From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH v3 5/6] KVM: Reorder KVM_REQ_EVENT to optimize processing
Date: Mon, 9 Jul 2012 20:05:44 +0300 [thread overview]
Message-ID: <1341853545-3023-6-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1341853545-3023-1-git-send-email-avi@redhat.com>
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 --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
next prev parent reply other threads:[~2012-07-09 17:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 17:05 [PATCH v3 0/6] Optimize vcpu->requests processing Avi Kivity
2012-07-09 17:05 ` [PATCH v3 1/6] KVM: Don't use KVM_REQ_PENDING_TIMER Avi Kivity
2012-07-10 8:50 ` Gleb Natapov
2012-07-10 9:13 ` Avi Kivity
2012-07-09 17:05 ` [PATCH v3 2/6] KVM: Simplify KVM_REQ_EVENT/req_int_win handling Avi Kivity
2012-07-09 17:05 ` [PATCH v3 3/6] KVM: Move mmu reload out of line Avi Kivity
2012-07-10 3:57 ` Xiao Guangrong
2012-07-10 7:48 ` Avi Kivity
2012-07-09 17:05 ` [PATCH v3 4/6] KVM: Optimize vcpu->requests checking Avi Kivity
2012-07-09 17:05 ` Avi Kivity [this message]
2012-07-09 17:05 ` [PATCH v3 6/6] KVM: Clean up vcpu->requests == 0 processing Avi Kivity
2012-09-24 5:55 ` [PATCH v3 0/6] Optimize vcpu->requests processing Xiao Guangrong
2012-09-24 9:48 ` Avi Kivity
2012-09-24 10:19 ` Xiao Guangrong
2012-09-24 10:52 ` Avi Kivity
2012-09-24 11:16 ` Xiao Guangrong
2012-09-24 12:12 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341853545-3023-6-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.