[PATCH v3 06/16] monitor: Introduce monitor_fdset_*free

2024-06-17 Thread Fabiano Rosas
Introduce new functions to remove and free no longer used fds and fdsets. We need those to decouple the remove/free routines from monitor_fdset_cleanup() which will go away in the next patches. The new functions: - monitor_fdset_free/_if_empty() will be used when a monitor connection closes an

Re: [PULL v2 00/19] aspeed queue

2024-06-17 Thread Richard Henderson
https://github.com/legoater/qemu/ tags/pull-aspeed-20240617 for you to fetch changes up to 5f44521242d2fdfa190206a6be40577a58a71ef9: MAINTAINERS: Add reviewers for ASPEED BMCs (2024-06-16 21:08:54 +0200) aspeed queue: * Add AST27

Re: [PATCH v2] os-posix: Expand setrlimit() syscall compatibility

2024-06-17 Thread Richard Henderson
On 6/17/24 08:15, Philippe Mathieu-Daudé wrote: On 17/6/24 15:07, Michael Tokarev wrote: 17.06.2024 10:19, Philippe Mathieu-Daudé wrote: Hi Trent, On 14/6/24 23:06, Trent Huber wrote: Darwin uses a subtly different version of the setrlimit() syscall as described in the COMPATIBILITY section o

[PATCH v2 04/10] migration: Cleanup incoming migration setup state change

2024-06-17 Thread Peter Xu
Destination QEMU can setup incoming ports for two purposes: either a fresh new incoming migration, in which QEMU will switch to SETUP for channel establishment, or a paused postcopy migration, in which QEMU will stay in POSTCOPY_PAUSED until kicking off the RECOVER phase. Now the state machine wor

[PATCH v2 07/10] tests/migration-tests: Drop most WIN32 ifdefs for postcopy failure tests

2024-06-17 Thread Peter Xu
Most of them are not needed, we can stick with one ifdef inside postcopy_recover_fail() so as to cover the scm right tricks only. The tests won't run on windows anyway due to has_uffd always false. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 10 ++ 1 file changed, 2 insert

[PATCH v2 10/10] tests/migration-tests: Cover postcopy failure on reconnect

2024-06-17 Thread Peter Xu
Make sure there will be an event for postcopy recovery, irrelevant of whether the reconnect will success, or when the failure happens. The added new case is to fail early in postcopy recovery, in which case it didn't even reach RECOVER stage on src (and in real life it'll be the same to dest, but

[PATCH v2 05/10] migration/postcopy: Add postcopy-recover-setup phase

2024-06-17 Thread Peter Xu
This patch adds a migration state on src called "postcopy-recover-setup". The new state will describe the intermediate step starting from when the src QEMU received a postcopy recovery request, until the migration channels are properly established, but before the recovery process take place. The r

[PATCH v2 03/10] migration: Use MigrationStatus instead of int

2024-06-17 Thread Peter Xu
QEMU uses "int" in most cases even if it stores MigrationStatus. I don't know why, so let's try to do that right and see what blows up.. Signed-off-by: Peter Xu --- migration/migration.h | 9 + migration/migration.c | 24 +++- 2 files changed, 12 insertions(+), 21 d

[PATCH v2 02/10] migration: Rename thread debug names

2024-06-17 Thread Peter Xu
The postcopy thread names on dest QEMU are slightly confusing, partly I'll need to blame myself on 36f62f11e4 ("migration: Postcopy preemption preparation on channel creation"). E.g., "fault-fast" reads like a fast version of "fault-default", but it's actually the fast version of "postcopy/listen"

[PATCH v2 08/10] tests/migration-tests: Always enable migration events

2024-06-17 Thread Peter Xu
Libvirt should always enable it, so it'll be nice qtest also cover that for all tests. Though this patch only enables it, no extra tests are done on these events yet. Signed-off-by: Peter Xu --- tests/qtest/migration-test.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/

[PATCH v2 01/10] migration/multifd: Avoid the final FLUSH in complete()

2024-06-17 Thread Peter Xu
We always do the flush when finishing one round of scan, and during complete() phase we should scan one more round making sure no dirty page existed. In that case we shouldn't need one explicit FLUSH at the end of complete(), as when reaching there all pages should have been flushed. Reviewed-by:

[PATCH v2 09/10] tests/migration-tests: Verify postcopy-recover-setup status

2024-06-17 Thread Peter Xu
Making sure the postcopy-recover-setup status is present in the postcopy failure unit test. Note that it only applies to src QEMU not dest. This also introduces the tiny but helpful migration_event_wait() helper. Signed-off-by: Peter Xu --- tests/qtest/migration-helpers.h | 2 ++ tests/qtest/

[PATCH v2 00/10] migration: New postcopy state, and some cleanups

2024-06-17 Thread Peter Xu
v2: - Collect tags - Patch 3 - cover all states in migration_postcopy_is_alive() - Patch 4 (old) - English changes [Fabiano] - Split the migration_incoming_state_setup() cleanup into a new patch [Fabiano] - Drop RECOVER_SETUP in fill_destination_migration_info() [Fabiano] - Keep using

[PATCH v2 06/10] migration/docs: Update postcopy recover session for SETUP phase

2024-06-17 Thread Peter Xu
Firstly, the "Paused" state was added in the wrong place before. The state machine section was describing PostcopyState, rather than MigrationStatus. Drop the Paused state descriptions. Then in the postcopy recover session, add more information on the state machine for MigrationStatus in the lines

Re: [PATCH] target/loongarch: Remove avail_64 in trans_srai_w()

2024-06-17 Thread Richard Henderson
On 6/17/24 06:07, Feiyang Chen wrote: Since srai.w is a valid instruction on la32, simply remove the avail_64 check. Fixes: c0c0461e3a06 ("target/loongarch: Add avail_64 to check la64-only instructions") Signed-off-by: Feiyang Chen --- target/loongarch/tcg/insn_trans/trans_shift.c.inc | 4 --

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-17 Thread Richard Henderson
On 6/17/24 04:51, Chinmay Rath wrote: Hi Richard, On 6/17/24 00:43, Richard Henderson wrote: On 6/13/24 02:33, Chinmay Rath wrote: +/* EA <- (ra == 0) ? 0 : GPR[ra] */ +static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) +{ +    TCGv EA; +    if (!ra) { +    EA = tcg_constant_tl(0); +   

Re: [PATCH 18/20] qapi: ensure all errors sections are uniformly typset

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 7:24 AM Markus Armbruster wrote: > John Snow writes: > > > Transactions have the only instance of an Errors section that isn't a > > rST list; turn it into one. > > Just for consistency? Or do you have other shenanigans up your sleeve? > Just consistency at this precise m

Re: [PATCH 14/20] qapi: fix non-compliant JSON examples

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 6:55 AM Markus Armbruster wrote: > John Snow writes: > > > If we parse all examples as QMP, we need them to conform to a standard > > so that they render correctly. Once the QMP lexer is active for > > examples, these will produce warning messages and fail the build. > > >

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-17 Thread Richard Henderson
On 6/17/24 03:40, Chinmay Rath wrote: static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) {     TCGv EA;     if (!ra) {         return tcg_constant_tl(0);     }     if (NARROW_MODE(ctx)) {         EA = tcg_temp_new();         tcg_gen_ext32u_tl(EA, cpu_gpr[ra]);     } else {         retu

Re: [PATCH 13/20] docs/qapidoc: fix nested parsing under untagged sections

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 5:46 AM Markus Armbruster wrote: > John Snow writes: > > > Sphinx does not like sections without titles, because it wants to > > convert every section into a reference. When there is no title, it > > struggles to do this and transforms the tree inproperly. > > > > Depending

Re: [PATCH v7 00/17] Add a host IOMMU device abstraction to check with vIOMMU

2024-06-17 Thread Cédric Le Goater
Hello Michael, On 6/5/24 10:30 AM, Zhenzhong Duan wrote: Hi, This series introduce a HostIOMMUDevice abstraction and sub-classes. Also HostIOMMUDeviceCaps structure in HostIOMMUDevice and a new interface between vIOMMU and HostIOMMUDevice. A HostIOMMUDevice is an abstraction for an assigned de

Re: [PATCH 11/20] qapi/schema: add doc_visible property to QAPISchemaDefinition

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024, 5:40 AM Markus Armbruster wrote: > John Snow writes: > > > The intent here is to mark only certain definitions as visible in the > > end-user docs. > > > > All commands and events are inherently visible. Everything else is > > visible only if it is a member (or a branch mem

[PATCH v4 4/5] hw/ppc: SPI controller wiring to P10 chip

2024-06-17 Thread Chalapathi V
In this commit, create SPI controller on p10 chip and connect cs irq. The QOM tree of pnv-spi and seeprom are. /machine (powernv10-machine) /chip[0] (power10_v2.0-pnv-chip) /pib_spic[2] (pnv-spi) /pnv-spi-bus.2 (SSI) /xscom-spi-regs[0] (memory-region) /machine (powernv10-machine

[PATCH v4 1/5] ppc/pnv: Add SPI model

2024-06-17 Thread Chalapathi V
SPI controller device model supports a connection to a single SPI responder. This provide access to SPI seeproms, TPM, flash device and an ADC controller. All SPI function control is mapped into the SPI register space to enable full control by firmware. In this commit SPI configuration component i

[PATCH v4 5/5] tests/qtest: Add pnv-spi-seeprom qtest

2024-06-17 Thread Chalapathi V
In this commit Write a qtest pnv-spi-seeprom-test to check the SPI transactions between spi controller and seeprom device. Signed-off-by: Chalapathi V --- tests/qtest/pnv-spi-seeprom-test.c | 110 + tests/qtest/meson.build| 1 + 2 files changed, 111 inse

[PATCH v4 0/5] hw/ppc: SPI model

2024-06-17 Thread Chalapathi V
Hello, Thank You so much for reviewing patch v3. In patch v4, - Renamed hw/ppc/pnv_spi_controller.c to /hw/ssi/pnv_spi.c - To improve the readability register/field names is shortened. - SPI registers are put in array to simplify read/write method. - In seeprom qtest generated the tmp_image to te

[PATCH v4 3/5] hw/block: Add Microchip's 25CSM04 to m25p80

2024-06-17 Thread Chalapathi V
Add Microchip's 25CSM04 Serial EEPROM to m25p80. 25CSM04 provides 4 Mbits of Serial EEPROM utilizing the Serial Peripheral Interface (SPI) compatible bus. The device is organized as 524288 bytes of 8 bits each (512Kbyte) and is optimized for use in consumer and industrial applications where reliab

[PATCH v4 2/5] ppc/pnv: Extend SPI model

2024-06-17 Thread Chalapathi V
In this commit SPI shift engine and sequencer logic is implemented. Shift engine performs serialization and de-serialization according to the control by the sequencer and according to the setup defined in the configuration registers. Sequencer implements the main control logic and FSM to handle dat

Re: [PATCH 09/20] qapi/parser: add undocumented stub members to all_sections

2024-06-17 Thread John Snow
On Fri, Jun 14, 2024 at 4:53 AM Markus Armbruster wrote: > John Snow writes: > > > This helps simplify the doc generator if it doesn't have to check for > > undocumented members. > > > > Signed-off-by: John Snow > > --- > > scripts/qapi/parser.py | 20 ++-- > > 1 file changed,

Re: [PATCH] hw/arm/virt-acpi-build: Fix IORT id_count

2024-06-17 Thread Nicolin Chen
On Mon, Jun 17, 2024 at 06:41:55AM -0400, Michael S. Tsirkin wrote: > On Thu, Jun 13, 2024 at 04:48:02PM -0700, Nicolin Chen wrote: > > The IORT doc defines "Number of IDs" ("id_count" in the virt-acpi-build) > > to be "the number of IDs in the range minus one". Otherwise, Linux kernel > > reports

Re: [PATCH 01/18] tcg/loongarch64: Import LASX, FP insns

2024-06-17 Thread Richard Henderson
On 6/17/24 00:57, gaosong wrote: 在 2024/5/28 上午5:18, Richard Henderson 写道: Signed-off-by: Richard Henderson ---   tcg/loongarch64/tcg-insn-defs.c.inc | 6181 +--   1 file changed, 2123 insertions(+), 4058 deletions(-) diff --git a/tcg/loongarch64/tcg-insn-defs.c.inc b/t

Re: [PATCH] tap: use close_range() when forking scripts and helper

2024-06-17 Thread Daniel P . Berrangé
On Mon, Jun 17, 2024 at 06:25:18PM +0200, Clément Léger wrote: > Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on > POSIX"), the maximum number of file descriptors that can be opened are > raised to nofile.rlim_max. On recent debian distro, this yield a maximum > of 1073741816 f

Re: [PATCH] tap: use close_range() when forking scripts and helper

2024-06-17 Thread Clément Léger
On 17/06/2024 18:36, Peter Maydell wrote: > On Mon, 17 Jun 2024 at 17:25, Clément Léger wrote: >> >> Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on >> POSIX"), the maximum number of file descriptors that can be opened are >> raised to nofile.rlim_max. On recent debian dist

Re: [PATCH] tap: use close_range() when forking scripts and helper

2024-06-17 Thread Peter Maydell
On Mon, 17 Jun 2024 at 17:25, Clément Léger wrote: > > Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on > POSIX"), the maximum number of file descriptors that can be opened are > raised to nofile.rlim_max. On recent debian distro, this yield a maximum > of 1073741816 file descr

[PATCH] tap: use close_range() when forking scripts and helper

2024-06-17 Thread Clément Léger
Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on POSIX"), the maximum number of file descriptors that can be opened are raised to nofile.rlim_max. On recent debian distro, this yield a maximum of 1073741816 file descriptors. Now, when forking to start qemu-bridge-helper, this ac

Re: [PATCH v2 00/17] vfio: QOMify VFIOContainer

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: > Hello, > > The series starts with simple changes (patch 1-4). Two of which were > initially sent by Joao in a series adding VFIO migration support with > vIOMMU [1]. > > The changes following prepare VFIOContainer for QOMification, switch > th

[PATCH 1/3] target/i386: Introduce x86_mmu_index_{kernel_,}pl

2024-06-17 Thread Richard Henderson
Disconnect mmu index computation from the current pl as stored in env->hflags. Signed-off-by: Richard Henderson --- target/i386/cpu.h | 12 +++- target/i386/cpu.c | 27 --- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/target/i386/cpu.h b/target

[RFC PATCH 0/3] target/i386: Reorg push/pop within seg_helper.c

2024-06-17 Thread Richard Henderson
Hi Paolo, Thanks for offering to do the work to fix the memory access issues identified by Robert. Here is a code dump from this weekend that I noodled with -- it is prep work only, not intending to change any semantics, but it may be helpful in finishing the work. I considered adding a MemOp me

[PATCH 3/3] target/i386: Reorg push/pop within seg_helper.c

2024-06-17 Thread Richard Henderson
Use a structure to contain the stack parameters, env, unwind return address, and mmu index. Rewrite the macros into functions. Signed-off-by: Richard Henderson --- target/i386/tcg/seg_helper.c | 465 +++ 1 file changed, 253 insertions(+), 212 deletions(-) diff --

[PATCH 2/3] target/i386: Remove SEG_ADDL

2024-06-17 Thread Richard Henderson
This truncation is now handled by MMU_*32_IDX, which is how this was working for PUSHW/POPW, which did not use SEG_ADDL. Signed-off-by: Richard Henderson --- target/i386/tcg/seg_helper.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/i386/tcg/seg_helper.c b/ta

[PULL 0/1] Dirty page rate and dirty page limit 20240617 patches

2024-06-17 Thread Hyman Huang
dirtylimit-dirtyrate-pull-request-20240617 for you to fetch changes up to e65152d5483b2c847ec7a947ed52650152cfdcc0: migration/dirtyrate: Fix segmentation fault (2024-06-17 23:29:21 +0800) dirtylimit-dirtyrate-pull-request-20240

[PULL 1/1] migration/dirtyrate: Fix segmentation fault

2024-06-17 Thread Hyman Huang
From: Masato Imai Since the kvm_dirty_ring_enabled function accesses a null kvm_state pointer when the KVM acceleration parameter is not specified, running calc_dirty_rate with the -r or -b option causes a segmentation fault. Signed-off-by: Masato Imai Message-ID: <20240507025010.1968881-1-...@

Re: [PATCH 07/20] qapi/parser: add semantic 'kind' parameter to QAPIDoc.Section

2024-06-17 Thread John Snow
On Thu, Jun 13, 2024 at 10:46 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024, 2:18 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > When iterating all_sections, this is helpful to be able to distinguish > >> > "members" from "features"; the only

Re: [PATCH 06/20] qapi/parser: fix comment parsing immediately following a doc block

2024-06-17 Thread John Snow
On Thu, Jun 13, 2024 at 10:32 AM Markus Armbruster wrote: > John Snow writes: > > > On Thu, May 16, 2024 at 2:01 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > If a comment immediately follows a doc block, the parser doesn't > ignore > >> > that token appropriately. Fix t

Re: [PATCH v2 17/17] vfio/container: Move vfio_container_destroy() to an instance_finalize() handler

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 08:34, Cédric Le Goater wrote: > vfio_container_destroy() clears the resources allocated > VFIOContainerBase object. Now that VFIOContainerBase is a QOM object, > add an instance_finalize() handler to do the cleanup. It will be > called through object_unref(). > > Suggested-b

Re: [PATCH v2 16/17] vfio/container: Introduce vfio_iommu_legacy_instance_init()

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > Just as we did for the VFIOContainerBase object, introduce an > instance_init() handler for the legacy VFIOContainer object and do the > specific initialization there. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eri

Re: [PATCH v2 15/17] vfio/container: Remove vfio_container_init()

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > It's now empty. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric > --- > include/hw/vfio/vfio-container-base.h | 2 -- > hw/vfio/container-base.c | 5 - > hw/vfio/container.c

Re: [PATCH v2 14/17] vfio/container: Remove VFIOContainerBase::ops

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > Instead, use VFIO_IOMMU_GET_CLASS() to get the class pointer. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric > --- > include/hw/vfio/vfio-container-base.h | 1 - > hw/vfio/common.c

Re: [PATCH v2 12/17] vfio/container: Switch to QOM

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > Instead of allocating the container struct, create a QOM object of the > appropriate type. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric > --- > hw/vfio/container.c | 6 +++--- > hw/vfio/iommufd.c

Re: [PATCH v2 13/17] vfio/container: Introduce an instance_init() handler

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > This allows us to move the initialization code from vfio_container_init(), > which we will soon remove. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric > --- > hw/vfio/container-base.c | 19 ++

Re: [PATCH v2 11/17] vfio/container: Change VFIOContainerBase to use QOM

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > VFIOContainerBase was made a QOM interface because we believed that a > QOM object would expose all the IOMMU backends to the QEMU machine and > human interface. This only applies to user creatable devices or objects. > > Change the VFIOContainerBase n

Re: [PATCH v2] os-posix: Expand setrlimit() syscall compatibility

2024-06-17 Thread Philippe Mathieu-Daudé
On 17/6/24 15:07, Michael Tokarev wrote: 17.06.2024 10:19, Philippe Mathieu-Daudé wrote: Hi Trent, On 14/6/24 23:06, Trent Huber wrote: Darwin uses a subtly different version of the setrlimit() syscall as described in the COMPATIBILITY section of the macOS man page. The value of the rlim_cur m

Re: [RFC PATCH v3 15/18] hw/arm/smmuv3: Advertise S2FWB

2024-06-17 Thread Mostafa Saleh
Hi Eric, On Mon, May 20, 2024 at 03:30:58PM +0200, Eric Auger wrote: > > > On 4/29/24 05:23, Mostafa Saleh wrote: > > QEMU doesn's support memory attributes, so FWB is NOP, this > > might change in the future if memory attributre would be supported. > if mem attributes get supported > > > > Sign

Re: [RFC PATCH v3 14/18] hw/arm/smmuv3: Support and advertise nesting

2024-06-17 Thread Mostafa Saleh
Hi Eric, On Mon, May 20, 2024 at 03:16:40PM +0200, Eric Auger wrote: > Hi Mostafa, > > On 4/29/24 05:23, Mostafa Saleh wrote: > > Everything is in place, add the last missing bits: > > - Handle fault checking according to the actual PTW event and not the > > the translation stage. > missing the

Re: [RFC PATCH v3 13/18] hw/arm/smmuv3: Support nested SMMUs in smmuv3_notify_iova()

2024-06-17 Thread Mostafa Saleh
Hi Eric, On Mon, May 20, 2024 at 12:37:55PM +0200, Eric Auger wrote: > Hi Mostafa, > > On 4/29/24 05:23, Mostafa Saleh wrote: > > IOMMUTLBEvent only understands IOVA, for stage-2 only SMMUs keep > > the implementation, while only notify for stage-1 invalidation > > in case of nesting. > > > > Sig

Re: [RFC PATCH v3 12/18] hw/arm/smmu: Support nesting in the rest of commands

2024-06-17 Thread Mostafa Saleh
Hi Eric, On Mon, May 20, 2024 at 12:24:22PM +0200, Eric Auger wrote: > Hi Mostafa, > > On 4/29/24 05:23, Mostafa Saleh wrote: > > Some commands need rework for nesting, as they used to assume S1 > > and S2 are mutually exclusive: > > > > - CMD_TLBI_NH_ASID: Consider VMID if stage-2 is supported >

Re: [RFC PATCH v3 10/18] hw/arm/smmu-common: Support nested translation

2024-06-17 Thread Mostafa Saleh
Hi Eric, On Mon, May 20, 2024 at 11:48:18AM +0200, Eric Auger wrote: > Hi Mostafa, > > On 4/29/24 05:23, Mostafa Saleh wrote: > > When nested translation is requested, do the following: > > > > - Translate stage-1 IPA using stage-2 to a physical address. > stage-1 table address IPA into PA throug

Re: [RFC PATCH v3 08/18] hw/arm/smmu-common: Add support for nested TLB

2024-06-17 Thread Mostafa Saleh
On Wed, May 22, 2024 at 1:44 PM Mostafa Saleh wrote: > > Hi Eric, > > On Mon, May 20, 2024 at 10:20:43AM +0200, Eric Auger wrote: > > Hi Mostafa, > > On 5/16/24 17:20, Mostafa Saleh wrote: > > > Hi Eric, > > > > > > On Wed, May 15, 2024 at 03:48:05PM +0200, Eric Auger wrote: > > >> Hi Mostafa, > >

Re: [RFC PATCH v3 06/18] hw/arm/smmu: Consolidate ASID and VMID types

2024-06-17 Thread Mostafa Saleh
Hi Eric, Sorry no updates for a while, I have been away for some time, but I am now back to working on this. On Wed, May 15, 2024 at 02:41:42PM +0200, Eric Auger wrote: > Hi Mostafa, > On 4/29/24 05:23, Mostafa Saleh wrote: > > ASID and VMID used to be uint16_t in the translation config, however,

Re: [PATCH 5/5] s390x: Enable and document boot device fallback on panic

2024-06-17 Thread Christian Borntraeger
Am 05.06.24 um 15:37 schrieb Thomas Huth: On 29/05/2024 17.43, jro...@linux.ibm.com wrote: From: Jared Rossi On a panic during IPL (i.e. a device failed to boot) check for another device to boot from, as indicated by the presence of an unused IPLB. If an IPLB is successfully loaded, then j

Re: [PATCH v2 10/17] vfio/container: Discover IOMMU type before creating the container

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > Since the QEMU struct type representing the VFIO container is deduced > from the IOMMU type exposed by the host, this type should be well > defined *before* creating the container struct. This will be necessary > to instantiate a QOM object of the corr

Re: [PATCH RESEND v7 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-17 Thread Stefano Garzarella
On Mon, Jun 17, 2024 at 09:42:21AM GMT, Michael S. Tsirkin wrote: On Mon, Jun 17, 2024 at 02:59:14PM +0200, Stefano Garzarella wrote: On Mon, Jun 17, 2024 at 02:02:30PM GMT, Markus Armbruster wrote: > Stefano Garzarella writes: > > > Hi Michael, > > > > On Wed, Jun 12, 2024 at 03:01:28PM GMT, S

Re: [PATCH] hw/i386/fw_cfg: Add etc/e820 to fw_cfg late

2024-06-17 Thread David Woodhouse
On Mon, 2024-06-17 at 15:15 +0100, Peter Maydell wrote: > On Mon, 17 Jun 2024 at 14:46, David Woodhouse wrote: > > > > From: David Woodhouse > > > > In e820_add_entry() the e820_table is reallocated with g_renew() to make > > space for a new entry. However, fw_cfg_arch_create() just uses the ex

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-17 Thread Paolo Bonzini
On Mon, Jun 17, 2024 at 4:04 PM Manos Pitsidianakis wrote: > I respectfully disagree and recommend taking another look at the code. > > The device actually performs all logic in non-unsafe methods and is > typed instead of operating on raw integers as fields/state. The C stuff > is the FFI boundar

Re: [PATCH v2 08/17] vfio/container: Introduce vfio_get_iommu_class_name()

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > Rework vfio_get_iommu_class() to return a literal class name instead > of a class object. We will need this name to instantiate the object > later on. Since the default case asserts, remove the error report as > QEMU will simply abort before. > > Signe

Re: [PATCH v2 09/17] vfio/container: Introduce vfio_create_container()

2024-06-17 Thread Eric Auger
On 6/17/24 08:34, Cédric Le Goater wrote: > This routine allocates the QEMU struct type representing the VFIO > container. It is minimal currently and future changes will do more > initialization. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric

Re: [PATCH v2 07/17] vfio/container: Modify vfio_get_iommu_type() to use a container fd

2024-06-17 Thread Eric Auger
On 6/17/24 08:33, Cédric Le Goater wrote: > The 'container' pointer has no other use than its 'fd' attribute. > Simplify the prototype to ease future changes. > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan Reviewed-by: Eric Auger Eric > --- > hw/vfio/container.c | 6 +++--

Re: [PATCH v2 06/17] vfio/container: Simplify vfio_container_init()

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: > Assign the base container VFIOAddressSpace 'space' pointer in > vfio_address_space_insert(). OK I get it now. Maybe in the previous patch, say that the vfio_address_space_insert() will be enhanced with additional initializations. > > To be

Re: [PATCH] hw/i386/fw_cfg: Add etc/e820 to fw_cfg late

2024-06-17 Thread Peter Maydell
On Mon, 17 Jun 2024 at 14:46, David Woodhouse wrote: > > From: David Woodhouse > > In e820_add_entry() the e820_table is reallocated with g_renew() to make > space for a new entry. However, fw_cfg_arch_create() just uses the existing > e820_table pointer. > > This leads to a use-after-free if any

Re: [PATCH v2 05/17] vfio/container: Introduce vfio_address_space_insert()

2024-06-17 Thread Eric Auger
On 6/17/24 08:33, Cédric Le Goater wrote: > It will ease future changes. Does it, really? Besides Reviewed-by: Eric Auger Eric > > Signed-off-by: Cédric Le Goater > Reviewed-by: Zhenzhong Duan > --- > include/hw/vfio/vfio-common.h | 2 ++ > hw/vfio/common.c | 6 ++ > hw/vf

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-17 Thread Manos Pitsidianakis
On Mon, 17 Jun 2024 14:32, Paolo Bonzini wrote: Il lun 17 giu 2024, 10:59 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: >qdev_define_type!(c"test-device", TestDevice); >impl ObjectImpl for TestDevice {} >impl DeviceImpl for TestDevice {} > >fn main() { >let d = TestDevi

Re: [PATCH v2 04/17] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: > From: Avihai Horon > > Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and > restructure the code. > > This is done in preparation for optimizing vIOMMU deviice dirty page device > tracking. No functional changes intended.

Re: [PATCH v2 01/17] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 14:34, Cédric Le Goater wrote: > Hello Eric, > > On 6/17/24 1:31 PM, Eric Auger wrote: >> Hi Cédric, >> >> On 6/17/24 08:33, Cédric Le Goater wrote: >>> Since vfio_devices_dma_logging_start() takes an 'Error **' argument, >>> best practices suggest to return a bool. See the a

Re: [PATCH] Update event idx if guest has made extra buffers during double check

2024-06-17 Thread Yang Dongshan
hi, subject should list the affected component, and be shorter. ok, I will rewrite the subject: "update the latest available idx seen by the host to event idx" Fixes: 06b12970174 ("virtio-net: fix network stall under load") this should come at the end. I have submitted v2, it's at the end now.

[PATCH] hw/i386/fw_cfg: Add etc/e820 to fw_cfg late

2024-06-17 Thread David Woodhouse
From: David Woodhouse In e820_add_entry() the e820_table is reallocated with g_renew() to make space for a new entry. However, fw_cfg_arch_create() just uses the existing e820_table pointer. This leads to a use-after-free if anything adds a new entry after fw_cfg is set up. Shift the addition of

Re: [PATCH RESEND v7 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-17 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 02:59:14PM +0200, Stefano Garzarella wrote: > On Mon, Jun 17, 2024 at 02:02:30PM GMT, Markus Armbruster wrote: > > Stefano Garzarella writes: > > > > > Hi Michael, > > > > > > On Wed, Jun 12, 2024 at 03:01:28PM GMT, Stefano Garzarella wrote: > > > > This series should be

[PATCH] target/loongarch: Remove avail_64 in trans_srai_w()

2024-06-17 Thread Feiyang Chen
Since srai.w is a valid instruction on la32, simply remove the avail_64 check. Fixes: c0c0461e3a06 ("target/loongarch: Add avail_64 to check la64-only instructions") Signed-off-by: Feiyang Chen --- target/loongarch/tcg/insn_trans/trans_shift.c.inc | 4 1 file changed, 4 deletions(-) diff

Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor

2024-06-17 Thread Harsh Prateek Bora
On 6/10/24 11:50, Philippe Mathieu-Daudé wrote: Hi, This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review. For rationale see previous series from Daniel

Re: [PATCH v4 3/8] HostIOMMUDevice: Introduce get_iova_ranges callback

2024-06-17 Thread Cédric Le Goater
On 6/14/24 11:52 AM, Eric Auger wrote: Introduce a new HostIOMMUDevice callback that allows to retrieve the usable IOVA ranges. Implement this callback in the legacy VFIO and IOMMUFD VFIO host iommu devices. This relies on the VFIODevice agent's base container iova_ranges resource. Signed-off-b

Re: Guest agent guest-exec memory usage

2024-06-17 Thread Daniel P . Berrangé
On Mon, Jun 17, 2024 at 04:05:07PM +0300, Konstantin Kostiuk wrote: > Hi All, > > During the investigation of a possible memory leak in the `guest-exec` > command of guest-agent, I found unexpected behavior for me. When we execute > the `guest-exec` command with `capture-output = true`, guest-agen

Re: [PATCH v2] os-posix: Expand setrlimit() syscall compatibility

2024-06-17 Thread Michael Tokarev
17.06.2024 10:19, Philippe Mathieu-Daudé wrote: Hi Trent, On 14/6/24 23:06, Trent Huber wrote: Darwin uses a subtly different version of the setrlimit() syscall as described in the COMPATIBILITY section of the macOS man page. The value of the rlim_cur member has been adjusted accordingly for Da

Guest agent guest-exec memory usage

2024-06-17 Thread Konstantin Kostiuk
Hi All, During the investigation of a possible memory leak in the `guest-exec` command of guest-agent, I found unexpected behavior for me. When we execute the `guest-exec` command with `capture-output = true`, guest-agent stores stdout/stderr until someone calls `guest-exec-status`. Just for test

Re: [PATCH RESEND v7 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-17 Thread Stefano Garzarella
On Mon, Jun 17, 2024 at 02:02:30PM GMT, Markus Armbruster wrote: Stefano Garzarella writes: Hi Michael, On Wed, Jun 12, 2024 at 03:01:28PM GMT, Stefano Garzarella wrote: This series should be in a good shape, in which tree should we queue it? @Micheal would your tree be okay? Markus sugges

Re: [PATCH 0/7] Remove some unused structures

2024-06-17 Thread Michael Tokarev
07.06.2024 17:04, Dr. David Alan Gilbert пишет: * Dr. David Alan Gilbert (d...@treblig.org) wrote: A bunch of structs that are currently unused, found with a simple script and a bit of eyeballing. The only one I'm that suspicious of is the SPARC one, where the patch which removed the use is a b

Re: [PATCH] monitor: Remove obsolete stubs

2024-06-17 Thread Michael Tokarev
10.06.2024 09:39, Philippe Mathieu-Daudé wrote: hmp_info_roms() was removed in commit dd98234c05 ("qapi: introduce x-query-roms QMP command"), hmp_info_numa() in commit 1b8ae799d8 ("qapi: introduce x-query-numa QMP command"), hmp_info_ramblock() in commit ca411b7c8a ("qapi: introduce x-query-ra

Re: [PATCH v2] os-posix: Expand setrlimit() syscall compatibility

2024-06-17 Thread Daniel P . Berrangé
On Fri, Jun 14, 2024 at 05:06:38PM -0400, Trent Huber wrote: > Darwin uses a subtly different version of the setrlimit() syscall as > described in the COMPATIBILITY section of the macOS man page. The value > of the rlim_cur member has been adjusted accordingly for Darwin-based > systems. > > Signe

Re: [PATCH] fix SSE2/SSSE3 feature detection in tcg/decode-new.c.inc

2024-06-17 Thread Michael Tokarev
Adding Cc's. /mjt 29.05.2024 16:53, Frank Mehnert wrote: The correct bitmask is cpuid_features rather than cpuid_ext_features. --- target/i386/tcg/decode-new.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decod

Re: [PATCH 08/26] hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info()

2024-06-17 Thread Harsh Prateek Bora
On 6/10/24 11:50, Philippe Mathieu-Daudé wrote: @@ -203,10 +201,8 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) spapr_xive_end_pic_print_info(xive, end, buf); } -info = human_readable_text_from_str(buf); -mo

Re: [PATCH] cpu: fix memleak of 'halt_cond' and 'thread'

2024-06-17 Thread Michael Tokarev
12.06.2024 20:04, Matheus Tavares Bernardino wrote: Since a4c2735f35 (cpu: move Qemu[Thread|Cond] setup into common code, 2024-05-30) these fields are now allocated at cpu_common_initfn(). So let's make sure we also free them at cpu_common_finalize(). Furthermore, the code also frees these on ro

Re: [PATCH] hmp-commands-info.hx: Add missing info command for stats subcommand

2024-06-17 Thread Michael Tokarev
Applied to trivial-patches, thanks! /mjt -- GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24. New key: rsa4096/61AD3D98ECDF2C8E 9D8B E14E 3F2A 9DD7 9199 28F1 61AD 3D98 ECDF 2C8E Old key: rsa2048/457CE0A0804465C5 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 Transition stat

Re: [PATCH V3 0/2] improve -overcommit cpu-pm=on|off

2024-06-17 Thread Michael Tokarev
04.06.2024 03:02, Zide Chen wrote: Currently, if running "-overcommit cpu-pm=on" on hosts that don't have MWAIT support, the MWAIT/MONITOR feature is advertised to the guest and executing MWAIT/MONITOR on the guest triggers #UD. Typically #UD takes priority over VM-Exit interception checks and K

Re: [PATCH 07/26] hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info()

2024-06-17 Thread Harsh Prateek Bora
On 6/10/24 11:50, Philippe Mathieu-Daudé wrote: @@ -198,13 +193,18 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) if (!xive_eas_is_masked(eas)) { uint32_t end_idx = xive_get_field64(EAS_END_INDEX, eas->w); XiveEND *end; +

Re: [PATCH 06/26] hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info()

2024-06-17 Thread Harsh Prateek Bora
On 6/10/24 11:50, Philippe Mathieu-Daudé wrote: @@ -1389,8 +1392,10 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) if (qaddr_base) { monitor_printf(mon, " eq:@%08"PRIx64"% 6d/%5d ^%d", qaddr_base, qindex, qentries, qgen);

Re: [PATCH v2 01/17] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-17 Thread Cédric Le Goater
Hello Eric, On 6/17/24 1:31 PM, Eric Auger wrote: Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: Since vfio_devices_dma_logging_start() takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. It will simplify potential changes coming afte

Re: [PATCH v7 1/2] hw/misc/riscv_iopmp: Add RISC-V IOPMP device

2024-06-17 Thread Stefan Weil via
Am 12.06.24 um 05:17 schrieb Ethan Chen via: Support basic functions of IOPMP specification v0.9.1 rapid-k model. The specification url: https://github.com/riscv-non-isa/iopmp-spec/releases/tag/v0.9.1 IOPMP check memory access from device is valid or not. This implementation uses IOMMU to change

Re: [PATCH qemu ] hw/acpi: Fix big endian host creation of Generic Port Affinity Structures

2024-06-17 Thread Jonathan Cameron via
On Fri, 14 Jun 2024 15:08:35 +0100 Jonathan Cameron wrote: > On Fri, 14 Jun 2024 12:57:25 +0200 > Igor Mammedov wrote: > > > On Thu, 6 Jun 2024 18:47:16 +0100 > > Jonathan Cameron wrote: > > > > > On Thu, 6 Jun 2024 16:06:53 +0200 > > > Igor Mammedov wrote: > > > > > > > On Wed, 5 Jun

Re: [PATCH RESEND v7 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-17 Thread Markus Armbruster
Stefano Garzarella writes: > Hi Michael, > > On Wed, Jun 12, 2024 at 03:01:28PM GMT, Stefano Garzarella wrote: >>This series should be in a good shape, in which tree should we queue it? >>@Micheal would your tree be okay? > > Markus suggested a small change to patch 10, so do you want me to resen

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-17 Thread Chinmay Rath
Hi Richard, On 6/17/24 00:43, Richard Henderson wrote: On 6/13/24 02:33, Chinmay Rath wrote: +/* EA <- (ra == 0) ? 0 : GPR[ra] */ +static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) +{ +    TCGv EA; +    if (!ra) { +    EA = tcg_constant_tl(0); +    return EA; +    } +    EA = tcg_t

Re: [RFC PATCH] subprojects: add a wrapper for libvirglrenderer

2024-06-17 Thread Akihiko Odaki
On 2024/06/17 19:35, Alex Bennée wrote: Akihiko Odaki writes: On 2024/06/05 22:35, Alex Bennée wrote: As the latest features for virtio-gpu need a pretty recent version of libvirglrenderer. When it is not available on the system we can use a meson wrapper and provide it when --download is spe

Re: [PATCH v2 03/17] vfio/common: Move dirty tracking ranges update to helper

2024-06-17 Thread Eric Auger
Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: > From: Joao Martins > > Separate the changes that updates the ranges from the listener, to s/updates/update > make it reusable in preparation to expand its use to vIOMMU support. > > [ clg: - Rebased on upstream >- Introduced vfio_dirty

<    1   2   3   >