From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03.groups.io (mail03.groups.io [45.79.227.220]) by spool.mail.gandi.net (Postfix) with ESMTPS id 69477D811BB for ; Fri, 12 Apr 2024 14:33:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JCKVqutEI4FJwBNI7JWXyQi08rparvV/qdtPaNUo77I=; c=relaxed/simple; d=groups.io; h=Received-SPF:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:NoDisclaimer:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1712932433; v=1; b=RyDt3fOZgPvXpS8PzFnmJh/3cZO2x5cDCsl2N7v5AJ6usVPdFHaEk2HqxhT9vMLkVEXNxIzK 5NmAu67Qd4/bwPlnRjiOLB9NsJiT8tytLgTIW6wPxEkvWxWm+cfqnnuEcfwqo4dA4Jwlanjh5fg DBshYFz/0rF75RK5t+QfCbAhPsnbFGl/DOlRt1+GuaOyU+6R5nxUGoSVxMMeL06MXxFJ/oaOPrs CJBPpJIlpzbiPisNkIe1H949FttNgXpO7EPiEPb5Kb2Vpwogc6ULLBOSaPkEHJ9AJ9BHDHNN6fH 4APNAJWHbelY0WqQudPAaCLkHCBAF4sUAunCuQ9VvJG/g== X-Received: by 127.0.0.2 with SMTP id YzkAYY7687511xjUmipNkI53; Fri, 12 Apr 2024 07:33:53 -0700 X-Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.53]) by mx.groups.io with SMTP id smtpd.web10.48531.1712932429817958796 for ; Fri, 12 Apr 2024 07:33:50 -0700 X-Received: from AM8P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::22) by AS4PR08MB8166.eurprd08.prod.outlook.com (2603:10a6:20b:58d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.54; Fri, 12 Apr 2024 14:33:46 +0000 X-Received: from AM3PEPF0000A792.eurprd04.prod.outlook.com (2603:10a6:20b:219:cafe::a1) by AM8P190CA0017.outlook.office365.com (2603:10a6:20b:219::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Fri, 12 Apr 2024 14:33:46 +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 X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM3PEPF0000A792.mail.protection.outlook.com (10.167.16.121) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:46 +0000 X-Received: ("Tessian outbound e14047529286:v313"); Fri, 12 Apr 2024 14:33:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c8b72f5e4e216875 X-CR-MTA-TID: 64aa7808 X-Received: from 32c5c1f6ed6b.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5303DB7D-5C14-46EA-B25D-667244CB527B.1; Fri, 12 Apr 2024 14:33:34 +0000 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 32c5c1f6ed6b.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:34 +0000 X-Received: from DB8P191CA0022.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::32) by GVXPR08MB10764.eurprd08.prod.outlook.com (2603:10a6:150:14f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Fri, 12 Apr 2024 14:33:31 +0000 X-Received: from DU6PEPF00009529.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::d0) by DB8P191CA0022.outlook.office365.com (2603:10a6:10:130::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.19 via Frontend Transport; Fri, 12 Apr 2024 14:33:31 +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 X-Received: from nebula.arm.com (40.67.248.234) by DU6PEPF00009529.mail.protection.outlook.com (10.167.8.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:31 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 14:33:30 +0000 X-Received: from E114225.Arm.com (10.1.196.56) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 14:33:30 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 11/45] ArmVirtPkg: Add NULL instance of ArmCcaInitPeiLib Date: Fri, 12 Apr 2024 15:32:48 +0100 Message-ID: <20240412143322.5244-12-sami.mujawar@arm.com> In-Reply-To: <20240412143322.5244-1-sami.mujawar@arm.com> References: <20240412143322.5244-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU6PEPF00009529:EE_|GVXPR08MB10764:EE_|AM3PEPF0000A792:EE_|AS4PR08MB8166:EE_ X-MS-Office365-Filtering-Correlation-Id: 2af9ba49-6294-4260-9717-08dc5afd8fbd 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: 41i6xksclSK2syV52sTs45L1D5VmtcbrgUU/LLFJuhL2/5ju1achE8qzJq/VK9X3WlB0gKYJjVQhyLvnJN2A8Aqkhnkt7NFO5jYLzUOHB0A8j2pz5KI5meW7SbjhFXSg4U3UBn/R2oYfvmUGk1NyY0ObEHq34KGvM4gN3peTArhF10v5gp66xMV8xPNNIZ4VC5KJ7aljSZcVgfApRX2LCgkJdSpRiu47hskRfXp5HXvx1NBiDszP7cXoCjH/BsP7vi70KHIJVhcabMIdteUAQPJkbhJZBiWpmWBVIE3aGm4K0N+NOtBsu4Xc+QmD+79iPkfVfC16TkMC19bXBwtdQCGHFinc0iuN/k0NaW8x61OKLhX10jbfdBDevdmei8U75/5OUA2ATVgDnZtHLXbs9uNOB6Yxe9jc/hEpS87hjh/36rcDuS3D8Rl8vy8d+NRfWwBdI1D5Iay5B9dg0ei0jWkgHKUQ1Q7YAoDEBzkIAiNul+nDaBkkvx5HkIA75/ngi7yNAxqK/gYIXnXP+KgWex04od55N+hy/AIhgxZAXpwa/yOiQ6zmY2FrEKhCAyX2IraRJmCIOqMPUnL7kWCjXDYtu7AUpERB+OPG6DhicjL0tCqyAgfaPXZ6nhPAT0B82FlUMAyq7ehubWv5Z/GBIDidUhrAwC05VpXg8nQiGscvrSLrE3VyHx6objrjdAokmO/h8rwzvQfcgTRARC9lqrhXSyOhbmreDx4nj63HOn39KjI5GGXWuMriEMQ9rwCW 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:(13230031)(36860700004)(376005)(82310400014)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10764 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A792.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6f3b8996-56e2-4b02-7f9e-08dc5afd86ff X-Microsoft-Antispam-Message-Info: f6rE/u7KED6px41pZjP4OjsKhI+E1LLgIhSUdXmUYVz9V5IlApvhW9eWqY21m6hK/M8diXJpb98HdjkLeZM+ohGyAqtyEggDh7Wvigh4ucD3q86+gMwXo0rMHHEgCRyUkj/TtIxc3JdtFFHJ2pZQA5g0qIB+Ix81juYHsXG0gZ+XT3Jeq3vnqEp/MIc+Y6Al2ZGtlV1Qp+voT3POoNvazAb0Jneuh+zSFq7zAfxQlAxXoddL3FF0ZNEEGik6BjT+Jo3mrJJwsNvgWxQ+cvM3QLwsebjwNgQssEBiNHUxeNiYAbxu8qqKYhSEZP3w25R8XA3gZjWZWUtlXT/eacmNrS6i/17clS3Tzt93m2ACn0E1hP+yGzFFBG5EihuMkgdgcuAL/KahGGeIyl1hTJZrLmmU2saehFjNp0fEVe4otjdzEy+dsWz5/25gcvGG0lTr4FYHwfPK6U53SQPBBJAexrw5FkwELNkmoVJYQzioWXUp6y7rFDLoXGNC2Fzkh8U5G+Addqx0Bxl0m9qg4gh0hGGmhrzvCasp9ij3XYXYFW+IUTXDpoQ7eQWcMd5BZBMmSJGe13GhUNkV8PfO9bSov/W0F80V3Ii03IzsoW32+MsGuprQztMevsuwz1EYOh7E2JFrrRhCzQPPYFsl4zo5i4xLFbnw2YRFIrEtu/fkjmA7ZiWqQg4gBIXWAxQCu26tdBCUrKELNL5nNRCC32hzi1ndDx9FSgms3EvwdtpaXWYcsFHvlsWX5aQHrAJ2W47i X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:46.4091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2af9ba49-6294-4260-9717-08dc5afd8fbd 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: AM3PEPF0000A792.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8166 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Fri, 12 Apr 2024 07:33:50 -0700 Resent-From: sami.mujawar@arm.com Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: UWP1ysXUWLLfkFrMs8facHB4x7686176AA= Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=RyDt3fOZ; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none) Add a NULL instance of ArmCcaInitPeiLib library that guest firmware for VMMs that do not implement Arm CCA Realms can use. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann 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 2bc6a29eb131f7c3817c4b411a0a69eb6181a059..8c1063fb73f81e69e866549a2ba9b12945c83d9c 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -194,6 +194,8 @@ [LibraryClasses.common.SEC] DebugLib|ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf !endif + 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)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117677): https://edk2.groups.io/g/devel/message/117677 Mute This Topic: https://groups.io/mt/105483415/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-