Skip to content

RFC accel: Add per-accelerator vCPUs queue

Philippe Mathieu-Daudé kvm qemu-arm qemu-devel xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7cpus: Restrict CPU_FOREACH_SAFE() to user emulationinclude/hw/core/cpu.h+3 -01 reply
2/7cpus: Introduce AccelOpsClass::get_cpus_queue()accel/tcg/user-exec-stub.c cpu-common.c include/hw/core/cpu.h +2 more+34 -00 replies
3/7accel/tcg: Implement tcg_get_cpus_queue()accel/tcg/tcg-accel-ops.c accel/tcg/tcg-accel-ops.h+18 -00 replies
4/7accel/tcg: Use CPU_FOREACH_TCG()accel/tcg/cputlb.c accel/tcg/monitor.c accel/tcg/tb-maint.c +2 more+19 -160 replies
5/7accel/hw: Implement hw_accel_get_cpus_queue()accel/accel-system.c accel/kvm/kvm-accel-ops.c accel/xen/xen-all.c +3 more+21 -00 replies
6/7accel/hvf: Use CPU_FOREACH_HVF()accel/hvf/hvf-accel-ops.c include/system/hvf_int.h target/arm/hvf/hvf.c+11 -63 replies
7/7accel/kvm: Use CPU_FOREACH_KVM()accel/kvm/kvm-all.c hw/i386/kvm/clock.c hw/intc/spapr_xive_kvm.c +6 more+24 -170 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchDaniel Henrique Barboza
1/7R-b
2/7
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/7] accel: Add per-accelerator vCPUs queue

Hi,

Currently we register all vCPUs to the global 'cpus_queue' queue, however we can not discriminate per accelerator or per target architecture (which might happen in a soon future).

This series tries to add an accelerator discriminator, so accelerator specific code can iterate on its own vCPUs. This is required to run a pair of HW + SW accelerators like the (HVF, TCG) or (KVM, TCG) combinations. Otherwise, i.e. the HVF core code could iterate on TCG vCPUs...
To keep it simple and not refactor heavily the code base, we introduce the CPU_FOREACH_TCG/HVF/KVM() macros, only defined for each accelerator.

This is just a RFC to get some thoughts whether this is heading in the correct direction or not ;)

Regards,

Phil.

Philippe Mathieu-Daudé (7):
cpus: Restrict CPU_FOREACH_SAFE() to user emulation
cpus: Introduce AccelOpsClass::get_cpus_queue() accel/tcg: Implement tcg_get_cpus_queue() accel/tcg: Use CPU_FOREACH_TCG()
accel/hw: Implement hw_accel_get_cpus_queue() accel/hvf: Use CPU_FOREACH_HVF()
accel/kvm: Use CPU_FOREACH_KVM()

 accel/tcg/tcg-accel-ops.h         | 10 ++++++++++
 include/hw/core/cpu.h             | 11 +++++++++++
 include/system/accel-ops.h        |  6 ++++++
 include/system/hvf_int.h          |  4 ++++
 include/system/hw_accel.h         |  9 +++++++++
 include/system/kvm_int.h          |  3 +++
 accel/accel-system.c              |  8 ++++++++
 accel/hvf/hvf-accel-ops.c         |  9 +++++----
 accel/kvm/kvm-accel-ops.c         |  1 +
 accel/kvm/kvm-all.c               | 14 +++++++-------
 accel/tcg/cputlb.c                |  7 ++++---
 accel/tcg/monitor.c               |  3 ++-
 accel/tcg/tb-maint.c              |  7 ++++---
 accel/tcg/tcg-accel-ops-rr.c      | 10 +++++-----
 accel/tcg/tcg-accel-ops.c         | 16 ++++++++++++----
 accel/tcg/user-exec-stub.c        |  5 +++++
 accel/xen/xen-all.c               |  1 +
 cpu-common.c                      | 10 ++++++++++
 hw/i386/kvm/clock.c               |  3 ++-
 hw/intc/spapr_xive_kvm.c          |  5 +++--
 hw/intc/xics_kvm.c                |  5 +++--
 system/cpus.c                     |  5 +++++
 target/arm/hvf/hvf.c              |  4 ++--
 target/i386/kvm/kvm.c             |  4 ++--
 target/i386/kvm/xen-emu.c         |  2 +-
 target/i386/nvmm/nvmm-accel-ops.c |  1 +
 target/i386/whpx/whpx-accel-ops.c |  1 +
 target/s390x/kvm/kvm.c            |  2 +-
 target/s390x/kvm/stsi-topology.c  |  3 ++-
 29 files changed, 130 insertions(+), 39 deletions(-)
Signature · 1 line
2.47.1