From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.89]) by mx.groups.io with SMTP id smtpd.web10.83977.1682438709487087082 for ; Tue, 25 Apr 2023 09:05:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=lqbhYqOC; spf=pass (domain: arm.com, ip: 40.107.13.89, 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=1oVwmpGAf3voqL9vWH7WpkvNo3ymIXFICsg04W94SDs=; b=lqbhYqOC2cvwugFs3DT6TRxu1NxxHtxwH1FURCUPe30qbA6E+mnn1/h8NUz1kfv9yYBeNniqK9XVraWxzPtoFo8g2kyeeabSu/+F+dADR8XxrEh6NmiV0tUEgetWt6p0ymiGKNw3lqtTbdiVNRqE+DvDyIaN8riaS41S/YJic2U= Received: from AM6PR01CA0042.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::19) by AS4PR08MB7479.eurprd08.prod.outlook.com (2603:10a6:20b:4e6::16) 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:05:06 +0000 Received: from AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::24) by AM6PR01CA0042.outlook.office365.com (2603:10a6:20b:e0::19) 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:05:06 +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 AM7EUR03FT061.mail.protection.outlook.com (100.127.140.72) 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:05:06 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Tue, 25 Apr 2023 16:05:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6ed8a76c541ad89f X-CR-MTA-TID: 64aa7808 Received: from 2d7936ed63e7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2CBD3FB4-CBA5-42C8-95EB-3A047A230F9D.1; Tue, 25 Apr 2023 16:04:58 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2d7936ed63e7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:04:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dOUi376AHLadHMJ2b/LnKHZ+tX6jcLGzUUUiJ18CwhrJQy0200CIdxv0nHJ1VsrHhh+8c6/4cqjP+LuNaAllYTRUHww098TAsPJPwIjMP1pFNG6dLoXKgq/u3+sbPZEQDNC1d55z09rFSvkhCB9UFMO4uxpa8IHDZ8RTvK01ejZDif4HGZAIIT54l+OFWpgG+UmsfMYPv2VcOUQFWuFkV35X2OzuEOLeWUfKpIeXx/ILYMaQmqX8Kq85aWwqYaKVPGqrOcO+569Sujc7wOLPJ+9rbLK+Y0Ra+vac4rC2AocLajUpAKdhiw1ZDHZBseiO/YlzabFYMMZrXUJStq4k0w== 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=1oVwmpGAf3voqL9vWH7WpkvNo3ymIXFICsg04W94SDs=; b=Mc1wJMrWd+mTjsC+jHegrAhZpxvxswL5Snd909P8o1T4au6zeWUnQmDIvrmD9/KZtLozQHTD0uf/4mtMhXBqItS/ztGx1jDjLkH7xsc3aMnO3BpWmfwsGB+2AbUn+fsmFSfHo8dlvDoC89Be0eeSXK1kwIH87KsrabEP3FeGHkv2ANfRmpK7DLWZs6D3Py8pnBWRznFu3McxHVtYJtb8c7sEnybXpKuNyoSJbpSO/sHTBEvIwDA11/xNSGayIQOT5zuR18jWd0VzdR6J6K7c7WHiWFnL3RKarAL851+fHlgUcq0OKUNGy7huNkshKVHwPa9re9UE39gxdMn3oiX+Qg== 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=1oVwmpGAf3voqL9vWH7WpkvNo3ymIXFICsg04W94SDs=; b=lqbhYqOC2cvwugFs3DT6TRxu1NxxHtxwH1FURCUPe30qbA6E+mnn1/h8NUz1kfv9yYBeNniqK9XVraWxzPtoFo8g2kyeeabSu/+F+dADR8XxrEh6NmiV0tUEgetWt6p0ymiGKNw3lqtTbdiVNRqE+DvDyIaN8riaS41S/YJic2U= Received: from DU2PR04CA0264.eurprd04.prod.outlook.com (2603:10a6:10:28e::29) by PAXPR08MB6656.eurprd08.prod.outlook.com (2603:10a6:102:135::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 16:04:54 +0000 Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::9f) by DU2PR04CA0264.outlook.office365.com (2603:10a6:10:28e::29) 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:54 +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:54 +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:53 +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 24/30] ArmVirtPkg: Perform Arm CCA initialisation in the Pei phase Date: Tue, 25 Apr 2023 17:04:22 +0100 Message-ID: <20230425160428.27980-25-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_|PAXPR08MB6656:EE_|AM7EUR03FT061:EE_|AS4PR08MB7479:EE_ X-MS-Office365-Filtering-Correlation-Id: 955817fe-3c16-4970-64a4-08db45a6d612 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: QUc/ttYBCmQbECnyh3UgeHBznS9KWdu5ybJl5FPh9s6YpVkqpbXrljsDvmZQcpXi9Tdc5mkden1vhqdu2eGrB9vp4Ga0vt0s6uphg4Tr2ZPh2XSOYrj0+94/pcEWNllRD1zWfpEr+QI/ZiuZEICGyqmXQ54aEbSG3mNQLpMnx74LnQALy8Thd8QurO7LEuHa3lnfGBwaH8JbLLW7yzEbx/z/xD00VdGmmS8+w+bwXbdV8nJQ6O8uvvyO2azBe6uYzkzASPI0UjgDRHJ5swqcXqWv5gCFUcYoqjjaawBoFu/dgc5QRFUmQwyi+XT/Vnm2ArJjAxuGA7FaprrtAVnphE0GKTSXocNzzBLp5H6QrZxtnHWMkeqimgixW/wD+OXBAecHkuixlrkVLZ70hZ0MZ8CfGwdBTtTw+AtctDOv3iKJwQDDz8Z/vRdw9RqXhGn53tIm22DladCviWarEFHMpWqlZodO/zZeAHtSEqaXX4sVoZE6utBHn1Zzy7KgkAQmVBGmx6d/aD3oDPujQ+Rhdj7eJ/S61Iqe2r2HA9UG0pfGOSLz5UiSqt7KB+rFwYzKcX0PiISlHo2bQh5VtenKQJBaftXUzMa0+T0jyf5XfUU6ZHNaAluCxCsYkL5dlQHQwBB2pjvL/IYoGcgNGAuNulgiEW+j7xf7bMJp5kKZ5pvgY+Ild7Lt8lzsxE8G085qr/4ci9eR5bE6/ALjXJUUvOah+b474SWeVGpd31xVo+g= 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)(396003)(376002)(39860400002)(346002)(451199021)(46966006)(36840700001)(36756003)(54906003)(34070700002)(82310400005)(86362001)(478600001)(41300700001)(81166007)(8936002)(8676002)(44832011)(2906002)(6916009)(40480700001)(4326008)(316002)(356005)(82740400003)(70586007)(70206006)(5660300002)(186003)(1076003)(26005)(336012)(426003)(83380400001)(47076005)(2616005)(36860700001)(7696005)(6666004)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6656 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 34e4fcd1-49f0-40c8-b046-08db45a6ceff X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cLFdAEp6mQv+XM63rk0y9QDiPRnn+SvIDB45PKKjScY1zV/82J1AK9anxyCG4N/qWmqevLpA9IiZnTLg3Vqfn6xc0dChAD0CoD+ryrczuwlbZd1r0mPC9eSUjxqlfYHKus3AdwPZdSN8s1TwAIOlJT8CuR664Tjh5WbREjO/u4UEGwWuHvQhLhTbjfOusRBywzMMCdcgQrmYf0VXVAhcNHvY1rCvvFOXPXXUmzs2mM8m9yXCRVXe22/TrKnfbWpRwPa4GIgxb1uQsQzyl18S4GWoXfKpUzTsOjs5y+6mrMA9f184pQKXSuA1QqzXiNHyShImS0s7vLlXd20K9lFxhIWRi5YvksaYXhC1iVodVPkDQw5ZKS3w35Y4ig5v+qZCD00VGp6bsNrG5FJAYN2kGz2S9OzKkx5vKfAQVLuaFpW4KlXUsdCP5l32WfQcTM5HTon1u+t/+TpeICFnEOJtlz4jpC3Qpig45ECFWoH1QuIKU/DC5473XcCcgYDPkvGuMIljhytskJvuzvG4rj/9cCvSmLPrN4HG388eBXvtSQZVRR+Sa0gaRKR2/u1TSWxtFBxz1Gdymc3QTFSw/DQa4Im1CX4L3n0yvZzwBFrBz64flyCjkS+yZjrJ+/dXpP88SLzIaE89pr9m/u8IVLC+wcNNxd5wJUvEKL0VoOXD891LteDKTehT/+U8sliRCO9Kc927jHUfla3adU5QspXNxhkQ5FqM5vwC/RrdAGve3Iw= 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)(346002)(136003)(376002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(82740400003)(34070700002)(44832011)(7696005)(70586007)(6916009)(70206006)(2906002)(6666004)(1076003)(8936002)(40480700001)(336012)(426003)(186003)(83380400001)(8676002)(2616005)(41300700001)(36860700001)(26005)(5660300002)(316002)(40460700003)(47076005)(86362001)(54906003)(36756003)(4326008)(81166007)(82310400005)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 16:05:06.1005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 955817fe-3c16-4970-64a4-08db45a6d612 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: AM7EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7479 Content-Type: text/plain Add ArmCcaInitialize () to perform Arm CCA specific initialisation like: - Reading the Realm Config by calling the RSI interface. - Storing the IPA width of the Realm in PcdArmCcaEarlyIpaWidth. - Configuring the MMIO regions to update the page tables to set the protection attribute as Unprotected IPA. Note: ArmCcaInitialize () is implemented in ArmCcaInitPeiLib for which a Null implementation is provided. Therefore, this change should not break existing platforms that do not implement the Arm CCA. Signed-off-by: Sami Mujawar --- ArmVirtPkg/PrePi/PrePi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index 3d943b2138d3fe8a03322262111d5f7df3e39d39..7ece1e07152ebc395c1f21dfabd78df2020cf052 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright (c) 2011-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -40,6 +41,7 @@ PrePiMain ( CHAR8 Buffer[100]; UINTN CharCount; UINTN StacksSize; + RETURN_STATUS RetStatus; // Initialize the architecture specific bits ArchInitialize (); @@ -67,6 +69,12 @@ PrePiMain ( Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)); ASSERT_EFI_ERROR (Status); + // Perform the Arm CCA specific initialisations. + RetStatus = ArmCcaInitialize (); + if (RETURN_ERROR (RetStatus)) { + CpuDeadLoop (); + } + // Initialize the Serial Port SerialPortInitialize (); CharCount = AsciiSPrint ( -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'