From 7c96d4e6b1452af3c8a11a09cab9c7f488b73733 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 19 May 2017 11:01:42 +0100 Subject: [PATCH] xen/x86: Drop sync_core() As identified in Linux c/s c198b121b1a1d "x86/asm: Rewrite sync_core() to use IRET-to-self", sync_core() is only appropriate for two very specific usecases. Xen doesn't have need of either of these usecases, so drop sync_core() to avoid any misuse. In the unlikely event that we do gain a legitimate use for sync_core(), it should be reintroduced as a mov to %cr2 rather than cpuid, which has a lower overhead. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/include/asm-x86/processor.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 1d1a4ff2da..6a335d3a61 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -396,17 +396,6 @@ static inline bool_t read_pkru_wd(uint32_t pkru, unsigned int pkey) outb((data), 0x23); \ } while (0) -/* Stop speculative execution */ -static inline void sync_core(void) -{ - int tmp; - asm volatile ( - "cpuid" - : "=a" (tmp) - : "0" (1) - : "ebx","ecx","edx","memory" ); -} - static always_inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { -- 2.39.5