[PATCH] pcie_sriov: Remove g_new assertion

2023-11-22 Thread Akihiko Odaki
g_new() aborts if the allocation fails so it returns NULL only if the requested allocation size is zero. register_vfs() makes such an allocation if NumVFs is zero so it should not assert that g_new() returns a non-NULL value. Fixes: 7c0fa8dff8 ("pcie: Add support for Single Root I/O

RE: [PATCH] hw/ppc: Improve build for PPC VFIO

2023-11-22 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Thursday, November 23, 2023 3:33 PM >Subject: Re: [PATCH] hw/ppc: Improve build for PPC VFIO > >On 11/23/23 07:01, Zhenzhong Duan wrote: >> VFIO is not a required subsystem for the pseries machine but it's >> force enabled currently.

Re: [PATCH] hw/ppc: Improve build for PPC VFIO

2023-11-22 Thread Cédric Le Goater
On 11/23/23 07:01, Zhenzhong Duan wrote: VFIO is not a required subsystem for the pseries machine but it's force enabled currently. When --without-default-devices is used to drop some default devices including vfio-pci, vfio core code is still kept which is unnecessary. Introduce a stub file to

Re: [PATCH v6 0/5] gdbstub and TCG plugin improvements

2023-11-22 Thread Akihiko Odaki
On 2023/11/23 12:10, Alistair Francis wrote: On Mon, Oct 30, 2023 at 3:49 PM Akihiko Odaki wrote: Based-on: <20231029145033.592566-1-alex.ben...@linaro.org> ("[PATCH v2 00/19] Maintainer updates for testing, gdb, semihosting and plugins (pre-PR)") This series extracts fixes and refactorings

Re: [PATCH v6 1/5] hw/riscv: Use misa_mxl instead of misa_mxl_max

2023-11-22 Thread Akihiko Odaki
On 2023/11/23 12:04, Alistair Francis wrote: On Mon, Oct 30, 2023 at 3:50 PM Akihiko Odaki wrote: The effective MXL value matters when booting. This doesn't sound right. Surely the max is what matters here Also, this was specifically changed to misa_mxl_max in db23e5d981a "target/riscv:

Re: [PATCH-for-9.0] hw/mips/cps: Simplify access to 'start-powered-off' property

2023-11-22 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Since commit c1b701587e ("target/arm: Move start-powered-off > property to generic CPUState"), all target CPUs have the > 'start-powered-off' property. > > This object_property_set_bool() call can not fail. Use _abort > to simplify. > > Signed-off-by: Philippe

Re: [PATCH for-8.2] ui/vnc-clipboard: fix inflate_buffer

2023-11-22 Thread Marc-André Lureau
Hi On Wed, Nov 22, 2023 at 5:25 PM Fiona Ebner wrote: > > Am 22.11.23 um 14:06 schrieb Marc-André Lureau: > > Hi > > > > On Wed, Nov 22, 2023 at 5:00 PM Fiona Ebner wrote: > >> > >> Commit d921fea338 ("ui/vnc-clipboard: fix infinite loop in > >> inflate_buffer (CVE-2023-3255)") removed this

[PATCH] hw/ppc: Improve build for PPC VFIO

2023-11-22 Thread Zhenzhong Duan
VFIO is not a required subsystem for the pseries machine but it's force enabled currently. When --without-default-devices is used to drop some default devices including vfio-pci, vfio core code is still kept which is unnecessary. Introduce a stub file to hold stub functions of VFIO EEH hooks,

[PATCH v3 1/2] ppc/spapr: Introduce SPAPR_IRQ_NR_IPIS to refer IRQ range for CPU IPIs.

2023-11-22 Thread Harsh Prateek Bora
spapr_irq_init currently uses existing macro SPAPR_XIRQ_BASE to refer to the range of CPU IPIs during initialization of nr-irqs property. It is more appropriate to have its own define which can be further reused as appropriate for correct interpretation. Signed-off-by: Harsh Prateek Bora

[PATCH v3 2/2] ppc/spapr: Initialize max_cpus limit to SPAPR_IRQ_NR_IPIS.

2023-11-22 Thread Harsh Prateek Bora
Initialize the machine specific max_cpus limit as per the maximum range of CPU IPIs available. Keeping between 4096 to 8192 will throw IRQ not free error due to XIVE/XICS limitation and keeping beyond 8192 will hit assert in tcg_region_init or spapr_xive_claim_irq. Logs: Without patch fix:

[PATCH v3 0/2] Introduce SPAPR_IRQ_NR_IPIS and fix max-cpus

2023-11-22 Thread Harsh Prateek Bora
On spapr, the max number of CPU IPIs are 4096 which is accounted during spapr_irq_init but currently existing macro SPAPR_XIRQ_BASE is being used to refer to that. Introducing SPAPR_IRQ_NR_IPIS to refer to the range of CPU IPIS which is being further used to initialize mc->max_cpus during

[PATCH 2/2] vhost-user-scsi: free the inflight area when reset

2023-11-22 Thread Li Feng
Keep it the same to vhost-user-blk. At the same time, fix the vhost_reset_device. Signed-off-by: Li Feng --- hw/scsi/vhost-user-scsi.c | 16 hw/virtio/virtio.c| 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/scsi/vhost-user-scsi.c

[PATCH 0/2] fix some vhost-user issues

2023-11-22 Thread Li Feng
Li Feng (2): vhost-user: fix the reconnect error vhost-user-scsi: free the inflight area when reset hw/block/vhost-user-blk.c | 8 +++- hw/scsi/vhost-user-scsi.c | 19 ++- hw/virtio/vhost-user-gpio.c | 3 ++- hw/virtio/virtio.c | 2 +- 4 files changed,

[PATCH 1/2] vhost-user: fix the reconnect error

2023-11-22 Thread Li Feng
If the error occurs in vhost_dev_init, the value of s->connected is set to true in advance, and there is no chance to enter this function execution again in the future. Signed-off-by: Li Feng --- hw/block/vhost-user-blk.c | 8 +++- hw/scsi/vhost-user-scsi.c | 3 ++-

Re: [PATCH v2 1/2] ppc/spapr: Introduce SPAPR_NR_IPIS to refer IRQ range for CPU IPIs.

2023-11-22 Thread Harsh Prateek Bora
On 11/22/23 17:01, Cédric Le Goater wrote: Hello Harsh, Please add to your .git/config file: [diff] orderFile = /path/to/qemu/scripts/git.orderfile Sure, thanks for the suggestion. On 11/22/23 10:28, Harsh Prateek Bora wrote: spapr_irq_init currently uses existing macro

Re: [PATCH v2 2/2] ppc/spapr: Initialize max_cpus limit to SPAPR_NR_IPIS.

2023-11-22 Thread Harsh Prateek Bora
Hi Philippe, On 11/22/23 16:46, Philippe Mathieu-Daudé wrote: Hi Harsh, On 22/11/23 10:28, Harsh Prateek Bora wrote: Initialize the machine specific max_cpus limit as per the maximum range of CPU IPIs available. Keeping between 4096 to 8192 will throw IRQ not free error due to XIVE/XICS

[PATCH 14/21] target/arm/kvm: Merge kvm64.c into kvm.c

2023-11-22 Thread Richard Henderson
Since kvm32.c was removed, there is no need to keep them separate. This will allow more symbols to be unexported. Signed-off-by: Richard Henderson --- target/arm/kvm.c | 789 +++ target/arm/kvm64.c | 820 -

[PATCH 15/21] target/arm/kvm: Unexport kvm_arm_vcpu_init

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 12 target/arm/kvm.c | 12 +++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 1043123cc7..b96ff35e34 100644 --- a/target/arm/kvm_arm.h +++

[PATCH 16/21] target/arm/kvm: Unexport kvm_arm_vcpu_finalize

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 14 -- target/arm/kvm.c | 14 +- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index b96ff35e34..9b630a1631 100644 --- a/target/arm/kvm_arm.h +++

[PATCH 20/21] target/arm/kvm: Unexport and tidy kvm_arm_sync_mpstate_to_{kvm, qemu}

2023-11-22 Thread Richard Henderson
Drop fprintfs and actually use the return values in the callers. Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 20 target/arm/kvm.c | 23 ++- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/target/arm/kvm_arm.h

[PATCH 10/21] target/arm/kvm: Move kvm_arm_get_host_cpu_features and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 22 target/arm/kvm.c | 265 +++ target/arm/kvm64.c | 254 - 3 files changed, 265 insertions(+), 276 deletions(-) diff --git

[PATCH 19/21] target/arm/kvm: Unexport kvm_{get,put}_vcpu_events

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 20 target/arm/kvm.c | 20 ++-- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 1ec2476de7..b4339d49d1 100644 ---

[PATCH 08/21] target/arm/kvm: Unexport kvm_arm_{get, put}_virtual_time

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 16 target/arm/kvm.c | 16 ++-- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 9fa9cb7f76..e7c32f6ed0 100644 --- a/target/arm/kvm_arm.h

[PATCH 13/21] target/arm/kvm: Move kvm_arm_reg_syncs_via_cpreg_list and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 10 -- target/arm/kvm.c | 23 +++ target/arm/kvm64.c | 15 --- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index

[PATCH 17/21] target/arm/kvm: Unexport kvm_arm_init_cpreg_list

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 12 target/arm/kvm.c | 10 -- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 9b630a1631..350ba6cb96 100644 --- a/target/arm/kvm_arm.h +++

[PATCH 01/21] accel/kvm: Make kvm_has_guest_debug static

2023-11-22 Thread Richard Henderson
This variable is not used or declared outside kvm-all.c. Signed-off-by: Richard Henderson --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index e39a810a4e..f138e7fefe 100644 --- a/accel/kvm/kvm-all.c +++

[PATCH 12/21] target/arm/kvm: Move kvm_arm_cpreg_level and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 9 - target/arm/kvm.c | 22 ++ target/arm/kvm64.c | 15 --- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index

[PATCH 07/21] target/arm/kvm: Move kvm_arm_handle_debug and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 9 -- target/arm/kvm.c | 77 target/arm/kvm64.c | 70 3 files changed, 77 insertions(+), 79 deletions(-) diff --git a/target/arm/kvm_arm.h

[PATCH 03/21] target/arm/kvm: Merge kvm_arm_init_debug into kvm_arch_init

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 8 target/arm/kvm.c | 8 +++- target/arm/kvm64.c | 12 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 051a0da41c..fe6d824a52 100644 ---

[PATCH 21/21] target/arm/kvm: Unexport kvm_arm_vm_state_change

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 2 -- target/arm/kvm.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 8a44a6b762..2037b2d7ea 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@

[PATCH 11/21] target/arm/kvm: Use a switch for kvm_arm_cpreg_level

2023-11-22 Thread Richard Henderson
Use a switch instead of a linear search through data. Signed-off-by: Richard Henderson --- target/arm/kvm64.c | 32 +--- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 504526b24c..61fb9dbde0 100644 ---

[PATCH for-9.0 00/21] target/arm: kvm cleanups

2023-11-22 Thread Richard Henderson
This is primarily concerned with merging kvm64.c with kvm.c and then unexporting everything that is not required outside. r~ Chao Du (1): target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe Richard Henderson (20): accel/kvm: Make kvm_has_guest_debug static target/arm/kvm:

[PATCH 18/21] target/arm/kvm: Init cap_has_inject_serror_esr in kvm_arch_init

2023-11-22 Thread Richard Henderson
There is no need to do this in kvm_arch_init_vcpu per vcpu. Inline kvm_arm_init_serror_injection rather than keep separate. Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 8 target/arm/kvm.c | 13 - 2 files changed, 4 insertions(+), 17 deletions(-) diff

[PATCH 04/21] target/arm/kvm: Move kvm_arm_verify_ext_dabt_pending and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 10 target/arm/kvm.c | 57 target/arm/kvm64.c | 49 - 3 files changed, 57 insertions(+), 59 deletions(-) diff --git a/target/arm/kvm_arm.h

[PATCH 06/21] target/arm/kvm: Move kvm_arm_hw_debug_active and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 8 target/arm/kvm.c | 11 +++ target/arm/kvm64.c | 5 - 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 207b7f21b0..ac4856cb46 100644 ---

[PATCH 09/21] target/arm/kvm: Inline kvm_arm_steal_time_supported

2023-11-22 Thread Richard Henderson
This function is only used once, and is quite simple. Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 13 - target/arm/kvm64.c | 7 +-- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index

[PATCH 02/21] target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe

2023-11-22 Thread Richard Henderson
From: Chao Du The KVM_CAP_SET_GUEST_DEBUG is probed during kvm_init(). gdbserver will fail to start if the CAP is not supported. So no need to make another probe here, like other targets. Signed-off-by: Chao Du Reviewed-by: Richard Henderson Message-Id:

[PATCH 05/21] target/arm/kvm: Move kvm_arm_copy_hw_debug_data and unexport

2023-11-22 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/kvm_arm.h | 10 -- target/arm/kvm.c | 24 target/arm/kvm64.c | 17 - 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index

Re: [PATCH v6 0/5] gdbstub and TCG plugin improvements

2023-11-22 Thread Alistair Francis
On Mon, Oct 30, 2023 at 3:49 PM Akihiko Odaki wrote: > > Based-on: <20231029145033.592566-1-alex.ben...@linaro.org> > ("[PATCH v2 00/19] Maintainer updates for testing, gdb, semihosting and > plugins (pre-PR)") > > This series extracts fixes and refactorings that can be applied > independently

Re: [PATCH v6 2/5] target/riscv: Remove misa_mxl validation

2023-11-22 Thread Alistair Francis
On Mon, Oct 30, 2023 at 3:50 PM Akihiko Odaki wrote: > > It is initialized with a simple assignment and there is little room for > error. In fact, the validation is even more complex. > > Signed-off-by: Akihiko Odaki > Acked-by: LIU Zhiwei > Reviewed-by: Daniel Henrique Barboza Acked-by:

Re: [PATCH v6 1/5] hw/riscv: Use misa_mxl instead of misa_mxl_max

2023-11-22 Thread Alistair Francis
On Mon, Oct 30, 2023 at 3:50 PM Akihiko Odaki wrote: > > The effective MXL value matters when booting. This doesn't sound right. Surely the max is what matters here Also, this was specifically changed to misa_mxl_max in db23e5d981a "target/riscv: Replace riscv_cpu_is_32bit with riscv_cpu_mxl".

[PATCH v3 3/3] hw/nvme: Add SPDM over DOE support

2023-11-22 Thread Alistair Francis
From: Wilfred Mallawa Setup Data Object Exchance (DOE) as an extended capability for the NVME controller and connect SPDM to it (CMA) to it. Signed-off-by: Wilfred Mallawa Signed-off-by: Alistair Francis Reviewed-by: Jonathan Cameron Acked-by: Klaus Jensen --- docs/specs/index.rst|

[PATCH v3 2/3] backends: Initial support for SPDM socket support

2023-11-22 Thread Alistair Francis
From: Huai-Cheng Kuo SPDM enables authentication, attestation and key exchange to assist in providing infrastructure security enablement. It's a standard published by the DMTF [1]. SPDM supports multiple transports, including PCIe DOE and MCTP. This patch adds support to QEMU to connect to an

[PATCH v3 1/3] hw/pci: Add all Data Object Types defined in PCIe r6.0

2023-11-22 Thread Alistair Francis
Add all of the defined protocols/features from the PCIe-SIG r6.0 "Table 6-32 PCI-SIG defined Data Object Types (Vendor ID = 0001h)" table. Signed-off-by: Alistair Francis Reviewed-by: Jonathan Cameron --- include/hw/pci/pcie_doe.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v3 0/3] Initial support for SPDM Responders

2023-11-22 Thread Alistair Francis
The Security Protocol and Data Model (SPDM) Specification defines messages, data objects, and sequences for performing message exchanges over a variety of transport and physical media. - https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.3.0.pdf SPDM currently supports PCIe

Re: [PATCH] tests/avocado/reverse_debugging: Disable the ppc64 tests by default

2023-11-22 Thread Nicholas Piggin
On Tue Nov 21, 2023 at 5:18 AM AEST, John Snow wrote: > On Wed, Nov 15, 2023 at 12:23 PM Daniel P. Berrangé > wrote: > > > > On Wed, Nov 15, 2023 at 01:14:53PM +, Daniel P. Berrangé wrote: > > > On Wed, Nov 15, 2023 at 07:23:01AM +0100, Thomas Huth wrote: > > > > On 15/11/2023 02.15,

Re: [PATCH v4 03/11] ppc/pnv: New powernv10-rainier machine type

2023-11-22 Thread Nicholas Piggin
On Tue Nov 21, 2023 at 5:29 PM AEST, Cédric Le Goater wrote: > On 11/21/23 02:33, Nicholas Piggin wrote: > > On Tue Nov 21, 2023 at 9:51 AM AEST, Glenn Miles wrote: > >> Create a new powernv machine type, powernv10-rainier, that > >> will contain rainier-specific devices. > > > > Is the plan to

[PATCH] RISC-V: Increase max vlen to 4096

2023-11-22 Thread Patrick O'Neill
QEMU currently limits the max vlenb to 1024. GCC sets the upper bound to 4096 [1]. There doesn't seem to be an upper bound set by the spec [2] so this patch just changes QEMU to match GCC's upper bound. [1]

Re: [PATCH] target/ppc: Update gdbstub to read SPR's CFAR, DEC, HDEC, TB-L/U

2023-11-22 Thread Nicholas Piggin
On Mon Sep 18, 2023 at 7:26 PM AEST, Saif Abrar wrote: > SPR's CFAR, DEC, HDEC, TB-L/U are not implemented as part of CPUPPCState. > Hence, gdbstub is not able to access them using (CPUPPCState *)env->spr[] > array. > Update gdb_get_spr_reg() method to handle these SPR's specifically. > >

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Tue, 2023-11-21 at 22:10 +, Volodymyr Babchuk wrote: >> >> --- a/hw/xen/xen-operations.c >> +++ b/hw/xen/xen-operations.c >> @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle >> *h,

Re: [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-22 Thread Volodymyr Babchuk
Hi Vikram, Vikram Garhwal writes: > Hi Volodymyr, > Thank you sharing this patch. I have few comments below > On Wed, Nov 22, 2023 at 02:39:46PM -0800, Stefano Stabellini wrote: >> +Vikram >> >> On Tue, 21 Nov 2023, Volodymyr Babchuk wrote: >> > From: Oleksandr Tyshchenko >> > >> > The

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Volodymyr Babchuk
Hi, Volodymyr Babchuk writes: > Hi Stefano, > > Stefano Stabellini writes: > >> On Wed, 22 Nov 2023, David Woodhouse wrote: >>> On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: >>> > On Wed, 22 Nov 2023, David Woodhouse wrote: >>> > > On Wed, 2023-11-22 at 14:29 -0800, Stefano

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Woodhouse, David
On Wed, 2023-11-22 at 23:49 +, Volodymyr Babchuk wrote: > > I can just pull it from this link, if you don't mind. Please do; thank you! smime.p7s Description: S/MIME cryptographic signature Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Volodymyr Babchuk
Hi David, "Woodhouse, David" writes: > On Wed, 2023-11-22 at 17:05 +, Paul Durrant wrote: >> On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> > From: David Woodhouse >> > >> > This allows a XenDevice implementation to know whether it was created >> > by QEMU, or merely discovered in

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Volodymyr Babchuk
Hi Stefano, Stefano Stabellini writes: > On Wed, 22 Nov 2023, David Woodhouse wrote: >> On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: >> > On Wed, 22 Nov 2023, David Woodhouse wrote: >> > > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: >> > > > On Wed, 22 Nov

Re: [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-22 Thread Vikram Garhwal
Hi Volodymyr, Thank you sharing this patch. I have few comments below On Wed, Nov 22, 2023 at 02:39:46PM -0800, Stefano Stabellini wrote: > +Vikram > > On Tue, 21 Nov 2023, Volodymyr Babchuk wrote: > > From: Oleksandr Tyshchenko > > > > The bridge is needed for virtio-pci support, as QEMU can

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Stefano Stabellini
On Wed, 22 Nov 2023, David Woodhouse wrote: > On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: > > On Wed, 22 Nov 2023, David Woodhouse wrote: > > > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: > > > > On Wed, 22 Nov 2023, Paul Durrant wrote: > > > > > On 21/11/2023

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 22:49 +, Volodymyr Babchuk wrote: > > > On 21/11/23 23:10, Volodymyr Babchuk wrote: > > > was created by QEMU > > > > Please do not split lines between subject and content. Rewrite the > > full line. Preferably restrict the subject to 72 chars. > > I tried to come with

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 15:09 -0800, Stefano Stabellini wrote: > On Wed, 22 Nov 2023, David Woodhouse wrote: > > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: > > > On Wed, 22 Nov 2023, Paul Durrant wrote: > > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > > > > From: Oleksandr

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Stefano Stabellini
On Wed, 22 Nov 2023, David Woodhouse wrote: > On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: > > On Wed, 22 Nov 2023, Paul Durrant wrote: > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > > > From: Oleksandr Tyshchenko > > > > > > > > Instead of forcing the owner to domid 0,

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Volodymyr Babchuk
Hi David, David Woodhouse writes: > [[S/MIME Signed Part:Undecided]] > On Tue, 2023-11-21 at 22:10 +, Volodymyr Babchuk wrote: >> >> --- a/hw/xen/xen-operations.c >> +++ b/hw/xen/xen-operations.c >> @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle >> *h,

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 22:56 +, Volodymyr Babchuk wrote: > > > Paul Durrant writes: > > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > > From: David Woodhouse > > > This allows a XenDevice implementation to know whether it was > > > created > > > by QEMU, or merely discovered in

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread David Woodhouse
On Wed, 2023-11-22 at 14:29 -0800, Stefano Stabellini wrote: > On Wed, 22 Nov 2023, Paul Durrant wrote: > > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > > From: Oleksandr Tyshchenko > > > > > > Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to > > > inherit the owner of the

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread David Woodhouse
On Tue, 2023-11-21 at 22:10 +, Volodymyr Babchuk wrote: > > --- a/hw/xen/xen-operations.c > +++ b/hw/xen/xen-operations.c > @@ -300,6 +300,18 @@ static bool libxenstore_create(struct qemu_xs_handle *h, > xs_transaction_t t, > return false; > } >   > +    if (owner ==

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Volodymyr Babchuk
Paul Durrant writes: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> From: David Woodhouse >> This allows a XenDevice implementation to know whether it was >> created >> by QEMU, or merely discovered in XenStore after the toolstack created >> it. This will allow us to create

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Volodymyr Babchuk
Hi Paul, Paul Durrant writes: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: >> was created by QEMU >> Xen PV devices in QEMU can be created in two ways: either by QEMU >> itself, if they were passed via command line, or by Xen toolstack. In >> the latter case, QEMU scans XenStore entries

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Volodymyr Babchuk
Hi Philippe, Philippe Mathieu-Daudé writes: > Hi Volodymyr, > > On 21/11/23 23:10, Volodymyr Babchuk wrote: >> was created by QEMU > > Please do not split lines between subject and content. Rewrite the > full line. Preferably restrict the subject to 72 chars. I tried to come with shorter

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Woodhouse, David
On Wed, 2023-11-22 at 17:03 +, Paul Durrant wrote: > > > This patch checks presence of xendev->backend to check if Xen PV > > device is acting as a backend (i.e. it was configured by Xen > > Technally *all* XenDevice objects are backends. Right. The key criterion is whether the backend was

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Woodhouse, David
On Wed, 2023-11-22 at 17:05 +, Paul Durrant wrote: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > From: David Woodhouse > > > > This allows a XenDevice implementation to know whether it was created > > by QEMU, or merely discovered in XenStore after the toolstack created > > it. This

Re: [PATCH v2 6/6] xen_arm: Add virtual PCIe host bridge support

2023-11-22 Thread Stefano Stabellini
+Vikram On Tue, 21 Nov 2023, Volodymyr Babchuk wrote: > From: Oleksandr Tyshchenko > > The bridge is needed for virtio-pci support, as QEMU can emulate the > whole bridge with any virtio-pci devices connected to it. > > This patch provides a flexible way to configure PCIe brige resources >

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Stefano Stabellini
On Wed, 22 Nov 2023, Paul Durrant wrote: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > From: Oleksandr Tyshchenko > > > > Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to > > inherit the owner of the directory. > > Ah... so that's why the previous patch is there. > >

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Stefano Stabellini
On Wed, 22 Nov 2023, Paul Durrant wrote: > On 21/11/2023 22:10, Volodymyr Babchuk wrote: > > Add option to preserve owner when creating an entry in Xen Store. This > > may be needed in cases when Qemu is working as device model in a > > *may* be needed? > > I don't undertstand why this patch is

Re: [PATCH-for-8.2 v2 1/2] hw/net/can/xlnx-zynqmp: Avoid underflow while popping TX FIFOs

2023-11-22 Thread Vikram Garhwal
Hi, On Sun, Nov 19, 2023 at 11:51:01PM +0100, Philippe Mathieu-Daudé wrote: > Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format > > Message Format > > The same message format is used for RXFIFO, TXFIFO, and TXHPB. > Each message includes four words (16 bytes).

Re: [PATCH-for-8.2 v2 2/2] hw/net/can/xlnx-zynqmp: Avoid underflow while popping RX FIFO

2023-11-22 Thread Vikram Garhwal
On Wed, Nov 22, 2023 at 08:45:56PM +0100, Francisco Iglesias wrote: > On Sun, Nov 19, 2023 at 11:51:02PM +0100, Philippe Mathieu-Daudé wrote: > > Per > > https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format > > > > Message Format > > > > The same message format is used

Re: [PATCH-for-9.0] iothread: Remove unused Error** argument in aio_context_set_aio_params

2023-11-22 Thread Stefan Hajnoczi
On Mon, Nov 20, 2023 at 06:18:06PM +0100, Philippe Mathieu-Daudé wrote: > aio_context_set_aio_params() doesn't use its undocumented > Error** argument. Remove it to simplify. > > Note this removes a use of "unchecked Error**" in > iothread_set_aio_context_params(). > > Signed-off-by: Philippe

Re: [PATCH-for-9.0] hw/ppc/xive2_regs: Remove unnecessary 'cpu.h' inclusion

2023-11-22 Thread Cédric Le Goater
On 11/22/23 19:39, Philippe Mathieu-Daudé wrote: xive2_regs.h only requires declarations from "qemu/bswap.h". Include it instead of the huge target-specific "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/ppc/xive2_regs.h | 2 +-

Re: [PATCH-for-8.2 v2 2/2] hw/net/can/xlnx-zynqmp: Avoid underflow while popping RX FIFO

2023-11-22 Thread Francisco Iglesias
On Sun, Nov 19, 2023 at 11:51:02PM +0100, Philippe Mathieu-Daudé wrote: > Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format > > Message Format > > The same message format is used for RXFIFO, TXFIFO, and TXHPB. > Each message includes four words (16 bytes).

Re: [PATCH-for-8.2 v2 1/2] hw/net/can/xlnx-zynqmp: Avoid underflow while popping TX FIFOs

2023-11-22 Thread Francisco Iglesias
On Sun, Nov 19, 2023 at 11:51:01PM +0100, Philippe Mathieu-Daudé wrote: > Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format > > Message Format > > The same message format is used for RXFIFO, TXFIFO, and TXHPB. > Each message includes four words (16 bytes).

[PATCH-for-9.0] hw/mips: Inline 'bios.h' definitions

2023-11-22 Thread Philippe Mathieu-Daudé
There is no universal BIOS, each machine needs a specific one. Move the machine-specific definitions to each machine code and remove this bogus header. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/mips/bios.h | 14 -- hw/mips/jazz.c | 10 +- hw/mips/malta.c

[PATCH-for-9.0] hw/ppc/xive2_regs: Remove unnecessary 'cpu.h' inclusion

2023-11-22 Thread Philippe Mathieu-Daudé
xive2_regs.h only requires declarations from "qemu/bswap.h". Include it instead of the huge target-specific "cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ppc/xive2_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/ppc/xive2_regs.h

[PATCH-for-9.0] hw/mips/cps: Simplify access to 'start-powered-off' property

2023-11-22 Thread Philippe Mathieu-Daudé
Since commit c1b701587e ("target/arm: Move start-powered-off property to generic CPUState"), all target CPUs have the 'start-powered-off' property. This object_property_set_bool() call can not fail. Use _abort to simplify. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/cps.c | 7 +++ 1

[PATCH-for-9.0 06/11] hw/arm/bcm2836: Simplify use of 'reset-cbar' property

2023-11-22 Thread Philippe Mathieu-Daudé
bcm2836_realize() is called by - bcm2836_class_init() which sets: bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a7") - bcm2837_class_init() which sets: bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a53") Both Cortex-A7 / A53 have the ARM_FEATURE_CBAR set. If it isn't, then this is a

[RFC PATCH-for-9.0 02/11] target/arm: Add target_aarch64_available() helper

2023-11-22 Thread Philippe Mathieu-Daudé
We want to build HW models once, but don't want to register types when all prerequisites are satisfied. Add the target_aarch64_available() to know at runtime whether TARGET_AARCH64 is built-in. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu-qom.h | 2 ++ target/arm/cpu.c | 9

[RFC PATCH-for-9.0 09/11] hw/arm/bcm2836: Allocate ARM CPU state with object_new()

2023-11-22 Thread Philippe Mathieu-Daudé
The ARMCPU type is forward declared as a pointer to all hw/ files. Its declaration is restricted to target/arm/ files. By using a pointer in BCM283XState instead of embedding the whole CPU state, we don't need to include "cpu.h" which is target-specific. Signed-off-by: Philippe Mathieu-Daudé ---

[RFC PATCH-for-9.0 11/11] hw/intc/meson: Simplify how arm_gicv3_kvm.o objects are built

2023-11-22 Thread Philippe Mathieu-Daudé
Use the target_aarch64_available() to build the ARM_GIC_KVM types regardless the ARM/AARCH64 targets are selected, but restrict its registration to TARGET_AARCH64 presence at runtime. This will help to have a single binary running both ARM/Aarch64. Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH-for-9.0 08/11] hw/arm/bcm2836: Use ARM_CPU 'mp-affinity' property

2023-11-22 Thread Philippe Mathieu-Daudé
The 'mp-affinity' property is present since commit 15a21fe028 ("target-arm: Add mp-affinity property for ARM CPU class"). Use it and remove a /* TODO */ comment. Since all ARM CPUs have this property, use _abort, because this call can not fail. Signed-off-by: Philippe Mathieu-Daudé ---

[RFC PATCH-for-9.0 01/11] qom: Introduce the TypeInfo::can_register() handler

2023-11-22 Thread Philippe Mathieu-Daudé
Add a helper to decide at runtime whether a type can be registered to the QOM framework or not. Signed-off-by: Philippe Mathieu-Daudé --- include/qom/object.h | 4 qom/object.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index

[RFC PATCH-for-9.0 10/11] hw/arm/raspi: Build bcm2836.o and raspi.o objects once

2023-11-22 Thread Philippe Mathieu-Daudé
Use the target_aarch64_available() method to restrict Aarch64 specific models. They will only be added at runtime if TARGET_AARCH64 is built in. The Raspberry Pi models can now be built once for all targets. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/bcm2836.c | 5 + hw/arm/raspi.c

[PATCH-for-9.0 03/11] target/arm: Declare ARM_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'

2023-11-22 Thread Philippe Mathieu-Daudé
Missed in commit 2d56be5a29 ("target: Declare FOO_CPU_TYPE_NAME/SUFFIX in 'cpu-qom.h'"). See it for more details. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu-qom.h | 3 +++ target/arm/cpu.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH-for-9.0 07/11] hw/arm/bcm2836: Simplify access to 'start-powered-off' property

2023-11-22 Thread Philippe Mathieu-Daudé
All ARM CPUs have the 'start-powered-off' property since commit 5de164304a ("arm: Allow secondary KVM CPUs to be booted via PSCI"). Note: since commit c1b701587e ("target/arm: Move start-powered-off property to generic CPUState"), all CPUs for all targets have it. Signed-off-by: Philippe

[PATCH-for-9.0 00/11] hw/arm: Step toward building qemu-system-{arm, aarch64} altogether

2023-11-22 Thread Philippe Mathieu-Daudé
Hi, This series is a step toward having a single qemu-system-aarch64 binary for both ARM and Aarch64 variants. First we add the TypeInfo::can_register() handler to QOM, to be able to decide at runtime if a type can be registered. We'll later use the target_aarch64_available() method to restrict

[PATCH-for-9.0 05/11] target/arm: Move GTIMER definitions to 'cpu-defs.h'

2023-11-22 Thread Philippe Mathieu-Daudé
To allow GTIMER_* definitions to be used by non-ARM specific hardware models, move them to a new target agnostic "cpu-defs.h" header. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu-defs.h | 19 +++ target/arm/cpu.h | 8 +--- hw/arm/bcm2836.c | 1 + 3

[PATCH-for-9.0 04/11] target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h'

2023-11-22 Thread Philippe Mathieu-Daudé
The ARM_CPU_IRQ/FIQ definitions are meant for the ARM CPU QOM model. Move them to "cpu-qom.h" so any QOM code can use them. Signed-off-by: Philippe Mathieu-Daudé --- Or do these definitions belong to cpu-defs.h? --- target/arm/cpu-qom.h | 6 ++ target/arm/cpu.h | 6 -- 2 files

Re: [PATCH] hw/net/rocker: avoid NULL pointer dereference in of_dpa_cmd_add_l2_flood

2023-11-22 Thread Michael Tokarev
LORE has better view/threading for this one, https://lore.kernel.org/qemu-devel/20220624143912.1234427-1-mcasc...@redhat.com/ Which also links to https://gitlab.com/qemu-project/qemu/-/issues/1851 So basically, n/m. /mjt

Re: [PATCH 06/19] qapi/schema: adjust type narrowing for mypy's benefit

2023-11-22 Thread John Snow
On Wed, Nov 22, 2023, 7:00 AM Markus Armbruster wrote: > John Snow writes: > > > On Tue, Nov 21, 2023, 9:09 AM Markus Armbruster > wrote: > > > >> John Snow writes: > >> > >> > We already take care to perform some type narrowing for arg_type and > >> > ret_type, but not in a way where mypy

[PATCH] hw/net/rocker: avoid NULL pointer dereference in of_dpa_cmd_add_l2_flood

2023-11-22 Thread Michael Tokarev
Did this lost this CVE-2022-36648 fix? https://lists.nongnu.org/archive/html/qemu-devel/2022-06/msg04469.html rocker_tlv_parse_nested could return early because of no group ids in the group_tlvs. In such case tlvs is NULL; tlvs[i + 1] in the next for-loop will deref the NULL pointer.

Re: [PATCH v2 4/6] xen_pvdev: Do not assume Dom0 when creating a directory

2023-11-22 Thread Paul Durrant
On 21/11/2023 22:10, Volodymyr Babchuk wrote: From: Oleksandr Tyshchenko Instead of forcing the owner to domid 0, use XS_PRESERVE_OWNER to inherit the owner of the directory. Ah... so that's why the previous patch is there. This is not the right way to fix it. The QEMU Xen support is

Re: [PATCH v2 3/6] xen: xenstore: add possibility to preserve owner

2023-11-22 Thread Paul Durrant
On 21/11/2023 22:10, Volodymyr Babchuk wrote: Add option to preserve owner when creating an entry in Xen Store. This may be needed in cases when Qemu is working as device model in a *may* be needed? I don't undertstand why this patch is necessary and the commit comment isn't really helping

Re: [PATCH v2 1/6] hw/xen: Set XenBackendInstance in the XenDevice before realizing it

2023-11-22 Thread Paul Durrant
On 21/11/2023 22:10, Volodymyr Babchuk wrote: From: David Woodhouse This allows a XenDevice implementation to know whether it was created by QEMU, or merely discovered in XenStore after the toolstack created it. This will allow us to create frontend/backend nodes only when we should, rather

Re: [PATCH v2 2/6] xen: backends: touch some XenStore nodes only if device...

2023-11-22 Thread Paul Durrant
On 21/11/2023 22:10, Volodymyr Babchuk wrote: was created by QEMU Xen PV devices in QEMU can be created in two ways: either by QEMU itself, if they were passed via command line, or by Xen toolstack. In the latter case, QEMU scans XenStore entries and configures devices accordingly. In the

  1   2   >