]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/arm_gicv3: fix prio masking on pmr write
authorJens Wiklander <jens.wiklander@linaro.org>
Mon, 14 Nov 2022 15:10:58 +0000 (15:10 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 14 Nov 2022 15:10:58 +0000 (15:10 +0000)
commitd9721f19cd05a382f4f5a7093c80d1c4a8a1aa82
treeebbd542126edded7e8221816f87d5bd50ae59114
parent32bd99d02b4549d1007fb26b7301d26c55e3ba5a
hw/intc/arm_gicv3: fix prio masking on pmr write

With commit 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of
priority bits for the CPU") the number of priority bits was changed from
the maximum value 8 to typically 5. As a consequence a few of the lowest
bits in ICC_PMR_EL1 becomes RAZ/WI. However prior to this patch one of
these bits was still used since the supplied priority value is masked
before it's eventually right shifted with one bit. So the bit is not
lost as one might expect when the register is read again.

The Linux kernel depends on lowest valid bit to be reset to zero, see
commit 33625282adaa ("irqchip/gic-v3: Probe for SCR_EL3 being clear
before resetting AP0Rn") for details.

So fix this by masking the priority value after it may have been right
shifted by one bit.

Cc: qemu-stable@nongnu.org
Fixes: 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of priority bits for the CPU")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gicv3_cpuif.c