[PATCH] hw/i386/pc: Avoid overlap between CXL window and PCI 64bit BARs in QEMU

2025-07-18 Thread peng guo via
When using a CXL Type 3 device together with a virtio 9p device in QEMU, the 9p device fails to initialize properly. The kernel reports the following: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1 9pnet_virtio virtio0: probe with driver 9pnet_virtio failed with

RE: [PATCH v8 08/12] hw/arm/virt: Allow user-creatable SMMUv3 dev instantiation

2025-07-18 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Friday, July 18, 2025 9:12 AM > To: Shameerali Kolothum Thodi > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; > eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com; > ddut...@redhat.com; berra...@redhat.com; imamm...@redh

RE: [PATCH v8 08/12] hw/arm/virt: Allow user-creatable SMMUv3 dev instantiation

2025-07-18 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Friday, July 18, 2025 5:14 AM > To: Shameerali Kolothum Thodi > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; > eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com; > ddut...@redhat.com; berra...@redhat.com; imamm...@redh

[PATCH v1 20/21] tests/function/aspeed: Replace manual loader with vbootrom for ast2700fc test

2025-07-16 Thread Jamin Lin via
after launch. For example, when the PSP is launched first to enable SSP via SCU, the test framework cannot dynamically attach to the SSP console afterward to verify its behavior. Due to this limitation, the test case for AST2700FC has been modified to use vBootROM (`ast27x0_bootrom.bin`) instead of

[PATCH v1 14/21] hw/arm/ast27x0: Start TSP in powered-off state to match hardware behavior

2025-07-16 Thread Jamin Lin via
In the previous design, both the PSP and TSP were started together during SoC initialization. However, on real hardware, the TSP begins in a powered-off state. The typical boot sequence involves the PSP powering up first, loading the TSP firmware binary into shared memory via DRAM remap, and then

[PATCH v1 19/21] pc-bios: Update AST27x0 vBootrom with SSP/TSP SCU initialization support

2025-07-16 Thread Jamin Lin via
The updated boot ROM includes logic to initialize and enable SSP/TSP using SCU registers, based on reserved-memory regions defined in the device tree. Its source code is available at: https://github.com/google/vbootrom/commit/f9eb0bb57decbab860a81712c56132c2102fa98e Build Information: Build Date

[PATCH v1 18/21] hw/misc/aspeed_scu: Implement TSP reset and power-on control via SCU registers

2025-07-16 Thread Jamin Lin via
This patch implements TSP reset and power control logic in the SCU module for AST2700. It introduces support for the following behavior: 1. TSP Reset Trigger (via SCU 0x224): - TSP reset is triggered by writing 1 to bit 9 (RW1S) of SYS_RESET_CTRL_2. 2. TSP Reset State and Source Hold (via

[PATCH v1 15/21] hw/misc/aspeed_scu: Add SCU support for SSP SDRAM remap

2025-07-16 Thread Jamin Lin via
This commit adds SCU register support for SSP SDRAM remap control and runtime activation. It introduces logic for the PSP to dynamically configure the mapping of its own DRAM windows into SSP-visible SDRAM space, enabling shared memory communication via memory region aliases. Two MemoryRegion

[PATCH v1 08/21] hw/arm/ast27x0: Add SCU alias for SSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
mory between the main CPU (PSP) and the + * coprocessors. Coprocessors access this shared SRAM region through a + * MemoryRegion alias mapped to a different physical address. + * + * Similarly, the SCU is a single hardware block shared across all + * processors. Coprocessors ac

[PATCH v1 21/21] docs: Add support vbootrom for ast2700fc

2025-07-16 Thread Jamin Lin via
``-device loader``: + +In this approach, users manually load firmware and assign entry points via QEMU loader devices. +By default, the PSP begins execution at address ``0x43000``, the load address of the bl31 +firmware. The SSP and TSP start in the powered-off state and must be explicitly

[PATCH v1 07/21] hw/arm/ast27x0: Add SRAM alias for TSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a 128KB SRAM, physically mapped at 0x1000–0x1001 for the main CA35 processor. The TSP coprocessor accesses this same memory at a different memory address: 0x7000–0x7001. To support this shared memory model, this commit introduces "tsp.sram_mr_alias", a "MemoryRegion" al

[PATCH v1 06/21] hw/arm/ast27x0: Add SRAM alias for SSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a 128KB SRAM, physically mapped at 0x1000–0x1001 for the main CA35 processor. The SSP coprocessor accesses this same memory at a different memory address: 0x7000–0x7001. To support this shared memory model, this commit introduces "ssp.sram_mr_alias", a "MemoryRegion" al

[PATCH v1 12/21] hw/arm/ast27x0: Add DRAM alias for TSP SDRAM remap and update realization order

2025-07-16 Thread Jamin Lin via
This commit adds a MemoryRegion alias to support PSP access to TSP SDRAM through shared memory remapping, as defined by the default SCU configuration. The TSP coprocessor exposes one DRAM alias: - remap maps PSP DRAM at 0x42e00 (32MB) to TSP SDRAM offset 0x0 This region corresponds to the d

[PATCH v1 16/21] hw/misc/aspeed_scu: Add SCU support for TSP SDRAM remap

2025-07-16 Thread Jamin Lin via
window. One MemoryRegion alias is attached to the SCU via QOM property link: - tsp-sdram-remap: maps PSP DRAM at 0x42E00 (size: 32MB) to TSP SDRAM offset 0x0 The SCU registers AST2700_SCU_TSP_CTRL_1 and AST2700_SCU_TSP_REMAP_SIZE_2 allow runtime reconfiguration of the DRAM base (alias

[PATCH v1 10/21] hw/arm/ast27x0: Move DRAM and SDMC initialization earlier to support memory aliasing

2025-07-16 Thread Jamin Lin via
at a specific offset. This alias is mapped into the coprocessor's SDRAM address space, allowing both PSP and the coprocessor (SSP/TSP) to access the same physical memory through their respective views — PSP via its DRAM, and the coprocessor via its SDRAM. The remapping is configured throug

[PATCH v1 11/21] hw/arm/ast27x0: Add DRAM alias for SSP SDRAM remap and update realization order

2025-07-16 Thread Jamin Lin via
U register defaults. + * Therefore, DRAM must be fully initialized before coprocessors can + * attach aliases to it. * - * Similarly, the SCU is a single hardware block shared across all - * processors. Coprocessors access it via a MemoryRegion alias that maps - * t

[PATCH v1 09/21] hw/arm/ast27x0: Add SCU alias for TSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a single SCU hardware block, memory-mapped at 0x12C02000–0x12C03FFF from the perspective of the main CA35 processor (PSP). The TSP coprocessor accesses this same SCU block at a different address: 0x72C02000–0x72C03FFF. To support this shared SCU model, this commit introduces "tsp.scu_

[PATCH v1 13/21] hw/arm/ast27x0: Start SSP in powered-off state to match hardware behavior

2025-07-16 Thread Jamin Lin via
In the previous design, both the PSP and SSP were started together during SoC initialization. However, on real hardware, the SSP begins in a powered-off state. The typical boot sequence involves the PSP powering up first, loading the SSP firmware binary into shared memory via DRAM remap, and then

[PATCH v1 17/21] hw/misc/aspeed_scu: Implement SSP reset and power-on control via SCU registers

2025-07-16 Thread Jamin Lin via
This patch implements SSP reset and power control logic in the SCU for AST2700. It introduces support for the following behavior: 1. SSP Reset Trigger (via SCU 0x220): - SSP reset is triggered by writing 1 to bit 30 (RW1S) of SYS_RESET_CTRL_1. 2. SSP Reset State and Source Hold (via SCU 0x120

[PATCH v1 05/21] hw/arm/aspeed_ast27x0-tsp: Switch TSP memory to SDRAM and use dram_container for remap support

2025-07-16 Thread Jamin Lin via
According to the AST2700 design, the TSP coprocessor uses its own SDRAM instead of SRAM. Additionally, all three coprocessors—SSP, TSP, and PSP—share a common SRAM block. In the previous implementation, the TSP memory region was labeled and sized as "SRAM", but in practice it was being used as TSP'

[PATCH v1 01/21] hw/arm/aspeed_ast27x0-fc: Support VBootRom

2025-07-16 Thread Jamin Lin via
Introduces support for loading a vbootrom image into the dedicated vbootrom memory region in the AST2700 Full Core machine. Additionally, it implements a mechanism to extract the content of fmc_cs0 flash data(backend file) and copy it into the memory-mapped region corresponding to ASPEED_DEV_SPI_B

[PATCH v1 02/21] hw/arm/ast27x0: Move SSP coprocessor initialization from machine to SoC leve

2025-07-16 Thread Jamin Lin via
In the previous design, the SSP coprocessor (aspeed27x0ssp-soc) was initialized and realized at the machine level (e.g., AST2700FC). However, to make sure the coprocessors can work together properly—such as using the same SRAM, sharing the SCU, and having consistent memory remapping—we need to chan

[PATCH v1 04/21] hw/arm/aspeed_ast27x0-ssp: Switch SSP memory to SDRAM and use dram_container for remap support

2025-07-16 Thread Jamin Lin via
According to the AST2700 design, the SSP coprocessor uses its own SDRAM instead of SRAM. Additionally, all three coprocessors—SSP, TSP, and PSP—share a common SRAM block. In the previous implementation, the SSP memory region was labeled and sized as "SRAM", but in practice it was being used as SSP'

[PATCH v1 03/21] hw/arm/ast27x0: Move TSP coprocessor initialization from machine to SoC leve

2025-07-16 Thread Jamin Lin via
In the previous design, the TSP coprocessor (aspeed27x0tsp-soc) was initialized and realized at the machine level (e.g., AST2700FC). To allow proper integration between coprocessors—such as shared use of SRAM, SCU, and memory remap configuration—this commit moves TSP initialization into the AST2700

[PATCH v1 00/21] Control coprocessor reset for AST2700

2025-07-16 Thread Jamin Lin via
coprocessor reset via SCU registers. Jamin Lin (21): hw/arm/aspeed_ast27x0-fc: Support VBootRom hw/arm/ast27x0: Move SSP coprocessor initialization from machine to SoC leve hw/arm/ast27x0: Move TSP coprocessor initialization from machine to SoC leve hw/arm/aspeed_ast27x0-ssp: Switch SSP

Re: [PATCH] docs: Fix Aspeed title

2025-07-16 Thread Ed Tanous via
On Tue, Jul 15, 2025 at 08:19:04AM +0200, Cédric Le Goater wrote: > commit ad8e0e8a0088 removed the "==" underlining the file title > which broke documentation rendering. Add it back. > > Fixes: ad8e0e8a0088 ("docs: add support for gb200-bmc") > Cc: Ed Tanous > Reported-by: Peter Maydell > S

RE: [RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-16 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Wednesday, July 16, 2025 3:58 AM > To: Shameerali Kolothum Thodi > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; > eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com; > ddut...@redhat.com; berra...@redhat.com; nath...@nvi

Re: [PATCH v2] intel_iommu: Allow both Status Write and Interrupt Flag in QI wait

2025-07-16 Thread Konstantin Belousov via
On Wed, Jul 16, 2025 at 05:23:57PM +0800, Yi Liu wrote: > On 2025/7/16 12:05, Konstantin Belousov wrote: > > On Wed, Jul 16, 2025 at 12:01:44PM +0800, Yi Liu wrote: > > > On 2025/7/15 20:27, CLEMENT MATHIEU--DRIF wrote: > > > > > > > > > > > > On 15/07/2025 10:27 am, David Woodhouse wrote: > > >

Re: [RFC PATCH v3 08/15] hw/arm/smmuv3-accel: Add set/unset_iommu_device callback

2025-07-16 Thread Jonathan Cameron via
On Tue, 15 Jul 2025 10:01:21 -0700 Nicolin Chen wrote: > On Tue, Jul 15, 2025 at 11:29:41AM +0100, Jonathan Cameron wrote: > > > +if (!iommufd_backend_alloc_viommu(idev->iommufd, idev->devid, > > > + IOMMU_VIOMMU_TYPE_ARM_SMMUV3, > > > +

RE: [RFC PATCH v3 06/15] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd

2025-07-16 Thread Shameerali Kolothum Thodi via
backend is allowed with > >> >arm-smmuv3,accel=on", > >> >+ pdev->name); > >> >+exit(1); > >> > >> Seems aggressive for a hotplug, could we fail hotplug instead of kill > QEMU? > > > >Hotpl

RE: [RFC PATCH v3 05/15] hw/arm/smmuv3-accel: Introduce smmuv3 accel device

2025-07-16 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Duan, Zhenzhong > Sent: Wednesday, July 16, 2025 4:39 AM > To: Nicolin Chen > Cc: Shameerali Kolothum Thodi > ; qemu-...@nongnu.org; > qemu-devel@nongnu.org; eric.au...@redhat.com; > peter.mayd...@linaro.org; j...@nvidia.com; ddut...@redhat.com; > berra...@

RE: [RFC PATCH v3 09/15] hw/arm/smmuv3-accel: Support nested STE install/uninstall support

2025-07-16 Thread Shameerali Kolothum Thodi via
accel) { > > +return; > > + } > > + > > +g_hash_table_foreach(bs->configs, smmuv3_accel_ste_range, range); > > This will not work correctly? > > The bs->configs is a cache that gets an entry inserted to when a > config is fetched via sm

RE: [RFC PATCH v3 06/15] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd

2025-07-16 Thread Shameerali Kolothum Thodi via
But things like IORT mappings aren't able > to get refreshed since the OS is likely already booted. Why do we need IORT mappings to be refreshed during hotplug? AFAICS, the mappings are created per host bridge Ids. And how is this different from a host machine doing hotplug? Even an >

RE: [RFC PATCH v3 13/15] hw/arm/smmuv3: Forward invalidation commands to hw

2025-07-16 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Tuesday, July 15, 2025 6:23 PM > To: Jonathan Cameron > Cc: Shameerali Kolothum Thodi > ; Linuxarm > ; qemu-...@nongnu.org; qemu- > de...@nongnu.org; eric.au...@redhat.com; peter.mayd...@linaro.org; > j...@nvidia.com; ddut...@redhat.com

RE: [RFC PATCH v3 00/15] hw/arm/virt: Add support for user-creatable accelerated SMMUv3

2025-07-16 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Duan, Zhenzhong > Sent: Tuesday, July 15, 2025 11:46 AM > To: Shameerali Kolothum Thodi > ; qemu-...@nongnu.org; > qemu-devel@nongnu.org > Cc: eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com; > nicol...@nvidia.com; ddut...@redhat.com; berra..

Re: [RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-15 Thread Nicolin Chen via
On Mon, Jul 14, 2025 at 04:59:40PM +0100, Shameer Kolothum wrote: > From: Nicolin Chen > > Not all fields in the SMMU IDR registers are meaningful for userspace. > Only the following fields can be used: > >   - IDR0: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN, CD2L, ASID16, TTF   >   - IDR1: SI

Re: [RFC PATCH v3 15/15] hw/arm/smmu-common: Add accel property for SMMU dev

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:41 +0100 Shameer Kolothum wrote: > Now user can set "accel=on". Have fun! > > Signed-off-by: Shameer Kolothum Hard to argue with this one ;) Reviewed-by: Jonathan Cameron > --- > hw/arm/smmu-common.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/arm

Re: [RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:40 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Not all fields in the SMMU IDR registers are meaningful for userspace. > Only the following fields can be used: > >   - IDR0: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN, CD2L, ASID16, TTF   >   - IDR1: SIDSIZE

Re: [RFC PATCH v3 13/15] hw/arm/smmuv3: Forward invalidation commands to hw

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:39 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Use the provided smmuv3-accel helper functions to issue the > invalidation commands to host SMMUv3. > > Signed-off-by: Nicolin Chen > Signed-off-by: Shameer Kolothum > --- > hw/arm/smmuv3-internal.h | 11 +++

Re: [RFC PATCH v3 12/15] hw/arm/smmuv3-accel: Introduce helpers to batch and issue cache invalidations

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:38 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Helpers will batch the commands and issue at once to host SMMUv3. > > Signed-off-by: Nicolin Chen > Signed-off-by: Shameer Kolothum > --- > hw/arm/smmuv3-accel.c| 65 +

Re: [RFC PATCH v3 08/15] hw/arm/smmuv3-accel: Add set/unset_iommu_device callback

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:34 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Implement a set_iommu_device callback: > -If found an existing viommu reuse that. >(Devices behind the same physical SMMU should share an S2 HWPT) > -Else, > Allocate a viommu with the nested parent S2

Re: [RFC PATCH v3 06/15] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd

2025-07-15 Thread Jonathan Cameron via
the IOMMU address space > > Note: On ARM, MSI doorbell addresses are also translated via SMMUv3. > Hence, if a vfio-pci device is behind the SMMuv3 with translation enabled, > it must return the IOMMU address space for MSI. Support for this will be > added in a follow-up patc

Re: [RFC PATCH v3 05/15] hw/arm/smmuv3-accel: Introduce smmuv3 accel device

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:31 +0100 Shameer Kolothum wrote: > Also setup specific PCIIOMMUOps for accel SMMUv3 as accel > SMMUv3 will have different handling for those ops callbacks > in subsequent patches. > > The "accel" property is not yet added, so users cannot set it at this > point. It will

Re: [RFC PATCH v3 04/15] hw/arm/smmu-common: Introduce smmu_iommu_ops_by_type() helper

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:30 +0100 Shameer Kolothum wrote: > Allows to retrieve the PCIIOMMUOps based on the SMMU type. This will be > useful when we add support for accelerated SMMUV3 in subsequent patches > as that requires a different set of callbacks for iommu ops. > > No special handling is

Re: [RFC PATCH v3 03/15] hw/arm/smmu-common: Factor out common helper functions and export

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:29 +0100 Shameer Kolothum wrote: > Subsequent patches for smmuv3 accel support will make use of this. > > Signed-off-by: Nicolin Chen > Reviewed-by: Eric Auger > Signed-off-by: Shameer Kolothum Various trivial things inline. In general looks fine. J > --- > hw/ar

Re: [RFC PATCH v3 02/15] backends/iommufd: Introduce iommufd_vdev_alloc

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:28 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Add a helper to allocate an iommufd device's virtual device (in the user > space) per a viommu instance. Same trivial suggestion as in patch 1. Also feel free to ignore.

Re: [RFC PATCH v3 01/15] backends/iommufd: Introduce iommufd_backend_alloc_viommu

2025-07-15 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 16:59:27 +0100 Shameer Kolothum wrote: > From: Nicolin Chen > > Add a helper to allocate a viommu object. > > Signed-off-by: Nicolin Chen > Reviewed-by: Eric Auger > Signed-off-by: Shameer Kolothum One trivial comment inline. Feel free to ignore. > --- > backends/iomm

Re: [PATCH v2] intel_iommu: Allow both Status Write and Interrupt Flag in QI wait

2025-07-14 Thread Konstantin Belousov via
On Mon, Jul 14, 2025 at 05:41:22PM +0100, David Woodhouse wrote: > On 14 July 2025 15:28:09 GMT+01:00, Yi Liu wrote: > >Hi David, > > > >On 2025/7/14 16:00, David Woodhouse wrote: > >> From: David Woodhouse > >> > >> FreeBSD does both, and this appears to be perfectly valid. The VT-d > >> spec e

Re: [RFC PATCH v3 00/15] hw/arm/virt: Add support for user-creatable accelerated SMMUv3

2025-07-14 Thread Nicolin Chen via
On Mon, Jul 14, 2025 at 09:14:17AM -0700, Nicolin Chen wrote: > Hi Shameer, > > Thank you for sending the v3. > > On Mon, Jul 14, 2025 at 04:59:26PM +0100, Shameer Kolothum wrote: > > Branch for testing: > [...] > > Tested on a HiSilicon platform with multiple SMMUv3s. > > > > ./qemu-system-aarc

Re: [RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-14 Thread Nicolin Chen via
On Mon, Jul 14, 2025 at 01:04:02PM -0700, Nicolin Chen wrote: > On Mon, Jul 14, 2025 at 04:59:40PM +0100, Shameer Kolothum wrote: > > From: Nicolin Chen > > > > Not all fields in the SMMU IDR registers are meaningful for userspace. > > Only the following fields can be used: > > > >   - IDR0: ST_

Re: [RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-14 Thread Nicolin Chen via
On Mon, Jul 14, 2025 at 04:59:40PM +0100, Shameer Kolothum wrote: > From: Nicolin Chen > > Not all fields in the SMMU IDR registers are meaningful for userspace. > Only the following fields can be used: > >   - IDR0: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN, CD2L, ASID16, TTF   >   - IDR1: SI

Re: [PATCH v7 00/36] ACPI PCI Hotplug support on ARM

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 10:04:44 +0200 Eric Auger wrote: > This series enables ACPI PCI hotplug/hotunplug on ARM. > It is not enabled by default and ACPI PCI hotplug can > be selected by setting: > > -global acpi-ged.acpi-pci-hotplug-with-bridge-support=on > > Expected benefits should be similar t

Re: [PATCH v5 3/3] net/af-xdp: Support pinned map path for AF_XDP sockets

2025-07-14 Thread Daniel Borkmann via
On 7/14/25 5:12 PM, Ilya Maximets wrote: On 7/11/25 11:44 AM, Daniel Borkmann wrote: Extend 'inhibit=on' setting with the option to specify a pinned XSK map path along with a starting index (default 0) to push the created XSK sockets into. Example usage: # ./build/qemu-system-x86_64 [...] \

[PATCH qemu v2 09/11] hw/cxl: Create helper function to create DC Event Records from extents

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su Prepatory patch for following FMAPI Add/Release Patches. Refactors part of qmp_cxl_process_dynamic_capacity_prescriptive() into a helper function to create DC Event Records and insert in the event log. Moves definition for CXL_NUM_EXTENTS_SUPPORTED to cxl.h so it can be accessed b

[PATCH qemu v2 06/11] hw/mem: cxl_type3: Add DC Region bitmap lock

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su Add a lock on the bitmap of each CXLDCRegion in preparation for the next patch which implements FMAPI Set DC Region Configuration. This command can modify the block size, which means the region's bitmap must be updated accordingly. The lock becomes necessary when commands that add

[PATCH qemu v2 11/11] hw/cxl: mailbox-utils: 0x5605 - FMAPI Initiate DC Release

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5605 implemented per CXL r3.2 Spec Section 7.6.7.6.6 Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 88 ++ 1 file changed, 88 insertions(+) diff --git

[PATCH qemu v2 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5602 implemented per CXL r3.2 Spec Section 7.6.7.6.3 Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- v2 of set to merge: - Fixed blksize check in set dc region config - Added check that it is a power of 2 (and host-ut

[PATCH qemu v2 10/11] hw/cxl: mailbox-utils: 0x5604 - FMAPI Initiate DC Add

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5604 implemented per CXL r3.2 Spec Section 7.6.7.6.5 Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_device.h | 4 ++ hw/cxl/cxl-mailbox-utils.c | 109 hw/mem

[PATCH qemu v2 08/11] hw/cxl: mailbox-utils: 0x5603 - FMAPI Get DC Region Extent Lists

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5603 implemented per CXL r3.2 Spec Section 7.6.7.6.4 Very similar to previously implemented command 0x4801. Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- v2 for merge: - Added a missing : in a comment similar to Fan

[PATCH qemu v2 04/11] hw/cxl: mailbox-utils: 0x5601 - FMAPI Get Host Region Config

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5601 implemented per CXL r3.2 Spec Section 7.6.7.6.2 Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- hw/cxl/cxl-mailbox-utils.c | 106 + 1 file changed, 106 insertions(+) diff --gi

[PATCH qemu v2 05/11] hw/cxl: Move definition for dynamic_capacity_uuid and enum for DC event types to header

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su Move definition/enum to cxl_events.h for shared use in next patch Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl_events.h | 15 +++ hw/mem/cxl_type3.c | 15 --- 2 files changed, 15 insertions(

[PATCH qemu v2 03/11] hw/mem: cxl_type3: Add dsmas_flags to CXLDCRegion struct

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su Add booleans to DC Region struct to represent dsmas flags (defined in CDAT) in preparation for the next command, which returns the flags in the next mailbox command 0x5601. Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- v2 for merge - Added some

[PATCH qemu v2 02/11] hw/cxl: mailbox-utils: 0x5600 - FMAPI Get DCD Info

2025-07-14 Thread Jonathan Cameron via
From: Anisa Su FM DCD Management command 0x5600 implemented per CXL 3.2 Spec Section 7.6.7.6.1. Reviewed-by: Fan Ni Signed-off-by: Anisa Su Signed-off-by: Jonathan Cameron --- v2 series for merge. - Modify the code that fills in the support blk sizes to not do effectively 2**log2(x) when we

[PATCH qemu v2 01/11] hw/cxl: fix DC extent capacity tracking

2025-07-14 Thread Jonathan Cameron via
From: Fan Ni Per cxl r3.2 Section 9.13.3.3, extent capacity tracking should include extents in different states including added, pending, etc. Before the change, for the in-device extent number tracking purpose, we only have "total_extent_count" defined, which only tracks the number of extents a

[PATCH qemu v2 00/11] hw/cxl: DCD Fabric Management Command Set (for 10.1)

2025-07-14 Thread Jonathan Cameron via
v2: - Missing colon and tags (Fan) - Simpler handling block size parameters. The spec constrains these to be power of 2 so the v1 code of BITUL((int)log2(x) is equivalent of just using x directly. (Michael) - Check for power of 2 (Fan + Anisa) Hi Michael, I consider these ready for upstream

[PATCH v7 3/4] hw/acpi/aml-build: Build a root node in the PPTT table

2025-07-14 Thread Alireza Sanaee via
From: Yicong Yang Currently we build the PPTT starting from the socket node and each socket will be a separate tree. For a multi-socket system it'll be hard for the OS to know the whole system is homogeneous or not (actually we're in the current implementation) since no parent node to telling the

[PATCH v7 4/4] tests: virt: Update expected ACPI tables for virt test

2025-07-14 Thread Alireza Sanaee via
Update the ACPI tables according to the acpi aml_build change, also empty bios-tables-test-allowed-diff.h. The disassembled differences between actual and expected PPTT shows below. Only about the root node adding and identification flag set as expected. Diff regarding Loongarch64: /* * Intel

[PATCH v7 2/4] hw/acpi/aml-build: Set identical implementation flag for PPTT processor nodes

2025-07-14 Thread Alireza Sanaee via
From: Yicong Yang Per ACPI 6.5 Table 5.158: Processor Structure Flags, the identical implementation flag indicates whether all the children processors of this node share the same identical implementation revision. Currently Linux support parsing this field [1] and maybe used to identify the heter

[PATCH v7 0/4] Building PPTT with root node and identical implementation flag

2025-07-14 Thread Alireza Sanaee via
OS like Linux is using PPTT processor node's identical implementation flag [1] to infer whether the whole system or a certain CPU cluster is homogeneous or not [2]. QEMU currently only support building homogeneous system, set the flag to indicate the fact. Build a root node in PPTT for indicates th

[PATCH v7 1/4] tests: virt: Allow changes to PPTT test table

2025-07-14 Thread Alireza Sanaee via
From: Yicong Yang Allow changes to PPTT test table, preparing for adding identical implementation flags support and for adding a root node for all the system. This is related to both loongarch64 and aarch64. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron Reviewed-by: Zhao Liu Signe

Re: [PATCH qemu 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 17:21:10 + Anisa Su wrote: > On Mon, Jul 14, 2025 at 06:02:26PM +0100, Jonathan Cameron wrote: > > On Mon, 14 Jul 2025 09:45:31 -0700 > > Fan Ni wrote: > > > > > On Mon, Jul 14, 2025 at 03:16:38PM +0100, Jonathan Cameron wrote: > > > > On Mon, 14 Jul 2025 15:15:12 +0

Re: [PATCH qemu 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 09:45:31 -0700 Fan Ni wrote: > On Mon, Jul 14, 2025 at 03:16:38PM +0100, Jonathan Cameron wrote: > > On Mon, 14 Jul 2025 15:15:12 +0100 > > Jonathan Cameron wrote: > > > > > On Mon, 14 Jul 2025 15:02:18 +0100 > > > Jonathan Cameron wrote: > > > > > > > On Mon, 14 Jul 2

Re: [RFC PATCH v3 04/15] hw/arm/smmu-common: Introduce smmu_iommu_ops_by_type() helper

2025-07-14 Thread Nicolin Chen via
On Mon, Jul 14, 2025 at 04:59:30PM +0100, Shameer Kolothum wrote: > Allows to retrieve the PCIIOMMUOps based on the SMMU type. This will be > useful when we add support for accelerated SMMUV3 in subsequent patches > as that requires a different set of callbacks for iommu ops. > > No special handli

Re: [PATCH v6 3/4] hw/acpi/aml-build: Build a root node in the PPTT table

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 11:57:19 -0400 "Michael S. Tsirkin" wrote: > On Mon, Jul 14, 2025 at 03:10:41PM +0100, Alireza Sanaee wrote: > > On Mon, 14 Jul 2025 09:09:10 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Jun 04, 2025 at 12:52:32PM +0100, Alireza Sanaee wrote: > > > > From: Yic

Re: [RFC PATCH v3 00/15] hw/arm/virt: Add support for user-creatable accelerated SMMUv3

2025-07-14 Thread Nicolin Chen via
Hi Shameer, Thank you for sending the v3. On Mon, Jul 14, 2025 at 04:59:26PM +0100, Shameer Kolothum wrote: > Branch for testing: [...] > Tested on a HiSilicon platform with multiple SMMUv3s. > > ./qemu-system-aarch64 \ >   -machine virt,accel=kvm,gic-version=3 \ >   -object iommufd,id=iommufd0

[RFC PATCH v3 14/15] Read and validate host SMMUv3 feature bits

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Not all fields in the SMMU IDR registers are meaningful for userspace. Only the following fields can be used:   - IDR0: ST_LEVEL, TERM_MODEL, STALL_MODEL, TTENDIAN, CD2L, ASID16, TTF     - IDR1: SIDSIZE, SSIDSIZE     - IDR3: BBML, RIL     - IDR5: VAX, GRAN64K, GRAN16K, GRAN4K

[RFC PATCH v3 11/15] hw/pci/pci: Introduce optional get_msi_address_space() callback.

2025-07-14 Thread Shameer Kolothum via
(S2) mappings for guest RAM, while the guest controls Stage-1 (S1). To allow VFIO to correctly configure S2 mappings, we currently return the system address space via the get_address_space() callback for vfio-pci devices. However, QEMU/KVM also uses this same callback path when resolving the

[RFC PATCH v3 13/15] hw/arm/smmuv3: Forward invalidation commands to hw

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Use the provided smmuv3-accel helper functions to issue the invalidation commands to host SMMUv3. Signed-off-by: Nicolin Chen Signed-off-by: Shameer Kolothum --- hw/arm/smmuv3-internal.h | 11 +++ hw/arm/smmuv3.c | 28 2 files c

[RFC PATCH v3 05/15] hw/arm/smmuv3-accel: Introduce smmuv3 accel device

2025-07-14 Thread Shameer Kolothum via
Also setup specific PCIIOMMUOps for accel SMMUv3 as accel SMMUv3 will have different handling for those ops callbacks in subsequent patches. The "accel" property is not yet added, so users cannot set it at this point. It will be introduced in a subsequent patch once the necessary support is in pla

[RFC PATCH v3 04/15] hw/arm/smmu-common: Introduce smmu_iommu_ops_by_type() helper

2025-07-14 Thread Shameer Kolothum via
Allows to retrieve the PCIIOMMUOps based on the SMMU type. This will be useful when we add support for accelerated SMMUV3 in subsequent patches as that requires a different set of callbacks for iommu ops. No special handling is required for now and returns the default ops in base SMMU Class. No f

Re: [PATCH v6 3/4] hw/acpi/aml-build: Build a root node in the PPTT table

2025-07-14 Thread Alireza Sanaee via
On Mon, 14 Jul 2025 11:57:19 -0400 "Michael S. Tsirkin" wrote: > On Mon, Jul 14, 2025 at 03:10:41PM +0100, Alireza Sanaee wrote: > > On Mon, 14 Jul 2025 09:09:10 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Jun 04, 2025 at 12:52:32PM +0100, Alireza Sanaee wrote: > > > > From: Yic

[RFC PATCH v3 03/15] hw/arm/smmu-common: Factor out common helper functions and export

2025-07-14 Thread Shameer Kolothum via
Subsequent patches for smmuv3 accel support will make use of this. Signed-off-by: Nicolin Chen Reviewed-by: Eric Auger Signed-off-by: Shameer Kolothum --- hw/arm/smmu-common.c | 48 ++-- include/hw/arm/smmu-common.h | 6 + 2 files changed, 36 insert

[RFC PATCH v3 00/15] hw/arm/virt: Add support for user-creatable accelerated SMMUv3

2025-07-14 Thread Shameer Kolothum via
Hi All, This patch series introduces initial support for a user-creatable, accelerated SMMUv3 device (-device arm-smmuv3,accel=on) in QEMU. This is based on the user-creatable SMMUv3 device series [0]. Why this is needed: On ARM, to enable vfio-pci pass-through devices in a VM, the host SMMUv3

[RFC PATCH v3 12/15] hw/arm/smmuv3-accel: Introduce helpers to batch and issue cache invalidations

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Helpers will batch the commands and issue at once to host SMMUv3. Signed-off-by: Nicolin Chen Signed-off-by: Shameer Kolothum --- hw/arm/smmuv3-accel.c| 65 hw/arm/smmuv3-accel.h| 16 ++ hw/arm/smmuv3-internal.h | 12

[RFC PATCH v3 15/15] hw/arm/smmu-common: Add accel property for SMMU dev

2025-07-14 Thread Shameer Kolothum via
Now user can set "accel=on". Have fun! Signed-off-by: Shameer Kolothum --- hw/arm/smmu-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 6a58f574d3..3e8783670a 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -1022,6 +10

[RFC PATCH v3 08/15] hw/arm/smmuv3-accel: Add set/unset_iommu_device callback

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Implement a set_iommu_device callback: -If found an existing viommu reuse that. (Devices behind the same physical SMMU should share an S2 HWPT) -Else, Allocate a viommu with the nested parent S2 hwpt allocated by VFIO. Allocate bypass and abort hwpt. -And add the

[RFC PATCH v3 09/15] hw/arm/smmuv3-accel: Support nested STE install/uninstall support

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Allocates a s1 HWPT for the Guest s1 stage and attaches that to the dev. This will be invoked when Guest issues SMMU_CMD_CFGI_STE/STE_RANGE. While at it, we are also exporting both smmu_find_ste() and smmuv3_flush_config() from smmuv3.c for use here. Signed-off-by: Nicolin Ch

[RFC PATCH v3 07/15] hw/arm/smmuv3: Implement get_viommu_cap() callback

2025-07-14 Thread Shameer Kolothum via
For accelerated SMMUv3, we need nested parent domain creation. Add the callback support so that VFIO can create a nested parent. Since 'accel=on' for SMMUv3 requires the guest SMMUv3 to be configured in Stage 1 mode, ensure that the 'stage' property is explicitly set to Stage 1. Signed-off-by: Sh

[RFC PATCH v3 10/15] hw/arm/smmuv3-accel: Allocate a vDEVICE object for device

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Allocate and associate a vDEVICE object for the Guest device with the vIOMMU. This will help the kernel to do the vSID --> sid translation whenever required (eg: device specific invalidations). Signed-off-by: Nicolin Chen Signed-off-by: Shameer Kolothum --- hw/arm/smmuv3-ac

[RFC PATCH v3 01/15] backends/iommufd: Introduce iommufd_backend_alloc_viommu

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Add a helper to allocate a viommu object. Signed-off-by: Nicolin Chen Reviewed-by: Eric Auger Signed-off-by: Shameer Kolothum --- backends/iommufd.c | 25 + backends/trace-events| 1 + include/system/iommufd.h | 4 3 files changed,

[RFC PATCH v3 06/15] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd

2025-07-14 Thread Shameer Kolothum via
able correct S2 mappings of guest RAM. So in short: - vfio-pci devices return the system address space - bridges and root ports return the IOMMU address space Note: On ARM, MSI doorbell addresses are also translated via SMMUv3. Hence, if a vfio-pci device is behind the SMMuv3 with translation e

[RFC PATCH v3 02/15] backends/iommufd: Introduce iommufd_vdev_alloc

2025-07-14 Thread Shameer Kolothum via
From: Nicolin Chen Add a helper to allocate an iommufd device's virtual device (in the user space) per a viommu instance. Signed-off-by: Nicolin Chen Reviewed-by: Eric Auger Signed-off-by: Shameer Kolothum --- backends/iommufd.c | 26 ++ backends/trace-events

Re: [PATCH qemu 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 15:02:18 +0100 Jonathan Cameron wrote: > On Mon, 14 Jul 2025 05:32:19 -0400 > "Michael S. Tsirkin" wrote: > > > On Wed, Jul 02, 2025 at 05:02:13PM +0100, Jonathan Cameron wrote: > > > From: Anisa Su > > > > > > FM DCD Management command 0x5602 implemented per CXL r3.2 Sp

Re: [PATCH qemu 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 15:15:12 +0100 Jonathan Cameron wrote: > On Mon, 14 Jul 2025 15:02:18 +0100 > Jonathan Cameron wrote: > > > On Mon, 14 Jul 2025 05:32:19 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Jul 02, 2025 at 05:02:13PM +0100, Jonathan Cameron wrote: > > > > From: An

Re: [PATCH v6 3/4] hw/acpi/aml-build: Build a root node in the PPTT table

2025-07-14 Thread Alireza Sanaee via
On Mon, 14 Jul 2025 09:09:10 -0400 "Michael S. Tsirkin" wrote: > On Wed, Jun 04, 2025 at 12:52:32PM +0100, Alireza Sanaee wrote: > > From: Yicong Yang > > > > Currently we build the PPTT starting from the socket node and each > > socket will be a separate tree. For a multi-socket system it'll >

Re: [PATCH qemu 07/11] hw/cxl: mailbox-utils: 0x5602 - FMAPI Set DC Region Config

2025-07-14 Thread Jonathan Cameron via
On Mon, 14 Jul 2025 05:32:19 -0400 "Michael S. Tsirkin" wrote: > On Wed, Jul 02, 2025 at 05:02:13PM +0100, Jonathan Cameron wrote: > > From: Anisa Su > > > > FM DCD Management command 0x5602 implemented per CXL r3.2 Spec Section > > 7.6.7.6.3 > > > > Reviewed-by: Fan Ni > > Signed-off-by: An

Re: [PATCH v14 5/7] hw/acpi: add cache hierarchy to pptt table

2025-07-14 Thread Alireza Sanaee via
On Mon, 14 Jul 2025 06:11:44 -0400 "Michael S. Tsirkin" wrote: > On Mon, Jul 14, 2025 at 10:59:58AM +0100, Alireza Sanaee wrote: > > On Sun, 13 Jul 2025 17:15:02 -0400 > > "Michael S. Tsirkin" wrote: > > > > > On Mon, Jul 07, 2025 at 01:19:06PM +0100, Alireza Sanaee wrote: > > > > Add cache

Re: [PATCH v14 5/7] hw/acpi: add cache hierarchy to pptt table

2025-07-14 Thread Alireza Sanaee via
On Sun, 13 Jul 2025 17:15:02 -0400 "Michael S. Tsirkin" wrote: > On Mon, Jul 07, 2025 at 01:19:06PM +0100, Alireza Sanaee wrote: > > Add cache topology to PPTT table. With this patch, both ACPI PPTT > > table and device tree will represent the same cache topology given > > users input. > > > > C

RE: [PATCH v3 02/20] hw/pci: Introduce pci_device_get_viommu_cap()

2025-07-11 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Thursday, July 10, 2025 6:16 PM > To: Shameerali Kolothum Thodi > Cc: Donald Dutile ; Zhenzhong Duan > ; qemu-devel@nongnu.org; > alex.william...@redhat.com; c...@redhat.com; eric.au...@redhat.com; > m...@redhat.com; jasow...@redhat.com

Re: [PATCH v4 3/3] net/af-xdp: Support pinned map path for AF_XDP sockets

2025-07-11 Thread Daniel Borkmann via
Hey Ilya, On 7/9/25 2:29 PM, Ilya Maximets wrote: [...] Thnaks, Daniel! I have just a couple of small nits below that I missed in v3, the rest looks good and is working fine. diff --git a/net/af-xdp.c b/net/af-xdp.c index 29c5ad16cd..005117c336 100644 --- a/net/af-xdp.c +++ b/net/af-xdp.c @@

  1   2   3   4   5   6   7   8   9   10   >