Commit d0ace2ce authored by Stefan Bader's avatar Stefan Bader Committed by Juerg Haefliger

UBUNTU: SAUCE: x86: Add alternative_msr_write

CVE-2018-3639 (x86)

This is a partial backport of dd84441a
  "x86/speculation: Use IBRS if available before calling into firmware"
as later patches rely on the call.
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
parent cb71f84f
......@@ -217,6 +217,16 @@ static inline void vmexit_fill_RSB(void)
#endif
}
#define alternative_msr_write(_msr, _val, _feature) \
asm volatile(ALTERNATIVE("", \
"movl %[msr], %%ecx\n\t" \
"movl %[val], %%eax\n\t" \
"movl $0, %%edx\n\t" \
"wrmsr", \
_feature) \
: : [msr] "i" (_msr), [val] "i" (_val) \
: "eax", "ecx", "edx", "memory")
#endif /* __ASSEMBLY__ */
/*
......
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