Re: [PATCH] hw/vmcoreinfo: make guest format endian safe

2024-07-12 Thread Marc-André Lureau
Hi On Fri, Jul 12, 2024 at 10:25 AM Ani Sinha wrote: > > Guest and host formats in struct FWCfgVMCoreInfo are written in little endian > format. However, the hypervisor host might be big endian. We need to do > appropriate conversions between the formats before comparing the values. Fix > it. >

Re: [RFC PATCH 0/8] Convert avocado tests to normal Python unittests

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 07:44:39PM +0200, Thomas Huth wrote: > On 11/07/2024 16.39, Fabiano Rosas wrote: > > Thomas Huth writes: > ... > > > Things that need further attention though: > > > > > > - All tests that use the LinuxTest / LinuxDistro classes (e.g. based > > >on cloud-init images) r

[PATCH v4] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-07-12 Thread Yu-Ming Chang via
Both CSRRS and CSRRC always read the addressed CSR and cause any read side effects regardless of rs1 and rd fields. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value back to the CSR and will cause any attendant

Re: [PATCH v2] plugins/stoptrigger: TCG plugin to stop execution under conditions

2024-07-12 Thread Simon Hamelin
On 7/11/24 12:03, Alex Bennée wrote: +static void exit_emulation(int return_code) +{ +exit(return_code); +} + +static void exit_icount_reached(unsigned int cpu_index, void *udata) +{ +qemu_plugin_outs("icount reached, exiting\n"); +exit_emulation(icount_exit_code); +} + +static voi

Re: [PATCH 03/14] qapi: cope with special feature names containing a '-'

2024-07-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > When we shortly allow custom special feature names to be defined, it > will be valid to include a '-', which must be translated to a '_' > when generating code. > > Signed-off-by: Daniel P. Berrangé > --- > scripts/qapi/gen.py | 2 +- > 1 file changed, 1 insertion(+

[PATCH v3] plugins/stoptrigger: TCG plugin to stop execution under conditions

2024-07-12 Thread Simon Hamelin
This new plugin allows to stop emulation using conditions on the emulation state. By setting this plugin arguments, it is possible to set an instruction count limit and/or trigger address(es) to stop at. The code returned at emulation exit can be customized. This plugin demonstrates how someone co

Re: [PATCH 04/14] qapi: add a 'command-features' pragma

2024-07-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > The 'command-features' pragma allows for defining additional > special features that are unique to a particular QAPI schema > instance and its implementation. So far, we have special features (predefined, known to the generator and treated specially), and normal feat

Re: [PATCH 04/14] qapi: add a 'command-features' pragma

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 10:07:34AM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > The 'command-features' pragma allows for defining additional > > special features that are unique to a particular QAPI schema > > instance and its implementation. > > So far, we have special fea

Re: [PATCH v2 03/22] qga: move linux suspend command impls to commands-linux.c

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:02 PM Daniel P. Berrangé wrote: > The qmp_guest_suspend_{disk,ram,hybrid} command impls in > commands-posix.c are surrounded by '#ifdef __linux__' so should > instead live in commands-linux.c > > Reviewed-by: Manos Pitsidianakis > Signe

Re: [PATCH v2 02/22] qga: move linux vcpu command impls to commands-linux.c

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:02 PM Daniel P. Berrangé wrote: > The qmp_guest_set_vcpus and qmp_guest_get_vcpus command impls in > commands-posix.c are surrounded by '#ifdef __linux__' so should > instead live in commands-linux.c > > Reviewed-by: Manos Pitsidianakis

Re: [PATCH v2 05/22] qga: move linux disk/cpu stats command impls to commands-linux.c

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:02 PM Daniel P. Berrangé wrote: > The qmp_guest_{diskstats,cpustats} command impls in > commands-posix.c are surrounded by '#ifdef __linux__' so should > instead live in commands-linux.c > > This also removes a "#ifdef CONFIG_LINUX" that

Re: [PATCH v2 06/22] qga: move linux memory block command impls to commands-linux.c

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > The qmp_guest_{set,get}_{memory_blocks,block_info} command impls in > commands-posix.c are surrounded by '#ifdef __linux__' so should > instead live in commands-linux.c > > This also removes a "#ifdef CO

Re: [PATCH v2 08/22] qga: conditionalize schema for commands unsupported on Windows

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the commands on Windows. > > The command will be

Re: [PATCH v2 09/22] qga: conditionalize schema for commands unsupported on non-Linux POSIX

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the commands on non-Linux POSIX > platforms > > T

Re: [PATCH v2 10/22] qga: conditionalize schema for commands requiring getifaddrs

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every comamnd that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the network interface command on > POSIX platform

Re: [PATCH v2 12/22] qga: conditionalize schema for commands only supported on Windows

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the commands on non-Windows. > > The command will

Re: [PATCH v2 13/22] qga: conditionalize schema for commands requiring fsfreeze

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the schema to fully > exclude generation of the filesystem freezing commands on POSIX > platforms

Re: [PATCH v2 14/22] qga: conditionalize schema for commands requiring fstrim

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the filesystem trimming commands > on POSIX platf

Re: [PATCH] chardev: add a mutex to protect IOWatchPoll::src

2024-07-12 Thread Sergey Dyasli
On 11/07/2024 12:23, Paolo Bonzini wrote: So I think we should just revert commit 2b316774f60, which is not hard to do (if it works) even if the code has since moved from qemu-char.c to chardev/char-io.c. Hi Paolo, Thanks for the suggestion - I've tried it and it seems to work. I'll send out

Re: [PATCH v2 15/22] qga: conditionalize schema for commands requiring libudev

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the schema to fully > exclude generation of the filesystem trimming commands on POSIX > platforms

Re: [PATCH v2 16/22] qga: conditionalize schema for commands requiring utmpx

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the get-users command on POSIX > platforms lackin

Re: [PATCH v2 17/22] qga: conditionalize schema for commands not supported on other UNIX

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > Rather than creating stubs for every command that just return > QERR_UNSUPPORTED, use 'if' conditions in the QAPI schema to > fully exclude generation of the commands on other UNIX. > > The command will

Re: [PATCH v2 19/22] qga: move declare of QGAConfig struct to top of file

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:44 PM Daniel P. Berrangé wrote: > It is referenced by QGAState already, and it is clearer to declare all > data types at the top of the file, rather than have them mixed with > code later. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [PATCH v2 20/22] qga: remove pointless 'blockrpcs_key' variable

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:45 PM Daniel P. Berrangé wrote: > This variable was used to support back compat for the old config > file key name, and became redundant after the following change: > > commit a7a2d636ae4549ef0551134d4bf8e084a14431c4 > Author: Philip

Re: [RFC PATCH 1/8] tests/pytest: Add base classes for the upcoming pytest-based tests

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:39PM +0200, Thomas Huth wrote: > The file is a copy of the tests/avocado/avocado_qemu/__init__.py file > with some adjustments to get rid of the Avocado dependencies (i.e. > we also have to drop the LinuxSSHMixIn and LinuxTest for now). > > The emulator binary, source

Re: [PATCH 04/14] qapi: add a 'command-features' pragma

2024-07-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Fri, Jul 12, 2024 at 10:07:34AM +0200, Markus Armbruster wrote: >> Daniel P. Berrangé writes: >> >> > The 'command-features' pragma allows for defining additional >> > special features that are unique to a particular QAPI schema >> > instance and its implementati

Re: [RFC PATCH 2/8] tests/pytest: Convert some simple avocado tests into pytests

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:40PM +0200, Thomas Huth wrote: > These test are rather simple and don't need any modifications apart > from adjusting the "from avocado_qemu" line. These tests can now > be run directly via "pytest" by setting the PYTHONPATH environment > variable to the python folder

Re: [RFC PATCH 3/8] tests/pytest: Convert info_usernet and version test with small adjustments

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:41PM +0200, Thomas Huth wrote: > These two simple tests can be converted to a pytest quite easily, > we just have to set the machine to 'none' now manually since we > don't support the avocado tags here yet. > > Signed-off-by: Thomas Huth > --- > .../info_usernet.py

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: > From: Ani Sinha > > Integrate the pytest framework with the meson build system. This > will make meson run all the pytests under the pytest directory. Lets add a note about the compelling benefit of this new approach With this cha

Re: [PULL 0/9] loongarch-to-apply queue

2024-07-12 Thread Philippe Mathieu-Daudé
On 12/7/24 03:35, gaosong wrote: 在 2024/7/11 下午5:57, Philippe Mathieu-Daudé 写道: Xianglai Li (2):    hw/loongarch: Change the tpm support by default    hw/loongarch: Modify flash block size to 256K Please hold on before merging, I'd like to check with the author for migration issue re

Re: [PATCH v2 21/22] qga: allow configuration file path via the cli

2024-07-12 Thread Konstantin Kostiuk
On Thu, Jun 13, 2024 at 6:45 PM Daniel P. Berrangé wrote: > Allowing the user to set the QGA_CONF environment variable to change > the default configuration file path is very unusual practice, made > more obscure since this ability is not documented. > > This introduces the more normal '-c PATH'

Re: [PATCH v4 01/11] target/riscv: Add zimop extension

2024-07-12 Thread Jim Shu
Reviewed-by: Jim Shu On Tue, Jul 9, 2024 at 7:39 PM LIU Zhiwei wrote: > Zimop extension defines an encoding space for 40 MOPs.The Zimop > extension defines 32 MOP instructions named MOP.R.n, where n is > an integer between 0 and 31, inclusive. The Zimop extension > additionally defines 8 MOP in

Re: [PATCH v4 02/11] disas/riscv: Support zimop disassemble

2024-07-12 Thread Jim Shu
On Tue, Jul 9, 2024 at 7:41 PM LIU Zhiwei wrote: > Signed-off-by: LIU Zhiwei > Acked-by: Alistair Francis > Reviewed-by: Deepak Gupta > Reviewed-by: Jim Shu

Re: [PATCH v4 03/11] target/riscv: Add zcmop extension

2024-07-12 Thread Jim Shu
On Tue, Jul 9, 2024 at 7:40 PM LIU Zhiwei wrote: > > Zcmop defines eight 16-bit MOP instructions named C.MOP.n, where n is > an odd integer between 1 and 15, inclusive. C.MOP.n is encoded in > the reserved encoding space corresponding to C.LUI xn, 0. > > Unlike the MOPs defined in the Zimop extens

Re: [PATCH v4 04/11] disas/riscv: Support zcmop disassemble

2024-07-12 Thread Jim Shu
On Tue, Jul 9, 2024 at 7:41 PM LIU Zhiwei wrote: > > Although in QEMU disassemble, we usually lift compressed instruction > to an normal format when display the instruction name. For C.MOP.n, > it is more reasonable to directly display its compressed name, because > its behavior can be redefined b

Re: [RFC PATCH] build deps: update lcitool to include rust bits

2024-07-12 Thread Philippe Mathieu-Daudé
On 10/7/24 17:43, Alex Bennée wrote: For rust development we need cargo, rustc and bindgen in our various development environments. Update the libvirt-ci project to (!495) and regenerate the containers and other dependency lists. Signed-off-by: Alex Bennée --- NB: - this is currently waitin

Re: [RFC PATCH 5/8] tests_pytest: Implement fetch_asset() method for downloading assets

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:43PM +0200, Thomas Huth wrote: > In the pytests, we cannot use the fetch_asset() function from Avocado > anymore, so we have to provide our own implementation now instead. > Thus add such a function based on the _download_with_cache() function > from tests/vm/basevm.py

Re: [RFC PATCH 6/8] tests/pytest: Convert some tests that download files via fetch_asset()

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:44PM +0200, Thomas Huth wrote: > Now that we've got a working fetch_asset() function, we can convert > some Avocado tests that use this function for downloading their > required files. > > Signed-off-by: Thomas Huth > --- > tests/pytest/meson.build

Re: [RFC PATCH 7/8] tests/pytest: Add a function for extracting files from an archive

2024-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2024 at 01:55:45PM +0200, Thomas Huth wrote: > Some Avocado-based tests use the "archive" module from avocado.utils > to extract files from an archive. To be able to use these tests > without Avocado, we have to provide our own function for extracting > files. Fortunately, there is

Re: [PATCH 04/14] qapi: add a 'command-features' pragma

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 10:50:54AM +0200, Markus Armbruster wrote: > Daniel P. Berrangé writes: > > > On Fri, Jul 12, 2024 at 10:07:34AM +0200, Markus Armbruster wrote: > >> Daniel P. Berrangé writes: > >> > >> > The 'command-features' pragma allows for defining additional > >> > special featur

Re: [PATCH v2 21/22] qga: allow configuration file path via the cli

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 12:05:23PM +0300, Konstantin Kostiuk wrote: > On Thu, Jun 13, 2024 at 6:45 PM Daniel P. Berrangé > wrote: > > > Allowing the user to set the QGA_CONF environment variable to change > > the default configuration file path is very unusual practice, made > > more obscure sinc

Re: [RFC PATCH 5/8] tests_pytest: Implement fetch_asset() method for downloading assets

2024-07-12 Thread Thomas Huth
On 12/07/2024 11.09, Daniel P. Berrangé wrote: On Thu, Jul 11, 2024 at 01:55:43PM +0200, Thomas Huth wrote: In the pytests, we cannot use the fetch_asset() function from Avocado anymore, so we have to provide our own implementation now instead. Thus add such a function based on the _download_wit

[PATCH] Revert "qemu-char: do not operate on sources from finalize callbacks"

2024-07-12 Thread Sergey Dyasli
This reverts commit 2b316774f60291f57ca9ecb6a9f0712c532cae34. After 038b4217884c ("Revert "chardev: use a child source for qio input source"") we've been observing the "iwp->src == NULL" assertion triggering periodically during the initial capabilities querying by libvirtd. One of possible backtra

Re: [PATCH v2 01/22] qga: drop blocking of guest-get-memory-block-size command

2024-07-12 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Thu, Jun 13, 2024 at 6:01 PM Daniel P. Berrangé wrote: > This command has never existed in tree, since it was renamed to > guest-get-memory-block-info before being merged. > > Reviewed-by: Manos Pitsidianakis > Signed-off-by: Daniel P. Berrangé > --- > qga/

[PATCH v2 2/2] iotests/298: add testcase for async writes with preallocation filter

2024-07-12 Thread Andrey Drobyshev
The testcase simply creates a 64G image with 1M clusters, generates a list of 1M aligned offsets and feeds aio_write commands with those offsets to qemu-io run with '--aio native --nocache'. Then we check the data written at each of the offsets. Before the previous commit this could result into a

[PATCH v2 0/2] Fix data corruption within preallocation

2024-07-12 Thread Andrey Drobyshev
v1 -> v2: * Patch 1/2: get rid of the lock. Instead, simply update the file_end field before the write_zeroes operation. This patch implements a much simpler logic w/o the locking compared to v1, and the problem seems to go away. However there still might be potential issues with the operati

[PATCH v2 1/2] block: zero data data corruption using prealloc-filter

2024-07-12 Thread Andrey Drobyshev
From: "Denis V. Lunev" We have observed that some clusters in the QCOW2 files are zeroed while preallocation filter is used. We are able to trace down the following sequence when prealloc-filter is used: co=0x55e7cbed7680 qcow2_co_pwritev_task() co=0x55e7cbed7680 preallocate_co_pwritev_p

Re: [PULL 0/9] loongarch-to-apply queue

2024-07-12 Thread lixianglai
Hi Philippe: Hi Richard, On 11/7/24 09:48, Song Gao wrote: The following changes since commit 59084feb256c617063e0dbe7e64821ae8852d7cf:    Merge tag 'pull-aspeed-20240709' of https://github.com/legoater/qemu into staging (2024-07-09 07:13:55 -0700) are available in the Git repository at:

Re: [PATCH v5 7/7] tests/avocado: Add an avocado test for riscv64

2024-07-12 Thread Daniel Henrique Barboza
On 7/9/24 11:24 PM, LIU Zhiwei wrote: From: TANG Tiancheng To regularly test booting Linux with rv32 on QEMU RV64, we have added a test to boot_linux_console.py to retrieve cpuinfo and verify if it shows 'rv32' when using RV64 to boot rv32 CPUs. Signed-off-by: TANG Tiancheng Reviewed-by: L

Re: [PATCH v5 0/7] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-07-12 Thread Daniel Henrique Barboza
On 7/9/24 11:24 PM, LIU Zhiwei wrote: From: 甲一 This patch set aims to expose 32-bit RISC-V cpu to RV64 QEMU. Thus qemu-system-riscv64 can directly boot a RV32 Linux. This patch set has been tested with 6.9.0 Linux Image. And add an avocado test in tests/avocado. Thanks for this work and s

Re: [RFC PATCH] build deps: update lcitool to include rust bits

2024-07-12 Thread Daniel P . Berrangé
On Wed, Jul 10, 2024 at 04:43:35PM +0100, Alex Bennée wrote: > For rust development we need cargo, rustc and bindgen in our various > development environments. Update the libvirt-ci project to (!495) and > regenerate the containers and other dependency lists. > > Signed-off-by: Alex Bennée > > -

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Thomas Huth
On 12/07/2024 11.01, Daniel P. Berrangé wrote: On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: From: Ani Sinha Integrate the pytest framework with the meson build system. This will make meson run all the pytests under the pytest directory. Lets add a note about the compelling be

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 12:14:45PM +0200, Thomas Huth wrote: > On 12/07/2024 11.01, Daniel P. Berrangé wrote: > > On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: > > > From: Ani Sinha > > > > > > Integrate the pytest framework with the meson build system. This > > > will make meson r

Re: [PATCH v5 00/13] WIP: Use Intel DSA accelerator to offload zero page checking in multifd live migration.

2024-07-12 Thread Michael S. Tsirkin
On Thu, Jul 11, 2024 at 02:52:35PM -0700, Yichen Wang wrote: > v5 > * Rebase on top of 39a032cea23e522268519d89bb738974bc43b6f6. > * Rename struct definitions with typedef and CamelCase names; > * Add build and runtime checks about DSA accelerator; > * Address all comments from v4 reviews about typ

[PULL v1 0/3] Xen queue

2024-07-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" The following changes since commit 23901b2b721c0576007ab7580da8aa855d6042a9: Merge tag 'pull-target-arm-20240711' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-07-11 12:00:00 -0700) are available in the Git repository at: https://gitlab.c

[PULL v1 1/3] MAINTAINERS: add Edgar as Xen maintainer

2024-07-12 Thread Edgar E. Iglesias
From: Stefano Stabellini Add Edgar as Xen subsystem maintainer in QEMU. Edgar has been a QEMU maintainer for years, and has already made key changes to one of the most difficult areas of the Xen subsystem (the mapcache). Edgar volunteered helping us maintain the Xen subsystem in QEMU and we are

[PULL v1 3/3] xen: mapcache: Fix unmapping of first entries in buckets

2024-07-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" This fixes the clobbering of the entry->next pointer when unmapping the first entry in a bucket of a mapcache. Fixes: 123acd816d ("xen: mapcache: Unmap first entries in buckets") Reported-by: Anthony PERARD Signed-off-by: Edgar E. Iglesias Reviewed-by: Anthony PERARD

[PULL v1 2/3] physmem: Bail out qemu_ram_block_from_host() for invalid ram addrs

2024-07-12 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Bail out in qemu_ram_block_from_host() when xen_ram_addr_from_mapcache() does not find an existing mapping. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alex Bennée Reviewed-by: Stefano Stabellini --- system/physmem.c | 4 1 file changed, 4 insertions(+) diff

[PATCH v5 01/13] hw/acpi: Fix ordering of BDF in Generic Initiator PCI Device Handle.

2024-07-12 Thread Jonathan Cameron via
The ordering in ACPI specification [1] has bus number in the lowest byte. As ACPI tables are little endian this is the reverse of the ordering used by PCI_BUILD_BDF(). As a minimal fix split the QEMU BDF up into bus and devfn and write them as single bytes in the correct order. [1] ACPI Spec 6.3,

[PATCH v5 00/13] acpi: NUMA nodes for CXL HB as GP + complex NUMA test

2024-07-12 Thread Jonathan Cameron via
v5: Thanks to Igor for review. Patch 5: - Add an assert to catch out of range PCI devfn retrieved from addr property which is oddly an int32_t Patch 6: - Push TYPE_ACPI_GENERIC_INTIATOR define down into c file along with qom_interfaces.h include as they are only needed there. Patch 7: -

[PATCH v5 02/13] hw/acpi/GI: Fix trivial parameter alignment issue.

2024-07-12 Thread Jonathan Cameron via
Before making additional modification, tidy up this misleading indentation. Reviewed-by: Ankit Agrawal Reviewed-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: No change --- hw/acpi/acpi_generic_initiator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[PATCH v5 03/13] hw/acpi: Move AML building code for Generic Initiators to aml_build.c

2024-07-12 Thread Jonathan Cameron via
Rather than attempting to create a generic function with mess of the two different device handle types, use a PCI handle specific variant. If the ACPI handle form is needed then that can be introduced alongside this with little duplicated code. Drop the PCIDeviceHandle in favor of just passing th

[PATCH v5 04/13] hw/acpi: Rename build_all_acpi_generic_initiators() to build_acpi_generic_initiator()

2024-07-12 Thread Jonathan Cameron via
Igor noted that this function only builds one instance, so was rather misleadingly named. Fix that. Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: No change --- hw/acpi/acpi_generic_initiator.c | 4 ++-- 1 file changed,

[PATCH v5 05/13] hw/pci: Add a busnr property to pci_props and use for acpi/gi

2024-07-12 Thread Jonathan Cameron via
Using a property allows us to hide the internal details of the PCI device from the code to build a SRAT Generic Initiator Affinity Structure with PCI Device Handle. Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Signed-off-by: Jonathan Cameron --- V5: Add assert() to catch if devfn is

[PATCH v5 06/13] acpi/pci: Move Generic Initiator object handling into acpi/pci.*

2024-07-12 Thread Jonathan Cameron via
Whilst ACPI SRAT Generic Initiator Afinity Structures are able to refer to both PCI and ACPI Device Handles, the QEMU implementation only implements the PCI Device Handle case. For now move the code into the existing hw/acpi/pci.c file and header. If support for ACPI Device Handles is added in th

[PATCH v5 07/13] hw/pci-bridge: Add acpi_uid property to TYPE_PXB_BUS

2024-07-12 Thread Jonathan Cameron via
Enable ACPI table creation for PCI Expander Bridges to be independent of PCI internals. Note that the UID is currently the PCI bus number. This is motivated by the forthcoming ACPI Generic Port SRAT entries which can be made completely independent of PCI internals. Suggested-by: Igor Mammedov Te

[PATCH v5 08/13] hw/i386/acpi: Use TYPE_PXB_BUS property acpi_uid for DSDT

2024-07-12 Thread Jonathan Cameron via
Rather than relying on PCI internals, use the new acpi_property to obtain the ACPI _UID values. These are still the same as the PCI Bus numbers so no functional change. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: Leave the device naming as using

[PATCH v5 09/13] hw/pci-host/gpex-acpi: Use acpi_uid property.

2024-07-12 Thread Jonathan Cameron via
Reduce the direct use of PCI internals inside ACPI table creation. Suggested-by: Igor Mammedov Tested-by: "Huang, Ying" Signed-off-by: Jonathan Cameron --- v5: Similar to previous, use bus number, not uid in ACPI device naming so that uid can be 32 bits and we don't need checks to ensure it

[PATCH v5 10/13] hw/acpi: Generic Port Affinity Structure support

2024-07-12 Thread Jonathan Cameron via
These are very similar to the recently added Generic Initiators but instead of representing an initiator of memory traffic they represent an edge point beyond which may lie either targets or initiators. Here we add these ports such that they may be targets of hmat_lb records to describe the latenc

[PATCH v5 11/13] bios-tables-test: Allow for new acpihmat-generic-x test data.

2024-07-12 Thread Jonathan Cameron via
The test to be added exercises many corner cases of the SRAT and HMAT table generation. Signed-off-by: Jonathan Cameron --- v5: No change. --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + tests/data/acpi/x86/q35/APIC.acpihmat-generic-x | 0 tests/data/acpi/x86/q35/CEDT.acpihmat-gen

[PATCH v5 12/13] bios-tables-test: Add complex SRAT / HMAT test for GI GP

2024-07-12 Thread Jonathan Cameron via
Add a test with 6 nodes to exercise most interesting corner cases of SRAT and HMAT generation including the new Generic Initiator and Generic Port Affinity structures. More details of the set up in the following patch adding the table data. Signed-off-by: Jonathan Cameron --- v5: No change ---

[PATCH v5 13/13] bios-tables-test: Add data for complex numa test (GI, GP etc)

2024-07-12 Thread Jonathan Cameron via
Given this is a new configuration, there are affects on APIC, CEDT and DSDT, but the key elements are in SRAT (plus related data in HMAT). The configuration has node to exercise many different combinations. 0) CPUs + Memory 1) GI only 2) GP only 3) CPUS only 4) Memory only 5) CPUs + HP memory GI

[PATCH] accel/tcg: Make cpu_exec_interrupt hook mandatory

2024-07-12 Thread Peter Maydell
The TCGCPUOps::cpu_exec_interrupt hook is currently not mandatory; if it is left NULL then we treat it as if it had returned false. However since pretty much every architecture needs to handle interrupts, almost every target we have provides the hook. The one exception is Tricore, which doesn't cur

[PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking

2024-07-12 Thread Joao Martins
This small series adds support for IOMMU dirty tracking support via the IOMMUFD backend. The hardware capability is available on most recent x86 hardware. The series is divided organized as follows: * Patch 1-2: Fixes a regression into mdev support with IOMMUFD. This one is independen

[PATCH v4 08/12] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-07-12 Thread Joao Martins
Probe hardware dirty tracking support by querying device hw capabilities via IOMMUFD_GET_HW_INFO. In preparation to using the dirty tracking UAPI, request dirty tracking in the HWPT flags when the IOMMU supports dirty tracking. The auto domain logic allows different IOMMU domains to be created wh

[PATCH v4 12/12] vfio/common: Allow disabling device dirty page tracking

2024-07-12 Thread Joao Martins
The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole tracking of VF pre-copy phase of dirty page tracking, though it means that it will only be used at the start of the switchover phase. Add an option that disables the VF dirty page tracking, and fall back into container-based

[PATCH v4 06/12] vfio/{iommufd,container}: Remove caps::aw_bits

2024-07-12 Thread Joao Martins
In preparation to moving HostIOMMUDevice realize() being able to called early during attach_device(), remove properties that rely on container being initialized. This means removing caps::aw_bits which requires the bcontainer::iova_ranges to be inititalized after device is actually attached. Inste

[PATCH v4 02/12] vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev

2024-07-12 Thread Joao Martins
mdevs aren't "physical" devices and when asking for backing IOMMU info, it fails the entire provisioning of the guest. Fix that by skipping HostIOMMUDevice initialization in the presence of mdevs, and skip setting an iommu device when it is known to be an mdev. Cc: Zhenzhong Duan Fixes: 930589520

[PATCH v4 04/12] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt()

2024-07-12 Thread Joao Martins
In preparation to implement auto domains have the attach function return the errno it got during domain attach instead of a bool. -EINVAL is tracked to track domain incompatibilities, and decide whether to create a new IOMMU domain. Signed-off-by: Joao Martins --- hw/vfio/iommufd.c | 8

[PATCH v4 07/12] vfio/{iommufd, container}: Initialize HostIOMMUDeviceCaps during attach_device()

2024-07-12 Thread Joao Martins via
Fetch IOMMU hw raw caps behind the device and thus move the HostIOMMUDevice::realize() to be done during the attach of the device. It allows it to cache the information obtained from IOMMU_GET_HW_INFO from iommufd early on. However, while legacy HostIOMMUDevice caps always return true and doesn't h

[PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation

2024-07-12 Thread Joao Martins
There's generally two modes of operation for IOMMUFD: * The simple user API which intends to perform relatively simple things with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO and mainly performs IOAS_MAP and UNMAP. * The native IOMMUFD API where you have fine grained control

[PATCH v4 01/12] vfio/pci: Extract mdev check into an helper

2024-07-12 Thread Joao Martins
In preparation to skip initialization of the HostIOMMUDevice for mdev, extract the checks that validate if a device is an mdev into helpers. A vfio_set_mdev() is created, and subsystems consult VFIODevice::mdev to check if it's mdev or not. Signed-off-by: Joao Martins --- include/hw/vfio/vfio-c

[PATCH v4 10/12] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support

2024-07-12 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI that fetches the bitmap that tells what was dirty in an IOVA range. A single bitmap is allocated and used across all the hwpts sharing an IOAS which is then used in log_sync() to set Qemu global bitmaps. Signed-off-by: Joao Martins ---

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 12:14:45PM +0200, Thomas Huth wrote: > On 12/07/2024 11.01, Daniel P. Berrangé wrote: > > On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: > > > From: Ani Sinha > > > > > > Integrate the pytest framework with the meson build system. This > > > will make meson r

[PATCH v4 03/12] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities

2024-07-12 Thread Joao Martins
The helper will be able to fetch vendor agnostic IOMMU capabilities supported both by hardware and software. Right now it is only iommu dirty tracking. Signed-off-by: Joao Martins Reviewed-by: Zhenzhong Duan --- include/sysemu/iommufd.h | 2 +- backends/iommufd.c | 4 +++- hw/vfio/iommufd

[PATCH v4 11/12] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-12 Thread Joao Martins
By default VFIO migration is set to auto, which will support live migration if the migration capability is set *and* also dirty page tracking is supported. For testing purposes one can force enable without dirty page tracking via enable-migration=on, but that option is generally left for testing p

[PATCH v4 09/12] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-07-12 Thread Joao Martins
ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that enables or disables dirty page tracking. It is used if the hwpt has been created with dirty tracking supported domain (stored in hwpt::flags) and it is called on the whole list of iommu domains it is are tracking. On failure it rol

Re: [RFC PATCH 7/8] tests/pytest: Add a function for extracting files from an archive

2024-07-12 Thread Thomas Huth
On 12/07/2024 11.14, Daniel P. Berrangé wrote: On Thu, Jul 11, 2024 at 01:55:45PM +0200, Thomas Huth wrote: Some Avocado-based tests use the "archive" module from avocado.utils to extract files from an archive. To be able to use these tests without Avocado, we have to provide our own function fo

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Thomas Huth
On 12/07/2024 12.26, Daniel P. Berrangé wrote: On Fri, Jul 12, 2024 at 12:14:45PM +0200, Thomas Huth wrote: On 12/07/2024 11.01, Daniel P. Berrangé wrote: On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: From: Ani Sinha Integrate the pytest framework with the meson build system.

Re: [PATCH v2 1/2] block: zero data data corruption using prealloc-filter

2024-07-12 Thread Vladimir Sementsov-Ogievskiy
On 12.07.24 12:46, Andrey Drobyshev wrote: From: "Denis V. Lunev" We have observed that some clusters in the QCOW2 files are zeroed while preallocation filter is used. We are able to trace down the following sequence when prealloc-filter is used: co=0x55e7cbed7680 qcow2_co_pwritev_task()

Re: [RFC PATCH 7/8] tests/pytest: Add a function for extracting files from an archive

2024-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2024 at 01:52:03PM +0200, Thomas Huth wrote: > On 12/07/2024 11.14, Daniel P. Berrangé wrote: > > On Thu, Jul 11, 2024 at 01:55:45PM +0200, Thomas Huth wrote: > > > Some Avocado-based tests use the "archive" module from avocado.utils > > > to extract files from an archive. To be abl

Re: [RFC PATCH 4/8] tests/pytest: add pytest to the meson build system

2024-07-12 Thread Thomas Huth
On 12/07/2024 13.47, Daniel P. Berrangé wrote: On Fri, Jul 12, 2024 at 12:14:45PM +0200, Thomas Huth wrote: On 12/07/2024 11.01, Daniel P. Berrangé wrote: On Thu, Jul 11, 2024 at 01:55:42PM +0200, Thomas Huth wrote: From: Ani Sinha Integrate the pytest framework with the meson build system.

[PATCH v2 00/19] ppc/pnv: Better big-core model, lpar-per-core, PC unit

2024-07-12 Thread Nicholas Piggin
Primary motivation for this series is to improve big-core support. This also fixes POWER8 SMT running Linux with the msgsnd fix and setting lpar-per-core mode (which is always true on POWER8). Since v1: - Remove chip->pnv_machine pointer addition. - Split cpu_pause() function into its own patch.

[PATCH v2 06/19] ppc/pnv: Extend chip_pir class method to TIR as well

2024-07-12 Thread Nicholas Piggin
The chip_pir chip class method allows the platform to set the PIR processor identification register. Extend this to a more general ID function which also allows the TIR to be set. This is in preparation for "big core", which is a more complicated topology of cores and threads. Reviewed-by: Cédric

[PATCH v2 05/19] ppc/pnv: use class attribute to limit SMT threads for different machines

2024-07-12 Thread Nicholas Piggin
Use a class attribute to specify the number of SMT threads per core permitted for different machines, 8 for powernv8 and 4 for powernv9/10. Reviewed-by: Cédric Le Goater Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- include/hw/ppc/pnv.h | 1 + hw/ppc/pnv.c | 12 ++

[PATCH v2 01/19] target/ppc: Fix msgsnd for POWER8

2024-07-12 Thread Nicholas Piggin
POWER8 (ISA v2.07S) introduced the doorbell facility, the msgsnd instruction behaved mostly like msgsndp, it was addressed by TIR and could only send interrupts between threads on the core. ISA v3.0 changed msgsnd to be addressed by PIR and can interrupt any thread in the system. msgsnd only impl

[PATCH v2 03/19] ppc/pnv: Move timebase state into PnvCore

2024-07-12 Thread Nicholas Piggin
The timebase state machine is per per-core state and can be driven by any thread in the core. It is currently implemented as a hack where the state is in a CPU structure and only thread 0's state is accessed by the chiptod, which limits programming the timebase side of the state machine to thread 0

[PATCH v2 04/19] target/ppc: Move SPR indirect registers into PnvCore

2024-07-12 Thread Nicholas Piggin
SPRC/SPRD were recently added to all BookS CPUs supported, but they are only tested on POWER9 and POWER10, so restrict them to those CPUs. SPR indirect scratch registers presently replicated per-CPU like SMT SPRs, but the PnvCore is a better place for them since they are restricted to P9/P10. Als

[PATCH v2 07/19] ppc: Add a core_index to CPUPPCState for SMT vCPUs

2024-07-12 Thread Nicholas Piggin
The way SMT thread siblings are matched is clunky, using hard-coded logic that checks the PIR SPR. Change that to use a new core_index variable in the CPUPPCState, where all siblings have the same core_index. CPU realize routines have flexibility in setting core/sibling topology. Reviewed-by: Céd

[PATCH v2 02/19] ppc/pnv: Add pointer from PnvCPUState to PnvCore

2024-07-12 Thread Nicholas Piggin
This helps move core state from CPU to core structures. Reviewed-by: Cédric Le Goater Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- include/hw/ppc/pnv_core.h | 1 + hw/ppc/pnv_core.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/hw/ppc/pnv_core.h

  1   2   3   >