x86: Clean up the hypervisor layer

Clean up the hypervisor layer and the hypervisor drivers, using an ops
structure instead of an enumeration with if statements.

The identity of the hypervisor, if needed, can be tested by testing
the pointer value in x86_hyper.

The MS-HyperV private state is moved into a normal global variable
(it's per-system state, not per-CPU state).  Being a normal bss
variable, it will be left at all zero on non-HyperV platforms, and so
can generally be tested for HyperV-specific features without
additional qualification.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: Greg KH <greg@kroah.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Ky Srinivasan <ksrinivasan@novell.com>
LKML-Reference: <4BE49778.6060800@zytor.com>
This commit is contained in:
H. Peter Anvin
2010-05-07 16:57:28 -07:00
parent 9fa0231742
commit e08cae4181
8 changed files with 116 additions and 106 deletions

View File

@@ -1,7 +1,14 @@
#ifndef ASM_X86__MSHYPER_H
#define ASM_X86__MSHYPER_H
#ifndef _ASM_X86_MSHYPER_H
#define _ASM_X86_MSHYPER_H
int ms_hyperv_platform(void);
void __cpuinit ms_hyperv_set_feature_bits(struct cpuinfo_x86 *c);
#include <linux/types.h>
#include <asm/hyperv.h>
struct ms_hyperv_info {
u32 features;
u32 hints;
};
extern struct ms_hyperv_info ms_hyperv;
#endif