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 7BD1D9418C2 for ; Fri, 12 Apr 2024 14:34:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qxQzW201XAK/1nWDGqHlJNSJummi06gBru7IWwe/iHo=; 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=1712932458; v=1; b=CnOf5scKdRXiDNB/F6OwqPNVlFfMkvP2BAT1oK32e8k99A+UCbtZ91MbAmdFl3gtRctKCe+K R54wrGZQXITL1NkHWGV6B456CQ+Um5QVr323BBjKZvrAA/vb7M91PNl8JubgAwk8gLTMotmg3jb rQD3lS7+EH2dIrpGOQ6svCcJ+WQphHWFStZtpppv3MJuTCzELQ4Eg6bMi+QGmQ89r5R0jgjtx64 U6K4BXF8X1GvNr4TEBWuhdjhkv+7oBXN5NtJfiIu/F8kPFwGtlunL95H+TeGE8x1qlmlkmRDety nHlRngGjcAH/HvRiufeLKFZuC4ZsO1Xv8fD2kfckawAdQ== X-Received: by 127.0.0.2 with SMTP id NDXyYY7687511xlQOH933KcN; Fri, 12 Apr 2024 07:34:18 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.47]) by mx.groups.io with SMTP id smtpd.web11.47973.1712932447408235116 for ; Fri, 12 Apr 2024 07:34:07 -0700 X-Received: from AS4PR10CA0016.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::8) by PAVPR08MB9483.eurprd08.prod.outlook.com (2603:10a6:102:316::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 12 Apr 2024 14:34:02 +0000 X-Received: from AM3PEPF0000A798.eurprd04.prod.outlook.com (2603:10a6:20b:5d8:cafe::6d) by AS4PR10CA0016.outlook.office365.com (2603:10a6:20b:5d8::8) 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: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 X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM3PEPF0000A798.mail.protection.outlook.com (10.167.16.103) 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:55 +0000 X-Received: ("Tessian outbound e14047529286:v313"); Fri, 12 Apr 2024 14:33:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d5acc6a8a3d83bd4 X-CR-MTA-TID: 64aa7808 X-Received: from b7f6c69caa3e.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D7A193CC-A8D5-4AD6-A60C-69EA2195BC81.1; Fri, 12 Apr 2024 14:33:43 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b7f6c69caa3e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:43 +0000 X-Received: from DUZPR01CA0006.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::13) by AS2PR08MB9572.eurprd08.prod.outlook.com (2603:10a6:20b:608::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 12 Apr 2024 14:33:38 +0000 X-Received: from DU2PEPF00028D01.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::b1) by DUZPR01CA0006.outlook.office365.com (2603:10a6:10:3c3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:37 +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 DU2PEPF00028D01.mail.protection.outlook.com (10.167.242.185) 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:37 +0000 X-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.35; Fri, 12 Apr 2024 14:33:36 +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:35 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 23/45] ArmVirtPkg: Arm CCA configure system memory in early Pei Date: Fri, 12 Apr 2024 15:33:00 +0100 Message-ID: <20240412143322.5244-24-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: DU2PEPF00028D01:EE_|AS2PR08MB9572:EE_|AM3PEPF0000A798:EE_|PAVPR08MB9483:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d132847-d1f7-48a1-7c70-08dc5afd9526 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: uTgEQNOmweR2t1yZcIIJn2M/GFCpbY35LqLeQfN3B2Z/EyhgcsB/pxzS3FXLWC5lY9VqEfQ7OIj6LED9HQtW4kkAlNGH7UdR4WcNswDu+F9ggZy/Paz7pW5NoTCQaYi1MqLdNJ/lhUiylip0lGYSBO28SPLCzOLtG206Q5YtftjjQIP89Rya99qX8fAlzlor0s1qCoBPnt4u2SC67md81lLbXMvbD0HTng7hK3vwBcoACHupo4yjQiuaVApLDOOtyl1FAvxeNCivjaajDp9Dt0jjyKvuRagplmQz7xNU4wGv/ihg8Dxv2D+u9m0Oatmel5MHfEqgIsO+d1PI1hYe94Sa6hSAVqeCRfXi+Fl7IVhCNbmhB08bK0X6U1y6rTXZGu0cUDwvlrDaf1LTFI3bXYGf3lA4YkkLfh9LAkbVeexrroyirZOz++Pa3cs5yF+XNOSFm6h6tLOEnIjiAjrUaWRDm1I1XV5QFRj3FE1aZ9e79JmEgZJzUkBknod0yyHTNDTH6gF9YiKJcwlkAfbHvyFAtf66wDGpEasN0+Jrnw3jqWsFLx9Fmcc5TDc0JSi11dSm393ZM+wrX1vt/xi6Vj1eqGIR38zhvJsjXORX4+GKRKM/kqCXMoSCnW+0YBUpUirdNnljP3D4gr04cWjWOmI1BnPd+ba1bsgkGwSfubYLx1HSHhScOYN06TU0Nr/sAaATJSRw2JMuwRzadyBBRxuQZzjn9auLwAhj48fOwsvKYq6EQfZ3s2q8M2wTSOzf 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)(1800799015)(82310400014)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9572 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A798.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 426bda17-6613-4dee-5feb-08dc5afd8a7d X-Microsoft-Antispam-Message-Info: V2nJiuOUZJyrW3sSimbtsrFNY4bY+wsDMyRFtdMx3HAx+s1sT3xYKktoieYNav3tNk7AfQf/pJ5vF9VEUulk5nppbJb2/EHybtBOLpcdjcG8NwnKWBZhFPV2muKTi4iqLbvP81W9p6Of68CPiLioE540sgjYKvxqEwBMSXZQf8VINOmNoUiPnOemVMtS9ZUeu7ehY6zG/+5eOfG+RJc13MF63plQ0s0quR10xpWXVu6rGeKqnPxyBCvKyuuLXlcnOQTqH+SidKyKLxJByGFdq75Agcf/XWx1xoSPX2pBKG75p0mkw4o2BuFQdmD7fzxBtunGc50hkSIInPYtgJCCAyb1oOEp7b/XOJ11riuQXbko1Hm9xh6/YNZ+4cDoCBRE8esSd4jDCM+K06//RI/8cMJejMw0If5fELUMTAMLSPNlO8bhl65Z/2slIaICrrktXOEiNGRkmY2h0ntU7UVIQTjT2yEj0MSG87yzgpCL4jLN1lbnNr1bTEVIw42O4ZU48+XFgPpcWustHmskliWNB79dqajwbs3ycVi1/my2+EYd/k98vOpZ61PTnyE8ucEaqOnXBUnamro6YXy3nXHLbvmxs9Y2IbIf0wcBFk9BbQNu9WhnFFqcvrRgjF6JX/jqTu16maGxLobqcMz+q5rnYB/rVDGuSSE/Qmw5ipzyA3Aoss3zVkUvftvuNUXPlGviatY+Ei/VyB/wMkqgZb01DzWMd1pF3/pmiiEkyD6tWt2CB24DCAzR2ic78Nnu/1Ck X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:55.4852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d132847-d1f7-48a1-7c70-08dc5afd9526 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: AM3PEPF0000A798.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9483 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:34:07 -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: hRMiowhwpRCC3L54BvdUfeMvx7686176AA= 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=CnOf5scK; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io 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. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann 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 578ee37e7467b2f29bacac0b5d111271061e3ff5..f1c2776c7b74d0fae3529956ea91a9b504ba83c2 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 @@ -38,6 +38,7 @@ [Packages] OvmfPkg/OvmfPkg.dec [LibraryClasses] + ArmCcaInitPeiLib BaseLib DebugLib FdtLib -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117702): https://edk2.groups.io/g/devel/message/117702 Mute This Topic: https://groups.io/mt/105483445/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-