diff mbox

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

Message ID 1341853545-3023-6-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity July 9, 2012, 5:05 p.m. UTC
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@redhat.com>
---
 include/linux/kvm_host.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

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