]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - virt/kvm/arm/hyp/vgic-v3-sr.c
KVM: arm/arm64: vgic-v3: Use PREbits to infer the number of ICH_APxRn_EL2 registers
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 2 May 2017 13:30:41 +0000 (14:30 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 9 Aug 2017 14:47:34 +0000 (16:47 +0200)
commit70fc14779b920c24a0a14337c8c5e3382414a387
treeca5a98aa1699bb056a47c18b0b96b5bc368063c2
parent91fe9cc6928106bd62aed6223d6e2dc6cb7eea08
KVM: arm/arm64: vgic-v3: Use PREbits to infer the number of ICH_APxRn_EL2 registers

BugLink: https://bugs.launchpad.net/bugs/1673564
The GICv3 documentation is extremely confusing, as it talks about
the number of priorities represented by the ICH_APxRn_EL2 registers,
while it should really talk about the number of preemption levels.

This leads to a bug where we may access undefined ICH_APxRn_EL2
registers, since PREbits is allowed to be smaller than PRIbits.
Thankfully, nobody seem to have taken this path so far...

The fix is to use ICH_VTR_EL2.PREbits instead.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
(backported from commit 15d2bffdde6268883647c6112970f74d3e1af651)
[ dannf: trivial context fixes ]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
virt/kvm/arm/hyp/vgic-v3-sr.c