This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [SVM][PATCH] fix NMI vmexit handling

On 25 Jul 2006, at 20:58, Woller, Thomas wrote:

Attached SVM patch fixes a problem when an NMI is intercepted while
running an SVM guest.
Basically the NMI handler (do_nmi()) was being called twice, once when
global interrupts was enabled, and then second when the vmexit nmi
handler executed.
This patch moves enablement of the global interrupts (STGI) from the asm exits.S files to the vmexit handler (svm.c), and then enables interrupts
after the do_nmi() handling.

How does moving the STGI fix this double-nmi problem? The reference manual says that external interrupts are 'held pending' until delivery is enabled by the VMM. I can't see that do_nmi() does anything that would cause that pending status to be reset (local APIC isn't EOI'ed, or anything like that) and so I would expect that you would still get an NMI when STGI is executed, and all you've done is switch the order (the explicit call to do_nmi() happens before the STGI_triggered one). Am I wrong?

Another thing: the code you have under case VMEXIT_INTR, which raises schedule softirq, seems pointless. All interrupt work will happen in proper interrupt context triggered on STGI. Should the code under VMEXIT_INTR simply be removed?

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>