Commit af8c4be1 authored by Tim Chen's avatar Tim Chen Committed by Khalid Elmously

x86/mm: Set IBPB upon context switch

CVE-2017-5715 (Spectre v2 Intel)

Set IBPB on context switch with changing of page table.
Signed-off-by: default avatarTim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
(backported from commit 172351a2ae2c03d501e1d5933b8f50f6cd459186)
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 4575a1b0
......@@ -14,6 +14,7 @@
#include <asm/apic.h>
#include <asm/uv/uv.h>
#include <asm/kaiser.h>
#include <asm/microcode.h>
/*
* Smarter SMP flushing macros.
......@@ -139,6 +140,9 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
/* Stop flush ipis for the previous mm */
cpumask_clear_cpu(cpu, mm_cpumask(prev));
if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
/* Load per-mm CR4 state */
load_mm_cr4(next);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment