[Stable-8.2.2 49/60] i386/cpu: Clear FEAT_XSAVE_XSS_LO/HI leafs when CPUID_EXT_XSAVE is not available

2024-02-21 Thread Michael Tokarev
From: Xiaoyao Li Leaf FEAT_XSAVE_XSS_LO and FEAT_XSAVE_XSS_HI also need to be cleared when CPUID_EXT_XSAVE is not set. Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features") Signed-off-by: Xiaoyao Li Reviewed-by: Yang Weijiang Message-ID: <20240115091325.1904229-2-xiaoya

[RFC PATCH v2 04/22] target/arm: Implement ALLINT MSR (immediate)

2024-02-21 Thread Jinjie Ruan via
Add ALLINT MSR (immediate) to decodetree. And the EL0 check is necessary to ALLINT. Avoid the unconditional write to pc and use raise_exception_ra to unwind. Signed-off-by: Jinjie Ruan --- target/arm/tcg/a64.decode | 1 + target/arm/tcg/helper-a64.c| 24 target

[RFC PATCH v2 10/22] target/arm: Handle PSTATE.ALLINT on taking an exception

2024-02-21 Thread Jinjie Ruan via
Set or clear PSTATE.ALLINT on taking an exception to ELx according to the SCTLR_ELx.SPINTMASK bit. Signed-off-by: Jinjie Ruan --- target/arm/helper.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 62c8e5d611..952ea7c02a 100644 --- a/t

[Stable-8.2.2 36/60] smmu: Clear SMMUPciBus pointer cache when system reset

2024-02-21 Thread Michael Tokarev
From: Zhenzhong Duan s->smmu_pcibus_by_bus_num is a SMMUPciBus pointer cache indexed by bus number, bus number may not always be a fixed value, i.e., guest reboot to different kernel which set bus number with different algorithm. This could lead to smmu_iommu_mr() providing the wrong iommu MR.

[RFC PATCH v2 15/22] hw/intc/arm_gicv3_redist: Implement GICR_INMIR0

2024-02-21 Thread Jinjie Ruan via
Add GICR_INMIR0 register and support access GICR_INMIR0. Signed-off-by: Jinjie Ruan --- hw/intc/arm_gicv3_redist.c | 23 +++ hw/intc/gicv3_internal.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index 815352

[Stable-8.2.2 46/60] target/arm: Don't get MDCR_EL2 in pmu_counter_enabled() before checking ARM_FEATURE_PMU

2024-02-21 Thread Michael Tokarev
From: Peter Maydell It doesn't make sense to read the value of MDCR_EL2 on a non-A-profile CPU, and in fact if you try to do it we will assert: #6 0x74b95e96 in __GI___assert_fail (assertion=0x565a8c70 "!arm_feature(env, ARM_FEATURE_M)", file=0x565a6e5c "../../target/arm/he

[PATCH v4 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types

2024-02-21 Thread Hyman Huang
VhostDeviceProtocols and VirtioDeviceFeatures are only used in virtio-hmp-cmds.c. So define them as plain C types there, and drop them from the QAPI schema. Signed-off-by: Hyman Huang Reviewed-by: Markus Armbruster --- hw/virtio/virtio-hmp-cmds.c | 16 +++ qapi/virtio.json

[Stable-8.2.2 43/60] target/arm: Split out make_svemte_desc

2024-02-21 Thread Michael Tokarev
From: Richard Henderson Share code that creates mtedesc and embeds within simd_desc. Cc: qemu-sta...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-5-richard.hender...@linaro.org Signed-off-by: Peter Maydell (c

Re: [PATCH v2 6/7] migration/multifd: Add zero pages and zero bytes counter to migration status interface.

2024-02-21 Thread Markus Armbruster
Hao Xiang writes: > This change extends the MigrationStatus interface to track zero pages > and zero bytes counter. > > Signed-off-by: Hao Xiang > --- > migration/migration-hmp-cmds.c | 4 > migration/migration.c | 2 ++ > qapi/migration.json | 15 +

[RFC PATCH v2 21/22] hw/intc/arm_gicv3: Implement NMI interrupt prioirty

2024-02-21 Thread Jinjie Ruan via
If GICD_CTLR_DS bit is zero and the NMI is non-secure, the NMI prioirty is higher than 0x80, otherwise it is higher than 0x0. And save NMI super prioirty information in hppi.superprio to deliver NMI exception. Since both GICR and GICD can deliver NMI, it is both necessary to check whether the pendi

[RFC PATCH v2 18/22] hw/arm/virt: Add FEAT_GICv3_NMI feature support in virt GIC

2024-02-21 Thread Jinjie Ruan via
Included support FEAT_GICv3_NMI feature as part of virt platform GIC initialization. Signed-off-by: Jinjie Ruan --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index c442652d0f..0359dbd8bd 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -77

Re: [PATCH 5/6] hw/pci-bridge/cxl_upstream: Fix missing ERRP_GUARD() in cxl_usp_realize()

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because it may be null. > *

Re: [PATCH 1/5] hw/isa/meson.build: Sort alphabetically

2024-02-21 Thread Mark Cave-Ayland
On 18/02/2024 13:16, Bernhard Beschow wrote: Fixes: fbd758008f0f "hw/isa: extract FDC37M81X to a separate file" Signed-off-by: Bernhard Beschow --- hw/isa/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/meson.build b/hw/isa/meson.build index f650b39507

[Stable-8.2.2 60/60] tests/qtest: Depend on dbus_display1_dep

2024-02-21 Thread Michael Tokarev
From: Akihiko Odaki It ensures dbus-display1.c will not be recompiled. Signed-off-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Message-Id: <20240214-dbus-v7-3-7eff29f04...@daynix.com> (cherry picked from commit 186acfbaf7f325833702f50f75ef5116dc29e233) Signed-off-by: Michael Tokarev diff

[PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed to error_pr

Re: [PATCH V4 3/5] util: strv_from_strList

2024-02-21 Thread Markus Armbruster
Steve Sistare writes: > Signed-off-by: Steve Sistare > Reviewed-by: Marc-André Lureau > --- > include/qemu/strList.h | 6 ++ > util/strList.c | 14 ++ > 2 files changed, 20 insertions(+) > > diff --git a/include/qemu/strList.h b/include/qemu/strList.h > index 010237f..

Re: [PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because it may be null. > *

Re: [PATCH v3 2/3] tools: build qemu-vmsr-helper

2024-02-21 Thread Daniel P . Berrangé
On Wed, Feb 21, 2024 at 02:19:11PM +0100, Anthony Harivel wrote: > Daniel P. Berrangé, Jan 29, 2024 at 20:45: > > On Mon, Jan 29, 2024 at 08:33:21PM +0100, Paolo Bonzini wrote: > > > On Mon, Jan 29, 2024 at 7:53 PM Daniel P. Berrangé > > > wrote: > > > > > diff --git a/meson.build b/meson.build >

Re: [PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:32:43PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:32:43 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in > macfb_nubus_realize() > > Zhao Liu writes: > > > From: Zhao Liu > > > > As the commen

Re: QNX VM hang on Qemu

2024-02-21 Thread Faiq Ali Sayed
Hi Alex, I have created a new QNX image, particularly for Qemu, and still, both the prompts are hanging without any further details. Please have a look at the results of both terminals below qemu-system-aarch64.exe -M xlnx-zcu102 -m 16G -serial mon:stdio -display none -device loader,file="C:ifs.b

[RFC PATCH v2 02/22] target/arm: Handle HCR_EL2 accesses for bits introduced with FEAT_NMI

2024-02-21 Thread Jinjie Ruan via
FEAT_NMI defines another new bit in HCRX_EL2: TALLINT. When the feature is enabled, allow this bit to be written in HCRX_EL2. Signed-off-by: Jinjie Ruan --- target/arm/cpu-features.h | 5 + target/arm/helper.c | 5 + 2 files changed, 10 insertions(+) diff --git a/target/arm/cpu-fe

Re: [PATCH 00/10] reset: Make whole system three-phase-reset aware

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 16:06, Peter Maydell wrote: This patchset is an incremental improvement to our reset handling that tries to roll out the "three-phase-reset" design we have for devices to a wider scope. At the moment devices and buses have a three-phase reset system, with separate 'enter', 'hold'

Re: [PATCH v4 32/34] monitor: fdset: Match against O_DIRECT

2024-02-21 Thread Fabiano Rosas
Markus Armbruster writes: > Fabiano Rosas writes: > >> We're about to enable the use of O_DIRECT in the migration code and >> due to the alignment restrictions imposed by filesystems we need to >> make sure the flag is only used when doing aligned IO. >> >> The migration will do parallel IO to d

Re: [PATCH v5 1/9] target/ppc: Use env_cpu for cpu_abort in excp_helper

2024-02-21 Thread Harsh Prateek Bora
On 1/19/24 03:31, BALATON Zoltan wrote: Use the env_cpu function to get the CPUState for cpu_abort. These are only needed in case of fatal errors so this allows to avoid casting and storing CPUState in a local variable wnen not needed. I wish the patch could have broader scope to cover whol

Re: [PATCH 12/23] qemu-img: make -l (list) the default for "snapshot" subcommand

2024-02-21 Thread Michael Tokarev
20.02.2024 21:51, Michael Tokarev wrote: 20.02.2024 20:45, Daniel P. Berrangé wrote: On Sat, Feb 10, 2024 at 12:22:33AM +0300, Michael Tokarev wrote: also remove bdrv_oflags handling (only list can use RO mode) ---   qemu-img.c | 13 -   1 file changed, 8 insertions(+), 5 deletions(-

[PULL 0/1] loongarch-to-apply queue

2024-02-21 Thread Song Gao
The following changes since commit 760b4dcdddba4a40b9fa0eb78fdfc7eda7cb83d0: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-02-20 10:11:08 +) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-202

Re: [PATCH v4 11/34] migration/ram: Introduce 'fixed-ram' migration capability

2024-02-21 Thread Daniel P . Berrangé
On Wed, Feb 21, 2024 at 10:24:05AM -0300, Fabiano Rosas wrote: > Markus Armbruster writes: > > > Fabiano Rosas writes: > > > >> Add a new migration capability 'fixed-ram'. > >> > >> The core of the feature is to ensure that each RAM page has a specific > >> offset in the resulting migration stre

Re: [PATCH v4 11/34] migration/ram: Introduce 'fixed-ram' migration capability

2024-02-21 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Wed, Feb 21, 2024 at 10:24:05AM -0300, Fabiano Rosas wrote: >> Markus Armbruster writes: >> >> > Fabiano Rosas writes: >> > >> >> Add a new migration capability 'fixed-ram'. >> >> >> >> The core of the feature is to ensure that each RAM page has a specific >> >>

Re: [PATCH v4 0/3] Fix MCE handling on AMD hosts

2024-02-21 Thread Joao Martins
On 20/02/2024 17:27, John Allen wrote: > On Wed, Feb 07, 2024 at 11:21:05AM +, Joao Martins wrote: >> On 12/09/2023 22:18, John Allen wrote: >>> In the event that a guest process attempts to access memory that has >>> been poisoned in response to a deferred uncorrected MCE, an AMD system >>> wi

Re: [PATCH 15/23] qemu-img: resize: do not always eat last argument

2024-02-21 Thread Michael Tokarev
20.02.2024 20:57, Daniel P. Berrangé пишет: On Sat, Feb 10, 2024 at 12:22:36AM +0300, Michael Tokarev wrote: 'qemu-img resize --help' does not work, since it wants more arguments. Only eat last option at the beginning if it starts like -N.., and allow getopt() to do its work, and eat it up at th

Re: [RFC 1/4] drive-mirror: add support for sync=bitmap mode=never

2024-02-21 Thread Fiona Ebner
Am 21.02.24 um 07:55 schrieb Markus Armbruster: >> diff --git a/qapi/block-core.json b/qapi/block-core.json >> index ab5a93a966..ac05483958 100644 >> --- a/qapi/block-core.json >> +++ b/qapi/block-core.json >> @@ -2181,6 +2181,15 @@ >> # destination (all the disk, only the sectors allocated in

[PATCH] hw/intc/Kconfig: Fix GIC settings when using "--without-default-devices"

2024-02-21 Thread Thomas Huth
When using "--without-default-devices", the ARM_GICV3_TCG and ARM_GIC_KVM settings currently get disabled, though the arm virt machine is only of very limited use in that case. This also causes the migration-test to fail in such builds. Let's make sure that we always keep the GIC switches enabled i

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-21 Thread Mark Cave-Ayland
On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the PIIX and ICH south bridges, so instantiate it there. The isapc machine now needs to instantiate it explicitly, analoguous to the RTC. Note that due to migration compatibility, port92 is optional in the south bridges

[Stable-8.2.2 44/60] target/arm: Handle mte in do_ldrq, do_ldro

2024-02-21 Thread Michael Tokarev
From: Richard Henderson These functions "use the standard load helpers", but fail to clean_data_tbi or populate mtedesc. Cc: qemu-sta...@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Tested-by: Gustavo Romero Message-id: 20240207025210.8837-6-richard.hender...@linaro.

Re: [PATCH v2 0/7] hw/ide: Clean up hw/ide/qdev.c and include/hw/ide/internal.h

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 08:54, Thomas Huth wrote: While trying to make it possible to compile-out the CompactFlash IDE device in downstream distributions (first patch), we noticed that there are more things in the IDE code that could use a proper clean up: First, hw/ide/qdev.c is quite a mix between IDE

[RFC PATCH v2 12/22] hw/arm/virt: Wire NMI irq line from GIC to CPU

2024-02-21 Thread Jinjie Ruan via
Wire the new NMI interrupt line from the GIC to each CPU. Signed-off-by: Jinjie Ruan --- hw/arm/virt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0af1943697..c442652d0f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -804,7 +804,

Re: [PATCH v4 11/34] migration/ram: Introduce 'fixed-ram' migration capability

2024-02-21 Thread Markus Armbruster
Fabiano Rosas writes: > Add a new migration capability 'fixed-ram'. > > The core of the feature is to ensure that each RAM page has a specific > offset in the resulting migration stream. The reasons why we'd want > such behavior are: > > - The resulting file will have a bounded size, since pages

Re: [PATCH 06/10] hw/core: Add ResetContainer which holds objects implementing Resettable

2024-02-21 Thread Philippe Mathieu-Daudé
On 20/2/24 17:06, Peter Maydell wrote: Implement a ResetContainer. This is a subclass of Object, and it implements the Resettable interface. The container holds a list of arbitrary other objects which implement Resettable, and when the container is reset, all the objects it contains are also re

Re: [PATCH RFC 0/8] Add Counter delegation ISA extension support

2024-02-21 Thread Daniel Henrique Barboza
Hi Atish, This series and its dependency, which I assume it's "[PATCH v4 0/5] Add ISA extension smcntrpmf support" Doesn't apply in neither master nor riscv-to-apply.next because of this patch: "target/riscv: Use RISCVException as return type for all csr ops" That changed some functions from

[RFC PATCH v2 01/22] target/arm: Add FEAT_NMI to max

2024-02-21 Thread Jinjie Ruan via
Enable FEAT_NMI on the 'max' CPU. Signed-off-by: Jinjie Ruan --- docs/system/arm/emulation.rst | 1 + target/arm/tcg/cpu64.c| 1 + 2 files changed, 2 insertions(+) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index f67aea2d83..91baf7ad69 100644 --- a/docs/s

Re: [PATCH v4 32/34] monitor: fdset: Match against O_DIRECT

2024-02-21 Thread Markus Armbruster
Fabiano Rosas writes: > We're about to enable the use of O_DIRECT in the migration code and > due to the alignment restrictions imposed by filesystems we need to > make sure the flag is only used when doing aligned IO. > > The migration will do parallel IO to different regions of a file, so > we

[RFC PATCH v2 06/22] target/arm: Add support for Non-maskable Interrupt

2024-02-21 Thread Jinjie Ruan via
This only implements the external delivery method via the GICv3. Signed-off-by: Jinjie Ruan --- target/arm/cpu-qom.h | 3 ++- target/arm/cpu.c | 39 ++- target/arm/cpu.h | 2 ++ target/arm/helper.c | 1 + 4 files changed, 39 insertions(+), 6 deleti

[PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() in trng_prop_fault_event_set()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed to error_pr

[Stable-8.2.2 55/60] ui/clipboard: mark type as not available when there is no data

2024-02-21 Thread Michael Tokarev
From: Fiona Ebner With VNC, a client can send a non-extended VNC_MSG_CLIENT_CUT_TEXT message with len=0. In qemu_clipboard_set_data(), the clipboard info will be updated setting data to NULL (because g_memdup(data, size) returns NULL when size is 0). If the client does not set the VNC_ENCODING_CL

[RFC PATCH v2 14/22] target/arm: Handle NMI in arm_cpu_do_interrupt_aarch64()

2024-02-21 Thread Jinjie Ruan via
The NMI exception trap entry behave like IRQ or FIQ which depends on the NMI interrupt type. Signed-off-by: Jinjie Ruan --- target/arm/helper.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 952ea7c02a..ac5f998e32 100644 --- a/target/ar

[Stable-8.2.2 50/60] i386/cpu: Mask with XCR0/XSS mask for FEAT_XSAVE_XCR0_HI and FEAT_XSAVE_XSS_HI leafs

2024-02-21 Thread Michael Tokarev
From: Xiaoyao Li The value of FEAT_XSAVE_XCR0_HI leaf and FEAT_XSAVE_XSS_HI leaf also need to be masked by XCR0 and XSS mask respectively, to make it logically correct. Fixes: 301e90675c3f ("target/i386: Enable support for XSAVES based features") Signed-off-by: Xiaoyao Li Reviewed-by: Yang Weij

[PATCH 0/6] [PATCH 0/6] Fix missing ERRP_GUARD() when dereference @errp

2024-02-21 Thread Zhao Liu
From: Zhao Liu Hi all, Thanks to Markus's explanation about ERRP_GUARD() on my previsou patch [1], I realize that perhaps more @errp dereference cases need to be double-checked to ensure that ERRP_GUARD() is being used correctly. Therefore, there're the patches to add more missing ERRP_GUARD()

Re: [PATCH] vhost-user: fix the issue of vhost deadlock in nested virtualization

2024-02-21 Thread Maxime Coquelin
On 2/20/24 12:43, Michael S. Tsirkin wrote: On Tue, Feb 20, 2024 at 12:26:49PM +0100, Maxime Coquelin wrote: On 2/13/24 11:05, Michael S. Tsirkin wrote: On Fri, Jan 26, 2024 at 06:07:37PM +0800, Hao Chen wrote: I run "dpdk-vdpa" and "qemur-L2" in "qemu-L1". In a nested virtualization env

Re: [PATCH] qapi: Craft the BlockdevCreateOptionsLUKS comment

2024-02-21 Thread Yong Huang
On Wed, Feb 21, 2024 at 4:26 PM Markus Armbruster wrote: > Yong Huang writes: > > > On Wed, Feb 21, 2024 at 2:43 PM Markus Armbruster > wrote: > > > >> Hyman Huang writes: > >> > >> > Add comment in detail for commit 433957bb7f (qapi: > >> > Make parameter 'file' optional for > >> > BlockdevCr

Re: [RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > Add "l1d-cache", "l1i-cache". "l2-cache", and "l3-cache" options in > -smp to define the cache topology for SMP system. > > Signed-off-by: Zhao Liu [...] > diff --git a/qapi/machine.json b/qapi/machine.json > index d0e7f1f615f3..0a923ac38803 100644 > ---

[Stable-8.2.2 41/60] target/arm: Fix nregs computation in do_{ld, st}_zpa

2024-02-21 Thread Michael Tokarev
From: Richard Henderson The field is encoded as [0-3], which is convenient for indexing our array of function pointers, but the true value is [1-4]. Adjust before calling do_mem_zpa. Add an assert, and move the comment re passing ZT to the helper back next to the relevant code. Cc: qemu-sta...

Re: [PATCH v2 1/2] qapi/migration.json: add reason to MIGRATION event

2024-02-21 Thread Roman Khapov
The reason in MIGRATION event can be used, when there is some helpful message, that can be added to improve debugging\understanding of the reason of migration status changing. I propose the next usage - when qemu sends (MIGRATION status=failed) event, the error message describing the problem c

Re: [PATCH 09/10] hw/core/machine: Use qemu_register_resettable for sysbus reset

2024-02-21 Thread Philippe Mathieu-Daudé
On 20/2/24 17:06, Peter Maydell wrote: Move the reset of the sysbus (and thus all devices and buses anywhere on the qbus tree) from qemu_register_reset() to qemu_register_resettable(). This is a behaviour change: because qemu_register_resettable() is aware of three-phase reset, this now means th

[Stable-8.2.2 35/60] virtio_iommu: Clear IOMMUPciBus pointer cache when system reset

2024-02-21 Thread Michael Tokarev
From: Zhenzhong Duan s->iommu_pcibus_by_bus_num is a IOMMUPciBus pointer cache indexed by bus number, bus number may not always be a fixed value, i.e., guest reboot to different kernel which set bus number with different algorithm. This could lead to endpoint binding to wrong iommu MR in virtio_

[Stable-8.2.2 42/60] target/arm: Adjust and validate mtedesc sizem1

2024-02-21 Thread Michael Tokarev
From: Richard Henderson When we added SVE_MTEDESC_SHIFT, we effectively limited the maximum size of MTEDESC. Adjust SIZEM1 to consume the remaining bits (32 - 10 - 5 - 12 == 5). Assert that the data to be stored fits within the field (expecting 8 * 4 - 1 == 31, exact fit). Cc: qemu-sta...@nong

[Stable-8.2.2 19/60] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-21 Thread Michael Tokarev
From: Stefan Hajnoczi Requests that complete in an IOThread use irqfd to notify the guest while requests that complete in the main loop thread use the traditional qdev irq code path. The reason for this conditional is that the irq code path requires the BQL: if (s->ioeventfd_started && !s->ioe

[Stable-8.2.2 24/60] hw/smbios: Fix OEM strings table option validation

2024-02-21 Thread Michael Tokarev
From: Akihiko Odaki qemu_smbios_type11_opts did not have the list terminator and that resulted in out-of-bound memory access. It also needs to have an element for the type option. Cc: qemu-sta...@nongnu.org Fixes: 2d6dcbf93fb0 ("smbios: support setting OEM strings table") Signed-off-by: Akihiko

[Stable-8.2.2 54/60] ui: reject extended clipboard message if not activated

2024-02-21 Thread Michael Tokarev
From: Daniel P. Berrangé The extended clipboard message protocol requires that the client activate the extension by requesting a psuedo encoding. If this is not done, then any extended clipboard messages from the client should be considered invalid and the client dropped. Signed-off-by: Daniel P

Re: [PATCH] qapi: Misc cleanups to migrate QAPIs

2024-02-21 Thread Markus Armbruster
Het Gala writes: > Sorry Markus, firstly I thought its just regarding qapi documentation so > migration maintainers might not be needed ? but then I realize the commit > message fails to specify that > > IIRC, you are one of the maintainers for qapi. So, just cc'd to you, but you > are right,

Re: [RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 01:46:21PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 13:46:21 +0100 > From: Markus Armbruster > Subject: Re: [RFC 4/8] hw/core: Add cache topology options in -smp > > Zhao Liu writes: > > > From: Zhao Liu > > > > Add "l1d-cache", "l1i-cache". "l2-cache",

Re: [PATCH 3/9] hw/i386/x86: Turn apic_xrupt_override into class attribute

2024-02-21 Thread Philippe Mathieu-Daudé
On 8/2/24 23:03, Bernhard Beschow wrote: The attribute isn't user-changeable and only true for pc-based machines. Turn it into a class attribute which allows for inlining pc_guest_info_init() into pc_machine_initfn(). Signed-off-by: Bernhard Beschow --- include/hw/i386/x86.h | 3 ++- hw/i386

Re: [PATCH] vl, pc: turn -no-fd-bootchk into a machine property

2024-02-21 Thread Bernhard Beschow
Am 21. Februar 2024 09:04:21 UTC schrieb Paolo Bonzini : >On Tue, Feb 20, 2024 at 11:43 PM Bernhard Beschow wrote: >> >> >> >> Am 20. Februar 2024 15:53:52 UTC schrieb Paolo Bonzini : >> >Add a fd-bootchk property to PC machine types, so that -no-fd-bootchk >> >returns an error if the machine d

[Stable-8.2.2 26/60] hw/net/tulip: add chip status register values

2024-02-21 Thread Michael Tokarev
From: Sven Schnelle Netbsd isn't able to detect a link on the emulated tulip card. That's because netbsd reads the Chip Status Register of the Phy (address 0x14). The default phy data in the qemu tulip driver is all zero, which means no link is established and autonegotation isn't complete. Ther

Re: [PATCH v2] virtio-iommu: Use qemu_real_host_page_mask as default page_size_mask

2024-02-21 Thread Eric Auger
On 2/21/24 12:31, Jean-Philippe Brucker wrote: > On Wed, Feb 21, 2024 at 11:41:57AM +0100, Eric Auger wrote: >> Hi, >> >> On 2/13/24 13:00, Michael S. Tsirkin wrote: >>> On Tue, Feb 13, 2024 at 12:24:22PM +0100, Eric Auger wrote: Hi Michael, On 2/13/24 12:09, Michael S. Tsirkin wrote:

[PATCH v4 2/3] virtio: Declare the decoding functions to static

2024-02-21 Thread Hyman Huang
qmp_decode_protocols(), qmp_decode_status(), and qmp_decode_features() are now only used in virtio-hmp-cmds.c. So move them into there, redeclare them to static, and replace the qmp_ prefix with hmp_. Signed-off-by: Hyman Huang --- hw/virtio/meson.build | 4 +- hw/virtio/virtio-hmp-cmds

Help with qemu_input_event_send_key_number and IOThreads in Qemu

2024-02-21 Thread Akilan Purushothaman
Dear Development Team, I'm trying to use Qemu as a shared library for my Android app. It is working fine so far. I can get the display output, but I cannot send it any keys. When I try, I get an error about an assert() failing at line 91 in tcg-accel-ops.c

[RFC PATCH v2 19/22] hw/intc/arm_gicv3: Add irq superpriority information

2024-02-21 Thread Jinjie Ruan via
A SPI, PPI or SGI interrupt can have a superpriority property. So maintain superpriority information in PendingIrq and GICR/GICD. Signed-off-by: Jinjie Ruan --- include/hw/intc/arm_gicv3_common.h | 4 1 file changed, 4 insertions(+) diff --git a/include/hw/intc/arm_gicv3_common.h b/includ

Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-21 Thread Markus Armbruster
Hao Xiang writes: > 1. Implements the zero page detection and handling on the multifd > threads for non-compression, zlib and zstd compression backends. > 2. Added a new value 'multifd' in ZeroPageDetection enumeration. > 3. Add proper asserts to ensure pages->normal are used for normal pages > i

Re: [PATCH 01/10] hw/i386: Store pointers to IDE buses in PCMachineState

2024-02-21 Thread Philippe Mathieu-Daudé
On 21/2/24 14:07, Philippe Mathieu-Daudé wrote: Hi Peter, On 20/2/24 17:06, Peter Maydell wrote: Add the two IDE bus BusState pointers to the set we keep in PCMachineState. This allows us to avoid passing them to pc_cmos_init(), and also will allow a refactoring of how we call pc_cmos_init_lat

Re: [PATCH v3 2/3] tools: build qemu-vmsr-helper

2024-02-21 Thread Anthony Harivel
Daniel P. Berrangé, Jan 29, 2024 at 20:45: > On Mon, Jan 29, 2024 at 08:33:21PM +0100, Paolo Bonzini wrote: > > On Mon, Jan 29, 2024 at 7:53 PM Daniel P. Berrangé > > wrote: > > > > diff --git a/meson.build b/meson.build > > > > index d0329966f1b4..93fc233b0891 100644 > > > > --- a/meson.build >

Re: [PATCH 9/9] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables

2024-02-21 Thread Philippe Mathieu-Daudé
On 8/2/24 23:03, Bernhard Beschow wrote: There is no advantage in having these local variables which 1/ needlessly have different identifiers in both machines and 2/ which are redundant to pcms->bus which is almost as short. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 14 ++---

[PATCH v2 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-02-21 Thread Dehan Meng
The Route information of the Linux VM needs to be used by administrators and users when debugging network problems and troubleshooting. Signed-off-by: Dehan Meng --- qga/commands-posix.c | 78 ++ qga/commands-win32.c | 6 qga/qapi-schema.json | 80 ++

[Stable-8.2.2 57/60] ui/console: Fix console resize with placeholder surface

2024-02-21 Thread Michael Tokarev
From: Tianlan Zhou In `qemu_console_resize()`, the old surface of the console is keeped if the new console size is the same as the old one. If the old surface is a placeholder, and the new size of console is the same as the placeholder surface (640*480), the surface won't be replace. In this situ

Re: [PATCH 02/10] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done()

2024-02-21 Thread Philippe Mathieu-Daudé
On 20/2/24 17:06, Peter Maydell wrote: In the i386 PC machine, we want to run the pc_cmos_init_late() function only once the IDE and floppy drive devices have been set up. We currently do this using qemu_register_reset(), and then have the function call qemu_unregister_reset() on itself, so it ru

[PATCH 2/6] hw/display/macfb: Fix missing ERRP_GUARD() in macfb_nubus_realize()

2024-02-21 Thread Zhao Liu
From: Zhao Liu As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. * - It should not be passed to error_pr

[RFC PATCH v2 22/22] hw/intc/arm_gicv3: Report the NMI interrupt in gicv3_cpuif_update()

2024-02-21 Thread Jinjie Ruan via
In CPU Interface, if the IRQ or FIQ has the superpriority property, report NMI to the corresponding PE and record the NMI interrupt type. Signed-off-by: Jinjie Ruan --- hw/intc/arm_gicv3_cpuif.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b

Re: [PATCH v4 27/34] migration: Add direct-io parameter

2024-02-21 Thread Markus Armbruster
Fabiano Rosas writes: > Add the direct-io migration parameter that tells the migration code to > use O_DIRECT when opening the migration stream file whenever possible. > > This is currently only used with the fixed-ram migration that has a > clear window guaranteed to perform aligned writes. > >

Re: [PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because it may be null. > *

Re: [PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() in trng_prop_fault_event_set()

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because it may be null. > *

Re: [PATCH v3 2/3] tools: build qemu-vmsr-helper

2024-02-21 Thread Anthony Harivel
Daniel P. Berrangé, Feb 21, 2024 at 14:47: > On Wed, Feb 21, 2024 at 02:19:11PM +0100, Anthony Harivel wrote: > > Daniel P. Berrangé, Jan 29, 2024 at 20:45: > > > On Mon, Jan 29, 2024 at 08:33:21PM +0100, Paolo Bonzini wrote: > > > > On Mon, Jan 29, 2024 at 7:53 PM Daniel P. Berrangé > > > > wrot

Re: [PATCH v8 00/21] Introduce smp.modules for x86 in QEMU

2024-02-21 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > Hi list, > > This is the our v8 patch series, rebased on the master branch at the > commit 11be70677c70 ("Merge tag 'pull-vfio-20240129' of > https://github.com/legoater/qemu into staging"). > > Compared with v7 [1], v8 mainly has the following changes: >

Re: [PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:31:06PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:31:06 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 1/6] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in > cxl_fixed_memory_window_config() > > Zhao Liu writes: > > > From: Zhao Liu > > > > As

Re: [PATCH V4 1/5] util: strList_from_string

2024-02-21 Thread Markus Armbruster
I apologize for the lateness of my review. Steve Sistare writes: > Generalize hmp_split_at_comma() to take any delimiter string, rename > as strList_from_string(), and move it to util/strList.c. > > No functional change. > > Signed-off-by: Steve Sistare I can't see an actual use of generalized

Re: [PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in iommufd_cdev_getfd()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:53:10PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:53:10 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 6/6] hw/vfio/iommufd: Fix missing ERRP_GUARD() in > iommufd_cdev_getfd() > > Zhao Liu writes: > > > From: Zhao Liu > > > > As the comment

[RFC PATCH v2 08/22] target/arm: Handle IS/FS in ISR_EL1 for NMI

2024-02-21 Thread Jinjie Ruan via
Add IS and FS bit in ISR_EL1 and handle the read according to whether the NMI is IRQ or FIQ. Signed-off-by: Jinjie Ruan --- target/arm/cpu.h| 2 ++ target/arm/helper.c | 9 + 2 files changed, 11 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 051e589e19..e2d07e3

Re: [PATCH v2 1/7] migration/multifd: Add new migration option zero-page-detection.

2024-02-21 Thread Markus Armbruster
Hao Xiang writes: > This new parameter controls where the zero page checking is running. > 1. If this parameter is set to 'legacy', zero page checking is > done in the migration main thread. > 2. If this parameter is set to 'none', zero page checking is disabled. > > Signed-off-by: Hao Xiang [.

Re: [PATCH] test/qtest: Add an API function to capture IRQ toggling

2024-02-21 Thread Gustavo Romero
Hi Phil, Apologies, I missed this and I just found it when preparing now the v3 for ivshmem-flat. On 12/13/23 6:15 AM, Philippe Mathieu-Daudé wrote: On 13/11/23 18:33, Gustavo Romero wrote: Currently the QTest API does not provide a function to allow capturing when an IRQ line is toggled (rai

Re: [PATCH V2 1/1] loongarch: Change the UEFI loading mode to loongarch

2024-02-21 Thread gaosong
在 2024/2/19 下午6:34, Xianglai Li 写道: The UEFI loading mode in loongarch is very different from that in other architectures:loongarch's UEFI code is in rom, while other architectures' UEFI code is in flash. loongarch UEFI can be loaded as follows: -machine virt,pflash=pflash0-format -bios ./QEMU_E

Re: [PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() in trng_prop_fault_event_set()

2024-02-21 Thread Zhao Liu
On Wed, Feb 21, 2024 at 12:47:33PM +0100, Markus Armbruster wrote: > Date: Wed, 21 Feb 2024 12:47:33 +0100 > From: Markus Armbruster > Subject: Re: [PATCH 4/6] hw/misc/xlnx-versal-trng: Fix missing ERRP_GUARD() > in trng_prop_fault_event_set() > > Zhao Liu writes: > > > From: Zhao Liu > > > >

Re: [PATCH v2 2/7] migration/multifd: Support for zero pages transmission in multifd format.

2024-02-21 Thread Elena Ufimtseva
On Fri, Feb 16, 2024 at 2:41 PM Hao Xiang wrote: > This change adds zero page counters and updates multifd send/receive > tracing format to track the newly added counters. > > Signed-off-by: Hao Xiang > --- > migration/multifd.c| 43 ++ > migration/mu

[Stable-8.2.2 31/60] cxl/cdat: Fix header sum value in CDAT checksum

2024-02-21 Thread Michael Tokarev
From: Ira Weiny The addition of the DCD support for CXL type-3 devices extended the CDAT table large enough that the checksum being returned was incorrect.[1] This was because the checksum value was using the header length field rather than each of the 4 bytes of the length field. This was prev

[PATCH v4 1/3] qmp: Switch x-query-virtio-status back to numeric encoding

2024-02-21 Thread Hyman Huang
x-query-virtio-status returns several sets of virtio feature and status flags. It goes back to v7.2.0. In the initial commit 90c066cd682 (qmp: add QMP command x-query-virtio-status), we returned them as numbers, using virtio's well-known binary encoding. The next commit f3034ad71fc (qmp: decode

Re: [PATCH] qapi: Misc cleanups to migrate QAPIs

2024-02-21 Thread Peter Xu
On Wed, Feb 21, 2024 at 09:30:52AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > Thanks, Markus. > > [...] > > > Reviewed-by: Peter Xu > > > > Markus, do you want us to pick it up, or let it go via qapi? > > I can stick it into my next qapi PR in a few days, if you guys don't > bea

Re: [PATCH 5/9] hw/i386/pc: Defer smbios_set_defaults() to machine_done

2024-02-21 Thread Philippe Mathieu-Daudé
On 8/2/24 23:03, Bernhard Beschow wrote: Handling most of smbios data generation in the machine_done notifier is similar to how the ARM virt machine handles it which also calls smbios_set_defaults() there. The result is that all pc machines are freed from explicitly worrying about smbios setup.

Re: [PATCH V4 5/5] migration: simplify exec migration functions

2024-02-21 Thread Fabiano Rosas
Fabiano Rosas writes: > Steve Sistare writes: > >> Simplify the exec migration code by using list utility functions. >> >> As a side effect, this also fixes a minor memory leak. On function return, >> "g_auto(GStrv) argv" frees argv and each element, which is wrong, because >> the function does

Re: [PATCH v2] virtio-iommu: Use qemu_real_host_page_mask as default page_size_mask

2024-02-21 Thread Eric Auger
Hi, On 2/13/24 13:00, Michael S. Tsirkin wrote: > On Tue, Feb 13, 2024 at 12:24:22PM +0100, Eric Auger wrote: >> Hi Michael, >> On 2/13/24 12:09, Michael S. Tsirkin wrote: >>> On Tue, Feb 13, 2024 at 11:32:13AM +0100, Eric Auger wrote: Do you have an other concern? >>> I also worry a bit abou

[Stable-8.2.2 52/60] i386/cpuid: Move leaf 7 to correct group

2024-02-21 Thread Michael Tokarev
From: Xiaoyao Li CPUID leaf 7 was grouped together with SGX leaf 0x12 by commit b9edbadefb9e ("i386: Propagate SGX CPUID sub-leafs to KVM") by mistake. SGX leaf 0x12 has its specific logic to check if subleaf (starting from 2) is valid or not by checking the bit 0:3 of corresponding EAX is 1 or

Re: [PATCH 18/23] plugins: add an API to read registers

2024-02-21 Thread Alex Bennée
Akihiko Odaki writes: > On 2024/02/20 23:14, Alex Bennée wrote: >> Akihiko Odaki writes: >> >>> On 2024/02/17 1:30, Alex Bennée wrote: We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initiali

Re: [PATCH v2 3/7] migration/multifd: Zero page transmission on the multifd thread.

2024-02-21 Thread Elena Ufimtseva
On Fri, Feb 16, 2024 at 2:42 PM Hao Xiang wrote: > 1. Implements the zero page detection and handling on the multifd > threads for non-compression, zlib and zstd compression backends. > 2. Added a new value 'multifd' in ZeroPageDetection enumeration. > 3. Add proper asserts to ensure pages->norma

Re: QNX VM hang on Qemu

2024-02-21 Thread Peter Maydell
On Tue, 20 Feb 2024 at 22:22, Faiq Ali Sayed wrote: > > The real hardware ( xlnx-zcu102 ) is being used for our software. The > software is in the development phase, and for that, I need to create a VM for > simulation purposes. > Qemu has a machine type (-M xlnx-zcu102) which is supported with

<    1   2   3   4   5   >