[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 08/14] XSM: pass just SBDF to xsm_{,un}map_domain_irq()
On 12/1/26 10:00 AM, Jan Beulich wrote:
On 01.12.2026 13:56, Andrew Cooper wrote:
On 17/08/2026 9:54 am, Jan Beulich wrote:
@@ -1091,32 +1088,15 @@ static int cf_check flask_map_domain_irq
return rc;
}
-static int flask_unmap_domain_msi (
- struct domain *d, int irq, const void *data, uint32_t *sid,
- struct avc_audit_data *ad)
-{
-#ifdef CONFIG_HAS_PCI_MSI
- const struct pci_dev *pdev = data;
- uint32_t machine_bdf = (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn;
-
- AVC_AUDIT_DATA_INIT(ad, DEV);
- ad->device = machine_bdf;
-
- return security_device_sid(machine_bdf, sid);
-#else
- return -EINVAL;
-#endif
-}
-
static int cf_check flask_unmap_domain_irq(
- struct domain *d, int irq, const void *data)
+ struct domain *d, int irq, const pci_sbdf_t *sbdf)
{
uint32_t sid;
int rc = -EPERM;
struct avc_audit_data ad;
- if ( irq >= nr_static_irqs && data )
- rc = flask_unmap_domain_msi(d, irq, data, &sid, &ad);
+ if ( irq >= nr_static_irqs && sbdf )
+ rc = flask_map_domain_msi(d, irq, *sbdf, &sid, &ad);
else
rc = get_irq_sid(irq, &sid, &ad);
From AI review:
- d068e967e8 (XSM: pass just SBDF), xen/arch/x86/irq.c in
unmap_domain_pirq(): the argument changed from msi_desc ? msi_desc->dev
: NULL to msi_desc ? &msi_desc->dev->sbdf : NULL. If msi_desc is set but
msi_desc->dev is NULL, Flask used to fall back to get_irq_sid(). Now it
gets a bogus non-NULL pointer. HPET and VT-d IOMMU interrupts have no
dev, though it looks unlikely they can reach this path. msi_desc &&
msi_desc->dev ? ... : NULL would keep the old behaviour.
While it noticed the HPET and IOMMU cases as special, it somehow didn't
manage to realize that we'd never expose HPET or IOMMU IRQs to guests.
Hence afaict there's no change in behavior here.
I concur, this came up in my own cross-check AI Review and I traced them
out to find then same as Jan has indicated.
dps
|