linux/tools/testing/selftests/kvm/include/x86_64
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 <yi1.lai@intel.com>
Signed-off-by: Tao Su <tao1.su@linux.intel.com>
Tested-by: Yi Lai <yi1.lai@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20240513014003.104593-1-tao1.su@linux.intel.com
[sean: tweak name, add comment and sanity check]
Signed-off-by: Sean Christopherson <seanjc@google.com>
2024-06-05 06:16:10 -07:00
..
apic.h KVM: selftests: Add a self test for CMCI and UCNA emulations. 2022-06-24 04:52:04 -04:00
evmcs.h KVM: selftests: evmcs_test: Introduce L2 TLB flush test 2022-11-21 06:42:41 -05:00
hyperv.h KVM: selftests: Test Hyper-V extended hypercall enablement 2023-02-01 13:46:24 -08:00
kvm_util_arch.h KVM: selftests: Move GDT, IDT, and TSS fields to x86's kvm_vm_arch 2024-04-29 12:55:07 -07:00
mce.h KVM: selftests: Add a self test for CMCI and UCNA emulations. 2022-06-24 04:52:04 -04:00
pmu.h KVM: selftests: Add pmu.h and lib/pmu.c for common PMU assets 2024-01-30 15:29:18 -08:00
processor.h KVM: selftests: x86: Prioritize getting max_gfn from GuestPhysBits 2024-06-05 06:16:10 -07:00
sev.h selftests: kvm: split "launch" phase of SEV VM creation 2024-04-11 13:08:27 -04:00
svm.h KVM: selftests: hyperv_svm_test: Introduce L2 TLB flush test 2022-11-21 06:42:43 -05:00
svm_util.h KVM: selftests: Stuff RAX/RCX with 'safe' values in vmmcall()/vmcall() 2022-11-21 06:42:38 -05:00
ucall.h Revert "kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h" 2024-04-29 12:54:13 -07:00
vmx.h KVM: selftests: Stuff RAX/RCX with 'safe' values in vmmcall()/vmcall() 2022-11-21 06:42:38 -05:00