From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.83]) by mx.groups.io with SMTP id smtpd.web11.83459.1682438703836636679 for ; Tue, 25 Apr 2023 09:05:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=8M0a1Ebz; spf=pass (domain: arm.com, ip: 40.107.6.83, 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=2R+Lu8sFq1r82tuKRe1bNV1i3jws/WkEKnuXk8wsZ/Y=; b=8M0a1EbzeeZSOmKOdgmDkGlRWMc7fgjPKblPQQbR6spQuBaHe9dd/3XPdXf2kXLSO0IXgWdwmRJD3a1lix5h1MODFLDnOo8u+LSRemR2qVLuLI3sLY7H0TcrQMqhXy4xrlFVvuRg7chISFOKlk2Gu4LX6RckhK4xeiI/y9/9Vgw= Received: from DUZPR01CA0306.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b7::16) by AS8PR08MB7815.eurprd08.prod.outlook.com (2603:10a6:20b:529::17) 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:55 +0000 Received: from DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b7:cafe::4e) by DUZPR01CA0306.outlook.office365.com (2603:10a6:10:4b7::16) 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:55 +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 DBAEUR03FT016.mail.protection.outlook.com (100.127.142.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 16:04:55 +0000 Received: ("Tessian outbound 3570909035da:v136"); Tue, 25 Apr 2023 16:04:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4333d20a7cb2c8c1 X-CR-MTA-TID: 64aa7808 Received: from b6c820fde953.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 581B0BF3-C3FC-4118-9EC4-B5ED49DC3A5E.1; Tue, 25 Apr 2023 16:04:48 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b6c820fde953.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:04:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jtD+ot+8W9LoWJc4hA63+9L+l/FWZWMiHvHpdWiUjNAbeL8eKk0SBAgeKU5A2/BL4LBMd7xXUp8oY4/fOBrwIu4gtn+YPDvoa1E+VewLjOf589rQBnOSwQhMaIOOqxNqHRGdhkRpaEh9oI0FOlrHk6lkbzk6rrQm81LsMB6rxUVFN4zZRjOCIe6Wj6W6+fGdpdWkMP7KdiWjx6A9nVE9AIXaFwgNqC0jp7a/ReqM8GGXkkvgRRg2kVYm0o6jCzIYhRl/ouJSlDpP6fNS1PnXkjZ6jl/uy2U9muBZYPj4x5GhPtQXH9sXPLJUxRM5iQn2t/n1CIZr/57CAe27Gt//Xg== 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=2R+Lu8sFq1r82tuKRe1bNV1i3jws/WkEKnuXk8wsZ/Y=; b=U9zF2TKUX0OyAyheg68N1TXMtGIkaqpDFfdtgOCCRdhveIDsZl63CsIFUd9G0/J9bYZ0isRXKoGI/UMfRmUhA1fbBVpi2DaUywRSj6JygJ92M5xf+bHVmswUfGk9IyQJIxAH6XXQxtWsDgYPw0rT4Lx6r+5wuuGtfrVNzA6kDdMrBka+P0L8vSb5bl4RglVRR4r9N2N95uwgZAjjJS17NP06ir3aJ08ciabkesbKrmTVogsGcO2COCcL1sbwRIELaKz59C7H9WUThxgYLSWRwWST0ttbqDTEJUbijxEkdyy+sX+cXTsQoYX695JP/MPywPtbFpyMneDDagL54WtVgg== 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=2R+Lu8sFq1r82tuKRe1bNV1i3jws/WkEKnuXk8wsZ/Y=; b=8M0a1EbzeeZSOmKOdgmDkGlRWMc7fgjPKblPQQbR6spQuBaHe9dd/3XPdXf2kXLSO0IXgWdwmRJD3a1lix5h1MODFLDnOo8u+LSRemR2qVLuLI3sLY7H0TcrQMqhXy4xrlFVvuRg7chISFOKlk2Gu4LX6RckhK4xeiI/y9/9Vgw= Received: from DB7PR05CA0053.eurprd05.prod.outlook.com (2603:10a6:10:2e::30) by AS8PR08MB9314.eurprd08.prod.outlook.com (2603:10a6:20b:5a5::7) 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:45 +0000 Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::a4) by DB7PR05CA0053.outlook.office365.com (2603:10a6:10:2e::30) 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:45 +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:45 +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:43 +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:43 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [RFC PATCH v1 13/30] ArmVirtPkg: Add NULL instance of ArmCcaInitPeiLib Date: Tue, 25 Apr 2023 17:04:11 +0100 Message-ID: <20230425160428.27980-14-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_|AS8PR08MB9314:EE_|DBAEUR03FT016:EE_|AS8PR08MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: bc93916a-aa86-46dd-bb26-08db45a6cfa5 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: xjDMtpqDoGYWZ5BQBksdKkw+dos7F5QQXJkFUIk/FHBDzmAw6H7FgpxF4+0dCPSO8wEo1MeQgkFdw1wvJihKrEKfx9BL+UsSh1nanMpbjhLBG8RyMZA+pfzU2mEekh24KW945xvMxFc1vrocI1T3HTrYCwz24PhWd/fPjz0LloXjnWNUie+nBKOUUwA5I40IxxOF8OYjbeBaYHAKI81NADG4Kbm2mvHXd73p6IKWhbg89vR9yRF3obIStCvFnxBcQvobYa51Q5xocYkVi84CWDohGuRX+3N6QxwBTeaR2/IZ0i2Gz90+aoueswDkgssmnjm+405xzBXkKlf0GJ8Of95kJqNpp2q8aHCipefFc+Gf+0TnK8npUIx84q59jVskoUbERc+h/NvMPPhRMBmW65jfP7NFzJWNfcA7zThte3MHHJOkXaa+if6+2Iql6gt3f6dDPipILqSgEciuQCepuwp/8r+++51fmPsEt7V3AnExp/MrrJe6KpvX8aX2v39LKUl5hHYPQe565iD0P6Wm14JMKgemI7HJCysTT+FQYmuTXxVsNZVkekOeQsf40Xg+kmNmhS7+rYE1EBzMus0XcmpqIO2pNaSNoCJvPpLoBKNYLWlfwOLabRCt3fzwaECgmCBtJxXQ1cbRyFvxz8Nc58lF+AZLBNary1VMRlcxUe5bNhKpQmSYjyHnGkd9i1ksZ/AqxKfzk3nQL+dCYaXdbNRmxd9Asil3ZKXU5TRh8LKulsgidxds8vm7oTXb2EQyx0nkVrxXiQTQra16aSYxYw== 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)(396003)(39860400002)(376002)(136003)(346002)(451199021)(36840700001)(46966006)(1076003)(26005)(40480700001)(426003)(336012)(2616005)(36756003)(34070700002)(83380400001)(36860700001)(47076005)(186003)(82740400003)(356005)(81166007)(70206006)(86362001)(70586007)(478600001)(6916009)(8676002)(8936002)(54906003)(44832011)(5660300002)(7696005)(41300700001)(2906002)(82310400005)(4326008)(6666004)(316002)(213903007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9314 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2cd568c9-22bd-4206-8975-08db45a6c990 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a9yxuAt77b9Kp3oU7masSX+bRJ1d/Ej6qSPprZZ7gVAUXB2du/w5UVDI+GAVRRNnAzORsZsUXQ9pWfJEPAOhvF26WMJMFalUtJ3rTWhxqy4JNN+bd+cggfWsqjIC+U7DbrHgaonxZsh/koVnbqD21eteFKuOBVuiNJT8bE3Crm4cRbDXsn1X29BvzWd/rmYxRg9iJ+bBIqhaIhhjCXrULBHIwdR4EDrnak/+aGcBuwK3vHn7Y2TYafolATLnvM3KeBJVjXh/sSV5B7PEFKdK91PWWgi6bUoEJF6KgVIPOB2+Herp6hqJO8AaCukk4NZpnpQA9yFHDAMMB9XZnWN7lYYsqHYiqvXC6bM++haYbaPV/RqbWmJnZeYDQgyabEwK+O99gF1w47VFHsG1eOuV9cpoRtT21WEfr5BKbY6bY6y9AxZFCp2USBycIcvznP7biecSglQ5j8n9bicaH+LdmP+qDww+cxnO2gurSP/YQjerRTPfQ1Nycbax7WQedLDA3PClhj6RZTHS17veiIFCTdu1KQjtaGl9NDnTdY9UqUt5vWxq5rndnR/uzpmkv2e7iZ8gkqQPVGSbJy1xMyyAA8jiCoe/tJ3kaItSB4AGEv+L5pELk1+lVgPpY/9vsmQh2h7oGcQUpy22nzaeVl86Uh4ZlnbUvwSoFBHZD4szFqo5nJrd7mqy+Hh3nsVQ+YfCBO2997z7w8zQ6mJz61uu/tby8NVsmPNr5ypnmSHG+mCHh6MOfsXdGAUJu+OW0AsSAEUOaiU86TOcG2o4xyiqbA== 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)(396003)(376002)(39860400002)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(86362001)(186003)(7696005)(6666004)(36756003)(26005)(1076003)(54906003)(82310400005)(478600001)(40480700001)(34070700002)(36860700001)(8676002)(8936002)(81166007)(2616005)(41300700001)(2906002)(47076005)(83380400001)(336012)(426003)(5660300002)(44832011)(316002)(6916009)(82740400003)(4326008)(70206006)(70586007)(213903007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 16:04:55.3533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc93916a-aa86-46dd-bb26-08db45a6cfa5 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: DBAEUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7815 Content-Type: text/plain Add a NULL instance of ArmCcaInitPeiLib library that guest firmware for VMMs that do not implement Arm CCA Realms can use. Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirt.dsc.inc | 2 + ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.c | 59 ++++++++++++++++++++ ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.inf | 27 +++++++++ 3 files changed, 88 insertions(+) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 5b18184be2631ce6d158b471c055af9e6e07f4a0..409749297263a13696885d17c6d5554d07c195e4 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -189,6 +189,8 @@ [LibraryClasses.common.SEC] PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + ArmCcaInitPeiLib|ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.inf + [LibraryClasses.common.PEI_CORE] PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.c b/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.c new file mode 100644 index 0000000000000000000000000000000000000000..5b606208dbcf4f0494cde79dd8923ef80fa0137b --- /dev/null +++ b/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.c @@ -0,0 +1,59 @@ +/** @file + Library that implements a NULL implementation of the ArmCcaInitPeiLib. + + 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 + +/** + 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 RETURN_UNSUPPORTED; +} + +/** + Perform Arm CCA specific initialisations. + + @retval EFI_SUCCESS Success or execution context is not a Realm. + @retval EFI_OUT_OF_RESOURCES Out of resources. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. +**/ +EFI_STATUS +EFIAPI +ArmCcaInitialize ( + VOID + ) +{ + // Noting to do as the execution context is not a Realm. + return EFI_SUCCESS; +} diff --git a/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.inf b/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.inf new file mode 100644 index 0000000000000000000000000000000000000000..f039c7abdb6d5391f792179546ff9947086fe541 --- /dev/null +++ b/ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.inf @@ -0,0 +1,27 @@ +## @file +# Library that implements a NULL implementation of the ArmCcaInitPeiLib. +# +# 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 = 60686C60-8433-49EE-9F2C-DDC424A95652 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ArmCcaInitPeiLib + +[Sources] + ArmCcaInitPeiLibNull.c + +[Packages] + ArmPkg/ArmPkg.dec + ArmVirtPkg/ArmVirtPkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'