x86/MSR: Move native_* variants to msr.h
Borislav Petkov
maintainerPATCH 1/1 x86/MSR: Move native_* variants to msr.h
From: Borislav Petkov <[email protected]>
... where they belong.
No functionality change.
Signed-off-by Borislav Petkov <[email protected]>
--- arch/x86/include/asm/microcode.h | 14 -------------- arch/x86/include/asm/msr.h | 14 ++++++++++++++ arch/x86/kvm/svm.c | 1 - arch/x86/kvm/vmx.c | 1 - 4 files changed, 14 insertions(+), 16 deletions(-)
arch/x86/include/asm/microcode.h +0 -14
@@ -6,20 +6,6 @@#include <linux/earlycpio.h> #include <linux/initrd.h> -#define native_rdmsr (msr, val1, val2) \ -do { \ - u64 __val = __rdmsr((msr)); \ - (void)((val1) = (u32)__val); \ - (void)((val2) = (u32)(__val >> 32)); \ -} while (0) - -#define native_wrmsr (msr, low, high) \ - __wrmsr(msr, low, high) - -#define native_wrmsrl (msr, val) \ - __wrmsr((msr), (u32)((u64)(val)), \ - (u32)((u64)(val) >> 32)) -struct ucode_patch {struct list_head plist;void *data;/* Intel uses only this one */
arch/x86/include/asm/msr.h +14 -0
@@ -108,6 +108,20 @@ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) : : "c" (msr), "a"(low), "d" (high) : "memory"); } +#define native_rdmsr (msr, val1, val2) \ +do { \ + u64 __val = __rdmsr((msr)); \ + (void)((val1) = (u32)__val); \ + (void)((val2) = (u32)(__val >> 32)); \ +} while (0) + +#define native_wrmsr (msr, low, high) \ + __wrmsr(msr, low, high) + +#define native_wrmsrl (msr, val) \ + __wrmsr((msr), (u32)((u64)(val)), \ + (u32)((u64)(val) >> 32)) +static inline unsigned long long native_read_msr (unsigned int msr) {unsigned long long val;
arch/x86/kvm/svm.c +0 -1
@@ -49,7 +49,6 @@#include <asm/debugreg.h> #include <asm/kvm_para.h> #include <asm/irq_remapping.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include <asm/virtext.h>
arch/x86/kvm/vmx.c +0 -1
@@ -51,7 +51,6 @@#include <asm/apic.h> #include <asm/irq_remapping.h> #include <asm/mmu_context.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include "trace.h"
Signature · 1 line
2.13.0
Quoted 8 lines · Borislav Petkov
From: Borislav Petkov <[email protected]>
... where they belong.
No functionality change.
Signed-off-by Borislav Petkov <[email protected]>
Seems like the right place to put them.
Reviewed-by Darren Kenny <[email protected]>
Quoted 84 lines
---
arch/x86/include/asm/microcode.h | 14 -------------- arch/x86/include/asm/msr.h | 14 ++++++++++++++ arch/x86/kvm/svm.c | 1 - arch/x86/kvm/vmx.c | 1 - 4 files changed, 14 insertions(+), 16 deletions(-)arch/x86/include/asm/microcode.h +0
-14@@ -6,20 +6,6 @@#include <linux/earlycpio.h> #include <linux/initrd.h> -#define native_rdmsr (msr, val1, val2) \ -do { \ - u64 __val = __rdmsr((msr)); \ - (void)((val1) = (u32)__val); \ - (void)((val2) = (u32)(__val >> 32)); \ -} while (0) - -#define native_wrmsr (msr, low, high) \ - __wrmsr(msr, low, high) - -#define native_wrmsrl (msr, val) \ - __wrmsr((msr), (u32)((u64)(val)), \ - (u32)((u64)(val) >> 32)) -struct ucode_patch {struct list_head plist;void *data;/* Intel uses only this one */ arch/x86/include/asm/msr.h +14
-0@@ -108,6 +108,20 @@ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) : : "c" (msr), "a"(low), "d" (high) : "memory"); } +#define native_rdmsr (msr, val1, val2) \ +do { \ + u64 __val = __rdmsr((msr)); \ + (void)((val1) = (u32)__val); \ + (void)((val2) = (u32)(__val >> 32)); \ +} while (0) + +#define native_wrmsr (msr, low, high) \ + __wrmsr(msr, low, high) + +#define native_wrmsrl (msr, val) \ + __wrmsr((msr), (u32)((u64)(val)), \ + (u32)((u64)(val) >> 32)) +static inline unsigned long long native_read_msr (unsigned int msr) {unsigned long long val;arch/x86/kvm/svm.c +0
-1@@ -49,7 +49,6 @@#include <asm/debugreg.h> #include <asm/kvm_para.h> #include <asm/irq_remapping.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include <asm/virtext.h> arch/x86/kvm/vmx.c +0
-1@@ -51,7 +51,6 @@#include <asm/apic.h> #include <asm/irq_remapping.h> #include <asm/mmu_context.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include "trace.h" Signature · 1 line
2.13.0
tip-bot for Borislav Petkov
merge botx86/MSR: Move native_* variants to msr.h
Commit-ID: c996f3802006a585a6c3f8eaa73e375330efc0e7 Gitweb: https://git.kernel.org/tip/c996f3802006a585a6c3f8eaa73e375330efc0e7 Author: Borislav Petkov <[email protected]> AuthorDate: Thu, 1 Mar 2018 16:13:36 +0100 Committer: Thomas Gleixner <[email protected]> CommitDate: Thu, 8 Mar 2018 10:22:57 +0100
x86/MSR: Move native_* variants to msr.h
... where they belong.
No functional change.
Signed-off-by Borislav Petkov <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
Reviewed-by Darren Kenny <[email protected]>
--- arch/x86/include/asm/microcode.h | 14 -------------- arch/x86/include/asm/msr.h | 14 ++++++++++++++ arch/x86/kvm/svm.c | 1 - arch/x86/kvm/vmx.c | 1 - 4 files changed, 14 insertions(+), 16 deletions(-)
arch/x86/include/asm/microcode.h +0 -14
@@ -6,20 +6,6 @@#include <linux/earlycpio.h> #include <linux/initrd.h> -#define native_rdmsr (msr, val1, val2) \ -do { \ - u64 __val = __rdmsr((msr)); \ - (void)((val1) = (u32)__val); \ - (void)((val2) = (u32)(__val >> 32)); \ -} while (0) - -#define native_wrmsr (msr, low, high) \ - __wrmsr(msr, low, high) - -#define native_wrmsrl (msr, val) \ - __wrmsr((msr), (u32)((u64)(val)), \ - (u32)((u64)(val) >> 32)) -struct ucode_patch {struct list_head plist;void *data;/* Intel uses only this one */
arch/x86/include/asm/msr.h +14 -0
@@ -108,6 +108,20 @@ static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high) : : "c" (msr), "a"(low), "d" (high) : "memory"); } +#define native_rdmsr (msr, val1, val2) \ +do { \ + u64 __val = __rdmsr((msr)); \ + (void)((val1) = (u32)__val); \ + (void)((val2) = (u32)(__val >> 32)); \ +} while (0) + +#define native_wrmsr (msr, low, high) \ + __wrmsr(msr, low, high) + +#define native_wrmsrl (msr, val) \ + __wrmsr((msr), (u32)((u64)(val)), \ + (u32)((u64)(val) >> 32)) +static inline unsigned long long native_read_msr (unsigned int msr) {unsigned long long val;
arch/x86/kvm/svm.c +0 -1
@@ -49,7 +49,6 @@#include <asm/debugreg.h> #include <asm/kvm_para.h> #include <asm/irq_remapping.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include <asm/virtext.h>
arch/x86/kvm/vmx.c +0 -1
@@ -51,7 +51,6 @@#include <asm/apic.h> #include <asm/irq_remapping.h> #include <asm/mmu_context.h> -#include <asm/microcode.h> #include <asm/nospec-branch.h> #include "trace.h"