]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 6 Mar 2018 21:44:37 +0000 (21:44 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 14 Mar 2018 18:31:26 +0000 (18:31 +0000)
commit2d99a33373b348c97a41b0f2389b918082095dfc
tree182d51d28baa7ab42884117c37e53b2eebe8675a
parente8035e93644208a30d34aae837f1b96a85736e3a
kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3

On guest exit, and when using GICv2 on GICv3, we use a dsb(st) to
force synchronization between the memory-mapped guest view and
the system-register view that the hypervisor uses.

This is incorrect, as the spec calls out the need for "a DSB whose
required access type is both loads and stores with any Shareability
attribute", while we're only synchronizing stores.

We also lack an isb after the dsb to ensure that the latter has
actually been executed before we start reading stuff from the sysregs.

The fix is pretty easy: turn dsb(st) into dsb(sy), and slap an isb()
just after.

Cc: stable@vger.kernel.org
Fixes: b1e5240c40e7 ("arm64: KVM: Implement vgic-v3 save/restore")
Acked-by: Christoffer Dall <cdall@kernel.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/hyp/vgic-v3-sr.c