From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.49]) by mx.groups.io with SMTP id smtpd.web11.53798.1674672088426863900 for ; Wed, 25 Jan 2023 10:41:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=Ik+8y0c+; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.101.49, mailfrom: username@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U9rPV0n1w7vnJLqwmb6p+m6BsFnSIjcOUP6c32NQKbosNeFRo+/6vG+e4ERpaTWEMNcMZc55CS76cR3rEsg6pzjgO5CScdcelD+oH3hxrDghBKd0h/1bBQp2SMfIYWH/Pn33VRLpRoWsTvwejg9XK4ZxClC++qJUsd0mzD0zUQudjymqWGhw4YpHjN21itbfHU0HiWIeIBgkEp/o9LIncTqA9s1T5re82G0GD6YmsCyLFbvKlo5vCvk6DetUbPQp8OpMtAeqLDXaC4uwcS0gcleyB48Rioz1KDYqN0vRIB/Ey7Nh0TLfg6GkQwIEX9/STCryM2cwpctqDzCCHIn4Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=4bDdTEsekfDlmkCwGyhpptEo40pyebz1uhkVh8NfVSA=; b=GlLp7aQyGs91tuJYU4Usp2zYLC3SlAV5obSF9llu5bXvy9Thh9fA5c0GlSmZ5CjU6K0P3eboQECZfViqeQbHt1nKqf5i4ug5R7BZeYwSurByC3ABQcK5EPDb+l9IUuXOigzgtmzbReLpa0pdHKHCcw3GmGwHGBSlNL8sKmYctB9vL2IhLpC/x7tzA1PRw2rFCC4mFH4XZobNPwlQ6BmwyUahWNyu/5lkaixvw7h2C1zWDTDNmLjY6ScZYSARZdeOUsp15bbcvmVlJagVe6JhfeVsdly+uFal4fhwxClr0sS9FgV0H/LJ+bQzCpV42jLWXApB8Qolco1n0zvKlwWAPA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4bDdTEsekfDlmkCwGyhpptEo40pyebz1uhkVh8NfVSA=; b=Ik+8y0c+zeK3j8deIcNoGkFVLX+voe5k1oJLjQpHQ/sJ5HBZ0xWUeri7Q3/ahlWNBuTWkL5nJXKMqb1c0laG7UYrllosZHOze41dk5J+3dZa///TNdvrO0kY/zbXCBrJ2MVZmKADxtjvXSsB0vNCNBcn0TbkHj40zXBb+h+fE1ubKbvFZFCo/rCyclCU7nzF42Q4/jgwji4ZNP1/4XtAqlZa0kr8n4xTJardZnJjPsBbfWSWCiOXARbtdNYiQwEZ29xAyogbtfCoX9srogbvbCMI7JrmSH3Efzl01dnj+lX7pYVen+iy9/d0OKxU4jc6J7rHdhcjb7VlJ1ugJCiyjQ== Received: from BN8PR07CA0026.namprd07.prod.outlook.com (2603:10b6:408:ac::39) by IA1PR12MB6068.namprd12.prod.outlook.com (2603:10b6:208:3ec::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 18:41:25 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::14) by BN8PR07CA0026.outlook.office365.com (2603:10b6:408:ac::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.20 via Frontend Transport; Wed, 25 Jan 2023 18:41:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.17 via Frontend Transport; Wed, 25 Jan 2023 18:41:24 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 25 Jan 2023 10:41:07 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Wed, 25 Jan 2023 10:41:07 -0800 Received: from swatisrik-X299-A.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Wed, 25 Jan 2023 10:41:06 -0800 From: Name To: , , , , , , CC: Swatisri Kantamsetti Subject: [PATCH 1/2] DynamicTablesPkg: IORT generator updates for Rev E.e spec Date: Wed, 25 Jan 2023 11:40:53 -0700 Message-ID: <13bc39429583f0129b2935970df6489191004ad2.1674671138.git.swatisrik@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public Return-Path: username@nvidia.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT020:EE_|IA1PR12MB6068:EE_ X-MS-Office365-Filtering-Correlation-Id: f568bdd1-3b6c-40fc-f5a3-08daff03c316 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DvYXU5uH/YW3fohQX9IX0jwMi3BBLFvbGvujbsSW1y1JKyNNRZABEb+9ADyv7gdfbi3clkt9r1BNffPayR58L0AVlO3/Ygl+y78XAhw5gqBqJiPCmQrrg30AcGjmK0YV7TIY/ZeTAD5afv6r3QVWRvAGUPtl3QdbaRO8GfFlHuJEzfYcxcnNA/bUsicC5Cyaa0Y5FWzD8pTc10vWOrtmSZUt4C9/g8l9kop9oD8AyVrf54Y+ig2kqFEwg+5Oc1X1vPPDK7Huc9fy20fZ3LovIfEEb/dmCxbtl13xHenScmnV+/ZFthhYsXS3XYL/48fWpcIF9b1LM1UKE0ZhW2WWqPz/3eanj81NZ3Vl1n0eJu95zp9nj3nZrdgdqC4P+/nyCOba3cVcQAjxv8KWjQCZYHdIL39OYoSjzqmhwb9UsW1pldoQ0dHnq4oJhWUISjdfEEnwoqTMNkH0F8LxikY0+O7yoHOomedalNrWTqBJqu6Ibn8AdXFwbMPD/1ahQSXVGPrT3uAD78X2dRWe4KYCa4/OIWKHTa+NU4H2dQz21G8jlxo6tKsCQS2n5e1BX7iJnpMAKuH+YE6eZczw+uyG8GluCiaIVbJgBr01LZcTHL9/jVsAm0CjIZzyBTXMcKSGRqBDuBrTeh39uExUz2FEBMPKAlZ0ANsh0Ih/SmMx1SGkoWPGUSrihq8+RJrA8AIqcSn/5sFT4ZbH1EDe9vIysbjDVGihp9eZI1n65nYc5FgR24LvbxnTQyHb1xYDhpBVLB3fkeWSwT5wC7cF+qCJxu1cCubBOBg/FVQw77x2w/0= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199018)(40470700004)(36840700001)(46966006)(82740400003)(5660300002)(2906002)(15650500001)(36756003)(8676002)(40460700003)(70206006)(40480700001)(70586007)(478600001)(86362001)(316002)(426003)(336012)(186003)(26005)(6666004)(47076005)(107886003)(83380400001)(356005)(7636003)(4326008)(8936002)(2616005)(41300700001)(82310400005)(110136005)(7696005)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 18:41:24.7361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f568bdd1-3b6c-40fc-f5a3-08daff03c316 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6068 Content-Type: text/plain From: Swatisri Kantamsetti The IO Remapping Table, Platform Design Document, Revision E.e, Sept 2022 (https://developer.arm.com/documentation/den0049/ee) added flags in SMMUv3 node for validity of ID mappings for MSIs related to control interrupts. It makes one small addition to SMMUv3 nodes to describe MSI support independently of wired GSIV support Therefore, update the IORT generator to: - increment IORT table revision to 6 - increment SMMUV3 node revision to 5 - for SMMUV3 node revision >=5 check the DeviceID mapping index valid flag to populate DeviceIdMappingIndex field - preserve backward compatibility. Signed-off-by: Swatisri Kantamsetti --- .../Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index f28973c1a8..235a475629 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1554,9 +1554,14 @@ AddSmmuV3Nodes ( { SmmuV3Node->Node.Revision = 2; SmmuV3Node->Node.Identifier = EFI_ACPI_RESERVED_DWORD; - } else { + } else if (AcpiTableInfo->AcpiTableRevision < + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06) + { SmmuV3Node->Node.Revision = 4; SmmuV3Node->Node.Identifier = NodeList->Identifier; + } else { + SmmuV3Node->Node.Revision = 5; + SmmuV3Node->Node.Identifier = NodeList->Identifier; } // SMMUv3 specific data @@ -1577,12 +1582,27 @@ AddSmmuV3Nodes ( SmmuV3Node->ProximityDomain = 0; } - if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) && - (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0)) - { - // If all the SMMU control interrupts are GSIV based, - // the DeviceID mapping index field is ignored. - SmmuV3Node->DeviceIdMappingIndex = 0; + /* DeviceID mapping valid flag was introduced in IORT rev E.e + * for SMMUV3 nodes rev. > 5. + * For older revisions, if all the SMMU control interrupts are GSIV + * based, DeviceID mapping index field is ignored. + * If the DeviceID mapping index valid flag is set to 0, + * DeviceID mapping index field must be ignored. + * Where the SMMU uses message signaled interrupts for + * its control interrupts, DeviceId Mapping Index contains an + * index into the array of ID mapping. + */ + + if ((SmmuV3Node->Node.Revision < 5) || (!(SmmuV3Node->Flags & EFI_ACPI_IORT_SMMUv3_FLAG_DEVICEID_VALID))) { + if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) && + (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0)) + { + // If all the SMMU control interrupts are GSIV based, + // the DeviceID mapping index field is ignored. + SmmuV3Node->DeviceIdMappingIndex = 0; + } else { + SmmuV3Node->DeviceIdMappingIndex = NodeList->DeviceIdMappingIndex; + } } else { SmmuV3Node->DeviceIdMappingIndex = NodeList->DeviceIdMappingIndex; } @@ -2819,7 +2839,7 @@ ACPI_IORT_GENERATOR IortGenerator = { // ACPI Table Signature EFI_ACPI_6_4_IO_REMAPPING_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05, + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_06, // Minimum supported ACPI Table Revision EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00, // Creator ID -- 2.17.1