From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.80]) by mx.groups.io with SMTP id smtpd.web11.83464.1682438709486030019 for ; Tue, 25 Apr 2023 09:05:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=PXzV493V; spf=pass (domain: arm.com, ip: 40.107.105.80, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R7mcpJ5ZAFLJeQwI5mWmp4oT+pR7WhNK0ZU7bUlvpRE=; b=PXzV493VX2LrAB1ygCpAA+EWpggMQZOzhGMVxQyyvcksoFtBraQl0eEcn5HKHIDL8JPP6mkdGetRflEA2MRbyEWoVCbbNz2RBF44EYBC6kVDvHrq8dsKoKn1mxTlIqBEnYcAiqedFzSLGD0R/wPXSxDTLcq/x1CODt6eFlf7FoQ= Received: from AM6P193CA0086.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::27) by AS2PR08MB10111.eurprd08.prod.outlook.com (2603:10a6:20b:62d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 16:04:57 +0000 Received: from AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::45) by AM6P193CA0086.outlook.office365.com (2603:10a6:209:88::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34 via Frontend Transport; Tue, 25 Apr 2023 16:04:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT065.mail.protection.outlook.com (100.127.140.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.19 via Frontend Transport; Tue, 25 Apr 2023 16:04:57 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Tue, 25 Apr 2023 16:04:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 301b1281c6bc2f0a X-CR-MTA-TID: 64aa7808 Received: from f4ffd1d3368c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 19225EF1-8FF5-430E-A92C-3AF40F202DB6.1; Tue, 25 Apr 2023 16:04:50 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f4ffd1d3368c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:04:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cejnMI0teJKj8qKhLD95mqim+aZ8gQtL4Ypxz9HDKDERBdkLEdaYbluVMlX83+y0WGkL2T/uZen+/GzZ8lpWURKfHW6foJXZIu2LXGzzKv+/p+VfXQptSv67pXf8aMcklHUR6B7TSNN64iLBVEMXfD1Qoeqi9Y656eFcRzoc/t6A2GhIdRQOPRNuuy+Yd9lQyAFfc4MwTsflJ7RnOqD0A1F99fRl2QmwxGRfoaWsSqHKPb6TrOUeh8v3JTkwd54gUlQ0IDZCX/adEtWeklrz9d18YEwX1QqOyorxrxis4IUwISKg4RzglVmvlRc0i3wPQySQ4lVKOdtjPYxPzdGJQQ== 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=R7mcpJ5ZAFLJeQwI5mWmp4oT+pR7WhNK0ZU7bUlvpRE=; b=YRL0wSXR2ZGWQuT+gosB9bh+kBsZxqAGj97gV2RRuvfowjPG1tPKULalXwhyX9a2XLYGyPBCQsuHbXKSbGMmw2BzxSkeRDzOSYvLm4s73vTbmHjbzy/zDfICKXYP3xhEIszRx7cnHW8JlvsJeCPPANosDnaiJaRiDUgvWW8q3FXbB6op291gZ/Ujn/GYtmq1LnBjX9OcthDxuHX1KTf9OYkGA6Yi4KsJ4Uei5nw3lOiE7qlXhpZYbJeVrjxgsv+19f2AX5/T7U+1CpdUmuotfxVqce6JGqR81GV7xtkFQliYlPeKmQ+6+UtxSs3/ojctH49jjoX3pg7dj4DiHofhKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R7mcpJ5ZAFLJeQwI5mWmp4oT+pR7WhNK0ZU7bUlvpRE=; b=PXzV493VX2LrAB1ygCpAA+EWpggMQZOzhGMVxQyyvcksoFtBraQl0eEcn5HKHIDL8JPP6mkdGetRflEA2MRbyEWoVCbbNz2RBF44EYBC6kVDvHrq8dsKoKn1mxTlIqBEnYcAiqedFzSLGD0R/wPXSxDTLcq/x1CODt6eFlf7FoQ= Received: from DB7PR05CA0072.eurprd05.prod.outlook.com (2603:10a6:10:2e::49) by GV1PR08MB8260.eurprd08.prod.outlook.com (2603:10a6:150:a1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 16:04:44 +0000 Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::ae) by DB7PR05CA0072.outlook.office365.com (2603:10a6:10:2e::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33 via Frontend Transport; Tue, 25 Apr 2023 16:04:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 16:04:43 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 25 Apr 2023 16:04:42 +0000 Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Tue, 25 Apr 2023 16:04:41 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [RFC PATCH v1 12/30] ArmVirtPkg: Add library for Arm CCA initialisation in PEI Date: Tue, 25 Apr 2023 17:04:10 +0100 Message-ID: <20230425160428.27980-13-sami.mujawar@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20230425160428.27980-1-sami.mujawar@arm.com> References: <20230425160428.27980-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT010:EE_|GV1PR08MB8260:EE_|AM7EUR03FT065:EE_|AS2PR08MB10111:EE_ X-MS-Office365-Filtering-Correlation-Id: 725797ba-5cd2-4b15-c04e-08db45a6d11f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mIuWEvkneEfc0pVXcMPZB5J9msRaMSpCiL2eN/yq6UeBS9rSVvQwg91+q9TP6XufRdaxkN65Q/S8GkJpa6X9JcChFRy1wujqnAOOaFd39VJt4Y2RyRm9Ej9v/7r2MMHIzQU1FiQaLeEoy0fYOS969ZqlIVd3V97FFFSiLVbQ6J+dCZDVIUYVcftLHu+Joa47GBtn/uJcuVwVQzLcDIcrI1pEtc3FLtFTIgYFGQaTVRV2mQkb4LpU6qJ7mbChJ/Og7bnDUABSpTcJBUF7bsdx8bkmGrB6YxEpClPK4doQJgMwFXWikZsUHzyblVzxL6vdW1hKu9LOwfkaSB1FV4g+02Vb1urnn/NcWOaJrkRDCRuFSs5pqY76+c9dprIKXKXU0LYbv4fEasCyMendQiZkno8NowrGjHt1NQG1sOt/m7c+sDsNN+I78Q8G/Wy7IDuNQiCcH3AcLudqrIX2CXqrx7+YNbQcqLKcuGFEPvET9cn6SYsS1q6fM1xFqKPLM8gOX4+npXbH5FELmQo9gwyOQAdOTIbeTcNDQYSMSgDIRi94kEFOJ6XLE6N/bIVRuSZIy5BJUZTTtnPe5xn2usfsywU/qGHpE54c7ABVk0LBdJxY5lQf407e4R7xBO/CyYZucVFu5cEKvkolQKQL8n74QQKkJj6GXyWGW1tlQ7qfaij6R0bfFOsxYFY1GmmraeurYbwjwzJN9Y6rcnpoD639WIsY15Xj6uyT1pwucEbCwBA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(36840700001)(46966006)(36756003)(8676002)(8936002)(54906003)(34070700002)(478600001)(70586007)(6916009)(4326008)(70206006)(40480700001)(356005)(81166007)(44832011)(316002)(41300700001)(82740400003)(2906002)(5660300002)(2616005)(86362001)(36860700001)(186003)(336012)(426003)(26005)(1076003)(7696005)(6666004)(83380400001)(47076005)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8260 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bb4906ba-168f-4aa5-f8bb-08db45a6c8d8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tZYxdkLo1glAFi7FPypskTFDVYoriQhHDMa7IKwlOwc9h+/p6CXSYdJHXfrHg+uB9B6kzdiiQF4rpGkS7yNjeGFd5oi3EyiQM5Y6X/5MgW0PDORlVT/jaUaTdtem/5Mg1KdvPOgwiTIkLvjbUSvnoJWTQF9RH1ekZoQLxTgLYuiYwgMqdbOgQrDxgS/z9P5VaEvGlEKHOAWKdDug5AYdVS2oj0sJhX3y+8VtqvS2qHjEnr3pUePlUuehKOLeVhihwg1itXgUMI0EU8MGX8ro2h+0x3RH6HQfYciSY9124jfMt+ofUuwRK/qx1IJVxA/fxY479FURFmMknXHaSNhGUm3J0pUkfpNVdMwn6a56KGbQb53MScSVGwo7a12AT48g/XBURCiqxz+sGlChC1yI4cIMrFnG/42sCCleAVukSHP/3698TjPdKQb34+YDTu1Zb0o59iy63TSQsPuQS3860lY+Ekj1oOKmtaGrdiRHRNnpqBtebhFN1OIk6TBNuQqXvKtehkifs5Z/oc9vdnYgMxWI0mCcmegMOj/x7r41q7v/RP8kwpKYgtoFOzENQ0Tb34y//kGRc0/9sUSBiVTI7mvArsbMINWIQkvUi0wO/aPWt2NWrWWlZPOWx+RxIh4gFe2eVscliOz3Ew2SEQaIwld4xJEaCggsIdJBmkIP7RkJtsghFgty5uIxLk9ZOedaOpJ30d9oA10VzZFlYYG30bQkiov9MPrvN3S/nO5uUMM= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(36756003)(8676002)(8936002)(54906003)(40460700003)(34070700002)(478600001)(70586007)(6916009)(4326008)(70206006)(40480700001)(81166007)(44832011)(316002)(41300700001)(82740400003)(2906002)(5660300002)(2616005)(86362001)(36860700001)(186003)(336012)(426003)(26005)(1076003)(7696005)(6666004)(83380400001)(47076005)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 16:04:57.7682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 725797ba-5cd2-4b15-c04e-08db45a6d11f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10111 Content-Type: text/plain Add ArmCcaInitPeiLib library that performs the Arm CCA specific initialisation in the PEI phase like: - Configuring the system memory as Protected RAM. - Reading the Realm Config and storing the IPA width in a GUID HOB i.e., gArmCcaIpaWidthGuid for subsequent use. - Calling ArmCcaConfigureMmio () to configure the MMIO regions by setting the Unprotected IPA attribute in the page tables. Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirtPkg.dec | 1 + ArmVirtPkg/Include/Library/ArmCcaInitPeiLib.h | 49 +++++++++ ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c | 116 ++++++++++++++++++++ ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.inf | 39 +++++++ 4 files changed, 205 insertions(+) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index ebdb9629fa2754e6f8b59f23750ea50cf702d8fd..c270d4a1ee268fb57a5338fd71487ed54699f496 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -26,6 +26,7 @@ [Includes.common] Include # Root include for the package [LibraryClasses] + ArmCcaInitPeiLib|Include/Library/ArmCcaInitPeiLib.h ArmCcaRsiLib|Include/Library/ArmCcaRsiLib.h ArmVirtMemInfoLib|Include/Library/ArmVirtMemInfoLib.h diff --git a/ArmVirtPkg/Include/Library/ArmCcaInitPeiLib.h b/ArmVirtPkg/Include/Library/ArmCcaInitPeiLib.h new file mode 100644 index 0000000000000000000000000000000000000000..439a70a54a218badd4cd4d6c419df58f57271cc2 --- /dev/null +++ b/ArmVirtPkg/Include/Library/ArmCcaInitPeiLib.h @@ -0,0 +1,49 @@ +/** @file + Library that implements the Arm CCA helper functions. + + Copyright (c) 2022 2023, Arm Ltd. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + + - Rsi or RSI - Realm Service Interface + - IPA - Intermediate Physical Address + - RIPAS - Realm IPA state +**/ + +#ifndef ARM_CCA_INIT_PEI_LIB_ +#define ARM_CCA_INIT_PEI_LIB_ + +#include + +/** + Configure the System Memory region as Protected RAM. + + When a VMM creates a Realm, a small amount of DRAM (which contains the + firmware image) and the initial content is configured as Protected RAM. + The remaining System Memory is in the Protected Empty state. The firmware + must then initialise the remaining System Memory as Protected RAM before + it can be accessed. + + @retval RETURN_SUCCESS Success. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. + @retval RETURN_UNSUPPORTED The execution context is not in a Realm. +**/ +RETURN_STATUS +EFIAPI +ArmCcaConfigureSystemMemory ( + VOID + ); + +/** + Perform Arm CCA specific initialisations. + + @retval RETURN_SUCCESS Success or execution context is not a Realm. + @retval RETURN_OUT_OF_RESOURCES Out of resources. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. +**/ +RETURN_STATUS +EFIAPI +ArmCcaInitialize ( + VOID + ); + +#endif // ARM_CCA_LIB_ diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c new file mode 100644 index 0000000000000000000000000000000000000000..2b1ed4c3eaa18a5519edce2d3d4f143d08adb53e --- /dev/null +++ b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.c @@ -0,0 +1,116 @@ +/** @file + Library that implements the Arm CCA initialisation in PEI phase. + + Copyright (c) 2022 2023, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Rsi or RSI - Realm Service Interface + - IPA - Intermediate Physical Address + - RIPAS - Realm IPA state +**/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + Configure the System Memory region as Protected RAM. + + When a VMM creates a Realm, a small amount of DRAM (which contains the + firmware image) and the initial content is configured as Protected RAM. + The remaining System Memory is in the Protected Empty state. The firmware + must then initialise the remaining System Memory as Protected RAM before + it can be accessed. + + @retval RETURN_SUCCESS Success. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. + @retval RETURN_UNSUPPORTED The execution context is not in a Realm. +**/ +RETURN_STATUS +EFIAPI +ArmCcaConfigureSystemMemory ( + VOID + ) +{ + RETURN_STATUS Status; + + if (!IsRealm ()) { + return RETURN_UNSUPPORTED; + } + + Status = RsiSetIpaState ( + (UINT64 *)PcdGet64 (PcdSystemMemoryBase), + PcdGet64 (PcdSystemMemorySize), + RIPAS_RAM + ); + if (RETURN_ERROR (Status)) { + // Panic + CpuDeadLoop (); + } + + return Status; +} + +/** + Perform Arm CCA specific initialisations. + + @retval RETURN_SUCCESS Success or execution context is not a Realm. + @retval RETURN_OUT_OF_RESOURCES Out of resources. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. +**/ +RETURN_STATUS +EFIAPI +ArmCcaInitialize ( + VOID + ) +{ + EFI_STATUS Status; + REALM_CONFIG *Config; + UINT64 *IpaWidthHobData; + + if (!IsRealm ()) { + // Noting to do as the execution context is not a Realm. + return RETURN_SUCCESS; + } + + // Read the Realm Config and store the IPA width in a GUID HOB. + Config = AllocatePages (EFI_SIZE_TO_PAGES (sizeof (REALM_CONFIG))); + if (Config == NULL) { + ASSERT (0); + return RETURN_OUT_OF_RESOURCES; + } + + ZeroMem (Config, sizeof (REALM_CONFIG)); + + Status = RsiGetRealmConfig (Config); + if (RETURN_ERROR (Status)) { + ASSERT (0); + return Status; + } + + IpaWidthHobData = BuildGuidHob ( + &gArmCcaIpaWidthGuid, + sizeof (*IpaWidthHobData) + ); + if (IpaWidthHobData == NULL) { + ASSERT (0); + FreePages (Config, EFI_SIZE_TO_PAGES (sizeof (REALM_CONFIG))); + return RETURN_OUT_OF_RESOURCES; + } + + *IpaWidthHobData = Config->IpaWidth; + + FreePages (Config, EFI_SIZE_TO_PAGES (sizeof (REALM_CONFIG))); + + // Configure the MMIO memory regions. + return ArmCcaConfigureMmio (*IpaWidthHobData); +} diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.inf b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.inf new file mode 100644 index 0000000000000000000000000000000000000000..f2a321d9cdfcf1bd87d6584e3c6834686a298bf0 --- /dev/null +++ b/ArmVirtPkg/Library/ArmCcaInitPeiLib/ArmCcaInitPeiLib.inf @@ -0,0 +1,39 @@ +## @file +# Library that implements the Arm CCA initialisation in PEI phase. +# +# Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = ArmCcaInitPeiLib + FILE_GUID = 9A8C3768-79ED-487E-8155-BBF4DD638296 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ArmCcaInitPeiLib + +[Sources] + ArmCcaInitPeiLib.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + ArmCcaLib + ArmCcaRsiLib + ArmLib + ArmMmuLib + ArmVirtMemInfoLib + BaseLib + +[Pcd] + gArmTokenSpaceGuid.PcdSystemMemoryBase + gArmTokenSpaceGuid.PcdSystemMemorySize + +[Guids] + gArmCcaIpaWidthGuid -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'