linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/cpu: Move prototype for get_umwait_control_msr() to global location
@ 2020-01-23 14:01 Benjamin Thiel
  2020-01-23 15:32 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Thiel @ 2020-01-23 14:01 UTC (permalink / raw)
  To: X86 ML; +Cc: kvm, LKML, Benjamin Thiel

.. in order to fix a -Wmissing-prototype warning.

No functional change.

Signed-off-by: Benjamin Thiel <b.thiel@posteo.de>
---
 arch/x86/include/asm/mwait.h | 2 ++
 arch/x86/kernel/cpu/umwait.c | 1 +
 arch/x86/kvm/vmx/vmx.c       | 1 +
 arch/x86/kvm/vmx/vmx.h       | 2 --
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index 9d5252c9685c..83b296ffc85a 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -23,6 +23,8 @@
 #define MWAITX_MAX_LOOPS		((u32)-1)
 #define MWAITX_DISABLE_CSTATES		0xf0
 
+extern u32 get_umwait_control_msr(void);
+
 static inline void __monitor(const void *eax, unsigned long ecx,
 			     unsigned long edx)
 {
diff --git a/arch/x86/kernel/cpu/umwait.c b/arch/x86/kernel/cpu/umwait.c
index c222f283b456..300e3fd5ade3 100644
--- a/arch/x86/kernel/cpu/umwait.c
+++ b/arch/x86/kernel/cpu/umwait.c
@@ -4,6 +4,7 @@
 #include <linux/cpu.h>
 
 #include <asm/msr.h>
+#include <asm/mwait.h>
 
 #define UMWAIT_C02_ENABLE	0
 
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e3394c839dea..25ddfd3d6bb0 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -44,6 +44,7 @@
 #include <asm/spec-ctrl.h>
 #include <asm/virtext.h>
 #include <asm/vmx.h>
+#include <asm/mwait.h>
 
 #include "capabilities.h"
 #include "cpuid.h"
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
index a4f7f737c5d4..db947076bf68 100644
--- a/arch/x86/kvm/vmx/vmx.h
+++ b/arch/x86/kvm/vmx/vmx.h
@@ -14,8 +14,6 @@
 extern const u32 vmx_msr_index[];
 extern u64 host_efer;
 
-extern u32 get_umwait_control_msr(void);
-
 #define MSR_TYPE_R	1
 #define MSR_TYPE_W	2
 #define MSR_TYPE_RW	3
-- 
2.17.1


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

* Re: [PATCH] x86/cpu: Move prototype for get_umwait_control_msr() to global location
  2020-01-23 14:01 [PATCH] x86/cpu: Move prototype for get_umwait_control_msr() to global location Benjamin Thiel
@ 2020-01-23 15:32 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2020-01-23 15:32 UTC (permalink / raw)
  To: Benjamin Thiel; +Cc: X86 ML, kvm, LKML

On Thu, Jan 23, 2020 at 03:01:13PM +0100, Benjamin Thiel wrote:
> .. in order to fix a -Wmissing-prototype warning.
> 
> No functional change.
> 
> Signed-off-by: Benjamin Thiel <b.thiel@posteo.de>
> ---
>  arch/x86/include/asm/mwait.h | 2 ++
>  arch/x86/kernel/cpu/umwait.c | 1 +
>  arch/x86/kvm/vmx/vmx.c       | 1 +
>  arch/x86/kvm/vmx/vmx.h       | 2 --
>  4 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
> index 9d5252c9685c..83b296ffc85a 100644
> --- a/arch/x86/include/asm/mwait.h
> +++ b/arch/x86/include/asm/mwait.h
> @@ -23,6 +23,8 @@
>  #define MWAITX_MAX_LOOPS		((u32)-1)
>  #define MWAITX_DISABLE_CSTATES		0xf0
>  
> +extern u32 get_umwait_control_msr(void);

Nit: extern isn't needed on function declarations.  It shouldn't have been
added in the VMX code, but I'm guessing the author saw the externs on the
vmx_msr_index and host_efer variables and followed suite.  Since there is
no existing precedent in mwait.h, now would be a good time to drop it.

> +
>  static inline void __monitor(const void *eax, unsigned long ecx,
>  			     unsigned long edx)
>  {
> diff --git a/arch/x86/kernel/cpu/umwait.c b/arch/x86/kernel/cpu/umwait.c
> index c222f283b456..300e3fd5ade3 100644
> --- a/arch/x86/kernel/cpu/umwait.c
> +++ b/arch/x86/kernel/cpu/umwait.c
> @@ -4,6 +4,7 @@
>  #include <linux/cpu.h>
>  
>  #include <asm/msr.h>
> +#include <asm/mwait.h>
>  
>  #define UMWAIT_C02_ENABLE	0
>  
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index e3394c839dea..25ddfd3d6bb0 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -44,6 +44,7 @@
>  #include <asm/spec-ctrl.h>
>  #include <asm/virtext.h>
>  #include <asm/vmx.h>
> +#include <asm/mwait.h>

Please maintain the alphabetical ordering of these includes.

>  
>  #include "capabilities.h"
>  #include "cpuid.h"
> diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
> index a4f7f737c5d4..db947076bf68 100644
> --- a/arch/x86/kvm/vmx/vmx.h
> +++ b/arch/x86/kvm/vmx/vmx.h
> @@ -14,8 +14,6 @@
>  extern const u32 vmx_msr_index[];
>  extern u64 host_efer;
>  
> -extern u32 get_umwait_control_msr(void);
> -
>  #define MSR_TYPE_R	1
>  #define MSR_TYPE_W	2
>  #define MSR_TYPE_RW	3
> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2020-01-23 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 14:01 [PATCH] x86/cpu: Move prototype for get_umwait_control_msr() to global location Benjamin Thiel
2020-01-23 15:32 ` Sean Christopherson

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