]> git.karo-electronics.de Git - linux-beck.git/commit
x86/asm: Rewrite sync_core() to use IRET-to-self
authorAndy Lutomirski <luto@kernel.org>
Fri, 9 Dec 2016 18:24:08 +0000 (10:24 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 Dec 2016 10:54:21 +0000 (11:54 +0100)
commitc198b121b1a1d7a7171770c634cd49191bac4477
treedf6c91eaccf56aff6af2d952e58c663a8dbb0dbd
parent484d0e5c7943644cc46e7308a8f9d83be598f2b9
x86/asm: Rewrite sync_core() to use IRET-to-self

Aside from being excessively slow, CPUID is problematic: Linux runs
on a handful of CPUs that don't have CPUID.  Use IRET-to-self
instead.  IRET-to-self works everywhere, so it makes testing easy.

For reference, On my laptop, IRET-to-self is ~110ns,
CPUID(eax=1, ecx=0) is ~83ns on native and very very slow under KVM,
and MOV-to-CR2 is ~42ns.

While we're at it: sync_core() serves a very specific purpose.
Document it.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Matthew Whitehead <tedheadster@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel <Xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/5c79f0225f68bc8c40335612bf624511abb78941.1481307769.git.luto@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/processor.h