hw/arm/virt: Don't incorrectly claim architectural timer to be edge-triggered
commit156bc9a5ea877e8252a07f35543a24157d4ab822
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 9 Jan 2017 11:40:21 +0000 (9 11:40 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 9 Jan 2017 11:40:21 +0000 (9 11:40 +0000)
tree4c12acbb0e02224a81b5c4140fb88a4e77f0ffe2
parentc8ef2bda05af317819427c2fde7ebf061129c142
hw/arm/virt: Don't incorrectly claim architectural timer to be edge-triggered

The architectural timers in ARM CPUs all have level triggered interrupts
(unless you're using KVM on a host kernel before 4.4, which misimplemented
them as edge-triggered).

We were incorrectly describing them in the device tree as edge triggered.
This can cause problems for guest kernels in 4.8 before rc6:
 * pre-4.8 kernels ignore the values in the DT
 * 4.8 before rc6 write the DT values to the GIC config registers
 * newer than rc6 ignore the DT and insist that the timer interrupts
   are level triggered regardless

Fix the DT so we're describing reality. For backwards-compatibility
purposes, only do this for the virt-2.9 machine onward.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
hw/arm/virt.c