Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513037

[PATCH v8 0/7] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

From Kyle Huey <me@kylehuey.com>
Newsgroups linux.kernel
Subject [PATCH v8 0/7] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction
Date 2016-11-01 02:40 +0100
Message-ID <sywdr-1Rv-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Newer Intel CPUs (Ivy Bridge and later) can fault when CPUID is executed at
CPL > 0. Expose this capability to userspace as a new pair of arch_prctls,
ARCH_GET_CPUID and ARCH_SET_CPUID, with two values, ARCH_CPUID_ENABLE and
ARCH_CPUID_SIGSEGV.

Since v7:
Patch 5:
- Applied and tested Thomas's review comments re: generic MSR testing code.

Patch 6:
- arch_prctl now returns ENODEV for ARCH_[GET|SET]_CPUID if the feature
  is not supported by the hardware. The selftest has been updated for this.
- Applied and tested review comments from Thomas and Andy re: context
  switching performance.

Added patch 7, implementing KVM support for virtualizing cpuid faulting.
One thing to note is that this exposes this Intel-only feature to VMs
running on both Intel and AMD CPUs. A Linux guest kernel with these patches
will not take advantage of this on an AMD CPU though, because the feature
detection code inside Linux is in an Intel-specific codepath.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v8 0/7] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Kyle Huey <me@kylehuey.com> - 2016-11-01 02:40 +0100
  [PATCH v8 5/7] x86/cpufeature: Detect CPUID faulting support Kyle Huey <me@kylehuey.com> - 2016-11-01 02:40 +0100
  [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Kyle Huey <me@kylehuey.com> - 2016-11-01 02:40 +0100
    Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Paolo Bonzini <pbonzini@redhat.com> - 2016-11-01 15:30 +0100
      Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Thomas Gleixner <tglx@linutronix.de> - 2016-11-01 19:40 +0100
        Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Paolo Bonzini <pbonzini@redhat.com> - 2016-11-02 00:00 +0100
    Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting David Matlack <dmatlack@google.com> - 2016-11-04 21:40 +0100
      Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Paolo Bonzini <pbonzini@redhat.com> - 2016-11-04 23:00 +0100
        Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting David Matlack <dmatlack@google.com> - 2016-11-05 01:10 +0100
          Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Kyle Huey <me@kylehuey.com> - 2016-11-06 22:00 +0100
        Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Eduardo Habkost <ehabkost@redhat.com> - 2016-11-07 19:40 +0100
  [PATCH v8 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID Kyle Huey <me@kylehuey.com> - 2016-11-01 02:50 +0100
  [PATCH v8 1/7] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl Kyle Huey <me@kylehuey.com> - 2016-11-01 02:50 +0100
  [PATCH v8 3/7] x86/arch_prctl: Add do_arch_prctl_common Kyle Huey <me@kylehuey.com> - 2016-11-01 02:50 +0100
  [PATCH v8 4/7] x86/syscalls/32: Wire up arch_prctl on x86-32 Kyle Huey <me@kylehuey.com> - 2016-11-01 02:50 +0100
  [PATCH v8 2/7] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64 Kyle Huey <me@kylehuey.com> - 2016-11-01 02:50 +0100

csiph-web