[PATCH v3 5/6] KVM: Reorder KVM_REQ_EVENT to optimize processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we now process events in order of their bit values, we need to keep
KVM_REQ_EVENT last.  This is so that if an event which may generate an
interrupt (say, PMU) happens, we can process the generated KVM_REQ_EVENT
before entering the critical section (and then aborting because vcpu->requests
has KVM_REQ_EVENT set).

Reorder the KVM_REQ_ definitions to make it so.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 include/linux/kvm_host.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index e3c86f8..6d71058 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -62,13 +62,13 @@
 #define KVM_REQ_CLOCK_UPDATE       8
 #define KVM_REQ_KICK               9
 #define KVM_REQ_DEACTIVATE_FPU    10
-#define KVM_REQ_EVENT             11
-#define KVM_REQ_APF_HALT          12
-#define KVM_REQ_STEAL_UPDATE      13
-#define KVM_REQ_NMI               14
-#define KVM_REQ_IMMEDIATE_EXIT    15
-#define KVM_REQ_PMU               16
-#define KVM_REQ_PMI               17
+#define KVM_REQ_APF_HALT          11
+#define KVM_REQ_STEAL_UPDATE      12
+#define KVM_REQ_NMI               13
+#define KVM_REQ_IMMEDIATE_EXIT    14
+#define KVM_REQ_PMU               15
+#define KVM_REQ_PMI               16
+#define KVM_REQ_EVENT             17 /* Keep after any req which can cause an interrupt */
 
 #define KVM_USERSPACE_IRQ_SOURCE_ID	0
 
-- 
1.7.11

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux