All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] svm: Avoid VINTR injection during NMI shadow
@ 2010-05-07 14:41 Wei Wang2
  2010-05-07 16:56 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Wang2 @ 2010-05-07 14:41 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

Hi,
I had observed that if xen injects and intercepts VINTR during NMI shadow, and 
if the xen injects NMI into guest at a very hight frequency, guest vcpu will 
hang. Attached patch avoids VINTR injection when guest is handling a NMI.

Thanks,

Wei
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Reviewed-by: Wei Huang<wei.huang2@amd.com>
--
Legal Information:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34
85609 Dornach b. München

Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis München
Registergericht München, HRB Nr. 43632

[-- Attachment #2: fix_nmi.patch --]
[-- Type: text/x-diff, Size: 565 bytes --]

diff -r e6f751ed8e38 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Tue Mar 09 10:00:37 2010 +0000
+++ b/xen/arch/x86/hvm/svm/intr.c	Fri May 07 16:15:58 2010 +0200
@@ -92,6 +92,10 @@ static void enable_intr_window(struct vc
      * track 'NMI blocking' from NMI injection until IRET. This can be done
      * quite easily in software by intercepting the unblocking IRET.
      */
+
+    if ( vmcb->general1_intercepts & GENERAL1_INTERCEPT_IRET )
+        return;
+
     intr = vmcb->vintr;
     intr.fields.irq     = 1;
     intr.fields.vector  = 0;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] svm: Avoid VINTR injection during NMI shadow
  2010-05-07 14:41 [PATCH] svm: Avoid VINTR injection during NMI shadow Wei Wang2
@ 2010-05-07 16:56 ` Keir Fraser
  2010-05-07 17:18   ` Wei Wang2
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2010-05-07 16:56 UTC (permalink / raw)
  To: Wei Wang2, xen-devel

I think the if statement should be:
 if ((vmcb->general1_intercepts & GENERAL1_INTERCEPT_IRET) &&
     (intack.source == hvm_intsrc_nmi))
     return;

Which I think deals properly and specifically with this hang problem.

What do you think?

 -- Keir

On 07/05/2010 15:41, "Wei Wang2" <wei.wang2@amd.com> wrote:

> Hi,
> I had observed that if xen injects and intercepts VINTR during NMI shadow, and
> if the xen injects NMI into guest at a very hight frequency, guest vcpu will
> hang. Attached patch avoids VINTR injection when guest is handling a NMI.
> 
> Thanks,
> 
> Wei
> Signed-off-by: Wei Wang <wei.wang2@amd.com>
> Reviewed-by: Wei Huang<wei.huang2@amd.com>
> --
> Legal Information:
> Advanced Micro Devices GmbH
> Karl-Hammerschmidt-Str. 34
> 85609 Dornach b. München
> 
> Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
> Sitz: Dornach, Gemeinde Aschheim, Landkreis München
> Registergericht München, HRB Nr. 43632

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] svm: Avoid VINTR injection during NMI shadow
  2010-05-07 16:56 ` Keir Fraser
@ 2010-05-07 17:18   ` Wei Wang2
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Wang2 @ 2010-05-07 17:18 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Totally agree,  you are are right only NMI injection should be avoid.
I have tested that the new condition works well. Thanks.
Wei

On Friday 07 May 2010 18:56:32 Keir Fraser wrote:
> I think the if statement should be:
>  if ((vmcb->general1_intercepts & GENERAL1_INTERCEPT_IRET) &&
>      (intack.source == hvm_intsrc_nmi))
>      return;
>
> Which I think deals properly and specifically with this hang problem.
>
> What do you think?
>
>  -- Keir
>
> On 07/05/2010 15:41, "Wei Wang2" <wei.wang2@amd.com> wrote:
> > Hi,
> > I had observed that if xen injects and intercepts VINTR during NMI
> > shadow, and if the xen injects NMI into guest at a very hight frequency,
> > guest vcpu will hang. Attached patch avoids VINTR injection when guest is
> > handling a NMI.
> >
> > Thanks,
> >
> > Wei
> > Signed-off-by: Wei Wang <wei.wang2@amd.com>
> > Reviewed-by: Wei Huang<wei.huang2@amd.com>
> > --
> > Legal Information:
> > Advanced Micro Devices GmbH
> > Karl-Hammerschmidt-Str. 34
> > 85609 Dornach b. München
> >
> > Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
> > Sitz: Dornach, Gemeinde Aschheim, Landkreis München
> > Registergericht München, HRB Nr. 43632

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-07 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-07 14:41 [PATCH] svm: Avoid VINTR injection during NMI shadow Wei Wang2
2010-05-07 16:56 ` Keir Fraser
2010-05-07 17:18   ` Wei Wang2

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.