summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/apm.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-03-12 12:10:03 +0100
committerIngo Molnar <mingo@kernel.org>2018-03-12 12:10:03 +0100
commit3c76db70eb70a0fbd40b3e0dec8f69ca344d1ff8 (patch)
treea9dd314ac18992cdc2c50d4de60535a1b76ee351 /arch/x86/include/asm/apm.h
parent194a9749c73d650c0b1dfdee04fb0bdf0a888ba8 (diff)
parent7958b2246fadf54b7ff820a2a5a2c5ca1554716f (diff)
downloadop-kernel-dev-3c76db70eb70a0fbd40b3e0dec8f69ca344d1ff8.zip
op-kernel-dev-3c76db70eb70a0fbd40b3e0dec8f69ca344d1ff8.tar.gz
Merge branch 'x86/pti' into x86/mm, to pick up dependencies
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/apm.h')
-rw-r--r--arch/x86/include/asm/apm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h
index 4d4015d..c356098 100644
--- a/arch/x86/include/asm/apm.h
+++ b/arch/x86/include/asm/apm.h
@@ -7,6 +7,8 @@
#ifndef _ASM_X86_MACH_DEFAULT_APM_H
#define _ASM_X86_MACH_DEFAULT_APM_H
+#include <asm/nospec-branch.h>
+
#ifdef APM_ZERO_SEGS
# define APM_DO_ZERO_SEGS \
"pushl %%ds\n\t" \
@@ -32,6 +34,7 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
* N.B. We do NOT need a cld after the BIOS call
* because we always save and restore the flags.
*/
+ firmware_restrict_branch_speculation_start();
__asm__ __volatile__(APM_DO_ZERO_SEGS
"pushl %%edi\n\t"
"pushl %%ebp\n\t"
@@ -44,6 +47,7 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in,
"=S" (*esi)
: "a" (func), "b" (ebx_in), "c" (ecx_in)
: "memory", "cc");
+ firmware_restrict_branch_speculation_end();
}
static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
@@ -56,6 +60,7 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
* N.B. We do NOT need a cld after the BIOS call
* because we always save and restore the flags.
*/
+ firmware_restrict_branch_speculation_start();
__asm__ __volatile__(APM_DO_ZERO_SEGS
"pushl %%edi\n\t"
"pushl %%ebp\n\t"
@@ -68,6 +73,7 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in,
"=S" (si)
: "a" (func), "b" (ebx_in), "c" (ecx_in)
: "memory", "cc");
+ firmware_restrict_branch_speculation_end();
return error;
}
OpenPOWER on IntegriCloud