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

From: Guixin Liu

Date: Wed Mar 25 2026 - 04:52:18 EST




在 2026/3/25 16:15, Thomas Gleixner 写道:
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.
I found that hwsize only affects the range checking when allocating and
releasing intterrupts after the irq_domain is established,
and the kernel does not allocate related resources based on it.
Cloud you plz tell me specifically where the inconsistency is? thanks.

Best Regards,
Guixin Liu