linux-stable/arch/arm64
Will Deacon f62d4c3eb6 KVM: arm64: Don't defer TLB invalidation when zapping table entries
Commit 7657ea920c ("KVM: arm64: Use TLBI range-based instructions for
unmap") introduced deferred TLB invalidation for the stage-2 page-table
so that range-based invalidation can be used for the accumulated
addresses. This works fine if the structure of the page-tables remains
unchanged, but if entire tables are zapped and subsequently freed then
we transiently leave the hardware page-table walker with a reference
to freed memory thanks to the translation walk caches. For example,
stage2_unmap_walker() will free page-table pages:

	if (childp)
		mm_ops->put_page(childp);

and issue the TLB invalidation later in kvm_pgtable_stage2_unmap():

	if (stage2_unmap_defer_tlb_flush(pgt))
		/* Perform the deferred TLB invalidations */
		kvm_tlb_flush_vmid_range(pgt->mmu, addr, size);

For now, take the conservative approach and invalidate the TLB eagerly
when we clear a table entry. Note, however, that the existing level
hint passed to __kvm_tlb_flush_vmid_ipa() is incorrect and will be
fixed in a subsequent patch.

Cc: Raghavendra Rao Ananta <rananta@google.com>
Cc: Shaoqin Huang <shahuang@redhat.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240327124853.11206-2-will@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2024-04-01 01:30:45 -07:00
..
boot USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
configs arm64 updates for 6.9: 2024-03-14 15:35:42 -07:00
crypto This update includes the following changes: 2024-03-15 14:46:54 -07:00
hyperv x86/hyperv: Use Hyper-V entropy to seed guest random number generator 2024-03-18 22:01:52 +00:00
include hyperv-next for v6.9 2024-03-21 10:01:02 -07:00
kernel S390: 2024-03-15 13:03:13 -07:00
kvm KVM: arm64: Don't defer TLB invalidation when zapping table entries 2024-04-01 01:30:45 -07:00
lib arm64: Get rid of ARM64_HAS_NO_HW_PREFETCH 2023-12-05 12:02:52 +00:00
mm - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
net arm64, bpf: Use bpf_prog_pack for arm64 bpf trampoline 2024-03-09 08:39:55 -08:00
tools S390: 2024-03-15 13:03:13 -07:00
xen
Kbuild
Kconfig arm64 fix/update: 2024-03-21 17:21:41 -07:00
Kconfig.debug
Kconfig.platforms
Makefile arm64: rust: Enable Rust support for AArch64 2024-02-09 16:12:36 +00:00