Re: [PATCH v6 02/11] KVM: arm64: Use kvm_arch_flush_remote_tlbs()

From: Philippe Mathieu-Daudé
Date: Mon Jul 17 2023 - 04:13:17 EST


Hi Raghavendra, David,

On 15/7/23 02:53, Raghavendra Rao Ananta wrote:
From: David Matlack <dmatlack@xxxxxxxxxx>

Use kvm_arch_flush_remote_tlbs() instead of
CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL. The two mechanisms solve the same
problem, allowing architecture-specific code to provide a non-IPI
implementation of remote TLB flushing.

Dropping CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL allows KVM to standardize
all architectures on kvm_arch_flush_remote_tlbs() instead of maintaining
two mechanisms.

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: David Matlack <dmatlack@xxxxxxxxxx>
Signed-off-by: Raghavendra Rao Ananta <rananta@xxxxxxxxxx>
Reviewed-by: Zenghui Yu <zenghui.yu@xxxxxxxxx>
Acked-by: Oliver Upton <oliver.upton@xxxxxxxxx>
Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
---
arch/arm64/include/asm/kvm_host.h | 3 +++
arch/arm64/kvm/Kconfig | 1 -
arch/arm64/kvm/mmu.c | 6 +++---
virt/kvm/Kconfig | 3 ---
virt/kvm/kvm_main.c | 2 --
5 files changed, 6 insertions(+), 9 deletions(-)

You are doing 2 changes in the same patch:

- Have ARM use kvm_arch_flush_remote_tlbs() instead of
HAVE_KVM_ARCH_TLB_FLUSH_ALL,
- Drop the now unused HAVE_KVM_ARCH_TLB_FLUSH_ALL.

Commits should be atomic, to allow partial
revert or cherry-pick.

Preferably splitting this patch in 2:
Reviewed-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>

Regards,

Phil.