Skip to content
Commit 980b8bc0 authored by Tao Su's avatar Tao Su Committed by Sean Christopherson
Browse files

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: default avatarYi Lai <yi1.lai@intel.com>
Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
Tested-by: default avatarYi Lai <yi1.lai@intel.com>
Reviewed-by: default avatarXiaoyao 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: default avatarSean Christopherson <seanjc@google.com>
parent d21b3c60
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment