KVM: selftests: Use magic value to signal ucall_alloc() failure
authorSean Christopherson <seanjc@google.com>
Fri, 9 Dec 2022 20:55:44 +0000 (12:55 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Dec 2022 11:00:49 +0000 (06:00 -0500)
commit2f5213b8fc311eaa8fc78de7ecbd27ead027993c
tree60701f5f9e1cc956a56bd51dd0969c498b9f037d
parentdb7b780dab6742a8358ae7ecb1d0e972ccea8737
KVM: selftests: Use magic value to signal ucall_alloc() failure

Use a magic value to signal a ucall_alloc() failure instead of simply
doing GUEST_ASSERT().  GUEST_ASSERT() relies on ucall_alloc() and so a
failure puts the guest into an infinite loop.

Use -1 as the magic value, as a real ucall struct should never wrap.

Reported-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/ucall_common.c