1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Tim Chen <tim.c.chen@linux.intel.com>
3 Date: Fri, 20 Oct 2017 12:56:29 -0700
4 Subject: [PATCH] x86/mm: Set IBPB upon context switch
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
12 Set IBPB on context switch with changing of page table.
14 Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
15 Signed-off-by: Andy Whitcroft <apw@canonical.com>
16 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
17 (cherry picked from commit a3320203792b633fb96df5d0bbfb7036129b78e2)
18 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 arch/x86/mm/tlb.c | 4 ++++
21 1 file changed, 4 insertions(+)
23 diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
24 index 06f3854d0a4f..bb3ded3a4e5f 100644
25 --- a/arch/x86/mm/tlb.c
26 +++ b/arch/x86/mm/tlb.c
28 #include <asm/cache.h>
30 #include <asm/uv/uv.h>
31 +#include <asm/microcode.h>
32 #include <linux/debugfs.h>
35 @@ -218,6 +219,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
39 + if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
40 + native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
42 if (IS_ENABLED(CONFIG_VMAP_STACK)) {
44 * If our current stack is in vmalloc space and isn't