From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T33E4-0005vq-AD for qemu-devel@nongnu.org; Sun, 19 Aug 2012 06:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T33E3-0005uS-9f for qemu-devel@nongnu.org; Sun, 19 Aug 2012 06:59:24 -0400 Received: from gir.skynet.ie ([193.1.99.77]:60404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T33E3-0005uJ-3h for qemu-devel@nongnu.org; Sun, 19 Aug 2012 06:59:23 -0400 From: Brendan Fennell Date: Sun, 19 Aug 2012 11:59:10 +0100 Message-Id: <1345373950-16276-1-git-send-email-bfennell@skynet.ie> Subject: [Qemu-devel] [PATCH v2] pl190: fix read of VECTADDR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, bfennell@skynet.ieqemu-devel@nongnu.org Cc: peter.maydell@linaro.org Signed-off-by: Brendan Fennell --- hw/pl190.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pl190.c b/hw/pl190.c index cb50afb..eddb531 100644 --- a/hw/pl190.c +++ b/hw/pl190.c @@ -120,7 +120,8 @@ static uint64_t pl190_read(void *opaque, target_phys_addr_t offset, current priority level to that of the current interrupt. */ for (i = 0; i < s->priority; i++) { - if ((s->level | s->soft_level) & s->prio_mask[i]) + /* Ensure that 'i' is current highest priority interrupt on exit */ + if ((s->level | s->soft_level) & s->prio_mask[i+1]) break; } /* Reading this value with no pending interrupts is undefined. -- 1.7.2.5