Re: [PATCH 1/2] genirq/msi: Introduce update hwsize helper

From: Thomas Gleixner

Date: Wed Mar 25 2026 - 04:21:01 EST


On Tue, Mar 24 2026 at 09:47, Guixin Liu wrote:
> +int msi_domain_update_hwsize(struct device *dev, unsigned int domid,
> + unsigned int hwsize_new)
> +{
> + struct msi_domain_info *info;
> + struct irq_domain *domain;
> +
> + if (hwsize_new > MSI_XA_DOMAIN_SIZE)
> + return -EINVAL;
> + if (!hwsize_new)
> + hwsize_new = MSI_XA_DOMAIN_SIZE;
> +
> + domain = msi_get_device_domain(dev, domid);
> + if (!domain)
> + return -ENODEV;
> +
> + info = domain->host_data;
> + if (hwsize_new != info->hwsize)
> + info->hwsize = hwsize_new;

This is incorrect because the underlying irqdomain has been created with
the original hardware size. So just fiddling with info->hwsize results
in inconsistent state.