x86: Force host-phys-bits for normal maxphyaddr access tests
Sean Christopherson
reviewerPATCH 1/1 x86: Force host-phys-bits for normal maxphyaddr access tests
Explicitly force host-phys-bits for the access tests that intends to run with the host's MAXPHYADDR, as QEMU only forces host-phys-bits for "max" CPUs as of version 6.0 (see commit 5a140b255d ("x86/cpu: Use max host physical address if -cpu max option is applied")).
Running the access test with an older QEMU, e.g. 5.3, on a CPU with MAXPHYADDR=52 and allow_smaller_maxphyaddr=N (i.e. with TDP enabled) fails miserably as the test isn't aware that bit 51 is a legal physical address bit.
Amusingly, the KVM-Unit-Test appears to pre-date the QEMU change by a few months, which suggests that the KVM-Unit-Test change was made without proper testing, and the QEMU change was made to fix the problem.
--- x86/unittests.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
x86/unittests.cfg +2 -2
@@ -126,12 +126,12 @@ groups = vmexit [access] file = access_test.flat arch = x86_64 -extra_params = -cpu max +extra_params = -cpu max,host-phys-bits [access_fep] file = access_test.flat arch = x86_64 -extra_params = -cpu max -append force_emulation +extra_params = -cpu max,host-phys-bits -append force_emulation groups = nodefault timeout = 240
base-commit: 6b801c8981f74d75419d77e031dd37f5ad356efe
Signature · 1 line
2.46.0.295.g3b9ea8a38a-goog
Quoted 11 lines · Sean Christopherson
Explicitly force host-phys-bits for the access tests that intends to run with the host's MAXPHYADDR, as QEMU only forces host-phys-bits for "max" CPUs as of version 6.0 (see commit
5a140b255d("x86/cpu: Use max host physical address if -cpu max option is applied")).Running the access test with an older QEMU, e.g. 5.3, on a CPU with MAXPHYADDR=52 and allow_smaller_maxphyaddr=N (i.e. with TDP enabled) fails miserably as the test isn't aware that bit 51 is a legal physical address bit.
[...]
Applied to kvm-x86 next (and now pulled by Paolo). Thanks!
[1/1] x86: Force host-phys-bits for normal maxphyaddr access tests
https://github.com/kvm-x86/kvm-unit-tests/commit/b8e135d6bb48