On Fri, May 21, 2021 at 05:38:28PM +0000, David Matlack wrote: > vm_get_max_gfn() casts vm->max_gfn from a uint64_t to an unsigned int, > which causes the upper 32-bits of the max_gfn to get truncated. > > Nobody noticed until now likely because vm_get_max_gfn() is only used > as a mechanism to create a memslot in an unused region of the guest > physical address space (the top), and the top of the 32-bit physical > address space was always good enough. > > This fix reveals a bug in memslot_modification_stress_test which was > trying to create a dummy memslot past the end of guest physical memory. > Fix that by moving the dummy memslot lower. > > Fixes: 52200d0d944e ("KVM: selftests: Remove duplicate guest mode handling") > Reviewed-by: Venkatesh Srinivas <venkateshs@xxxxxxxxxxxx> > Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx> Reviewed-by: Peter Xu <peterx@xxxxxxxxxx> -- Peter Xu