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 BD3DD941A44 for ; Fri, 12 Apr 2024 14:34:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=kzMrp4e5Z9VpWffk4H3Yqpj/pFLoDUgC+58s/1+NnE0=; 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=1712932450; v=1; b=nWfZTOaPipcH0dIxsGYfxCz9OxvXuOSaA5VyWWUzD5eeUwgga7DAXknvmh/9WKZUZxgxiZ/Z KCIj7Kk/EDVpRMiOhp5TOBYySB5eFuTCTgevbTp5e2RRV5VFdig5T+k7KIHH9suxwP8KgZD2a/6 X+djjXihBHGMSRNvpU2zSuqigFIoxyJJfhLYzR0EJumxfKjw5xqicrL+9LCAeRb6r9rZjkahgu2 kbqPUqmHEYt1fV58O6Lh7mFmyG8hSVWt8O3xzJZJllLI+mUbdv2AS0Lfg3IUaX1IP+C429nNNMB 6e83fJbxyTGcSE1WwO57lOTNHsfn9/VjAX+PY6Y1+Scug== X-Received: by 127.0.0.2 with SMTP id BexeYY7687511xqycgwgbfG3; Fri, 12 Apr 2024 07:34:10 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.76]) by mx.groups.io with SMTP id smtpd.web10.48549.1712932441840870476 for ; Fri, 12 Apr 2024 07:34:02 -0700 X-Received: from AM5PR0601CA0084.eurprd06.prod.outlook.com (2603:10a6:206::49) by DBBPR08MB6138.eurprd08.prod.outlook.com (2603:10a6:10:205::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Fri, 12 Apr 2024 14:33:58 +0000 X-Received: from AMS0EPF00000192.eurprd05.prod.outlook.com (2603:10a6:206:0:cafe::5e) by AM5PR0601CA0084.outlook.office365.com (2603:10a6:206::49) 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:58 +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 AMS0EPF00000192.mail.protection.outlook.com (10.167.16.218) 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:58 +0000 X-Received: ("Tessian outbound 01a47eb2eb85:v313"); Fri, 12 Apr 2024 14:33:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6a7e1ff40385bf62 X-CR-MTA-TID: 64aa7808 X-Received: from 6e23c7855d73.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 77065963-0DA5-4470-87F8-88F5C9022DAE.1; Fri, 12 Apr 2024 14:33:46 +0000 X-Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6e23c7855d73.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:46 +0000 X-Received: from DUZPR01CA0013.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::6) by GVXPR08MB8233.eurprd08.prod.outlook.com (2603:10a6:150:3f::12) 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 DU2PEPF00028D01.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::37) by DUZPR01CA0013.outlook.office365.com (2603:10a6:10:3c3::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 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:43 +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:39 +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:39 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 27/45] ArmVirtPkg: Enable Virtio communication for Arm CCA Date: Fri, 12 Apr 2024 15:33:04 +0100 Message-ID: <20240412143322.5244-28-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_|GVXPR08MB8233:EE_|AMS0EPF00000192:EE_|DBBPR08MB6138:EE_ X-MS-Office365-Filtering-Correlation-Id: dce9f785-dd76-43cc-2126-08dc5afd9706 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: lkdtnmc7HQgiwvzM0uufmKSf8AA6ewLydJ3JgE2yXztaMZdrFW4j6RAdMhrM1eNZExvmPI8kt3tI07BlV4/VIqmuo9CB43v+DTWYSp9rLTHWIREGZdODIvIqYAADz4HCmXflS1Xsl9VfUNKxDMYm/t0II9WZkuWjUZJU/RA95GqylmcC/YkhveVEgJa5n1Bec2rizQgxV6yPtuWYk4fMRPK/qjGIzHqSE4Zb1BFR/ckAw1kPPCjLlfLvTe7rRZkMa6E0hWO3Iow6WU/VnvBvKx2/axl/SHTOXhRDIMbZ+N7eoYsxo19R7/oVfetE0owqRYfjWCLGIizTeQ6nFAu3zIulTzwFC1pXqS3VLaSBxFlTVg9+9jCun086BvTCDqehvkxcWAGX0AIA2/0/ksJotW4G8lWJ6gyNYrMBupvkC+0RKF9nEang8AF9RWVyJD6K0cKYF3BSDt4HYtkkvQMeyxCAKka9UxtwVqgzrdjac5K1fu4xW5kUDXv7yw94yibKXezY2mRXG0fPLV60dMVAtvv5rLj37mIKDUC2B3tSXl0VNi/NdGEKk1lwYmMhcR8fVUNH9jIfHkKhzNROdZhVWMB/T2TsVN4RczojZI2jwhKq/5wL10ExnNWTen2fjnLJhqDUe31SKLz2fs3GrMYl3hNRQmY7Gsb2uQYZhXFYYA+f1PwPuyhZCuWhs/q1lkDJq6+xUgFNRiZngGyjuSHtwiX+4fiVfoGO1XxiLT9DHcMkAKkYt8+OUo2b2QSaP9I8 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)(82310400014)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB8233 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF00000192.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 77e0a20b-f5d7-4933-97af-08dc5afd8de3 X-Microsoft-Antispam-Message-Info: Kf+WXpHyQLzc/buccGe4zB7oE5l2Ltbo1soLHIAkHS6m2mtWUgeAVPIUwTeaa+AU8Y/3zXfvbyBHdBP9Gj7Ws5ZqdGryHA80VvJc7A52uG2vaO9W4w6Ca/AZSx+n/rUJU1j6XwnUz2RGbUfJD9xf1njIkueXWxJjvL3qEr3zeVWxI5eeenFHMm85/C7U8uf12eIC9EdSqMXo/gUuJneYL3SCZT8J7K/evhDE4vCJlVc2s3Z9hhjlS7QiycP7xM44Oh5gsqG+Va4O1hDtZ4TQpMWpugTPA4i87rn+p8XFWV22+if6iNejTFgdObGudOCmCGIXzC96m0LyfngV8ueG3S4+UnBFsuc+7l6a1tD9OFaGknGOueH4jxs2xvD+GnDyjXTHlaANLmwQcnZFhTT9iu825p64rysfy1s52rDcEUWfLHJfjT0KyN5LOxaouzfmvHbs5uqzh5mWMMZUYvyrX157UpV5AslUORy28b3gk9HYKxlnLazbGvnxzTBCzCjX+p3ypiNVsYpIJ2hZXVSKJ5yetsBLgmqJKBmJocO/spz7sTLH5j9e2iyGbtOog/NM0X+RHtPnhR5cvnjjrGr421hwtf3R8O+U4G/oxLe9IFmmaX17tchIoCC3aZQ8zJUm6Pw/anbWald/Ay+ERMKlcuuYWeTe5nSEUeyhIFmJ+KWL+gOF3hjDxMUZfHlOXQzzWEVo3qxLjsJE4BN/ZWPIxrvepqtzzU+4XnxkMQq6FyNXFvfCNQ0EQQgw6xq32IMH X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:58.6129 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dce9f785-dd76-43cc-2126-08dc5afd9706 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: AMS0EPF00000192.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6138 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:02 -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: 50Kjso6kDlWpMvaADkHeAKI1x7686176AA= 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=nWfZTOaP; 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 Arm CCA Realms protect the access to memory from outside the Realm. For Virtio to work the Realm Guest and the Host should be able to share buffers. Realm Aperture Management protocol (RAMP) manages the sharing of buffers between the Realm Guest and the Host, while the ArmCcaIoMmuDxe implements the EDKII_IOMMU_PROTOCOL which provides the necessary hooks so that DMA accesses can be performed by bouncing buffers using pages shared with the host. Therefore, enable the support for Realm Aperture Management Protocol and ArmCcaIoMmuDxe for Kvmtool Guest firmware. Note: The ArmCcaIoMmuDxe and RAMP check if the code is executing in a Realm before installing the respective protocols. If the code is not executing in a Realm the gIoMmuAbsentProtocolGuid is installed, thereby allowing the same firmware to be used both for normal and Realm Guest firmware. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirtKvmTool.dsc | 13 +++++++++++-- ArmVirtPkg/ArmVirtKvmTool.fdf | 10 ++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index 33eb280f91413141cacb6526375c2733778a853c..c358b0a55daea8f8231b037cc63005cc86fe9a18 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -401,9 +401,18 @@ [Components.common] # SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf -!if $(ARCH) == AARCH64 +[Components.AARCH64] # # ACPI Support # ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf -!endif + + # + # Realm Aperture Management + # + ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.inf + + # + # IoMMU support for Arm CCA + # + ArmVirtPkg/ArmCcaIoMmuDxe/ArmCcaIoMmuDxe.inf diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf index cdf756c11289b90cb3815295a6cb38cb2f74916f..07d86f649e01a9e61f2acb76f748a95eb57c0a6e 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.fdf +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf @@ -212,6 +212,16 @@ [FV.FvMain] !include DynamicTablesPkg/DynamicTables.fdf.inc INF ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf + + # + # Realm Aperture Management + # + INF ArmVirtPkg/RealmApertureManagementProtocolDxe/RealmApertureManagementProtocolDxe.inf + + # + # IoMMU support for Arm CCA + # + INF ArmVirtPkg/ArmCcaIoMmuDxe/ArmCcaIoMmuDxe.inf !endif # -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117695): https://edk2.groups.io/g/devel/message/117695 Mute This Topic: https://groups.io/mt/105483435/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-