* [PATCH 0/2] hypervisor, update hypervisor_x86 entries for kvm and xen
@ 2012-07-05 13:11 Prarit Bhargava
2012-07-05 13:11 ` [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] Prarit Bhargava
2012-07-05 13:11 ` [PATCH 2/2] xen, fix x86_hyper_xen_hvm symbol export Prarit Bhargava
0 siblings, 2 replies; 8+ messages in thread
From: Prarit Bhargava @ 2012-07-05 13:11 UTC (permalink / raw)
To: linux-kernel; +Cc: Prarit Bhargava
In order to help with debugging, add a hypervisor_x86 for kvm, and properly
export the xen hypervisor_x86.
Prarit Bhargava (2):
kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check
[v2]
xen, fix x86_hyper_xen_hvm symbol export
arch/x86/include/asm/hypervisor.h | 1 +
arch/x86/kernel/cpu/hypervisor.c | 1 +
arch/x86/kernel/kvm.c | 14 ++++++++++++++
arch/x86/xen/enlighten.c | 2 +-
4 files changed, 17 insertions(+), 1 deletion(-)
--
1.7.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-05 13:11 [PATCH 0/2] hypervisor, update hypervisor_x86 entries for kvm and xen Prarit Bhargava @ 2012-07-05 13:11 ` Prarit Bhargava 2012-07-05 13:26 ` Avi Kivity 2012-07-05 13:11 ` [PATCH 2/2] xen, fix x86_hyper_xen_hvm symbol export Prarit Bhargava 1 sibling, 1 reply; 8+ messages in thread From: Prarit Bhargava @ 2012-07-05 13:11 UTC (permalink / raw) To: linux-kernel Cc: Prarit Bhargava, Avi Kivity, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk 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() which results in a nice printk in the syslog. This is only really a stub function but it does make kvm more consistent with the other hypervisors. [v2]: add detect and _GPL export 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> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- arch/x86/include/asm/hypervisor.h | 1 + arch/x86/kernel/cpu/hypervisor.c | 1 + arch/x86/kernel/kvm.c | 14 ++++++++++++++ 3 files changed, 16 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..865cd13 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,19 @@ void __init kvm_guest_init(void) #endif } +static bool __init kvm_detect(void) +{ + if (!kvm_para_available()) + return false; + return true; +} + +const struct hypervisor_x86 x86_hyper_kvm __refconst = { + .name = "KVM", + .detect = kvm_detect, +}; +EXPORT_SYMBOL_GPL(x86_hyper_kvm); + static __init int activate_jump_labels(void) { if (has_steal_clock) { -- 1.7.9.3 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-05 13:11 ` [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] Prarit Bhargava @ 2012-07-05 13:26 ` Avi Kivity 2012-07-05 13:37 ` Prarit Bhargava 0 siblings, 1 reply; 8+ messages in thread From: Avi Kivity @ 2012-07-05 13:26 UTC (permalink / raw) To: Prarit Bhargava Cc: linux-kernel, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk On 07/05/2012 04:11 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() which results in a nice printk in the > syslog. This is only really a stub function but it > does make kvm more consistent with the other hypervisors. > > [v2]: add detect and _GPL export > Please copy at least kvm@vger.kernel.org, and preferably Marcelo as well (the other kvm co-maintainer). -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-05 13:26 ` Avi Kivity @ 2012-07-05 13:37 ` Prarit Bhargava 2012-07-06 11:27 ` Marcelo Tosatti 0 siblings, 1 reply; 8+ messages in thread From: Prarit Bhargava @ 2012-07-05 13:37 UTC (permalink / raw) To: Avi Kivity Cc: linux-kernel, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk, Marcelo Tostatti, kvm On 07/05/2012 09:26 AM, Avi Kivity wrote: > Please copy at least kvm@vger.kernel.org, and preferably Marcelo as well > (the other kvm co-maintainer). > > 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() which results in a nice printk in the syslog. This is only really a stub function but it does make kvm more consistent with the other hypervisors. [v2]: add detect and _GPL export 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> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- arch/x86/include/asm/hypervisor.h | 1 + arch/x86/kernel/cpu/hypervisor.c | 1 + arch/x86/kernel/kvm.c | 14 ++++++++++++++ 3 files changed, 16 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..865cd13 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,19 @@ void __init kvm_guest_init(void) #endif } +static bool __init kvm_detect(void) +{ + if (!kvm_para_available()) + return false; + return true; +} + +const struct hypervisor_x86 x86_hyper_kvm __refconst = { + .name = "KVM", + .detect = kvm_detect, +}; +EXPORT_SYMBOL_GPL(x86_hyper_kvm); + static __init int activate_jump_labels(void) { if (has_steal_clock) { -- 1.7.9.3 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-05 13:37 ` Prarit Bhargava @ 2012-07-06 11:27 ` Marcelo Tosatti 2012-07-06 17:47 ` Prarit Bhargava 0 siblings, 1 reply; 8+ messages in thread From: Marcelo Tosatti @ 2012-07-06 11:27 UTC (permalink / raw) To: Prarit Bhargava Cc: Avi Kivity, linux-kernel, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk, kvm On Thu, Jul 05, 2012 at 09:37:00AM -0400, Prarit Bhargava wrote: > > > On 07/05/2012 09:26 AM, Avi Kivity wrote: > > Please copy at least kvm@vger.kernel.org, and preferably Marcelo as well > > (the other kvm co-maintainer). > > > > > > 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() which results in a nice printk in the > syslog. This is only really a stub function but it > does make kvm more consistent with the other hypervisors. > > [v2]: add detect and _GPL export > > 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> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Looks good, please regenerate: Hunk #1 FAILED at 39. Hunk #2 succeeded at 484 (offset 51 lines). 1 out of 2 hunks FAILED -- saving rejects to file arch/x86/kernel/kvm.c.rej ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-06 11:27 ` Marcelo Tosatti @ 2012-07-06 17:47 ` Prarit Bhargava 2012-07-11 16:34 ` Avi Kivity 0 siblings, 1 reply; 8+ messages in thread From: Prarit Bhargava @ 2012-07-06 17:47 UTC (permalink / raw) To: Marcelo Tosatti Cc: Avi Kivity, linux-kernel, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk, kvm On 07/06/2012 07:27 AM, Marcelo Tosatti wrote: > On Thu, Jul 05, 2012 at 09:37:00AM -0400, Prarit Bhargava wrote: >> >> >> On 07/05/2012 09:26 AM, Avi Kivity wrote: >>> Please copy at least kvm@vger.kernel.org, and preferably Marcelo as well >>> (the other kvm co-maintainer). >>> >>> >> >> 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() which results in a nice printk in the >> syslog. This is only really a stub function but it >> does make kvm more consistent with the other hypervisors. >> >> [v2]: add detect and _GPL export >> >> 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> >> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > Looks good, please regenerate: > > Hunk #1 FAILED at 39. > Hunk #2 succeeded at 484 (offset 51 lines). > 1 out of 2 hunks FAILED -- saving rejects to file > arch/x86/kernel/kvm.c.rej Oops. Sorry about that Marcelo. I didn't know about kvm next :( My bad. ----8<----- [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v3] 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() which results in a nice printk in the syslog. This is only really a stub function but it does make kvm more consistent with the other hypervisors. [v2]: add detect and _GPL export [v3]: patch against kvm next 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> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Marcelo Tostatti <mtosatti@redhat.com> Cc: kvm@vger.kernel.org --- arch/x86/include/asm/hypervisor.h | 1 + arch/x86/kernel/cpu/hypervisor.c | 1 + arch/x86/kernel/kvm.c | 14 ++++++++++++++ 3 files changed, 16 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 75ab94c..299cf14 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -41,6 +41,7 @@ #include <asm/idle.h> #include <asm/apic.h> #include <asm/apicdef.h> +#include <asm/hypervisor.h> static int kvmapf = 1; @@ -483,6 +484,19 @@ void __init kvm_guest_init(void) #endif } +static bool __init kvm_detect(void) +{ + if (!kvm_para_available()) + return false; + return true; +} + +const struct hypervisor_x86 x86_hyper_kvm __refconst = { + .name = "KVM", + .detect = kvm_detect, +}; +EXPORT_SYMBOL_GPL(x86_hyper_kvm); + static __init int activate_jump_labels(void) { if (has_steal_clock) { -- 1.7.10.2 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] 2012-07-06 17:47 ` Prarit Bhargava @ 2012-07-11 16:34 ` Avi Kivity 0 siblings, 0 replies; 8+ messages in thread From: Avi Kivity @ 2012-07-11 16:34 UTC (permalink / raw) To: Prarit Bhargava Cc: Marcelo Tosatti, linux-kernel, Gleb Natapov, Alex Williamson, Konrad Rzeszutek Wilk, kvm On 07/06/2012 08:47 PM, Prarit Bhargava wrote: > [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v3] > > 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() which results in a nice printk in the > syslog. This is only really a stub function but it > does make kvm more consistent with the other hypervisors. Thanks, applied. > > --- 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[] = Corrupted patch, fixed by hand. > #endif -- error compiling committee.c: too many arguments to function ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] xen, fix x86_hyper_xen_hvm symbol export 2012-07-05 13:11 [PATCH 0/2] hypervisor, update hypervisor_x86 entries for kvm and xen Prarit Bhargava 2012-07-05 13:11 ` [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] Prarit Bhargava @ 2012-07-05 13:11 ` Prarit Bhargava 1 sibling, 0 replies; 8+ messages in thread From: Prarit Bhargava @ 2012-07-05 13:11 UTC (permalink / raw) To: linux-kernel; +Cc: Prarit Bhargava This should be EXPORT_SYMBOL_GPL. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- arch/x86/xen/enlighten.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index ff962d4..f381f59 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1566,5 +1566,5 @@ const struct hypervisor_x86 x86_hyper_xen_hvm __refconst = { .detect = xen_hvm_platform, .init_platform = xen_hvm_guest_init, }; -EXPORT_SYMBOL(x86_hyper_xen_hvm); +EXPORT_SYMBOL_GPL(x86_hyper_xen_hvm); #endif -- 1.7.9.3 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-07-11 18:36 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-07-05 13:11 [PATCH 0/2] hypervisor, update hypervisor_x86 entries for kvm and xen Prarit Bhargava 2012-07-05 13:11 ` [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2] Prarit Bhargava 2012-07-05 13:26 ` Avi Kivity 2012-07-05 13:37 ` Prarit Bhargava 2012-07-06 11:27 ` Marcelo Tosatti 2012-07-06 17:47 ` Prarit Bhargava 2012-07-11 16:34 ` Avi Kivity 2012-07-05 13:11 ` [PATCH 2/2] xen, fix x86_hyper_xen_hvm symbol export Prarit Bhargava
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome