[PATCH] arm64: kvm: Prevent restoring stale PMSCR_EL1 for vcpu
Will Deacon
will.deacon at arm.com
Wed Dec 6 09:25:51 PST 2017
On Wed, Dec 06, 2017 at 05:09:49PM +0000, Julien Thierry wrote:
> When VHE is not present, KVM needs to save and restores PMSCR_EL1 when
> possible. If SPE is used by the host, value of PMSCR_EL1 cannot be saved
> for the guest.
> If the host starts using SPE between two save+restore on the same vcpu,
> restore will write the value of PMSCR_EL1 read during the first save.
>
> Make sure __debug_save_spe_nvhe clears the value of the saved PMSCR_EL1
> when the guest cannot use SPE.
Ok, so the problem is that we have a stale (non-zero) saved pmscr_el1,
and therefore the restore code unconditionally restores that even though
SPE is no longer in use by the host. Well spotted!
> Signed-off-by: Julien Thierry <julien.thierry at arm.com>
> Cc: Christoffer Dall <christoffer.dall at linaro.org>
> Cc: Marc Zyngier <marc.zyngier at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Will Deacon <will.deacon at arm.com>
> Cc: <stable at vger.kernel.org>
> ---
> arch/arm64/kvm/hyp/debug-sr.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Will Deacon <will.deacon at arm.com>
Will
More information about the linux-arm-kernel
mailing list