KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs
authorMaxim Levitsky <mlevitsk@redhat.com>
Fri, 15 Mar 2024 14:35:07 +0000 (10:35 -0400)
committerSean Christopherson <seanjc@google.com>
Mon, 8 Apr 2024 20:21:40 +0000 (13:21 -0700)
commit0ef2dd1f4144bc024d3c98954fa061a102f6481b
treec57371a00a165a3ae7e20c8bc8b8ecb45821118e
parent08a828249b16f69248652937be7f1b8dab340a22
KVM: selftests: fix max_guest_memory_test with more that 256 vCPUs

max_guest_memory_test uses ucalls to sync with the host, but
it also resets the guest RIP back to its initial value in between
tests stages.

This makes the guest never reach the code which frees the ucall struct
and since a fixed pool of 512 ucall structs is used, the test starts
to fail when more that 256 vCPUs are used.

Fix that by replacing the manual register reset with a loop in
the guest code.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20240315143507.102629-1-mlevitsk@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/max_guest_memory_test.c