Patchwork [6/7] pseries: Fix some small errors in XICS logic

login
register
mail settings
Submitter David Gibson
Date April 8, 2013, 5:08 a.m.
Message ID <1365397702-1515-7-git-send-email-david@gibson.dropbear.id.au>
Download mbox | patch
Permalink /patch/234572/
State New
Headers show

Comments

David Gibson - April 8, 2013, 5:08 a.m.
Under certain circumstances the emulation for the pseries "XICS" interrupt
controller was clearing a pending interrupt from the XISR register, without
also clearing the corresponding priority variable.  This will cause
problems later when can trigger sanity checks in the under-development
in-kernel XICS implementation.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/xics.c |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/hw/ppc/xics.c b/hw/ppc/xics.c
index 374da5b..207691b 100644
--- a/hw/ppc/xics.c
+++ b/hw/ppc/xics.c
@@ -101,6 +101,7 @@  static void icp_set_cppr(struct icp_state *icp, int server, uint8_t cppr)
         if (XISR(ss) && (cppr <= ss->pending_priority)) {
             old_xisr = XISR(ss);
             ss->xirr &= ~XISR_MASK; /* Clear XISR */
+            ss->pending_priority = 0xff;
             qemu_irq_lower(ss->output);
             ics_reject(icp->ics, old_xisr);
         }
@@ -127,6 +128,7 @@  static uint32_t icp_accept(struct icp_server_state *ss)
 
     qemu_irq_lower(ss->output);
     ss->xirr = ss->pending_priority << 24;
+    ss->pending_priority = 0xff;
 
     trace_xics_icp_accept(xirr, ss->xirr);