From nobody Mon Nov 23 22:39:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1793059208; cv=pass; d=zohomail.com; s=zohoarc; b=fb75FyJ3ltNmkhknJP4WyZ8e9cyVYjr2LsWPyQOpiiMrV+hu0njh+BiZ023MxVxFpR6SAODyI5f+FY831qKdB4r7ACIPqd0yB/iNiVXTbk7pLGVSa9vC/hejKe0L64gRW+8cqWhgiuFUZ0CL6oTD9i7FC/HfLplwYXvqesO7VfY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793059208; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TWgMMYm6qraa7yW0VlmJDne9MS3CBCB+gTW/oD8hbgw=; b=V3WrsRrlDbE0wD+eF2V5C145f/t8jxk+1c4VeNCv0/c8jVarUtIg1r2oxPDvOEoSPY/nLUaH5BgOgMQ1Mm6pCN133By9heJvNmoYB0flOEPK1j+B7lLv7DePFleWqCAUY+BMWdWOBSGE1/uZxnx/ZtAe7OFycq5TxxKTad/FO7E= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1793059208247165.89594078443827; Mon, 26 Oct 2026 17:00:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1461742.1672770 (Exim 4.92) (envelope-from ) id 1xLUbK-0002Kn-9o; Mon, 26 Oct 2026 23:59:38 +0000 Received: by outflank-mailman (output) from mailman id 1461742.1672770; Mon, 26 Oct 2026 23:59:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xLUbK-0002Kg-62; Mon, 26 Oct 2026 23:59:38 +0000 Received: by outflank-mailman (input) for mailman id 1461742; Mon, 26 Oct 2026 23:59:37 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xLUbJ-0002Ka-Lk for xen-devel@lists.xenproject.org; Mon, 26 Oct 2026 23:59:37 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xLUbI-001mTq-KW for xen-devel@lists.xenproject.org; Tue, 27 Oct 2026 00:59:36 +0100 Received: from [10.42.69.3] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6adfe968-e002-0a2a0a5209dd-0a2a45038f2e-0 for ; Tue, 27 Oct 2026 00:59:36 +0100 Received: from [40.107.209.42] (helo=PH8PR06CU001.outbound.protection.outlook.com) by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6adfe966-fae8-0a2a45030019-286bd12a1e58-3 for ; Tue, 27 Oct 2026 00:59:35 +0100 Received: from BN9PR03CA0058.namprd03.prod.outlook.com (2603:10b6:408:fb::33) by CH1PR12MB9648.namprd12.prod.outlook.com (2603:10b6:610:2b0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Mon, 26 Oct 2026 23:59:31 +0000 Received: from BN1PEPF00018546.namprd05.prod.outlook.com (2603:10b6:408:fb:cafe::3c) by BN9PR03CA0058.outlook.office365.com (2603:10b6:408:fb::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.20 via Frontend Transport; Mon, 26 Oct 2026 23:59:31 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by BN1PEPF00018546.mail.protection.outlook.com (10.167.248.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Mon, 26 Oct 2026 23:59:30 +0000 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.53; Mon, 26 Oct 2026 18:59:30 -0500 Received: from amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.53 via Frontend Transport; Mon, 26 Oct 2026 18:59:29 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DPU7hfR9d0myahnPwxUYUCceN7j3pbzBi+Q/JI4G8h8Y9sOAEhgHz5peGKPm1deH8nBpKONZbwwwpo/6gC2o2MFUpQTDWgIRPvqNxgHd9n313L2if3etVjXdYk7DLkMwhkzzICtY4pey0ZKF4AB/Ez+NHe0dEfHFkQQTViagryPKQjnJIpHKIZPybadf6bUe4Cg9SfRRdLVDXEnOVCYVuqsluXbSmFfd3Fw3hXqNid+9uQH6KhjZpbQmASsL+q+kMeXNyzZsXhjyiQtmInT5GaC9XW1RPV4gGTfzqHFrf1TrRVMspl3g2bi+yta15Ha0X2/kIr1A4GVbJCMM8mCJ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TWgMMYm6qraa7yW0VlmJDne9MS3CBCB+gTW/oD8hbgw=; b=LASdTsR/ERZal9GOdhfObaYIl0la3PujmrDM5Szoi6Ksh5k7NA7OciRGjZqJ19/FivcqqirvkLdHlomKHrft+o4SQxYJgAFlWrziTOXGz5LKQ4GMBlqq/8jT4LovN7C6droc35TecseC02cxfxQ88VRan4HF3ZaVARCBgMShHr2HLPehtrNJVdf4dgWOBPsPv4SGS8pzVSJwC1JxvIQBmIyHwh9o4W+nQRhJsQ4vj/GUQMwmzRSXjsngU8B0aydZZt35hh3sgVmEbtcb9a81UUyIIY54U9emZi+IVYG/CHDc6QawbY3Z376jE8ISzOqjH+7Y+cd/6YEeqAHX9HoO6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TWgMMYm6qraa7yW0VlmJDne9MS3CBCB+gTW/oD8hbgw=; b=jqWvVCOZsccj5jWiix4Cc74E501AEdPQ7mo1JilLKe2eugph2sBzA0uPqF0BmCn2T49k5Q7sXDfUIhOMpYr3k36B6K1YiNUc8BwPcNaTyKVD0pow4fjlAuCxtIBDSqX/ZG8Zc/KzEVt3Wj7dPJtRWV3cuQ4NCWu2GaU8R6lM4dM= X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C From: Stefano Stabellini To: CC: Stefano Stabellini , , , , , Subject: [PATCH v2] xen/amd/iommu: record the IOMMU for alias DeviceIDs Date: Mon, 26 Oct 2026 16:59:26 -0700 Message-ID: <20261026235926.2105578-1-stefano.stabellini@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261020221214.3683476-1-stefano.stabellini@amd.com> References: <20261020221214.3683476-1-stefano.stabellini@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00018546:EE_|CH1PR12MB9648:EE_ X-MS-Office365-Filtering-Correlation-Id: d0f0e4ea-5063-4d6b-99ee-08df33bd2d16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700016|82310400026|23010399003|1800799024|6133799003|18002099003|22082099003|261026140227099003|10067099003|11063799006|5023799004|56012099006|261009223027099003|261022075727099003|261022105027099003|261021121427099003|261026121527099003; X-Microsoft-Antispam-Message-Info: zrB6f7I9YuWLKXUL18K6a/PMc8mUNXfFsCXquwM/Tf9jYAcGJx0hOhc7Px+5HDT+bAIZdG5JcnJWxFRcipvDkodi7ynz2SSUu3ftUEVHudCvd6UMXqB79UeGQ0j9MCqXoesGK9mjEJ+XR8vLayGIkbQ0dpYOtpECxz8ZCy9weIr54M4jNVmqBMMHk+7zaFXqdejjeASnCEiQZKgTfptHwmmqvfO0TnMtAAQgIvdprJiUCpOxLZFLp2tQhHB2TCU4MfhIRjvhjQS9qjlDR3iDBjymf9BHKalVeCFo56GjRitaCPvBOEhwBhshEoHaWEo0vIvDI6QbS6ru8Tzj8ZZ6/Vj0svJXyw3TtO7QM7h14OaxA1ZBqHAuINAaq+4Zn/9Oav/hnyHL7fQdrk1uFO/S34SH/uHkhx01hOLqqIgNaDtfhivxUrB5SeqHyHWHd8D9OYVxGzPl4+lUnJFIQOolvL7UJvtbO5PPqfTyfphxC+cMOKQ5HO3bzWdqexX6poQNHbbJSUcQNCSHzG2j/3zngIoz3vHmzG+WG9adtsjN/CFYYMh8xSurJPHGSz+DuHhBzLBZsFxlU9SQhPfycWvHtzySrqJI/0dXKVxx0bnfpO424C9mallpYKlTy3rKA+uaF35uTP8RhUfw+tgRVTTRUaIkguyUQgNhUWo3+3Rqt2Bm45PBefEV37JyqsnOqPSXDZySmtgFbANQYzFYtzmbyg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700016)(82310400026)(23010399003)(1800799024)(6133799003)(18002099003)(22082099003)(261026140227099003)(10067099003)(11063799006)(5023799004)(56012099006)(261009223027099003)(261022075727099003)(261022105027099003)(261021121427099003)(261026121527099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FvgV1rR9k8DWCqWHE0llZDTVIGyl+ADHIeXz6iALF/9XH9ayiGI5iaindmhI8Ub3+pKmPNMZgprZXSvkNjw4rK/OYnhSedVlLLEMHTpyBhC4y0HuKeZB0p/XkVHFjy44N7K8d5Oc6NRzS/UYk+Nw5GpMc+IyFNj/UsTIkMCKIvjNqgapWWAV8ftNuVUO/UDoR62sLXL1IaWX+ojStHs2EiZghadLn/qBRwDeh5NFWZWOYCH2HtQRMAlyFHDLgbYUCY4uGnJe5GyFHdjwtcF+J0U75XHoTo6tYfV1PJHeJ7lLYxP1+VuxYnxXf8YISeZat7SxXz8/gdzCytcJiNoWlTjglkH82o18LRepbR9gPoUdP5LwHVjjehvdswe9BJw9KGXx3tPvKYKXd9MSVDU9zMAlhh+7BFwvAFwynpZjs9dtrvPFjjWbmZEmfLkPHJKm X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2026 23:59:30.7811 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0f0e4ea-5063-4d6b-99ee-08df33bd2d16 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00018546.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PR12MB9648 X-purgate-ID: tlsNG-33051d/1793059176-74C884E9-0F62AE7B/0/0 X-purgate-type: clean X-purgate-size: 1834 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1793059209976158500 Content-Type: text/plain; charset="utf-8" add_ivrs_mapping_entry() marks an alias DeviceID valid and may give it an interrupt remapping table, but records the IOMMU only for the device using the alias. If no IVHD entry names the alias DeviceID itself, amd_iommu_setup_device_table() passes a NULL IOMMU to amd_iommu_set_intremap_table(), which dereferences it at boot. Record the IOMMU for the alias too, as was done before the interrupt remapping rework. Nothing relies on it being NULL: the alias is then handled like any other DeviceID. Its remapping table is freed on cleanup and dumped by the 'V' key, a device at the alias DeviceID can be added instead of failing with -ENODEV, and reserved ranges, already recorded for the alias as well, are reported once under it. A NULL check at the crash site instead would leave the alias device table entry without interrupt remapping. Fixes: a3713b97e8e1 ("AMD IOMMU: Rework of interrupt remapping") Signed-off-by: Stefano Stabellini --- Changes in v2: - describe the crash precisely, and why nothing relies on the alias entry's IOMMU being NULL - add a Fixes tag xen/drivers/passthrough/amd/iommu_acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthr= ough/amd/iommu_acpi.c index d118b36d80..d8ff4d24da 100644 --- a/xen/drivers/passthrough/amd/iommu_acpi.c +++ b/xen/drivers/passthrough/amd/iommu_acpi.c @@ -104,6 +104,10 @@ static void __init add_ivrs_mapping_entry( =20 /* Assign IOMMU hardware. */ ivrs_mappings[bdf].iommu =3D iommu; + + /* Requests using the alias go through the same IOMMU. */ + if ( !ivrs_mappings[alias_id].iommu ) + ivrs_mappings[alias_id].iommu =3D iommu; } =20 static struct amd_iommu * __init find_iommu_from_bdf_cap( --=20 2.47.3