]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commit
target-arm: Fix errors in writes to generic timer control registers
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 9 Jun 2014 14:43:26 +0000 (15:43 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 5 Aug 2014 18:33:30 +0000 (13:33 -0500)
commit27fb65dd1b040bb68d44a7ce24d8527df2a57fbc
tree884121bfe3970f7851cdeacec086d802478c608d
parent6ea80edc0165a11060b5e13d62e81630abbc5d25
target-arm: Fix errors in writes to generic timer control registers

The code for handling writes to the generic timer control registers
had several bugs:
 * ISTATUS (bit 2) is read-only but we forced it to zero on any write
 * the check for "was IMASK (bit 1) toggled?" incorrectly used '&' where
   it should be '^'
 * the handling of IMASK was inverted: we should set the IRQ if
   ISTATUS is set and IMASK is clear, not if both are set

The combination of these bugs meant that when running a Linux guest
that uses the generic timers we would fairly quickly end up either
forgetting that the timer output should be asserted, or failing to
set the IRQ when the timer was unmasked. The result is that the guest
never gets any more timer interrupts.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1401803208-1281-1-git-send-email-peter.maydell@linaro.org
Cc: qemu-stable@nongnu.org
(cherry picked from commit d3afacc7269fee45d54d1501a46b51f12ea7bb15)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-arm/helper.c