Skip to content

Commit c42b6f0

Browse files
rananta468Marc Zyngier
authored andcommitted
KVM: arm64: Implement kvm_arch_flush_remote_tlbs_range()
Implement kvm_arch_flush_remote_tlbs_range() for arm64 to invalidate the given range in the TLB. Signed-off-by: Raghavendra Rao Ananta <rananta@google.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Reviewed-by: Shaoqin Huang <shahuang@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230811045127.3308641-12-rananta@google.com
1 parent 117940a commit c42b6f0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,8 @@ struct kvm *kvm_arch_alloc_vm(void);
11151115

11161116
#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS
11171117

1118+
#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS_RANGE
1119+
11181120
static inline bool kvm_vm_is_protected(struct kvm *kvm)
11191121
{
11201122
return false;

arch/arm64/kvm/mmu.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ int kvm_arch_flush_remote_tlbs(struct kvm *kvm)
172172
return 0;
173173
}
174174

175+
int kvm_arch_flush_remote_tlbs_range(struct kvm *kvm,
176+
gfn_t gfn, u64 nr_pages)
177+
{
178+
kvm_tlb_flush_vmid_range(&kvm->arch.mmu,
179+
gfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
180+
return 0;
181+
}
182+
175183
static bool kvm_is_device_pfn(unsigned long pfn)
176184
{
177185
return !pfn_is_map_memory(pfn);

0 commit comments

Comments
 (0)