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

Philippe Mathieu-Daudé philmd at linaro.org
Mon Jul 17 01:12:57 PDT 2023


Hi Raghavendra, David,

On 15/7/23 02:53, Raghavendra Rao Ananta wrote:
> From: David Matlack <dmatlack at google.com>
> 
> 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 at google.com>
> Signed-off-by: Raghavendra Rao Ananta <rananta at google.com>
> Reviewed-by: Zenghui Yu <zenghui.yu at linux.dev>
> Acked-by: Oliver Upton <oliver.upton at linux.dev>
> Reviewed-by: Gavin Shan <gshan at redhat.com>
> ---
>   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 at linaro.org>

Regards,

Phil.




More information about the kvm-riscv mailing list