OSDN Git Service

KVM: arm/arm64: VGIC: Fix command handling while ITS being disabled
authorAndre Przywara <andre.przywara@arm.com>
Thu, 16 Feb 2017 10:41:20 +0000 (10:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:28:19 +0000 (09:28 +0100)
commitb1f71147a1883fff0535f1bd12fca3839e54aadc
tree5f4ab6e9e89f1269d35bf6f4133f0177cc0b6ea2
parentaafb72d2ed5579208191cfc3fb9425570c1303ce
KVM: arm/arm64: VGIC: Fix command handling while ITS being disabled

[ Upstream commit a5e1e6ca94a8cec51571fd62e3eaec269717969c ]

The ITS spec says that ITS commands are only processed when the ITS
is enabled (section 8.19.4, Enabled, bit[0]). Our emulation was not taking
this into account.
Fix this by checking the enabled state before handling CWRITER writes.

On the other hand that means that CWRITER could advance while the ITS
is disabled, and enabling it would need those commands to be processed.
Fix this case as well by refactoring actual command processing and
calling this from both the GITS_CWRITER and GITS_CTLR handlers.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/arm/vgic/vgic-its.c