]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: properly use vcpu requests
authorAndrew Jones <drjones@redhat.com>
Sun, 4 Jun 2017 12:43:54 +0000 (14:43 +0200)
committerChristoffer Dall <cdall@linaro.org>
Sun, 4 Jun 2017 14:53:47 +0000 (16:53 +0200)
commit55bd83e47235be2122e272c8e22f8b5e5f0de024
tree77e46462337671cb0ca513fef8801366cfca632e
parent1965084173f63a290e3927b747c0fc5c806b6479
KVM: arm/arm64: properly use vcpu requests

arm/arm64 already has one VCPU request used when setting pause,
but it doesn't properly check requests in VCPU RUN. Check it
and also make sure we set vcpu->mode at the appropriate time
(before the check) and with the appropriate barriers. See
Documentation/virtual/kvm/vcpu-requests.rst. Also make sure we
don't leave any vcpu requests we don't intend to handle later
set in the request bitmap. If we don't clear them, then
kvm_request_pending() may return true when it shouldn't.

Using VCPU requests properly fixes a small race where pause
could get set just as a VCPU was entering guest mode.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/kvm/handle_exit.c
arch/arm64/kvm/handle_exit.c
virt/kvm/arm/arm.c
virt/kvm/arm/psci.c