From b929c1e2beefad6b0c5e215f5d79055782625c2f Mon Sep 17 00:00:00 2001 From: Vaibhav Nagarnaik Date: Tue, 10 May 2022 18:49:38 +0000 Subject: [PATCH] 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 Tested-by: kokoro Commit-Queue: Vaibhav Nagarnaik --- hypervisor/src/kvm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index ca75558169..1c7e139b2b 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -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 };