Re: [PATCH] hw/vfio: fix iteration over global VFIODevice list

2024-01-02 Thread Cédric Le Goater
On 1/2/24 05:27, Duan, Zhenzhong wrote: -Original Message- From: Volker Rümelin Subject: [PATCH] hw/vfio: fix iteration over global VFIODevice list Commit 3d779abafe ("vfio/common: Introduce a global VFIODevice list") introduced a global VFIODevice list, but forgot to update the list

Re: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence

2024-01-02 Thread Cédric Le Goater
On 12/21/23 09:09, Cédric Le Goater wrote: Using stat() before opening a file or a directory can lead to a time-of-check to time-of-use (TOCTOU) filesystem race, which is reported by coverity as a Security best practices violations. The sequence could be replaced by open and fdopendir but it does

Re: [PATCH] vfio/container: Rename vfio_init_container to vfio_set_iommu

2024-01-02 Thread Cédric Le Goater
On 12/21/23 03:45, Zhenzhong Duan wrote: vfio_container_init() and vfio_init_container() names are confusing especially when we see vfio_init_container() calls vfio_container_init(). vfio_container_init() operates on base container which is consistent with all routines handling 'VFIOContainerBas

Re: [PATCH 2/2] hw/s390x/ccw: Replace dirname() with g_path_get_dirname()

2024-01-02 Thread Cédric Le Goater
On 12/21/23 18:19, Zhao Liu wrote: From: Zhao Liu As commit 3e015d815b3f ("use g_path_get_basename instead of basename") said, g_path_get_dirname() should be preferred over dirname() since the former is a portable utility function that has the advantage of not modifing the string argument. Rep

Re: [PATCH 1/2] hw/s390x/ccw: Replace basename() with g_path_get_basename()

2024-01-02 Thread Cédric Le Goater
On 12/21/23 18:19, Zhao Liu wrote: From: Zhao Liu g_path_get_basename() is a portable utility function that has the advantage of not modifing the string argument, so it should be preferred over basename(). And also to avoid potential compile breakage with the Musl C library similar to [1], rep

Re: [PATCH] vfio/migration: Add helper function to set state or reset device

2024-01-02 Thread Cédric Le Goater
On 12/31/23 11:48, Avihai Horon wrote: There are several places where failure in setting the device state leads to a device reset, which is done by setting ERROR as the recover state. Add a helper function that sets the device state and resets the device in case of failure. This will make the co

Adding custom CSR to riscv-qemu

2024-01-02 Thread Nati Rapaport
Hello, I'm going to add some custom CSRs (Control & Status Registers) to a new RiscV core in qemu. Could you please help me understanding if there is any method to do it? Should I do it in /target/riscv/cpu_bits.h where all CSRs are defined (and other files, where all standard CSRs implementatio

Re: [PATCH v2 2/2] target/loongarch: move translate modules to tcg/

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 03:02, Song Gao wrote: Introduce the target/loongarch/tcg directory. Its purpose is to hold the TCG code that is selected by CONFIG_TCG Signed-off-by: Song Gao --- target/loongarch/{ => tcg}/constant_timer.c | 0 target/loongarch/{ => tcg}/csr_helper.c | 0 target/loonga

Re: [PATCH v2 1/2] target/loongarch/meson: move gdbstub.c to loongarch.ss

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 03:01, Song Gao wrote: gdbstub.c is not specific to TCG and can be used by other accelerators, such as KVM accelerator Suggested-by: Philippe Mathieu-Daudé I didn't really suggested the change but the split ;) Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Song Gao --- ta

Re: [PATCH] vfio/migration: Add helper function to set state or reset device

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 11:48, Avihai Horon wrote: There are several places where failure in setting the device state leads to a device reset, which is done by setting ERROR as the recover state. Add a helper function that sets the device state and resets the device in case of failure. This will make the co

Re: [PATCH 2/8] vga: introduce VGADisplayParams

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 10:39, Paolo Bonzini wrote: The next patches will introduce more parameters that cause a full refresh. Instead of adding arguments to get_offsets and lines to update_basic_params, do everything through a struct. Signed-off-by: Paolo Bonzini --- hw/display/cirrus_vga.c | 24 +-

Re: [PATCH 6/8] vga: reindent memory access code

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 10:39, Paolo Bonzini wrote: The next patch will reuse latched memory access in text modes. Start with a patch that moves the latched access code out of the "if". Best reviewed with "git diff -b". Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 211 ---

Re: [PATCH 03/11] migration: Refactor migration_incoming_setup()

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 10:30, Avihai Horon wrote: Commit 6720c2b32725 ("migration: check magic value for deciding the mapping of channels") extracted the only code that could fail in migration_incoming_setup(). Now migration_incoming_setup() can't fail, so refactor it to return void and remove errp paramet

Re: [PATCH 06/11] migration/multifd: Simplify multifd_channel_connect() if else statement

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 10:30, Avihai Horon wrote: The else branch in multifd_channel_connect() is redundant because when the if branch is taken the function returns. Simplify the code by removing the else branch. Signed-off-by: Avihai Horon --- migration/multifd.c | 13 ++--- 1 file changed, 6

Re: [PATCH 09/11] migration: Fix migration_channel_read_peek() error path

2024-01-02 Thread Philippe Mathieu-Daudé
+Markus On 31/12/23 10:30, Avihai Horon wrote: migration_channel_read_peek() calls qio_channel_readv_full() and handles both cases of return value == 0 and return value < 0 the same way, by calling error_setg() with errp. However, if return value < 0, errp is already set, so calling error_setg()

Re: [PATCH 11/11] migration/multifd: Remove unnecessary usage of local Error

2024-01-02 Thread Philippe Mathieu-Daudé
On 31/12/23 10:30, Avihai Horon wrote: According to Error API, usage of ERRP_GUARD() or a local Error instead of errp is needed if errp is passed to void functions, where it is later dereferenced to see if an error occurred. There are several places in multifd.c that use local Error although it

Re: [PATCH] mailmap: Fix Stefan Weil author email again

2024-01-02 Thread Stefan Hajnoczi
On Wed, Dec 27, 2023 at 10:21:26AM +0100, Philippe Mathieu-Daudé wrote: > On 27/12/23 10:12, Philippe Mathieu-Daudé wrote: > > On 27/12/23 10:09, Michael Tokarev wrote: > > > 27.12.2023 11:59, Philippe Mathieu-Daudé: > > > > Commit 5204b499a6 ("mailmap: Fix Stefan Weil author email") > > > > correc

Re: [PATCH] tcg/ppc: Use new registers for LQ destination

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 02:34, Richard Henderson wrote: LQ has a constraint that RTp != RA, else SIGILL. Therefore, force the destination of INDEX_op_qemu_*_ld128 to be a new register pair, so that it cannot overlap the input address. This requires new support in process_op_defs and tcg_reg_alloc_op. Cc: qem

Re: [PATCH] vfio/migration: Add helper function to set state or reset device

2024-01-02 Thread Cédric Le Goater
On 12/31/23 11:48, Avihai Horon wrote: There are several places where failure in setting the device state leads to a device reset, which is done by setting ERROR as the recover state. Add a helper function that sets the device state and resets the device in case of failure. This will make the co

Re: [QEMU-devel][RFC PATCH 1/1] backends/hostmem: qapi/qom: Add an ObjectOption for memory-backend-* called HostMemType and its arg 'cxlram'

2024-01-02 Thread Philippe Mathieu-Daudé
Hi Jack, On 1/1/24 08:53, Ho-Ren (Jack) Chuang wrote: Introduce a new configuration option 'host-mem-type=' in the '-object memory-backend-ram', allowing users to specify from which type of memory to allocate. Users can specify 'cxlram' as an argument, and QEMU will then automatically locate CX

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2024-01-02 Thread Marc-André Lureau
Hi On Thu, Dec 21, 2023 at 10:55 AM Akihiko Odaki wrote: > > On 2023/12/19 23:14, Peter Maydell wrote: > > On Tue, 19 Dec 2023 at 13:49, Huang Rui wrote: > >> > >> On Tue, Dec 19, 2023 at 08:20:22PM +0800, Akihiko Odaki wrote: > >>> On 2023/12/19 16:53, Huang Rui wrote: > Sync up kernel hea

[PATCH] vhost_net: add NOTIFICATION_DATA and IN_ORDER feature bits to vdpa_feature_bits

2024-01-02 Thread Srujana Challa
Enables VIRTIO_F_NOTIFICATION_DATA and VIRTIO_F_IN_ORDER feature bits for vhost vdpa backend. Also adds code to consider all feature bits supported by vhost net client type for feature negotiation, so that vhost backend device supported features can be negotiated with guest. Signed-off-by: Srujana

Re: [PATCH] virtio-net: correctly copy vnet header when flushing TX

2024-01-02 Thread Yuri Benditovich
I agree, thank you. Where is this CVE-2023-6693 available? Thanks, Yuri On Tue, Jan 2, 2024 at 5:29 AM Jason Wang wrote: > When HASH_REPORT is negotiated, the guest_hdr_len might be larger than > the size of the mergeable rx buffer header. Using > virtio_net_hdr_mrg_rxbuf during the header swa

Re: [PATCH] virtio-net: correctly copy vnet header when flushing TX

2024-01-02 Thread Mauro Matteo Cascella
On Tue, Jan 2, 2024 at 12:20 PM Yuri Benditovich wrote: > > I agree, thank you. > > Where is this CVE-2023-6693 available? Here: https://bugzilla.redhat.com/show_bug.cgi?id=2254580. > Thanks, > Yuri > > On Tue, Jan 2, 2024 at 5:29 AM Jason Wang wrote: >> >> When HASH_REPORT is negotiated, the g

Re: PCIe with Designware RC.

2024-01-02 Thread Ben Dooks
On 24/12/2023 09:51, Shlomo Pongratz wrote: Hi, I'm working on a AARCH64 project that uses the designeware (hw/pci-host/designware.c). I've copied the designware initialization from hw/arm/fsl-imx7.c and I hope I've updated the dtsi correctly. After fixing an issue with the iATU windows (see patc

Re: [PATCH for 9.0 08/12] vdpa: add vhost_vdpa_load_setup

2024-01-02 Thread Eugenio Perez Martin
On Tue, Jan 2, 2024 at 6:33 AM Peter Xu wrote: > > Jason, Eugenio, > > Apologies for a late reply; just back from the long holiday. > > On Thu, Dec 21, 2023 at 09:20:40AM +0100, Eugenio Perez Martin wrote: > > Si-Wei did the actual profiling as he is the one with the 128G guests, > > but most of t

Re: [PATCH v13 00/26] riscv: RVA22 profiles support

2024-01-02 Thread Daniel Henrique Barboza
Hi, Drew brought to my attention the following post on the tech-unprivileged mailing list: "Architecture Review Committee meeting minutes, 12/19/23" https://lists.riscv.org/g/tech-unprivileged/message/611 Second paragraph mentions: "In response to some recent discussion in the Apps and Tools H

Re: [PATCH v6 03/11] virtio-gpu: Support context init feature with virglrenderer

2024-01-02 Thread Marc-André Lureau
Hi On Tue, Dec 19, 2023 at 11:54 AM Huang Rui wrote: > > Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init > feature flags. > We would like to enable the feature with virglrenderer, so add to create > virgl renderer context with flags using context_id when valid. > > Originally-

Re: [PATCH 5/8] vga: optimize horizontal pel panning in 256-color modes

2024-01-02 Thread BALATON Zoltan
On Mon, 1 Jan 2024, Paolo Bonzini wrote: Il dom 31 dic 2023, 17:27 BALATON Zoltan ha scritto: palette = vga->last_palette; hpel = (hpel >> 1) & 3; + +/* For 256 color modes, we can adjust the source address and write directly + * to the destination, even if horizontal pel pan

Re: [PATCH v6 04/11] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled

2024-01-02 Thread Marc-André Lureau
On Tue, Dec 19, 2023 at 11:54 AM Huang Rui wrote: > > From: Dmitry Osipenko > > The udmabuf usage is mandatory when virgl is disabled and blobs feature > enabled in the Qemu machine configuration. If virgl and blobs are enabled, > then udmabuf requirement is optional. Since udmabuf isn't widely s

Re: [PATCH v6 05/11] virtio-gpu: Introduce virgl_gpu_resource structure

2024-01-02 Thread Marc-André Lureau
Hi On Tue, Dec 19, 2023 at 11:55 AM Huang Rui wrote: > > Introduce a new virgl_gpu_resource data structure and helper functions > for virgl. It's used to add new member which is specific for virgl in > following patches of blob memory support. > > Signed-off-by: Huang Rui > --- > > New patch: >

Re: [PATCH v2 08/16] target/riscv: move 'vlen' to riscv_cpu_properties[]

2024-01-02 Thread Daniel Henrique Barboza
On 12/29/23 08:22, Vladimir Isaev wrote: 22.12.2023 15:22, Daniel Henrique Barboza wrote: Turning 'vlen' into a class property will allow its default value to be overwritten by cpu_init() later on, solving the issue we have now where CPU specific settings are getting overwritten by the defau

Re: [PATCH v2 1/2] target/loongarch/meson: move gdbstub.c to loongarch.ss

2024-01-02 Thread gaosong
在 2024/1/2 下午5:46, Philippe Mathieu-Daudé 写道: On 2/1/24 03:01, Song Gao wrote: gdbstub.c is not specific to TCG and can be used by other accelerators, such as KVM accelerator Suggested-by: Philippe Mathieu-Daudé I didn't really suggested the change but the split ;) Ah,  I can drop it for p

Re: [RFC PATCH] hw/arm: Prefer arm_feature() over object_property_find()

2024-01-02 Thread Philippe Mathieu-Daudé
Hi, On 18/12/23 10:48, Peter Maydell wrote: On Mon, 18 Dec 2023 at 07:26, Markus Armbruster wrote: Peter Maydell writes: On Thu, 14 Dec 2023 at 17:14, Philippe Mathieu-Daudé wrote: QOM properties are added on the ARM vCPU object when a feature is present. Rather than checking the proper

Re: [PATCH v2 10/16] target/riscv: create finalize_features() for KVM

2024-01-02 Thread Daniel Henrique Barboza
On 12/29/23 08:22, Vladimir Isaev wrote: 22.12.2023 15:22, Daniel Henrique Barboza wrote: To turn cbom_blocksize and cboz_blocksize into class properties we need KVM specific changes. KVM is creating its own version of these options with a customized setter() that prevents users from picking

Re: [PATCH v6 0/2] acpi: report numa nodes for device memory using GI

2024-01-02 Thread Jonathan Cameron via
On Mon, 25 Dec 2023 10:26:01 +0530 wrote: > From: Ankit Agrawal > > There are upcoming devices which allow CPU to cache coherently access > their memory. It is sensible to expose such memory as NUMA nodes separate > from the sysmem node to the OS. The ACPI spec provides a scheme in SRAT > calle

[PATCH 1/2] backends/iommufd: Remove check on number of backend users

2024-01-02 Thread Cédric Le Goater
QOM already has a ref count on objects and it will assert much earlier, when INT_MAX is reached. Signed-off-by: Cédric Le Goater --- backends/iommufd.c | 5 - 1 file changed, 5 deletions(-) diff --git a/backends/iommufd.c b/backends/iommufd.c index ba58a0eb0d0ba9aae625c987eb728547543dba66.

[PATCH 0/2] backends/iommufd: Remove mutex

2024-01-02 Thread Cédric Le Goater
Hello ! Coverity has some reports regarding the IOMMUFDBackend mutex. Since the IOMMUFDBackend routines are called from the QEMU main thread, this series simply suggests removing the mutex and rely on the BQL to handle concurrent access. Thanks, C. Cédric Le Goater (2): backends/iommufd: Remo

[PATCH 2/2] backends/iommufd: Remove mutex

2024-01-02 Thread Cédric Le Goater
Coverity reports a concurrent data access violation because be->users is being accessed in iommufd_backend_can_be_deleted() without holding the mutex. However, these routines are called from the QEMU main thread when a device is created. In this case, the code paths should be protected by the BQL

Re: [PATCH v6 07/11] virtio-gpu: Handle resource blob commands

2024-01-02 Thread Marc-André Lureau
Hi On Tue, Dec 19, 2023 at 11:55 AM Huang Rui wrote: > > From: Antonio Caggiano > > Support BLOB resources creation, mapping and unmapping by calling the > new stable virglrenderer 0.10 interface. Only enabled when available and > via the blob config. E.g. -device virtio-vga-gl,blob=true > > Sig

Re: [PATCH v6 08/11] virtio-gpu: Resource UUID

2024-01-02 Thread Marc-André Lureau
Hi On Tue, Dec 19, 2023 at 11:55 AM Huang Rui wrote: > > From: Antonio Caggiano > > Enable resource UUID feature and implement command resource assign UUID. > This is done by introducing a hash table to map resource IDs to their > UUIDs. I agree with Akihiko, what about putting QemuUUID in stru

Re: [PATCH v6 1/2] qom: new object to associate device to numa node

2024-01-02 Thread Jonathan Cameron via
On Mon, 25 Dec 2023 10:26:02 +0530 wrote: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a d

Re: [QEMU-devel][RFC PATCH 1/1] backends/hostmem: qapi/qom: Add an ObjectOption for memory-backend-* called HostMemType and its arg 'cxlram'

2024-01-02 Thread David Hildenbrand
On 01.01.24 08:53, Ho-Ren (Jack) Chuang wrote: Introduce a new configuration option 'host-mem-type=' in the '-object memory-backend-ram', allowing users to specify from which type of memory to allocate. Users can specify 'cxlram' as an argument, and QEMU will then automatically locate CXL RAM NU

Re: [PATCH v6 10/11] virtio-gpu: Initialize Venus

2024-01-02 Thread Marc-André Lureau
Hi On Tue, Dec 19, 2023 at 11:55 AM Huang Rui wrote: > > From: Antonio Caggiano > > Request Venus when initializing VirGL. > > Signed-off-by: Antonio Caggiano > Signed-off-by: Huang Rui > --- > > Changes in v6: > - Remove the unstable API flags check because virglrenderer is already 1.0. > - S

Re: [PATCH v2 1/1] virgl: Implement resource_query_layout

2024-01-02 Thread Marc-André Lureau
Hi On Thu, Dec 21, 2023 at 3:36 PM Julia Zhang wrote: > > From: Daniel Stone > > A new ioctl to shuttle information between host and guest about the > actual buffer allocation, which can be used for interop between GL and > Vulkan when supporting standard window systems. > The command hasn't be

Re: [PATCH 01/33] hw/arm/boot: Propagate vCPU to arm_load_dtb()

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: In heterogeneous setup the first vCPU might not be the one expected, better pass it explicitly. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 02/33] hw/arm/fsl-imx6: Add a local 'gic' variable

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: The A9MPCore forward the IRQs from its internal GIC. To make the code clearer, add a 'gic' variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 03/33] hw/arm/fsl-imx6ul: Add a local 'gic' variable

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: The A7MPCore forward the IRQs from its internal GIC. To make the code clearer, add a 'gic' variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 05/33] hw/cpu: Remove dead Kconfig

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: ARM MPCore Kconfig are defined in hw/arm/Kconfig. hw/cpu/Kconfig is never used, remove it. Fixes: 82f5181777 ("kconfig: introduce kconfig files") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 04/33] hw/arm/fsl-imx7: Add a local 'gic' variable

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: The A7MPCore forward the IRQs from its internal GIC. To make the code clearer, add a 'gic' variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 06/33] hw/cpu/arm: Rename 'busdev' -> 'gicsbd' in a15mp_priv_realize()

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: 'busdev' is the internal GIC as SysBus device. Since we already have a 'gicdev' variable for the GIC as QDev, rename 'busdev' as 'gicsbd' to make it clear we access the IRQ lines from the GIC. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

Re: [PATCH 07/33] hw/cpu/arm: Alias 'num-cpu' property on TYPE_REALVIEW_MPCORE

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: No need to duplicate and forward the 'num-cpu' property from TYPE_ARM11MPCORE_PRIV to TYPE_REALVIEW_MPCORE, alias it with QOM object_property_add_alias(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 08/33] hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédri

Re: [PATCH 09/33] hw/cpu/arm: Merge {a9mpcore.h, a15mpcore.h} as cortex_mpcore.h

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: Merge Cortex-A{9,15} MPCore devices in the same header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

[PATCH for 8.2.1] hw/net: cadence_gem: Fix MDIO_OP_xxx values

2024-01-02 Thread Bin Meng
Testing upstream U-Boot with 'sifive_u' machine we see: => dhcp ethernet@1009: PHY present at 0 Could not get PHY for ethernet@1009: addr 0 phy_connect failed This has been working till QEMU 8.1 but broken since QEMU 8.2. Fixes: 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to des

Re: [PATCH 10/33] hw/cpu/arm: Introduce abstract CORTEX_MPCORE_PRIV QOM type

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: This type will be common to A9MPCORE/A15MPCORE devices. Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 12/33] hw/cpu/arm: Create MPCore container in QOM parent

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: Move the memory region container creation to the abstract QOM parent. Children set the region size via the class 'container_size' field. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 11/33] hw/cpu/arm: Have A9MPCORE/A15MPCORE inheritate common CORTEX_MPCORE_PRIV

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: TYPE_CORTEX_MPCORE_PRIV becomes the common parent to TYPE_A9MPCORE_PRIV and TYPE_A15MPCORE_PRIV. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C.

Re: [PATCH 0/2] backends/iommufd: Remove mutex

2024-01-02 Thread Eric Auger
Hi Cédric, On 1/2/24 13:32, Cédric Le Goater wrote: > Hello ! > > Coverity has some reports regarding the IOMMUFDBackend mutex. Since > the IOMMUFDBackend routines are called from the QEMU main thread, this > series simply suggests removing the mutex and rely on the BQL to > handle concurrent acce

Re: [PATCH for 9.0 00/12] Map memory at destination .load_setup in vDPA-net migration

2024-01-02 Thread Eugenio Perez Martin
On Mon, Dec 25, 2023 at 5:31 PM Michael S. Tsirkin wrote: > > On Fri, Dec 15, 2023 at 06:28:18PM +0100, Eugenio Pérez wrote: > > Current memory operations like pinning may take a lot of time at the > > destination. Currently they are done after the source of the migration is > > stopped, and befo

Re: [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv

2024-01-02 Thread Cédric Le Goater
On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: Hi, When a MPCore cluster is used, the Cortex-A cores belong the the cluster container, not to the board/soc layer. This series move the creation of vCPUs to the MPCore private container. Doing so we consolidate the QOM model, moving common code

Re: [PATCH for 8.2.1] hw/net: cadence_gem: Fix MDIO_OP_xxx values

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 15:18, Bin Meng wrote: Testing upstream U-Boot with 'sifive_u' machine we see: => dhcp ethernet@1009: PHY present at 0 Could not get PHY for ethernet@1009: addr 0 phy_connect failed This has been working till QEMU 8.1 but broken since QEMU 8.2. s/till/until/? F

[PATCH] roms/opensbi: Upgrade from v1.3.1 to v1.4

2024-01-02 Thread Bin Meng
Upgrade OpenSBI from v1.3.1 to v1.4 and the pre-built bios images. The v1.4 release includes the following commits: 1a398d9 lib: sbi: Add Zicntr as a HART ISA extension 669089c lib: sbi: Add Zihpm as a HART ISA extension 72b9c8f lib: sbi: Alphabetically sort HART ISA extensions 5359fc6 lib: sbi:

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2024-01-02 Thread Hanna Czenczek
On 13.12.23 22:15, Stefan Hajnoczi wrote: Hanna and Fiona encountered a bug in aio_set_fd_handler(): there is no matching io_poll_end() call upon removing an AioHandler when io_poll_begin() was previously called. The missing io_poll_end() call leaves virtqueue notifications disabled and the virtq

Re: [PATCH 1/8] vga: remove unused macros

2024-01-02 Thread Paolo Bonzini
On Sun, Dec 31, 2023 at 5:01 PM BALATON Zoltan wrote: > > On Sun, 31 Dec 2023, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > > --- > > hw/display/vga.c | 14 -- > > 1 file changed, 14 deletions(-) > > > > diff --git a/hw/display/vga.c b/hw/display/vga.c > > index 37557c3442a.

Re: [PATCH 5/6] nbd/server: only traverse NBDExport->clients from main loop thread

2024-01-02 Thread Eric Blake
On Wed, Dec 20, 2023 at 08:49:02PM -0500, Stefan Hajnoczi wrote: > The NBD clients list is currently accessed from both the export > AioContext and the main loop thread. When the AioContext lock is removed > there will be nothing protecting the clients list. > > Adding a lock around the clients li

Re: [PATCH v2 1/5] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-02 Thread Stefan Hajnoczi
On Wed, Dec 13, 2023 at 03:37:00PM +0900, Akihiko Odaki wrote: > On 2023/12/13 0:39, Stefan Hajnoczi wrote: > > @@ -312,58 +312,58 @@ bool qemu_in_main_thread(void); > > } while (0) > > /** > > - * qemu_mutex_lock_iothread: Lock the main loop mutex. > > + * bql_lock: Lock the Big QEMU Lock

[PATCH v3 2/5] qemu/main-loop: rename QEMU_IOTHREAD_LOCK_GUARD to BQL_LOCK_GUARD

2024-01-02 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paul Durrant Acked-by: David Woodhouse Reviewed-by: Cédric Le Goater Acked-by: Ilya Leoshkevich --- include/qemu/main-loop.h |

[PATCH v3 0/5] Make Big QEMU Lock naming consistent

2024-01-02 Thread Stefan Hajnoczi
v3: - Rebase - Define bql_lock() macro on a single line [Akihiko Odaki] v2: - Rename APIs bql_*() [PeterX] - Spell out "Big QEMU Lock (BQL)" in doc comments [PeterX] - Rename "iolock" variables in hw/remote/mpqemu-link.c [Harsh] - Fix bql_auto_lock() indentation in Patch 2 [Ilya] - "with BQL taken"

[PATCH v3 5/5] Rename "QEMU global mutex" to "BQL" in comments and docs

2024-01-02 Thread Stefan Hajnoczi
The term "QEMU global mutex" is identical to the more widely used Big QEMU Lock ("BQL"). Update the code comments and documentation to use "BQL" instead of "QEMU global mutex". Signed-off-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/multi-t

[PATCH v3 1/5] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-02 Thread Stefan Hajnoczi
The Big QEMU Lock (BQL) has many names and they are confusing. The actual QemuMutex variable is called qemu_global_mutex but it's commonly referred to as the BQL in discussions and some code comments. The locking APIs, however, are called qemu_mutex_lock_iothread() and qemu_mutex_unlock_iothread().

[PATCH v3 4/5] Replace "iothread lock" with "BQL" in comments

2024-01-02 Thread Stefan Hajnoczi
The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL) in their names. Update the code comments to use "BQL" instead of "iothread lock". Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/reset.rst | 2 +- hw/display/qxl.h

[PATCH v3 3/5] qemu/main-loop: rename qemu_cond_wait_iothread() to qemu_cond_wait_bql()

2024-01-02 Thread Stefan Hajnoczi
The name "iothread" is overloaded. Use the term Big QEMU Lock (BQL) instead, it is already widely used and unambiguous. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- include/qemu/main-loop.h | 10 +- accel/tcg/tcg-accel-op

Re: Re: [PATCH v13 00/26] riscv: RVA22 profiles support

2024-01-02 Thread Andrew Jones
On Tue, Jan 02, 2024 at 08:40:48AM -0300, Daniel Henrique Barboza wrote: > Hi, > > Drew brought to my attention the following post on the tech-unprivileged > mailing > list: > > "Architecture Review Committee meeting minutes, 12/19/23" > https://lists.riscv.org/g/tech-unprivileged/message/611 >

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2024-01-02 Thread Paolo Bonzini
On Tue, Jan 2, 2024 at 4:24 PM Hanna Czenczek wrote: > I’ve attached the preliminary patch that I didn’t get to send (or test > much) last year. Not sure if it has the same CPU-usage-spike issue > Fiona was seeing, the only functional difference is that I notify the vq > after attaching the notif

Re: [PATCH v3 4/5] Replace "iothread lock" with "BQL" in comments

2024-01-02 Thread Cédric Le Goater
On 1/2/24 16:35, Stefan Hajnoczi wrote: The term "iothread lock" is obsolete. The APIs use Big QEMU Lock (BQL) in their names. Update the code comments to use "BQL" instead of "iothread lock". Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater

[RFC PATCH 0/5] qdev-properties: Try to improve use of dynamic property introspection

2024-01-02 Thread Philippe Mathieu-Daudé
Hi, This RFC series tries to work over some limitations exposed in https://lore.kernel.org/qemu-devel/9293e63b-8032-4ea0-b516-9db6949fb...@linaro.org/ Eventually all QDev objects would use static QOM properties, but in some cases we can not. ARMv7MState is a such example adding properties that mi

[RFC PATCH 2/5] qdev-properties: Add OptionalBool QAPI type

2024-01-02 Thread Philippe Mathieu-Daudé
To be able to distinct whether a boolean qdev property has been set or not, add the DEFINE_PROP_BOOL_NODEFAULT() qdev macro based on the tri-state OptionalBool QAPI type. Signed-off-by: Philippe Mathieu-Daudé --- qapi/common.json | 16 include/hw/qdev-properties.h |

[RFC PATCH 4/5] hw/arm/armv7m: Error if trying to set unavailable ARMCPU::vfp property

2024-01-02 Thread Philippe Mathieu-Daudé
Do not ignore impossible configuration requested by the user. For example, when trying to enable VFP on a Cortex-M33 we now get: qemu-system-arm: 'cortex-m33-arm-cpu' does not support VFP Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 3 +++ 1 file changed, 3 insertions(+) diff

[RFC PATCH 3/5] hw/arm/armv7m: Convert ARMv7MState::vfp from bool to OptionalBool

2024-01-02 Thread Philippe Mathieu-Daudé
We want to know if the 'vfp' property has been initialized. Convert it from boolean to OptionalBool (which contain the 'unset' enum). Note the monitor output is changed as: (qemu) info qtree ... dev: armv7m, id "" gpio-in "NMI" 1 gpio-out "SYSRESETREQ" 1 gpio-in "" 96

[RFC PATCH 5/5] hw/arm/armv7m: Do not expose 'vfp' property if ARM CPU doesn't have it

2024-01-02 Thread Philippe Mathieu-Daudé
Since the TYPE_ARMV7M object doesn't know its CPU type at the time armv7m_instance_init() is called, we need to prepare to forward any CPU properties there, then we can forward them in armv7m_realize(). But then when introspecting at runtime, in the case the requested CPU doesn't expose such prope

Re: [PATCH v3 5/5] Rename "QEMU global mutex" to "BQL" in comments and docs

2024-01-02 Thread Cédric Le Goater
On 1/2/24 16:35, Stefan Hajnoczi wrote: The term "QEMU global mutex" is identical to the more widely used Big QEMU Lock ("BQL"). Update the code comments and documentation to use "BQL" instead of "QEMU global mutex". Signed-off-by: Stefan Hajnoczi Acked-by: Markus Armbruster Reviewed-by: Phili

[RFC PATCH 1/5] qdev-properties: Add qdev_property_del_static()

2024-01-02 Thread Philippe Mathieu-Daudé
We can add properties with qdev_property_add_static(). Add qdev_property_del_static() to delete them. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-properties.h | 2 ++ hw/core/qdev-properties.c| 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/hw/qdev-properties

Re: [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv

2024-01-02 Thread Philippe Mathieu-Daudé
Hi Cédric, On 2/1/24 15:55, Cédric Le Goater wrote: On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: Hi, When a MPCore cluster is used, the Cortex-A cores belong the the cluster container, not to the board/soc layer. This series move the creation of vCPUs to the MPCore private container. Doin

Re: [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv

2024-01-02 Thread Cédric Le Goater
On 1/2/24 17:15, Philippe Mathieu-Daudé wrote: Hi Cédric, On 2/1/24 15:55, Cédric Le Goater wrote: On 12/12/23 17:29, Philippe Mathieu-Daudé wrote: Hi, When a MPCore cluster is used, the Cortex-A cores belong the the cluster container, not to the board/soc layer. This series move the creation

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2024-01-02 Thread Hanna Czenczek
On 02.01.24 16:53, Paolo Bonzini wrote: On Tue, Jan 2, 2024 at 4:24 PM Hanna Czenczek wrote: I’ve attached the preliminary patch that I didn’t get to send (or test much) last year. Not sure if it has the same CPU-usage-spike issue Fiona was seeing, the only functional difference is that I noti

[NOTFORMERGE PATCH 2/2] gitlab: Add Loongarch64 KVM-only build

2024-01-02 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- Used to test https://lore.kernel.org/qemu-devel/20231228084051.3235354-1-zhaotian...@loongson.cn/ --- .../openeuler-22.03-loongarch64.yml | 22 +++ 1 file changed, 22 insertions(+) diff --git a/.gitlab-ci.d/custom-runners/opene

[PATCH 1/2] gitlab: Introduce Loongarch64 runner

2024-01-02 Thread Philippe Mathieu-Daudé
Full build config to run CI tests on a Loongarch64 host. Forks might enable this by setting LOONGARCH64_RUNNER_AVAILABLE in their CI namespace settings, see: https://www.qemu.org/docs/master/devel/ci.html#maintainer-controlled-job-variables Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/c

[PATCH 0/2] gitlab: Add config for Loongarch64 custom runner

2024-01-02 Thread Philippe Mathieu-Daudé
Loongson Technology Corporation Limited offered to sponsor QEMU with a Loongarch64 custom runner. Philippe Mathieu-Daudé (2): gitlab: Introduce Loongarch64 runner gitlab: Add Loongarch64 KVM-only build docs/devel/ci-jobs.rst.inc| 6 +++ .gitlab-ci.d/custom-runners.yml

Re: [PATCH 01/11] migration: Remove migrate_max_downtime() declaration

2024-01-02 Thread Fabiano Rosas
Avihai Horon writes: > migrate_max_downtime() has been removed long ago, but its declaration > was mistakenly left. Remove it. > > Signed-off-by: Avihai Horon Reviewed-by: Fabiano Rosas

Re: Some thoughts and questions about CXL & MCE

2024-01-02 Thread Jonathan Cameron via
On Sat, 23 Dec 2023 00:33:43 +0800 Shiyang Ruan wrote: > Hi guys, > > I have some thoughts and questions about CXL & MCE mechanism. +CC qemu-devel as quite bit of this is QEMU related . > > CXL type-3 devices can be used as volatile or persistent memory, so a > poisoned page on them should a

Re: [PATCH v3 2/4] tests/lcitool: Refresh generated files

2024-01-02 Thread Philippe Mathieu-Daudé
On 12/7/23 15:07, Daniel P. Berrangé wrote: On Wed, Jul 12, 2023 at 02:55:10PM +0200, Philippe Mathieu-Daudé wrote: On 12/7/23 13:12, Daniel P. Berrangé wrote: On Wed, Jul 12, 2023 at 01:00:38PM +0200, Philippe Mathieu-Daudé wrote: On 11/7/23 19:58, Daniel P. Berrangé wrote: On Tue, Jul 11, 2

Re: [PATCH for 8.2.1] hw/net: cadence_gem: Fix MDIO_OP_xxx values

2024-01-02 Thread Heinrich Schuchardt
On 1/2/24 16:08, Philippe Mathieu-Daudé wrote: On 2/1/24 15:18, Bin Meng wrote: Testing upstream U-Boot with 'sifive_u' machine we see:    => dhcp    ethernet@1009: PHY present at 0    Could not get PHY for ethernet@1009: addr 0    phy_connect failed This has been working till QEMU 8.1

Re: [PATCH v3 2/4] tests/lcitool: Refresh generated files

2024-01-02 Thread Ilya Maximets
On 1/2/24 19:19, Philippe Mathieu-Daudé wrote: > On 12/7/23 15:07, Daniel P. Berrangé wrote: >> On Wed, Jul 12, 2023 at 02:55:10PM +0200, Philippe Mathieu-Daudé wrote: >>> On 12/7/23 13:12, Daniel P. Berrangé wrote: On Wed, Jul 12, 2023 at 01:00:38PM +0200, Philippe Mathieu-Daudé wrote: >

Re: [PATCH 02/11] migration: Remove nulling of hostname in migrate_init()

2024-01-02 Thread Fabiano Rosas
Avihai Horon writes: > MigrationState->hostname is set to NULL in migrate_init(). This is > redundant because it is already freed and set to NULL in > migrade_fd_cleanup(). Remove it. > > Signed-off-by: Avihai Horon Reviewed-by: Fabiano Rosas

Re: [PATCH 03/11] migration: Refactor migration_incoming_setup()

2024-01-02 Thread Fabiano Rosas
Avihai Horon writes: > Commit 6720c2b32725 ("migration: check magic value for deciding the > mapping of channels") extracted the only code that could fail in > migration_incoming_setup(). > > Now migration_incoming_setup() can't fail, so refactor it to return void > and remove errp parameter. > >

Re: [PATCH 04/11] migration: Remove errp parameter in migration_fd_process_incoming()

2024-01-02 Thread Fabiano Rosas
Avihai Horon writes: > Errp parameter in migration_fd_process_incoming() is unused. > Remove it. > > Signed-off-by: Avihai Horon Reviewed-by: Fabiano Rosas

Re: [PATCH 05/11] migration/multifd: Fix error message in multifd_recv_initial_packet()

2024-01-02 Thread Fabiano Rosas
Avihai Horon writes: > In multifd_recv_initial_packet(), if MultiFDInit_t->id is greater than > the configured number of multifd channels, an irrelevant error message > about multifd version is printed. > > Change the error message to a relevant one about the channel id. > > Signed-off-by: Avihai

Re: [PATCH for 8.2.1] hw/net: cadence_gem: Fix MDIO_OP_xxx values

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 19:32, Heinrich Schuchardt wrote: On 1/2/24 16:08, Philippe Mathieu-Daudé wrote: On 2/1/24 15:18, Bin Meng wrote: Testing upstream U-Boot with 'sifive_u' machine we see:    => dhcp    ethernet@1009: PHY present at 0    Could not get PHY for ethernet@1009: addr 0    phy_connec

Re: [PATCH v3 12/33] hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init

2024-01-02 Thread Philippe Mathieu-Daudé
On 2/1/24 02:57, Richard Henderson wrote: The size of the allocation need not match the alignment. Signed-off-by: Richard Henderson --- hw/tpm/tpm_ppi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/tpm/tpm_ppi.c b/hw/tpm/tpm_ppi.c index 7f74e26ec6..91eeafd53a 1006

  1   2   >