linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/MSR: Move native_* variants to msr.h
@ 2018-03-01 15:13 Borislav Petkov
  2018-03-02 12:01 ` Darren Kenny
  2018-03-08  9:30 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2018-03-01 15:13 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, kvm

From: Borislav Petkov <bp@suse.de>

... where they belong.

No functionality change.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: kvm@vger.kernel.org
---
 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(-)

diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 7fb1047d61c7..871714e2e4c6 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -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 */
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 30df295f6d94..77254c9c8f61 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -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;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index cbd7ab74952e..c6dde6f1d848 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -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>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cab6ea1f8be5..5f708478b66e 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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"
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/MSR: Move native_* variants to msr.h
  2018-03-01 15:13 [PATCH] x86/MSR: Move native_* variants to msr.h Borislav Petkov
@ 2018-03-02 12:01 ` Darren Kenny
  2018-03-08  9:30 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Darren Kenny @ 2018-03-02 12:01 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, LKML, kvm

On Thu, Mar 01, 2018 at 04:13:36PM +0100, Borislav Petkov wrote:
>From: Borislav Petkov <bp@suse.de>
>
>... where they belong.
>
>No functionality change.
>
>Signed-off-by: Borislav Petkov <bp@suse.de>
>Cc: kvm@vger.kernel.org

Seems like the right place to put them.

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>

>---
> 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(-)
>
>diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
>index 7fb1047d61c7..871714e2e4c6 100644
>--- a/arch/x86/include/asm/microcode.h
>+++ b/arch/x86/include/asm/microcode.h
>@@ -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 */
>diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
>index 30df295f6d94..77254c9c8f61 100644
>--- a/arch/x86/include/asm/msr.h
>+++ b/arch/x86/include/asm/msr.h
>@@ -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;
>diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
>index cbd7ab74952e..c6dde6f1d848 100644
>--- a/arch/x86/kvm/svm.c
>+++ b/arch/x86/kvm/svm.c
>@@ -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>
>diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>index cab6ea1f8be5..5f708478b66e 100644
>--- a/arch/x86/kvm/vmx.c
>+++ b/arch/x86/kvm/vmx.c
>@@ -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"
>-- 
>2.13.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/cleanups] x86/MSR: Move native_* variants to msr.h
  2018-03-01 15:13 [PATCH] x86/MSR: Move native_* variants to msr.h Borislav Petkov
  2018-03-02 12:01 ` Darren Kenny
@ 2018-03-08  9:30 ` tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Borislav Petkov @ 2018-03-08  9:30 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, bp, darren.kenny, mingo, linux-kernel, tglx

Commit-ID:  c996f3802006a585a6c3f8eaa73e375330efc0e7
Gitweb:     https://git.kernel.org/tip/c996f3802006a585a6c3f8eaa73e375330efc0e7
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Thu, 1 Mar 2018 16:13:36 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
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 <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Cc: kvm@vger.kernel.org
Link: https://lkml.kernel.org/r/20180301151336.12948-1-bp@alien8.de

---
 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(-)

diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index 7fb1047d61c7..871714e2e4c6 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -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 */
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 30df295f6d94..77254c9c8f61 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -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;
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index be9c839e2c89..9d2043f94e29 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -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>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 051dab74e4e9..ee5ed44bc284 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-08  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 15:13 [PATCH] x86/MSR: Move native_* variants to msr.h Borislav Petkov
2018-03-02 12:01 ` Darren Kenny
2018-03-08  9:30 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).