Files
linux/tools/testing/selftests/kvm/include
Tao Su 980b8bc019 KVM: selftests: x86: Prioritize getting max_gfn from GuestPhysBits
Use the max mappable GPA via GuestPhysBits advertised by KVM to calculate
max_gfn. Currently some selftests (e.g. access_tracking_perf_test,
dirty_log_test...) add RAM regions close to max_gfn, so guest may access
GPA beyond its mappable range and cause infinite loop.

Adjust max_gfn in vm_compute_max_gfn() since x86 selftests already
overrides vm_compute_max_gfn() specifically to deal with goofy edge cases.

Reported-by: Yi Lai <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Tested-by: Yi Lai <[email protected]>
Reviewed-by: Xiaoyao Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[sean: tweak name, add comment and sanity check]
Signed-off-by: Sean Christopherson <[email protected]>
2024-06-05 06:16:10 -07:00
..