WHPX improve interrupt notification registration
authorJustin Terry (VM) via Qemu-devel <qemu-devel@nongnu.org>
Mon, 26 Feb 2018 17:13:36 +0000 (09:13 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Mar 2018 13:01:29 +0000 (14:01 +0100)
Improves the usage of the InterruptNotification registration by skipping the
additional call to WHvSetVirtualProcessorRegisters if we have already
registered for the window exit.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
Message-Id: <1519665216-1078-9-git-send-email-juterry@microsoft.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Justin Terry (VM) via Qemu-devel <qemu-devel@nongnu.org>
target/i386/whpx-all.c

index 24387bebadf2395e7c9e92960e8f70585c9ef934..940bbe590d3375281fca9a562a4e2eb47e640117 100644 (file)
@@ -756,12 +756,11 @@ static void whpx_vcpu_pre_run(CPUState *cpu)
     }
 
     /* Update the state of the interrupt delivery notification */
-    if (cpu->interrupt_request & CPU_INTERRUPT_HARD) {
+    if (!vcpu->window_registered &&
+        cpu->interrupt_request & CPU_INTERRUPT_HARD) {
         reg_values[reg_count].DeliverabilityNotifications.InterruptNotification
             = 1;
-        if (vcpu->window_registered != 1) {
-            vcpu->window_registered = 1;
-        }
+        vcpu->window_registered = 1;
         reg_names[reg_count] = WHvX64RegisterDeliverabilityNotifications;
         reg_count += 1;
     }