qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5643] Fix interrupt exclusion via SSTEP_NOIRQ
@ 2008-11-06 18:54 malc
  0 siblings, 0 replies; only message in thread
From: malc @ 2008-11-06 18:54 UTC (permalink / raw)
  To: qemu-devel

Revision: 5643
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5643
Author:   malc
Date:     2008-11-06 18:54:46 +0000 (Thu, 06 Nov 2008)

Log Message:
-----------
Fix interrupt exclusion via SSTEP_NOIRQ

Commit #5620 revealed an issue of the SSTEP_NOIRQ masking that was
applied on all interrupt sources (including internal ones) when single
stepping through the guest. Due to that commit, we now ended up in an
infinite loop when CPU_INTERRUPT_EXIT was pending on SSTEP resume. That
was due to #5620 eating all TBs while CPU_INTERRUPT_EXIT is pending, but
SSTEP_NOIRQ preventing CPU_INTERRUPT_EXIT to be processed.

What SSTEP_NOIRQ should actually do is to block the delivery of all
external, guest visible interrupts. With the fix below applied, single
stepping now works again.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Modified Paths:
--------------
    trunk/cpu-exec.c

Modified: trunk/cpu-exec.c
===================================================================
--- trunk/cpu-exec.c	2008-11-06 16:15:18 UTC (rev 5642)
+++ trunk/cpu-exec.c	2008-11-06 18:54:46 UTC (rev 5643)
@@ -384,8 +384,14 @@
             next_tb = 0; /* force lookup of first TB */
             for(;;) {
                 interrupt_request = env->interrupt_request;
-                if (unlikely(interrupt_request) &&
-                    likely(!(env->singlestep_enabled & SSTEP_NOIRQ))) {
+                if (unlikely(interrupt_request)) {
+                    if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) {
+                        /* Mask out external interrupts for this step. */
+                        interrupt_request &= ~(CPU_INTERRUPT_HARD |
+                                               CPU_INTERRUPT_FIQ |
+                                               CPU_INTERRUPT_SMI |
+                                               CPU_INTERRUPT_NMI);
+                    }
                     if (interrupt_request & CPU_INTERRUPT_DEBUG) {
                         env->interrupt_request &= ~CPU_INTERRUPT_DEBUG;
                         env->exception_index = EXCP_DEBUG;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-06 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06 18:54 [Qemu-devel] [5643] Fix interrupt exclusion via SSTEP_NOIRQ malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).