From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.68]) by mx.groups.io with SMTP id smtpd.web11.83466.1682438713987237677 for ; Tue, 25 Apr 2023 09:05:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=y1K4kNI1; spf=pass (domain: arm.com, ip: 40.107.22.68, 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=zypZF577QhpXMYB855rhgmuQpX7Wujv/5sCWlDwmj3E=; b=y1K4kNI10ALurOmXgV/fNsCAxzxfhddmktYPABZdbvitmD/L9ojgld7GGMwbZayN5C5N1sESxxcSA/+k2Buxjn5PPEOBQt3SnVjYzx7fiKPGX0a9X66yVyw7hV+iSTV0+pvN4nsJwlHnsw7eaIhNueJ4uwXfoI0ee0m5lK2abaI= Received: from DUZPR01CA0007.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::11) by AM0PR08MB5473.eurprd08.prod.outlook.com (2603:10a6:208:180::17) 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:11 +0000 Received: from DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3c3:cafe::e4) by DUZPR01CA0007.outlook.office365.com (2603:10a6:10:3c3::11) 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:05:11 +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 DBAEUR03FT034.mail.protection.outlook.com (100.127.142.97) 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:05:11 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Tue, 25 Apr 2023 16:05:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a11fbcaf0c82dd4c X-CR-MTA-TID: 64aa7808 Received: from 0d786e6741ce.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 918F4E9B-4880-4682-9FE6-4024B27A2D22.1; Tue, 25 Apr 2023 16:05:04 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0d786e6741ce.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 16:05:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hzBdZ2Oq/gzdouS8NlPzVtOSqy8EQlkMZIHB44u5WPx0RJStKSyT1ttZTnULJMohgOb177l+qGlExBqLH0iKJ0R5zur67gyIOwC+th8tc+etCVua2jHfLsK+J9TeTEBkAx9oADTt61jlfKKEJFrHaC+Kljv/utuNAZVCnhifzbs4MZXWCRkrnq3fYjW/s7brmI72cVvc9B7jSQf5vHankguwFIsY7Q3q8BkrYCtiIIHQ8jsEzYfpIwifb5v8+fW/CEy94D/ltxzNmHCiyoslVOzg2tFQxEJ5hVbvDAKWLMi6v/7IdwlMKaG6i9kivYjCGIa+0oei8qJGIRqbwaRkSQ== 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=zypZF577QhpXMYB855rhgmuQpX7Wujv/5sCWlDwmj3E=; b=TQPONQm4C/t0DqK3ZvIDJVmW+0SZnUFhjT2xgXCJEoPUi2NgzJ7IhyjZx8PL71tvu04N9pvha+yRQLrh16Uj1SBhhF8Yv3NbjzUA14a5V94oo4AfTcCe7lIZdAix0dZS6lRbLq/IoKH4oiaM4U85Lq86kADEEMhfehe4FOXakiXNxDry9wnKSp4DsnnsVG8WXhdkGxnghFwGCeChbXQtceC7yMK2VPVpIAmiQNqUcowEwmlSO0RzAUBDzs7qL9l8jyuzomPlk0xiP4Xub/Ju7ognoBvNnSBcVYhmqtKL4JWMI0hoaJfKSwetqz/3WtbItU5oOYV7XvISOOoKXjTVMA== 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=zypZF577QhpXMYB855rhgmuQpX7Wujv/5sCWlDwmj3E=; b=y1K4kNI10ALurOmXgV/fNsCAxzxfhddmktYPABZdbvitmD/L9ojgld7GGMwbZayN5C5N1sESxxcSA/+k2Buxjn5PPEOBQt3SnVjYzx7fiKPGX0a9X66yVyw7hV+iSTV0+pvN4nsJwlHnsw7eaIhNueJ4uwXfoI0ee0m5lK2abaI= Received: from DUZPR01CA0009.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::16) by DB9PR08MB8436.eurprd08.prod.outlook.com (2603:10a6:10:3d4::18) 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:02 +0000 Received: from DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3c3:cafe::80) by DUZPR01CA0009.outlook.office365.com (2603:10a6:10:3c3::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:05:02 +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 DBAEUR03FT004.mail.protection.outlook.com (100.127.142.103) 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:05:02 +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:59 +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:59 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [RFC PATCH v1 28/30] ArmVirtPkg: Enable Virtio communication for Arm CCA Date: Tue, 25 Apr 2023 17:04:26 +0100 Message-ID: <20230425160428.27980-29-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: DBAEUR03FT004:EE_|DB9PR08MB8436:EE_|DBAEUR03FT034:EE_|AM0PR08MB5473:EE_ X-MS-Office365-Filtering-Correlation-Id: 31c066c8-10f9-44dc-cad6-08db45a6d928 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: Jzk7xXuDAUKeflwPM6opsisEqqkuAf59P/+3vEiVaj9CA7Oopy7J/6ytcPHit3kjKWPlyzpv6agxKIW1DfyrCGb9MAKZnLd1j/kHGEZxu/P/QPe+i0TXUTaiXqL17yJj7CPsQaQ2KorxIuUE/59PXs5qw/y5PYT0psuSfmY0lWtZZZ/9i4vDnjvXx9VySKstvFMUGIArekkOC0g1PgLTBQS0w+pKaO5LIv13mVF9K797USx6yd994E7i7RUM9e3cetVAZqazzZF9VKcafVxQyta07KRV5Uxx9o3TL5k7nFwmfhwRaZoElR/LTqHwUrbEYN8ENZJGnXy5+wx/KJAOMTyZlBi2tLuFluo6rue2E/4WDLfudnCvWUya+eft4q+YAjqBQO7w7y8aTCyqHyJrX/GsFkCzIw/cT0NhfU8P7cn5P8Hk3rXJfVkGofi/CG0fqJ9yyYA1CnVDzjQHVtwhHXUsnPwNyCvDtBwOlWCF8w/hnECWljqx8uZvLV0rtBREqC6iLZlVhu1v13ULQPS922oWUKct6BAp/MMxWf7pa2R/SYuw47FK6YK1M85wpghqjGR2XMvzeHwXQzPZk120sT6ifGcTuOAlsdSm6mbLK79MKHJBptOxLTFQY/LCGdso3kIeaSRQZehr2H5Mg7cbzlJ2lAHGBbh5r5CajWOh6KmRzfhIiP8lmLoi+TMlyQc4A0AsudcETxSJZ/fT0Bt4ABVFwvp+SNW+5qWyxtlfzto= 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)(396003)(346002)(136003)(376002)(39860400002)(451199021)(46966006)(36840700001)(54906003)(36756003)(34070700002)(478600001)(82740400003)(316002)(40480700001)(6916009)(70586007)(70206006)(4326008)(356005)(41300700001)(44832011)(81166007)(8676002)(2906002)(8936002)(5660300002)(36860700001)(186003)(426003)(86362001)(336012)(26005)(1076003)(2616005)(7696005)(6666004)(47076005)(83380400001)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8436 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0f0e4d09-0e77-46e3-dad7-08db45a6d3c1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oPTmG5S6h57VrEl5A4JMlJtyCbJCjuZyRwiIhqYeLT2dtF+UvqqtWeaaSTKySA0lKYqO3weGYnVz7BgoexQvUYeQPb8oOxpkncjJQHYtsugMFuyCM/SXyUEs5mVgPT4Y8DTCSD/h/I43DBkRsgrXnaOEJiJ8Bz7/JnJ5HfB8nb+fDDoKuSbSEls11W3LWGb1mfS7LL3QF9u8cllMUFKnwAwnXJHZaSJMkVIpIQ77B1pidhlKf1OZMlxptcpAFzBxtDv5ddEgIr9tUl/uSTyYy+pbjzyt1huhqQ5ybzVMeIiB6V1xSL1DyFXFMUSh2GJa9GJxp01KnltcKsLw1XoPzsxHfszUx3ptMYhbU16HupplxZrnQdpm1lrTvWHHP3FjFAWO+4ouPn430ppLoWcSrZOshMf0w75OmnUGp9X20eCVlIhnoymKi0u8UCRz4WCltJwv+rMCqrjERHdCUJRRZ4MABeLRQWPQUvDFVP/JWSVWarYOUcSsJJl+dgG8E5RznJlCkhT04Oe0DpU9HVeg/ykKdZ3+PgWA8jZiTUsGEyLQ2g8QrhXIjwYF6oamvFg2hdbp6DkrzgLwDleoUPN3ZO0rmJF7QncYP9g6je3MHsCLYkCtOrENVzfHwkIvY1lNxZprljbgDeBJPSLD+kudCbsr9HfQByPorWtCL3qjRuWTA0O+Twq5eNMTtqPfE551XlLOP8XuX/lhuVXcdsZ2z3jh3dU5oORoPNPcjWy1t9k= 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:05:11.3274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31c066c8-10f9-44dc-cad6-08db45a6d928 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: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5473 Content-Type: text/plain 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. Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirtKvmTool.dsc | 10 ++++++++++ ArmVirtPkg/ArmVirtKvmTool.fdf | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index acf4ede48da2d33d50b5593a857f3815f427707c..d9dd7a67307ffed5da16837301f18e7715187450 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -411,3 +411,13 @@ [Components.AARCH64] ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf ArmVirtPkg/ArmCcaDxe/ArmCcaDxe.inf + + # + # 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 68bd0e9d82dc83a337d8127a598018381888d894..c04a1f1f381410d2eccb781b2de99898d5da9578 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.fdf +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf @@ -224,6 +224,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)'