All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
@ 2012-06-27 21:42 Prarit Bhargava
  2012-06-27 23:55 ` Prarit Bhargava
  2012-06-28  1:24 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 5+ messages in thread
From: Prarit Bhargava @ 2012-06-27 21:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Prarit Bhargava, Avi Kivity, Gleb Natapov, Alex Williamson

While debugging I noticed that unlike all the other hypervisor code in the
kernel, kvm does not have an entry for x86_hyper which is used in
detect_hypervisor_platform(), and results in a nice message about the
hypervisor being used.  This is only really a stub function and it makes
kvm more consistent with the other hypervisors (and it makes debugging
a little easier).

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
---
 arch/x86/include/asm/hypervisor.h |    1 +
 arch/x86/kernel/cpu/hypervisor.c  |    1 +
 arch/x86/kernel/kvm.c             |    6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 7a15153..b518c75 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -49,6 +49,7 @@ extern const struct hypervisor_x86 *x86_hyper;
 extern const struct hypervisor_x86 x86_hyper_vmware;
 extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
 extern const struct hypervisor_x86 x86_hyper_xen_hvm;
+extern const struct hypervisor_x86 x86_hyper_kvm;
 
 static inline bool hypervisor_x2apic_available(void)
 {
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 755f64f..6d6dd7a 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
 #endif
 	&x86_hyper_vmware,
 	&x86_hyper_ms_hyperv,
+	&x86_hyper_kvm,
 };
 
 const struct hypervisor_x86 *x86_hyper;
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index e554e5a..0a38b68 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -39,6 +39,7 @@
 #include <asm/desc.h>
 #include <asm/tlbflush.h>
 #include <asm/idle.h>
+#include <asm/hypervisor.h>
 
 static int kvmapf = 1;
 
@@ -432,6 +433,11 @@ void __init kvm_guest_init(void)
 #endif
 }
 
+const struct hypervisor_x86 x86_hyper_kvm __refconst = {
+	.name			= "KVM",
+};
+EXPORT_SYMBOL(x86_hyper_kvm);
+
 static __init int activate_jump_labels(void)
 {
 	if (has_steal_clock) {
-- 
1.7.9.3


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

* Re: [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
  2012-06-27 21:42 [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check Prarit Bhargava
@ 2012-06-27 23:55 ` Prarit Bhargava
  2012-06-28  1:24 ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 5+ messages in thread
From: Prarit Bhargava @ 2012-06-27 23:55 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, Avi Kivity, Gleb Natapov, Alex Williamson



On 06/27/2012 05:42 PM, Prarit Bhargava wrote:
> While debugging I noticed that unlike all the other hypervisor code in the
> kernel, kvm does not have an entry for x86_hyper which is used in
> detect_hypervisor_platform(), and results in a nice message about the
> hypervisor being used.  This is only really a stub function and it makes
> kvm more consistent with the other hypervisors (and it makes debugging
> a little easier).
> 
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>

Self - nak this ... new patch coming.  Sorry for the noise.

P.

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

* Re: [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
  2012-06-27 21:42 [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check Prarit Bhargava
  2012-06-27 23:55 ` Prarit Bhargava
@ 2012-06-28  1:24 ` Konrad Rzeszutek Wilk
  2012-06-28 11:11   ` Prarit Bhargava
  1 sibling, 1 reply; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-06-28  1:24 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, Avi Kivity, Gleb Natapov, Alex Williamson

On Wed, Jun 27, 2012 at 05:42:18PM -0400, Prarit Bhargava wrote:
> While debugging I noticed that unlike all the other hypervisor code in the
> kernel, kvm does not have an entry for x86_hyper which is used in
> detect_hypervisor_platform(), and results in a nice message about the
> hypervisor being used.  This is only really a stub function and it makes
> kvm more consistent with the other hypervisors (and it makes debugging
> a little easier).
> 
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Gleb Natapov <gleb@redhat.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> ---
>  arch/x86/include/asm/hypervisor.h |    1 +
>  arch/x86/kernel/cpu/hypervisor.c  |    1 +
>  arch/x86/kernel/kvm.c             |    6 ++++++
>  3 files changed, 8 insertions(+)
> 
> diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
> index 7a15153..b518c75 100644
> --- a/arch/x86/include/asm/hypervisor.h
> +++ b/arch/x86/include/asm/hypervisor.h
> @@ -49,6 +49,7 @@ extern const struct hypervisor_x86 *x86_hyper;
>  extern const struct hypervisor_x86 x86_hyper_vmware;
>  extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
>  extern const struct hypervisor_x86 x86_hyper_xen_hvm;
> +extern const struct hypervisor_x86 x86_hyper_kvm;
>  
>  static inline bool hypervisor_x2apic_available(void)
>  {
> diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
> index 755f64f..6d6dd7a 100644
> --- a/arch/x86/kernel/cpu/hypervisor.c
> +++ b/arch/x86/kernel/cpu/hypervisor.c
> @@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
>  #endif
>  	&x86_hyper_vmware,
>  	&x86_hyper_ms_hyperv,
> +	&x86_hyper_kvm,
>  };
>  
>  const struct hypervisor_x86 *x86_hyper;
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index e554e5a..0a38b68 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -39,6 +39,7 @@
>  #include <asm/desc.h>
>  #include <asm/tlbflush.h>
>  #include <asm/idle.h>
> +#include <asm/hypervisor.h>
>  
>  static int kvmapf = 1;
>  
> @@ -432,6 +433,11 @@ void __init kvm_guest_init(void)
>  #endif
>  }
>  
> +const struct hypervisor_x86 x86_hyper_kvm __refconst = {
> +	.name			= "KVM",
> +};
> +EXPORT_SYMBOL(x86_hyper_kvm);

EXPORT_SYMBOL_GPL version. ?

> +
>  static __init int activate_jump_labels(void)
>  {
>  	if (has_steal_clock) {
> -- 
> 1.7.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
  2012-06-28  1:24 ` Konrad Rzeszutek Wilk
@ 2012-06-28 11:11   ` Prarit Bhargava
  2012-06-28 14:06     ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 5+ messages in thread
From: Prarit Bhargava @ 2012-06-28 11:11 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: linux-kernel, Avi Kivity, Gleb Natapov, Alex Williamson



On 06/27/2012 09:24 PM, Konrad Rzeszutek Wilk wrote:
> On Wed, Jun 27, 2012 at 05:42:18PM -0400, Prarit Bhargava wrote:
>> While debugging I noticed that unlike all the other hypervisor code in the
>> kernel, kvm does not have an entry for x86_hyper which is used in
>> detect_hypervisor_platform(), and results in a nice message about the
>> hypervisor being used.  This is only really a stub function and it makes
>> kvm more consistent with the other hypervisors (and it makes debugging
>> a little easier).
>>
>> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
>> Cc: Avi Kivity <avi@redhat.com>
>> Cc: Gleb Natapov <gleb@redhat.com>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> ---
>>  arch/x86/include/asm/hypervisor.h |    1 +
>>  arch/x86/kernel/cpu/hypervisor.c  |    1 +
>>  arch/x86/kernel/kvm.c             |    6 ++++++
>>  3 files changed, 8 insertions(+)
>>
>> diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
>> index 7a15153..b518c75 100644
>> --- a/arch/x86/include/asm/hypervisor.h
>> +++ b/arch/x86/include/asm/hypervisor.h
>> @@ -49,6 +49,7 @@ extern const struct hypervisor_x86 *x86_hyper;
>>  extern const struct hypervisor_x86 x86_hyper_vmware;
>>  extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
>>  extern const struct hypervisor_x86 x86_hyper_xen_hvm;
>> +extern const struct hypervisor_x86 x86_hyper_kvm;
>>  
>>  static inline bool hypervisor_x2apic_available(void)
>>  {
>> diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
>> index 755f64f..6d6dd7a 100644
>> --- a/arch/x86/kernel/cpu/hypervisor.c
>> +++ b/arch/x86/kernel/cpu/hypervisor.c
>> @@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
>>  #endif
>>  	&x86_hyper_vmware,
>>  	&x86_hyper_ms_hyperv,
>> +	&x86_hyper_kvm,
>>  };
>>  
>>  const struct hypervisor_x86 *x86_hyper;
>> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
>> index e554e5a..0a38b68 100644
>> --- a/arch/x86/kernel/kvm.c
>> +++ b/arch/x86/kernel/kvm.c
>> @@ -39,6 +39,7 @@
>>  #include <asm/desc.h>
>>  #include <asm/tlbflush.h>
>>  #include <asm/idle.h>
>> +#include <asm/hypervisor.h>
>>  
>>  static int kvmapf = 1;
>>  
>> @@ -432,6 +433,11 @@ void __init kvm_guest_init(void)
>>  #endif
>>  }
>>  
>> +const struct hypervisor_x86 x86_hyper_kvm __refconst = {
>> +	.name			= "KVM",
>> +};
>> +EXPORT_SYMBOL(x86_hyper_kvm);
> 
> EXPORT_SYMBOL_GPL version. ?

Hey Konrad, thanks for the review.

The other hypervisor_x86 structs are only EXPORT_SYMBOL, so I maintained that
convention here.

If I'm mistaken in that assumption, please let me know.

Thanks again,

P.

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

* Re: [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
  2012-06-28 11:11   ` Prarit Bhargava
@ 2012-06-28 14:06     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-06-28 14:06 UTC (permalink / raw)
  To: Prarit Bhargava; +Cc: linux-kernel, Avi Kivity, Gleb Natapov, Alex Williamson

On Thu, Jun 28, 2012 at 07:11:31AM -0400, Prarit Bhargava wrote:
> 
> 
> On 06/27/2012 09:24 PM, Konrad Rzeszutek Wilk wrote:
> > On Wed, Jun 27, 2012 at 05:42:18PM -0400, Prarit Bhargava wrote:
> >> While debugging I noticed that unlike all the other hypervisor code in the
> >> kernel, kvm does not have an entry for x86_hyper which is used in
> >> detect_hypervisor_platform(), and results in a nice message about the
> >> hypervisor being used.  This is only really a stub function and it makes
> >> kvm more consistent with the other hypervisors (and it makes debugging
> >> a little easier).
> >>
> >> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> >> Cc: Avi Kivity <avi@redhat.com>
> >> Cc: Gleb Natapov <gleb@redhat.com>
> >> Cc: Alex Williamson <alex.williamson@redhat.com>
> >> ---
> >>  arch/x86/include/asm/hypervisor.h |    1 +
> >>  arch/x86/kernel/cpu/hypervisor.c  |    1 +
> >>  arch/x86/kernel/kvm.c             |    6 ++++++
> >>  3 files changed, 8 insertions(+)
> >>
> >> diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
> >> index 7a15153..b518c75 100644
> >> --- a/arch/x86/include/asm/hypervisor.h
> >> +++ b/arch/x86/include/asm/hypervisor.h
> >> @@ -49,6 +49,7 @@ extern const struct hypervisor_x86 *x86_hyper;
> >>  extern const struct hypervisor_x86 x86_hyper_vmware;
> >>  extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
> >>  extern const struct hypervisor_x86 x86_hyper_xen_hvm;
> >> +extern const struct hypervisor_x86 x86_hyper_kvm;
> >>  
> >>  static inline bool hypervisor_x2apic_available(void)
> >>  {
> >> diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
> >> index 755f64f..6d6dd7a 100644
> >> --- a/arch/x86/kernel/cpu/hypervisor.c
> >> +++ b/arch/x86/kernel/cpu/hypervisor.c
> >> @@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
> >>  #endif
> >>  	&x86_hyper_vmware,
> >>  	&x86_hyper_ms_hyperv,
> >> +	&x86_hyper_kvm,
> >>  };
> >>  
> >>  const struct hypervisor_x86 *x86_hyper;
> >> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> >> index e554e5a..0a38b68 100644
> >> --- a/arch/x86/kernel/kvm.c
> >> +++ b/arch/x86/kernel/kvm.c
> >> @@ -39,6 +39,7 @@
> >>  #include <asm/desc.h>
> >>  #include <asm/tlbflush.h>
> >>  #include <asm/idle.h>
> >> +#include <asm/hypervisor.h>
> >>  
> >>  static int kvmapf = 1;
> >>  
> >> @@ -432,6 +433,11 @@ void __init kvm_guest_init(void)
> >>  #endif
> >>  }
> >>  
> >> +const struct hypervisor_x86 x86_hyper_kvm __refconst = {
> >> +	.name			= "KVM",
> >> +};
> >> +EXPORT_SYMBOL(x86_hyper_kvm);
> > 
> > EXPORT_SYMBOL_GPL version. ?
> 
> Hey Konrad, thanks for the review.

Sure thing.
> 
> The other hypervisor_x86 structs are only EXPORT_SYMBOL, so I maintained that
> convention here.

Go for _GPL. Not sure why they were the non-GPL version but there is no need
for non-GPL version.

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

end of thread, other threads:[~2012-06-28 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 21:42 [PATCH] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check Prarit Bhargava
2012-06-27 23:55 ` Prarit Bhargava
2012-06-28  1:24 ` Konrad Rzeszutek Wilk
2012-06-28 11:11   ` Prarit Bhargava
2012-06-28 14:06     ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.