KVM: VMX: Enable EPT A/D bits if supported by turning on relevant bit in EPTP
authorXudong Hao <xudong.hao@intel.com>
Mon, 28 May 2012 11:33:36 +0000 (19:33 +0800)
committerAvi Kivity <avi@redhat.com>
Tue, 5 Jun 2012 13:31:04 +0000 (16:31 +0300)
In EPT page structure entry, Enable EPT A/D bits if processor supported.

Signed-off-by: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c

index 18590e003bd21f6a90975acf0b686ea6c85f1084..d392e5427ca0573ab10e880129d0b09961e541ae 100644 (file)
@@ -3039,6 +3039,8 @@ static u64 construct_eptp(unsigned long root_hpa)
        /* TODO write the value reading from MSR */
        eptp = VMX_EPT_DEFAULT_MT |
                VMX_EPT_DEFAULT_GAW << VMX_EPT_GAW_EPTP_SHIFT;
+       if (enable_ept_ad_bits)
+               eptp |= VMX_EPT_AD_ENABLE_BIT;
        eptp |= (root_hpa & PAGE_MASK);
 
        return eptp;