Re: [PATCH v13 6/8] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-28 Thread Kyle Huey
On Mon, Nov 28, 2016 at 6:06 AM, Thomas Gleixner wrote: > On Sun, 27 Nov 2016, Kyle Huey wrote: >> +DEFINE_PER_CPU(u64, msr_misc_features_shadow); >> + >> +static void set_cpuid_faulting(bool on) >> +{ >> + u64 msrval; >> + >> + DEBUG_LOCKS_WARN_ON(!irqs_disabled()); > > The arch_prctl cod

Re: [PATCH v13 6/8] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-28 Thread Thomas Gleixner
On Sun, 27 Nov 2016, Kyle Huey wrote: > +DEFINE_PER_CPU(u64, msr_misc_features_shadow); > + > +static void set_cpuid_faulting(bool on) > +{ > + u64 msrval; > + > + DEBUG_LOCKS_WARN_ON(!irqs_disabled()); The arch_prctl code path does not have interrupts disabled and there is no reason why i

[PATCH v13 6/8] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-27 Thread Kyle Huey
Intel supports faulting on the CPUID instruction beginning with Ivy Bridge. When enabled, the processor will fault on attempts to execute the CPUID instruction with CPL>0. Exposing this feature to userspace will allow a ptracer to trap and emulate the CPUID instruction. When supported, this featur