Skip to content

RFC accel: Introduce AccelvCPUState opaque structure

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest19 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19target/i386/hvf: Use boolean value for vcpu_dirtytarget/i386/hvf/hvf.c+1 -10 replies
2/19target/s390x/kvm: Simplify debug codetarget/s390x/kvm.c+1 -22 replies
3/19target/s390x/kvm: Reduce deref by declaring 'struct kvm_run' on stacktarget/s390x/kvm.c+65 -630 replies
4/19cpu: Croup accelerator-specific fields altogetherinclude/hw/core/cpu.h+6 -81 reply
5/19cpu: Introduce AccelvCPUState opaque structureinclude/hw/core/cpu.h+5 -00 replies
6/19accel/whpx: Add typedef for 'struct whpx_vcpu'target/i386/whpx/whpx-all.c+15 -130 replies
7/19accel/whpx: Rename struct whpx_vcpu -> AccelvCPUStatetarget/i386/whpx/whpx-all.c+2 -20 replies
8/19accel/whpx: Use 'accel_vcpu' generic pointertarget/i386/whpx/whpx-all.c+3 -30 replies
9/19accel/hax: Add typedef for 'struct hax_vcpu_state'target/i386/hax/hax-all.c target/i386/hax/hax-i386.h target/i386/hax/hax-posix.c +1 more+18 -160 replies
10/19accel/hax: Use 'accel_vcpu' generic pointerinclude/hw/core/cpu.h target/i386/hax/hax-all.c target/i386/hax/hax-i386.h+9 -120 replies
11/19accel/kvm: Introduce kvm_vcpu_state() helperaccel/kvm/kvm-all.c include/sysemu/kvm.h target/i386/cpu.c+9 -20 replies
12/19accel/kvm: Use kvm_vcpu_state() when possibleaccel/kvm/kvm-all.c target/arm/kvm.c target/arm/kvm64.c +2 more+37 -370 replies
13/19accel/kvm: Declare and allocate AccelvCPUState structaccel/kvm/kvm-all.c include/sysemu/kvm_int.h target/s390x/kvm.c+9 -10 replies
14/19accel/kvm: Move the 'kvm_fd' field to AccelvCPUStateaccel/kvm/kvm-all.c include/hw/core/cpu.h include/sysemu/kvm_int.h+8 -60 replies
15/19accel/kvm: Move the 'kvm_state' field to AccelvCPUStateaccel/kvm/kvm-all.c include/hw/core/cpu.h include/sysemu/kvm_int.h+3 -30 replies
16/19accel/kvm: Move the 'kvm_run' field to AccelvCPUStateaccel/kvm/kvm-all.c hw/s390x/pv.c include/hw/core/cpu.h +3 more+22 -200 replies
17/19accel/hvf: Reduce deref by declaring 'hv_vcpuid_t hvf_fd' on stacktarget/i386/hvf/hvf.c target/i386/hvf/x86_descr.c target/i386/hvf/x86hvf.c+166 -1570 replies
18/19accel/hvf: Declare and allocate AccelvCPUState structtarget/i386/hvf/hvf-i386.h target/i386/hvf/hvf.c+6 -10 replies
19/19accel/hvf: Move the 'hvf_fd' field to AccelvCPUStateinclude/hw/core/cpu.h target/i386/hvf/hvf-i386.h target/i386/hvf/hvf.c +7 more+110 -1000 replies

Reviews trailers per patch

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

PatchThomas Huth
1/19
2/19R-b
3/19
4/19
5/19
6/19
7/19
8/19
9/19
10/19
11/19
12/19
13/19
14/19
15/19
16/19
17/19
18/19
19/19

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 00/19] accel: Introduce AccelvCPUState opaque structure

Hi,

This series introduces the 'AccelvCPUState' which is forward declared opaque in "cpu.h", then each accelerator define it.

The opaque CPUState::accel_vcpu pointer is shared by all accelerators (not a problem because there can be at most one accelerator per vCPU).

Series is organized as:
- preliminary trivial cleanups
- introduce AccelvCPUState
- move WHPX fields (build-tested)
- move HAX fields (not tested)
- move KVM fields (build-tested)
- move HVF fields (not tested)

For now vcpu_dirty is still shared in CPUState.

Sending as RFC to see if it is worthwhile.

Regards,

Phil.

Philippe Mathieu-Daudé (19):
target/i386/hvf: Use boolean value for vcpu_dirty target/s390x/kvm: Simplify debug code
target/s390x/kvm: Reduce deref by declaring 'struct kvm_run' on stack
cpu: Croup accelerator-specific fields altogether
cpu: Introduce AccelvCPUState opaque structure
accel/whpx: Add typedef for 'struct whpx_vcpu'
accel/whpx: Rename struct whpx_vcpu -> AccelvCPUState accel/whpx: Use 'accel_vcpu' generic pointer
accel/hax: Add typedef for 'struct hax_vcpu_state' accel/hax: Use 'accel_vcpu' generic pointer
accel/kvm: Introduce kvm_vcpu_state() helper
accel/kvm: Use kvm_vcpu_state() when possible
accel/kvm: Declare and allocate AccelvCPUState struct accel/kvm: Move the 'kvm_fd' field to AccelvCPUState accel/kvm: Move the 'kvm_state' field to AccelvCPUState accel/kvm: Move the 'kvm_run' field to AccelvCPUState accel/hvf: Reduce deref by declaring 'hv_vcpuid_t hvf_fd' on stack accel/hvf: Declare and allocate AccelvCPUState struct accel/hvf: Move the 'hvf_fd' field to AccelvCPUState

 include/hw/core/cpu.h         |  17 +--
 include/sysemu/kvm.h          |   2 +
 include/sysemu/kvm_int.h      |   9 ++
 target/i386/hax/hax-i386.h    |  10 +-
 target/i386/hvf/hvf-i386.h    |   4 +
 target/i386/hvf/vmx.h         |  28 +++--
 accel/kvm/kvm-all.c           |  44 ++++---
 hw/s390x/pv.c                 |   3 +-
 target/arm/kvm.c              |   2 +-
 target/arm/kvm64.c            |  12 +-
 target/i386/cpu.c             |   4 +-
 target/i386/hax/hax-all.c     |  22 ++--
 target/i386/hax/hax-posix.c   |   4 +-
 target/i386/hax/hax-windows.c |   4 +-
 target/i386/hvf/hvf.c         | 118 +++++++++---------
 target/i386/hvf/x86.c         |  28 ++---
 target/i386/hvf/x86_descr.c   |  32 +++--
 target/i386/hvf/x86_emu.c     |  62 +++++-----
 target/i386/hvf/x86_mmu.c     |   4 +-
 target/i386/hvf/x86_task.c    |  14 ++-
 target/i386/hvf/x86hvf.c      | 227 +++++++++++++++++-----------------
 target/i386/kvm/kvm.c         |  36 +++---
 target/i386/whpx/whpx-all.c   |  34 ++---
 target/ppc/kvm.c              |  16 +--
 target/s390x/kvm.c            | 148 +++++++++++-----------
 25 files changed, 466 insertions(+), 418 deletions(-)
Signature · 1 line
2.26.2