[PATCH v2 2/2] target/ppc: Move floating-point arithmetic instructions to decodetree.

2024-03-15 Thread Chinmay Rath
This patch moves the below instructions to decodetree specification : f{add, sub, mul, div, re, rsqrte, madd, msub, nmadd, nmsub}[s][.] : A-form ft{div, sqrt} : X-form With this patch, all the floating-point arithmetic instructions have

Re: [PATCH v5 49/65] i386/tdx: handle TDG.VP.VMCALL

2024-03-15 Thread Xiaoyao Li
On 3/13/2024 11:31 PM, Daniel P. Berrangé wrote: On Tue, Mar 12, 2024 at 03:44:32PM +0800, Xiaoyao Li wrote: On 3/11/2024 5:27 PM, Daniel P. Berrangé wrote: On Thu, Feb 29, 2024 at 01:37:10AM -0500, Xiaoyao Li wrote: From: Isaku Yamahata Add property "quote-generation-socket" to tdx-guest,

[PATCH v3] block: Use LVM tools for LV block device truncation

2024-03-15 Thread Alexander Ivanov
If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and resize it executing lvresize. Signed-off-by: Alexander Ivanov --- block/file-posix.c | 61

Re: [PATCH v3] block: Use LVM tools for LV block device truncation

2024-03-15 Thread Daniel P . Berrangé
On Fri, Mar 15, 2024 at 09:58:38AM +0100, Alexander Ivanov wrote: > If a block device is an LVM logical volume we can resize it using > standard LVM tools. > > Add a helper to detect if a device is a DM device. In raw_co_truncate() > check if the block device is DM and resize it executing

Re: [PATCH v2 7/7] qga/commands-posix: qmp_guest_set_user_password: use ga_run_command helper

2024-03-15 Thread Andrey Drobyshev
On 3/5/24 20:38, Daniel P. Berrangé wrote: > On Fri, Mar 01, 2024 at 07:28:58PM +0200, Andrey Drobyshev wrote: >> There's no need to check for the existence of the "chpasswd", "pw" >> executables, as the exec() call will do that for us. >> >> Signed-off-by: Andrey Drobyshev >> --- >>

Re: [PATCH for 9.0 v15 05/10] target/riscv: always clear vstart for ldst_whole insns

2024-03-15 Thread Max Chou
Reviewed-by: Max Chou On 2024/3/15 1:56 AM, Daniel Henrique Barboza wrote: Commit 8ff8ac6329 added a conditional to guard the vext_ldst_whole() helper if vstart >= evl. But by skipping the helper we're also not setting vstart = 0 at the end of the insns, which is incorrect. We'll move the

Re: [PATCH v3 1/3] migration/multifd: Ensure we're not given a socket for file migration

2024-03-15 Thread Peter Xu
On Fri, Mar 15, 2024 at 12:20:38AM -0300, Fabiano Rosas wrote: > When doing migration using the fd: URI, QEMU will fetch the file > descriptor passed in via the monitor at > fd_start_outgoing|incoming_migration(), which means the checks at > migration_channels_and_transport_compatible() happen too

Re: [PATCH] docs/s390: clarify even more that cpu-topology is KVM-only

2024-03-15 Thread Thomas Huth
On 14/03/2024 18.22, Claudio Fontana wrote: At least for now cpu-topology is implemented only for KVM. We already say this, but this tries to be more explicit, and also show it in the examples. This adds a new reference in the introduction that we can point to, whenever we need to reference

Re: [PATCH-for-9.0? 01/12] accel/tcg/plugin: Remove CONFIG_SOFTMMU_GATE definition

2024-03-15 Thread Richard Henderson
On 3/13/24 11:33, Philippe Mathieu-Daudé wrote: The CONFIG_SOFTMMU_GATE definition was never used, remove it. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/plugin-gen.c | 6 -- 1 file changed, 6 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH-for-9.0? 02/12] travis-ci: Rename SOFTMMU -> SYSTEM

2024-03-15 Thread Richard Henderson
On 3/13/24 11:33, Philippe Mathieu-Daudé wrote: Since we*might* have user emulation with softmmu, rename MAIN_SOFTMMU_TARGETS as MAIN_SYSTEM_TARGETS to express 'system emulation targets'. Signed-off-by: Philippe Mathieu-Daudé --- .travis.yml | 8 1 file changed, 4 insertions(+), 4

Re: Intention to work on GSoC project

2024-03-15 Thread Sahil
Hi, Thank you for your email. On Thursday, March 14, 2024 8:39:45 PM IST Eugenio Perez Martin wrote: > Hi Sahil, > > It's being hard to find a good self-contained small task related to > the project to be honest. As it would be out of SVQ, would it be ok > for you if we start straight to the

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Peter Xu
On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: > > migrate_set_state is also unintuitive because it ignores invalid state > > transitions and we've been using that property to deal with special > > states such as POSTCOPY_PAUSED and FAILED: > > > > - After the migration goes

[PATCH 5/9] tests/qemu-iotests: Restrict test 134 and 158 to the 'file' protocol

2024-03-15 Thread Thomas Huth
Commit b25b387fa592 updated the iotests 134 and 158 to use the --image-opts parameter for qemu-io with file protocol related options, but forgot to update the _supported_proto line accordingly. So let's do that now. Fixes: b25b387fa5 ("qcow2: convert QCow2 to use QCryptoBlock for encryption")

[PATCH 9/9] tests/qemu-iotests: Restrict tests using "--blockdev file" to the file protocol

2024-03-15 Thread Thomas Huth
Tests that use "--blockdev" with the "file" driver cannot work with other protocols, so we should mark them accordingly. Signed-off-by: Thomas Huth --- tests/qemu-iotests/tests/qcow2-internal-snapshots | 2 +- tests/qemu-iotests/tests/qsd-jobs | 2 +- 2 files changed, 2

[PATCH 4/9] tests/qemu-iotests: Restrict test 130 to the 'file' protocol

2024-03-15 Thread Thomas Huth
Using "-drive ...,backing.file.filename=..." only works with the file protocol, but not with URIs, so mark this test accordingly. Signed-off-by: Thomas Huth --- tests/qemu-iotests/130 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/130

[PATCH 8/9] tests/qemu-iotests: Fix some tests that use --image-opts for other protocols

2024-03-15 Thread Thomas Huth
Tests 263, 284 and detect-zeroes-registered-buf use qemu-io with --image-opts so we have to enforce IMGOPTSSYNTAX=true here to get $TEST_IMG in shape for other protocols than "file". Signed-off-by: Thomas Huth --- tests/qemu-iotests/263| 6 --

[PATCH 1/9] tests/qemu-iotests: Fix test 033 for running with non-file protocols

2024-03-15 Thread Thomas Huth
When running iotest 033 with the ssh protocol, it fails with: 033 fail [14:48:31] [14:48:41] 10.2soutput mismatch --- /.../tests/qemu-iotests/033.out +++ /.../tests/qemu-iotests/scratch/qcow2-ssh-033/033.out.bad @@ -174,6 +174,7 @@ 512 bytes, X ops; XX:XX:XX.X (XXX

[PATCH 6/9] tests/qemu-iotests: Restrict test 156 to the 'file' protocol

2024-03-15 Thread Thomas Huth
The test fails completely when you try to use it with a different protocol, e.g. with "./check -ssh -qcow2 156". The test uses some hand-crafted JSON statements which cannot work with other protocols, thus let's change this test to only support the 'file' protocol. Signed-off-by: Thomas Huth ---

[PATCH 3/9] tests/qemu-iotests: Restrict test 114 to the 'file' protocol

2024-03-15 Thread Thomas Huth
iotest 114 uses "truncate" and the qcow2.py script on the destination file, which both cannot deal with URIs. Thus this test needs the "file" protocol, otherwise it fails with an error message like this: truncate: cannot open

Re: [PATCH v3 2/3] migration/multifd: Duplicate the fd for the outgoing_args

2024-03-15 Thread Peter Xu
On Fri, Mar 15, 2024 at 12:20:39AM -0300, Fabiano Rosas wrote: > We currently store the file descriptor used during the main outgoing > channel creation to use it again when creating the multifd > channels. > > Since this fd is used for the first iochannel, there's risk that the > QIOChannel gets

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Cédric Le Goater
On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it ignores invalid state transitions and we've been using that property to deal with special states such as POSTCOPY_PAUSED and FAILED: - After the

[PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-15 Thread Andrey Drobyshev
Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to GuestFilesystemInfo") we have 2 values reported in guest-get-fsinfo: used = (f_blocks - f_bfree), total = (f_blocks - f_bfree + f_bavail) as returned by statvfs(3). While on Windows guests that's all we can get with

[PATCH 02/12] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

2024-03-15 Thread Sunil V L
Enable building the test application for RISC-V with appropriate dependencies updated. Signed-off-by: Sunil V L --- tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git

[PATCH-for-9.1 10/21] qapi: Make CpuModel* definitions target agnostic

2024-03-15 Thread Philippe Mathieu-Daudé
CpuModelInfo, CpuModelExpansionType and CpuModelCompareResult are not restricted to any particular target. Define them in machine.json to generate them once. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine-target.json | 78 --- qapi/machine.json

[PATCH 05/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

2024-03-15 Thread Sunil V L
Existing AARCH64 virt test functions do not have AARCH64 in their name. To add RISC-V virt related test cases, better to rename existing functions to indicate they are ARM only. Signed-off-by: Sunil V L --- tests/qtest/bios-tables-test.c | 35 ++ 1 file changed,

[RFC PATCH-for-9.1 20/21] target/ppc: Use QMP generic_query_cpu_definitions()

2024-03-15 Thread Philippe Mathieu-Daudé
Register ppc_add_alias_definitions() as handler so we can use the QMP generic_query_cpu_definitions() method. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu_init.c | 1 + target/ppc/ppc-qmp-cmds.c | 26 ++ 2 files changed, 3 insertions(+), 24 deletions(-)

[PATCH 10/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V

2024-03-15 Thread Sunil V L
Update the list of supported architectures to include RISC-V. Signed-off-by: Sunil V L --- tests/data/acpi/rebuild-expected-aml.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/rebuild-expected-aml.sh index

Re: [PATCH v2 3/6] qdev-monitor: add option to report GenericError from find_device_state

2024-03-15 Thread Vladimir Sementsov-Ogievskiy
On 15.03.24 15:51, Markus Armbruster wrote: Sorry for the late answer. Vladimir Sementsov-Ogievskiy writes: On 07.03.24 12:46, Markus Armbruster wrote: [...] I appreciate the attempt to curb the spread of DeviceNotFound errors. Two issues: * Copy-pasting find_device_state() with a false

Re: [PATCH v4 21/23] qapi/schema: add type hints

2024-03-15 Thread Markus Armbruster
John Snow writes: > This patch only adds type hints, which aren't utilized at runtime and > don't change the behavior of this module in any way. > > In a scant few locations, type hints are removed where no longer > necessary due to inference power from typing all of the rest of > creation; and

[PATCH for-9.0 v2] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
VDUSE requires that virtqueues are first enabled before the DRIVER_OK status flag is set; with the current API of the kernel module, it is impossible to enable the opposite order in our block export code because userspace is not notified when a virtqueue is enabled. This requirement also mathces

Re: [PATCH 02/12] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

2024-03-15 Thread Gerd Hoffmann
On Fri, Mar 15, 2024 at 06:35:09PM +0530, Sunil V L wrote: > Enable building the test application for RISC-V with appropriate > dependencies updated. > > Signed-off-by: Sunil V L > --- > tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +- > 1 file changed, 5 insertions(+), 1

Re: [PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-15 Thread Andrey Drobyshev
On 3/15/24 15:44, Markus Armbruster wrote: > [?? ??? ? ?? ?? arm...@redhat.com. ???, ?? ??? ?, > ?? ?? https://aka.ms/LearnAboutSenderIdentification ] > > Andrey Drobyshev writes: > >> Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to >>

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Cédric Le Goater
On 3/15/24 14:09, Peter Xu wrote: On Fri, Mar 15, 2024 at 01:20:49PM +0100, Cédric Le Goater wrote: On 3/15/24 12:01, Peter Xu wrote: On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: migrate_set_state is also unintuitive because it ignores invalid state transitions and we've

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Cédric Le Goater
On 3/15/24 14:11, Peter Xu wrote: On Fri, Mar 15, 2024 at 01:20:49PM +0100, Cédric Le Goater wrote: +static void qemu_savevm_wait_unplug(MigrationState *s, int state) One more trivial comment: I'd even consider dropping "state" altogether, as this should be the only state this function should

[PATCH v5 22/25] qapi/schema: turn on mypy strictness

2024-03-15 Thread Markus Armbruster
From: John Snow This patch can be rolled in with the previous one once the series is ready for merge, but for work-in-progress' sake, it's separate here. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/mypy.ini | 5 - 1 file

[PATCH v5 05/25] qapi: create QAPISchemaDefinition

2024-03-15 Thread Markus Armbruster
From: John Snow Include entities don't have names, but we generally expect "entities" to have names. Reclassify all entities with names as *definitions*, leaving the nameless include entities as QAPISchemaEntity instances. This is primarily to help simplify typing around expectations of what

[PATCH v5 11/25] qapi/schema: assert resolve_type has 'info' and 'what' args on error

2024-03-15 Thread Markus Armbruster
From: John Snow resolve_type() is generally used to resolve configuration-provided type names into type objects, and generally requires valid 'info' and 'what' parameters. In some cases, such as with QAPISchemaArrayType.check(), resolve_type may be used to resolve built-in types and as such

[PATCH v5 17/25] qapi/schema: fix typing for QAPISchemaVariants.tag_member

2024-03-15 Thread Markus Armbruster
From: John Snow There are two related changes here: (1) We need to perform type narrowing for resolving the type of tag_member during check(), and (2) tag_member is a delayed initialization field, but we can hide it behind a property that raises an Exception if it's called too

[PATCH v5 20/25] qapi/parser.py: assert member.info is present in connect_member

2024-03-15 Thread Markus Armbruster
From: John Snow Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 2f3c704fa2..7b13a583ac 100644 ---

[PATCH v5 23/25] qapi/schema: remove unnecessary asserts

2024-03-15 Thread Markus Armbruster
From: John Snow With strict typing enabled, these runtime statements aren't necessary anymore; we can prove them statically. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 25 - 1 file changed, 25

[PATCH v5 08/25] qapi/schema: make c_type() and json_type() abstract methods

2024-03-15 Thread Markus Armbruster
From: John Snow These methods should always return a str, it's only the default abstract implementation that doesn't. They can be marked "abstract", which requires subclasses to override the method with the proper return type. Signed-off-by: John Snow Reviewed-by: Markus Armbruster

[PATCH for-9.0 v3] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
VDUSE requires that virtqueues are first enabled before the DRIVER_OK status flag is set; with the current API of the kernel module, it is impossible to enable the opposite order in our block export code because userspace is not notified when a virtqueue is enabled. This requirement also mathces

Re: [RFC PATCH v3 3/3] migration: Add fd to FileMigrationArgs

2024-03-15 Thread Peter Xu
[I queued patch 1-2 into -stable, leaving this patch for further discussions] On Fri, Mar 15, 2024 at 08:55:42AM +, Daniel P. Berrangé wrote: > The 'file:' protocol eventually calls into qemu_open, and this > transparently allows for FD passing using /dev/fdset/NNN syntax > to pass in FDs.

[PATCH] scsi-generic: fix io_timeout property not applying

2024-03-15 Thread Lorenz Brun
The io_timeout property, introduced in c9b6609 (part of 6.0) is silently overwritten by the hardcoded default value of 30 seconds (DEFAULT_IO_TIMEOUT) in scsi_generic_realize because that function is being called after the properties have already been applied. The property definition already has

[PATCH 00/12] Add support for RISC-V ACPI tests

2024-03-15 Thread Sunil V L
Currently, bios-table-test doesn't support RISC-V. This series enables the framework changes required and basic testing. Things like NUMA related test cases will be added later. This needs refactoring/renaming of ARM64 bios table tests. Importantly, the test cases now look for the expected AML

[PATCH 01/12] roms/edk2-build.py: Add --module support

2024-03-15 Thread Sunil V L
UefiTestToolsPkg which should use edk2-build.py needs --module parameter support. Add this optional parameter handling. Signed-off-by: Sunil V L --- roms/edk2-build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roms/edk2-build.py b/roms/edk2-build.py index e564765aaa..3bfe200929

[PATCH-for-9.1 08/21] target/sparc: Make SPARC_CPU common to new SPARC32_CPU/SPARC64_CPU types

2024-03-15 Thread Philippe Mathieu-Daudé
"target/foo/cpu-qom.h" can not use any target specific definitions. Currently "target/sparc/cpu-qom.h" defines TYPE_SPARC_CPU depending on the sparc(32)/sparc64 build type. This doesn't scale in a heterogeneous context where we need to access both types concurrently. In order to do that,

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Peter Xu
On Fri, Mar 15, 2024 at 01:20:49PM +0100, Cédric Le Goater wrote: > +static void qemu_savevm_wait_unplug(MigrationState *s, int state) One more trivial comment: I'd even consider dropping "state" altogether, as this should be the only state this function should be invoked. So we can perhaps

[PATCH 07/12] tests/data/acpi/virt: Move ACPI tables under aarch64

2024-03-15 Thread Sunil V L
Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future. Signed-off-by: Sunil V L --- tests/data/acpi/virt/{ => aarch64}/APIC | Bin

Re: [PATCH 01/12] roms/edk2-build.py: Add --module support

2024-03-15 Thread Gerd Hoffmann
On Fri, Mar 15, 2024 at 06:35:08PM +0530, Sunil V L wrote: > UefiTestToolsPkg which should use edk2-build.py needs --module parameter > support. Add this optional parameter handling. I don't think this is needed. By default everything listed in [Components] should be built, which is just that

Re: [PATCH 03/12] uefi-test-tools: Add support for python based build script

2024-03-15 Thread Gerd Hoffmann
> +Build/bios-tables-test.%.efi: > + $(PYTHON) ../../roms/edk2-build.py --config uefi-test-build.config Adding '--match $*' will build one arch instead of all.

[PATCH-for-9.1 12/21] system: Introduce QemuArchBit enum

2024-03-15 Thread Philippe Mathieu-Daudé
Current QEMU_ARCH_foo definitions are used as masks. Extract the bit values, so we can easily iterate over. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/arch_init.h | 69 ++ 1 file changed, 47 insertions(+), 22 deletions(-) diff --git

Re: [PATCH v3 1/7] qga: guest-get-fsinfo: add optional 'total-bytes-root' field

2024-03-15 Thread Markus Armbruster
Andrey Drobyshev writes: > Since the commit 25b5ff1a86 ("qga: add mountpoint usage info to > GuestFilesystemInfo") we have 2 values reported in guest-get-fsinfo: > used = (f_blocks - f_bfree), total = (f_blocks - f_bfree + f_bavail) as > returned by statvfs(3). While on Windows guests that's

Re: [PATCH v4 10/25] migration: Add Error** argument to qemu_savevm_state_setup()

2024-03-15 Thread Peter Xu
On Fri, Mar 15, 2024 at 03:21:27PM +0100, Cédric Le Goater wrote: > On 3/15/24 13:20, Cédric Le Goater wrote: > > On 3/15/24 12:01, Peter Xu wrote: > > > On Fri, Mar 15, 2024 at 11:17:45AM +0100, Cédric Le Goater wrote: > > > > > migrate_set_state is also unintuitive because it ignores invalid

[RFC] Is there a bug in pause_all_vcpus()

2024-03-15 Thread zhukeqian via
During we waited on qemu_pause_cond the bql was unlocked, the vcpu's state may has been changed by other thread, so we must request the pause state on all vcpus again. For example: Both main loop thread and vCPU thread are allowed to call pause_all_vcpus(), and in general resume_all_vcpus() is

Re: Another CXL/MMIO tcg tlb corner case

2024-03-15 Thread Jørgen Hansen
> On 15 Mar 2024, at 13.25, Alex Bennée wrote: > > Jørgen Hansen writes: > >> Hi, >> >> While doing some testing using numactl-based interleaving of application >> memory >> across regular memory and CXL-based memory using QEMU with tcg, I ran into an >> issue similar to what we saw a while

[PATCH v5 06/25] qapi/schema: declare type for QAPISchemaObjectTypeMember.type

2024-03-15 Thread Markus Armbruster
From: John Snow A QAPISchemaObjectTypeMember's type gets resolved only during .check(). We have QAPISchemaObjectTypeMember.__init__() initialize self.type = None, and .check() assign the actual type. Using .type before .check() is wrong, and hopefully crashes due to the value being None.

[PATCH v5 01/25] qapi/parser: fix typo - self.returns.info => self.errors.info

2024-03-15 Thread Markus Armbruster
From: John Snow Small copy-pasto. The correct info field to use in this conditional block is self.errors.info. Fixes: 3a025d3d1ffa Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 15/25] qapi/schema: add _check_complete flag

2024-03-15 Thread Markus Armbruster
From: John Snow Instead of using the None value for the members field, use a dedicated flag to detect recursive misconfigurations. This is intended to assist with subsequent patches that seek to remove the "None" value from the members field (which can never hold that value after the final call

[PATCH v5 18/25] qapi/schema: assert inner type of QAPISchemaVariants in check_clash()

2024-03-15 Thread Markus Armbruster
From: John Snow QAPISchemaVariant's "variants" field is typed as List[QAPISchemaVariant], where the typing for QAPISchemaVariant allows its type field to be any QAPISchemaType. However, QAPISchemaVariant expects that all of its variants contain the narrower QAPISchemaObjectType. This

[PATCH v5 10/25] qapi/schema: add type narrowing to lookup_type()

2024-03-15 Thread Markus Armbruster
From: John Snow This function is a bit hard to type as-is; mypy needs some assertions to assist with the type narrowing. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v5 16/25] qapi/schema: Don't initialize "members" with `None`

2024-03-15 Thread Markus Armbruster
From: John Snow Declare, but don't initialize the "members" field with type List[QAPISchemaObjectTypeMember]. This simplifies the typing from what would otherwise be Optional[List[T]] to merely List[T]. This removes the need to add assertions to several callsites that this value is not None -

[PATCH v5 02/25] qapi/parser: shush up pylint

2024-03-15 Thread Markus Armbruster
From: John Snow Shhh! Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index fed88e9074..ec4ebef4e3 100644 ---

[PATCH v5 19/25] qapi/parser: demote QAPIExpression to Dict[str, Any]

2024-03-15 Thread Markus Armbruster
From: John Snow Dict[str, object] is a stricter type, but with the way that code is currently arranged, it is infeasible to enforce this strictness. In particular, although expr.py's entire raison d'être is normalization and type-checking of QAPI Expressions, that type information is not

[PATCH v5 04/25] qapi/schema: add pylint suppressions

2024-03-15 Thread Markus Armbruster
From: John Snow With this patch, pylint is happy with the file, so enable it in the configuration. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc | 5 - scripts/qapi/schema.py | 5 + 2 files changed, 5

[PATCH v5 12/25] qapi: Assert built-in types exist

2024-03-15 Thread Markus Armbruster
QAPISchema.lookup_type('FOO') returns a QAPISchemaType when type 'FOO' exists, else None. It won't return None for built-in types like 'int'. Since mypy can't see that, it'll complain that we assign the Optional[QAPISchemaType] returned by .lookup_type() to QAPISchemaType variables. Add

[PATCH v5 24/25] qapi: Tighten check whether implicit object type already exists

2024-03-15 Thread Markus Armbruster
Entities with names starting with q_obj_ are implicit object types. Therefore, QAPISchema._make_implicit_object_type()'s .lookup_entity() can only return a QAPISchemaObjectType. Assert that. Signed-off-by: Markus Armbruster --- scripts/qapi/schema.py | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [PATCH for-9.0 v2] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
Am 15.03.2024 um 16:07 hat Stefano Garzarella geschrieben: > On Fri, Mar 15, 2024 at 03:03:31PM +0100, Kevin Wolf wrote: > > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > > status flag is set; with the current API of the kernel module, it is > > impossible to enable the

Re: [PATCH v2 3/6] qdev-monitor: add option to report GenericError from find_device_state

2024-03-15 Thread Markus Armbruster
Sorry for the late answer. Vladimir Sementsov-Ogievskiy writes: > On 07.03.24 12:46, Markus Armbruster wrote: [...] >> I appreciate the attempt to curb the spread of DeviceNotFound errors. >> Two issues: >> >> * Copy-pasting find_device_state() with a false argument is an easy >> error to

Re: [PATCH v4 0/3] Adjust the output of x-query-virtio-status

2024-03-15 Thread Yong Huang
On Fri, Mar 15, 2024 at 3:51 PM Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > On Wed, Mar 13, 2024 at 10:40:21AM +0100, Markus Armbruster wrote: > >> I could be awkward for the use case described in PATCH 1's commit > >> message: > >> > >> However, we sometimes want to

Re: [PATCH v7 3/8] tests/qtest/migration: Replace migrate_get_connect_uri inplace of migrate_get_socket_address

2024-03-15 Thread Fabiano Rosas
Het Gala writes: > Refactor migrate_get_socket_address to internally utilize 'socket-address' > parameter, reducing redundancy in the function definition. > > migrate_get_socket_address implicitly converts SocketAddress into str. > Move migrate_get_socket_address inside migrate_get_connect_uri

[PATCH-for-9.1 01/21] target/i386: Declare CPU QOM types using DEFINE_TYPES() macro

2024-03-15 Thread Philippe Mathieu-Daudé
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews.

[PATCH 04/12] tests/data/uefi-boot-images: Add RISC-V ISO image

2024-03-15 Thread Sunil V L
To test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg. Signed-off-by: Sunil V L --- .../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode

[PATCH-for-9.1 02/21] target/mips: Declare CPU QOM types using DEFINE_TYPES() macro

2024-03-15 Thread Philippe Mathieu-Daudé
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews.

[PATCH 12/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

2024-03-15 Thread Sunil V L
Add basic ACPI table testing for RISC-V. Signed-off-by: Sunil V L --- tests/qtest/bios-tables-test.c | 28 1 file changed, 28 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index c492438ced..033acc8958 100644 ---

[RFC PATCH-for-9.1 15/21] target/arm: Use QMP generic_query_cpu_definitions()

2024-03-15 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/arm/arm-qmp-cmds.c | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index 3cc8cc738b..c5091e64ec 100644 --- a/target/arm/arm-qmp-cmds.c +++

[PATCH-for-9.1 04/21] target/sparc: Declare CPU QOM types using DEFINE_TYPES() macro

2024-03-15 Thread Philippe Mathieu-Daudé
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews.

[PATCH 03/12] uefi-test-tools: Add support for python based build script

2024-03-15 Thread Sunil V L
edk2-funcs.sh which is used in this Makefile, was removed in the commit c28a2891f3 ("edk2: update build script"). It is replaced with a python based script. So, update the Makefile and add the configuration file as required to support the python based build script. Signed-off-by: Sunil V L ---

[PATCH 08/12] meson.build: Add RISC-V to the edk2-target list

2024-03-15 Thread Sunil V L
so that ACPI table test can be supported. Signed-off-by: Sunil V L --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b8ded80cbe..bf50688593 100644 --- a/meson.build +++ b/meson.build @@ -93,7 +93,7 @@ else iasl =

[PATCH-for-9.1 05/21] cpus: Open code OBJECT_DECLARE_TYPE() in OBJECT_DECLARE_CPU_TYPE()

2024-03-15 Thread Philippe Mathieu-Daudé
Since the OBJECT_DECLARE_CPU_TYPE() macro uses the abstract ArchCPU type, when declaring multiple CPUs of the same ArchCPU type we get an error related to the indirect G_DEFINE_AUTOPTR_CLEANUP_FUNC() use within OBJECT_DECLARE_TYPE(): target/mips/cpu-qom.h:31:1: error: redefinition of

[PATCH 06/12] tests/qtest/bios-tables-test.c: Add support for arch in path

2024-03-15 Thread Sunil V L
Since virt machine is common for multiple architectures, add "arch" in the path to search expected AML files. Since the AML files are still under old path, support both by searching with and without arch in the path. Signed-off-by: Sunil V L --- tests/qtest/bios-tables-test.c | 32

[RFC PATCH-for-9.1 21/21] qapi: Make @query-cpu-definitions target-agnostic

2024-03-15 Thread Philippe Mathieu-Daudé
All targets use the generic_query_cpu_definitions() method, which is not target-specific. Make the command target agnostic by moving it to machine.json. Rename generic_query_cpu_definitions as qmp_query_cpu_definitions. This is an introspection change for the target that were not implementing

[PATCH 11/12] tests/data/acpi/virt/riscv64: Add expected ACPI tables for RISC-V

2024-03-15 Thread Sunil V L
Add expected ACPI tables for RISC-V so that bios-table-test can be enabled for RISC-V. Signed-off-by: Sunil V L --- tests/data/acpi/virt/riscv64/APIC | Bin 0 -> 116 bytes tests/data/acpi/virt/riscv64/BGRT | Bin 0 -> 56 bytes tests/data/acpi/virt/riscv64/DSDT | Bin 0 -> 3518 bytes

[RFC PATCH-for-9.1 14/21] system: Introduce QMP generic_query_cpu_definitions()

2024-03-15 Thread Philippe Mathieu-Daudé
Each target use a common template for qmp_query_cpu_definitions(). Extract it as generic_query_cpu_definitions(), keeping the target-specific implementations as the following SysemuCPUOps handlers: - cpu_list_compare() - add_definition() - add_alias_definitions() Signed-off-by: Philippe

[RFC PATCH-for-9.1 18/21] target/i386: Use QMP generic_query_cpu_definitions()

2024-03-15 Thread Philippe Mathieu-Daudé
Register x86_cpu_definition_entry() and x86_cpu_list_compare() as handler so we can use the QMP generic_query_cpu_definitions() method. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c

[PATCH-for-9.1 11/21] qapi: Make CpuDefinitionInfo target agnostic

2024-03-15 Thread Philippe Mathieu-Daudé
Generate the CpuDefinitionInfo type once for all targets. In few commits @query-cpu-definitions will become generic and all target will return their CPUs list. Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine-target.json | 69 qapi/machine.json

[RFC PATCH-for-9.1 16/21] target/loongarch: Use QMP generic_query_cpu_definitions()

2024-03-15 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/loongarch-qmp-cmds.c | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loongarch-qmp-cmds.c index 8721a5eb13..ef5aedc1cd 100644 ---

[PATCH-for-9.1 09/21] qapi: Merge machine-common.json with qapi/machine.json

2024-03-15 Thread Philippe Mathieu-Daudé
machine-common.json declares a single type, which isn't restricted to a particular target. Move this type in machine.json. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 - qapi/machine-common.json | 21 - qapi/machine-target.json | 2 +-

[PATCH-for-9.1 19/21] target/ppc: Factor ppc_add_alias_definitions() out

2024-03-15 Thread Philippe Mathieu-Daudé
Factor ppc_add_alias_definitions() out of qmp_query_cpu_definitions() to clearly see the generic pattern used in all targets. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-models.h | 4 target/ppc/ppc-qmp-cmds.c | 26 +++--- 2 files changed, 19

[PATCH-for-9.1 13/21] system: Introduce cpu_typename_by_arch_bit()

2024-03-15 Thread Philippe Mathieu-Daudé
Introduce a helper to return the CPU type name given a QemuArchBit. The TYPE_PPC_CPU target have different 32/64-bit definitions so we can not include it yet. Signed-off-by: Philippe Mathieu-Daudé --- --- MAINTAINERS| 1 + include/sysemu/arch_init.h | 2 ++

[PATCH 09/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs

2024-03-15 Thread Sunil V L
Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing. Signed-off-by: Sunil V L --- pc-bios/meson.build | 2 ++ tests/qtest/meson.build | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pc-bios/meson.build b/pc-bios/meson.build index

Re: [PATCH v3] blockcommit: Reopen base image as RO after abort

2024-03-15 Thread Vladimir Sementsov-Ogievskiy
On 15.03.24 12:55, Alexander Ivanov wrote: On 2/28/24 17:48, Vladimir Sementsov-Ogievskiy wrote: On 09.02.24 15:29, Alexander Ivanov wrote: Could you please review the patch? Sorry for long delay. Honestly, I don't like refcnt in block-driver. It violate incapsulation, refcnt is interal

Re: [PATCH for-9.0 v2] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Stefano Garzarella
On Fri, Mar 15, 2024 at 03:03:31PM +0100, Kevin Wolf wrote: VDUSE requires that virtqueues are first enabled before the DRIVER_OK status flag is set; with the current API of the kernel module, it is impossible to enable the opposite order in our block export code because userspace is not

[PATCH v5 21/25] qapi/schema: add type hints

2024-03-15 Thread Markus Armbruster
From: John Snow This patch only adds type hints, which aren't utilized at runtime and don't change the behavior of this module in any way. In a scant few locations, type hints are removed where no longer necessary due to inference power from typing all of the rest of creation; and any type

[PATCH v5 03/25] qapi: sort pylint suppressions

2024-03-15 Thread Markus Armbruster
From: John Snow Suggested-by: Markus Armbruster Signed-off-by: John Snow Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/pylintrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index

[PATCH v5 07/25] qapi/schema: declare type for QAPISchemaArrayType.element_type

2024-03-15 Thread Markus Armbruster
From: John Snow A QAPISchemaArrayType's element type gets resolved only during .check(). We have QAPISchemaArrayType.__init__() initialize self.element_type = None, and .check() assign the actual type. Using .element_type before .check() is wrong, and hopefully crashes due to the value being

[PATCH v5 09/25] qapi/schema: adjust type narrowing for mypy's benefit

2024-03-15 Thread Markus Armbruster
From: John Snow We already take care to perform some type narrowing for arg_type and ret_type, but not in a way where mypy can utilize the result once we add type hints, e.g.: qapi/schema.py:833: error: Incompatible types in assignment (expression has type "QAPISchemaType", variable has type

[PATCH v5 14/25] qapi/schema: assert info is present when necessary

2024-03-15 Thread Markus Armbruster
From: John Snow QAPISchemaInfo arguments can often be None because built-in definitions don't have such information. The type hint can only be Optional[QAPISchemaInfo] then. But, mypy gets upset about all the places where we exploit that it can't actually be None there. Add assertions that

[PATCH v5 25/25] qapi: Dumb down QAPISchema.lookup_entity()

2024-03-15 Thread Markus Armbruster
QAPISchema.lookup_entity() takes an optional type argument, a subtype of QAPISchemaDefinition, and returns that type or None. Callers can use this to save themselves an isinstance() test. The only remaining user of this convenience feature is .lookup_type(). But we don't actually save anything

[PATCH v5 13/25] qapi/schema: fix QAPISchemaArrayType.check's call to resolve_type

2024-03-15 Thread Markus Armbruster
From: John Snow Adjust the expression at the callsite to work around mypy's weak type introspection that believes this expression can resolve to QAPISourceInfo; it cannot. (Fundamentally: self.info only resolves to false in a boolean expression when it is None; therefore this expression may

  1   2   3   >