提交 9ea542fa 编写于 作者: S Sheng Yang 提交者: Avi Kivity

KVM: VMX: Rename IA32_FEATURE_CONTROL bits

Signed-off-by: NSheng Yang <sheng.yang@intel.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 ad8003d3
...@@ -1041,9 +1041,9 @@ static __init int vmx_disabled_by_bios(void) ...@@ -1041,9 +1041,9 @@ static __init int vmx_disabled_by_bios(void)
u64 msr; u64 msr;
rdmsrl(MSR_IA32_FEATURE_CONTROL, msr); rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
return (msr & (IA32_FEATURE_CONTROL_LOCKED_BIT | return (msr & (FEATURE_CONTROL_LOCKED |
IA32_FEATURE_CONTROL_VMXON_ENABLED_BIT)) FEATURE_CONTROL_VMXON_ENABLED))
== IA32_FEATURE_CONTROL_LOCKED_BIT; == FEATURE_CONTROL_LOCKED;
/* locked but not enabled */ /* locked but not enabled */
} }
...@@ -1055,14 +1055,14 @@ static void hardware_enable(void *garbage) ...@@ -1055,14 +1055,14 @@ static void hardware_enable(void *garbage)
INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu)); INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu));
rdmsrl(MSR_IA32_FEATURE_CONTROL, old); rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
if ((old & (IA32_FEATURE_CONTROL_LOCKED_BIT | if ((old & (FEATURE_CONTROL_LOCKED |
IA32_FEATURE_CONTROL_VMXON_ENABLED_BIT)) FEATURE_CONTROL_VMXON_ENABLED))
!= (IA32_FEATURE_CONTROL_LOCKED_BIT | != (FEATURE_CONTROL_LOCKED |
IA32_FEATURE_CONTROL_VMXON_ENABLED_BIT)) FEATURE_CONTROL_VMXON_ENABLED))
/* enable and lock */ /* enable and lock */
wrmsrl(MSR_IA32_FEATURE_CONTROL, old | wrmsrl(MSR_IA32_FEATURE_CONTROL, old |
IA32_FEATURE_CONTROL_LOCKED_BIT | FEATURE_CONTROL_LOCKED |
IA32_FEATURE_CONTROL_VMXON_ENABLED_BIT); FEATURE_CONTROL_VMXON_ENABLED);
write_cr4(read_cr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */ write_cr4(read_cr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */
asm volatile (ASM_VMX_VMXON_RAX asm volatile (ASM_VMX_VMXON_RAX
: : "a"(&phys_addr), "m"(phys_addr) : : "a"(&phys_addr), "m"(phys_addr)
......
...@@ -331,8 +331,8 @@ enum vmcs_field { ...@@ -331,8 +331,8 @@ enum vmcs_field {
#define AR_RESERVD_MASK 0xfffe0f00 #define AR_RESERVD_MASK 0xfffe0f00
#define IA32_FEATURE_CONTROL_LOCKED_BIT 0x1 #define FEATURE_CONTROL_LOCKED (1<<0)
#define IA32_FEATURE_CONTROL_VMXON_ENABLED_BIT 0x4 #define FEATURE_CONTROL_VMXON_ENABLED (1<<2)
#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT 9 #define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT 9
#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT 10 #define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT 10
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册