[kvm-unit-tests PATCH 1/3] nVMX: Use helpers to check for WB memtype and 4-level EPT support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use is_ept_memtype_supported() and is_4_level_ept_supported() to check for
basic EPT support instead of open coding checks on ept_vpid.val.

Opportunstically add a report() failure if 4-level EPT isn't supported, as
support for 4-level paging is mandatory in any sane configuration.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 x86/vmx_tests.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index c1540d39..907cbe1c 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -1039,11 +1039,14 @@ static int __setup_ept(u64 hpa, bool enable_ad)
 		printf("\tEPT is not supported\n");
 		return 1;
 	}
-	if (!(ept_vpid.val & EPT_CAP_WB)) {
+	if (!is_ept_memtype_supported(EPT_MEM_TYPE_WB)) {
 		printf("\tWB memtype for EPT walks not supported\n");
 		return 1;
 	}
-	if (!(ept_vpid.val & EPT_CAP_PWL4)) {
+
+	if (!is_4_level_ept_supported()) {
+		/* Support for 4-level EPT is mandatory. */
+		report(false, "4-level EPT support check");
 		printf("\tPWL4 is not supported\n");
 		return 1;
 	}
-- 
2.42.0.283.g2d96d420d3-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux