lkml.org 
[lkml]   [2016]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.
On Sep 11, 2016 5:29 PM, "Kyle Huey" <me@kylehuey.com> wrote:
>
> rr (http://rr-project.org/), a userspace record-and-replay reverse-
> execution debugger, would like to trap and emulate the CPUID instruction.
> This would allow us to a) mask away certain hardware features that rr does
> not support (e.g. RDRAND) and b) enable trace portability across machines
> by providing constant results.
>
> Intel supports faulting on the CPUID instruction in newer processors. Bit
> 31 of MSR_PLATFORM_INFO advertises support for this feature. It is
> documented in detail in Section 2.3.2 of
> http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf.
>

This should have a cpufeature bit and show up in /proc/cpuinfo. That
should be its own patch. You should explicitly check that, if the
feature is set under Xen PV, then the MSR actually works as
advertised. This may require talking to the Xen folks to make sure
you're testing the right configuration.

There should be a selftest.

The behavior on fork() should be defined, and that behavior should be
tested by the selftest.

If this bit is preserved on fork(), then no_new_privs must be checked
(or it must be cleared on "unsafe" exec, but that's nasty).

--Andy

\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.188 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site