From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (EUR02-VI1-obe.outbound.protection.outlook.com [40.107.241.50]) by mx.groups.io with SMTP id smtpd.web10.83976.1682438708221494041 for ; Tue, 25 Apr 2023 09:05:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=sb0RGjd/; spf=pass (domain: arm.com, ip: 40.107.241.50, 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=RAgHeiq8reVHDfEAsnplGWXOuoZvCSpkXxoz5JpBG0Q=; b=sb0RGjd/7vbUB5abk9klQshXkX9uciICauSvSX7+Se8f8auj+55zNyH6TgbQlJoKhr3AuWUIhxTz7gNgVBiiLEW2rerUAQeLyFxnMWw4+nHl6CapVHvU5oBmo/UZvEpSpxID6uc/sS+rnmy/btp+/02wDIfBUElOvIDVJUp/Sos= Received: from AS9PR04CA0146.eurprd04.prod.outlook.com (2603:10a6:20b:48a::19) by AS4PR08MB7506.eurprd08.prod.outlook.com (2603:10a6:20b:4f8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Tue, 25 Apr 2023 16:05:04 +0000 Received: from AM7EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48a:cafe::3c) by AS9PR04CA0146.outlook.office365.com (2603:10a6:20b:48a::19) 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:05:04 +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 AM7EUR03FT027.mail.protection.outlook.com (100.127.140.124) 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:05:04 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Tue, 25 Apr 2023 16:05:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: db91e0ec1c159140 X-CR-MTA-TID: 64aa7808 Received: from aa84faba890b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 717225D3-31BE-4675-ADDE-EDE941592710.1; Tue, 25 Apr 2023 16:04:56 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id aa84faba890b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:04:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KN07JZ1ql1Wv1m1L5saMw+Lvcy1DlGFAvcvGkgXkXDMSXNf3z/QodHkPucNb0xpJ/sKN8HEEDkzwUYZG9zfUuokKMPIcmPHPeH4KsezVft6u9jE/gRqtHn+whWi52k9X0tmqJqEHKRATyCVnvGi2j9X/FIF4JpgkKFI88ZISF9SG7T7TFohHT7agUsoHueneRMsJ9w5BdCtdM5dvrOGGbpIvhU2GEBAf/Gd/KREGPSYPN/ooCB7nQZUyp43SLzx2YKEpoHCTIn6CQT4ro1FAOrN0M0PbU8KWlYfXEwKtO/Q1WwyAmzcpVjEykU++S0A55DStpjwpEbwmorS1z/NQkg== 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=RAgHeiq8reVHDfEAsnplGWXOuoZvCSpkXxoz5JpBG0Q=; b=ShLAMZGOjx8fCjP+6Hu0eQXKrb0lRFCDwZ6yfGyZlWhmshiaaxGGp+sng0dXvHRmin3im+Xx9IF1t4wfek+8L5qgxFVhi+5HUSuhxGE9iQe6j1gZzzGIuUzk2ekSnGk2BE6URfwpjAQUg0/DICouCWJS+cRB/wGZrnOAx9E1ZegQcKsl6gtL7/qgNj+E1ZPdlG8D6qb9GhSYrqumaBcx7w9x3Mdo1VhEkF6N2eVR20B/103ozqMfoD6Au7XtnNRr3/r4YMPlXVvRwUkEN2WR27a99c69Ez55LCv85K8M3uXsd5qBSEkD4ZC2ZwsIdudZmCMlw15q0Uko+LP8GBE6BA== 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=RAgHeiq8reVHDfEAsnplGWXOuoZvCSpkXxoz5JpBG0Q=; b=sb0RGjd/7vbUB5abk9klQshXkX9uciICauSvSX7+Se8f8auj+55zNyH6TgbQlJoKhr3AuWUIhxTz7gNgVBiiLEW2rerUAQeLyFxnMWw4+nHl6CapVHvU5oBmo/UZvEpSpxID6uc/sS+rnmy/btp+/02wDIfBUElOvIDVJUp/Sos= Received: from DU2PR04CA0247.eurprd04.prod.outlook.com (2603:10a6:10:28e::12) by GV1PR08MB8213.eurprd08.prod.outlook.com (2603:10a6:150:5c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Tue, 25 Apr 2023 16:04:53 +0000 Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::35) by DU2PR04CA0247.outlook.office365.com (2603:10a6:10:28e::12) 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:53 +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 DBAEUR03FT055.mail.protection.outlook.com (100.127.142.171) 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:53 +0000 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.23; Tue, 25 Apr 2023 16:04:52 +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:52 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , , Subject: [RFC PATCH v1 23/30] ArmVirtPkg: Arm CCA configure system memory in early Pei Date: Tue, 25 Apr 2023 17:04:21 +0100 Message-ID: <20230425160428.27980-24-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: DBAEUR03FT055:EE_|GV1PR08MB8213:EE_|AM7EUR03FT027:EE_|AS4PR08MB7506:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c840f65-4720-4471-9d43-08db45a6d4ed 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: 5nvfM8PyTlP49MJ22dsuBwNC5NkmeQOv3F8/L7PdJ3MR8d9bQmYYq1VrHWb5hQlFZgZIGo3U/1QiNx4De2/cLF84eWLNTvH9xCUgr+MvMjaJkw8PThJXfPnfFkBO2vVQy6NUVCbvBGm/V3UoMKKpTSOQ+cUFuuTNLO00zv2XbGwytKaF4Ji1PtgmfPwTdQgeHC9ZkIkOY+hNED0uAvI6WWNzMVuKq5hNeHRxUFBEOaW34SjzlfO6Y0to+Yeoy91iiHEd5hAyxi/nvrfLLiEW/Ge2NjYJXyQWSHZOMRFrZVAoMIGJKDzirsZafsqgJ/+ZQ3LtqaLgHHJtuzyMeT+ZFJ0OEt6NtuSf02T/WIQzELU9Kw3rjeFaQrx2yMtjVcnIuglUch49U8H0KhTdZaK6MxZjHUnbczQtAai9zM1PZJPc8EMiIU8oFdv7OzpA/+WUJvrkL0ekLuRAhyFZhUnFg7KcOERxnQuaa6NbfuVvkR/VlukJu1Mxp4XILzIUlScEgHfUspMAz626BP92aySCkdIOoK5YbpyDMEJkyAXoYRBLT/+JfnvZKTF7czJpVED0QTH9Xod1iIim3fRzHGSoNo9hiSj7n87wlAj1MQJ8N0WlcoNMkHVEI6tFLqgPs/KW2q3/r9HOgSP4yfciabx+a4Ardah1qjW4o6VO9BSI0Yyq29VosOD/JUJ5uQyCy/8/THq84ToyFd4PAKD8Btg2WfDyVn7B/5DHJa5AhVXBGzM= 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)(136003)(39860400002)(346002)(376002)(396003)(451199021)(46966006)(36840700001)(82310400005)(1076003)(26005)(40480700001)(186003)(82740400003)(7696005)(6916009)(70206006)(6666004)(70586007)(36756003)(86362001)(41300700001)(54906003)(19627235002)(478600001)(83380400001)(4326008)(316002)(81166007)(356005)(36860700001)(426003)(44832011)(8936002)(2906002)(2616005)(5660300002)(8676002)(34070700002)(47076005)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8213 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3366e24e-1786-40e0-cabc-08db45a6ce96 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KFa1ura+m/ooflMEbR7pHQeRsbqYEl9BYzNl0Mfkdp+49vQWm9UEJ3NndpGupKnqFerNp40opME8kA8v+4M/TD5Ri6fEm2hpHeDDnkEOQ57oq3/HK3RzPO5vvP/EzLbS1g28s0N56AkEfBvJL3T8dez0rF8Kz/rgKSsBl+5WI+QyAuvSi/75SDpxDy1GKiiTIWMdQUeT8ENX1GXMR/nQhU6vLBOJ7EjDE0MqFkRZsq0Y1Q/n8tJe9vrCPzplJL4LJMWoXJdEV2/OfNhJ+W27ZVXxwS6Wk98rJXNeQelFad2UeGkYPYdurMu7T3a7P4WoxkC0i1KSCCO+NzE/6gKcYOyn+QLBob4EcAgCRehQaaSRhby2QyFN/6XvqTnFLRcDrv8LWD2breSQ68BtnqZuHylrINytoOLrlswHehOzWY/NfMXFDd/UWAkdTU2/XBSFldyQ81VHrJBJMXhGJW3y/5+V9sL0O6Q/gh/I2Vnz4bT5CpZ/XIeOpnaMGMtSYw6/RgYHtxPahKR3N7KJ/k7SQrlCPjkNddr4q9XwTj1jG3zpsGmrnJOfsbRWcm4iiZgnWBPFArPoNAGhvCaX6ZU1Be2cszf+0SoNnIavF3SXTKs2/LQI2Dv6Fon++W1dacTd6X6mAPu4gzfiQgLhFzC5WnfBrHbCLXE64NCvcIgf5LuLzUILfaO7G7YoLL0/MNUU0+gdWZML4nkWunyB7Em0LKkjlFSu2MQecDiZPrxrN44= 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)(39860400002)(136003)(346002)(396003)(451199021)(46966006)(36840700001)(40470700004)(40480700001)(36860700001)(6666004)(4326008)(6916009)(70586007)(70206006)(8676002)(478600001)(316002)(54906003)(8936002)(5660300002)(19627235002)(82740400003)(41300700001)(81166007)(40460700003)(47076005)(336012)(186003)(426003)(2616005)(83380400001)(7696005)(34070700002)(26005)(1076003)(82310400005)(86362001)(36756003)(2906002)(44832011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 16:05:04.1818 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c840f65-4720-4471-9d43-08db45a6d4ed 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: AM7EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7506 Content-Type: text/plain 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. Therefore, call the ArmCcaConfigureSystemMemory () in the early Pei phase so that the System Memory is configured as Protected RAM. Note: ArmCcaConfigureSystemMemory () is implemented in ArmCcaInitPeiLib for which a Null implementation is provided. Therefore, this change should not have an impact for non-Arm CCA enabled systems. Signed-off-by: Sami Mujawar --- ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S | 6 +++++- ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S index 01623b6b3591242778a5c76df5d401b1ce71834f..03bef60dd408e787cbeb9eeee12d95639821714f 100644 --- a/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S +++ b/ArmVirtPkg/PrePi/AArch64/ModuleEntryPoint.S @@ -1,5 +1,5 @@ // -// Copyright (c) 2011-2013, ARM Limited. All rights reserved. +// Copyright (c) 2011-2023, Arm Limited. All rights reserved. // Copyright (c) 2015-2016, Linaro Limited. All rights reserved. // // SPDX-License-Identifier: BSD-2-Clause-Patent @@ -11,6 +11,10 @@ ASM_FUNC(_ModuleEntryPoint) bl ASM_PFX(DiscoverDramFromDt) + // Check if we are in a Realm and configure + // the System Memory as Protected RAM. + bl ASM_PFX(ArmCcaConfigureSystemMemory) + // Get ID of this CPU in Multicore system bl ASM_PFX(ArmReadMpidr) // Keep a copy of the MpId register value diff --git a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf index 7edf5018089d0710564159a06e3f50b8890d2795..afa9b686eed60d894af6933e3b2fd5a82ebae951 100755 --- a/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf +++ b/ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf @@ -1,6 +1,6 @@ #/** @file # -# Copyright (c) 2011-2015, ARM Ltd. All rights reserved.
+# Copyright (c) 2011-2023, Arm Limited. All rights reserved.
# Copyright (c) 2015, Linaro Ltd. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -37,6 +37,7 @@ [Packages] ArmVirtPkg/ArmVirtPkg.dec [LibraryClasses] + ArmCcaInitPeiLib BaseLib DebugLib FdtLib -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'