aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-01-31 14:57:38 +0100
committerAvi Kivity <avi@qumranet.com>2008-04-27 11:53:18 +0300
commit50a37eb4e05efaa7bac6a948fd4db1a48c728b99 (patch)
tree34195810be002db84cfafb9ed706d48bb6752d52 /arch/x86/kvm/vmx.c
parentf2b4b7ddf633ffa24ce7c89c9e0d8a06463484e3 (diff)
KVM: align valid EFER bits with the features of the host system
This patch aligns the bits the guest can set in the EFER register with the features in the host processor. Currently it lets EFER.NX disabled if the processor does not support it and enables EFER.LME and EFER.LMA only for KVM on 64 bit hosts. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 1157e8a4059..a509910f6b5 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1117,6 +1117,10 @@ static __init int hardware_setup(void)
{
if (setup_vmcs_config(&vmcs_config) < 0)
return -EIO;
+
+ if (boot_cpu_has(X86_FEATURE_NX))
+ kvm_enable_efer_bits(EFER_NX);
+
return alloc_kvm_area();
}