mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 19:05:39 +00:00
KVM: Add x86_hyper_kvm to complete detect_hypervisor_platform check
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. 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 Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
58d8b1728e
commit
fc73373b33
@ -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_vmware;
|
||||||
extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
|
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_xen_hvm;
|
||||||
|
extern const struct hypervisor_x86 x86_hyper_kvm;
|
||||||
|
|
||||||
static inline bool hypervisor_x2apic_available(void)
|
static inline bool hypervisor_x2apic_available(void)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,7 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
|
|||||||
#endif
|
#endif
|
||||||
&x86_hyper_vmware,
|
&x86_hyper_vmware,
|
||||||
&x86_hyper_ms_hyperv,
|
&x86_hyper_ms_hyperv,
|
||||||
|
&x86_hyper_kvm,
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct hypervisor_x86 *x86_hyper;
|
const struct hypervisor_x86 *x86_hyper;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <asm/idle.h>
|
#include <asm/idle.h>
|
||||||
#include <asm/apic.h>
|
#include <asm/apic.h>
|
||||||
#include <asm/apicdef.h>
|
#include <asm/apicdef.h>
|
||||||
|
#include <asm/hypervisor.h>
|
||||||
|
|
||||||
static int kvmapf = 1;
|
static int kvmapf = 1;
|
||||||
|
|
||||||
@ -483,6 +484,19 @@ void __init kvm_guest_init(void)
|
|||||||
#endif
|
#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)
|
static __init int activate_jump_labels(void)
|
||||||
{
|
{
|
||||||
if (has_steal_clock) {
|
if (has_steal_clock) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user