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 135687803E7 for ; Fri, 12 Apr 2024 14:34:03 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=QCOtyzyx2dwETocp5DsK3nSYwU/6xOKgK9gtMbTz+9k=; 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=SkbrjudqgMbk5phcXItBK/lVoO5EUG4P5JeagIvm+q7MQ+90Y2CWR/t5MdUGNylyfXM1PJiI RO3IpdbPCXM1dHex1xmYlNJBuT7ajJHdlIuNqumNiFdHft8Nywtor2wQTUja/Jyn3qjvy8DPvVC S6YLZnpZcKr6vNGJ4H5ESKAKuKDKTO/a6ODylQTDtWDL+U7v1WD/hGVSElDxeK/Mxqvl/64yINY 0piNHqr0KiOiidbhe/m7hcD+ukuzbMuUgBRnbnUJDleyIVdgl9AL/Tx7JQVBhZTv6F5FWRwLOqc Uuj+5uoMPN0na59iYgFHuTn/+TrsZduyTzey8593prltQ== X-Received: by 127.0.0.2 with SMTP id Xbn4YY7687511xdcQd0sxKKL; Fri, 12 Apr 2024 07:34:02 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.87]) by mx.groups.io with SMTP id smtpd.web11.47961.1712932435264998250 for ; Fri, 12 Apr 2024 07:33:55 -0700 X-Received: from AS9PR06CA0481.eurprd06.prod.outlook.com (2603:10a6:20b:49b::6) 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:43 +0000 X-Received: from AMS0EPF000001A9.eurprd05.prod.outlook.com (2603:10a6:20b:49b:cafe::71) by AS9PR06CA0481.outlook.office365.com (2603:10a6:20b:49b::6) 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:43 +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 AMS0EPF000001A9.mail.protection.outlook.com (10.167.16.149) 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:43 +0000 X-Received: ("Tessian outbound e14047529286:v313"); Fri, 12 Apr 2024 14:33:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8e9a19733c7ed504 X-CR-MTA-TID: 64aa7808 X-Received: from 17fae90b6076.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ADF5C508-166E-4FF3-9801-C4037845226A.1; Fri, 12 Apr 2024 14:33:36 +0000 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 17fae90b6076.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:36 +0000 X-Received: from DB8P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::13) by PAVPR08MB9260.eurprd08.prod.outlook.com (2603:10a6:102:306::13) 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:34 +0000 X-Received: from DU6PEPF00009529.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::ef) by DB8P191CA0003.outlook.office365.com (2603:10a6:10:130::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.36 via Frontend Transport; Fri, 12 Apr 2024 14:33:34 +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:34 +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:32 +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:32 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 14/45] ArmVirtPkg: Define an interface to configure MMIO regions for Arm CCA Date: Fri, 12 Apr 2024 15:32:51 +0100 Message-ID: <20240412143322.5244-15-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_|PAVPR08MB9260:EE_|AMS0EPF000001A9:EE_|AS2PR08MB9572:EE_ X-MS-Office365-Filtering-Correlation-Id: a0743d88-fd2e-4fb7-4cf2-08dc5afd8dfe 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: GZs5qU2oMNmFaYtqwpy8EdCRjhPOE//M6Duqkue2PSGimxo1+d1BxA9zdTw1YrPKtzAwRCl6J+jCUAP+zeqs81hvJucw51rTwMExTlA5VGaRDpXKRW7pZFUW4qCxljgF2ZUtkd1S5aD+fQMtCYProB44UxIZ3sqY65rop73R9wxi+MJ4O8hbR8sYpxZr53lRbbzkP20QWER/KRfgiLNUkb5WumMxmm8EEDflMoQVK8Ml615847p2sIL7gXxqxvxP2JyY29K/mz3sollxTlThLgHhOQ7vRRqp7iX2JEhlMI/KAGbTEi1apbJ1FFxn/zBo7MoDSg2u14+LvesvkUkkkS9j7MYcsRdyjZ07x3zFUlVPziCifNtmLBDvsHO2xiaNlrtivSaDpwIlZtCtW6ulrFADCGcYO2MPKCNFVrYTAxnqgmNmn1lCK8nvVxVa2Szgd7CKfaSfx4VBCEg6lLjD3SWDKPS3R/HyuSEqmbwVX+pE71Qse4PDitCtCl4P1SRr/Aeo2I95zGMy9ggrBsuE+S6EdvmVJwrXBML9XvuQkIuzQJjHQTRjIMpeXcXtKQm0Uc8+qFWf02HmvQ+8opcZQxpROHiCn4oBjxK2ZOYqxHlrBx7d8mm5ZZ22ajGlTJ6G8Y2Cg8nB5BgLEu+927tkc9O51nkK+lgodBo9BdCVsLjXPZk8OxNuDciGgNF5VoDvlWK70cqTzqHFR9jlSaDj4ALgnwYsi/9Wq5MLhhHRkkZu/0z7XJyjXz0yfak/UFlf 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: PAVPR08MB9260 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF000001A9.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c7e806ba-0151-4ae4-f9d0-08dc5afd885d X-Microsoft-Antispam-Message-Info: +BMKceKk5qYfPgiOrmLMKjMx+Qlqyru9sK6BtMuVtE4wX8sksykWp6lT5KQeRbP9Rap0jVnxpYE2MQ5UhQ4chWqTgkl5VBMCekxpbfQUvHT+cP/xC2yWonXCU1kUzyya78BnvDlJS9bZiGfE2duSGA+YUEgtqXArK9qK5yPfFDWNjrU2YuyPg+WxFZcOx+iSYIHFhxkXwDUu4lws4L1EPhfPv0VfQP6+JvaPG3akNjOrmxhM3B2Ir/pMTAYhNj/MpKXyy6tu1K71HBPWGPHmX3q3ABpxw9COLfag6Cct67b+aaEZFatTYOJaoTRzXIcwPMmrtLcFaShRy4MOLo4vWiop0AJViaIc4FsQqOk+ma54vD08PRnVXy+EJPe9AcwYK1oxARdrM9yZtWlLsCm2mu8eWbW8wX+yqResKHIk9ObbDQXsrXWv2z4Amtei+TaTuE+33UQtmaldxV8Jyi/Y+zqzfH8yjy1J+su+zB9pAhj/3QBzo8fT0WvHj6yPsxmL6UgzKG3LvacaI7ElkBAIZdYQ+P51FkqbwlrXpsy8yNeQKi0rDRDefB4qc/+2NfU0X9ih8NhiSi5aSZgBl9LX8IbTJzV1zfSi+wg4Hkk+fq3HvLWZsIdj1chERWYBDtJsoEOIciJccfKsDtwUYA1UKpvgOgmImaWueWY/9T0Y8rzElqJwInMRhdWA0fGHh+8sZD05A9yTer9A1f4st/r4G17fp6VAi9X5+0niGAlIZHCyX8OGxZDXvSJCax6qs3es X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:43.4778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0743d88-fd2e-4fb7-4cf2-08dc5afd8dfe 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: AMS0EPF000001A9.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9572 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: 31ptQkIoOv3wmrt8OCTzHF19x7686176AA= 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=Skbrjudq; 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 The IPA space of a Realm is divided into two halves: - Protected IPA space and - Unprotected IPA space. Software in a Realm should treat the most significant bit of an IPA as a protection attribute. The Unprotected IPA space is used for sharing memory and for performing MMIO accesses with the Host. An Unprotected IPA is an address in the upper half of a Realm's IPA space. The most significant bit of an Unprotected IPA is 1. Therefore, the page tables for the MMIO regions must be updated to set the most significant bit of the IPA space. To facilitate this define ArmCcaConfigureMmio () that can be called during the early firmware startup. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h index 7812c2e28657ca9525880dcc0d16d7bca90cc334..b70a96ed923e8c2654e51c9714074744a4d5f0c2 100644 --- a/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h +++ b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2011-2013, ARM Limited. All rights reserved. + Copyright (c) 2011-2023, Arm Limited. All rights reserved. Copyright (c) 2017, Linaro, Ltd. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -32,4 +32,21 @@ ArmVirtGetMemoryMap ( OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap ); +/** + Configure the MMIO regions as shared with the VMM. + + Set the protection attribute for the MMIO regions as Unprotected IPA. + + @param[in] IpaWidth IPA width of the Realm. + + @retval RETURN_SUCCESS Success. + @retval RETURN_INVALID_PARAMETER A parameter is invalid. + @retval RETURN_UNSUPPORTED The execution context is not in a Realm. +**/ +EFI_STATUS +EFIAPI +ArmCcaConfigureMmio ( + IN UINT64 IpaWidth + ); + #endif -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117687): https://edk2.groups.io/g/devel/message/117687 Mute This Topic: https://groups.io/mt/105483426/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-