From: Christoph Egger <Christoph.Egger@amd.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: [PATCH] nestedsvm: fix interrupt handling
Date: Fri, 31 Aug 2012 11:16:53 +0200 [thread overview]
Message-ID: <50408105.3020502@amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
Give the l2 guest a chance to finish the delivery of the last injected
interrupt or exception before we emulate a VMEXIT.
For example after a NPF handled by the host there can be an interrupt
for the l1 guest.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_nh_intr.diff --]
[-- Type: text/plain, Size: 1106 bytes --]
diff -r a0b5f8102a00 xen/arch/x86/hvm/svm/nestedsvm.c
--- a/xen/arch/x86/hvm/svm/nestedsvm.c Tue Aug 28 22:40:45 2012 +0100
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c Fri Aug 31 11:09:37 2012 +0200
@@ -1164,6 +1164,8 @@ enum hvm_intblk nsvm_intr_blocked(struct
return hvm_intblk_svm_gif;
if ( nestedhvm_vcpu_in_guestmode(v) ) {
+ struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
+
if ( svm->ns_hostflags.fields.vintrmask )
if ( !svm->ns_hostflags.fields.rflagsif )
return hvm_intblk_rflags_ie;
@@ -1176,6 +1178,14 @@ enum hvm_intblk nsvm_intr_blocked(struct
*/
if ( v->arch.hvm_vcpu.hvm_io.io_state != HVMIO_none )
return hvm_intblk_shadow;
+
+ if ( !nv->nv_vmexit_pending && n2vmcb->exitintinfo.bytes != 0 ) {
+ /* Give the l2 guest a chance to finish the delivery of
+ * the last injected interrupt or exception before we
+ * emulate a VMEXIT (e.g. VMEXIT(INTR) ).
+ */
+ return hvm_intblk_shadow;
+ }
}
if ( nv->nv_vmexit_pending ) {
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
reply other threads:[~2012-08-31 9:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=50408105.3020502@amd.com \
--to=christoph.egger@amd.com \
--cc=xen-devel@lists.xen.org \
/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.