]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Do not flush memslot if FWB is supported
authorAlexandru Elisei <alexandru.elisei@arm.com>
Tue, 15 Sep 2020 17:04:42 +0000 (18:04 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 18 Sep 2020 15:18:24 +0000 (16:18 +0100)
commit2c6e418a503522e0ba19407b9719a51fafe13cd6
tree3f8ccb7a0cf659f19c2e49cb8e00177418895190
parent779de9a46cc7a87061ba222a9796ede5f98bddb5
KVM: arm64: Do not flush memslot if FWB is supported

As a result of a KVM_SET_USER_MEMORY_REGION ioctl, KVM flushes the
dcache for the memslot being changed to ensure a consistent view of memory
between the host and the guest: the host runs with caches enabled, and
it is possible for the data written by the hypervisor to still be in the
caches, but the guest is running with stage 1 disabled, meaning data
accesses are to Device-nGnRnE memory, bypassing the caches entirely.

Flushing the dcache is not necessary when KVM enables FWB, because it
forces the guest to uses cacheable memory accesses.

The current behaviour does not change, as the dcache flush helpers execute
the cache operation only if FWB is not enabled, but walking the stage 2
table is avoided.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200915170442.131635-1-alexandru.elisei@arm.com
arch/arm64/kvm/mmu.c