[PATCH 0/4] hw/cxl: Line length reduction and related

2023-09-13 Thread Jonathan Cameron via
Suggested-by: Michael S. Tsirkin Michael observed that the CXL code regularly went above the 80 character recommendation and in many cases this was not necessary for readability. This series is focused on tidying this up for the existing code so that we can maintain the preferred formatting

[PATCH 1/4] hw/cxl: Use a switch to explicitly check size in caps_reg_read()

2023-09-13 Thread Jonathan Cameron via
Bring this read function inline with the others that do check for unexpected size values. Also reduces line lengths to sub 80 chars. Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-device-utils.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git

Re: [PATCH 1/3] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file

2023-09-13 Thread Eric Blake
On Wed, Sep 06, 2023 at 04:09:15PM +0200, Denis V. Lunev wrote: > We need to check that we are able to create large enough file which is > used as an export base rather than connection URL. Unfortunately, there > are cases when the TEST_IMG_FILE is not defined. We should fallback to > TEST_IMG in

[PATCH 1/4] ui/console: make qemu_console_is_multihead() static

2023-09-13 Thread Laszlo Ersek
qemu_console_is_multihead() is only called from within "ui/console.c"; make it static. Cc: "Marc-André Lureau" (odd fixer:Graphics) Cc: Gerd Hoffmann (odd fixer:Graphics) Signed-off-by: Laszlo Ersek --- include/ui/console.h | 1 - ui/console.c | 2 +- 2 files changed, 1 insertion(+),

[PATCH 4/4] ui/console: sanitize search in qemu_graphic_console_is_multihead()

2023-09-13 Thread Laszlo Ersek
qemu_graphic_console_is_multihead() declares the graphical console "c" a "multihead" console if there are two different graphical consoles in the system that (a) both reference "c->device", and (b) have different "c->head" numbers. In effect, if at least two graphical consoles exist that are

[PATCH 3/4] ui/console: eliminate QOM properties from qemu_console_is_multihead()

2023-09-13 Thread Laszlo Ersek
According to Marc-André's and Gerd's descriptions, the "device" and "head" members of QemuGraphicConsole are exposed as QOM properties for two purposes: (1) Introspection (e.g., "qom-get" monitor command). (2) A VNC server can display a specific device + head. This lets us run a multihead

[PATCH 2/4] ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead()

2023-09-13 Thread Laszlo Ersek
qemu_console_is_multihead() declares the console "c" a "multihead" console if there are two different consoles in the system that (a) both reference "c->device", and (b) have different "c->head" numbers. In effect, if at least two consoles exist that are different heads of the same device that

[PATCH 0/4] ui/console: multihead: fix crash, simplify logic

2023-09-13 Thread Laszlo Ersek
Fix a recent regression (crash) in the multihead check; clean up the code some more. Cc: "Marc-André Lureau" (odd fixer:Graphics) Cc: Gerd Hoffmann (odd fixer:Graphics) Thanks, Laszlo Laszlo Ersek (4): ui/console: make qemu_console_is_multihead() static ui/console: only walk

Re: [PATCH v1 0/2] i386/a-b-bootblock: zero the first byte of each page on start

2023-09-13 Thread Daniil Tatianin
ping 07.09.2023, 22:31, "Daniil Tatianin" :This series fixes an issue where the outcome of the migration qtestrelies on the initial memory contents all being the same across thefirst 100MiB of RAM, which is a very fragile invariant.We fix this by making sure we zero the first byte of every

[PATCH] target/hppa: Optimize ldcw/ldcd instruction translation

2023-09-13 Thread Helge Deller
ldcw (load word and clear) is the only atomic memory instruction of the hppa architecture and thus is heavily used by the Linux and HP/UX kernel to implement locks. Since ldcw always writes a zero, optimize it to not write zero again if the memory already contained zero (as the lock was already

Re: [PATCH] tests/avocado: Disable MIPS Malta tests due to GitLab issue #1884

2023-09-13 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Commit 0d58c66068 ("softmmu: Use async_run_on_cpu in tcg_commit") > introduced a regression which is only triggered by the MIPS Malta > machine. Since those tests are gatting and disturb the CI workflow, > disable them until

Re: Various changes "backportability"

2023-09-13 Thread Michael Tokarev
13.09.2023 17:27, Stefan Hajnoczi wrote: ... For example, recent tpm bugfix, which is trivial by its own, uses RETRY_ON_EINTR helper which were introduced recently and which is now used everywhere. coroutine_fn et al markers is another example, translator_io_start is yet another, and so on and

Re: [PATCH v2 11/11] tests/migration-test: Add a test for postcopy hangs during RECOVER

2023-09-13 Thread Peter Xu
On Wed, Sep 13, 2023 at 11:27:13AM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > > > +static void wait_for_postcopy_status(QTestStatus *one, const char *status) > > +{ > > QTestState *who > > > +wait_for_migration_status(from, status, > > s/from/who > > > +

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Albert Esteve
On Wed, Sep 13, 2023 at 4:18 PM Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki > wrote: > >> On 2023/09/13 21:58, Albert Esteve wrote: >> > >> > >> > On Wed, Sep 13, 2023 at 2:22 PM Akihiko Odaki > > > wrote: >> > >> > On 2023/09/13

Re: Various changes "backportability"

2023-09-13 Thread Stefan Hajnoczi
On Wed, 13 Sept 2023 at 04:13, Michael Tokarev wrote: > > [Added some more active patch reviewers to Cc] > > Hi! > > Yesterday I wrote email about picking up changes from master > for previous stable release(s). What's interesting is that > yesterday, basically in a single day, we've faced

Re: [PATCH v2 11/11] tests/migration-test: Add a test for postcopy hangs during RECOVER

2023-09-13 Thread Fabiano Rosas
Peter Xu writes: > > +static void wait_for_postcopy_status(QTestStatus *one, const char *status) > +{ QTestState *who > +wait_for_migration_status(from, status, s/from/who > + (const char * []) { "failed", "active", > +

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Albert Esteve
On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki wrote: > On 2023/09/13 21:58, Albert Esteve wrote: > > > > > > On Wed, Sep 13, 2023 at 2:22 PM Akihiko Odaki > > wrote: > > > > On 2023/09/13 20:34, Albert Esteve wrote: > > > > > > > > > On Wed,

Did Avocado assets hashing system changed?

2023-09-13 Thread Philippe Mathieu-Daudé
Hi, We are trying to figure out why old assets saved in our Avocado cache (which we populate in our various CI jobs) isn't used anymore. Trying to reproduce locally, I see for example: 2023-09-13 14:39:18,834 test L0520 INFO | START

Re: [PATCH] tests/avocado: Disable MIPS Malta tests due to GitLab issue #1884

2023-09-13 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Commit 0d58c66068 ("softmmu: Use async_run_on_cpu in tcg_commit") > introduced a regression which is only triggered by the MIPS Malta > machine. Since those tests are gatting and disturb the CI workflow, > disable them until

[PATCH 0/1] sbsa-ref: add non-secure EL2 virtual timer

2023-09-13 Thread Marcin Juszkiewicz
Armv8.1+ cpus have Virtual Host Extension (VHE) which added non-secure EL2 virtual timer. This change adds it to fullfil Arm BSA (Base System Architecture) requirements. >From firmware side information about timer needs to be present in GTDT acpi table. If it is there with suggested interrupt 28

[PATCH 1/1] sbsa-ref: add non-secure EL2 virtual timer

2023-09-13 Thread Marcin Juszkiewicz
Armv8.1+ cpus have Virtual Host Extension (VHE) which added non-secure EL2 virtual timer. This change adds it to fullfil Arm BSA (Base System Architecture) requirements. Signed-off-by: Marcin Juszkiewicz --- hw/arm/sbsa-ref.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [BUG] virtio-fs: Corruption when running binaries from virtiofsd-backed fs

2023-09-13 Thread Erik Schilling
CCing a few more people as suggested by stefanha on #qemu. On Wed Sep 13, 2023 at 8:18 AM CEST, Erik Schilling wrote: > On Fri Sep 1, 2023 at 12:37 PM CEST, Erik Schilling wrote: > > On Wed Aug 30, 2023 at 10:20 AM CEST, Erik Schilling wrote: > > > Hi all! > > > > > > Some days ago I posted to

Re: [PATCH 0/4] hw/cxl: Minor CXL emulation fixes and cleanup

2023-09-13 Thread Michael Tokarev
04.09.2023 16:28, Jonathan Cameron via wrote: A small set gathering patches that have been posted and reviewed on list over the last few months. Looking to get these upstream before making any significant changes to the CXL emulation for this cycle. More wide spread cleanup will follow later

Re: [PATCH 1/4] hw/cxl: Fix CFMW config memory leak

2023-09-13 Thread Michael Tokarev
04.09.2023 16:28, Jonathan Cameron via: From: Li Zhijian Allocate targets and targets[n] resources when all sanity checks are passed to avoid memory leaks. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Li Zhijian Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jonathan Cameron

[PATCH] tests/avocado: Disable MIPS Malta tests due to GitLab issue #1884

2023-09-13 Thread Philippe Mathieu-Daudé
Commit 0d58c66068 ("softmmu: Use async_run_on_cpu in tcg_commit") introduced a regression which is only triggered by the MIPS Malta machine. Since those tests are gatting and disturb the CI workflow, disable them until https://gitlab.com/qemu-project/qemu/-/issues/1866 is fixed. $ make

Re: [PATCH v13 0/9] rutabaga_gfx + gfxstream

2023-09-13 Thread Marc-André Lureau
Hi On Wed, Sep 13, 2023 at 5:08 AM Gurchetan Singh wrote: > On Tue, Sep 12, 2023 at 6:59 AM Marc-André Lureau > wrote: >> Packaging aemu and gfxstream is a bit problematic. I have some WIP >> Fedora packages. >> >> AEMU: >> - installs files under /usr/include/host-common and >>

Re: [PATCH 05/11] accel/tcg: Modifies memory access functions to use CPUState

2023-09-13 Thread Anton Johansson via
On 9/12/23 21:34, Richard Henderson wrote: On 9/12/23 08:34, Anton Johansson wrote: do_[ld|st]*() and mmu_lookup*() are changed to use CPUState over CPUArchState, moving the target-dependence to the target-facing facing cpu_[ld|st] functions. Signed-off-by: Anton Johansson ---  

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
On 2023/09/13 21:58, Albert Esteve wrote: On Wed, Sep 13, 2023 at 2:22 PM Akihiko Odaki > wrote: On 2023/09/13 20:34, Albert Esteve wrote: > > > On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki mailto:akihiko.od...@daynix.com> >

Re: [PATCH v2 10/11] migration: Allow RECOVER->PAUSED convertion for dest qemu

2023-09-13 Thread Fabiano Rosas
Peter Xu writes: > There's a bug on dest that if a double fault triggered on dest qemu (a > network issue during postcopy-recover), we won't set PAUSED correctly > because we assumed we always came from ACTIVE. > > Fix that by always overwriting the state to PAUSE. > > We could also check for

Re: [PATCH v2 09/11] migration: Allow network to fail even during recovery

2023-09-13 Thread Fabiano Rosas
Peter Xu writes: > Normally the postcopy recover phase should only exist for a super short > period, that's the duration when QEMU is trying to recover from an > interrupted postcopy migration, during which handshake will be carried out > for continuing the procedure with state changes from

[PATCH V2] hw/pci-bridge/cxl-upstream: Add serial number extended capability support

2023-09-13 Thread Jonathan Cameron via
Will be needed so there is a defined serial number for information queries via the Switch CCI. Signed-off-by: Jonathan Cameron --- v2: Thanks to Philippe for review. - Keep to a fixed offset for the serial number capability. If it's not present then there will be a hole which is fine

Re: [PATCH v2 02/11] migration: Let migrate_set_error() take ownership

2023-09-13 Thread Fabiano Rosas
Peter Xu writes: > migrate_set_error() used one error_copy() so it always copy an error. > However that's not the major use case - the major use case is one would > like to pass the error to migrate_set_error() without further touching the > error. > > It can be proved if we see most of the

Re: [RFC 0/7] vhost-vdpa: add support for iommufd

2023-09-13 Thread Michael S. Tsirkin
On Wed, May 03, 2023 at 05:13:30PM +0800, Cindy Lu wrote: > Hi All > There is the RFC to support the IOMMUFD in vdpa device > any comments are welcome > Thanks > Cindy Any plans to work on this or should I consider this abandoned? > Cindy Lu (7): > vhost: introduce new UAPI to support IOMMUFD

[PATCH v4 4/4] hw/cxl: Support 4 HDM decoders at all levels of topology

2023-09-13 Thread Jonathan Cameron via
Support these decoders in CXL host bridges (pxb-cxl), CXL Switch USP and CXL Type 3 end points. Signed-off-by: Jonathan Cameron --- v3: Factor out the hdm_inc changes to previous patch. Fix use of encoded hdm count as if it were decoded in cxl-host. Minor refactoring to make that path

[PATCH v4 3/4] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere

2023-09-13 Thread Jonathan Cameron via
In order to avoid having the size of the per HDM decoder register block repeated in lots of places, create the register definitions for HDM decoder 1 and use the offset between the first registers in HDM decoder 0 and HDM decoder 1 to establish the offset. Calculate in each function as this is

[PATCH v4 2/4] hw/cxl: Add utility functions decoder interleave ways and target count.

2023-09-13 Thread Jonathan Cameron via
As an encoded version of these key configuration parameters is available in a register, provide functions to extract it again so as to avoid the need for duplicating the storage. Whilst here update the _enc() function to include additional values as defined in the CXL 3.0 specification. Whilst

[PATCH v4 1/4] hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c

2023-09-13 Thread Jonathan Cameron via
There is no strong justification for keeping these in the header so push them down into the associated cxl-component-utils.c file. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_component.h |

[PATCH v4 0/4] hw/cxl: Support emulating 4 HDM decoders throughout topology

2023-09-13 Thread Jonathan Cameron via
v4: Thanks to Fan and Philippe for reviews. - Add specification reference for interleave ways encodings - Gathered tags. Note I'm sending this out quicker than I normally would because I want to post another series on top of it and the additional comment will add some fuzz for that. For

[PATCH v2] hw/cxl: Fix out of bound array access

2023-09-13 Thread Dmitry Frolov
According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up to 16. This also corresponds to CXL specs. So, the fw->target_hbs[] array is iterated from 0 to 15. But it is staticaly declared of length 8. Thus, out of bound array access may occur. Fixes: c28db9e000 ("hw/pci-bridge:

[Stable-8.0.5 03/66] async: avoid use-after-free on re-entrancy guard

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov A BH callback can free the BH, causing a use-after-free in aio_bh_call. Fix that by keeping a local copy of the re-entrancy guard pointer. Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513 Fixes: 9c86c97f12 ("async: Add an optional reentrancy guard to

[Stable-8.0.5 62/66] linux-user/riscv: Use abi type for target_ucontext

2023-09-13 Thread Michael Tokarev
From: LIU Zhiwei We should not use types dependend on host arch for target_ucontext. This bug is found when run rv32 applications. Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Message-ID:

[Stable-8.0.5 56/66] virtio: Drop out of coroutine context in virtio_load()

2023-09-13 Thread Michael Tokarev
From: Kevin Wolf virtio_load() as a whole should run in coroutine context because it reads from the migration stream and we don't want this to block. However, it calls virtio_set_features_nocheck() and devices don't expect their .set_features callback to run in a coroutine and therefore call

[Stable-8.0.5 00/66] v2 Patch Round-up for stable 8.0.5, freeze on 2023-09-19

2023-09-13 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.0.5: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.0 Patch freeze is 2023-09-19, and the release is planned for 2023-09-21: https://wiki.qemu.org/Planning/8.0 Please respond here or CC qemu-sta...@nongnu.org on any additional

[Stable-8.0.5 59/66] hw/char/riscv_htif: Fix the console syscall on big endian hosts

2023-09-13 Thread Michael Tokarev
From: Thomas Huth Values that have been read via cpu_physical_memory_read() from the guest's memory have to be swapped in case the host endianess differs from the guest. Fixes: a6e13e31d5 ("riscv_htif: Support console output via proxy syscall") Signed-off-by: Thomas Huth Reviewed-by: Alistair

[Stable-8.0.5 61/66] hw/intc: Make rtc variable names consistent

2023-09-13 Thread Michael Tokarev
From: Jason Chien The variables whose values are given by cpu_riscv_read_rtc() should be named "rtc". The variables whose value are given by cpu_riscv_read_rtc_raw() should be named "rtc_r". Signed-off-by: Jason Chien Reviewed-by: Alistair Francis Message-ID:

[Stable-8.0.5 66/66] hw/tpm: TIS on sysbus: Remove unsupport ppi command line option

2023-09-13 Thread Michael Tokarev
From: Stefan Berger The ppi command line option for the TIS device on sysbus never worked and caused an immediate segfault. Remove support for it since it also needs support in the firmware and needs testing inside the VM. Reproducer with the ppi=on option passed: qemu-system-aarch64 \

[Stable-8.0.5 07/66] lsi53c895a: disable reentrancy detection for MMIO region, too

2023-09-13 Thread Michael Tokarev
From: Thomas Huth While trying to use a SCSI disk on the LSI controller with an older version of Fedora (25), I'm getting: qemu: warning: Blocked re-entrant IO on MemoryRegion: lsi-mmio at addr: 0x34 and the SCSI controller is not usable. Seems like we have to disable the reentrancy checker

[Stable-8.0.5 58/66] hw/char/riscv_htif: Fix printing of console characters on big endian hosts

2023-09-13 Thread Michael Tokarev
From: Thomas Huth The character that should be printed is stored in the 64 bit "payload" variable. The code currently tries to print it by taking the address of the variable and passing this pointer to qemu_chr_fe_write(). However, this only works on little endian hosts where the least

[Stable-8.0.5 60/66] hw/intc: Fix upper/lower mtime write calculation

2023-09-13 Thread Michael Tokarev
From: Jason Chien When writing the upper mtime, we should keep the original lower mtime whose value is given by cpu_riscv_read_rtc() instead of cpu_riscv_read_rtc_raw(). The same logic applies to writes to lower mtime. Signed-off-by: Jason Chien Reviewed-by: Alistair Francis Message-ID:

[Stable-8.0.5 11/66] loongarch: mark loongarch_ipi_iocsr re-entrnacy safe

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov loongarch_ipi_iocsr MRs rely on re-entrant IO through the ipi_send function. As such, mark these MRs re-entrancy-safe. Fixes: a2e1753b80 ("memory: prevent dma-reentracy issues") Signed-off-by: Alexander Bulekov Reviewed-by: Song Gao Message-Id:

[Stable-8.0.5 64/66] target/riscv: fix satp_mode_finalize() when satp_mode.supported = 0

2023-09-13 Thread Michael Tokarev
From: Daniel Henrique Barboza In the same emulated RISC-V host, the 'host' KVM CPU takes 4 times longer to boot than the 'rv64' KVM CPU. The reason is an unintended behavior of riscv_cpu_satp_mode_finalize() when satp_mode.supported = 0, i.e. when cpu_init() does not set

[Stable-8.0.5 65/66] target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes

2023-09-13 Thread Michael Tokarev
From: Leon Schuermann When the rule-lock bypass (RLB) bit is set in the mseccfg CSR, the PMP configuration lock bits must not apply. While this behavior is implemented for the pmpcfgX CSRs, this bit is not respected for changes to the pmpaddrX CSRs. This patch ensures that pmpaddrX CSR writes

[Stable-8.0.5 08/66] bcm2835_property: disable reentrancy detection for iomem

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov As the code is designed for re-entrant calls from bcm2835_property to bcm2835_mbox and back into bcm2835_property, mark iomem as reentrancy-safe. Signed-off-by: Alexander Bulekov Reviewed-by: Thomas Huth Message-Id: <20230427211013.2994127-7-alx...@bu.edu>

[Stable-8.0.5 09/66] raven: disable reentrancy detection for iomem

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov As the code is designed for re-entrant calls from raven_io_ops to pci-conf, mark raven_io_ops as reentrancy-safe. Signed-off-by: Alexander Bulekov Message-Id: <20230427211013.2994127-8-alx...@bu.edu> Signed-off-by: Thomas Huth (cherry picked from commit

[Stable-8.0.5 05/66] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov This protects devices from bh->mmio reentrancy issues. Thanks: Thomas Huth for diagnosing OS X test failure. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Reviewed-by: Paul Durrant

[Stable-8.0.5 63/66] hw/riscv: virt: Fix riscv,pmu DT node path

2023-09-13 Thread Michael Tokarev
From: Conor Dooley On a dtb dumped from the virt machine, dt-validate complains: soc: pmu: {'riscv,event-to-mhpmcounters': [[1, 1, 524281], [2, 2, 524284], [65561, 65561, 524280], [65563, 65563, 524280], [65569, 65569, 524280]], 'compatible': ['riscv,pmu']} should not be valid under {'type':

[Stable-8.0.5 04/66] checkpatch: add qemu_bh_new/aio_bh_new checks

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov Advise authors to use the _guarded versions of the APIs, instead. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Message-Id: <20230427211013.2994127-4-alx...@bu.edu> Signed-off-by: Thomas Huth (cherry picked from commit

[Stable-8.0.5 57/66] arm64: Restore trapless ptimer access

2023-09-13 Thread Michael Tokarev
From: Colton Lewis Due to recent KVM changes, QEMU is setting a ptimer offset resulting in unintended trap and emulate access and a consequent performance hit. Filter out the PTIMER_CNT register to restore trapless ptimer access. Quoting Andrew Jones: Simply reading the CNT register and

[Stable-8.0.5 12/66] pnv_lpc: disable reentrancy detection for lpc-hc

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov As lpc-hc is designed for re-entrant calls from xscom, mark it re-entrancy safe. Reported-by: Thomas Huth Signed-off-by: Alexander Bulekov [clg: mark opb_master_regs as re-entrancy safe also ] Signed-off-by: Cédric Le Goater Reviewed-by: Frederic Barrat Tested-by:

[Stable-8.0.5 06/66] lsi53c895a: disable reentrancy detection for script RAM

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov As the code is designed to use the memory APIs to access the script ram, disable reentrancy checks for the pseudo-RAM ram_io MemoryRegion. In the future, ram_io may be converted from an IO to a proper RAM MemoryRegion. Reported-by: Fiona Ebner Signed-off-by: Alexander

[Stable-8.0.5 10/66] apic: disable reentrancy detection for apic-msi

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov As the code is designed for re-entrant calls to apic-msi, mark apic-msi as reentrancy-safe. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Message-Id: <20230427211013.2994127-9-alx...@bu.edu> Signed-off-by: Thomas Huth (cherry picked from commit

[Stable-8.0.5 01/66] memory: prevent dma-reentracy issues

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. This flag is set/checked prior to calling a device's MemoryRegion handlers, and set when device code initiates DMA. The purpose of this flag is to prevent two types of DMA-based reentrancy issues:

[Stable-8.0.5 02/66] async: Add an optional reentrancy guard to the BH API

2023-09-13 Thread Michael Tokarev
From: Alexander Bulekov Devices can pass their MemoryReentrancyGuard (from their DeviceState), when creating new BHes. Then, the async API will toggle the guard before/after calling the BH call-back. This prevents bh->mmio reentrancy issues. Signed-off-by: Alexander Bulekov Reviewed-by: Darren

Re: [PATCH V5 0/2] migration file URI

2023-09-13 Thread Claudio Fontana
Hi, this is the first step towards faster migration to disk that we care about the most, can it be merged? Thanks, Claudio On 9/8/23 16:22, Steve Sistare wrote: > Add the migration URI "file:filename[,offset=offset]". > > Fabiano Rosas has submitted the unit tests in the series >

Re: [PATCH v3 21/23] bsd-user: Implement shmctl(2)

2023-09-13 Thread Karim Taha
Karim Taha wrote: This mistakenly has a `Reviewed-by` line, this is from v2 of the series when I thought the implementation was correct, before you replied to me on v1 series thread that IPC_SET does not need the VERIFY_WRITE, I'm writing this so you know why I will remove it in v4. > From:

Re: [PATCH v2 04/12] virtio-iommu: Rename reserved_regions into prop_resv_regions

2023-09-13 Thread Cédric Le Goater
On 9/13/23 10:01, Eric Auger wrote: Rename VirtIOIOMMU (nb_)reserved_regions fields with the "prop_" prefix to highlight those fields are set through a property, at machine level. They are IOMMU wide. A subsequent patch will introduce per IOMMUDevice reserved regions that will include both

Re: [PATCH V4 0/2] migration file URI

2023-09-13 Thread Claudio Fontana
On 8/30/23 15:09, Claudio Fontana wrote: > On 8/22/23 15:25, Philippe Mathieu-Daudé wrote: >> Hi Claudio, >> >> On 22/8/23 14:00, Claudio Fontana wrote: >>> Hello, >>> >>> this series is all reviewed, >>> >>> and is needed as a precondition for further work to improve dramatically >>> the

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Albert Esteve
On Wed, Sep 13, 2023 at 2:22 PM Akihiko Odaki wrote: > On 2023/09/13 20:34, Albert Esteve wrote: > > > > > > On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki > > wrote: > > > > On 2023/09/13 16:55, Albert Esteve wrote: > > > Hi Antonio, > > > > >

Re: [PATCH qemu 2/2] dump: Only use the makedumpfile flattened format when necessary

2023-09-13 Thread Stephen Brennan
Marc-André Lureau writes: > Hi > > On Wed, Aug 23, 2023 at 2:03 PM Marc-André Lureau > wrote: >> >> Hi >> >> On Wed, Aug 23, 2023 at 4:31 AM Stephen Brennan >> wrote: >> > >> > Stephen Brennan writes: >> > > Marc-André Lureau writes: >> > >> I am a bit reluctant to change the dump format by

Re: [PATCH qemu 2/2] dump: Only use the makedumpfile flattened format when necessary

2023-09-13 Thread Stephen Brennan
Daniel P. Berrangé writes: > On Tue, Sep 12, 2023 at 10:34:04AM +0400, Marc-André Lureau wrote: >> Hi >> >> On Wed, Aug 23, 2023 at 2:03 PM Marc-André Lureau >> wrote: >> > >> > Hi >> > >> > On Wed, Aug 23, 2023 at 4:31 AM Stephen Brennan >> > wrote: >> > > >> > > Stephen Brennan writes: >> >

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-13 Thread Cédric Le Goater
On 9/13/23 10:01, Eric Auger wrote: Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE capability is supported. This allows to propagate the information though the IOMMU MR set_iova_ranges() callback so that virtual IOMMUs get aware of those aperture constraints.

[PULL v3 0/1] Merge tpm 2023/09/12 v3

2023-09-13 Thread Stefan Berger
Hello! This PR contains a fix for the case where the TPM file descriptor is >= 1024 and the select() call cannot be used. It also avoids unnecessary errors due to EINTR being returned from the syscall. Regards, Stefan The following changes since commit

[PULL v3 1/1] tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

2023-09-13 Thread Stefan Berger
From: Marc-André Lureau Replace select() with poll() to fix a crash when QEMU has a large number of FDs. Also use RETRY_ON_EINTR to avoid unnecessary errors due to EINTR. Cc: qemu-sta...@nongnu.org Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133 Fixes: 56a3c24ffc ("tpm: Probe for

Re: [PULL v2 0/1] Merge tpm 2023/09/12 v2

2023-09-13 Thread Stefan Berger
On 9/13/23 08:27, Philippe Mathieu-Daudé wrote: Hi Stefan, On 13/9/23 13:54, Stefan Berger wrote: Hello!    This PR contains a fix for the case where the TPM file descriptor is >= 1024 and the select() call cannot be used. It also avoids unnecessary errors due to EINTR being returned

Re: [PATCH v2] virtio: add VIRTQUEUE_ERROR QAPI event

2023-09-13 Thread Denis Plotnikov
Reviewed-by: Denis Plotnikov On 9/12/23 20:57, Vladimir Sementsov-Ogievskiy wrote: For now we only log the vhost device error, when virtqueue is actually stopped. Let's add a QAPI event, which makes possible: - collect statistics of such errors - make immediate actions: take core dumps or

Re: [PATCH v2 01/12] memory: Let ReservedRegion use Range

2023-09-13 Thread Cédric Le Goater
On 9/13/23 10:01, Eric Auger wrote: A reserved region is a range tagged with a type. Let's directly use the Range type in the prospect to reuse some of the library helpers shipped with the Range type. Signed-off-by: Eric Auger Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 02/12] memory: Introduce memory_region_iommu_set_iova_ranges

2023-09-13 Thread Cédric Le Goater
On 9/13/23 10:01, Eric Auger wrote: This helper will allow to convey information about valid IOVA ranges to virtual IOMMUS. Signed-off-by: Eric Auger Reviewed-by: Cédric Le Goater Thanks, C. --- include/exec/memory.h | 26 ++ softmmu/memory.c | 15

[PATCH] vdpa net: zero vhost_vdpa iova_tree pointer at cleanup

2023-09-13 Thread Eugenio Pérez
Not zeroing it causes a SIGSEGV if the live migration is cancelled, at net device restart. This is caused because CVQ tries to reuse the iova_tree that is present in the first vhost_vdpa device at the end of vhost_vdpa_net_cvq_start. As a consequence, it tries to access an iova_tree that has been

Re: [PULL v2 0/1] Merge tpm 2023/09/12 v2

2023-09-13 Thread Philippe Mathieu-Daudé
Hi Stefan, On 13/9/23 13:54, Stefan Berger wrote: Hello! This PR contains a fix for the case where the TPM file descriptor is >= 1024 and the select() call cannot be used. It also avoids unnecessary errors due to EINTR being returned from the syscall. Regards, Stefan The following

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Akihiko Odaki
On 2023/09/13 20:34, Albert Esteve wrote: On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki > wrote: On 2023/09/13 16:55, Albert Esteve wrote: > Hi Antonio, > > If I'm not mistaken, this patch is related with: >

Re: [PATCH v10 17/45] hw/cxl/device: Add a memory device (8.2.8.5)

2023-09-13 Thread Philippe Mathieu-Daudé
Hi Ben, Jonathan, On 29/4/22 16:40, Jonathan Cameron via wrote: From: Ben Widawsky A CXL memory device (AKA Type 3) is a CXL component that contains some combination of volatile and persistent memory. It also implements the previously defined mailbox interface as well as the memory device

[PULL 1/4] meson: Fix targetos match for illumos and Solaris.

2023-09-13 Thread Paolo Bonzini
From: Jonathan Perkin qemu 8.1.0 breaks on illumos platforms due to _XOPEN_SOURCE and others no longer being set correctly, leading to breakage such as: https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20230908.1404/qemu-8.1.0/build.log This is a result of meson conversion

[PULL 4/4] target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()

2023-09-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé x86_cpu_get_supported_cpuid() is generic and handles the different accelerators. Use it instead of kvm_arch_get_supported_cpuid(). That fixes a link failure introduced by commit 3adce820cf ("target/i386: Remove unused KVM stubs") when QEMU is configured as: $

[PULL 2/4] target/i386: Check kvm_hyperv_expand_features() return value

2023-09-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé In case more code is added after the kvm_hyperv_expand_features() call, check its return value (since it can fail). Fixes: 071ce4b03b ("i386: expand Hyper-V features during CPU feature expansion time") Signed-off-by: Philippe Mathieu-Daudé Message-ID:

[PULL 0/4] Build fix patches for 2023-09-13

2023-09-13 Thread Paolo Bonzini
The following changes since commit 9ef497755afc252fb8e060c9ea6b0987abfd20b6: Merge tag 'pull-vfio-20230911' of https://github.com/legoater/qemu into staging (2023-09-11 09:13:08 -0400) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

[PULL 3/4] target/i386: Drop accel_uses_host_cpuid before x86_cpu_get_supported_cpuid

2023-09-13 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé x86_cpu_get_supported_cpuid() already checks for KVM/HVF accelerators, so it is not needed to manually check it via a call to accel_uses_host_cpuid() before calling it. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé Message-ID:

Re: [PULL v2 1/1] tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

2023-09-13 Thread Michael Tokarev
13.09.2023 14:54, Stefan Berger: Signed-off-by: Marc-Andr޸ Lureau It looks like this UTF8 glitch is within the commit itself, since https://github.com/stefanberger/qemu-tpm/commit/07160c57e47ce38bd256af3eae0481543fb52626 is also displayed wrongly but the page itself is in UTF8. /mjt

[PATCH] hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel

2023-09-13 Thread Fabian Vogt
Just like d7ef5e16a17c sets SCR_EL3.HXEn for FEAT_HCX, this commit handles SCR_EL3.FGTEn for FEAT_FGT: When we direct boot a kernel on a CPU which emulates EL3, we need to set up the EL3 system registers as the Linux kernel documentation specifies:

Re: [PATCH v11 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-13 Thread Bernhard Beschow
Am 23. August 2023 01:25:38 UTC schrieb Gurchetan Singh : >This adds initial support for gfxstream and cross-domain. Both >features rely on virtio-gpu blob resources and context types, which >are also implemented in this patch. > >gfxstream has a long and illustrious history in Android

[PULL v2 1/1] tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

2023-09-13 Thread Stefan Berger
From: Marc-Andr޸ Lureau Replace select() with poll() to fix a crash when QEMU has a large number of FDs. Also use RETRY_ON_EINTR to avoid unnecessary errors due to EINTR. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133 Cc: qemu-sta...@nongnu.org Fixes: 56a3c24ffc ("tpm: Probe for

[PULL v2 0/1] Merge tpm 2023/09/12 v2

2023-09-13 Thread Stefan Berger
Hello! This PR contains a fix for the case where the TPM file descriptor is >= 1024 and the select() call cannot be used. It also avoids unnecessary errors due to EINTR being returned from the syscall. Regards, Stefan The following changes since commit

Re: [RFC 0/3] qmp: make qmp_device_add() a coroutine

2023-09-13 Thread Paolo Bonzini
On Tue, Sep 12, 2023 at 7:08 PM Kevin Wolf wrote: > > Any caller of qmp_dispatch() knows if it is in a coroutine or not. > > qemu-ga uses neither a coroutine dispatcher nor coroutine commands. > > QEMU uses non-coroutine dispatch for out-of-band commands (and we can > > forbid coroutine +

Re: [PATCH] hw/cxl: Fix out of bound array access

2023-09-13 Thread Philippe Mathieu-Daudé
Hi Dmitry, On 13/9/23 12:10, Dmitry Frolov wrote: According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up to 16. This also corresponds to CXL specs. So, the fw->target_hbs[] array is iterated from 0 to 15. But it is staticaly declared of length 8. "statically" Thus, out

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-13 Thread Albert Esteve
On Wed, Sep 13, 2023 at 12:34 PM Akihiko Odaki wrote: > On 2023/09/13 16:55, Albert Esteve wrote: > > Hi Antonio, > > > > If I'm not mistaken, this patch is related with: > > https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg01853.html > >

Re: [PATCH v2] hw/i386/pc: fix code comment on cumulative flash size

2023-09-13 Thread Laszlo Ersek
On 9/12/23 18:40, Philippe Mathieu-Daudé wrote: > On 12/9/23 17:55, Laszlo Ersek wrote: >> - The comment is incorrectly indented / formatted. >> >> - The comment states a 8MB limit, even though the code enforces a 16MB >>    limit. >> >> Both of these warts come from commit 0657c657eb37

Re: [PATCH] hw/cxl: Fix out of bound array access

2023-09-13 Thread Jonathan Cameron via
On Wed, 13 Sep 2023 13:10:56 +0300 Dmitry Frolov wrote: > According to cxl_interleave_ways_enc(), > fw->num_targets is allowed to be up to 16. > This also corresponds to CXL specs. > So, the fw->target_hbs[] array is iterated from 0 to 15. > But it is staticaly declared of length 8. > Thus, out

Re: [PATCH v5 3/6] target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()

2023-09-13 Thread Philippe Mathieu-Daudé
On 13/9/23 12:59, Michael Tokarev wrote: 13.09.2023 12:30, Philippe Mathieu-Daudé: x86_cpu_get_supported_cpuid() is generic and handles the different accelerators. Use it instead of kvm_arch_get_supported_cpuid(). That fixes a link failure introduced by commit 3adce820cf ("target/i386: Remove

Re: [PATCH v5 3/6] target/i386: Call accel-agnostic x86_cpu_get_supported_cpuid()

2023-09-13 Thread Michael Tokarev
13.09.2023 12:30, Philippe Mathieu-Daudé: x86_cpu_get_supported_cpuid() is generic and handles the different accelerators. Use it instead of kvm_arch_get_supported_cpuid(). That fixes a link failure introduced by commit 3adce820cf ("target/i386: Remove unused KVM stubs") when QEMU is configured

[PATCH 00/10] TriCore tests and cleanups

2023-09-13 Thread Bastian Koppelmann
Hi, this series adds a test for many of the arithmetic instructions of the TriCore. The goal here is that each TriCore instruction is eventually at least run once in CI. While at this, I also cleaned up cpu.h, which contained a copy of the core special function registers (CSFR). These are

[PATCH 10/10] target/tricore: Change effective address (ea) to target_ulong

2023-09-13 Thread Bastian Koppelmann
as this is an effective address and those cannot be signed, it should not be a signed integed. Signed-off-by: Bastian Koppelmann --- target/tricore/op_helper.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/tricore/op_helper.c

<    1   2   3   4   >