]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
x86/microcode: Convert to bare minimum MSR accessors
authorBorislav Petkov <bp@suse.de>
Fri, 20 Jan 2017 20:29:42 +0000 (21:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 23 Jan 2017 09:02:45 +0000 (10:02 +0100)
Having tracepoints to the MSR accessors makes them unsuitable for early
microcode loading: think 32-bit before paging is enabled and us chasing
pointers to test whether a tracepoint is enabled or not. Results in a
reliable triple fault.

Convert to the bare ones.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/20170120202955.4091-4-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/microcode.h

index 38711df3bcb56b6939f2f84af16b920f0409049b..90b22bbdfce97f46e5631119e8cf34f706daf9fd 100644 (file)
@@ -7,18 +7,17 @@
 
 #define native_rdmsr(msr, val1, val2)                  \
 do {                                                   \
-       u64 __val = native_read_msr((msr));             \
+       u64 __val = __rdmsr((msr));                     \
        (void)((val1) = (u32)__val);                    \
        (void)((val2) = (u32)(__val >> 32));            \
 } while (0)
 
 #define native_wrmsr(msr, low, high)                   \
-       native_write_msr(msr, low, high)
+       __wrmsr(msr, low, high)
 
 #define native_wrmsrl(msr, val)                                \
-       native_write_msr((msr),                         \
-                        (u32)((u64)(val)),             \
-                        (u32)((u64)(val) >> 32))
+       __wrmsr((msr), (u32)((u64)(val)),               \
+                      (u32)((u64)(val) >> 32))
 
 struct ucode_patch {
        struct list_head plist;