]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: arm/arm64: vgic: Don't rely on the wrong pending table
authorZenghui Yu <yuzenghui@huawei.com>
Tue, 29 Oct 2019 07:19:19 +0000 (15:19 +0800)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:27 +0000 (14:22 -0300)
commit8a38dcf50a7e5f2ad342e96aa4f88c782da9d031
treeb846317ff9b0c8728bbfcdff0bfe036569e1b1e2
parent4accd9219205bcafb1d60ad69dab5742f9cb717e
KVM: arm/arm64: vgic: Don't rely on the wrong pending table

BugLink: https://bugs.launchpad.net/bugs/1857158
commit ca185b260951d3b55108c0b95e188682d8a507b7 upstream.

It's possible that two LPIs locate in the same "byte_offset" but target
two different vcpus, where their pending status are indicated by two
different pending tables.  In such a scenario, using last_byte_offset
optimization will lead KVM relying on the wrong pending table entry.
Let us use last_ptr instead, which can be treated as a byte index into
a pending table and also, can be vcpu specific.

Fixes: 280771252c1b ("KVM: arm64: vgic-v3: KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES")
Cc: stable@vger.kernel.org
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20191029071919.177-4-yuzenghui@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
virt/kvm/arm/vgic/vgic-v3.c