Re: [PATCH v8 23/55] i386/tdx: Setup the TD HOB list

2025-04-24 Thread Zhao Liu
On Tue, Apr 01, 2025 at 09:01:33AM -0400, Xiaoyao Li wrote: > Date: Tue, 1 Apr 2025 09:01:33 -0400 > From: Xiaoyao Li > Subject: [PATCH v8 23/55] i386/tdx: Setup the TD HOB list > X-Mailer: git-send-email 2.34.1 > > The TD HOB list is used to pass the information from VMM to TDVF. The TD > HOB m

Re: [PATCH v6 2/6] pc-bios: Add AST27x0 vBootrom

2025-04-24 Thread Cédric Le Goater
On 4/25/25 04:28, Jamin Lin wrote: Hi Cedric, Nabih Subject: Re: [PATCH v6 2/6] pc-bios: Add AST27x0 vBootrom On 4/24/25 09:51, Jamin Lin wrote: The boot ROM is a minimal implementation designed to load an AST27x0 boot image. Its source code is available at: https://github.com/google/vbootr

Re: [PATCH v3 0/6] python: add QAPI and qapidoc et al to python linter tests

2025-04-24 Thread Markus Armbruster
John Snow writes: > Hiya, this series turns on automated linting for scripts/qapi, > docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py. > > This includes flake8/isort/pylint/mypy for scripts/qapi, but omits mypy > from the Sphinx plugins owing to my inability to strictly type the > extensions

Re: [RFC PATCH v5 08/21] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 17:16, BALATON Zoltan wrote: On Fri, 25 Apr 2025, Philippe Mathieu-Daudé wrote: A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the

Re: [RFC 01/10] i386/cpu: Mark CPUID[0x80000005] as reserved for Intel

2025-04-24 Thread Ewan Hai
On 4/23/25 7:46 PM, Zhao Liu wrote: Per SDM, 0x8005 leaf is reserved for Intel CPU, and its current "assert" check blocks adding new cache model for non-AMD CPUs. Therefore, check the vendor and encode this leaf as all-0 for Intel CPU. And since Zhaoxin mostly follows Intel behavior, app

[PATCH v7 1/6] linux-header: update-linux-header script changes

2025-04-24 Thread Rorie Reyes
Kernel commit 8a141be3233a changed from using ASSEMBLY to ASSEMBLER Updated the update-linux-header script to match Signed-off-by: Rorie Reyes --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-

[PATCH v7 6/6] s390: implementing CHSC SEI for AP config change

2025-04-24 Thread Rorie Reyes
Handle interception of the CHSC SEI instruction for requests indicating the guest's AP configuration has changed. If configuring -without-defaul-devices, hw/vfio/ap-sub.c was created to handle such circumstance. Also added if CONFIG_VFIO_AP is false, it will use the stub file. Signed-off-by: Rori

[PATCH v7 2/6] linux-headers: Update to Linux v6.15-rc3

2025-04-24 Thread Rorie Reyes
Update headers to retrieve uapi information for vfio-ap Signed-off-by: Rorie Reyes --- include/standard-headers/asm-x86/setup_data.h | 4 +- include/standard-headers/drm/drm_fourcc.h | 41 ++ include/standard-headers/linux/const.h| 2 +- include/standard-headers/linux/ethtoo

[PATCH v7 0/6] Report vfio-ap configuration changes

2025-04-24 Thread Rorie Reyes
Changelog: v7: - Dropped initial commit for linux-header file vfio.h since I created two new commits to address the changes made in v6 - Moved patches 6 and 7 to the beginning of the series after dropping the first patch - Because I dropped the initial commit for linux-header file vfio.h, I ha

[PATCH v7 3/6] hw/vfio/ap: notification handler for AP config changed event

2025-04-24 Thread Rorie Reyes
Register an event notifier handler to process AP configuration change events by queuing the event and generating a CRW to let the guest know its AP configuration has changed Signed-off-by: Rorie Reyes Reviewed-by: Anthony Krowiak --- hw/vfio/ap.c | 31 +++ 1 file cha

[PATCH v7 4/6] hw/vfio/ap: store object indicating AP config changed in a queue

2025-04-24 Thread Rorie Reyes
Creates an object indicating that an AP configuration change event has been received and stores it in a queue. These objects will later be used to store event information for an AP configuration change when the CHSC instruction is intercepted. Signed-off-by: Rorie Reyes --- hw/vfio/ap.c | 12 +++

[PATCH v7 5/6] hw/vfio/ap: Storing event information for an AP configuration change event

2025-04-24 Thread Rorie Reyes
These functions can be invoked by the function that handles interception of the CHSC SEI instruction for requests indicating the accessibility of one or more adjunct processors has changed. Signed-off-by: Rorie Reyes --- hw/vfio/ap.c | 39 inc

Re: [PATCH v8 22/55] headers: Add definitions from UEFI spec for volumes, resources, etc...

2025-04-24 Thread Zhao Liu
On Tue, Apr 01, 2025 at 09:01:32AM -0400, Xiaoyao Li wrote: > Date: Tue, 1 Apr 2025 09:01:32 -0400 > From: Xiaoyao Li > Subject: [PATCH v8 22/55] headers: Add definitions from UEFI spec for > volumes, resources, etc... > X-Mailer: git-send-email 2.34.1 > > Add UEFI definitions for literals, enu

Re: [PATCH v8 21/55] i386/tdx: Track RAM entries for TDX VM

2025-04-24 Thread Zhao Liu
On Tue, Apr 01, 2025 at 09:01:31AM -0400, Xiaoyao Li wrote: > Date: Tue, 1 Apr 2025 09:01:31 -0400 > From: Xiaoyao Li > Subject: [PATCH v8 21/55] i386/tdx: Track RAM entries for TDX VM > X-Mailer: git-send-email 2.34.1 > > The RAM of TDX VM can be classified into two types: > > - TDX_RAM_UNACC

Re: A question about how to calculate the "Maximum transfer length" in case of its absence in the Block Limits VPD device response from the hardware

2025-04-24 Thread lma
在 2025-04-24 22:51,Stefan Hajnoczi 写道: On Wed, Apr 23, 2025 at 10:07:48PM +0800, lma wrote: 在 2025-04-23 21:24,Stefan Hajnoczi 写道: > On Wed, Apr 23, 2025 at 05:47:44PM +0800, lma wrote: > > 在 2025-04-18 23:34,Stefan Hajnoczi 写道: > > > On Thu, Apr 17, 2025 at 07:27:26PM +0800, lma wrote: > > > >

Re: [PATCH v2 0/2] hw/loongarch/virt: Small enhancements with ACPI table

2025-04-24 Thread bibo mao
slightly ping... On 2025/3/4 下午3:41, Bibo Mao wrote: There are two small enhancements about ACPI table on LoongArch virt machine type. One is replacing RSDT table with XSDT table to support 64 bit address, the other is adding support to customize OEM ID and OEM table ID. Bibo Mao (2): hw/loo

RE: [PATCH v6 2/6] pc-bios: Add AST27x0 vBootrom

2025-04-24 Thread Jamin Lin
Hi Cedric, Nabih > Subject: Re: [PATCH v6 2/6] pc-bios: Add AST27x0 vBootrom > > On 4/24/25 09:51, Jamin Lin wrote: > > The boot ROM is a minimal implementation designed to load an AST27x0 > boot image. > > Its source code is available at: > > https://github.com/google/vbootrom > > Commit id: 82b

RE: [PATCH] vfio: Register/unregister container for CPR only once for each container

2025-04-24 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH] vfio: Register/unregister container for CPR only once for >each container > >On 4/24/25 08:33, Zhenzhong Duan wrote: >> vfio_cpr_register_container and vfio_cpr_unregister_container are container >> scoped function. Callin

[PATCH v2] hw/loongarch/virt: Get physical entry address with elf file

2025-04-24 Thread Bibo Mao
With load_elf() api, image load low address and high address is converted to physical address if parameter translate_fn is provided. However executing entry address is still virtual address. Here convert entry address into physical address, since MMU is disabled when system power on, the first PC i

[PATCH v3 08/11] mirror: Skip writing zeroes when target is already zero

2025-04-24 Thread Eric Blake
When mirroring, the goal is to ensure that the destination reads the same as the source; this goal is met whether the destination is sparse or fully-allocated. However, if the destination cannot efficiently write zeroes, then any time the mirror operation wants to copy zeroes from the source to th

[PATCH v3 05/11] iotests: Improve iotest 194 to mirror data

2025-04-24 Thread Eric Blake
Mirroring a completely sparse image to a sparse destination should be practically instantaneous. It isn't yet, but the test will be more realistic if it has some non-zero to mirror as well as the holes. Signed-off-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/194 | 1 + 1

[PATCH v3 11/11] mirror: Allow QMP override to declare target already zero

2025-04-24 Thread Eric Blake
QEMU's attempts to learn whether a destination file starts life with all zero contents are just a heuristic. There may be cases where the caller is aware of information that QEMU cannot learn quickly, in which case telling QEMU what to assume about the destination can make the mirror operation fas

[PATCH v3 07/11] mirror: Skip pre-zeroing destination if it is already zero

2025-04-24 Thread Eric Blake
When doing a sync=full mirroring, QMP drive-mirror requests full zeroing if it did not just create the destination, and blockdev-mirror requests full zeroing unconditionally. This is because during a full sync, we must ensure that the portions of the disk that are not otherwise touched by the sour

[PATCH v3 04/11] block: Add new bdrv_co_is_all_zeroes() function

2025-04-24 Thread Eric Blake
There are some optimizations that require knowing if an image starts out as reading all zeroes, such as making blockdev-mirror faster by skipping the copying of source zeroes to the destination. The existing bdrv_co_is_zero_fast() is a good building block for answering this question, but it tends

[PATCH v3 00/11] Make blockdev-mirror dest sparse in more cases

2025-04-24 Thread Eric Blake
v2 was here: https://lists.gnu.org/archive/html/qemu-devel/2025-04/msg02940.html In v3: - use flags instead of enum at start of series [Stefan] - Don't throttle for skipped zeroes [Sunny] - Try harder to punch holes for "detect-zeroes":"unmap" - More cases in mirror-sparse iotest - R-b added

[PATCH v3 09/11] iotests/common.rc: add disk_usage function

2025-04-24 Thread Eric Blake
From: Andrey Drobyshev Move the definition from iotests/250 to common.rc. This is used to detect real disk usage of sparse files. In particular, we want to use it for checking subclusters-based discards. Signed-off-by: Andrey Drobyshev Reviewed-by: Alexander Ivanov Reviewed-by: Alberto Garci

[PATCH v3 06/11] mirror: Minor refactoring

2025-04-24 Thread Eric Blake
Commit 5791ba52 (v9.2) pre-initialized ret in mirror_dirty_init to silence a false positive compiler warning, even though in all code paths where ret is used, it was guaranteed to be reassigned beforehand. But since the function returns -errno, and -1 is not always the right errno, it's better to

[PATCH v3 01/11] block: Expand block status mode from bool to flags

2025-04-24 Thread Eric Blake
This patch is purely mechanical, changing bool want_zero into an unsigned int for bitwise-or of flags. As of this patch, all implementations are unchanged (the old want_zero==true is now mode==BDRV_WANT_PRECISE which is a superset of BDRV_WANT_ZERO); but the callers in io.c that used to pass want_

[PATCH v3 10/11] tests: Add iotest mirror-sparse for recent patches

2025-04-24 Thread Eric Blake
Prove that blockdev-mirror can now result in sparse raw destination files, regardless of whether the source is raw or qcow2. By making this a separate test, it was possible to test effects of individual patches for the various pieces that all have to work together for a sparse mirror to be success

[PATCH v3 03/11] block: Let bdrv_co_is_zero_fast consolidate adjacent extents

2025-04-24 Thread Eric Blake
Some BDS drivers have a cap on how much block status they can supply in one query (for example, NBD talking to an older server cannot inspect more than 4G per query; and qcow2 tends to cap its answers rather than cross a cluster boundary of an L1 table). Although the existing callers of bdrv_co_is

[PATCH v3 02/11] file-posix, gluster: Handle zero block status hint better

2025-04-24 Thread Eric Blake
Although the previous patch to change 'bool want_zero' into a bitmask made no semantic change, it is now time to differentiate. When the caller specifically wants to know what parts of the file read as zero, we need to use lseek and actually reporting holes, rather than short-circuiting and advert

Re: [RFC PATCH v5 08/21] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

2025-04-24 Thread BALATON Zoltan
On Fri, 25 Apr 2025, Philippe Mathieu-Daudé wrote: A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the qemu-system-aarch64 binary. Signed-off-

[PATCH v5 7/8] include/system: make functions accessible from common code

2025-04-24 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- include/system/kvm.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h index 18811cad6fd..b690dda1370 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -210,6 +210,10 @@ bool kv

[PATCH v5 3/8] hw/hyperv/vmbus: common compilation unit

2025-04-24 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- hw/hyperv/vmbus.c | 2 +- hw/hyperv/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index 98ea968e515..b4f3e12fe1a 100644 --- a/hw/hyperv/vmbus.c +++ b/

[PATCH v5 0/8] hw/hyperv: remove duplication compilation units

2025-04-24 Thread Pierrick Bouvier
Work towards having a single binary, by removing duplicated object files. v2 - remove osdep from header - use hardcoded buffer size for syndbg, assuming page size is always 4Kb. v3 - fix assert for page size. v4 - use KiB unit v5 - rebase on top of system memory common series - make hw/hyperv/h

[PATCH v5 4/8] hw/hyperv/syndbg: common compilation unit

2025-04-24 Thread Pierrick Bouvier
We assume that page size is 4KB only, to dimension buffer size for receiving message. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier --- hw/hyperv/syndbg.c| 9 ++--- hw/hyperv/meson.build | 2 +- 2 files changed, 7 insertions(+), 4 de

[PATCH v5 5/8] hw/hyperv/balloon: common balloon compilation units

2025-04-24 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- hw/hyperv/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build index a9f2045a9af..5acd709bdd5 100644 --- a/hw/hyperv/meson.build +++ b/hw/hyperv/meson.build

Re: [PATCH v5 0/8] hw/hyperv: remove duplication compilation units

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 16:28, Pierrick Bouvier wrote: Work towards having a single binary, by removing duplicated object files. v2 - remove osdep from header - use hardcoded buffer size for syndbg, assuming page size is always 4Kb. v3 - fix assert for page size. v4 - use KiB unit v5 - rebase on top of sy

[PATCH v5 2/8] hw/hyperv/hyperv.h: header cleanup

2025-04-24 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/hw/hyperv/hyperv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/hyperv/hyperv.h b/include/hw/hyperv/hyperv.h index d717b4e13d4..63a8b65278f 100644 --- a/include/hw/hyperv/hyperv.h +++ b

[PATCH v5 6/8] hw/hyperv/hyperv_testdev: common compilation unit

2025-04-24 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- hw/hyperv/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build index 5acd709bdd5..ef5a596c8ab 100644 --- a/hw/hyperv/meson.build +++ b/hw/hyperv/meson.build

[PATCH v5 1/8] hw/hyperv/hv-balloon-stub: common compilation unit

2025-04-24 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- hw/hyperv/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/hyperv/meson.build b/hw/hyperv/meson.build index d3d2668c71a..f4aa0a5ada9 100644 --- a/hw/hyperv/meson.build +++ b/hw/hyperv/meson.bui

[PATCH v5 8/8] hw/hyperv/hyperv: common compilation unit

2025-04-24 Thread Pierrick Bouvier
Signed-off-by: Pierrick Bouvier --- hw/hyperv/hyperv.c| 3 ++- hw/hyperv/meson.build | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/hyperv/hyperv.c b/hw/hyperv/hyperv.c index 8f193fd0bdf..1197a403efc 100644 --- a/hw/hyperv/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -13,6

Re: [PATCH 03/11] vfio/igd: Detect IGD device by OpRegion

2025-04-24 Thread Alex Williamson
On Tue, 22 Apr 2025 00:31:03 +0800 Tomita Moeko wrote: > There is currently no straightforward way to distinguish if a Intel > graphics device is IGD or discrete GPU. However, only IGD devices expose > OpRegion. Use the presence of VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION > to identify IGD devices.

Re: [PATCH 01/11] vfio/igd: Restrict legacy mode to Gen6-9 devices

2025-04-24 Thread Alex Williamson
On Tue, 22 Apr 2025 00:31:01 +0800 Tomita Moeko wrote: > Intel only provides legacy VBIOS for IGD up to Gen9, and there is no > CSM support on later devices. Additionally, Seabios can only handle > 32-bit BDSM register used until Gen9. Since legacy mode requires VGA > capability, restrict it to G

Re: [PATCH 07/11] vfio/igd: Allow hotplugging with OpRegion enabled

2025-04-24 Thread Alex Williamson
On Tue, 22 Apr 2025 00:31:07 +0800 Tomita Moeko wrote: > OpRegion is exposed to guest as a read-only fw_cfg item, so hotplugging > with it wouldn't cause issues. Since OpRegion needs to be set up by > guest firmware, a guest reboot is typically required. For linux guests, > i915 driver is able to

Re: [RFC PATCH v5 04/21] hw/core/null-machine: Define machine as generic QOM type

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:47, Philippe Mathieu-Daudé wrote: On 25/4/25 00:30, Pierrick Bouvier wrote: On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in prep

Re: [RFC PATCH v5 04/21] hw/core/null-machine: Define machine as generic QOM type

2025-04-24 Thread Philippe Mathieu-Daudé
On 25/4/25 00:30, Pierrick Bouvier wrote: On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in preparation to register interfaces. Signed-off-by: P

Re: [RFC PATCH v5 08/21] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

2025-04-24 Thread Philippe Mathieu-Daudé
On 25/4/25 00:35, Pierrick Bouvier wrote: On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the

Re: [RFC PATCH v5 07/21] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: DEFINE_MACHINE_WITH_INTERFACES() is similar to DEFINE_MACHINE() but allows to pass a InterfaceInfo[] pointer. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-b

Re: [RFC PATCH v5 14/21] hw/core/machine: Allow dynamic registration of valid CPU types

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:21, Philippe Mathieu-Daudé wrote: Add MachineClass::get_valid_cpu_types(), a helper that returns a dynamic list of CPU types. Since the helper takes a MachineState argument, we know the machine is created by the time we call it. Suggested-by: Pierrick Bouvier Signed-off-by: Philip

Re: [RFC PATCH v5 16/21] hw/arm/virt: Check accelerator availability at runtime

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:21, Philippe Mathieu-Daudé wrote: It is not possible to call accelerator runtime helpers when QOM types are registered, because they depend on the parsing of the '-accel FOO' command line option, which happens after main(). Now than get_valid_cpu_types() is called after accelerator

Re: [RFC PATCH v5 15/21] hw/arm/virt: Register valid CPU types dynamically

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:21, Philippe Mathieu-Daudé wrote: Replace the static array returned as MachineClass::valid_cpu_types[] by a runtime one generated by MachineClass::get_valid_cpu_types() once the machine is created (its options being processed). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vi

Re: [RFC PATCH v5 08/21] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the qemu-system-aarch64 binary. Signed-off-by:

Re: [RFC PATCH v5 04/21] hw/core/null-machine: Define machine as generic QOM type

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 15:20, Philippe Mathieu-Daudé wrote: While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in preparation to register interfaces. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/null-m

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-24 Thread Pierrick Bouvier
On 4/24/25 13:43, Philippe Mathieu-Daudé wrote: What about function name clashes? I.e.: 389 ## 390 # @query-cpu-definitions: 391 # 392 # Return a list of supported virtual CPU definitions 393 # 394 # Returns: a list of CpuDefinitionInfo 395 # 396 # Since: 1.2 397 ## 398 { 'command': 'query-cpu-d

[RFC PATCH v5 08/21] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros

2025-04-24 Thread Philippe Mathieu-Daudé
A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the qemu-system-aarch64 binary. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/arm/machi

[RFC PATCH v5 04/21] hw/core/null-machine: Define machine as generic QOM type

2025-04-24 Thread Philippe Mathieu-Daudé
While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in preparation to register interfaces. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/null-machine.c | 14 -- 1 file changed, 12 in

[RFC PATCH v5 15/21] hw/arm/virt: Register valid CPU types dynamically

2025-04-24 Thread Philippe Mathieu-Daudé
Replace the static array returned as MachineClass::valid_cpu_types[] by a runtime one generated by MachineClass::get_valid_cpu_types() once the machine is created (its options being processed). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 59 -

[RFC PATCH v5 09/21] hw/arm: Filter machine types for qemu-system-arm/aarch64 binaries

2025-04-24 Thread Philippe Mathieu-Daudé
Register machines to be able to run with the qemu-system-arm and qemu-system-aarch64 binaries, except few machines which are only available on the qemu-system-aarch64 binary: $ git grep TARGET_AARCH64 hw/arm/meson.build hw/arm/meson.build:31:arm_common_ss.add(when: ['CONFIG_RASPI', 'TARGET_AA

[RFC PATCH v5 12/21] hw/arm/aspeed: Build objects once

2025-04-24 Thread Philippe Mathieu-Daudé
Now than Aspeed machines can be filtered when running a qemu-system-arm or qemu-system-aarch64 binary, we can remove the TARGET_AARCH64 #ifdef'ry and compile the aspeed.c file once, moving it from arm_ss[] source set to arm_common_ss[]. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick

[RFC PATCH v5 20/21] hw/core: Introduce MachineClass::get_default_cpu_type() helper

2025-04-24 Thread Philippe Mathieu-Daudé
MachineClass::get_default_cpu_type() runs once the machine is created, being able to evaluate runtime checks; it returns the machine default CPU type. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/hw/boards.h | 6 ++ hw/core

[RFC PATCH v5 19/21] hw/arm/virt: Replace TARGET_AARCH64 -> target_aarch64()

2025-04-24 Thread Philippe Mathieu-Daudé
Replace the target-specific TARGET_AARCH64 definition by a call to the generic target_aarch64() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- hw/arm/virt.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --gi

[RFC PATCH v5 03/21] system/vl: Filter machine list available for a particular target binary

2025-04-24 Thread Philippe Mathieu-Daudé
Binaries can register a QOM type to filter their machines by filling their TargetInfo::machine_typename field. This can be used by example by main() -> machine_help_func() to filter the machines list. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Hende

[RFC PATCH v5 18/21] qemu/target_info: Add target_aarch64() helper

2025-04-24 Thread Philippe Mathieu-Daudé
Add a helper to distinct the binary is targetting Aarch64 or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/qemu/target-info.h | 7 +++ target-info.c | 5 + 2 files changed, 12 insertions(+) diff --git a

[RFC PATCH v5 16/21] hw/arm/virt: Check accelerator availability at runtime

2025-04-24 Thread Philippe Mathieu-Daudé
It is not possible to call accelerator runtime helpers when QOM types are registered, because they depend on the parsing of the '-accel FOO' command line option, which happens after main(). Now than get_valid_cpu_types() is called after accelerator initializations, it is safe to call the accelerat

[RFC PATCH v5 05/21] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces

2025-04-24 Thread Philippe Mathieu-Daudé
Define the TYPE_TARGET_ARM_MACHINE and TYPE_TARGET_AARCH64_MACHINE QOM interface names to allow machines to implement them. Register these interfaces in common code in target_info-qom.c used by all binaries because QOM interfaces must be registered before being checked (see next commit with the 'n

[RFC PATCH v5 10/21] meson: Prepare to accept per-binary TargetInfo structure implementation

2025-04-24 Thread Philippe Mathieu-Daudé
If a file defining the binary TargetInfo structure is available, link with it. Otherwise keep using the stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + meson.build | 9 - con

[RFC PATCH v5 14/21] hw/core/machine: Allow dynamic registration of valid CPU types

2025-04-24 Thread Philippe Mathieu-Daudé
Add MachineClass::get_valid_cpu_types(), a helper that returns a dynamic list of CPU types. Since the helper takes a MachineState argument, we know the machine is created by the time we call it. Suggested-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 4 ++

[RFC PATCH v5 21/21] hw/arm/virt: Get default CPU type at runtime

2025-04-24 Thread Philippe Mathieu-Daudé
Prefer MachineClass::get_default_cpu_type() over MachineClass::default_cpu_type to get CPU type, evaluating TCG availability at runtime calling tcg_enabled(). It's worth noting that this is a behavior change: - Previously only ./configure --disable-tcg --enable-kvm ./qemu-system-aarch64 -M v

[RFC PATCH v5 02/21] qemu: Convert target_name() to TargetInfo API

2025-04-24 Thread Philippe Mathieu-Daudé
Have target_name() be a target-agnostic method, dispatching to a per-target TargetInfo singleton structure. By default a stub singleton is used. No logical change expected. Inspired-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Hen

[RFC PATCH v5 13/21] hw/arm/raspi: Build objects once

2025-04-24 Thread Philippe Mathieu-Daudé
Now than Raspi machines can be filtered when running a qemu-system-arm or qemu-system-aarch64 binary, we can remove the TARGET_AARCH64 #ifdef'ry and compile the aspeed.c file once, moving it from arm_ss[] source set to arm_common_ss[]. Note, we expose the TYPE_BCM2837 type to qemu-system-arm, but i

[RFC PATCH v5 17/21] qemu/target_info: Add %target_arch field to TargetInfo

2025-04-24 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/qemu/target-info-impl.h | 3 +++ configs/targets/aarch64-softmmu.c | 1 + configs/targets/arm-softmmu.c | 1 + target-info-stub.c| 1 + 4 files changed, 6 insertions(+) diff --git a/include/qe

[RFC PATCH v5 06/21] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine

2025-04-24 Thread Philippe Mathieu-Daudé
When we'll start to use target_machine_typename() to filter machines for the ARM/Aarch64 binaries, the 'none' machine would be filtered out. Register the proper interfaces to keep it available. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/core/null-machine.c | 6 ++

[RFC PATCH v5 11/21] config/target: Implement per-binary TargetInfo structure (ARM, AARCH64)

2025-04-24 Thread Philippe Mathieu-Daudé
Implement the TargetInfo structure for qemu-system-arm and qemu-system-aarch64 binaries. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- configs/targets/aarch64-softmmu.c | 22 ++ configs/targets/arm-softmmu.c | 22

[RFC PATCH v5 07/21] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro

2025-04-24 Thread Philippe Mathieu-Daudé
DEFINE_MACHINE_WITH_INTERFACES() is similar to DEFINE_MACHINE() but allows to pass a InterfaceInfo[] pointer. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 765

[RFC PATCH v5 00/21] single-binary: Make hw/arm/ common

2025-04-24 Thread Philippe Mathieu-Daudé
Since v4: - Add DEFINE_MACHINE_WITH_INTERFACES (Zoltan) - Use GPtrArray for get_valid_cpu_type (Richard) - Define InterfaceInfo[] arrays (Richard) - Collect R-b tags Since v3: - QAPI structure renamed as QemuTargetInfo - MachineClass::get_valid_cpu_types() runtime - target_aarch64() checking SysEm

[RFC PATCH v5 01/21] qapi: Rename TargetInfo structure as QemuTargetInfo

2025-04-24 Thread Philippe Mathieu-Daudé
The QAPI-generated 'TargetInfo' structure name is only used in a single file. We want to heavily use another structure similarly named. Rename the QAPI one, since structure names are not part of the public API. Suggested-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pie

[PATCH] migration/postcopy: Spatial locality page hint for preempt mode

2025-04-24 Thread Peter Xu
The preempt mode postcopy has been introduced for a while. From latency POV, it should always win the vanilla postcopy. However there's one thing missing when preempt mode is enabled right now, which is the spatial locality hint when there're page requests from the destination side. In vanilla p

Re: [PATCH 08/14] vfio: add vfio-pci-base class

2025-04-24 Thread John Levon
On Thu, Apr 24, 2025 at 05:17:28PM +0200, Cédric Le Goater wrote: > !---| > CAUTION: External Email > > |---! > > On 4/9/25 15:48, John Levon wrote: > > Split out part

Re: [PULL 000/148] single-binary patch queue

2025-04-24 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

[PATCH v3 4/6] python: add qapi static analysis tests

2025-04-24 Thread John Snow
Update the python tests to also check QAPI and the QAPI Sphinx extensions. The docs/sphinx/qapidoc_legacy.py file is not included in these checks, as it is destined for removal soon. mypy is also not called on the QAPI Sphinx extensions, owing to difficulties supporting Sphinx 3.x - 8.x while maint

Re: [PULL 0/3] Miscellaneous patches for 2025-04-24

2025-04-24 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PULL 00/13] loongarch-to-apply queue

2025-04-24 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH v4 1/6] hw/misc/edu: Convert type_init() -> DEFINE_TYPES()

2025-04-24 Thread Richard Henderson
On 4/24/25 12:49, Philippe Mathieu-Daudé wrote: Prefer DEFINE_TYPES() macro over type_init() to register QOM types. Initialize the .interfaces struct field as compound literal casted to InterfaceInfo type like the rest of our code base. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/edu.c

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-24 Thread Richard Henderson
On 4/24/25 13:43, Philippe Mathieu-Daudé wrote: What about function name clashes? I.e.: 389 ## 390 # @query-cpu-definitions: 391 # 392 # Return a list of supported virtual CPU definitions 393 # 394 # Returns: a list of CpuDefinitionInfo 395 # 396 # Since: 1.2 397 ## 398 { 'command': 'query-cpu-d

[PATCH v3 5/6] python: Drop redundant warn_unused_configs = True

2025-04-24 Thread John Snow
From: Markus Armbruster strict = True implies warn_unused_configs = True. Signed-off-by: Markus Armbruster Signed-off-by: John Snow --- python/setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 84d8a1fd30d..757f41d9491 100644 --- a/python/se

[PATCH v3 3/6] python: update missing dependencies from minreqs

2025-04-24 Thread John Snow
We pin all dependencies for the "check-minreqs" test because pip lacks a dependency resolver that installs "the oldest possible package that meets dependency criteria". So, in order to test our stated minimum requirements, we pin all of our dependencies (and their dependencies, transitively) at the

[PATCH v3 1/6] qapi: Add some pylint ignores

2025-04-24 Thread John Snow
This restores the linting baseline in QAPI. Signed-off-by: John Snow --- scripts/qapi/backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi/backend.py b/scripts/qapi/backend.py index 14e60aa67af..49ae6ecdd33 100644 --- a/scripts/qapi/backend.py +++ b/scripts/qapi/backend.

[PATCH v3 6/6] qapi: delete un-needed python static analysis configs

2025-04-24 Thread John Snow
Since the previous commit, python/setup.cfg applies to scripts/qapi/ as well. Configuration files in scripts/qapi/ override python/setup.cfg. scripts/qapi/.flake8 and scripts/qapi/.isort.cfg actually match python/setup.cfg exactly, and can go. The differences between scripts/qapi/mypy.ini and py

[PATCH v3 2/6] docs/qapidoc: linting fixes

2025-04-24 Thread John Snow
This restores the linting baseline in qapidoc. The order of some imports change slightly here due to configuring isort a little better: previously, isort was having difficulty understanding that "compat" and "qapidoc_legacy" were local modules because docs/sphinx "isn't a python package". Configuri

[PATCH v3 0/6] python: add QAPI and qapidoc et al to python linter tests

2025-04-24 Thread John Snow
Hiya, this series turns on automated linting for scripts/qapi, docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py. This includes flake8/isort/pylint/mypy for scripts/qapi, but omits mypy from the Sphinx plugins owing to my inability to strictly type the extensions given the wide versions of Sph

Re: [RFC PATCH 3/3] qapi: make all generated files common

2025-04-24 Thread Richard Henderson
On 4/24/25 11:33, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- qapi/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/meson.build b/qapi/meson.build index ba9380d3f03..58ca8caee12 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -144,7

Re: [PATCH v2 07/13] target/riscv: Include missing 'accel/tcg/getpc.h' in csr.c

2025-04-24 Thread Richard Henderson
On 4/24/25 13:13, Philippe Mathieu-Daudé wrote: On 24/4/25 12:14, Mark Cave-Ayland wrote: On 24/04/2025 10:46, Philippe Mathieu-Daudé wrote: "accel/tcg/getpc.h" is pulled in indirectly. Include it explicitly to avoid when refactoring unrelated headers:    target/riscv/csr.c:2117:25: error: ca

Re: [PATCH 2/2] tcg/loongarch64: Improve constraints for TCG_CT_CONST_VCMP

2025-04-24 Thread Philippe Mathieu-Daudé
On 24/4/25 21:07, Richard Henderson wrote: Use the TCGCond given to tcg_target_const_match to exactly match the supported constant. Adjust the code generation to assume this has been done -- recall that encode_*_insn contain assertions that the constants are valid. Signed-off-by: Richard Hender

Re: [PATCH 1/2] tcg/loongarch64: Fix vec_val computation in tcg_target_const_match

2025-04-24 Thread Philippe Mathieu-Daudé
On 24/4/25 21:07, Richard Henderson wrote: Only use vece for a vector constant. This avoids an assertion failure in sextract64 when vece contains garbage. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 14 -- 1 file changed, 8 insertions(+), 6 deletions(

[PATCH v3 02/13] accel/tcg: Use vaddr in user/page-protection.h

2025-04-24 Thread Philippe Mathieu-Daudé
From: Richard Henderson Signed-off-by: Richard Henderson Message-ID: <20250424011918.599958-14-richard.hender...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/user/page-protection.h | 17 +--- accel/tcg/user-exec.c | 51 -- 2 fil

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-24 Thread Philippe Mathieu-Daudé
+Marc-André, Daniel & Dave On 24/4/25 20:33, Pierrick Bouvier wrote: Note: This RFC was posted to trigger a discussion around this topic, and it's not expected to merge it as it is. Context === Linaro is working towards heterogeneous emulation, mixing several architectures in a single QEMU

Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-24 Thread Philippe Mathieu-Daudé
On 24/4/25 20:33, Pierrick Bouvier wrote: QAPI QAPI generated files contain conditional clauses to define various structures, enums, and commands only for specific targets. This forces files to be compiled for every target. What we try to do here is to build them only once instead. In the

[PATCH v3 05/13] include/exec: Move tb_invalidate_phys_range to translation-block.h

2025-04-24 Thread Philippe Mathieu-Daudé
From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250424011918.599958-15-richard.hender...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 5 - include/exec/translation-block.h | 4 2 f

Re: [RFC PATCH 3/3] qapi: make all generated files common

2025-04-24 Thread Philippe Mathieu-Daudé
On 24/4/25 20:33, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- qapi/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/meson.build b/qapi/meson.build index ba9380d3f03..58ca8caee12 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -144,7

  1   2   3   >