diff mbox series

x86/HVM: send mapcache invalidation request to qemu regardless of preemption

Message ID d33721a8-af91-7efc-b954-1d775bd4e35c@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/HVM: send mapcache invalidation request to qemu regardless of preemption | expand

Commit Message

Jan Beulich Oct. 29, 2020, 3:14 p.m. UTC
Even if only part of a hypercall completed before getting preempted,
invalidation ought to occur. Therefore fold the two return statements.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Split off from "x86/HVM: refine when to send mapcache invalidation
request to qemu".

Comments

Andrew Cooper Oct. 29, 2020, 5:45 p.m. UTC | #1
On 29/10/2020 15:14, Jan Beulich wrote:
> Even if only part of a hypercall completed before getting preempted,
> invalidation ought to occur. Therefore fold the two return statements.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -326,14 +326,11 @@  int hvm_hypercall(struct cpu_user_regs *
 
     HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%lu -> %lx", eax, regs->rax);
 
-    if ( curr->hcall_preempted )
-        return HVM_HCALL_preempted;
-
     if ( unlikely(currd->arch.hvm.qemu_mapcache_invalidate) &&
          test_and_clear_bool(currd->arch.hvm.qemu_mapcache_invalidate) )
         send_invalidate_req();
 
-    return HVM_HCALL_completed;
+    return curr->hcall_preempted ? HVM_HCALL_preempted : HVM_HCALL_completed;
 }
 
 /*