[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] xen/amd/iommu: record the IOMMU for alias DeviceIDs
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
- Date: Tue, 20 Oct 2026 15:12:14 -0700
- 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)
- 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=0lTzeI14p4isnUJycPWW8/lofc2072mgt52wrZcl9+A=; b=Sf7OyMJ1olu/3LOF0Ai7oOeTd5TSFqKLE0VTBd4OfZaXBz5v5SgOFEYMql6vT8XAB6ol8OddhzQsZRBpN5BKjSf1q781/QQEndzjsXsdImqf+grKA8D1VJ5qWVC2U/eizpPN/d8y/N8nmMJSGjuMhiXYrsM4/uLybURkz2dcXgvZ42T21DiVrQKAURoDI8YztVdM724J8MX0yxujgq/XgrnTfG3/MuJv0CUZV6lJADVygHltV8S9s6uR3Jydv3EPIyTztOhPHdtlKBB0pgXgHY/kN0l9eGSf6d+8Mz3A9sOkkL/PkFlrGykDAxIz2SXBAgxBhoB5aYsej3SoqA6WRw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZzFbkAkyCGmYaaPHKdQFBfVfNy8FCAEHQyqSlPQKFkdK3JyUGBY/H3k8MuEmX65SgYjc8COBOhvPhtQ5jEfjsQky937AJoHhw8nAjT8E2Yz7PskU7pBNUMDxfb8fQwojvlegOh5lbFBeZ0W7XPPEYhUOSaFB+TcH78OLispUhGiAbZap0xPaxjvalRJg7qi4ndUeUb+y1Y9TNvUUaGGI5xhhDFihowmI0Nt5KwzCXqbr/whHK0v2TffiuxiM8poZ3+J6L07nylU8f6qozFLOys1eAEjFi9t/XRKtkk0ASZjU58LytW52JM1SvvXXYEk3a9sJN/Agcyv9/8lDFRlvdg==
- 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"
- Cc: <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <roger@xxxxxxxxxxxxxx>, <jason.andryuk@xxxxxxx>, <teddy.astie@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>
- Delivery-date: Tue, 20 Oct 2026 22:12:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
add_ivrs_mapping_entry() marks an alias DeviceID valid and may give it
an interrupt remapping table, but records the IOMMU only for the
aliased device. If no IVHD entry names the alias DeviceID itself,
amd_iommu_setup_device_table() passes a NULL IOMMU to
amd_iommu_set_intremap_table(), and Xen crashes at boot.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
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/passthrough/amd/iommu_acpi.c
index fe3dee872c..31fae663c8 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(
/* Assign IOMMU hardware. */
ivrs_mappings[bdf].iommu = iommu;
+
+ /* Requests using the alias go through the same IOMMU. */
+ if ( !ivrs_mappings[alias_id].iommu )
+ ivrs_mappings[alias_id].iommu = iommu;
}
static struct amd_iommu * __init find_iommu_from_bdf_cap(
--
2.43.0
|