Skip to content

Commit 8442d65

Browse files
author
Marc Zyngier
committed
KVM: arm64: pkvm: Document the side effects of kvm_flush_dcache_to_poc()
We rely on the presence of a DSB at the end of kvm_flush_dcache_to_poc() that, on top of ensuring completion of the cache clean, also covers the speculative page table walk started from EL1. Document this dependency. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
1 parent 7e1b232 commit 8442d65

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

arch/arm64/kvm/hyp/nvhe/mem_protect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ int __pkvm_prot_finalize(void)
297297
params->vttbr = kvm_get_vttbr(mmu);
298298
params->vtcr = host_mmu.arch.vtcr;
299299
params->hcr_el2 |= HCR_VM;
300+
301+
/*
302+
* The CMO below not only cleans the updated params to the
303+
* PoC, but also provides the DSB that ensures ongoing
304+
* page-table walks that have started before we trapped to EL2
305+
* have completed.
306+
*/
300307
kvm_flush_dcache_to_poc(params, sizeof(*params));
301308

302309
write_sysreg(params->hcr_el2, hcr_el2);

0 commit comments

Comments
 (0)