Re: [PATCH] KVM: arm64: Skip CMOs when updating a PTE pointing to non-memory
From: Marc Zyngier <maz@kernel.org>
Date: 2021-04-26 10:42:55
Also in:
kvm, kvmarm
From: Marc Zyngier <maz@kernel.org>
Date: 2021-04-26 10:42:55
Also in:
kvm, kvmarm
On 2021-04-26 11:36, Marc Zyngier wrote:
Sumit Gupta and Krishna Reddy both reported that for MMIO regions mapped into userspace using VFIO, a PTE update can trigger a MMU notifier reaching kvm_set_spte_hva(). There is an assumption baked in kvm_set_spte_hva() that it only deals with memory pages, and not MMIO. For this purpose, it performs a cache cleaning of the potentially newly mapped page. However, for a MMIO range, this explodes as there is no linear mapping for this range (and doing cache maintenance on it would make little sense anyway). Check for the validity of the page before performing the CMO addresses the problem. Reported-by: Krishna Reddy <vdumpa@nvidia.com> Reported-by: Sumit Gupta <sumitg@nvidia.com>, Tested-by: Sumit Gupta <sumitg@nvidia.com>, Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/5a8825bc-286e-b316-515f-3bd3c9c70a80@nvidia.com (local)
FWIW, I've locally added:
Fixes: 694556d54f35 ("KVM: arm/arm64: Clean dcache to PoC when changing
PTE due to CoW")
Cc: stable@vger.kernel.org
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel