Re: [PATCH] qapi: better docs for calc-dirty-rate and friends

2023-05-26 Thread Markus Armbruster
Peter Xu writes: > On Thu, May 25, 2023 at 03:08:35PM +0200, Markus Armbruster wrote: >> Andrei Gudkov writes: >> >> > Rewrote calc-dirty-rate documentation. Briefly described >> > different modes of dirty page rate measurement. Added some >> > examples. Fixed obvious grammar errors. >> > >> >

Re: [PATCH] qapi: better docs for calc-dirty-rate and friends

2023-05-26 Thread Markus Armbruster
writes: > On Thu, May 25, 2023 at 03:08:35PM +0200, Markus Armbruster wrote: >> Andrei Gudkov writes: >> >> > Rewrote calc-dirty-rate documentation. Briefly described >> > different modes of dirty page rate measurement. Added some >> > examples. Fixed obvious grammar errors. >> > >> > Signed-of

[PATCH v5 6/6] ui/gtk: enable backend to send multi-touch events

2023-05-26 Thread Sergio Lopez
GTK3 provides the infrastructure to receive and process multi-touch events through the "touch-event" signal and the GdkEventTouch type. Make use of it to transpose events from the host to the guest. This allows users of machines with hardware capable of receiving multi-touch events to run guests t

[PATCH v5 0/6] Implement virtio-multitouch and enable GTK3 to use it

2023-05-26 Thread Sergio Lopez
This series adds a virtio-multitouch device to the family of devices emulated by virtio-input implementing the Multi-touch protocol as descripted here: https://www.kernel.org/doc/html/latest/input/multi-touch-protocol.html?highlight=multi+touch It also extends the GTK UI backend to be able to rec

[PATCH v5 2/6] ui: add the infrastructure to support MT events

2023-05-26 Thread Sergio Lopez
Add the required infrastructure to support generating multitouch events. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- include/ui/input.h| 3 ++ qapi/ui.json | 68 +-- replay/replay-input.c |

[PATCH v5 1/6] virtio-input: generalize virtio_input_key_config()

2023-05-26 Thread Sergio Lopez
As there are other bitmap-based config properties that need to be dealt in a similar fashion as VIRTIO_INPUT_CFG_EV_BITS, generalize the function to receive select and subsel as arguments, and rename it to virtio_input_extend_config() Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --

[PATCH v5 5/6] ui: add helpers for virtio-multitouch events

2023-05-26 Thread Sergio Lopez
Add helpers for generating Multi-touch events from the UI backends that can be sent to the guest through a virtio-multitouch device. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --- include/ui/input.h | 5 + ui/input.c | 36 2 file

[PATCH v5 4/6] virtio-input-pci: add virtio-multitouch-pci

2023-05-26 Thread Sergio Lopez
Add virtio-multitouch-pci, a Multitouch-capable input device, to the list of devices that can be provided by virtio-input-pci. Signed-off-by: Sergio Lopez Reviewed-by: Marc-André Lureau --- hw/virtio/virtio-input-pci.c | 25 + 1 file changed, 21 insertions(+), 4 deletion

[PATCH v5 3/6] virtio-input: add a virtio-mulitouch device

2023-05-26 Thread Sergio Lopez
Add a virtio-multitouch device to the family of devices emulated by virtio-input implementing the Multi-touch protocol as descripted here: https://www.kernel.org/doc/html/latest/input/multi-touch-protocol.html?highlight=multi+touch This patch just add the device itself, without connecting it to a

Re: [PATCH 0/2] meson: Fix initrd-stress.img build

2023-05-26 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH 0/2] meson: Fix initrd-stress.img build

2023-05-26 Thread Daniel P . Berrangé
On Fri, May 26, 2023 at 10:19:21AM +0200, Paolo Bonzini wrote: > Queued, thanks. The second patch looks incomplete to me. With regards, Daniel -- |: https://berrange.com -o-https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o-https://fstop138.berrang

Re: [PULL 09/12] migration: Use migration_transferred_bytes() to calculate rate_limit

2023-05-26 Thread Fiona Ebner
Am 26.05.23 um 10:55 schrieb Juan Quintela: > Fiona Ebner wrote: >> Am 18.05.23 um 19:13 schrieb Juan Quintela: >>> diff --git a/migration/migration-stats.c b/migration/migration-stats.c >>> index feec7d7369..97759a45f3 100644 >>> --- a/migration/migration-stats.c >>> +++ b/migration/migration-sta

[RFC 2/2] migration: Update error description outside migration.c

2023-05-26 Thread Tejus GK
A few code paths exist in the source code,where a migration is marked as failed via MIGRATION_STATUS_FAILED, but the failure happens outside of migration.c In such cases, an error_report() call is made, however the current MigrationState is never updated with the error description, and hence clien

[RFC 1/2] migration/vmstate: Introduce vmstate_save_state_with_err

2023-05-26 Thread Tejus GK
Currently, a few code paths exist in the function vmstate_save_state_v, which ultimately leads to a migration failure. However, an update in the current MigrationState for the error description is never done. vmstate.c somehow doesn't seem to allow the use of migrate_set_error due to some dependen

[RFC 0/2] migration: Update error description outside migration.c

2023-05-26 Thread Tejus GK
Hi everyone, This patchset aims to cover code paths in the source code where a migration is marked as failed via MIGRATION_STATUS_FAILED, however the failure exists outside of migration.c, and without a call for migrate_set_error at this place. This patchset has been split out from the patchs

[PATCH v2 1/6] linux-user: Expose do_guest_openat() and do_guest_readlink()

2023-05-26 Thread Ilya Leoshkevich
These functions will be required by the GDB stub in order to provide the guest view of /proc to GDB. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- linux-user/qemu.h| 3 +++ linux-user/syscall.c | 54 2 files changed, 38 insertions

[PATCH v2 2/6] gdbstub: Expose gdb_get_process() and gdb_get_first_cpu_in_process()

2023-05-26 Thread Ilya Leoshkevich
These functions will be needed by user-target.c in order to retrieve the name of the executable. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 16 gdbstub/internals.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/g

[PATCH v2 0/6] gdbstub: Add support for info proc mappings

2023-05-26 Thread Ilya Leoshkevich
v1: https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg02614.html v1 -> v2: Reword the 5/6 commit message (Dominik). Add R-bs. Patches that need review: 4/6 gdbstub: Add support for info proc mappings 6/6 tests/tcg: Add a test for info proc mappings Hi

[PATCH v2 6/6] tests/tcg: Add a test for info proc mappings

2023-05-26 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Since there are issues with how GDB interprets QEMU's target.xml, enable the test only on aarch64 and s390x for now. Signed-off-by: Ilya Leoshkevich --- tests/tcg/aarch64/Makefile.target | 3 +- tests/tcg/multiarch/Makefile.target |

[PATCH v2 5/6] docs: Document security implications of debugging

2023-05-26 Thread Ilya Leoshkevich
Now that the GDB stub explicitly implements reading host files (note that it was already possible by changing the emulated code to open and read those files), concerns may arise that it undermines security. Document the status quo, which is that the users are already responsible for securing the G

[PATCH v2 3/6] gdbstub: Report the actual qemu-user pid

2023-05-26 Thread Ilya Leoshkevich
Currently qemu-user reports pid 1 to GDB. Resolve the TODO and report the actual PID. Using getpid() relies on the assumption that there is only one GDBProcess. Add an assertion to make sure that future changes don't break it. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- gdbstub

[PATCH v2 4/6] gdbstub: Add support for info proc mappings

2023-05-26 Thread Ilya Leoshkevich
Currently the GDB's generate-core-file command doesn't work well with qemu-user: the resulting dumps are huge [1] and at the same time incomplete (argv and envp are missing). The reason is that GDB has no access to proc mappings and therefore has to fall back to using heuristics for discovering the

Re: [PATCH v2 3/6] tests/qtest: capture RESUME events during migration

2023-05-26 Thread Daniel P . Berrangé
On Mon, Apr 24, 2023 at 10:53:36AM +0100, Daniel P. Berrangé wrote: > On Fri, Apr 21, 2023 at 11:59:25PM +0200, Juan Quintela wrote: > > Daniel P. Berrangé wrote: > > > When running migration tests we monitor for a STOP event so we can skip > > > redundant waits. This will be needed for the RESUME

Re: [RFC PATCH] softfloat: use QEMU_FLATTEN to avoid mistaken isra inlining

2023-05-26 Thread BALATON Zoltan
On Tue, 23 May 2023, BALATON Zoltan wrote: Unrelated to this patch I also started to see random crashes with a DSI on a dcbz instruction now which did not happen before (or not frequently enough for me to notice). I did not bisect that as it happens randomly but I wonder if it could be related

[PATCH] migration: stop tracking ram writes when cancelling background migration

2023-05-26 Thread Fiona Ebner
Currently, it is only done when the iteration finishes successfully. Not cleaning up the userfaultfd write protection can lead to symptoms/issues such as the process hanging in memmove or GDB not being able to attach. Signed-off-by: Fiona Ebner --- For the success case, the stuff in between the

[PATCH v5 0/3] hw/riscv/virt: pflash improvements

2023-05-26 Thread Sunil V L
This series improves the pflash usage in RISC-V virt machine with solutions to below issues. 1) Currently the first pflash is reserved for ROM/M-mode firmware code. But S-mode payload firmware like EDK2 need both pflash devices to have separate code and variable store so that OS distros can keep

[PATCH v5 3/3] docs/system: riscv: Add pflash usage details

2023-05-26 Thread Sunil V L
pflash devices can be used in virt machine for different purposes like for ROM code or S-mode FW payload. Add a section in the documentation on how to use pflash devices for different purposes. Signed-off-by: Sunil V L --- docs/system/riscv/virt.rst | 29 + 1 file cha

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

2023-05-26 Thread Sunil V L
Currently, virt machine supports two pflash instances each with 32MB size. However, the first pflash is always assumed to contain M-mode firmware and reset vector is set to this if enabled. Hence, for S-mode payloads like EDK2, only one pflash instance is available for use. This means both code and

Re: query-command-line-options

2023-05-26 Thread Markus Armbruster
Ján Tomko writes: > On a Friday in 2023, Markus Armbruster wrote: >>> { "sandbox", NULL, QEMU_CAPS_SECCOMP_SANDBOX }, >> >>Does option -sandbox exist? >> >>It does since v1.2. If CONFIG_SECCOMP is off, actually using it is a >>fatal error. Compiling out the option entirely would be more use

[PATCH v5 2/3] riscv/virt: Support using pflash via -blockdev option

2023-05-26 Thread Sunil V L
Currently, pflash devices can be configured only via -pflash or -drive options. This is the legacy way and the better way is to use -blockdev as in other architectures. libvirt also has moved to use -blockdev method. To support -blockdev option, pflash devices need to be created in instance_init i

Re: [PATCH v2 1/2] qemu-img: rebase: stop when reaching EOF of old backing file

2023-05-26 Thread Denis V. Lunev
On 5/25/23 20:02, Andrey Drobyshev wrote: In case when we're rebasing within one backing chain, and when target image is larger than old backing file, bdrv_is_allocated_above() ends up setting *pnum = 0. As a result, target offset isn't getting incremented, and we get stuck in an infinite for lo

Re: [PATCH v2 2/2] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size

2023-05-26 Thread Denis V. Lunev
On 5/25/23 20:02, Andrey Drobyshev wrote: Before previous commit, rebase was getting infitely stuck in case of rebasing within the same backing chain and when overlay_size > backing_size. Let's add this case to the rebasing test 024 to make sure it doesn't break again. Signed-off-by: Andrey Drob

Re: [RFC PATCH] pnv/chiptod: Add basic P9 chiptod model

2023-05-26 Thread Cédric Le Goater
On 8/11/22 19:30, Cédric Le Goater wrote: On 8/11/22 18:40, Nicholas Piggin wrote: The chiptod is a pervasive facility which can keep a time, synchronise it across multiple chips, and can move that time to or from the core timebase units. This adds a very basic initial emulation of chiptod regi

Re: [PATCH] ppc/pnv: Add initial P9/10 SBE model

2023-05-26 Thread Cédric Le Goater
On 8/11/22 10:04, Cédric Le Goater wrote: On 8/11/22 09:54, Nicholas Piggin wrote: The SBE (Self Boot Engine) are on-chip microcontrollers that perform early boot steps, as well as provide some runtime facilities (e.g., timer, secure register access, MPIPL). The latter facilities are accessed mo

Re: [PATCH v2 05/10] hw/virtio: Introduce VHOST_VSOCK_COMMON symbol in Kconfig

2023-05-26 Thread Stefano Garzarella
On Wed, May 24, 2023 at 11:37:39AM +0200, Philippe Mathieu-Daudé wrote: Instead of adding 'vhost-vsock-common.c' twice (for VHOST_VSOCK and VHOST_USER_VSOCK), have it depend on VHOST_VSOCK_COMMON, selected by both symbols. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Re

Re: [PATCH v2 07/10] hw/virtio/vhost-vsock: Include missing 'virtio/virtio-bus.h' header

2023-05-26 Thread Stefano Garzarella
On Wed, May 24, 2023 at 11:37:41AM +0200, Philippe Mathieu-Daudé wrote: Instead of having "virtio/virtio-bus.h" implicitly included, explicitly include it, to avoid when rearranging headers: hw/virtio/vhost-vsock-common.c: In function ‘vhost_vsock_common_start’: hw/virtio/vhost-vsock-common.c:

Re: [PATCH v5 0/3] hw/riscv/virt: pflash improvements

2023-05-26 Thread Andrea Bolognani
On Fri, May 26, 2023 at 05:40:03PM +0530, Sunil V L wrote: > This series improves the pflash usage in RISC-V virt machine with solutions to > below issues. > > 1) Currently the first pflash is reserved for ROM/M-mode firmware code. But > S-mode > payload firmware like EDK2 need both pflash devices

[PATCH] hw/ppc/mac_newworld: Check for the availability of pci-ohci before using it

2023-05-26 Thread Thomas Huth
pci-ohci might habe been disabled in the QEMU binary (e.g. when "configure" has been run with "--without-default-devices"). Thus we should check for its availability before blindly using it. Signed-off-by: Thomas Huth --- hw/ppc/mac_newworld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [PATCH v7 2/4] hw/cxl: QMP based poison injection support

2023-05-26 Thread Markus Armbruster
Jonathan Cameron writes: > Inject poison using qmp command cxl-inject-poison to add an entry to the QMP command > poison list. > > For now, the poison is not returned CXL.mem reads, but only via the > mailbox command Get Poison List. So a normal memory read to an address > that is on the poison

Re: [PATCH 2/2] meson: Add static glib dependency for initrd-stress.img

2023-05-26 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Thu, May 25, 2023 at 06:20:44PM -0300, Fabiano Rosas wrote: >> We recently moved glib detection code to meson but the static libs >> were left out. Add a specific dependency for stress.c which is linked >> statically. >> >> $ make V=1 tests/migration/initrd-stress

Re: [PATCH v7 5/7] hw/cxl/events: Add injection of General Media Events

2023-05-26 Thread Markus Armbruster
Jonathan Cameron writes: > From: Ira Weiny > > To facilitate testing provide a QMP command to inject a general media > event. The event can be added to the log specified. > > Signed-off-by: Ira Weiny > Signed-off-by: Jonathan Cameron > > --- > v7: Various docs updates and field renames includ

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

2023-05-26 Thread Markus Armbruster
Jonathan Cameron writes: > 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": "/machine/peripheral/cxl-mem0", >

Re: [PATCH v7 7/7] hw/cxl/events: Add injection of Memory Module Events

2023-05-26 Thread Markus Armbruster
Jonathan Cameron writes: > These events include a copy of the device health information at the > time of the event. Actually using the emulated device health would > require a lot of controls to manipulate that state. Given the aim > of this injection code is to just test the flows when events o

Re: [PATCH] hw/ppc/mac_newworld: Check for the availability of pci-ohci before using it

2023-05-26 Thread BALATON Zoltan
On Fri, 26 May 2023, Thomas Huth wrote: pci-ohci might habe been disabled in the QEMU binary (e.g. when "configure" has been run with "--without-default-devices"). Thus we should check for its availability before blindly using it. Signed-off-by: Thomas Huth --- hw/ppc/mac_newworld.c | 3 ++- 1 f

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-26 Thread Hanna Czenczek
On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's that do a lot of writes/deletes. This causes the qcow2 image to grow even over 110% of its virt

Re: [PATCH] qapi: better docs for calc-dirty-rate and friends

2023-05-26 Thread Peter Xu
On Fri, May 26, 2023 at 01:23:07PM +0200, Markus Armbruster wrote: > Going with > > # 2. Dirty bitmap mode captures writes to memory (for example by > #temporarily revoking write access to all pages) and counting page > #faults. Information about modified pages is collec

Re: [PATCH v2] migration: hold the BQL during setup

2023-05-26 Thread Fiona Ebner
Am 26.05.23 um 12:16 schrieb Juan Quintela: > Nak > > Sometimes it works, and sometimes it hangs. Sorry, I originally only ran the tests for x86_64 (native for me). I now ran into the hang too, with qtest-aarch64/migration-test and qtest-i386/migration-test. > Can you take a look? Will do! Bes

Re: [PATCH v5 2/3] riscv/virt: Support using pflash via -blockdev option

2023-05-26 Thread Philippe Mathieu-Daudé
On 26/5/23 14:10, Sunil V L wrote: Currently, pflash devices can be configured only via -pflash or -drive options. This is the legacy way and the better way is to use -blockdev as in other architectures. libvirt also has moved to use -blockdev method. To support -blockdev option, pflash devices

Re: [PATCH v5 3/3] docs/system: riscv: Add pflash usage details

2023-05-26 Thread Philippe Mathieu-Daudé
On 26/5/23 14:10, Sunil V L wrote: pflash devices can be used in virt machine for different purposes like for ROM code or S-mode FW payload. Add a section in the documentation on how to use pflash devices for different purposes. Signed-off-by: Sunil V L --- docs/system/riscv/virt.rst | 29 +++

Re: [RFC PATCH v1 0/9] Hypervisor-Enforced Kernel Integrity

2023-05-26 Thread James Morris
[Side topic] Would folks be interested in a Linux Plumbers Conference MC on this topic generally, across different hypervisors, VMMs, and architectures? If so, please let me know who the key folk would be and we can try writing up an MC proposal. -- James Morris

Re: [RFC PATCH 3/6] Convert query-block/info_block to coroutine

2023-05-26 Thread Fabiano Rosas
Eric Blake writes: > On Tue, May 23, 2023 at 06:39:00PM -0300, Fabiano Rosas wrote: >> From: Lin Ma >> >> Sometimes the query-block performs time-consuming I/O(say waiting for >> the fstat of NFS complete), So let's make this QMP handler runs in a >> coroutine. > > Grammar suggestions: > > Some

[PULL 2/5] Hexagon (target/hexagon) Fix assignment to tmp registers

2023-05-26 Thread Taylor Simpson
From: Marco Liebel The order in which instructions are generated by gen_insn() influences assignment to tmp registers. During generation, tmp instructions (e.g. generate_V6_vassign_tmp) use vreg_src_off() to determine what kind of register to use as source. If some instruction (e.g. generate_V6_v

Re: [RFC PATCH 6/6] block: Add a thread-pool version of fstat

2023-05-26 Thread Fabiano Rosas
Eric Blake writes: > On Tue, May 23, 2023 at 06:39:03PM -0300, Fabiano Rosas wrote: >> From: João Silva >> >> The fstat call can take a long time to finish when running over >> NFS. Add a version of it that runs in the thread pool. >> >> Adapt one of its users, raw_co_get_allocated_file size t

[PULL 4/5] Hexagon: fix outdated `hex_new_*` comments

2023-05-26 Thread Taylor Simpson
From: Matheus Tavares Bernardino Some code comments refer to hex_new_value and hex_new_pred_value, which have been transferred to DisasContext and, in the case of hex_new_value, should now be accessed through get_result_gpr(). In order to fix this outdated comments and also avoid having to tweak

[PULL 5/5] Hexagon (target/hexagon) Change Hexagon maintainer

2023-05-26 Thread Taylor Simpson
Change Hexagon maintainer from Taylor Simpson to Brian Cain Put Taylor's gmail address in .mailmap Signed-off-by: Taylor Simpson Reviewed-by: Alex Bennée --- MAINTAINERS | 2 +- .mailmap| 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1c93

[PULL 3/5] target/hexagon/*.py: clean up used 'toss' and 'numregs' vars

2023-05-26 Thread Taylor Simpson
From: Matheus Tavares Bernardino Many Hexagon python scripts call hex_common.get_tagregs(), but only one call site use the full reg structure given by this function. To make the code cleaner, let's make get_tagregs() filter out the unused fields (i.e. 'toss' and 'numregs'), properly removed the u

[PULL 0/5] Hexagon update

2023-05-26 Thread Taylor Simpson
The following changes since commit a3cb6d5004ff638aefe686ecd540718a793bd1b1: Merge tag 'pull-tcg-20230525' of https://gitlab.com/rth7680/qemu into staging (2023-05-25 11:11:52 -0700) are available in the Git repository at: https://github.com/quic/qemu tags/pull-hex-20230526

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-26 Thread Stefano Garzarella
On Thu, May 25, 2023 at 08:30:03PM +0200, Markus Armbruster wrote: Stefan Hajnoczi writes: On Wed, May 17, 2023 at 09:19:26AM +0200, Stefano Garzarella wrote: CCing Markus for some advice. On Tue, May 16, 2023 at 11:04:21AM -0500, Jonathon Jongsma wrote: [...] > I need some way to determ

Re: [PATCH] linux-user/i386: Properly align signal frame

2023-05-26 Thread Richard Henderson
On 5/25/23 19:56, fa...@mail.ustc.edu.cn wrote: "The beginning of the structure, with pretaddr, should be just below 16-byte alignment." It is incorrect! The beginning of the structure, with pretaddr not aligned as 16-byte! On x86-64, It aligned as (16n - sizeof(void*)) because of instruction

Re: [RESEND PATCH v2 0/3] Enable -cpu ,help

2023-05-26 Thread Igor Mammedov
On Mon, 3 Apr 2023 21:19:53 -0400 Dinah Baum wrote: > Part 1 is a refactor/code motion patch for > qapi/machine target required for setup of > > Part 2 which enables query-cpu-model-expansion > on all architectures > > Part 3 implements the ',help' feature > > Limitations: > Currently only 'F

Re: [PATCH 08/12] copy-before-write: Fix open with child in iothread

2023-05-26 Thread Eric Blake
On Thu, May 25, 2023 at 02:47:09PM +0200, Kevin Wolf wrote: > The AioContext lock must not be held for bdrv_open_child(), but it is > necessary for the followig operations, in particular those using nested following > event loops in coroutine wrappers. > > Temporarily dropping the main AioContex

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-26 Thread Jean-Louis Dupond
On 26/05/2023 15:31, Hanna Czenczek wrote: On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's that do a lot of writes/deletes. This causes the

Re: [PATCH] vhost: release memory objects in error path

2023-05-26 Thread Peter Xu
On Fri, May 26, 2023 at 12:24:07PM +0530, Prasad Pandit wrote: > Hello Peter, all > > On Thu, 25 May 2023 at 18:33, Peter Xu wrote: > > > IIRC this bug used to only reproduce on rt kernels, is it still the case? > > > > * Yes, it's a same crash. > > > > Here besides doing correct unregister,

Re: [PATCH v1] vhost: release memory objects in error path

2023-05-26 Thread Peter Xu
On Fri, May 26, 2023 at 01:10:51PM +0530, P J P wrote: > From: Prasad Pandit > > vhost_dev_start function does not release memory objects in case > of an error. This may crash the guest with: > > stack trace of thread 125653: > Program terminated with signal SIGSEGV, Segmentation fault > #

Re: [PATCH v2 01/20] target/arm: Add commentary for CPUARMState.exclusive_high

2023-05-26 Thread Richard Henderson
On 5/26/23 02:49, Juan Quintela wrote: Philippe Mathieu-Daudé wrote: Hi, On 26/5/23 01:25, Richard Henderson wrote: Document the meaning of exclusive_high in a big-endian context, and why we can't change it now. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 7 +++ 1 file c

[PATCH v4 0/2] block/blkio: support fd passing for virtio-blk-vhost-vdpa driver

2023-05-26 Thread Stefano Garzarella
v4: - added patch 02 to allow libvirt to discover we support fdset [Markus] - modified the commit description of patch 01 v3: https://lore.kernel.org/qemu-devel/20230511091527.46620-1-sgarz...@redhat.com/ - use qemu_open() on `path` to simplify libvirt code [Jonathon] - remove patch 01 since we a

[PATCH v4 1/2] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-26 Thread Stefano Garzarella
Some virtio-blk drivers (e.g. virtio-blk-vhost-vdpa) supports the fd passing. Let's expose this to the user, so the management layer can pass the file descriptor of an already opened path. If the libblkio virtio-blk driver supports fd passing, let's always use qemu_open() to open the `path`, so we

[PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-26 Thread Stefano Garzarella
The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd passing through the new 'fd' property. Since now we are using qemu_open() on '@path' if the virtio-blk driver supports the fd passing, let's announce it. In this way, the management layer can pass the file descriptor of an already

Re: [RFC PATCH v1 0/9] Hypervisor-Enforced Kernel Integrity

2023-05-26 Thread Mickaël Salaün
On 25/05/2023 15:59, Mickaël Salaün wrote: On 25/05/2023 00:20, Edgecombe, Rick P wrote: On Fri, 2023-05-05 at 17:20 +0200, Mickaël Salaün wrote: # How does it work? This implementation mainly leverages KVM capabilities to control the Second Layer Address Translation (or the Two Dimensional

[PATCH v4 0/2] Move ASID test to vhost-vdpa net initialization

2023-05-26 Thread Eugenio Pérez
QEMU v8.0 is able to switch dynamically between vhost-vdpa passthrough and SVQ mode as long as the net device does not have CVQ. The net device state followed (and migrated) by CVQ requires special care. A pre-requisite to add CVQ to that framework is to determine if devices with CVQ are migratab

[PATCH v4 1/2] vdpa: return errno in vhost_vdpa_get_vring_group error

2023-05-26 Thread Eugenio Pérez
We need to tell in the caller, as some errors are expected in a normal workflow. In particular, parent drivers in recent kernels with VHOST_BACKEND_F_IOTLB_ASID may not support vring groups. In that case, -ENOTSUP is returned. This is the case of vp_vdpa in Linux 6.2. Next patches in this serie

[PATCH v4 2/2] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-05-26 Thread Eugenio Pérez
Evaluating it at start time instead of initialization time may make the guest capable of dynamically adding or removing migration blockers. Also, moving to initialization reduces the number of ioctls in the migration, reducing failure possibilities. As a drawback we need to check for CVQ isolatio

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

2023-05-26 Thread Marcelo Tosatti
On Wed, May 24, 2023 at 04:53:49PM +0200, Anthony Harivel wrote: > set=UTF-8 > Status: RO > Content-Length: 24102 > Lines: 667 > > Marcelo Tosatti, May 19, 2023 at 20:28: > > Hi Marcelo, > > > > > > +/* Assuming those values are the same accross physical > > > > > system/packages */ > > > >

Re: [RFC PATCH v1 0/9] Hypervisor-Enforced Kernel Integrity

2023-05-26 Thread Mickaël Salaün
On 25/05/2023 17:52, Edgecombe, Rick P wrote: On Thu, 2023-05-25 at 15:59 +0200, Mickaël Salaün wrote: [ snip ] The kernel often creates writable aliases in order to write to protected data (kernel text, etc). Some of this is done right as text is being first written out (alternatives for exa

[PATCH] vdpa: Remove status in reset tracing

2023-05-26 Thread Eugenio Pérez
It is always 0 and it is not useful to route call through file descriptor. Reviewed-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: Eugenio Pérez --- Commit extracted from series [1], Message-Id <20230509154435.1410162-1-epere...@redhat.com>, as this change is not needed anymore the

Re: io-qcow2 failures on zfs

2023-05-26 Thread Richard Henderson
On 5/26/23 01:02, Thomas Huth wrote: What output do you get when running the tests directly? i.e.: cd tests/qemu-iotests/ ./check -qcow2 150 === Mapping non-sparse conversion === Offset Length File -0 0x10TEST_DIR/t.IMGFMT +0 0x1

Re: [PATCH v2] migration: hold the BQL during setup

2023-05-26 Thread Fiona Ebner
Am 26.05.23 um 15:47 schrieb Fiona Ebner: > Am 26.05.23 um 12:16 schrieb Juan Quintela: >> Nak >> >> Sometimes it works, and sometimes it hangs. > > Sorry, I originally only ran the tests for x86_64 (native for me). I now > ran into the hang too, with qtest-aarch64/migration-test and > qtest-i386/

Re: [PATCH] atomics: eliminate mb_read/mb_set

2023-05-26 Thread Richard Henderson
On 5/26/23 01:18, Paolo Bonzini wrote: qatomic_mb_read and qatomic_mb_set were the very first atomic primitives introduced for QEMU; their semantics are unclear and they provide a false sense of safety. The last use of qatomic_mb_read() has been removed, so delete it. qatomic_mb_set() instead ca

Re: [PATCH v2 2/5] gitlab: allow overriding name of the upstream repository

2023-05-26 Thread Richard Henderson
On 5/26/23 03:19, Daniel P. Berrangé wrote: The CI rules have special logic for what happens in upstream. To enable contributors who modify CI rules to test this logic, however, they need to be able to override which repo is considered upstream. This introduces the 'QEMU_CI_UPSTREAM' variable

Re: [PATCH v2 3/5] gitlab: stable staging branches publish containers in a separate tag

2023-05-26 Thread Richard Henderson
On 5/26/23 03:19, Daniel P. Berrangé wrote: If the stable staging branches publish containers under the 'latest' tag they will clash with containers published on the primary staging branch, as well as with each other. This introduces logic that overrides the container tag when jobs run against t

Re: [PATCH v2 4/5] gitlab: avoid extra pipelines for tags and stable branches

2023-05-26 Thread Richard Henderson
On 5/26/23 03:19, Daniel P. Berrangé wrote: In upstream context we only run pipelines on staging branches, and limited publishing jobs on the default branch. We don't want to run pipelines on stable branches, or tags, because the content will have already been tested on a staging branch before g

Re: [PATCH v2 5/5] gitlab: support disabling job auto-run in upstream

2023-05-26 Thread Richard Henderson
On 5/26/23 03:19, Daniel P. Berrangé wrote: +# Upstream pipeline jobs start automatically unless told not to +# by setting QEMU_CI=1 +- if: '$QEMU_CI == "1" && $CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_COMMIT_BRANCH =~/staging/' + when: manual + variables: +

[PULL 06/12] meson: Add static glib dependency for initrd-stress.img

2023-05-26 Thread Paolo Bonzini
From: Fabiano Rosas We recently moved glib detection code to meson but this changes the linker command line from -lglib-2.0 to using a path to libglib-2.0.so. This does not work for static linking, which is used by stress.c: $ make V=1 tests/migration/initrd-stress.img cc -m64 -mcx16 -o tests/

[PULL 11/12] meson: use subproject for keycodemapdb

2023-05-26 Thread Paolo Bonzini
By using a subproject, our own meson.build can use variables from the subproject instead of hard-coded paths. This is also the first step towards managing downloads with .wrap files instead of submodule. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- .gitmodules

[PULL 02/12] tests/vm: fix and simplify HOST_ARCH definition

2023-05-26 Thread Paolo Bonzini
ARCH is always empty, so just define HOST_ARCH as the result of uname. The incorrect definition was not being used because the "ifeq" statement is wrong; replace it with the same idiom based on $(realpath) that the main Makefile uses. With this change, vm-build-netbsd in a configured tree will not

[PULL 03/12] Makefile: remove $(TESTS_PYTHON)

2023-05-26 Thread Paolo Bonzini
It is now the same as $(PYTHON), since the latter always points at pyvenv/bin/python3. Reviewed-by: Alex Bennée Signed-off-by: Paolo Bonzini --- tests/Makefile.include| 8 +++- tests/vm/Makefile.include | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/Makefi

[PULL 01/12] tests/docker: simplify HOST_ARCH definition

2023-05-26 Thread Paolo Bonzini
ARCH is always empty, so just define HOST_ARCH as the result of uname. Acked-by: Alex Bennée Signed-off-by: Paolo Bonzini --- tests/docker/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 940

[PULL 09/12] meson: simplify logic for -Dfdt

2023-05-26 Thread Paolo Bonzini
fdt_opt == 'disabled' is going to give an error if libfdt is required by any target, so catch that immediately. For fdt_opt == 'enabled', instead, do not check immediately whether the internal libfdt is present. Instead do the check after ascertaining that libfdt is absent or too old. Reviewed-by

[PULL 10/12] meson: use subproject for internal libfdt

2023-05-26 Thread Paolo Bonzini
Recent dtc/libfdt can use either Make or meson as the build system. By using a subproject, our own meson.build can remove the hard coded list of source files. This is also the first step towards managing downloads with .wrap files instead of submodule. Reviewed-by: Daniel P. Berrangé Signed-off-

[PULL 08/12] virtio: qmp: fix memory leak

2023-05-26 Thread Paolo Bonzini
The VirtioInfoList is already allocated by QAPI_LIST_PREPEND and need not be allocated by the caller. Fixes Coverity CID 1508724. Reviewed-by: Daniel P. Berrangé Signed-off-by: Paolo Bonzini --- hw/virtio/virtio-qmp.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --gi

[PULL 00/12] (Mostly) build system patches for 2023-05-26

2023-05-26 Thread Paolo Bonzini
The following changes since commit a3cb6d5004ff638aefe686ecd540718a793bd1b1: Merge tag 'pull-tcg-20230525' of https://gitlab.com/rth7680/qemu into staging (2023-05-25 11:11:52 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fe

Re: [ANNOUNCE] KVM Microconference at LPC 2023

2023-05-26 Thread Mickaël Salaün
See James Morris's proposal here: https://lore.kernel.org/all/17f62cb1-a5de-2020-2041-359b8e96b...@linux.microsoft.com/ On 26/05/2023 04:36, James Morris wrote: > [Side topic] > > Would folks be interested in a Linux Plumbers Conference MC on this > topic generally, across different hypervisors,

[PULL 05/12] meson: Remove leftover comment

2023-05-26 Thread Paolo Bonzini
From: Fabiano Rosas Commit d2e6f9272d ("fuzz: remove fork-fuzzing scaffolding") removed the linker script and forgot to remove the comment. Signed-off-by: Fabiano Rosas Message-Id: <20230525212044.30222-2-faro...@suse.de> Signed-off-by: Paolo Bonzini --- meson.build | 2 -- 1 file changed, 2

[PULL 12/12] configure: ignore --make

2023-05-26 Thread Paolo Bonzini
Setting the MAKE variable to a GNU Make executable does not really have any effect: if a non-GNU Make is used, the QEMU Makefile will fail to parse. Just remove everything related to --make and $make as dead code. Signed-off-by: Paolo Bonzini --- configure | 18 +- meson.build

[PULL 04/12] configure: unset harmful environment variables

2023-05-26 Thread Paolo Bonzini
Apart from CLICOLOR_FORCE and GREP_OPTIONS, there are other variables that are listed in the Autoconf manual. While Autoconf neutralizes them very early, and assumes it does not (yet) run in a shell that has "unset", QEMU assumes that the user invoked configure under a POSIX shell, and therefore c

[PULL 07/12] slirp: update wrap to latest master

2023-05-26 Thread Paolo Bonzini
It is recommended to use SSIZE_T for ssize_t on win32, but the commit that is being used for slirp.wrap uses int. Update to include the fix as well as the other bugfix commit "ip: Enforce strict aliasing". Reported-by: Michael Tokarev Signed-off-by: Paolo Bonzini --- subprojects/slirp.wrap | 2

Re: [PATCH v5 10/10] accel/tcg: include cs_base in our hash calculations

2023-05-26 Thread Richard Henderson
On 5/24/23 06:39, Alex Bennée wrote: We weren't using cs_base in the hash calculations before. Since the arm front end moved a chunk of flags in a378206a20 (target/arm: Move mode specific TB flags to tb->cs_base) they comprise of an important part of the execution state. Widen the tb_hash_func t

Re: [PULL 00/15] Improve --without-default-devices testing, fix CVE-2023-0330

2023-05-26 Thread Richard Henderson
On 5/26/23 02:08, Thomas Huth wrote: The following changes since commit a3cb6d5004ff638aefe686ecd540718a793bd1b1: Merge tag 'pull-tcg-20230525' ofhttps://gitlab.com/rth7680/qemu into staging (2023-05-25 11:11:52 -0700) are available in the Git repository at: https://gitlab.com/thuth/qe

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

2023-05-26 Thread Richard Henderson
om/gaosong/qemu.git tags/pull-loongarch-20230526 for you to fetch changes up to 65bfaaae6ac79ebc623acc0ce28cc3bd4fe8b5e5: target/loongarch: Fix the vinsgr2vr/vpickve2gr instructions cause system coredump (2023-05-26 17:21:16 +0800) ---

[PATCH v2 1/6] target/riscv: Without H-mode mask all HS mode inturrupts in mie.

2023-05-26 Thread Rajnesh Kanwal
Signed-off-by: Rajnesh Kanwal --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 4451bd1263..041f0b3e2e 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -1522,7 +1522,7 @@ static RISCVException rmw_mi

<    1   2   3   >