[PATCH 1/5] hw/riscv/opentitan: Rename machine_[class]_init() functions

2023-05-19 Thread Philippe Mathieu-Daudé
Follow QOM style which declares FOO_init() as instance initializer and FOO_class_init() as class initializer: rename the OpenTitan machine class/instance init() accordingly. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/opentitan.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 4/5] hw/riscv/opentitan: Explicit machine type definition

2023-05-19 Thread Philippe Mathieu-Daudé
Expand the DEFINE_MACHINE() macro, converting the class_init() handler. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/riscv/opentitan.h | 3 ++- hw/riscv/opentitan.c | 10 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/hw/riscv/opentitan.h

[PATCH 0/5] hw/riscv/opentitan: Correct QOM type/size of OpenTitanState

2023-05-19 Thread Philippe Mathieu-Daudé
Hi, This series fix a QOM issue with the OpenTitanState structure, noticed while auditing QOM relations globally. All patches are trivial to review. Regards, Phil. Philippe Mathieu-Daudé (5): hw/riscv/opentitan: Rename machine_[class]_init() functions hw/riscv/opentitan: Declare QOM types

[PATCH 5/5] hw/riscv/opentitan: Correct OpenTitanState parent type/size

2023-05-19 Thread Philippe Mathieu-Daudé
OpenTitanState is the 'machine' (or 'board') state: it isn't a SysBus device, but inherits from the MachineState type. Correct the instance size. Doing so we avoid leaking an OpenTitanState pointer in opentitan_machine_init(). Fixes: fe0fe4735e ("riscv: Initial commit of OpenTitan machine")

[PATCH 3/5] hw/riscv/opentitan: Add TYPE_OPENTITAN_MACHINE definition

2023-05-19 Thread Philippe Mathieu-Daudé
QOM type names are usually defined as TYPE_FOO. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/riscv/opentitan.h | 2 ++ hw/riscv/opentitan.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/riscv/opentitan.h b/include/hw/riscv/opentitan.h index

[PATCH 2/5] hw/riscv/opentitan: Declare QOM types using DEFINE_TYPES() macro

2023-05-19 Thread Philippe Mathieu-Daudé
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. Replace the type_init() / type_register_static() combination. This is in preparation of adding the OpenTitan machine type to this array in a pair of commits. Signed-off-by: Philippe

Re: [PATCH 0/2] hw/cxl: CDAT file handling fixes.

2023-05-19 Thread Michael Tokarev
21.04.2023 16:20, Jonathan Cameron via wrote: I've picked up Hao Zeng's v5 and added a patch to deal with the issues that Peter pointed out in this area. On error, the CDAT file handling left resource dangling and didn't cleanly exit from calling functions. Hao Zeng dealt with closing the

Re: [RFC PATCH 2/4] vfio: Implement a common device info helper

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 23:57, Alex Williamson wrote: A common helper implementing the realloc algorithm for handling capabilities. Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-vfio.c | 37 hw/vfio/common.c | 46 ++-

Re: [RFC PATCH 6/8] sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 19:04, Alex Bennée wrote: Move the key functionality of moving time forward into the clock sub-system itself. This will allow us to plumb in time control into plugins. Signed-off-by: Alex Bennée --- include/qemu/timer.h | 15 +++ softmmu/qtest.c | 24

Re: [RFC PATCH 4/8] sysemu: add set_virtual_time to accel ops

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 19:04, Alex Bennée wrote: We are about to remove direct calls to individual accelerators for this information and will need a central point for plugins to hook into time changes. Signed-off-by: Alex Bennée --- include/sysemu/accel-ops.h | 18 +-

Re: [PATCH 2/8] plugins: fix memory leak while parsing options

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 19:04, Alex Bennée wrote: It was hard to track down this leak as it was an internal allocation by glib and the backtraces did not give much away. The autofree was freeing the allocation with g_free() but not taking care of the individual strings. They should have been freed with

Re: [PULL 00/40] virtio,pc,pci: fixes, features, cleanups

2023-05-19 Thread Richard Henderson
On 5/19/23 07:49, Michael S. Tsirkin wrote: The following changes since commit 297e8182194e634baa0cbbfd96d2e09e2a0bcd40: accel/tcg: Fix append_mem_cb (2023-05-18 09:28:44 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git

回复: 回复: [PATCH] target/i386: Clear xsave pkru bit when KVM XCR0 not support

2023-05-19 Thread Yuchen
Paolo, thanks, The kernel patch can solve this problem. But it is difficult to upgrade the kernel in some production environments, and upgrading qemu is easy. This patch is just to sync qemu with kvm XSAVE features, no negative impact. At the same time, it increases the compatibility of qemu

RE: [PATCH v1] migration: fail the cap check if it requires the use of deferred incoming

2023-05-19 Thread Wang, Wei W
On Friday, May 19, 2023 11:34 PM, Peter Xu wrote: > > Ah yes indeed it keeps working, because we apply -global bits before > > setup sockets. Then it's fine by me since that's the only thing I > > would still like to keep it working. :) > > > > If so, can we reword the error message a bit?

io-qcow2 failures on zfs

2023-05-19 Thread Richard Henderson
I'm doing some testing on one of the Linaro build machines and I reliably see Summary of Failures: 712/790 qemu:block / io-qcow2-150 ERROR 5.24s exit status 1 777/790 qemu:block / io-qcow2-copy-before-write

[PATCH v3 2/2] tests/tcg/aarch64: add DC CVA[D]P tests

2023-05-19 Thread Zhuojia Shen
Test execution of DC CVAP and DC CVADP instructions under user mode emulation. Signed-off-by: Zhuojia Shen --- tests/tcg/aarch64/Makefile.target | 11 ++ tests/tcg/aarch64/dcpodp.c| 58 +++ tests/tcg/aarch64/dcpop.c | 58

Re: [PATCH v11 00/14] TCG code quality tracking

2023-05-19 Thread Richard Henderson
On 5/18/23 18:16, Wu, Fei wrote: On 4/22/2023 12:42 AM, Alex Bennée wrote: Fei Wu writes: This patch series were done by Vanderson and Alex originally in 2019, I (Fei Wu) rebased them on latest upstream from: https://github.com/stsquad/qemu/tree/tcg/tbstats-and-perf-v10 and send out

[RFC PATCH 0/4] vfio/pci: Atomic Ops completer support

2023-05-19 Thread Alex Williamson
This RFC proposes automatically enabling PCIe Atomic Ops completer support on PCIe root ports within the VM given the restrictions that a) vfio-pci provides a capability on the vfio device indicating enabled support for various operations, and b) requiring a configuration of installing the

[RFC PATCH 2/4] vfio: Implement a common device info helper

2023-05-19 Thread Alex Williamson
A common helper implementing the realloc algorithm for handling capabilities. Signed-off-by: Alex Williamson --- hw/s390x/s390-pci-vfio.c | 37 hw/vfio/common.c | 46 ++- include/hw/vfio/vfio-common.h | 1 + 3 files

[RFC PATCH 3/4] pcie: Add a PCIe capability version helper

2023-05-19 Thread Alex Williamson
Report the PCIe capability version for a device Signed-off-by: Alex Williamson --- hw/pci/pcie.c | 7 +++ include/hw/pci/pcie.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index b8c24cf45f7e..b7f107ed8dd4 100644 --- a/hw/pci/pcie.c +++

[RFC PATCH 1/4] linux-headers: Update for vfio capability reporting AtomicOps

2023-05-19 Thread Alex Williamson
This is a partial linux-headers update for illustrative and testing purposes only, NOT FOR COMMIT. Signed-off-by: Alex Williamson --- linux-headers/linux/vfio.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index

[RFC PATCH 4/4] vfio/pci: Enable AtomicOps completers on root ports

2023-05-19 Thread Alex Williamson
For cold-plug configurations where the vfio-pci device reports enabled support for PCIe AtomicOps completers and we have a compatible VM configuration, mirror the host AtomicOps completer support in the virtual root port. Signed-off-by: Alex Williamson --- hw/vfio/pci.c | 66

[PATCH v3 1/2] target/arm: allow DC CVA[D]P in user mode emulation

2023-05-19 Thread Zhuojia Shen
DC CVAP and DC CVADP instructions can be executed in EL0 on Linux, either directly when SCTLR_EL1.UCI == 1 or emulated by the kernel (see user_cache_maint_handler() in arch/arm64/kernel/traps.c). This patch enables execution of the two instructions in user mode emulation. Signed-off-by: Zhuojia

Re: [PULL v3 00/21] Block layer patches

2023-05-19 Thread Juan Quintela
Kevin Wolf wrote: > Am 19.05.2023 um 20:48 hat Richard Henderson geschrieben: >> On 5/19/23 10:18, Kevin Wolf wrote: >> > The following changes since commit >> > d009607d08d22f91ca399b72828c6693855e7325: [ Adding Peter Xu, he has worked on postcopy lately] >> > >> >Revert "arm/kvm: add

[PATCH v3 0/2] target/arm: allow DC CVA[D]P in user mode emulation

2023-05-19 Thread Zhuojia Shen
This patch series enables executing DC CVAP and DC CVADP instructions in AArch64 Linux user mode emulation and adds proper TCG tests. Changes in v3: - Fix typo of HWCAP2_DCPODP - Split tests into a separate patch - Remove unnecessary handling of SIGILL in tests - Merge 4 tests into 2 Changes in

[QEMU][PATCH v5 0/4] Introduce Xilinx Versal CANFD

2023-05-19 Thread Vikram Garhwal
Hi, This patch implements CANFD controller for xlnx-versal-virt machine. There are two controllers CANFD0@0xFF06_ and CANFD1@0xFF07_ are connected to the machine. Also, added basic qtests for data exchange between both the controllers in various supported configs. Changelog: v4->v5:

[QEMU][PATCH v5 4/4] tests/qtest: Introduce tests for Xilinx VERSAL CANFD controller

2023-05-19 Thread Vikram Garhwal
The QTests perform three tests on the Xilinx VERSAL CANFD controller: Tests the CANFD controllers in loopback. Tests the CANFD controllers in normal mode with CAN frame. Tests the CANFD controllers in normal mode with CANFD frame. Signed-off-by: Vikram Garhwal Acked-by: Thomas Huth

[QEMU][PATCH v5 2/4] hw/net/can: Introduce Xilinx Versal CANFD controller

2023-05-19 Thread Vikram Garhwal
The Xilinx Versal CANFD controller is developed based on SocketCAN, QEMU CAN bus implementation. Bus connection and socketCAN connection for each CAN module can be set through command lines. Signed-off-by: Vikram Garhwal --- hw/net/can/meson.build |1 + hw/net/can/trace-events

[QEMU][PATCH v5 1/4] MAINTAINERS: Include canfd tests under Xilinx CAN

2023-05-19 Thread Vikram Garhwal
Signed-off-by: Vikram Garhwal Reviewed-by: Peter Maydell Reviewed-by: Francisco Iglesias --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index d0e604c725..e636bb5df8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1813,7 +1813,7 @@

[QEMU][PATCH v5 3/4] xlnx-versal: Connect Xilinx VERSAL CANFD controllers

2023-05-19 Thread Vikram Garhwal
Connect CANFD0 and CANFD1 on the Versal-virt machine and update xlnx-versal-virt document with CANFD command line examples. Signed-off-by: Vikram Garhwal Reviewed-by: Peter Maydell --- docs/system/arm/xlnx-versal-virt.rst | 31 hw/arm/xlnx-versal-virt.c| 53

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi Sean, On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > Hi, > > > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > > > [...] > > > +The user sets the per-page memory attributes to a guest memory range > > >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Nicolas Saenz Julienne
Hi, On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: [...] > +4.138 KVM_GET_SUPPORTED_MEMORY_ATTRIBUTES > +- > + > +:Capability: KVM_CAP_MEMORY_ATTRIBUTES > +:Architectures: x86 > +:Type: vm ioctl > +:Parameters: u64 memory attributes bitmask(out) >

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Sean Christopherson
On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > Hi Sean, > > On Fri May 19, 2023 at 6:23 PM UTC, Sean Christopherson wrote: > > On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > > > Hi, > > > > > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > > > > > [...] > > > > +The user

Re: [PULL v3 00/21] Block layer patches

2023-05-19 Thread Kevin Wolf
Am 19.05.2023 um 20:48 hat Richard Henderson geschrieben: > On 5/19/23 10:18, Kevin Wolf wrote: > > The following changes since commit d009607d08d22f91ca399b72828c6693855e7325: > > > >Revert "arm/kvm: add support for MTE" (2023-05-19 08:01:15 -0700) > > > > are available in the Git

Re: [PULL v3 00/21] Block layer patches

2023-05-19 Thread Richard Henderson
On 5/19/23 10:18, Kevin Wolf wrote: The following changes since commit d009607d08d22f91ca399b72828c6693855e7325: Revert "arm/kvm: add support for MTE" (2023-05-19 08:01:15 -0700) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

Re: [RFC PATCH] Add support for RAPL MSRs in KVM/Qemu

2023-05-19 Thread Marcelo Tosatti
Hi Anthony, On Thu, May 18, 2023 at 04:26:51PM +0200, Anthony Harivel wrote: > Marcelo Tosatti, May 17, 2023 at 17:43: > > Hi Marcelo, > > > On Wed, May 17, 2023 at 03:07:30PM +0200, Anthony Harivel wrote: > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > > > index

Re: [External] Re: Configure no longer works after pulling in the latest QEMU commits

2023-05-19 Thread Hao Xiang
Hi Paolo, I have applied this patch locally and I am able to run "configure" now. From: "Paolo Bonzini" Date: Fri, May 19, 2023, 1:31 AM Subject: [External] Re: Configure no longer works after pulling in the latest QEMU commits To: "Hao Xiang", "qemu-devel@nongnu.org"< qemu-devel@nongnu.org>,

Re: [PULL v3 00/21] Block layer patches

2023-05-19 Thread Richard Henderson
On 5/19/23 10:18, Kevin Wolf wrote: The following changes since commit d009607d08d22f91ca399b72828c6693855e7325: Revert "arm/kvm: add support for MTE" (2023-05-19 08:01:15 -0700) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[PATCH] build: rebuild build.ninja using "meson setup --reconfigure"

2023-05-19 Thread Paolo Bonzini
Do not use the rule in build.ninja, because the path to meson is hardcoded in build.ninja and this breaks if meson moves (for example if the distro meson suddenly becomes too old after an update). Reported-by: Peter Maydell Tested-by: Peter Maydell Signed-off-by: Paolo Bonzini --- Makefile |

Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes

2023-05-19 Thread Sean Christopherson
On Fri, May 19, 2023, Nicolas Saenz Julienne wrote: > Hi, > > On Fri Dec 2, 2022 at 6:13 AM UTC, Chao Peng wrote: > > [...] > > +The user sets the per-page memory attributes to a guest memory range > > indicated > > +by address/size, and in return KVM adjusts address and size to reflect the > >

Re: [PATCH] configure: fix backwards-compatibility for meson sphinx_build option

2023-05-19 Thread Peter Maydell
On Fri, 19 May 2023 at 19:08, Paolo Bonzini wrote: > > Reintroduce the cmd_line.txt mangling to remove the sphinx_build > option when rerunning meson. The mechanism was removed in > commit 75cc28648574 ("configure: remove backwards-compatibility code", > 2023-01-11) > because it was obsolete at

[PATCH] configure: fix backwards-compatibility for meson sphinx_build option

2023-05-19 Thread Paolo Bonzini
Reintroduce the cmd_line.txt mangling to remove the sphinx_build option when rerunning meson. The mechanism was removed in commit 75cc28648574 ("configure: remove backwards-compatibility code", 2023-01-11) because it was obsolete at the time, but the Meson deprecation mechanism doesn't quite

Re: [PULL v3 00/68] i386, build system, KVM changes for 2023-05-18

2023-05-19 Thread Paolo Bonzini
On 5/19/23 19:45, Peter Maydell wrote: On Fri, 19 May 2023 at 18:31, Paolo Bonzini wrote: On 5/19/23 19:01, Peter Maydell wrote: Can you send your config-host.mak after a failed rebuild? I think what's happening is that the path to meson has changed but Makefile still tries the old one

Re: [PATCH v2 14/19] test-cutils: Add more coverage to qemu_strtosz11;rgb:1e1e/1e1e/1e1e

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 05:26:12PM +0200, Hanna Czenczek wrote: > On 12.05.23 04:10, Eric Blake wrote: > > Add some more strings that the user might send our way. In > > particular, some of these additions include FIXME comments showing > > where our parser doesn't quite behave the way we want. >

Re: [PATCH v2 11/19] test-cutils: Refactor qemu_strtosz tests for less boilerplate

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 05:13:52PM +0200, Hanna Czenczek wrote: > On 12.05.23 04:10, Eric Blake wrote: > > No need to copy-and-paste lots of boilerplate per string tested, when > > we can consolidate that behind helper functions. Plus, this adds a > > bit more coverage (we now test all strings

Re: [PATCH v2 09/19] test-cutils: Add coverage of qemu_strtod

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 05:05:20PM +0200, Hanna Czenczek wrote: > On 12.05.23 04:10, Eric Blake wrote: > > It's hard to tweak code for consistency if I can't prove what will or > > won't break from those tweaks. Time to add unit tests for > > qemu_strtod() and qemu_strtod_finite(). > > > > Among

Re: [PATCH v3 2/3] vhost: register and change IOMMU flag depending on Device-TLB state

2023-05-19 Thread Viktor Prutyanov
On Thu, May 18, 2023 at 9:14 AM Jason Wang wrote: > > On Fri, May 12, 2023 at 9:51 PM Viktor Prutyanov wrote: > > > > The guest can disable or never enable Device-TLB. In these cases, > > it can't be used even if enabled in QEMU. So, check Device-TLB state > > before registering IOMMU notifier

Re: [PATCH v6 4/4] hw/cxl: Add clear poison mailbox command support.

2023-05-19 Thread Ira Weiny
Jonathan Cameron wrote: > Current implementation is very simple so many of the corner > cases do not exist (e.g. fragmenting larger poison list entries) > > Reviewed-by: Fan Ni Minor nit below. Otherwise looks good. Reviewed-by: Ira Weiny > diff --git a/hw/mem/cxl_type3.c

Re: [PULL v3 00/68] i386, build system, KVM changes for 2023-05-18

2023-05-19 Thread Peter Maydell
On Fri, 19 May 2023 at 18:31, Paolo Bonzini wrote: > > On 5/19/23 19:01, Peter Maydell wrote: > >> Can you send your config-host.mak after a failed rebuild? I think > >> what's happening is that the path to meson has changed but Makefile > >> still tries the old one (which could be the system

Re: [PULL v3 00/68] i386, build system, KVM changes for 2023-05-18

2023-05-19 Thread Paolo Bonzini
On 5/19/23 19:01, Peter Maydell wrote: Can you send your config-host.mak after a failed rebuild? I think what's happening is that the path to meson has changed but Makefile still tries the old one (which could be the system meson in /usr/bin). Attached; it has

[PULL v3 00/21] Block layer patches

2023-05-19 Thread Kevin Wolf
The following changes since commit d009607d08d22f91ca399b72828c6693855e7325: Revert "arm/kvm: add support for MTE" (2023-05-19 08:01:15 -0700) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to

Re: [PATCH v5 6/11] riscv: Initial commit of OpenTitan machine

2023-05-19 Thread Philippe Mathieu-Daudé
Hi Alistair, [Old patch] On 29/5/20 00:14, Alistair Francis wrote: This adds a barebone OpenTitan machine to QEMU. Signed-off-by: Alistair Francis Reviewed-by: Bin Meng --- default-configs/riscv32-softmmu.mak | 1 + default-configs/riscv64-softmmu.mak | 11 +-

Re: [PATCH] acpi/tests/bios-tables-test: add an environment variable for iasl location

2023-05-19 Thread Paolo Bonzini
On Thu, May 18, 2023 at 1:02 PM Ani Sinha wrote: > > Can we split this variable out to config-test.h maybe? > > Then you can reconfigure with a different iasl and QEMU > > will not be rebuilt, just the tests. > > TBH, it looks more and more like our previous approach was simple and > better

Re: [PATCH 10/13] hw/ide/piix: Reuse PCIIDEState::{cmd,data}_ops

2023-05-19 Thread Bernhard Beschow
Am 18. Mai 2023 14:53:26 UTC schrieb Mark Cave-Ayland : >On 13/05/2023 13:21, Bernhard Beschow wrote: > >> Am 3. Mai 2023 19:52:41 UTC schrieb Mark Cave-Ayland >> : >>> On 27/04/2023 19:15, Bernhard Beschow wrote: >>> Am 27. April 2023 10:52:17 UTC schrieb Mark Cave-Ayland : >

[RFC PATCH 7/8] plugins: add time control API

2023-05-19 Thread Alex Bennée
Expose the ability to control time through the plugin API. Only one plugin can control time so it has to request control when loaded. There are probably more corner cases to catch here. Signed-off-by: Alex Bennée --- include/qemu/qemu-plugin.h | 19 +++ plugins/api.c

[RFC PATCH 5/8] qtest: use cpu interface in qtest_clock_warp

2023-05-19 Thread Alex Bennée
This generalises the qtest_clock_warp code to use the AccelOps handlers for updating its own sense of time. This will make the next patch which moves the warp code closer to pure code motion. Signed-off-by: Alex Bennée --- include/sysemu/qtest.h | 1 + accel/qtest/qtest.c| 1 +

[RFC PATCH 6/8] sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time

2023-05-19 Thread Alex Bennée
Move the key functionality of moving time forward into the clock sub-system itself. This will allow us to plumb in time control into plugins. Signed-off-by: Alex Bennée --- include/qemu/timer.h | 15 +++ softmmu/qtest.c | 24 ++-- util/qemu-timer.c| 26

[PATCH 2/8] plugins: fix memory leak while parsing options

2023-05-19 Thread Alex Bennée
It was hard to track down this leak as it was an internal allocation by glib and the backtraces did not give much away. The autofree was freeing the allocation with g_free() but not taking care of the individual strings. They should have been freed with g_strfreev() instead. Searching the glib

[RFC PATCH 8/8] contrib/plugins: add iops plugin example for cost modelling

2023-05-19 Thread Alex Bennée
This plugin uses the new time control interface to make decisions about the state of time during the emulation. The algorithm is currently very simple. The user specifies an iops rate which applies per core. If the core runs ahead of its allocated execution time the plugin sleeps for a bit to let

[PATCH 1/8] plugins: force slow path when plugins instrument memory ops

2023-05-19 Thread Alex Bennée
The lack of SVE memory instrumentation has been an omission in plugin handling since it was introduced. Fortunately we can utilise the probe_* functions to force all all memory access to follow the slow path. We do this by checking the access type and presence of plugin memory callbacks and if set

[PATCH 0/8] plugins/next: bugfixs and iops based time control RFC

2023-05-19 Thread Alex Bennée
Hi, There are a couple of bug fixes in here but also the RFC for exposing time control to the plugin. Its very rough and ready and I've not done very many tests on the stability of the time slowing down but reducing the iops value does seem to at least get reflected in slower dhrystone scores.

[RFC PATCH 4/8] sysemu: add set_virtual_time to accel ops

2023-05-19 Thread Alex Bennée
We are about to remove direct calls to individual accelerators for this information and will need a central point for plugins to hook into time changes. Signed-off-by: Alex Bennée --- include/sysemu/accel-ops.h | 18 +- include/sysemu/cpu-timers.h

[PATCH 3/8] plugins: update lockstep to use g_memdup2

2023-05-19 Thread Alex Bennée
The old g_memdup is deprecated, use the replacement. Signed-off-by: Alex Bennée --- contrib/plugins/lockstep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index e36f0b9562..3614c3564c 100644 ---

Re: [PULL v3 00/68] i386, build system, KVM changes for 2023-05-18

2023-05-19 Thread Peter Maydell
On Fri, 19 May 2023 at 17:51, Paolo Bonzini wrote: > > > > Il ven 19 mag 2023, 16:39 Peter Maydell ha scritto: >> >> On Thu, 18 May 2023 at 12:41, Paolo Bonzini wrote: >> > >> > * kvm: enable dirty ring for arm64 >> > *

Re: [PULL v3 00/68] i386, build system, KVM changes for 2023-05-18

2023-05-19 Thread Paolo Bonzini
Il ven 19 mag 2023, 16:39 Peter Maydell ha scritto: > On Thu, 18 May 2023 at 12:41, Paolo Bonzini wrote: > > > > * kvm: enable dirty ring for arm64 > > * target/i386: new features > > * target/i386: AVX fixes > > * configure:

Re: [PATCH v6 1/4] bswap: Add the ability to store to an unaligned 24 bit field

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 18:24, Jonathan Cameron wrote: On Fri, 19 May 2023 18:08:30 +0200 Philippe Mathieu-Daudé wrote: On 19/5/23 16:18, Jonathan Cameron wrote: From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 18:34, Philippe Mathieu-Daudé wrote: On 18/5/23 08:03, Sunil V L wrote: On Thu, May 18, 2023 at 02:55:16PM +1000, Alistair Francis wrote: On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé wrote: On 8/5/23 12:00, Andrea Bolognani wrote: On Mon, May 08, 2023 at 11:37:43AM

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Philippe Mathieu-Daudé
On 18/5/23 08:03, Sunil V L wrote: On Thu, May 18, 2023 at 02:55:16PM +1000, Alistair Francis wrote: On Wed, May 17, 2023 at 10:48 PM Philippe Mathieu-Daudé wrote: On 8/5/23 12:00, Andrea Bolognani wrote: On Mon, May 08, 2023 at 11:37:43AM +0530, Sunil V L wrote: On Mon, May 08, 2023 at

Re: [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 04:42:11PM +0200, Hanna Czenczek wrote: > On 12.05.23 04:10, Eric Blake wrote: > > While we were matching 32-bit strtol in qemu_strtoi, our use of a > > 64-bit parse was leaking through for some inaccurate answers in > > qemu_strtoui in comparison to a 32-bit strtoul. Fix

Re: [PATCH v6 1/4] bswap: Add the ability to store to an unaligned 24 bit field

2023-05-19 Thread Jonathan Cameron via
On Fri, 19 May 2023 18:08:30 +0200 Philippe Mathieu-Daudé wrote: > On 19/5/23 16:18, Jonathan Cameron wrote: > > From: Ira Weiny > > > > CXL has 24 bit unaligned fields which need to be stored to. CXL is > > specified as little endian. > > > > Define st24_le_p() and the supporting functions

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Sunil V L
On Fri, May 19, 2023 at 09:11:37AM -0700, Andrea Bolognani wrote: > On Tue, Apr 25, 2023 at 03:55:45PM +0530, Sunil V L wrote: > > qemu-system-riscv64 -bios \ > > -drive file=,if=pflash,format=raw,unit=0 \ > > -drive file=,if=pflash,format=raw,unit=1,readonly=on \ > > -machine virt > > I've

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Andrea Bolognani
On Tue, Apr 25, 2023 at 03:55:45PM +0530, Sunil V L wrote: > qemu-system-riscv64 -bios \ > -drive file=,if=pflash,format=raw,unit=0 \ > -drive file=,if=pflash,format=raw,unit=1,readonly=on \ > -machine virt I've noticed that edk2 for RISC-V, at least in the form it is currently packaged for

Re: [PATCH v6 1/4] bswap: Add the ability to store to an unaligned 24 bit field

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 16:18, Jonathan Cameron wrote: From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size

Re: [PATCH v2] hw/riscv: virt: Assume M-mode FW in pflash0 only when "-bios none"

2023-05-19 Thread Andrea Bolognani
On Thu, May 18, 2023 at 02:53:05PM +1000, Alistair Francis wrote: > On Wed, May 17, 2023 at 6:45 PM Andrea Bolognani wrote: > > On Wed, May 17, 2023 at 02:57:12PM +1000, Alistair Francis wrote: > At one point we loaded Oreboot in in flash and booted from that. I > think Oreboot then loaded

Re: [PATCH v6 6/7] hw/cxl/events: Add injection of DRAM events

2023-05-19 Thread Philippe Mathieu-Daudé
On 19/5/23 17:45, Jonathan Cameron wrote: On Fri, 19 May 2023 17:34:20 +0200 Philippe Mathieu-Daudé wrote: Hi Jonathan, On 19/5/23 16:30, Jonathan Cameron wrote: Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event provides information related to DRAM devices. Example injection

Re: [PULL v2 00/21] Block layer patches

2023-05-19 Thread Richard Henderson
On 5/19/23 03:50, Kevin Wolf wrote: The following changes since commit 6972ef1440a9d685482d78672620a7482f2bd09a: Merge tag 'pull-tcg-20230516-3' of https://gitlab.com/rth7680/qemu into staging (2023-05-16 21:30:27 -0700) are available in the Git repository at:

Re: [PATCH v6 6/7] hw/cxl/events: Add injection of DRAM events

2023-05-19 Thread Jonathan Cameron via
On Fri, 19 May 2023 17:34:20 +0200 Philippe Mathieu-Daudé wrote: > Hi Jonathan, > > On 19/5/23 16:30, Jonathan Cameron wrote: > > Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event > > provides information related to DRAM devices. > > > > Example injection command in QMP: > > > > {

Re: gitlab shared runner time expired

2023-05-19 Thread Richard Henderson
On 5/18/23 17:41, Eldon Stegall wrote: On Thu, May 18, 2023 at 12:26:33PM -0700, Richard Henderson wrote: So, here we are again, out of runner time with 13 days left in the month. Did we come to any resolution since last time? Holding development for that long just isn't right, so I'll

Re: [PATCH v2 19/19] cutils: Improve qemu_strtosz handling of fractions

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: We have several limitations and bugs worth fixing; they are inter-related enough that it is not worth splitting this patch into smaller pieces: * ".5k" should work to specify 512, just as "0.5k" does * "1.k" and "1." + "9"*50 + "k" should both produce

Re: [PATCH v6 6/7] hw/cxl/events: Add injection of DRAM events

2023-05-19 Thread Philippe Mathieu-Daudé
Hi Jonathan, On 19/5/23 16:30, Jonathan Cameron wrote: Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event provides information related to DRAM devices. Example injection command in QMP: { "execute": "cxl-inject-dram-event", "arguments": { "path":

Re: [PATCH v1] migration: fail the cap check if it requires the use of deferred incoming

2023-05-19 Thread Peter Xu
On Fri, May 19, 2023 at 11:30:31AM -0400, Peter Xu wrote: > On Fri, May 19, 2023 at 02:34:57AM +, Wang, Wei W wrote: > > On Friday, May 19, 2023 3:20 AM, Peter Xu wrote: > > > On Fri, May 19, 2023 at 12:00:26AM +0800, Wei Wang wrote: > > > > qemu_start_incoming_migration needs to check the

Re: [PATCH v2 17/19] cutils: Use parse_uint in qemu_strtosz for negative rejection

2023-05-19 Thread Hanna Czenczek
On 12.05.23 21:34, Eric Blake wrote: On Thu, May 11, 2023 at 09:10:31PM -0500, Eric Blake wrote: Rather than open-coding two different ways to check for an unwanted negative sign, reuse the same code in both functions. That way, if we decide down the road to accept "-0" instead of rejecting

Re: [PATCH v1] migration: fail the cap check if it requires the use of deferred incoming

2023-05-19 Thread Peter Xu
On Fri, May 19, 2023 at 09:26:23AM +0100, Daniel P. Berrangé wrote: > On Thu, May 18, 2023 at 03:20:02PM -0400, Peter Xu wrote: > > On Fri, May 19, 2023 at 12:00:26AM +0800, Wei Wang wrote: > > > qemu_start_incoming_migration needs to check the number of multifd > > > channels or postcopy ram

Re: [PATCH v1] migration: fail the cap check if it requires the use of deferred incoming

2023-05-19 Thread Peter Xu
On Fri, May 19, 2023 at 02:34:57AM +, Wang, Wei W wrote: > On Friday, May 19, 2023 3:20 AM, Peter Xu wrote: > > On Fri, May 19, 2023 at 12:00:26AM +0800, Wei Wang wrote: > > > qemu_start_incoming_migration needs to check the number of multifd > > > channels or postcopy ram channels to

Re: [PATCH v2 15/19] cutils: Set value in all qemu_strtosz* error paths

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: Making callers determine whether or not *value was populated on error is not nice for usability. Pre-patch, we have unit tests that check that *result is left unchanged on most EINVAL errors and set to 0 on many ERANGE errors. This is subtly different from

Re: [PATCH v2 14/19] test-cutils: Add more coverage to qemu_strtosz11;rgb:1e1e/1e1e/1e1e

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: Add some more strings that the user might send our way. In particular, some of these additions include FIXME comments showing where our parser doesn't quite behave the way we want. Signed-off-by: Eric Blake --- v2: even more tests added, pad a string to

Re: [PATCH] [query-memory-size-summary] Report page size

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 11:10:30AM +0300, Andrei Gudkov wrote: > Some commands (query-migrate and calc-dirty-rate) report values > in units of pages. However, currently the only place where we can > get page size is through query-migrate and only after migration > has started.

Re: [PATCH v7 2/4] qapi: add DEVICE_ON and query-hotplug infrastructure

2023-05-19 Thread Philippe Mathieu-Daudé
Hi Vladimir, On 21/4/23 12:32, Vladimir Sementsov-Ogievskiy wrote: We have DEVICE_DELETED event, that signals that device_del command is actually completed. But we don't have a counter-part for device_add. Still it's sensible for SHPC and PCIe-native hotplug, as there are time when the device

Re: [PATCH 4/6] target/tricore: Refactor PCXI/ICR register fields

2023-05-19 Thread Bastian Koppelmann
Hi Phil, On Fri, May 19, 2023 at 05:02:48PM +0200, Philippe Mathieu-Daudé wrote: [...] > > case OPC2_32_SYS_ENABLE: > > -tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE_1_3); > > +if (has_feature(ctx, TRICORE_FEATURE_161)) { > > +tcg_gen_ori_tl(cpu_ICR, cpu_ICR,

Re: [PATCH] iotests: Fix test 104 under NBD

2023-05-19 Thread Daniel P . Berrangé
On Fri, May 19, 2023 at 10:02:16AM -0500, Eric Blake wrote: > In the past, commit a231cb27 ("iotests: Fix 104 for NBD", v2.3.0) > added an additional filter to _filter_img_info to rewrite NBD URIs > into the expected output form. This recently broke when we tweaked > tests to run in a per-format

Re: [PATCH] multifd: Set a higher "backlog" default value for listen()

2023-05-19 Thread Peter Xu
On Fri, May 19, 2023 at 01:22:20PM +0200, Juan Quintela wrote: > "Wang, Wei W" wrote: > > On Friday, May 19, 2023 9:31 AM, Wang, Lei4 wrote: > >> On 5/18/2023 17:16, Juan Quintela wrote: > >> > Lei Wang wrote: > >> >> When destination VM is launched, the "backlog" parameter for listen() > >> >>

Re: [PATCH v2 04/19] test-cutils: Test more integer corner cases

2023-05-19 Thread Eric Blake
On Fri, May 19, 2023 at 04:27:10PM +0200, Hanna Czenczek wrote: > On 12.05.23 04:10, Eric Blake wrote: > > We have quite a few undertested and underdocumented integer parsing > > corner cases. To ensure that any changes we make in the code are > > intentional rather than accidental semantic

Re: [PATCH] acpi/tests/avocado/bits: enable bios bits avocado tests on gitlab CI pipeline

2023-05-19 Thread Ani Sinha
> On 17-May-2023, at 12:23 PM, Ani Sinha wrote: > > Biosbits avocado tests on gitlab has thus far been disabled because some > packages needed by this test was missing in the container images used by > gitlab > CI. These packages have now been added with the commit: > > da9000784c90d

Re: [PATCH v2 12/19] cutils: Allow NULL str in qemu_strtosz

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: All the other qemu_strto* and parse_uint allow a NULL str. Having qemu_strtosz crash on qemu_strtosz(NULL, NULL, ) is an easy fix that adds some consistency between our string parsers. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 3 +++

Re: [PATCH RFC 1/5] hw/cxl: Use define for build bug detection

2023-05-19 Thread Jonathan Cameron via
On Thu, 18 May 2023 13:19:12 -0700 Ira Weiny wrote: > Jonathan Cameron wrote: > > On Wed, 17 May 2023 19:45:54 -0700 > > Ira Weiny wrote: > > > > > Magic numbers can be confusing. > > > > > > Use the range size define for CXL.cachemem rather than a magic number. > > > Update/add spec

Re: [PATCH v2 11/19] test-cutils: Refactor qemu_strtosz tests for less boilerplate

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: No need to copy-and-paste lots of boilerplate per string tested, when we can consolidate that behind helper functions. Plus, this adds a bit more coverage (we now test all strings both with and without endptr, whereas before some tests skipped the NULL

Re: [PATCH v2 09/19] test-cutils: Add coverage of qemu_strtod

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: It's hard to tweak code for consistency if I can't prove what will or won't break from those tweaks. Time to add unit tests for qemu_strtod() and qemu_strtod_finite(). Among other things, I wrote a check whether we have C99 semantics for strtod("0x1")

[PATCH] iotests: Fix test 104 under NBD

2023-05-19 Thread Eric Blake
In the past, commit a231cb27 ("iotests: Fix 104 for NBD", v2.3.0) added an additional filter to _filter_img_info to rewrite NBD URIs into the expected output form. This recently broke when we tweaked tests to run in a per-format directory, which did not match the regex, because _img_info itself

Re: [PATCH 4/6] target/tricore: Refactor PCXI/ICR register fields

2023-05-19 Thread Philippe Mathieu-Daudé
Hi Bastian, On 19/5/23 15:36, Bastian Koppelmann wrote: starting from ISA version 1.6.1 (previously known as 1.6P/E), some bitfields in PCXI and ICR have changed. We also refactor these registers using the register fields API. Signed-off-by: Bastian Koppelmann Resolves:

Re: [PATCH] Revert "arm/kvm: add support for MTE"

2023-05-19 Thread Richard Henderson
On 5/19/23 07:58, Peter Maydell wrote: This reverts commit b320e21c48ce64853904bea6631c0158cc2ef227, which accidentally broke TCG, because it made the TCG -cpu max report the presence of MTE to the guest even if the board hadn't enabled MTE by wiring up the tag RAM. This meant that if the guest

  1   2   3   >