Skip to contentSkip to conversation

nVMX: Clear A/D enable bit in EPTP after negative testcase on non-A/D host

PATCH Applied Sean Christopherson 1 participant 2 messages Feb 14, 2025 – Feb 24, 2025 KVM

lore
Share & tools
lore

Sean Christopherson

author reviewer
#0 lore raw

PATCH 1/1 nVMX: Clear A/D enable bit in EPTP after negative testcase on non-A/D host

Clear the Access/Dirty enable flag in EPTP after the negative testcase that verifies enabling A/D bits results in failed VM-Entry if A/D bits aren't supported. Leaving the A/D bit set causes the subsequent tests to fail on A/D-disabled hosts.

Fixes 1d70eb82 ("nVMX x86: Check EPTP on vmentry of L2 guests")
---
 x86/vmx_tests.c | 2 ++
 1 file changed, 2 insertions(+)
x86/vmx_tests.c +2 -0
index ffe7064c..160b50fb 100644
@@ -4750,6 +4750,8 @@ static void test_ept_eptp(void)
 
 		eptp |= EPTP_AD_FLAG;
 		test_eptp_ad_bit(eptp, false);
+
+		eptp &= ~EPTP_AD_FLAG;
 	}
 
 	/*

base-commit: f77fb696cfd0e4a5562cdca189be557946bf522f

Signature · 1 line
2.48.1.601.g30ceb7b040-goog
author reviewer Applied
#1 lore raw
Quoted 6 lines · Sean Christopherson

Clear the Access/Dirty enable flag in EPTP after the negative testcase that verifies enabling A/D bits results in failed VM-Entry if A/D bits aren't supported. Leaving the A/D bit set causes the subsequent tests to fail on A/D-disabled hosts.

Applied to kvm-x86 next (and now pulled by Paolo), thanks!

[1/1] nVMX: Clear A/D enable bit in EPTP after negative testcase on non-A/D host

      https://github.com/kvm-x86/kvm-unit-tests/commit/afbea997744e

--
https://github.com/kvm-x86/kvm-unit-tests/tree/next