]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
arm/arm64: KVM: Keep elrsr/aisr in sync with software model
authorChristoffer Dall <christoffer.dall@linaro.org>
Fri, 13 Mar 2015 17:02:56 +0000 (17:02 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Sat, 14 Mar 2015 12:42:07 +0000 (13:42 +0100)
commitae705930fca6322600690df9dc1c7d0516145a93
treefbcd8af3ba6bf67bf693bca8933cb98d23e07d11
parentb52104e509479c4709eb9d81642df77c5ef2716b
arm/arm64: KVM: Keep elrsr/aisr in sync with software model

There is an interesting bug in the vgic code, which manifests itself
when the KVM run loop has a signal pending or needs a vmid generation
rollover after having disabled interrupts but before actually switching
to the guest.

In this case, we flush the vgic as usual, but we sync back the vgic
state and exit to userspace before entering the guest.  The consequence
is that we will be syncing the list registers back to the software model
using the GICH_ELRSR and GICH_EISR from the last execution of the guest,
potentially overwriting a list register containing an interrupt.

This showed up during migration testing where we would capture a state
where the VM has masked the arch timer but there were no interrupts,
resulting in a hung test.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Reported-by: Alex Bennee <alex.bennee@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
include/kvm/arm_vgic.h
virt/kvm/arm/vgic-v2.c
virt/kvm/arm/vgic-v3.c
virt/kvm/arm/vgic.c