Skip to content

Commit 0f0ff09

Browse files
willdeaconoupton
authored andcommitted
KVM: arm64: Use TLBI_TTL_UNKNOWN in __kvm_tlb_flush_vmid_range()
Commit c910f2b ("arm64/mm: Update tlb invalidation routines for FEAT_LPA2") updated the __tlbi_level() macro to take the target level as an argument, with TLBI_TTL_UNKNOWN (rather than 0) indicating that the caller cannot provide level information. Unfortunately, the two implementations of __kvm_tlb_flush_vmid_range() were not updated and so now ask for an level 0 invalidation if FEAT_LPA2 is implemented. Fix the problem by passing TLBI_TTL_UNKNOWN instead of 0 as the level argument to __flush_s2_tlb_range_op() in __kvm_tlb_flush_vmid_range(). Cc: Catalin Marinas <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Marc Zyngier <[email protected]> Reviewed-by: Ryan Roberts <[email protected]> Fixes: c910f2b ("arm64/mm: Update tlb invalidation routines for FEAT_LPA2") Signed-off-by: Will Deacon <[email protected]> Reviewed-by: Shaoqin Huang <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 36e0083 commit 0f0ff09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,
154154
/* Switch to requested VMID */
155155
__tlb_switch_to_guest(mmu, &cxt, false);
156156

157-
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0);
157+
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride,
158+
TLBI_TTL_UNKNOWN);
158159

159160
dsb(ish);
160161
__tlbi(vmalle1is);

arch/arm64/kvm/hyp/vhe/tlb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ void __kvm_tlb_flush_vmid_range(struct kvm_s2_mmu *mmu,
171171
/* Switch to requested VMID */
172172
__tlb_switch_to_guest(mmu, &cxt);
173173

174-
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride, 0);
174+
__flush_s2_tlb_range_op(ipas2e1is, start, pages, stride,
175+
TLBI_TTL_UNKNOWN);
175176

176177
dsb(ish);
177178
__tlbi(vmalle1is);

0 commit comments

Comments
 (0)