hypervisor, update hypervisor_x86 entries for kvm and xen
Subsystems (4)
cover hypervisor, update hypervisor_x86 entries for kvm and xen
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(-)
Signature · 1 line
1.7.9.3
PATCH 2/2 xen, fix x86_hyper_xen_hvm symbol export
This should be EXPORT_SYMBOL_GPL.
--- arch/x86/xen/enlighten.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/enlighten.c +1 -1
@@ -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
Signature · 1 line
1.7.9.3
PATCH 1/2 kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
In reply to Prarit BhargavaWhile 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
--- 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(+)
arch/x86/include/asm/hypervisor.h +1 -0
@@ -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 ) {
arch/x86/kernel/cpu/hypervisor.c +1 -0
@@ -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;
arch/x86/kernel/kvm.c +14 -0
@@ -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) {
Signature · 1 line
1.7.9.3
Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
Quoted 8 lines · Prarit Bhargava
While debugging I noticed that unlike all the other hypervisor code in the kernel, kvm does not have an entry for
x86_hyperwhich is used indetect_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
_GPLexport
Please copy at least [email protected], and preferably Marcelo as well (the other kvm co-maintainer).
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
Quoted 4 lines · Avi Kivity
Please copy at least [email protected], 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
--- 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(+)
arch/x86/include/asm/hypervisor.h +1 -0
@@ -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 ) {
arch/x86/kernel/cpu/hypervisor.c +0 -0
@@ -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;
arch/x86/kernel/kvm.c +14 -0
@@ -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) {
Signature · 1 line
1.7.9.3
Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
Quoted 14 lines · Prarit Bhargava
Quoted 4 lines · Avi Kivity
Please copy at least [email protected], 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_hyperwhich is used indetect_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.
Quoted 7 lines
[v2]: add detect and
_GPLexportSigned-off-by Prarit Bhargava <[email protected]>Cc Avi Kivity <[email protected]>Cc Gleb Natapov <[email protected]>Cc Alex Williamson <[email protected]>Cc Konrad Rzeszutek Wilk <[email protected]>
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 filearch/x86/kernel/kvm.c.rej
Re: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
Quoted 23 lines · Marcelo Tosatti
Quoted 14 lines · Prarit Bhargava
Quoted 4 lines · Avi Kivity
Please copy at least [email protected], 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_hyperwhich is used indetect_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.Quoted 7 lines
[v2]: add detect and
_GPLexportSigned-off-by Prarit Bhargava <[email protected]>Cc Avi Kivity <[email protected]>Cc Gleb Natapov <[email protected]>Cc Alex Williamson <[email protected]>Cc Konrad Rzeszutek Wilk <[email protected]>
Quoted 6 lines
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 filearch/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
--- 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(+)
arch/x86/include/asm/hypervisor.h +1 -0
@@ -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 ) {
arch/x86/kernel/cpu/hypervisor.c +0 -0
@@ -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;
arch/x86/kernel/kvm.c +14 -0
@@ -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) {
Signature · 1 line
1.7.10.2
Avi Kivity
AppliedRe: [PATCH 1/2] kvm, Add x86_hyper_kvm to complete detect_hypervisor_platform check [v2]
Quoted 7 lines · Prarit Bhargava
[PATCH 1/2] kvm, Add
x86_hyper_kvmto completedetect_hypervisor_platformcheck [v3]While debugging I noticed that unlike all the other hypervisor code in the kernel, kvm does not have an entry for
x86_hyperwhich is used indetect_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.
Quoted 5 lines
arch/x86/kernel/cpu/hypervisor.c +0
-0@@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * consthypervisors[] =
Corrupted patch, fixed by hand.
Quoted 1 line
#endif
Signature · 1 line
error compiling committee.c: too many arguments to function