From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Teddy Astie" <teddy.astie@vates.tech>,
"Roger Pau Monné" <roger@xenproject.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 08/14] XSM: pass just SBDF to xsm_{,un}map_domain_irq()
Date: Wed, 2 Dec 2026 08:20:29 -0500 [thread overview]
Message-ID: <00f49ab3-55d9-4fa4-a41f-dbfa3ec79cbb@apertussolutions.com> (raw)
In-Reply-To: <6c001ee4-906b-4213-a77b-44a250319a5c@suse.com>
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
next prev parent reply other threads:[~2026-12-02 13:21 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 8:49 [PATCH v2 00/14] XSM: follow-on to XSAs 492 and 499 Jan Beulich
2026-08-17 8:51 ` [PATCH v2 01/14] XSM: make xsm_default_action() const-correct Jan Beulich
2026-08-27 18:19 ` Daniel P. Smith
2026-08-17 8:51 ` [PATCH v2 02/14] XSM: convert "allow" (Flask: "access") parameters to bool Jan Beulich
2026-08-17 8:52 ` [PATCH v2 03/14] x86/mm: get_page_from_l1e() is PV-or-shadow-only Jan Beulich
2026-09-22 14:18 ` Andrew Cooper
2026-09-23 8:06 ` Jan Beulich
2026-08-17 8:52 ` [PATCH v2 04/14] x86: restrict PHYSDEVOP_* when PV=n Jan Beulich
2026-09-22 15:21 ` Andrew Cooper
2026-09-22 16:02 ` Jan Beulich
2026-08-17 8:53 ` [PATCH v2 05/14] XSM: make Argo hooks well-formed ones Jan Beulich
2026-08-27 18:24 ` Daniel P. Smith
2026-08-17 8:53 ` [PATCH v2 06/14] XSM: fold xsm_{,un}map_domain_pirq() hooks Jan Beulich
2026-08-27 18:25 ` Daniel P. Smith
2026-11-30 14:31 ` Andrew Cooper
2026-08-17 8:54 ` [PATCH v2 07/14] x86: type-correct last parameter of map_domain_pirq() Jan Beulich
2026-11-30 14:12 ` Andrew Cooper
2026-08-17 8:54 ` [PATCH v2 08/14] XSM: pass just SBDF to xsm_{,un}map_domain_irq() Jan Beulich
2026-11-30 14:21 ` Andrew Cooper
2026-12-01 12:56 ` Andrew Cooper
2026-12-01 15:00 ` Jan Beulich
2026-12-02 13:20 ` Daniel P. Smith [this message]
2026-08-17 8:55 ` [PATCH v2 09/14] XSM: fold xsm_{,un}map_domain_irq() hooks Jan Beulich
2026-12-02 6:59 ` Ping: " Jan Beulich
2026-08-17 8:56 ` [PATCH v2 10/14] XSM: fold xsm_{,un}bind_pt_irq() hooks Jan Beulich
2026-08-17 8:56 ` [PATCH v2 11/14] XSM: convert remaining event channel hooks Jan Beulich
2026-08-17 8:57 ` [PATCH v2 12/14] XSM: convert remaining domain-related hooks Jan Beulich
2026-08-17 8:58 ` [PATCH v2 13/14] XSM: convert remaining miscellaneous hooks Jan Beulich
2026-08-17 8:58 ` [PATCH RFC v2 14/14] XSM: avoid fragile assumptions in xsm_fixup_ops() Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00f49ab3-55d9-4fa4-a41f-dbfa3ec79cbb@apertussolutions.com \
--to=dpsmith@apertussolutions.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=roger@xenproject.org \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.