From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0076.outbound.protection.outlook.com [104.47.42.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D847E2095D9CE for ; Mon, 31 Jul 2017 12:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CRGxhUNtSgV+BG+DIdE8+1lGHgfRBV2QP69zGKHAf9Q=; b=daFkjcDI0WWhUba7I8/GxV3em+vRqlDMCH/Oy17Ok1xkCa3W5RL7yOY0kFoKSJRICvwFX3EjIgkAou78sihzHlnog4yptrulRCpaHIjQxx6IZbeye06aR+SqOqGN4mk3f6w7SIt2wRh2WE5kl7BbtIr16FRAHHZ9D+y2vxkaKfg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from brijesh-build-machine.amd.com (165.204.77.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22; Mon, 31 Jul 2017 19:31:25 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Tom Lendacky , Ard Biesheuvel , Brijesh Singh , Laszlo Ersek , Jordan Justen Date: Mon, 31 Jul 2017 15:31:12 -0400 Message-Id: <1501529474-20550-3-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501529474-20550-1-git-send-email-brijesh.singh@amd.com> References: <1501529474-20550-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR19CA0017.namprd19.prod.outlook.com (10.175.226.155) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-Office365-Filtering-Correlation-Id: 8557e372-454e-446b-0278-08d4d84abc1d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:EUQ+G+9gZ/naR5b5K2BVs5J7+tziI+DKr4f+AKeqwsgX1gouf8KPOS1aZK4FVki1RBXsNXv/rbUHtJqNWsZqRo1fyaJxArOjQTQoXE9eJK7NSsuON/eaZggKTJFQgflhtLeGkoL/DnkLHN9g5RRh+TVNBYk1sdTM/NwN6PzW3SCGsqb6VGK8nFnc8XKuLucNAqubMDy+mKr1GdoxoFz1dZN4G5rXOLXLQU67n1UnVJ007Je4QmjeZ7Ku94kMBhq27HDVzZSO9s19ZfwPekyMJVwDeKCu7RsIoe0evjzbuMta9EZX/WTmFe55LhpvTq5b86X7Qf0m4ZZvDPSQSdGMC8csgMgtreKB/LXu0W6QxRM6fp0aapQF+7rpoBRl7Ma/gip5B1qMMPHkENEI6E99aby4D/4MgxDJzq2n/tXAW1i8x17Nxsy7kDrNP+LqPGJhYbPD0mbCn7xSKvkKfkRJJS7GoVa/zTN4dsWd0YdUxpQY/cCY9eLBILB5XjAa+l+Xev53anHDI/LQEBjtoB+PT+JTdTHgUf3EVyAhW2Vba+LMWy1UPAXHnKN9jN4jtE9tRgJi1xkGPZU0aOtM8xs/A/XhsiLYlFgiwH0zryaS3cJwpE1uf9DASs1mCL9fS0UUu3aJVQvKJ21EKsiGko/P48hVrGnpZHjthaDQ4Bf+gUrXiN/G7j3vu+oKF6UeYm2CEQqKWwqN6eOeUavUaV5PnmHKYYthz85dVj8pR+jUcg5t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ec0GnqHNM7TwHVImhToWKVMSojoc6Ten/ej07NN1GD9xin+tHCx3ZBVF7SEQ4PAXu8OvlK9Atj/f/79GBPo9HzMRHb7wG2X5Av/K3N+/Ug3wL6YRm3SEqQM36gtLRWYKqNAArD6q+hn2kCotV9gswLfYHwlEsC4840ApeBDh541ieTWQKfCYkiqJs2JNZ3FOrjoWVNh4W2GU34hYW3zjKzgHRzb+oy/Kdjc04+Rm/q1ZxI4KcdWW5L X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 4:co8it7R8+9N6QF/cMpdPbyKRz+LuE7IC/LSWX4YIhY?= =?us-ascii?Q?PmEJ0HnXP10/2Gs2pT+GWsWO8lf6LCklV/wpi1ymyeCsjcPAfScou8nF00Zj?= =?us-ascii?Q?4mbbG1VBuSPXv83u5iILlHr4xwbZCbMNZ5IUMqGwS60ve0kYG+zfkStXMtix?= =?us-ascii?Q?ldbKkb7IoYV+QlZo3gIZOyRu6PBbTkqACmO8zRkzcM/N9RE1Gb5LSNYJtpY3?= =?us-ascii?Q?Txj6qCYJkeX3avxLlxwr4AlLX9s7Xzn3+CtiGP7SGHlc2bAmDbkVhk9zKk3J?= =?us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Wp4QNFqkPvX9WkkoS3ZgeYeIJcNF6O9s+9NdVkCt+OU?= =?us-ascii?Q?g/RFXB4pLviTIeD0CnWNdOBZLtTkTfeZE92dSZ8+fP3S2fFxTBktf0n+nyPy?= =?us-ascii?Q?pVtsUtQdhetgHHM2U=3D?= X-Forefront-PRVS: 03853D523D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39840400002)(39860400002)(39450400003)(39850400002)(39410400002)(39400400002)(189002)(199003)(47776003)(4326008)(7350300001)(101416001)(50986999)(33646002)(478600001)(66066001)(2361001)(25786009)(76176999)(189998001)(54906002)(6116002)(3846002)(5003940100001)(86362001)(38730400002)(110136004)(53936002)(2351001)(97736004)(6486002)(106356001)(48376002)(7736002)(50466002)(36756003)(50226002)(42186005)(81156014)(305945005)(68736007)(81166006)(6916009)(2906002)(2950100002)(53416004)(6666003)(8676002)(105586002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:brijesh-build-machine.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:IS1ILW0TczWziFr4NOtLfEiqbImSXlhfD4gdgT09z?= =?us-ascii?Q?VqFUOSIhpRrejDT5kqLLbdGgmFzZARzLqkkGu7PpbCIP+BvEN7ze4nbpZGjp?= =?us-ascii?Q?rQoZP14KyeE2w4PgY4WqdAPrZa7PpHPYT+g72gUOFVqHsinpouNSEIcKJN+F?= =?us-ascii?Q?U47rsV4JQQDV9fSc29AvB452WIcr7XIgWhfcnk5Xh5rqJC0M4C2YNpoXDkib?= =?us-ascii?Q?r+04aQ5l1ovkut7iRrWkCZ9yvueETOCMDyFkXfhRxhKtuY/3u3d96SapX2OR?= =?us-ascii?Q?nRrEwLQlWgQiSPb4j6+kQv7nbLUBOq7rxcnICP9eITTm+4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zXy5QT1WrJESt2w7wqrWF+TG5H5A8cKhZBGw+4?= =?us-ascii?Q?rCyRKIBidBk0qZio25bWbEk+Iz0FOPG0RVmLBu2ebZZyJW0f2uxEFCIUnU3X?= =?us-ascii?Q?FTSU/griSigvJfc99vXq5k=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 6:Z2Dq79yDpxApusbAct2O5/YZylUrbmkoAwXnU8NunZ?= =?us-ascii?Q?dYP45EYLHuLiWFk0PQz3N4JJgZL7xtY6cJadMOl16M8radn2UjmWqyaBEEvk?= =?us-ascii?Q?cFvHPqe38SzS8E9YE6aw9UViyQ2yuTTxq6E5/ZmAaMolT3BH8GkgaXrvKkcp?= =?us-ascii?Q?yzFbMDYPgd88Erf5w4UfVDBcoEritO+3NLbey3d7dx0EMCZ4dX//Qnbcj5G+?= =?us-ascii?Q?6+CoLFrNiIsjGHlNtY8YiZx5phwl9scEqacZAonYgU69ix189ox0I4uRVd3U?= =?us-ascii?Q?KmWanjlLltnNLjJib67gLBDBScMguCkb7rsjo8ONXaj7nOl4D8CIeMQmd3j9?= =?us-ascii?Q?SbkFv+kSQFORPWFqfrBEEmvcPrP9+F2KGZxy24KlBTqv7k8rzA9vLRcwSdUw?= =?us-ascii?Q?BofCDRxafUfnbQGiLRoz0VV1Uuh86Of2rNyq7ArFAGr3pRCbTT/LmIsHBg9V?= =?us-ascii?Q?EH8YxIaoArCXubApEF3PYuqyCQkD1b4UbmsPXVVxHxOQ6zIX1jJJsK8mBFYK?= =?us-ascii?Q?/n3teNGRJlPRmrW9f2tchkQMmCvfMLVju+4/Q4L3pMfctGtqkkwW+LMFg51p?= =?us-ascii?Q?TyLUFM0Lw0c1Ygg82GLDV8pevvjy6UhVs0HPciwM8R8Ny9JoIZo87W6kgvXK?= =?us-ascii?Q?QyI2BVMIORLbckbVHItVXfkanyb1Qz2uQRFqoTWdKBkeCl/orVuwswExA9Ik?= =?us-ascii?Q?0JVkzhxU4M8FRb6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ayLoo9mJr9yuzRLSLoAWQRz8zDoZBIU8/RCDIYGcU4ja2krv7FZSn+bA8fH66yrL4LTNeGwKS667rc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2017 19:31:25.7373 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [PATCH v1 2/4] OvmfPkg: IommuDxe: Provide support for mapping BusMasterCommonBuffer operation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 19:29:20 -0000 Content-Type: text/plain The current implementation was making assumption that AllocateBuffer() returns a buffer with C-bit cleared. Hence when we were asked to Map() with BusMasterCommonBuffer, we do not change the C-bit on host buffer. In previous patch, we changed the AllocateBuffer() to not clear C-bit during allocation. The patch adds support for handling the BusMasterCommonBuffer operations when SEV is active. A typical DMA Bus master Common Operation follows the below step: 1. Client calls AllocateBuffer() to allocate a common buffer 2. Client fill some data in common buffer (optional) 3. Client calls Map() with BusMasterCommonBuffer 4. Programs the DMA bus master with the device address returned by Map() 5. The common buffer can now be accessed equally by the processor and the DMA bus master. 6. Client calls Unmap() 7. Client calls FreeBuffer() In order to handle steps #2 (in which common buffer may contain data), we perform in-place encryption to ensure that device address returned by the Map() contains the correct data after we clear the C-bit during Map(). In my measurement I do not see any noticable perform degradation when performing in-place encryption/decryption on common buffer. Suggested-by: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Laszlo Ersek Cc: Jordan Justen Signed-off-by: Brijesh Singh --- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 190 +++++++++++++++++--- 1 file changed, 164 insertions(+), 26 deletions(-) diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c index cc3c979d4484..5ae54482fffe 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -28,7 +28,127 @@ typedef struct { EFI_PHYSICAL_ADDRESS DeviceAddress; } MAP_INFO; -#define NO_MAPPING (VOID *) (UINTN) -1 +/** + + The function is used for mapping and unmapping the Host buffer with + BusMasterCommonBuffer. Since the buffer can be accessed equally by the + processor and the DMA bus master hence we can not use the bounce buffer. + + The function changes the underlying encryption mask of the pages that maps the + host buffer. It also ensures that buffer contents are updated with the desired + state. + +**/ +STATIC +EFI_STATUS +SetBufferAsEncDec ( + IN MAP_INFO *MapInfo, + IN BOOLEAN Enc + ) +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS TempBuffer; + + // + // Allocate an intermediate buffer to hold the host buffer contents + // + Status = gBS->AllocatePages ( + AllocateAnyPages, + EfiBootServicesData, + MapInfo->NumberOfPages, + &TempBuffer + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // If the host buffer has C-bit cleared, then make sure the intermediate + // buffer matches with same encryption mask. + // + if (!Enc) { + Status = MemEncryptSevClearPageEncMask (0, MapInfo->DeviceAddress, + MapInfo->NumberOfPages, TRUE); + ASSERT_EFI_ERROR (Status); + } + + // + // Copy the data from host buffer into a temporary buffer. At this + // time both host and intermediate buffer will have same encryption + // mask. + // + CopyMem ( + (VOID *) (UINTN) TempBuffer, + (VOID *) (UINTN)MapInfo->HostAddress, + MapInfo->NumberOfBytes); + + // + // Now change the encryption mask of the host buffer + // + if (Enc) { + Status = MemEncryptSevSetPageEncMask (0, MapInfo->HostAddress, + MapInfo->NumberOfPages, TRUE); + ASSERT_EFI_ERROR (Status); + } else { + Status = MemEncryptSevClearPageEncMask (0, MapInfo->HostAddress, + MapInfo->NumberOfPages, TRUE); + ASSERT_EFI_ERROR (Status); + } + + // + // Copy the data from intermediate buffer into host buffer. At this + // time encryption masks will be different on host and intermediate + // buffer and the hardware will perform encryption/decryption on + // accesses. + // + CopyMem ( + (VOID *) (UINTN)MapInfo->HostAddress, + (VOID *) (UINTN)TempBuffer, + MapInfo->NumberOfBytes); + + // + // Restore the encryption mask of the intermediate buffer + // + if (!Enc) { + Status = MemEncryptSevSetPageEncMask (0, MapInfo->DeviceAddress, + MapInfo->NumberOfPages, TRUE); + ASSERT_EFI_ERROR (Status); + } + + // + // Free the intermediate buffer + // + gBS->FreePages (TempBuffer, MapInfo->NumberOfPages); + return EFI_SUCCESS; +} + +/** + This function will be called by Map() when mapping the buffer buffer to + BusMasterCommonBuffer type. + +**/ +STATIC +EFI_STATUS +SetHostBufferAsEncrypted ( + IN MAP_INFO *MapInfo + ) +{ + return SetBufferAsEncDec (MapInfo, TRUE); +} + +/** + This function will be called by Unmap() when unmapping host buffer + from the BusMasterCommonBuffer type. + +**/ +STATIC +EFI_STATUS +SetHostBufferAsDecrypted ( + IN MAP_INFO *MapInfo + ) +{ + return SetBufferAsEncDec (MapInfo, FALSE); +} /** Provides the controller-specific addresses required to access system memory from a @@ -113,18 +233,6 @@ IoMmuMap ( } // - // CommandBuffer was allocated by us (AllocateBuffer) and is already in - // unencryted buffer so no need to create bounce buffer - // - if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer || - Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) { - *Mapping = NO_MAPPING; - *DeviceAddress = PhysicalAddress; - - return EFI_SUCCESS; - } - - // // Allocate a MAP_INFO structure to remember the mapping when Unmap() is // called later. // @@ -144,6 +252,25 @@ IoMmuMap ( MapInfo->DeviceAddress = DmaMemoryTop; // + // If the requested Map() operation is BusMasterCommandBuffer then map + // using internal function otherwise allocate a bounce buffer to map + // the host buffer to device buffer + // + if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer || + Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) { + + Status = SetHostBufferAsDecrypted (MapInfo); + if (EFI_ERROR (Status)) { + FreePool (MapInfo); + *NumberOfBytes = 0; + return Status; + } + + MapInfo->DeviceAddress = MapInfo->HostAddress; + goto Done; + } + + // // Allocate a buffer to map the transfer to. // Status = gBS->AllocatePages ( @@ -178,6 +305,7 @@ IoMmuMap ( ); } +Done: // // The DeviceAddress is the address of the maped buffer below 4GB // @@ -219,18 +347,25 @@ IoMmuUnmap ( return EFI_INVALID_PARAMETER; } - // - // See if the Map() operation associated with this Unmap() required a mapping - // buffer. If a mapping buffer was not required, then this function simply - // buffer. If a mapping buffer was not required, then this function simply - // - if (Mapping == NO_MAPPING) { - return EFI_SUCCESS; - } - MapInfo = (MAP_INFO *)Mapping; // + // If this is a CommonBuffer operation from the Bus Master's point of + // view then Map() have cleared the memory encryption mask from Host + // buffer. Lets restore the memory encryption mask before returning + // + if (MapInfo->Operation == EdkiiIoMmuOperationBusMasterCommonBuffer || + MapInfo->Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) { + + Status = SetHostBufferAsEncrypted (MapInfo); + if (EFI_ERROR (Status)) { + return Status; + } + + goto Done; + } + + // // If this is a write operation from the Bus Master's point of view, // then copy the contents of the mapped buffer into the real buffer // so the processor can read the contents of the real buffer. @@ -244,9 +379,6 @@ IoMmuUnmap ( ); } - DEBUG ((DEBUG_VERBOSE, "%a Device 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n", - __FUNCTION__, MapInfo->DeviceAddress, MapInfo->HostAddress, - MapInfo->NumberOfPages, MapInfo->NumberOfBytes)); // // Restore the memory encryption mask // @@ -254,9 +386,15 @@ IoMmuUnmap ( ASSERT_EFI_ERROR(Status); // - // Free the mapped buffer and the MAP_INFO structure. + // Free the bounce buffer // gBS->FreePages (MapInfo->DeviceAddress, MapInfo->NumberOfPages); + +Done: + DEBUG ((DEBUG_VERBOSE, "%a Device 0x%Lx Host 0x%Lx Pages 0x%Lx Bytes 0x%Lx\n", + __FUNCTION__, MapInfo->DeviceAddress, MapInfo->HostAddress, + MapInfo->NumberOfPages, MapInfo->NumberOfBytes)); + FreePool (Mapping); return EFI_SUCCESS; } -- 2.7.4