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 354FA941A24 for ; Fri, 12 Apr 2024 14:34:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=zGMFv1FbiOt1yQPvsGoxbcM0nit1NL3qOxelX5NAPFQ=; 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=1712932442; v=1; b=jDiYdcpLdMAeurfEQIxgaP5IrdfD3lOLdjXgula3TGdqRlSkYkruDJ3TAKiUF+eBNoM/V9Ke S0B6xLjCzdpRxa7iGz4rcKaA5ZDcGSZ9amjIzuMRkvCL6mpzsRprsqqjyJIuwOxTJmAQNg9Ms3s DVrhdZLfoQJ1ah+xkOXlVjwsfKnfZ2S8XwrtIijuZ6kTzviMkq5AdUjHOhBlMD8sBuvxnNRM9gX eFQKb7FWr9lr4hk6YjRhsQYwOzi+JAbDJfNP17HQev2k6Y3jGUxIQ+shCAsWQc0L1eRABPG9QPu ld02dneNRFT1ZLDD8x2frEFL9ENX1uW6VBhBKbgGJTxyA== X-Received: by 127.0.0.2 with SMTP id G6MuYY7687511xC40VngOo6s; Fri, 12 Apr 2024 07:34:02 -0700 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.54]) by mx.groups.io with SMTP id smtpd.web10.48542.1712932435499735563 for ; Fri, 12 Apr 2024 07:33:55 -0700 X-Received: from DUZPR01CA0296.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b7::25) by DB9PR08MB8340.eurprd08.prod.outlook.com (2603:10a6:10:3db::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.53; Fri, 12 Apr 2024 14:33:51 +0000 X-Received: from DB1PEPF00039230.eurprd03.prod.outlook.com (2603:10a6:10:4b7:cafe::10) by DUZPR01CA0296.outlook.office365.com (2603:10a6:10:4b7::25) 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:51 +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 DB1PEPF00039230.mail.protection.outlook.com (10.167.8.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:51 +0000 X-Received: ("Tessian outbound caed45120527:v313"); Fri, 12 Apr 2024 14:33:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d9f5d4d8d814abba X-CR-MTA-TID: 64aa7808 X-Received: from f96faf8ccba5.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D1878F63-D455-4D1C-AE6F-B896D48FEABC.1; Fri, 12 Apr 2024 14:33:45 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f96faf8ccba5.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:45 +0000 X-Received: from DB8PR06CA0040.eurprd06.prod.outlook.com (2603:10a6:10:120::14) by AS2PR08MB8950.eurprd08.prod.outlook.com (2603:10a6:20b:5f9::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:39 +0000 X-Received: from DU6PEPF00009525.eurprd02.prod.outlook.com (2603:10a6:10:120:cafe::6c) by DB8PR06CA0040.outlook.office365.com (2603:10a6:10:120::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.28 via Frontend Transport; Fri, 12 Apr 2024 14:33:39 +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 DU6PEPF00009525.mail.protection.outlook.com (10.167.8.6) 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:39 +0000 X-Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:37 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:36 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 24/45] ArmVirtPkg: Perform Arm CCA initialisation in the Pei phase Date: Fri, 12 Apr 2024 15:33:01 +0100 Message-ID: <20240412143322.5244-25-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: DU6PEPF00009525:EE_|AS2PR08MB8950:EE_|DB1PEPF00039230:EE_|DB9PR08MB8340:EE_ X-MS-Office365-Filtering-Correlation-Id: 034a7f36-6cf0-44fd-f291-08dc5afd92c3 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: e//o6Yvvv8cqYO0lRMDrdamu0A9q2vqwmx0vUcXaDUlOPcXw5oWt0U78RzCw/7slElqvhuX05ijAhmsvJem32NLCtZ072Iw1BUOnkDOkCwswIHwrRGaVM+kE6TO36q7qM/fnHqcVgWnPqKG+qbMscIb8IVFwHGSXvpPT4i+GmDCsDNMEUGlhmjeY9IOdJ/wO56ZWfiFOclN8enFCicpt5p8bpvLmzFZhVUosZ9aiBDFI/o7J3KGcTTo4uFhPMe+exqXDY9TfDt9wAitIktgWi74eNnr0F8yP8IWgjzyr5navcGKYOqJ53oRe1/kxJvJ2e/3VRwrM1AUarOOUHA5KM0eZQjbvszT8OLnkWeDEU3uT4yrDU5ay5eCjOMWHVz4xawv8kqcF92Q6NDjea3W45Armls9be9p/lJ5uB5oMyDOOdZZyRFbyAdeT033Lz0WhyPsH+vOrOH9qfH0GXElOJjb+odFWVHK34ckkMPwJ836rkLkYF5TB/dVLZxlk7b2n8Ur/ty/5OXPcPWtHfGLXcxdZMD6aOWRzT71X+ufkXAKzphRBIGtZY5q6xX7iGnL2bJHFpBId4clGLrlhORqJPhaNTiaZncOVFc+KVQ1PtUlesPbnqDfKoYPsAoAtU43XpGaryb2CiJq8iUYj+ZrnFTkcOq8Fur76awy62Z0ojbb7Eag2ze6L7arSykMnjoXlpwqxlLBX5zyK2wBwTBpdSEeCN6gvjnJa0VpnplHvxRCYmBM1a6FYCzsLJ0YLpH9F 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)(1800799015)(36860700004)(376005)(82310400014);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8950 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00039230.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c65e67e6-da63-4f95-1f38-08dc5afd8bce X-Microsoft-Antispam-Message-Info: e6B2xvT+otOiNM3CV5cUyHeku8+b0ob9zFu0f6mlRxSUijNSNdsDtpMy0zQZn/RLUjDSafaIATCLGrNtZaz6Lf+uQuCU+357aVX9CtEGusAtuIu3N4VUn6BC64f3MaSWrVnKdDzR6IfRNsgMBgSoViiBtUf815k8gDhWTtfE51fJks7ooQE/eTUJf6ErgOUYow1DPzPiHTq6ZoJnrwFwXcnMmU7sA0LwHDPA14kTKzGDb4/7vCCjBM3tn3muINFytcA+OWU9YPwuZxIUy68pq+SNk2ZzimOhkUYiljjyL5VZe6kzceeIOCOfxqwkLhCUqj0znSna1shkQjuFz+0ChYXSGeA2cwAx71USyaZacSBclsP5AoTmWmeRQvTUQgFqLxiEZqBG5BP8AT5rSZBusEl4FJr5moAr8kmMXbxPK25d+iyP/l3p/wLtYh9bjaZuJ0FIAvwgByCEF47Up4Z5YC1HykE2rOzPpipXgBCe2y+kdA8gr6ZO6Bb59s600d3jQOWvfHm7ASWRekL5rmOAr+ZtV9ncYcHXLLbgBE5W07OHQM7mzX4IpsbRov0RSbT2RIaZP3HZkemY9PqDNi3zdmIqUL6w9Qm8pdN/cYDH+pQbqAwhvKeInwobGYlQYnf0b4lIkHFvyttSqY55TAEtpfON5vMnk+VDBtDN+/BgDSEw/B8fQjpXn0VaRQ4DLYe2ArT1I2Vn3tpxgtPnbTm3AUn3YsskORX2PkReyl9C3VJb3dBtjM3qb5xW2hQvQbwZ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:51.4996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 034a7f36-6cf0-44fd-f291-08dc5afd92c3 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: DB1PEPF00039230.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8340 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:55 -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: P5GdaoW8yDFwL0MVEK00TYxJx7686176AA= 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=jDiYdcpL; 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 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. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/PrePi/PrePi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index f27e0ad3d223820f60d1f8087325a96c60ebe876..405da60177f56238a79687ff8e1839207b14afd3 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,7 @@ PrePiMain ( CHAR8 Buffer[100]; UINTN CharCount; UINTN StacksSize; + RETURN_STATUS RetStatus; // Initialize the architecture specific bits ArchInitialize (); @@ -61,6 +63,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)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117688): https://edk2.groups.io/g/devel/message/117688 Mute This Topic: https://groups.io/mt/105483427/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-