From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (EUR02-AM0-obe.outbound.protection.outlook.com [40.107.247.84]) by mx.groups.io with SMTP id smtpd.web11.83449.1682438700894121368 for ; Tue, 25 Apr 2023 09:05:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=EW9OMZVT; spf=pass (domain: arm.com, ip: 40.107.247.84, 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=Ysef8IRGjfpBtVoFx50q53CHwtU7t4us0mKbXDxlNP8=; b=EW9OMZVTzP8YgUdWUVDLaLmpE69b0BpSLMZI50q2sqLhmaj9JkgFhyho2jkYRSMhQIuyICM1TrqFhBPSToRxUag5YqnSc9/otZB+hlBxmqWFtJwKcAGFGOT2w8NTB2t/ZJ4T3tF9gdoBC4a8e3f8uX9Ag53bAX/6Q64OHEoBSNA= Received: from DUZPR01CA0047.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::16) by AS2PR08MB9786.eurprd08.prod.outlook.com (2603:10a6:20b:605::22) 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:04:58 +0000 Received: from DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:469:cafe::d3) by DUZPR01CA0047.outlook.office365.com (2603:10a6:10:469::16) 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:57 +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 DBAEUR03FT015.mail.protection.outlook.com (100.127.142.112) 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:04:56 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Tue, 25 Apr 2023 16:04:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 44425aacb0ec7c2c X-CR-MTA-TID: 64aa7808 Received: from 36b0111cc216.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 864306D3-B6F6-4A69-BC78-F5F52690390F.1; Tue, 25 Apr 2023 16:04:49 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 36b0111cc216.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:04:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L4mWHZNm3w1GwX3slX3AD1sm5Iht+ejMFF7QFk95lgvffEB1rUXKlP7o7neTvJmwopRxf2jP35rR3RnDAs/xlYPmMMD3b6m4rUYIsHuf9zwPMKkp3LsEG2iNoVXCEfBh4+yWHI+4qQDcJn+9Q/Wfl4g96bb6xd/3VMPPlFNX9anFt8QQbqGpb9+rZJGtbYfW6I/IMQeAKeM4Yw+kwfE1i0k03G4m9bdfLTm42CBPblYiOYap/IkwWbk+kTGG/xTUsW8yURqtTr74XQE3CGhDKTEG6yGRlDrUlbtc3qjrgzAzbdhAlRt60acGp9k0PEoBouPk/ftYujFuiAkkBbV+eA== 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=Ysef8IRGjfpBtVoFx50q53CHwtU7t4us0mKbXDxlNP8=; b=L3AHm6LRLWbGw+j3dp1f/vwJg8IYmaNmzFn+RUCPQfWYk5dTb6VqNCFah/zhCgIoZ7HmMThkHfwKOojHVkvNxufUOK2vvE8/LANHMyFYU/x/W1Jko7WkvbtAxkz9hjpzgJ46rSo5BLYf5kTSXKTdshaFD9qhaFZ4Mi4DniVi/BlT3Jw/DSx5v4zRoJTl1QkOoi8XFqJH034nHL2q3Gfg3SVhGklouy9KJsyKqLDNK9m3FJUG8HdFiWGmUwibgwBc6TpMBHLJKeg9i6tj8gpOWanKEZ4w5m3Eh0hU80aY1ZlDYee3uaxfh861EIfn/8iRx5WCdMfR0SqNQ5b7v66iTQ== 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=Ysef8IRGjfpBtVoFx50q53CHwtU7t4us0mKbXDxlNP8=; b=EW9OMZVTzP8YgUdWUVDLaLmpE69b0BpSLMZI50q2sqLhmaj9JkgFhyho2jkYRSMhQIuyICM1TrqFhBPSToRxUag5YqnSc9/otZB+hlBxmqWFtJwKcAGFGOT2w8NTB2t/ZJ4T3tF9gdoBC4a8e3f8uX9Ag53bAX/6Q64OHEoBSNA= Received: from DUZPR01CA0110.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::7) by PAXPR08MB7383.eurprd08.prod.outlook.com (2603:10a6:102:22e::13) 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:04:47 +0000 Received: from DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4bb:cafe::a4) by DUZPR01CA0110.outlook.office365.com (2603:10a6:10:4bb::7) 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:47 +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 DBAEUR03FT054.mail.protection.outlook.com (100.127.142.218) 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:47 +0000 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.23; Tue, 25 Apr 2023 16:04:47 +0000 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.23; Tue, 25 Apr 2023 16:04:46 +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:46 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [RFC PATCH v1 16/30] ArmVirtPkg: Define an interface to configure MMIO regions for Arm CCA Date: Tue, 25 Apr 2023 17:04:14 +0100 Message-ID: <20230425160428.27980-17-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: DBAEUR03FT054:EE_|PAXPR08MB7383:EE_|DBAEUR03FT015:EE_|AS2PR08MB9786:EE_ X-MS-Office365-Filtering-Correlation-Id: 8fdb9734-bfb7-43bb-503c-08db45a6d088 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: qFLOs8vYrxm84zi3gm8U5R2FKvNxieZH6/0SCzY8RDz9/daoKO3hr8Pdmh2ydj9GPZd1CNO1eWh5PIDl7qnqWzxlY8AMsbNhC/J69WUxSYprYh4iuTsbSN1whHUrVgXojxSEpWTC1JwdwtEMem1fPdPjSuC37LtHUP6NmRfMGySPT7n60S1jzHDBISx1qQQu9CttY1clba3H4dKJl6nHHtOGan+AdKmIB6AvjB2m96H2RM8Bd9w8jnoWP9u6nupblBicni5ScfBs6thJd4d5XqesySypwqRbf61Mhh/zOMqTBFvQ0CO72cduDVQjBH8Y/kRR0TVUvlc8N2OspBZ3/biSn+M2hFhH84TljzoBg6lItfP+bU3MZ0gPKbGOL36Dtwdu3tkF+aLAP626CsZxtfDcUmj1pELsce7vXIQmad3T2ZkenZrlbxAfXF9oQhGPI30zFNf7wLjgiZMXjqhR9yL2xTCAs+i1mS0IptDeP4PKL6iOZuWYdHqL9LoZ2lLr6yBMBFU5xrrg949aBkYmBsq1dCn5WttOs3oxT1O6fRg1aOdhX2NIT/z7b8DAUx15dYf3Q07sTBVF0dT5MdD8InLglfzt7VmTrBp4DwLNkTPdWp9Sr7HnWKYfRjoC5Dcbk88yuVBnKLqCAuOVdefOOgCJDQXtkfo3FIYfgS4Q2d00+uNk9nhp2c+VImVYCRYFZYUVORnOtcbwsrS16vvZT+N7A0NVWpcGPYY5z8CwX0Q= 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)(376002)(346002)(39860400002)(136003)(396003)(451199021)(46966006)(36840700001)(478600001)(54906003)(86362001)(36756003)(34070700002)(186003)(26005)(82310400005)(1076003)(40480700001)(4326008)(6916009)(316002)(6666004)(82740400003)(44832011)(83380400001)(70206006)(70586007)(36860700001)(2906002)(8676002)(336012)(426003)(356005)(81166007)(41300700001)(7696005)(5660300002)(8936002)(47076005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7383 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 318f41f6-0eb0-430b-54ae-08db45a6cb20 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZMdZu6jjklwIEU1qQGfeBcEvDQoSoFsDKRJqP/oedOiPL32mqhgwjKWQs+R41ZP8Abo1GbGuMq4ymfnq6HzEbsOC97JXMfigiE0+ReO9+JcTgmc+jon80OcvxMk9HvwK2ECLh8nyMGj3JApvp3ElOZbH0BCvg+sQS/HwlxpmwYfljLPhUXmdauFzS5F9ozKoEdt+3IeGtQaJ3yxrjs3KszRPrqY056WU1UrQQTZOrwdB31YkzQErjlj3DnZRyAOE3hIc46D0WCqxexy5MqT3D0/6uSxFt2iUDgtRFMU0DLcsgKhIRwjZOd37q3/cJgyMcw9eeAFwuH8KkUuYYMt0JDiMmbtHXq563tcXel2cwa5IWWZyf0tfoWcSbwwap/o4GaidujFbWIgY8X8Avg+TAeVGGXpalK7DOM1sr1nwsPvFaBSx1uwx/KfZFMsDEi7wJSTzcq93+xRyXZxNTjyE1huW+LYWzCU1TJGV+TPFahdE/u40v8speHakWmQEhxoqMPbcgWXR507aO7fc7gII0UhKu6M1+RXOkMwHu6JbOZBid8bWmWwmG11d72FWdVkByBfkVRa1LCQekTNH3/sedNtAreZA0MSaF0g3qyaqhyVOfRCYENqAWP7S8yn9FV/VbrpzEKWllViaPYURnxiEAFXm6GBMVKDOgzbK3RdGWi+oqyCYlMwDSd6ezrfKeC90Od/6/KcdDeTMhboAXhQCIvWO0ypPFh6JEV3vnZdztuE= 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)(39860400002)(376002)(451199021)(46966006)(36840700001)(40470700004)(7696005)(2906002)(2616005)(6666004)(186003)(40480700001)(1076003)(70206006)(70586007)(8936002)(8676002)(41300700001)(6916009)(4326008)(316002)(26005)(478600001)(44832011)(5660300002)(54906003)(82740400003)(81166007)(82310400005)(36756003)(86362001)(40460700003)(36860700001)(47076005)(336012)(426003)(83380400001)(34070700002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 16:04:56.8382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fdb9734-bfb7-43bb-503c-08db45a6d088 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: DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9786 Content-Type: text/plain 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. 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)'