Skip to content

QOMify accelerator code

Eduardo Habkost qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest17 patches 1 replyIn review
  2. v217 patches 22 repliesSuperseded
  3. v1 RFC25 patches 0 repliesSuperseded

Changes in v3 from the cover letter

* Rename hw/core/accel.c to accel.c
* Rename include/hw/accel.h to include/sysemu/accel.h
* Report unknown accelerator as "not found" instead of "does not exist"
* Squashed "accel: Create accel object when initializing machine" and "accel: Save AccelState on MachineState when initializing" in a single patch

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17vl.c: Small coding style fixvl.c+1 -10 replies
2/17accel: Move accel code to accel.cMakefile.objs accel.c include/sysemu/accel.h +1 more+147 -800 replies
3/17accel: Create AccelType typedefaccel.c+4 -20 replies
4/17accel: Simplify configure_accelerator() using AccelType *acc variableaccel.c+10 -80 replies
5/17accel: Move accel name lookup to separate functionaccel.c+33 -240 replies
6/17accel: Use QOM classes for accel typesaccel.c include/sysemu/accel.h+123 -240 replies
7/17accel: Make AccelClass.available() optionalaccel.c+1 -10 replies
8/17accel: Report unknown accelerator as "not found" instead of "does not exist"accel.c+1 -10 replies
9/17accel: Move KVM accel registration to kvm-all.caccel.c include/sysemu/kvm.h kvm-all.c +1 more+25 -260 replies
10/17accel: Move Xen registration code to xen-common.caccel.c include/hw/xen/xen.h xen-common-stub.c +1 more+24 -260 replies
11/17accel: Move qtest accel registration to qtest.caccel.c include/sysemu/qtest.h qtest.c+26 -200 replies
12/17accel: Remove tcg_available() functionaccel.c arch_init.c include/sysemu/arch_init.h+0 -70 replies
13/17accel: Move accel init/allowed code to separate functionaccel.c+12 -30 replies
14/17accel: Rename 'init' method to 'init_machine'accel.c include/sysemu/accel.h kvm-all.c +2 more+8 -80 replies
15/17accel: Pass MachineState object to accel init functionsaccel.c include/qemu/typedefs.h include/sysemu/accel.h +4 more+14 -110 replies
16/17accel: Create accel object when initializing machineaccel.c include/hw/boards.h include/qemu/typedefs.h+10 -00 replies
17/17kvm: Make KVMState be the TYPE_KVM_ACCEL instance structkvm-all.c+9 -40 replies

Reviews trailers per patch

15 of 17 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo Bonzini
SeriesR-b
1/17R-b
2/17R-b
3/17R-b
4/17R-b
5/17R-b
6/17R-b
7/17R-b
8/17
9/17R-b
10/17R-b
11/17R-b
12/17R-b
13/17R-b
14/17
15/17R-b
16/17R-b
17/17R-b

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

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 00/17] QOMify accelerator code

This is an attempt to convert the accel initialization and registration code to be QOM-based. Some use cases for this are:

* Isolating KVM-specific CPU initialization and compatibility code;
* Use compat_props to implement accelrator-specific compatibility code on machine-types;
* Returning accelerator-specific information on the "query-cpu-definitions" QMP command (e.g. "runnable" information; CPU features).

Changes v2 -> v3:
* Rename hw/core/accel.c to accel.c
* Rename include/hw/accel.h to include/sysemu/accel.h
* Report unknown accelerator as "not found" instead of "does not exist"
* Squashed "accel: Create accel object when initializing machine" and "accel: Save AccelState on MachineState when initializing" in a single patch

Changes v1 -> v2:
* Remove the TYPE_X86_ACCEL interface and KVM-specific changes, by now (they will be submitted later).
* Introduce ACCEL_CLASS_NAME(s) macro.

Cc Michael Mueller <[email protected]>
Cc Christian Borntraeger <[email protected]>
Cc Alexander Graf <[email protected]>
Cc "Jason J. Herne" <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Andreas Färber <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>

Eduardo Habkost (17):
vl.c: Small coding style fix
accel: Move accel code to accel.c
accel: Create AccelType typedef
accel: Simplify configure_accelerator() using AccelType *acc variable
accel: Move accel name lookup to separate function
accel: Use QOM classes for accel types
accel: Make AccelClass.available() optional
accel: Report unknown accelerator as "not found" instead of "does not
exist"
accel: Move KVM accel registration to kvm-all.c
accel: Move Xen registration code to xen-common.c
accel: Move qtest accel registration to qtest.c
accel: Remove tcg_available() function
accel: Move accel init/allowed code to separate function
accel: Rename 'init' method to 'init_machine'
accel: Pass MachineState object to accel init functions
accel: Create accel object when initializing machine
kvm: Make KVMState be the TYPE_KVM_ACCEL instance struct

 Makefile.objs              |   1 +
 accel.c                    | 157 +++++++++++++++++++++++++++++++++++++++++++++
 arch_init.c                |   5 --
 include/hw/boards.h        |   1 +
 include/hw/xen/xen.h       |   1 -
 include/qemu/typedefs.h    |   3 +
 include/sysemu/accel.h     |  62 ++++++++++++++++++
 include/sysemu/arch_init.h |   1 -
 include/sysemu/kvm.h       |   2 -
 include/sysemu/qtest.h     |   1 -
 kvm-all.c                  |  40 ++++++++++--
 kvm-stub.c                 |   5 --
 qtest.c                    |  27 +++++++-
 vl.c                       |  83 +-----------------------
 xen-common-stub.c          |   6 --
 xen-common.c               |  25 +++++++-
 16 files changed, 311 insertions(+), 109 deletions(-)
 create mode 100644 accel.c
 create mode 100644 include/sysemu/accel.h
Signature · 1 line
1.9.3