From: Greg Kroah-Hartman Date: Tue, 13 Mar 2018 07:39:01 +0000 (+0100) Subject: 4.15-stable patches X-Git-Tag: v4.14.27~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e80e30d7c5706407d973692225766e857c021a15;p=thirdparty%2Fkernel%2Fstable-queue.git 4.15-stable patches added patches: x86-speculation-move-firmware_restrict_branch_speculation_-from-c-to-cpp.patch --- diff --git a/queue-4.15/series b/queue-4.15/series index 9b2ffcc7da7..5612a599c92 100644 --- a/queue-4.15/series +++ b/queue-4.15/series @@ -90,6 +90,7 @@ revert-x86-retpoline-simplify-vmexit_fill_rsb.patch x86-speculation-use-ibrs-if-available-before-calling-into-firmware.patch x86-retpoline-support-retpoline-builds-with-clang.patch x86-speculation-objtool-annotate-indirect-calls-jumps-for-objtool.patch +x86-speculation-move-firmware_restrict_branch_speculation_-from-c-to-cpp.patch x86-paravirt-objtool-annotate-indirect-calls.patch x86-boot-objtool-annotate-indirect-jump-in-secondary_startup_64.patch x86-mm-sme-objtool-annotate-indirect-call-in-sme_encrypt_execute.patch diff --git a/queue-4.15/x86-speculation-move-firmware_restrict_branch_speculation_-from-c-to-cpp.patch b/queue-4.15/x86-speculation-move-firmware_restrict_branch_speculation_-from-c-to-cpp.patch new file mode 100644 index 00000000000..89e53c40d83 --- /dev/null +++ b/queue-4.15/x86-speculation-move-firmware_restrict_branch_speculation_-from-c-to-cpp.patch @@ -0,0 +1,73 @@ +From d72f4e29e6d84b7ec02ae93088aa459ac70e733b Mon Sep 17 00:00:00 2001 +From: Ingo Molnar +Date: Wed, 21 Feb 2018 09:20:37 +0100 +Subject: x86/speculation: Move firmware_restrict_branch_speculation_*() from C to CPP + +From: Ingo Molnar + +commit d72f4e29e6d84b7ec02ae93088aa459ac70e733b upstream. + +firmware_restrict_branch_speculation_*() recently started using +preempt_enable()/disable(), but those are relatively high level +primitives and cause build failures on some 32-bit builds. + +Since we want to keep low level, convert +them to macros to avoid header hell... + +Cc: David Woodhouse +Cc: Thomas Gleixner +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: arjan.van.de.ven@intel.com +Cc: bp@alien8.de +Cc: dave.hansen@intel.com +Cc: jmattson@google.com +Cc: karahmed@amazon.de +Cc: kvm@vger.kernel.org +Cc: pbonzini@redhat.com +Cc: rkrcmar@redhat.com +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/nospec-branch.h | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +--- a/arch/x86/include/asm/nospec-branch.h ++++ b/arch/x86/include/asm/nospec-branch.h +@@ -257,20 +257,22 @@ static inline void indirect_branch_predi + /* + * With retpoline, we must use IBRS to restrict branch prediction + * before calling into firmware. ++ * ++ * (Implemented as CPP macros due to header hell.) + */ +-static inline void firmware_restrict_branch_speculation_start(void) +-{ +- preempt_disable(); +- alternative_msr_write(MSR_IA32_SPEC_CTRL, SPEC_CTRL_IBRS, +- X86_FEATURE_USE_IBRS_FW); +-} ++#define firmware_restrict_branch_speculation_start() \ ++do { \ ++ preempt_disable(); \ ++ alternative_msr_write(MSR_IA32_SPEC_CTRL, SPEC_CTRL_IBRS, \ ++ X86_FEATURE_USE_IBRS_FW); \ ++} while (0) + +-static inline void firmware_restrict_branch_speculation_end(void) +-{ +- alternative_msr_write(MSR_IA32_SPEC_CTRL, 0, +- X86_FEATURE_USE_IBRS_FW); +- preempt_enable(); +-} ++#define firmware_restrict_branch_speculation_end() \ ++do { \ ++ alternative_msr_write(MSR_IA32_SPEC_CTRL, 0, \ ++ X86_FEATURE_USE_IBRS_FW); \ ++ preempt_enable(); \ ++} while (0) + + #endif /* __ASSEMBLY__ */ +