Commit Graph

19394 Commits

Author SHA1 Message Date
Stefan Hajnoczi
0951d6dab1 Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* target/i386/mshv: CPU model support
* target/i386/mshv: first part of migration support
* target/i386/mshv: faster register access for MMIO exits
* target/i386/tdx: add support for AMX alias bits in CPUID and AVX10
* Deprecate memory-encryption in favor of confidential-guest-support

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmo9sDwUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroOHBwf8Dx4gkbzOFxmCNX3EaW+ROYwlyAC7
# ADo9LFloDHXforRYTm4mBXNUVNF1/KFA6Tf92rzBlUZgp9KuMy/KhWZ1GbNsE+9b
# k5/1RF9/IxRHy6GL69apdHEKY2OYzXl76or2HF3wMd6Mu77qD8Onthko81VaLWox
# 5ZOBz6NaSnykzs9RimkVLtD9HswtFile2NWTPSliUV874lEJioNi9RcdhnQvJCnX
# WqGWViC0THucIGCm+NVhSEmvRnAFbPgUBPvQuy7skLu+R7Ryy7GAWmE/gFlSrYy2
# 4c4zt4SB0tFYJlT9db5ZdaUSgCs52CFawQ9uTSEjNSmEEuQFzXGo6BeY4w==
# =4V0w
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 25 Jun 2026 18:48:28 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (45 commits)
  i386/tdx: Add CPUID_24_0_EBX_AVX10_VL_MASK as supported
  i386/tdx: Make AMX alias bits supported
  i386/tdx: Use .has_gpa field to check if the gpa is valid
  machine: Deprecate memory-encryption
  qemu-options: Add description of tdx-guest object
  qemu-options: Add confidential-guest-support to machine options
  qemu-options: Change memory-encryption to confidential-guest-support in the example
  i386/sev: Remove the example that references memory-encryption
  target/i386/mshv: use the register page to set registers
  target/i386/mshv: use the register page to get registers
  target/i386/mshv: hv_vp_register_page setup for the vcpu
  include/hw/hyperv: add hv_vp_register_page struct definition
  accel: remove unnecessary #ifdefs
  target/i386/mshv: migrate CET/SS MSRs
  target/i386/mshv: migrate MTRR MSRs
  target/i386/mshv: migrate MSRs
  target/i386/mshv: reconstruct hflags after load
  target/i386/mshv: migrate XSAVE state
  target/i386/mshv: migrate pending ints/excs
  target/i386/mshv: move msr code to arch
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-06-27 23:06:04 -04:00
Doru Blânzeanu
8afb40b7fe include/hw/hyperv: add hv_vp_register_page struct definition
Define the `hv_vp_register_page` structure that the linux kernel uses
to allow access to vcpu registers.

This structure is going to be used in later patches to access vcpu
registers.

Signed-off-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260428135053.251200-4-dblanzeanu@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-26 00:48:22 +02:00
Magnus Kulke
f879d781b4 target/i386/mshv: migrate CET/SS MSRs
This change migrates the MSRs required for CET shadow stack and indirect
branch tracking. They are gated behind cet_ss_support || cet_ibt_support
mshv processor feature flags.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-24-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-26 00:48:22 +02:00
Magnus Kulke
d540dcc5e2 target/i386/mshv: migrate MSRs
In this change the we rewrite the existing MSR logic to make MSRs
migratable:

- we map them on existing QEMU fields in the CPU. A table and a macro
  MSHV_ENV_FIELD is used to associate a HV register name to the their msr
  index and their offset in the cpu state struct. The list is not
  exhaustive and will be extended in follow-up commits.
- mshv_set/get_msrs() fns are called in the arch_load/store_vcpu_state()
  fns. they use use generic registers ioctl's and map the input/output
  via load/store_to/from_env() from/to the hv register content to the
  cpu state representation.
- init_msrs() has been moved from mshv-vcpu to the msr source file
- we need to perform some filtering of MSR because before writing and
  reading, because the hvcalls will fail if the partition doesn't
  support a given MSRs.
- Some MSRs are partition-wide and so we will only write the to on the
  BSP.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-21-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-26 00:48:22 +02:00
Stefan Hajnoczi
60533c6193 Merge tag 'ui-pr-v1' of https://gitlab.com/marcandre.lureau/qemu into staging
UI patches

- ui: better console hotplug support
- vga: implement blinking

To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmo7wlsACgkQ2ujhCXWW
# nOUAaA/+OWDMM1SdVCk9M9K/sWiSP2fsXAB+Zpdj9mUKz4B86ulVAc5Wv0ROMKyC
# hO9XT8ksCC5Xuehhfb1gxhazA46z9QWDiZ1Drnm945WUJF9U6zcqMS9w343HNL/p
# HE+wCxz+D2Izx0wrlPHVPnNp+54Ge/YK4vNjfGKSXdwFGgQPfqMX3D+chL57/quG
# xttjbDNixplqxKGqzmQRIZKgifyrMUs1knLv+bi7BHGnKIws1ww5EwOAF9zfY626
# ouo5knVNqRKMekCudIudWIYKNtVSV2WPQz/k2AdNq5L0NeI2Mj6tFswVSfLlZ1LZ
# Np0Ijeip2EOYLuPTZJKZmAWlsUK1E/VXqpehzmZdi07i37kHJBafppPOD2//P3Bs
# UB8pXVcjlXrHxEwkwEKRLHsAbivmD/bszLeNj+/E1V9M7P9pIc0jiEYPG+9WniYv
# CJZ9w9Q9S7C1IKjRIRtR/veLI4MxBu/gz5DG8qzD2GfRVpGUV8J5loSc2CidBvCR
# Vk7fetkBLh9vWgWqqbBBguHieiqoWqJZ3OL+F+tMRfiA7WIJgl2K6hRlmA5baQpW
# pD794a2bn6h6jK26natfdA6Ns4NfWc4R/3lZRNqX3cPjyAy98nxdmCQwDJBV61e9
# e9YKU2tJ6zruUs3Oa9/XW/W4kyEm+aBXdysg5KziXUKLx3pHTOY=
# =N7bZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 24 Jun 2026 07:41:15 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-pr-v1' of https://gitlab.com/marcandre.lureau/qemu: (35 commits)
  vga: implement text mode character blink
  tests/qtest: add D-Bus display hotplug test
  ui/dbus: handle console hotplug/unplug events
  ui/console: unregister console from QOM tree on close
  ui/console: register console in QOM tree dynamically
  ui/gtk: handle console hotplug/unplug events
  ui/gtk: centralize console menu and shortcut management
  ui/gtk: fix tab re-insertion order on window close
  ui/gtk: move global display settings out of per-console init
  ui/gtk: convert VirtualConsole storage from fixed array to GPtrArray
  ui/console-vc: fire ADDED/REMOVED notifications
  ui/console: fire console ADDED/REMOVED notifications
  ui/console: add console event notifier infrastructure
  ui/gtk: implement display cleanup
  ui/dbus: implement display cleanup
  ui/cocoa: implement display cleanup
  ui/egl: implement display and EGL cleanup
  ui/spice-app: implement display cleanup
  ui/sdl2: implement display cleanup
  ui/curses: implement display cleanup
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-06-25 16:58:35 -04:00
Magnus Kulke
b2c0cc6300 target/i386/mshv: migrate pending ints/excs
We use PENDING_INTERRUPTION, INTERRUPT_STATE, PENDING_EVENT hv registers
to map and roundtrip from/to CPUX86State.

We ignore HV_REGISTER_PENDING_EVENT1 which represent events for nested
virt contexts, as we don't support nested virt with MSHV currently.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-30-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:55:41 +02:00
Magnus Kulke
f629431c09 accel/mshv: enable dirty page tracking
This change introduces the functions required to perform dirty page
tracking to speed up migrations. We are using the sync, global_start,
and global_stop hooks.

The sync is implemented in batches.

Before we can disable the dirty page tracking we have to set all dirty bits.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-35-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:55:28 +02:00
Magnus Kulke
a70da3a0e0 target/i386/mshv: expose mshv_get_generic_regs
We expose the fn, so we can call them from the other source files
(msr.c).

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-20-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:54:49 +02:00
Magnus Kulke
e624d93f33 accel/mshv: store partition proc features
We retrieve and store processor features on the state, so we can query
them later when deciding which MSRs to migrate.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-19-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:54:49 +02:00
Magnus Kulke
f2230f044d accel/mshv: remove redundant msi controller
The remaining MsiControl infrastructure can be removed now

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-14-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
c77944aa82 accel/mshv: reserve ioapic routes on s->irq_routes
We reserve 24 ioapic routes using the new functions that operate on the
mshv apic state.

commit/add_msi_routing() fn's can be removed now.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-13-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
f48f2011fd accel/mshv: use s->irq_routes in commit_routes
In mshv_irqchip_commit_routes() the entries that have been accumulated
in s->irq_routes are committed directly to MSHV's irqchip.

The old commit_msi_routing_table() fn will be removed in a subsquent commit.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-12-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
fff9929879 accel/mshv: update s->irq_routes in release_virq
The state's irq_routes field will be updated when an irqchip's gsi
is requested to be released.

The old remove_msi_routing() fn is redundant and can be removed.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-11-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
5cebd7c354 accel/mshv: update s->irq_routes in add_msi_route
The irq_routes field of the state is populated with native mshv irq
route entries. The allocation logic is modelled after the KVM
implementation: we will always allocate a minumum of 64 entries and use
a bitmask to find/set/clear GSIs.

The old implementation of add_msi_routes will be removed in a subsequent
commit.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-9-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
f81fefdeb8 accel/mshv: add irq_routes to state
This change adds fields related to irq routing to the MSHV state, following
similar fields in the KVM implementation.

So far the fields are only initialized, they will be used in subsequent
commits for bookkeeping purposes and storing uncommitted interrupt routes.

The TYPE_MSHV_ACCEL defines have been moved to the header.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-8-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:09:20 +02:00
Magnus Kulke
cc2b30223c accel/accel-irq: add generic commit_route_changes
A generic accel_irqchip_commit_route_changes() fn has been introduced for
usage in the MSHV accelerator. The respective kvm_ fn can be removed
since we handle the commit op in a generic way.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-7-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:45 +02:00
Magnus Kulke
49b2dcbd24 accel/accel-irq: add generic begin_route_changes
A generic accel_irqchip_begin_route_change() fn has been introduced for
usage in the MSHV accelerator. It replaces the respective kvm_ fn.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-6-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:45 +02:00
Magnus Kulke
61c139c4fa accel/accel-irq: add AccelRouteChange abstraction
The accelerated irqchip routines use a record of changes to batch
changes when programming routes.

Currently this mechanism is coupled to the KVM accelerator, this change
introduces an abstraction that replaces KVMRouteChange and keeps a
pointer to an abstract AccelState instead of the concrete type,
converting the state where necessary.

This is done to further align the irqchip programming in the MSHV
accelerator with the existing KVM code in QEMU. Subsequent commits will
introduce AccelRouteChange to the MSHV accelerator code.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-5-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:45 +02:00
Magnus Kulke
62e961af8f target/i386/mshv: impl init/load/store_vcpu_state
In migration we will handle more than registers, so we rework the
routines that were used to load & store CPU registers from/to the
hypervisor into more explicit init/load/store_vcpu_state() functions
that can be called from the appropriate hooks.

load/store_regs() still exists for the purpose of MMIO emulation, but it
will only address standard and special x86 registers.

Functions to retrieve FPU and XCR0 state from the hypervsisor have been
introduced.

MSR and APIC state covered are covered only as part of init_vcpu(). They
are not yet part of the load/store routines.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-4-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:45 +02:00
Magnus Kulke
d564c2a296 target/i386/mshv: use generic FPU/xcr0 state
Instead of using an mshv-specific FPU state representation we switch to
the generic i386 representation of the registers.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-3-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:45 +02:00
Magnus Kulke
a6961182bc target/i386/mshv: use arch_load/store_reg fns
Improved consistency around the naming of load/store register fn's. this
is required since we want to roundtrip more registers in a migration
than what's currently required for MMIO emulation.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260417105618.3621-2-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:44 +02:00
Magnus Kulke
e7c9532d89 accel/mshv: disable la57 (5lvl paging)
This change disable la57 paging on the mshv hypervisor on both the
mshv processor feature bitmap and mask the cpuid feature leaf to the
guest.

Since the removal of hypervisor-assisted gva=>gpa translation in
1c85a4a3d7 we have seen MMIO errors in guests on la57-enabled hw. We
will have to investigate and test this further.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Reviewed-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260416121116.527927-10-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:12 +02:00
Magnus Kulke
38a557bc85 target/i386: query mshv accel for supported cpuids
We implement mshv_get_supported_cpuid() and invoke it in
x86_cpu_get_supported_feature_word() retrieve the cpu features that the
host is supporting. Initially we mask the virtualization capabilitities
potentially we might need to mask more in the future.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260416121116.527927-7-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:08:12 +02:00
Magnus Kulke
842e77d410 accel/mshv: use mshv_create_partition_v2 payload
When using the extended request format we can instruct the hypervisor to
provision enough space for requested XSAVE features. This is required
for supporting QEMU models provided via the -cpu flag properly.

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
Link: https://lore.kernel.org/r/20260416121116.527927-2-magnuskulke@linux.microsoft.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-25 19:06:57 +02:00
Marc-André Lureau
de1ecdc0f8 ui/gtk: handle console hotplug/unplug events
Register a console notifier so the GTK display dynamically creates and
destroys VirtualConsole tabs when graphic consoles are added or removed
at runtime (e.g. vfio-pci with display=on hotplug).

Add skips consoles that already have a VC binding, remove skips unknown
consoles.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-30-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
b1e8bf9238 ui/gtk: centralize console menu and shortcut management
Replace the per-console gd_vc_menu_init() with gd_rebuild_vc_menu()
that tears down and rebuilds all console radio menu items and
Ctrl+Alt+N accelerators at once. This is called from initialization
and whenever consoles are detached or reattached.

Shortcuts now skip detached (windowed) consoles, so they always map
to reachable tabs. Rename gd_vc_gfx_init() to add_gfx_console()
and simplify the init function signatures now that menu creation is
decoupled.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-29-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
50cff68a63 ui/gtk: convert VirtualConsole storage from fixed array to GPtrArray
Replace the fixed-size vc[MAX_VCS] with GPtrArray.

This is a preparatory refactoring for console hotplug support, which
needs to add/remove VCs dynamically.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-26-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
6ca4df5e9c ui/console: add console event notifier infrastructure
Add a NotifierList to DisplayState so display backends can be notified
when consoles are added or removed at runtime.

No events are fired yet, that follows in the next commits.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-23-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
b09e45f77a ui/gtk: implement display cleanup
Add gtk_display_cleanup() to properly tear down GTK display state:
remove console and mouse notifiers, unregister clipboard peer,
destroy the main window and virtual consoles.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-22-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
a3cf9b55bb ui/egl: implement display and EGL cleanup
Add egl_cleanup() to tear down the EGL render node context, GBM device,
and EGL display. Add egl_headless_cleanup() to unregister listeners,
destroy framebuffers, and free per-console state tracked via a new
GPtrArray.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-19-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
285689a3f1 ui: add display cleanup infrastructure
Add a cleanup callback to QemuDisplay and a qemu_display_cleanup()
function that iterates all registered display types and calls their
cleanup handler. Wire it into qemu_cleanup() in runstate.c, replacing
the ad-hoc vnc_cleanup() call.

This provides a structured alternative to atexit() handlers, giving
deterministic teardown ordering and making resource leaks visible to
sanitizers.

The cleanup should happen before user_creatable_cleanup(), since some
display have weak user-creatable references to cleanup before.

Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-15-4656aec3398d@redhat.com>
2026-06-24 15:41:15 +04:00
Marc-André Lureau
73ae0be3f1 ui/spice: add cleanup on shutdown
SPICE resources were never freed on shutdown. Add per-subsystem
cleanup (display, input, core) and call it from qemu_cleanup().

Move spice-module.c into libui so the qemu_spice ops table links
with the rest of the UI code. Add an LSan suppression for a known
spice-server leak.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-14-4656aec3398d@redhat.com>
2026-06-24 15:41:14 +04:00
Marc-André Lureau
59deba3b74 ui/spice: remove dead spice_displays
This is left-over from commit 9fa032866d ("spice: fix multihead support")

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-13-4656aec3398d@redhat.com>
2026-06-24 15:41:14 +04:00
Marc-André Lureau
1599015a7a glib-compat: add fallback for g_clear_fd/g_autofd
Those helpers were added in glib 2.76.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-7-4656aec3398d@redhat.com>
2026-06-24 15:41:14 +04:00
Marc-André Lureau
0457762e9e irq: add per-IRQ observer to fix qemu_irq_intercept_in leak
qemu_irq_intercept_in() saves original IRQ handlers by allocating
new QOM objects, which are never freed. On a PC machine, this leaks
IRQ objects (one per IOAPIC pin) on every qtest run.

Rather than tracking allocations to free later, avoid them: add an
"observer" field to IRQState, called by qemu_set_irq() after the
real handler. Interception sets the observer instead of rewriting
handlers, so there's nothing to save and nothing to leak.

Fix qemu_notirq() to route through qemu_set_irq() so inverted IRQs
trigger observers too. Drop the LSan suppression.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260623-b4-ui-v4-3-4656aec3398d@redhat.com>
2026-06-24 15:41:14 +04:00
Marc-André Lureau
1f3241bcae system/physmem: make ram_block_discard_range() handle guest_memfd
Most callers of ram_block_discard_range() want to discard both the
shared and guest_memfd backing. Only kvm_convert_memory() intentionally
discards a single plane during private/shared conversions.

Rename the current implementation to ram_block_discard_shared_range()
and make ram_block_discard_range() a composite that also discards
guest_memfd when present (rb->guest_memfd >= 0). This ensures callers
like virtio-mem, virtio-balloon, hv-balloon, migration.. reclaim
private pages on discard.

Update kvm_convert_memory() to use the plane-specific
ram_block_discard_shared_range() since it only needs to discard
the shared backing when converting to private.

Likewise, after TDVF image copy, use ram_block_discard_shared_range().

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-11-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:49 -04:00
Marc-André Lureau
cc9c77f4dd system/memory: implement RamDiscardManager multi-source aggregation
Refactor RamDiscardManager to aggregate multiple RamDiscardSource
instances. This enables scenarios where multiple components (e.g.,
virtio-mem and RamBlockAttributes) can coordinate memory discard
state for the same memory region.

The aggregation uses:
- Populated: ALL sources populated
- Discarded: ANY source discarded

When a source is added with existing listeners, they are notified
about regions that become discarded. When a source is removed,
listeners are notified about regions that become populated.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-7-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Marc-André Lureau
f46a11c563 system/ram-discard-manager: drop replay from source interface
Remove replay_populated and replay_discarded from RamDiscardSourceClass
now that the RamDiscardManager handles replay iteration internally via
is_populated.

Remove the now-dead replay methods, helpers, and
for_each_populated/discarded_section() from ram-block-attributes, which
was the last source still carrying this code.

Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: David Hildenbrand <david@kernel.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-6-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Marc-André Lureau
49a159baae system/memory: constify section arguments
The sections shouldn't be modified.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Acked-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> # for CPR
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-3-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Marc-André Lureau
d444e348b1 system/memory: move RamDiscardManager to separate compilation unit
Extract RamDiscardManager and RamDiscardSource from system/memory.c into
dedicated a unit.

This reduces coupling and allows code that only needs the
RamDiscardManager interface to avoid pulling in all of memory.h
dependencies.

rust-sys bindings are no longer generated for RamDiscardSourceClass at
this point, thus we drop the unneeded InterfaceClass use.

Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: David Hildenbrand <david@kernel.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-2-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Marc-André Lureau
43d1320c6c system/memory: split RamDiscardManager into source and manager
Refactor the RamDiscardManager interface into two distinct components:
- RamDiscardSource: An interface that state providers (virtio-mem,
  RamBlockAttributes) implement to provide discard state information
  (granularity, populated/discarded ranges, replay callbacks).
- RamDiscardManager: A concrete QOM object that wraps a source, owns
  the listener list, and handles listener registration/unregistration
  and notifications.

This separation moves the listener management logic from individual
source implementations into the central RamDiscardManager, reducing
code duplication between virtio-mem and RamBlockAttributes.

The change prepares for future work where a RamDiscardManager could
aggregate multiple sources.

Note, the original virtio-mem code had conditions before discard:
  if (vmem->size) {
      rdl->notify_discard(rdl, rdl->section);
  }
however, the new code calls discard unconditionally. This is considered
safe, since the populate/discard of sections are already asymmetrical
(unplug & unregister all listener section unconditionally).

Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: David Hildenbrand <david@kernel.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260604-rdm5-v5-1-5768e6a0943d@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Gavin Shan
cde9c44562 system/memory: Remove MAX_PHYS_ADDR
Remove MAX_PHYS_ADDR and MAX_PHYS_ADDR_SPACE_BITS as they're not used
since the addition by commit 052e87b073 ("memory: make section size
a 128-bit integer").

Signed-off-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20260608002303.851456-1-gshan@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2026-06-22 17:08:48 -04:00
Ziyang Zhang
731525c276 plugins: use int64_t for the syscall filter return value
The syscall return value passed back through the syscall filter
callback is semantically signed: negative values encode errno codes.
Declaring the sysret pointer as uint64_t * is therefore misleading and
forces callers to launder the value through an unsigned temporary.

Change the sysret pointer to int64_t * across the public plugin API
typedef (qemu_plugin_vcpu_syscall_filter_cb_t), the internal
qemu_plugin_vcpu_syscall_filter() prototypes and stub, its
implementation in plugins/core.c, the linux-user caller, and the
in-tree example plugins.

Signed-off-by: Ziyang Zhang <functioner@sjtu.edu.cn>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Link: https://lore.kernel.org/qemu-devel/20260618082426.790315-2-functioner@sjtu.edu.cn
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
2026-06-18 16:47:12 -07:00
Stefan Hajnoczi
3b50303f95 Merge tag 'accel-20260618' of https://github.com/philmd/qemu into staging
Accelerators patches queue

- Avoid double hv_vcpu_destroy() call during teardown on HVF ARM
- Constify various AddressSpace/MemoryRegionCache arguments
- Clarify physical_memory_*() API in "system/physmem.h"
- Extract "accel/tcg/cpu-loop.h" out of "exec/cpu-common.h"
- Restrict few TCG-specific code
- Remove pre-C11 check
- Various header cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmoz5EIACgkQ4+MsLN6t
# wN4pJhAAtQ+qMRS49PoXnyBkPnuTZlnIjhy0gpXp7wRAiZiOQFjgIkX7F8YKz/aQ
# Hu15PIsbvH7mjzTiSfW48Km/3qzzCx0F0U9KsNaZLCJ+/HVctaN94slewgAfA6qc
# sEuVq6u70oaeGjYVM1wmUXhK3h2vfpWPnE81qjUJBnjsfC99T24TMmtY0CGw8f9J
# UJ6SpkwlES9B6YeJ0GFACCZMTMD0QiXuAtKzfL/2aD1Ts31qY9DG/bdlmDJJ3R0Y
# y/ZcWjvPQE4NDdcMfuW4/ywz7sAX/h0XreMIb2OL5ppE0qYDBqpB6SFGWjg4uQ5r
# yDhzVhdrPT2HxXl9LTYOjlAQEHrs3Pm0170G7OwCVs+gtlloZqV08sJ+61J2jv73
# OH2YsQh/sIy9QUPZxI+LloBRLApMg5mjY9KP5DPH2qmsOpvE4fj07hq+EXS3OCuz
# L+3TMD0fhxI+RHg8/zaqidc3+Xb4zN/H069Qkjx0wyQI7QMmfK4rU4CJV6MP6d9r
# r9qngtxVfbGfXpaDqan73TjKHx/ZnOgNQqrfaeypiAkiyIoOPRzeG3H6T17HlOBX
# S2Pz4vllzs0SS1vC4OKnS1BI2eEf6ge14ozKGQqh5qOvfKlTy4s8fXX/2MKIaqMG
# cVE4lkL2suLoxmOu2zsEvDBCVUaRLWZLJZib1J4B/UIvvC3rpQs=
# =Jj+Z
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 18 Jun 2026 08:27:46 EDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'accel-20260618' of https://github.com/philmd/qemu: (48 commits)
  accel/tcg: Restrict headers being TCG specific
  accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'
  accel/tcg: Have cpu_loop_exit_requested() take const @cpu argument
  accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_unwind_state_data() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_exec_step_atomic() out of 'exec/cpu-common.h'
  accel/tcg: Move cpu_exec() out of 'exec/cpu-common.h'
  accel/tcg: Remove cpu_loop_exit() stub
  hw/s390x/ipl: Remove TCG dependency in handle_diag_308()
  system/memory: Rename cpu_exec_init_all() -> machine_memory_init()
  system/memory: Remove unnecessary CONFIG_USER_ONLY guards
  exec/cpu-common.h: Avoid including unused exec/page-protection.h header
  exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header
  exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header
  exec/cpu-common.h: Include missing 'qemu/thread.h' header
  ui/cocoa: Use qemu_input_map_osx_to_linux
  util/cutils: drop qemu_strnlen() in favor of strnlen()
  configure: honor --extra-ldflags when forced to use objc_LINKER
  meson: build macOS signed binary as part of the default target
  accel/tcg: Restrict IOMMU declarations
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-06-18 16:28:12 -04:00
Stefan Hajnoczi
407a769aa8 Merge tag 'ui-input-pr-v1' of https://gitlab.com/marcandre.lureau/qemu into staging
UI patches for 2026-06-17

- retire input-legacy.c
- sdl2 fixes

To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmoyu8oACgkQ2ujhCXWW
# nOX6RA//TQRZhYpHWGZSKsBWkC1UXPSHXfsbaMrrv9L8U66nXxN9FZgqukisw8rq
# udUNHzdhfRVlTOcEDYscgNeGTIIZ/2phFrNOE0759Q4BIg7CNaEBhvjNmzp/tAVV
# XImS3RzzVdE2RJKN8DAaFKqCAIa2NF8ZPr7NtjIK/VwUPQ0AtfY/plVGtfkChSTx
# +WZt2gTkli0WMGYFz0ZXttqtfuts1fCTxyNUwBItNQkgXzM9+lPmIHYOSF4huPa1
# ek03WVrA6k9ke+A9lNpSl1l/a6g8FBOfHSzSBBWhjT8pQN0iChLzxzkBXWKbvBOk
# PhprHBTNVzY1ogLp3WupVcXTDl/bgaHS/4cv75plR5qHrZC7Z0sDachr7MtVvrDW
# SsSV7Ni2ggiXJ8EspGPKNQ1PFV69TmwSeRVGaJUlXUDdr25k6sN59sqLpwBMZb/O
# UwxeqUI3LXmFdjzGoGHmHdB4UneENOEHoTBTqj/lkHjm+sxB504/ZIewhK7bjtlr
# efi11fRB3+XAUZVrC9BCmaeD+ZZANqQ5PXex8KfZpD5+H7VuJVEnAIIvCQqNCg4i
# UGDuqWV7qxsVP6jMdidtUYKPiKZEGChAYGsYNvoJ+mXusebkJLHY6zUyIcMEcJCL
# Bu/oFF9PaPYBBvvS45hzn5MVgR//ylWZpEFqtqRzXYrxCzruvRE=
# =VcKS
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 11:22:50 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'ui-input-pr-v1' of https://gitlab.com/marcandre.lureau/qemu: (27 commits)
  ui/sdl2: Set GL ES profile before creating initial GL context
  ui/sdl2: Explicitly specify EGL platform
  ui/pixman: fix zero rowstride in qemu_pixman_image_new_shareable()
  ui/input: Have qemu_input_is_absolute() take a const QemuConsole
  tools/qemu-vnc: Have console_get_mouse/keyboard take const QemuConsole
  ui/input: remove old LED handler broadcast queue
  ui/dbus: switch LED handling to Notifier-based input API
  ui/spice: switch LED handling to Notifier-based input API
  ui/vnc: switch LED handling to Notifier-based input API
  hw/input/virtio-input-hid: use qemu_input_handler_set_leds_mask() for LED state
  hw/input/hid: use qemu_input_handler_set_leds_mask() for LED state
  hw/input/ps2: use qemu_input_handler_set_leds_mask() for LED state
  ui/input: qemu_input_handler_register to warn for unused result
  hw/m68k: keep QemuInputHandlerState in next-kbd
  hw/input: keep QemuInputHandlerState in stellaris
  hw/input: keep QemuInputHandlerState in adb-kbd
  hw/arm: keep QemuInputHandlerState in musicpal
  hw/input/ps2: keep QemuInputHandlerState in PS2State
  ui/input: add LED state tracking to QemuInputHandlerState
  ui/input: remove dead declaration
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-06-18 09:47:17 -04:00
Stefan Hajnoczi
44f7c85be4 Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* GNU/Hurd support
* More patches to support qemu-ga builds with clang-cl
* gdbstub: Update x86 control register bits
* rust: fix incorrect dependency in Cargo.toml
* target/i386: apply mod to immediate count of an RCL/RCR operation

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmoynoYUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNaIgf8D6Nb0jy5hP2t43s6ZT5VEM+k889p
# 89TiRelrnzvcrZ8GhfB+JeA87LCd0pNn0nIspsMzA6butOzO/tlft2vLlNEXevli
# MNhZVdj2PNGwN3TqW4EM4zM1VmLFxMshEEtAcBtHkUCCxlkscju+zSmwnJ0zzHy/
# fQpOAXO3HtDlHEzLF1QWjjpHQd6IorjeWqRVzH8i+djlgk6YGn51mNYOwgvBOSUZ
# IET2FVabLpJkoQWlr11mt3woL+cxi5tKeVFAUzHB6q6rvkbLp85tyDx2nW4O+M8C
# G7Hb82z/nV6Rh0E6ehq3x0DDdYTxt1ARyljnx3QQIsZo5uAVP+1WtqIgkg==
# =nh+D
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 17 Jun 2026 09:17:58 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  qga/vss: Drop unused define uuid(x)
  qga/vss: Remove unused undefs
  qga/vss: Use MAX_PATH instead of PATH_MAX
  qga/meson: Allow to use MSVC message compiler 'mc'
  qga/meson: Use windows.compile_resources instead of custom_target
  qga/meson: Remove unused lib stdc++
  qga/win: Use swprintf instead of snwprintf
  Make copy_file_range non-static on GNU/Hurd
  block/file-posix: Clean up sys/ioctl import
  tpm: Add conditional to not compile ioctls on GNU/Hurd
  Add GNU/Hurd host_os=gnu
  Include new arbitrary limits if not already defined
  gdbstub: Update x86 control register bits
  target/i386: add more easy cases to gen_eflags_adcox
  target/i386: apply mod to immediate count of an RCL/RCR operation
  rust: fix incorrect dependency in Cargo.toml

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2026-06-18 09:46:49 -04:00
Philippe Mathieu-Daudé
1eaae985d4 accel/tcg: Restrict headers being TCG specific
Forbid including TCG-specific headers in non-TCG builds.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-12-philmd@oss.qualcomm.com>
2026-06-18 14:27:21 +02:00
Philippe Mathieu-Daudé
2368ea9744 accel/tcg: Move cpu_loop_exit_*() out of 'exec/cpu-common.h'
Move the following TCG-specific cpu_loop_exit_*() declarations
out of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one, documenting them:

 - cpu_loop_exit_noexc()
 - cpu_loop_exit_atomic()
 - cpu_loop_exit_restore()
 - cpu_loop_exit()

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-11-philmd@oss.qualcomm.com>
2026-06-18 14:27:21 +02:00
Philippe Mathieu-Daudé
f6ff0d1ffc accel/tcg: Have cpu_loop_exit_requested() take const @cpu argument
Since the CPUState argument is simply read-only accessed, make it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-9-philmd@oss.qualcomm.com>
2026-06-18 14:27:21 +02:00
Philippe Mathieu-Daudé
e1883d1a32 accel/tcg: Move cpu_restore_state() out of 'exec/cpu-common.h'
Move the TCG-specific cpu_restore_state() declaration out
of the generic "exec/cpu-common.h" header, to the recently
created "accel/tcg/cpu-loop.h" one.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-8-philmd@oss.qualcomm.com>
2026-06-18 14:27:21 +02:00