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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Oct 2016, Andy Lutomirski wrote:
> On Thu, Oct 27, 2016 at 4:15 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> Let's just do this right from day one:
> 
> static void set_cpuid_faulting(bool on)
> {
>   u64 msrval;
> 
>   DEBUG_LOCKS_WARN_ON(!irqs_disabled());
> 
>   msrval = this_cpu_read(msr_misc_features_enables_shadow);
>   msrval &= CPUID_FAULT_ENABLE;
>   msrval |= (on << CPUID_FAULT_ENABLE_BIT);
>   this_cpu_write(msr_misc_features_enables_shadow, msrval);
>   wrmsrl(MSR_MISC_FEATURES_ENABLES, msrval);
> }
> 
> RDMSR may be considerably faster than WRMSR, but that doesn't mean it's *fast*.

Good point!
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux