Skip to content

RFC KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs()

Peter Xu kvm linux-mips lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: Provide kvm_flush_remote_tlbs_common()include/linux/kvm_host.h virt/kvm/kvm_main.c+9 -21 reply
2/4KVM: MIPS: Drop flush_shadow_memslot() callbackarch/mips/include/asm/kvm_host.h arch/mips/kvm/mips.c arch/mips/kvm/trap_emul.c +1 more+4 -250 replies
3/4KVM: MIPS: Replace all the kvm_flush_remote_tlbs() referencesarch/mips/kvm/trap_emul.c arch/mips/kvm/vz.c+3 -120 replies
4/4KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs()arch/mips/kvm/Kconfig arch/mips/kvm/mips.c+11 -123 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/4] KVM: MIPS: Provide arch-specific kvm_flush_remote_tlbs()

[This series is RFC because I don't have MIPS to compile and test]

kvm_flush_remote_tlbs() can be arch-specific, by either:

- Completely replace kvm_flush_remote_tlbs(), like ARM, who is the only user of CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL so far

- Doing something extra before kvm_flush_remote_tlbs(), like MIPS VZ support, however still wants to have the common tlb flush to be part of the process. Could refer to kvm_vz_flush_shadow_all(). Then in MIPS it's awkward to flush remote TLBs: we'll need to call the mips hooks.

It's awkward to have different ways to specialize this procedure, especially MIPS cannot use the genenal interface which is quite a pity. It's good to make it a common interface.

This patch series removes the 2nd MIPS usage above, and let it also use the common kvm_flush_remote_tlbs() interface. It should be suggested that we always keep kvm_flush_remote_tlbs() be a common entrance for tlb flushing on all archs.

This idea comes from the reading of Sean's patchset on dynamic memslot allocation, where a new dirty log specific hook is added for flushing TLBs only for the MIPS code [1]. With this patchset, logically the new hook in that patch can be dropped so we can directly use kvm_flush_remote_tlbs().

TODO: We can even extend another common interface for ranged TLB, but let's see how we think about this series first.

Any comment is welcomed, thanks.

Peter Xu (4):
KVM: Provide kvm_flush_remote_tlbs_common()
KVM: MIPS: Drop flush_shadow_memslot() callback
KVM: MIPS: Replace all the kvm_flush_remote_tlbs() references
KVM: MIPS: Define arch-specific kvm_flush_remote_tlbs()

 arch/mips/include/asm/kvm_host.h |  7 -------
 arch/mips/kvm/Kconfig            |  1 +
 arch/mips/kvm/mips.c             | 22 ++++++++++------------
 arch/mips/kvm/trap_emul.c        | 15 +--------------
 arch/mips/kvm/vz.c               | 14 ++------------
 include/linux/kvm_host.h         |  1 +
 virt/kvm/kvm_main.c              | 10 ++++++++--
 7 files changed, 23 insertions(+), 47 deletions(-)
Signature · 1 line
2.24.1