kvm: Fix assert check

For handling HYPERV hypercalls, the exit reason needs to be checked
against KVM_EXIT_HYPERV.

TEST=Compiled.

Change-Id: Ib11d558e25e2c5fd037e1bc6ca88a454e957a1c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3639149
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vaibhav Nagarnaik <vnagarnaik@google.com>
This commit is contained in:
Vaibhav Nagarnaik 2022-05-10 18:49:38 +00:00 committed by Chromeos LUCI
parent 7f1b94e96a
commit b929c1e2be

View file

@ -1028,7 +1028,7 @@ impl Vcpu for KvmVcpu {
// kernel told us how large it was.
let run = unsafe { &mut *(self.run_mmap.as_ptr() as *mut kvm_run) };
// Verify that the handler is called in the right context.
assert!(run.exit_reason == KVM_EXIT_HYPERV_HCALL);
assert!(run.exit_reason == KVM_EXIT_HYPERV);
// Safe because the exit_reason (which comes from the kernel) told us which
// union field to use.
let hyperv = unsafe { &mut run.__bindgen_anon_1.hyperv };