Re: [tip:x86/pti] Revert "x86/speculation: Simplify indirect_branch_prediction_barrier()"

From: Peter Zijlstra
Date: Tue Feb 13 2018 - 08:28:39 EST


On Tue, Feb 13, 2018 at 12:28:38PM +0100, Ingo Molnar wrote:

> Separate would be better, it makes sense and is one problem less to worry about?

Something like so then? I'm not entirely sure which commit wants to fo
in Fixes, I picked the earlier one, but it could equally have been:

Fixes: f208820a321f ("Revert "x86/speculation: Simplify indirect_branch_prediction_barrier()"")

---
Subject: x86/speculation: Add msr-index.h
From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Date: Tue, 13 Feb 2018 10:41:32 +0100

Joe Konno reported a compile failure resulting from using an MSR
without inclusion of msr-index.h, and while the current code builds
fine (by accident) this needs fixing for future patches.

Cc: mingo@xxxxxxxxxx
Cc: dwmw2@xxxxxxxxxxxxx
Cc: torvalds@xxxxxxxxxxxxxxxxxxxx
Cc: bp@xxxxxxxxx
Cc: tglx@xxxxxxxxxxxxx
Cc: arjan@xxxxxxxxxxxxxxx
Cc: dan.j.williams@xxxxxxxxx
Cc: dave.hansen@xxxxxxxxxxxxxxx
Cc: jpoimboe@xxxxxxxxxx
Cc: hpa@xxxxxxxxx
Cc: gregkh@xxxxxxxxxxxxxxxxxxx
Cc: dwmw@xxxxxxxxxxxx
Cc: luto@xxxxxxxxxx
Fixes: 20ffa1caecca ("x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support")
Reported-by: Joe Konno <joe.konno@xxxxxxxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
---
arch/x86/include/asm/nospec-branch.h | 1 +
1 file changed, 1 insertion(+)

--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -6,6 +6,7 @@
#include <asm/alternative.h>
#include <asm/alternative-asm.h>
#include <asm/cpufeatures.h>
+#include <asm/msr-index.h>

#ifdef __ASSEMBLY__