Skip to content

Commit 32121c8

Browse files
rananta468Marc Zyngier
authored andcommitted
KVM: arm64: Use kvm_arch_flush_remote_tlbs()
Stop depending on CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL and opt to standardize on kvm_arch_flush_remote_tlbs() since it avoids duplicating the generic TLB stats across architectures that implement their own remote TLB flush. This adds an extra function call to the ARM64 kvm_flush_remote_tlbs() path, but that is a small cost in comparison to flushing remote TLBs. In addition, instead of just incrementing remote_tlb_flush_requests stat, the generic interface would also increment the remote_tlb_flush stat. Signed-off-by: Raghavendra Rao Ananta <[email protected]> Reviewed-by: Shaoqin Huang <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cfb0c08 commit 32121c8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,8 @@ int __init kvm_set_ipa_limit(void);
11131113
#define __KVM_HAVE_ARCH_VM_ALLOC
11141114
struct kvm *kvm_arch_alloc_vm(void);
11151115

1116+
#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS
1117+
11161118
static inline bool kvm_vm_is_protected(struct kvm *kvm)
11171119
{
11181120
return false;

arch/arm64/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ menuconfig KVM
2525
select MMU_NOTIFIER
2626
select PREEMPT_NOTIFIERS
2727
select HAVE_KVM_CPU_RELAX_INTERCEPT
28-
select HAVE_KVM_ARCH_TLB_FLUSH_ALL
2928
select KVM_MMIO
3029
select KVM_GENERIC_DIRTYLOG_READ_PROTECT
3130
select KVM_XFER_TO_GUEST_WORK

arch/arm64/kvm/mmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ static bool memslot_is_logging(struct kvm_memory_slot *memslot)
161161
}
162162

163163
/**
164-
* kvm_flush_remote_tlbs() - flush all VM TLB entries for v7/8
164+
* kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for v7/8
165165
* @kvm: pointer to kvm structure.
166166
*
167167
* Interface to HYP function to flush all VM TLB entries
168168
*/
169-
void kvm_flush_remote_tlbs(struct kvm *kvm)
169+
int kvm_arch_flush_remote_tlbs(struct kvm *kvm)
170170
{
171-
++kvm->stat.generic.remote_tlb_flush_requests;
172171
kvm_call_hyp(__kvm_tlb_flush_vmid, &kvm->arch.mmu);
172+
return 0;
173173
}
174174

175175
static bool kvm_is_device_pfn(unsigned long pfn)

0 commit comments

Comments
 (0)