qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/65] accel: Preparatory cleanups for split-accel
@ 2025-07-02 18:52 Philippe Mathieu-Daudé
  2025-07-02 18:52 ` [PATCH v4 01/65] system/runstate: Document qemu_add_vm_change_state_handler() Philippe Mathieu-Daudé
                   ` (65 more replies)
  0 siblings, 66 replies; 108+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-07-02 18:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Paolo Bonzini, Richard Henderson,
	Pierrick Bouvier, Philippe Mathieu-Daudé

Missing review: 22-23, 57-59, 63

Since v3:
- Addressed Richard's review comments

Few changes needed before being able to add the
split acceleration:

- few method docstring added
- remove pointless stubs
- propagate soon required AccelState argument
- try to reduce current_accel() uses
- move declarations AccelClass <-> AccelOpsClass
- display model name in 'info cpus'
- add 'info accel' command to QMP/HMP
- make accel_create_vcpu_thread() more generic
- introduce hwaccel_enabled()

I plan to send a PR once fully reviewed.

Regards,

Phil.

Philippe Mathieu-Daudé (65):
  system/runstate: Document qemu_add_vm_change_state_handler()
  system/cpus: Defer memory layout changes until vCPUs are realized
  system/cpus: Assert interrupt handling is done with BQL locked
  accel: Keep reference to AccelOpsClass in AccelClass
  accel: Introduce AccelOpsClass::cpu_target_realize() hook
  accel/hvf: Add hvf_arch_cpu_realize() stubs
  accel/kvm: Remove kvm_init_cpu_signals() stub
  accel/kvm: Reduce kvm_create_vcpu() declaration scope
  accel: Propagate AccelState to AccelClass::init_machine()
  accel/kvm: Prefer local AccelState over global MachineState::accel
  accel/hvf: Re-use QOM allocated state
  accel/tcg: Prefer local AccelState over global current_accel()
  accel: Directly pass AccelState argument to AccelClass::has_memory()
  accel/kvm: Directly pass KVMState argument to do_kvm_create_vm()
  accel: Remove unused MachineState argument of AccelClass::setup_post()
  accel: Pass AccelState argument to gdbstub_supported_sstep_flags()
  accel: Move supports_guest_debug() declaration to AccelClass
  accel: Move cpus_are_resettable() declaration to AccelClass
  accel: Move cpu_common_[un]realize() declarations to AccelOpsClass
  accel/system: Convert pre_resume() from AccelOpsClass to AccelClass
  hw/core/machine: Display CPU model name in 'info cpus' command
  qapi: Move definitions related to accelerators in their own file
  accel/system: Introduce @x-accel-stats QMP command
  accel/system: Add 'info accel' on human monitor
  accel/tcg: Factor tcg_dump_flush_info() out
  accel/tcg: Implement get_[vcpu]_stats()
  accel/hvf: Implement get_vcpu_stats()
  accel/hvf: Report missing com.apple.security.hypervisor entitlement
  accel/hvf: Restrict internal declarations
  accel/hvf: Move per-cpu method declarations to hvf-accel-ops.c
  accel/hvf: Move generic method declarations to hvf-all.c
  cpus: Document CPUState::vcpu_dirty field
  accel/hvf: Replace @dirty field by generic CPUState::vcpu_dirty field
  accel/nvmm: Replace @dirty field by generic CPUState::vcpu_dirty field
  accel/whpx: Replace @dirty field by generic CPUState::vcpu_dirty field
  accel/kvm: Remove kvm_cpu_synchronize_state() stub
  accel/system: Document cpu_synchronize_state()
  accel/system: Document cpu_synchronize_state_post_init/reset()
  accel/nvmm: Expose nvmm_enabled() to common code
  accel/whpx: Expose whpx_enabled() to common code
  accel/system: Introduce hwaccel_enabled() helper
  target/arm: Use generic hwaccel_enabled() to check 'host' cpu type
  accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h'
  accel/dummy: Factor dummy_thread_precreate() out
  accel/tcg: Factor tcg_vcpu_thread_precreate() out
  accel: Factor accel_create_vcpu_thread() out
  accel: Introduce AccelOpsClass::cpu_thread_routine handler
  accel/dummy: Convert to AccelOpsClass::cpu_thread_routine
  accel/tcg: Convert to AccelOpsClass::cpu_thread_routine
  accel/hvf: Convert to AccelOpsClass::cpu_thread_routine
  accel/kvm: Convert to AccelOpsClass::cpu_thread_routine
  accel/nvmm: Convert to AccelOpsClass::cpu_thread_routine
  accel/whpx: Convert to AccelOpsClass::cpu_thread_routine
  accel: Factor accel_cpu_realize() out
  accel: Pass old/new interrupt mask to handle_interrupt() handler
  accel: Expose and register generic_handle_interrupt()
  accel: Always register AccelOpsClass::kick_vcpu_thread() handler
  accel: Always register AccelOpsClass::get_elapsed_ticks() handler
  accel: Always register AccelOpsClass::get_virtual_clock() handler
  system/memory: Restrict eventfd dispatch_write() to emulators
  accel/tcg: Factor tcg_vcpu_init() out for re-use
  accel/tcg: Factor mttcg_cpu_exec() out for re-use
  accel/tcg: Factor rr_cpu_exec() out
  accel/tcg: Clear exit_request once in tcg_cpu_exec()
  accel/tcg: Unregister the RCU before exiting RR thread

 MAINTAINERS                       |   1 +
 qapi/accelerator.json             |  92 ++++++++
 qapi/machine.json                 |  68 +-----
 qapi/qapi-schema.json             |   1 +
 accel/accel-internal.h            |   2 +
 accel/dummy-cpus.h                |  15 ++
 accel/kvm/kvm-cpus.h              |   1 -
 accel/tcg/internal-common.h       |   2 +
 accel/tcg/tcg-accel-ops-icount.h  |   2 +-
 accel/tcg/tcg-accel-ops-mttcg.h   |   4 +-
 accel/tcg/tcg-accel-ops.h         |   5 +-
 include/hw/core/cpu.h             |   3 +-
 include/qemu/accel.h              |  22 +-
 include/system/accel-ops.h        |  42 +++-
 include/system/cpus.h             |   5 -
 include/system/hvf.h              |  38 ----
 include/system/hvf_int.h          |  37 +++-
 include/system/hw_accel.h         |  34 ++-
 include/system/kvm.h              |   8 -
 include/system/nvmm.h             |  23 +-
 include/system/runstate.h         |  10 +
 include/system/whpx.h             |  27 +--
 target/i386/whpx/whpx-accel-ops.h |   1 -
 accel/accel-common.c              |  55 ++++-
 accel/accel-qmp.c                 |  34 +++
 accel/accel-system.c              |  35 ++-
 accel/dummy-cpus.c                |  11 +-
 accel/hvf/hvf-accel-ops.c         | 341 +++++-------------------------
 accel/hvf/hvf-all.c               | 281 ++++++++++++++++++++++--
 accel/kvm/kvm-accel-ops.c         |  25 +--
 accel/kvm/kvm-all.c               |  38 ++--
 accel/qtest/qtest.c               |  10 +-
 accel/stubs/kvm-stub.c            |   9 -
 accel/stubs/nvmm-stub.c           |  12 ++
 accel/stubs/whpx-stub.c           |  12 ++
 accel/tcg/monitor.c               |  29 ++-
 accel/tcg/tcg-accel-ops-icount.c  |   8 +-
 accel/tcg/tcg-accel-ops-mttcg.c   |  28 +--
 accel/tcg/tcg-accel-ops-rr.c      |  40 ++--
 accel/tcg/tcg-accel-ops.c         |  44 ++--
 accel/tcg/tcg-all.c               |  20 +-
 accel/xen/xen-all.c               |  13 +-
 bsd-user/main.c                   |   2 +-
 gdbstub/system.c                  |   7 +-
 hw/core/machine-hmp-cmds.c        |   4 +-
 hw/core/machine-qmp-cmds.c        |   2 +
 linux-user/main.c                 |   2 +-
 system/cpus.c                     |  55 ++---
 system/memory.c                   |  11 +-
 system/physmem.c                  |   8 +
 target/arm/arm-qmp-cmds.c         |   5 +-
 target/arm/cpu.c                  |   5 +-
 target/arm/hvf/hvf.c              |  11 +-
 target/i386/hvf/hvf.c             |  11 +-
 target/i386/hvf/x86hvf.c          |   2 +-
 target/i386/nvmm/nvmm-accel-ops.c |  17 +-
 target/i386/nvmm/nvmm-all.c       |  29 +--
 target/i386/whpx/whpx-accel-ops.c |  18 +-
 target/i386/whpx/whpx-all.c       |  33 ++-
 accel/meson.build                 |   2 +-
 accel/stubs/meson.build           |   2 +
 hmp-commands-info.hx              |  12 ++
 qapi/meson.build                  |   1 +
 63 files changed, 1013 insertions(+), 714 deletions(-)
 create mode 100644 qapi/accelerator.json
 create mode 100644 accel/dummy-cpus.h
 create mode 100644 accel/accel-qmp.c
 create mode 100644 accel/stubs/nvmm-stub.c
 create mode 100644 accel/stubs/whpx-stub.c

-- 
2.49.0



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

end of thread, other threads:[~2025-07-04 12:46 UTC | newest]

Thread overview: 108+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 18:52 [PATCH v4 00/65] accel: Preparatory cleanups for split-accel Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 01/65] system/runstate: Document qemu_add_vm_change_state_handler() Philippe Mathieu-Daudé
2025-07-03  7:03   ` Alex Bennée
2025-07-02 18:52 ` [PATCH v4 02/65] system/cpus: Defer memory layout changes until vCPUs are realized Philippe Mathieu-Daudé
2025-07-03 16:37   ` Alex Bennée
2025-07-03 16:55     ` Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 03/65] system/cpus: Assert interrupt handling is done with BQL locked Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 04/65] accel: Keep reference to AccelOpsClass in AccelClass Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 05/65] accel: Introduce AccelOpsClass::cpu_target_realize() hook Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 06/65] accel/hvf: Add hvf_arch_cpu_realize() stubs Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 07/65] accel/kvm: Remove kvm_init_cpu_signals() stub Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 08/65] accel/kvm: Reduce kvm_create_vcpu() declaration scope Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 09/65] accel: Propagate AccelState to AccelClass::init_machine() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 10/65] accel/kvm: Prefer local AccelState over global MachineState::accel Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 11/65] accel/hvf: Re-use QOM allocated state Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 12/65] accel/tcg: Prefer local AccelState over global current_accel() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 13/65] accel: Directly pass AccelState argument to AccelClass::has_memory() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 14/65] accel/kvm: Directly pass KVMState argument to do_kvm_create_vm() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 15/65] accel: Remove unused MachineState argument of AccelClass::setup_post() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 16/65] accel: Pass AccelState argument to gdbstub_supported_sstep_flags() Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 17/65] accel: Move supports_guest_debug() declaration to AccelClass Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 18/65] accel: Move cpus_are_resettable() " Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 19/65] accel: Move cpu_common_[un]realize() declarations to AccelOpsClass Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 20/65] accel/system: Convert pre_resume() from AccelOpsClass to AccelClass Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 21/65] hw/core/machine: Display CPU model name in 'info cpus' command Philippe Mathieu-Daudé
2025-07-03  7:23   ` Zhao Liu
2025-07-02 18:52 ` [PATCH v4 22/65] qapi: Move definitions related to accelerators in their own file Philippe Mathieu-Daudé
2025-07-02 20:26   ` Pierrick Bouvier
2025-07-03  7:26   ` Zhao Liu
2025-07-03  8:31   ` Markus Armbruster
2025-07-02 18:52 ` [PATCH v4 23/65] accel/system: Introduce @x-accel-stats QMP command Philippe Mathieu-Daudé
2025-07-02 20:27   ` Pierrick Bouvier
2025-07-03  8:35   ` Markus Armbruster
2025-07-03  8:42   ` Zhao Liu
2025-07-02 18:52 ` [PATCH v4 24/65] accel/system: Add 'info accel' on human monitor Philippe Mathieu-Daudé
2025-07-02 20:27   ` Pierrick Bouvier
2025-07-02 18:52 ` [PATCH v4 25/65] accel/tcg: Factor tcg_dump_flush_info() out Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 26/65] accel/tcg: Implement get_[vcpu]_stats() Philippe Mathieu-Daudé
2025-07-03  8:40   ` Zhao Liu
2025-07-03 16:55   ` Alex Bennée
2025-07-03 16:57     ` Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 27/65] accel/hvf: Implement get_vcpu_stats() Philippe Mathieu-Daudé
2025-07-04 12:05   ` Mads Ynddal
2025-07-04 12:45     ` Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 28/65] accel/hvf: Report missing com.apple.security.hypervisor entitlement Philippe Mathieu-Daudé
2025-07-02 21:06   ` Pierrick Bouvier
2025-07-04  9:20   ` Mads Ynddal
2025-07-02 18:52 ` [PATCH v4 29/65] accel/hvf: Restrict internal declarations Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 30/65] accel/hvf: Move per-cpu method declarations to hvf-accel-ops.c Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 31/65] accel/hvf: Move generic method declarations to hvf-all.c Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 32/65] cpus: Document CPUState::vcpu_dirty field Philippe Mathieu-Daudé
2025-07-03  7:29   ` Zhao Liu
2025-07-02 18:52 ` [PATCH v4 33/65] accel/hvf: Replace @dirty field by generic " Philippe Mathieu-Daudé
2025-07-04 10:40   ` Mads Ynddal
2025-07-02 18:52 ` [PATCH v4 34/65] accel/nvmm: " Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 35/65] accel/whpx: " Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 36/65] accel/kvm: Remove kvm_cpu_synchronize_state() stub Philippe Mathieu-Daudé
2025-07-02 18:52 ` [PATCH v4 37/65] accel/system: Document cpu_synchronize_state() Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 38/65] accel/system: Document cpu_synchronize_state_post_init/reset() Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 39/65] accel/nvmm: Expose nvmm_enabled() to common code Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 40/65] accel/whpx: Expose whpx_enabled() " Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 41/65] accel/system: Introduce hwaccel_enabled() helper Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 42/65] target/arm: Use generic hwaccel_enabled() to check 'host' cpu type Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 43/65] accel/dummy: Extract 'dummy-cpus.h' header from 'system/cpus.h' Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 44/65] accel/dummy: Factor dummy_thread_precreate() out Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 45/65] accel/tcg: Factor tcg_vcpu_thread_precreate() out Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 46/65] accel: Factor accel_create_vcpu_thread() out Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 47/65] accel: Introduce AccelOpsClass::cpu_thread_routine handler Philippe Mathieu-Daudé
2025-07-04  9:12   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 48/65] accel/dummy: Convert to AccelOpsClass::cpu_thread_routine Philippe Mathieu-Daudé
2025-07-02 20:09   ` Fabiano Rosas
2025-07-02 18:53 ` [PATCH v4 49/65] accel/tcg: " Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 50/65] accel/hvf: " Philippe Mathieu-Daudé
2025-07-04  9:12   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 51/65] accel/kvm: " Philippe Mathieu-Daudé
2025-07-04  9:15   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 52/65] accel/nvmm: " Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 53/65] accel/whpx: " Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 54/65] accel: Factor accel_cpu_realize() out Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 55/65] accel: Pass old/new interrupt mask to handle_interrupt() handler Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 56/65] accel: Expose and register generic_handle_interrupt() Philippe Mathieu-Daudé
2025-07-02 21:19   ` Pierrick Bouvier
2025-07-03  8:53   ` Zhao Liu
2025-07-04 10:30   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 57/65] accel: Always register AccelOpsClass::kick_vcpu_thread() handler Philippe Mathieu-Daudé
2025-07-02 21:26   ` Pierrick Bouvier
2025-07-03 10:45     ` Philippe Mathieu-Daudé
2025-07-03  8:46   ` Zhao Liu
2025-07-02 18:53 ` [PATCH v4 58/65] accel: Always register AccelOpsClass::get_elapsed_ticks() handler Philippe Mathieu-Daudé
2025-07-02 21:29   ` Pierrick Bouvier
2025-07-03  8:48   ` Zhao Liu
2025-07-04  9:34   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 59/65] accel: Always register AccelOpsClass::get_virtual_clock() handler Philippe Mathieu-Daudé
2025-07-02 21:30   ` Pierrick Bouvier
2025-07-02 21:35   ` Pierrick Bouvier
2025-07-03  8:49   ` Zhao Liu
2025-07-04  9:31   ` Mads Ynddal
2025-07-02 18:53 ` [PATCH v4 60/65] system/memory: Restrict eventfd dispatch_write() to emulators Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 61/65] accel/tcg: Factor tcg_vcpu_init() out for re-use Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 62/65] accel/tcg: Factor mttcg_cpu_exec() " Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 63/65] accel/tcg: Factor rr_cpu_exec() out Philippe Mathieu-Daudé
2025-07-02 21:07   ` Pierrick Bouvier
2025-07-03  8:50   ` Zhao Liu
2025-07-02 18:53 ` [PATCH v4 64/65] accel/tcg: Clear exit_request once in tcg_cpu_exec() Philippe Mathieu-Daudé
2025-07-02 18:53 ` [PATCH v4 65/65] accel/tcg: Unregister the RCU before exiting RR thread Philippe Mathieu-Daudé
2025-07-02 21:09   ` Pierrick Bouvier
2025-07-03  8:51   ` Zhao Liu
2025-07-02 19:08 ` [PATCH v4 00/65] accel: Preparatory cleanups for split-accel Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).