target/loongarch: advertise pv features per vCPU
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 10 repliesIn review
- v11 patch 3 repliesSuperseded
Changes in v2 from the cover letter
- 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).
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | target/loongarch/kvm: advertise pv features per vCPUtarget/ | +6 | 5 replies | |
| 2/3 | target/loongarch: migrate pv_features in the vCPU VMStatetarget/ | +19 | 3 replies | |
| 3/3 | target/loongarch: add no_pv_feature compat flaghw/ include/ target/ +1 more | +27 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] target/loongarch: advertise pv features per vCPU
From: Tao Cui <[email protected]>
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(-)
Signature · 1 line
2.43.0