[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1610280038260.4913@nanos>
Date: Fri, 28 Oct 2016 00:38:54 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Andy Lutomirski <luto@...capital.net>
cc: Kyle Huey <me@...ehuey.com>,
Robert O'Callahan <robert@...llahan.org>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...e.de>,
Dmitry Safonov <dsafonov@...tuozzo.com>,
Peter Zijlstra <peterz@...radead.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Shuah Khan <shuah@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Len Brown <len.brown@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"user-mode-linux-devel@...ts.sourceforge.net"
<user-mode-linux-devel@...ts.sourceforge.net>,
"open list:USER-MODE LINUX (UML)"
<user-mode-linux-user@...ts.sourceforge.net>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>
Subject: Re: [PATCH v7 6/6] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID
On Thu, 27 Oct 2016, Andy Lutomirski wrote:
> On Thu, Oct 27, 2016 at 4:15 AM, Thomas Gleixner <tglx@...utronix.de> 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!
Powered by blists - more mailing lists