Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH 0/6] LoongArch: KVM: Add separate vmid support
@ 2026-07-27  7:21 Bibo Mao
  2026-07-27  7:21 ` [PATCH 1/6] LoongArch: KVM: Add vmid support for stage2 MMU Bibo Mao
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Bibo Mao @ 2026-07-27  7:21 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Sean Christopherson, Paolo Bonzini, WANG Xuerui, Arnd Bergmann,
	Xi Ruoyao, kvm, loongarch, linux-kernel

LoongArch KVM hypervisor supports two-level MMU, vpid index is used
for stage1 MMU and vmid index is used for stage2 MMU.

On 3A5000, vmid must be the same with vpid. On 3A6000 platform vmid
may separate from vpid. There are such advantages if separate vmid
is supported.
  1. One VM uses one vmid, vCPUs on the same VM can share the same vmid.
  2. If one vCPU switch between different physical CPU, old vmid can be
     still useful if the old vmid is not expired
  3. For remote tlb flush, it is to flush TLBs which are mapping
     GPA --> HPA, only vmid need update and vpid need not.

Here add separate vmid feature support, vmid feature detecting method
comes from LVZ version with 2 and LVZ is enabled.

Bibo Mao (6):
  LoongArch: KVM: Add vmid support for stage2 MMU
  LoongArch: KVM: Add separate vCPU and VM id update function
  LoongArch: KVM: Add separate vmid feature support
  LoongArch: KVM: implement vmid updating logic
  LoongArch: KVM: Add remote tlb flushing support
  LoongArch: KVM: Enable separate vmid feature

 arch/loongarch/include/asm/kvm_host.h  | 10 ++++
 arch/loongarch/include/asm/loongarch.h |  2 +
 arch/loongarch/kernel/asm-offsets.c    |  1 +
 arch/loongarch/kernel/cpu-probe.c      |  7 ++-
 arch/loongarch/kvm/main.c              | 76 ++++++++++++++++++++++++--
 arch/loongarch/kvm/mmu.c               | 16 ++++++
 arch/loongarch/kvm/switch.S            |  5 +-
 arch/loongarch/kvm/tlb.c               | 19 ++++++-
 arch/loongarch/kvm/vcpu.c              |  7 ++-
 9 files changed, 133 insertions(+), 10 deletions(-)


base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
-- 
2.39.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-27  7:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27  7:21 [PATCH 0/6] LoongArch: KVM: Add separate vmid support Bibo Mao
2026-07-27  7:21 ` [PATCH 1/6] LoongArch: KVM: Add vmid support for stage2 MMU Bibo Mao
2026-07-27  7:21 ` [PATCH 2/6] LoongArch: KVM: Add separate vCPU and VM id update function Bibo Mao
2026-07-27  7:21 ` [PATCH 3/6] LoongArch: KVM: Add separate vmid feature support Bibo Mao
2026-07-27  7:42   ` sashiko-bot
2026-07-27  7:21 ` [PATCH 4/6] LoongArch: KVM: implement vmid updating logic Bibo Mao
2026-07-27  7:49   ` sashiko-bot
2026-07-27  7:21 ` [PATCH 5/6] LoongArch: KVM: Add remote tlb flushing support Bibo Mao
2026-07-27  7:46   ` sashiko-bot
2026-07-27  7:21 ` [PATCH 6/6] LoongArch: KVM: Enable separate vmid feature Bibo Mao
2026-07-27  7:40   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox