From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FA3E606A31A for ; Wed, 2 Dec 2026 13:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=apertussolutions.com header.i=@apertussolutions.com header.a=rsa-sha256 header.s=x header.b=cAMI2fhJ Received: from list by lists.xenproject.org with outflank-mailman.1510548.1703263 (Exim 4.92) (envelope-from ) id 1xYkGN-0000MP-0B; Wed, 02 Dec 2026 13:20:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1510548.1703263; Wed, 02 Dec 2026 13:20:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYkGM-0000MI-Sc; Wed, 02 Dec 2026 13:20:46 +0000 Received: by outflank-mailman (input) for mailman id 1510548; Wed, 02 Dec 2026 13:20:45 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYkGL-0000MC-78 for xen-devel@lists.xenproject.org; Wed, 02 Dec 2026 13:20:45 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xYkGK-00BRHf-Jh for xen-devel@lists.xenproject.org; Wed, 02 Dec 2026 14:20:44 +0100 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6b101b20-bab6-0a2a0a5309dd-0a2a45048d28-36 for ; Wed, 02 Dec 2026 14:20:44 +0100 Received: from [136.175.108.253] (helo=mail-108-mta253.mxroute.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6b101b2a-b57f-0a2a45040019-88af6cfd80c1-3 for ; Wed, 02 Dec 2026 14:20:43 +0100 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta253.mxroute.com (ZoneMTA) with ESMTPSA id 1a236ea0e49000d084.002 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 02 Dec 2026 13:20:38 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=x header.d=apertussolutions.com header.i="@apertussolutions.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date" X-Zone-Loop: 2dd1b5394160dde7ffd080c9831e8f80fe69eccbdf2f DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=apertussolutions.com; s=x; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=/TW8n6aUqzcghXup2b/4zn74bYAPEuGbZf8dVjgLlmY=; b=cAMI2fhJIJSCzqBcC5C+VjwQyX JbKh50Vl05UPS5ujZX7pV8q5sTKZMAqDgw/AAQ6jKsmp51kJOf3B7CWs96tgsgBU8lbHogg16OREj tiOhgR8EdS+Af11biqFzFMMZeZipAAdAsfwwciOF930piaP3EJTfCtIQbmL5hxJhMZEx1XlcJhy30 T52IKHeABeYTwgsJZMkDz4EdnQDc4z2jLmfS4+h4cCpD7Oy2HsTVIFOXPgdCMxFYfdN6qreJzS8eV lPoE2qV7z5wfJXeuvoeQhAlWk4wE5pX/FYGpKnuZLexv6SVTVIQj0ifPZQOCrAex6RTzbH82gt5Ks 7WHGZ/PA==; Message-ID: <00f49ab3-55d9-4fa4-a41f-dbfa3ec79cbb@apertussolutions.com> Date: Wed, 2 Dec 2026 08:20:29 -0500 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 08/14] XSM: pass just SBDF to xsm_{,un}map_domain_irq() To: Jan Beulich , Andrew Cooper Cc: Teddy Astie , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "xen-devel@lists.xenproject.org" References: <6c001ee4-906b-4213-a77b-44a250319a5c@suse.com> Content-Language: en-US From: "Daniel P. Smith" In-Reply-To: <6c001ee4-906b-4213-a77b-44a250319a5c@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Id: dpsmith@apertussolutions.com X-purgate-ID: tlsNG-ebf023/1796217643-C0EDEB50-D4FE1B2E/0/0 X-purgate-type: clean X-purgate-size: 2212 X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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