On Fri, 16 Oct 2026 18:10:55 +0800
Jinjie Ruan <[email protected]> wrote:

> From: Jinjie Ruan <[email protected]>
> 
> Instead of failing with 'MPAM support requires NUMA nodes to be
> specified', -M virt,mpam=on with no -numa now treats all RAM as one
> implicit node 0 and creates a single memory MSC for it (node 0, one
> RIS, same partitioning configuration as a per-node instance).  The
> ACPI MPAM locator keeps proximity domain 0, which the mainline
> arm_mpam driver resolves to node 0 via its pxm_to_node()
> NUMA_NO_NODE fallback; no SRAT is fabricated and the guest stays
> non-NUMA-aware.  Cache MSC creation is unaffected, and explicit
> -numa / mpam-min-msc paths are unchanged.

I'd push this back to where that check was introduced in the earlier
patch.

> 
> Signed-off-by: Jinjie Ruan <[email protected]>
> ---
>  hw/arm/virt.c | 30 +++++++++++++++++++++++++-----
>  1 file changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 4ef7aed..ee4308e 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2244,11 +2244,31 @@ static void create_mpam_msc(VirtMachineState *vms, 
> Error **errp)
>      hwaddr base = vms->memmap[VIRT_MPAM_MSC].base;
>  
>      if (ms->numa_state->num_nodes == 0) {
> -        error_setg(errp,
> -                   "MPAM support requires NUMA nodes to be specified");
> -        return;
> -    }
> -    if (!vms->mpam_min_msc) {
> +        /*
> +         * No -numa: treat all RAM as one implicit node 0 -- a single
> +         * memory MSC with one RIS.  The ACPI locator keeps proximity
> +         * domain 0, which the arm_mpam driver resolves to node 0 via its
> +         * pxm_to_node() NUMA_NO_NODE fallback; no SRAT is fabricated and
> +         * the guest stays non-NUMA-aware.
> +         */
I lost track, but doesn't this just correspond to 1 node 1 ris?  Why can't
we use either of the existing paths below having tweaked the number of nodes?

> +        int err_spi, oflow_spi;
> +
> +        dev = qdev_new(TYPE_MPAM_MSC_MEM);
> +        object_property_set_uint(OBJECT(dev), "node", 0, &error_fatal);
> +        object_property_set_uint(OBJECT(dev), "num-ris", 1, &error_fatal);
> +        object_property_set_uint(OBJECT(dev), "num-partid",
> +                                 MPAM_VIRT_NUM_PARTID, &error_fatal);
> +        object_property_set_uint(OBJECT(dev), "num-int-partid",
> +                                 MPAM_VIRT_NUM_INTPARTID, &error_fatal);
> +        mpam_msc_assign_irqs(dev, &err_spi, &oflow_spi, &next_spi);
> +        sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> +        sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
> +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
> +                           qdev_get_gpio_in(vms->gic, err_spi));
> +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), 1,
> +                           qdev_get_gpio_in(vms->gic, oflow_spi));
> +        base += MPAM_SIZE;
> +    } else if (!vms->mpam_min_msc) {
>          for (i = 0; i < ms->numa_state->num_nodes; i++) {
>              /* at most 16 mem MSCs (4-bit selector space, SPI budget) */
>              if (ms->numa_state->nodes[i].node_mem > 0 && count < 16) {


Reply via email to