All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] target/loongarch: advertise pv features per vCPU
@ 2026-07-10  0:50 Tao Cui
  2026-07-10  0:50 ` [PATCH v2 1/3] target/loongarch/kvm: " Tao Cui
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Tao Cui @ 2026-07-10  0:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Song Gao, Bibo Mao, Jiaxun Yang, Paolo Bonzini,
	Philippe Mathieu-Daudé, Tao Cui

From: Tao Cui <cuitao@kylinos.cn>

kvm_set_pv_features() programs the KVM_FEATURE cpucfg attribute, which is a
per-vCPU setting, but it was called from kvm_arch_put_registers() under a
function-local static guard and so ran only once for the whole VM: only the
first vCPU got its pv features pushed to KVM, and on SMP guests the others
never saw KVM_FEATURE_IPI / KVM_FEATURE_STEAL_TIME.

  1/3: drop the static guard and push pv features per vCPU under
       KVM_PUT_FULL_STATE, like kvm_set_stealtime(); host detection stays in
       kvm_arch_init_vcpu().
  2/3: add pv_features (the value of pseudo-register CPUCFG_KVM_FEATURE) to
       the vCPU VMState as a subsection so it travels across migration.
  3/3: add a no_pv_feature compat flag (LoongArchCPU + virt machine class)
       so the new behavior is gated per machine version: 11.1 keeps pv
       advertisement off, the new 11.2 enables it.

Compiled and boot-tested on a loongarch64 KVM host; migration verified
virt-11.2->virt-11.2 and virt-11.1->virt-11.1.

Changes in v2 (per Bibo Mao's review):
- Revert v1's move to kvm_arch_init_vcpu(); keep kvm_set_pv_features() in
  kvm_arch_put_registers(), drop the static guard, push per vCPU under
  KVM_PUT_FULL_STATE.
- Migrate pv_features (CPUCFG_KVM_FEATURE) via a VMState subsection.
- Add no_pv_feature compat flag: 11.1 off, 11.2 on.
- Split into three patches (fix / migrate / compat).

Tao Cui (3):
  target/loongarch/kvm: advertise pv features per vCPU
  target/loongarch: migrate pv_features in the vCPU VMState
  target/loongarch: add no_pv_feature compat flag

 hw/loongarch/virt.c         | 14 +++++++++++++-
 include/hw/loongarch/virt.h |  9 ++++++++-
 target/loongarch/cpu.h      |  1 +
 target/loongarch/kvm/kvm.c  | 20 +++++++++++---------
 target/loongarch/machine.c  | 19 +++++++++++++++++++
 5 files changed, 52 insertions(+), 11 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-07-13  1:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10  0:50 [PATCH v2 0/3] target/loongarch: advertise pv features per vCPU Tao Cui
2026-07-10  0:50 ` [PATCH v2 1/3] target/loongarch/kvm: " Tao Cui
2026-07-10  2:58   ` Bibo Mao
2026-07-10  8:09     ` Tao Cui
2026-07-10  8:44       ` Bibo Mao
2026-07-10 12:46         ` Tao Cui
2026-07-13  1:00           ` Bibo Mao
2026-07-10  0:50 ` [PATCH v2 2/3] target/loongarch: migrate pv_features in the vCPU VMState Tao Cui
2026-07-10  3:02   ` Bibo Mao
2026-07-10  3:15     ` Bibo Mao
2026-07-10  8:22       ` Tao Cui
2026-07-10  0:50 ` [PATCH v2 3/3] target/loongarch: add no_pv_feature compat flag Tao Cui
2026-07-10  3:09   ` Bibo Mao
2026-07-10  8:28     ` Tao Cui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.