Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 pti fixes from Thomas Gleixner:
"Two small updates for the speculative distractions:

- Make it more clear to the compiler that array_index_mask_nospec()
is not subject for optimizations. It's not perfect, but ...

- Don't report XEN PV guests as vulnerable because their mitigation
state depends on the hypervisor. Report unknown and refer to the
hypervisor requirement"

* 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/spectre_v1: Disable compiler optimizations over array_index_mask_nospec()
x86/pti: Don't report XenPV as vulnerable

+5 -1
+1 -1
arch/x86/include/asm/barrier.h
··· 38 38 { 39 39 unsigned long mask; 40 40 41 - asm ("cmp %1,%2; sbb %0,%0;" 41 + asm volatile ("cmp %1,%2; sbb %0,%0;" 42 42 :"=r" (mask) 43 43 :"g"(size),"r" (index) 44 44 :"cc");
+4
arch/x86/kernel/cpu/bugs.c
··· 27 27 #include <asm/pgtable.h> 28 28 #include <asm/set_memory.h> 29 29 #include <asm/intel-family.h> 30 + #include <asm/hypervisor.h> 30 31 31 32 static void __init spectre_v2_select_mitigation(void); 32 33 static void __init ssb_select_mitigation(void); ··· 664 663 case X86_BUG_CPU_MELTDOWN: 665 664 if (boot_cpu_has(X86_FEATURE_PTI)) 666 665 return sprintf(buf, "Mitigation: PTI\n"); 666 + 667 + if (hypervisor_is_type(X86_HYPER_XEN_PV)) 668 + return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n"); 667 669 668 670 break; 669 671