Skip to contentSkip to conversation

x86: Skip EPT tests that involve unrestricted guest when URG is disabled

PATCH New Sean Christopherson 1 participant 1 message Aug 22, 2019 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Skip EPT tests that involve unrestricted guest when URG is disabled

Cc Krish Sadhukhan <[email protected]>
Fixes f749ddc19bb2d ("nVMX x86: Check enable-EPT on vmentry of L2 guests")
---
 x86/vmx_tests.c | 4 ++++
 1 file changed, 4 insertions(+)
x86/vmx_tests.c +4 -0
index 9078665..f035f24 100644
@@ -4797,6 +4797,9 @@ static void test_ept_eptp(void)
 	test_vmx_valid_controls(false);
 	report_prefix_pop();
 
+	if (!(ctrl_cpu_rev[1].clr & CPU_URG))
+		goto skip_unrestricted_guest;
+
 	secondary |= CPU_URG;
 	vmcs_write(CPU_EXEC_CTRL1, secondary);
 	report_prefix_pushf("Enable-EPT disabled, unrestricted-guest enabled");
@@ -4809,6 +4812,7 @@ static void test_ept_eptp(void)
 	test_vmx_valid_controls(false);
 	report_prefix_pop();
 
+skip_unrestricted_guest:
 	secondary &= ~CPU_URG;
 	vmcs_write(CPU_EXEC_CTRL1, secondary);
 	report_prefix_pushf("Enable-EPT enabled, unrestricted-guest disabled");
Signature · 1 line
2.22.0