From nobody Fri Dec 27 02:44:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1503697437694201.15352881384342; Fri, 25 Aug 2017 14:43:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E830B2095DC99; Fri, 25 Aug 2017 14:41:14 -0700 (PDT) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0074.outbound.protection.outlook.com [104.47.36.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E0DF2095B9C1 for ; Fri, 25 Aug 2017 14:41:13 -0700 (PDT) Received: from brijesh-build-machine.amd.com (165.204.77.1) by DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Fri, 25 Aug 2017 21:43:47 +0000 X-Original-To: edk2-devel@lists.01.org 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=Rd6zM54aL5sXFOKdXOzdreScP0dvo2cpqFEf1U/809U=; b=dh+dLvhS5NB5rO+Bcq4KyMgjING+60wOHRHhoqLo8CDyYge+Bf2Nw/pWrDTXekH0EFieABtwJXhQvoFNFnk3WBNUAYGY5YXTTtiXwnjPHVVAMyarcnbKqJeQ3fLBrie9sqxwCgH8F7b/znnxkDCrcolwzhUaAVkOjvoSgXWDQcY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: edk2-devel@lists.01.org Date: Fri, 25 Aug 2017 17:43:33 -0400 Message-Id: <1503697414-6830-3-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503697414-6830-1-git-send-email-brijesh.singh@amd.com> References: <1503697414-6830-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0041.namprd22.prod.outlook.com (2603:10b6:301:16::15) To DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7945dbbc-8003-4b6b-2225-08d4ec025e72 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM2PR12MB0156; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 3:P2wVw8Ap7beMFnudmZRuiNeszuQEETM/1n0mH3sCOg0smC/l+Gpl97u9zzux2ZerFuvLl5Qn8vZnXZ9CqQmJUH+JZRAzZcnV9Un0G6ngBjvuuqgnuHllJtTkvlHINNMZYjrk+N+Pe5P2D2tgzdCBULmA4BhjMCWoxmvYjG7M9yRZ4G7I8kcmjAujCqeIAXQqIg5zazICisHFdha9B5o6TTvybq6UYUg2I5AfSd7/0Aglf//g0jj5gEmjYI1w0Lar; 25:DLtSVmDvuihNDjKWSjBZ2DZoCZw5j0VKJtkQi8V+gN9W9C3RCDJ0RjFUYwFPv0F1Zq4kd/6vST6FLh4scOfsU4ePG+fEuFaZsC/OjKH1HigKKUphRRWS/M3cNJMmocZmGb+akEt9YPHhAHNbHLRFipMgK2vRxJBUTGuD9tnQRALkVYHvLwfxBlY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WH1aqXNavmryiGpxcgmKHUKlESfgFAKb1f7n0YwNA5d7g08fAzUOive2AoLjoNBV2r/al23X68PsN6YdbIPlDfU8+1CHWtFCVNrjNA+MXkWQFP9H4SCqUYv2DFlTGPB2S+V0kMTfbNW4W2JeyDI4ya3Umwtyox20FIpchcNpExm7uLRmHopwjKNaDt0ubBCX/TuG4xT/4WJMElzDSAVaqN3QQs7+8I05ig0wKOkTWPmhieKIhPDMg5BEhFnwwQ== 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)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR12MB0156; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR12MB0156; X-Forefront-PRVS: 041032FF37 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(199003)(189002)(97736004)(54906002)(86362001)(47776003)(5660300001)(110136004)(48376002)(4326008)(7736002)(305945005)(53936002)(68736007)(105586002)(50466002)(5003940100001)(6486002)(7350300001)(2950100002)(8676002)(76176999)(101416001)(6666003)(6116002)(50986999)(478600001)(106356001)(66066001)(2906002)(25786009)(81156014)(53416004)(189998001)(33646002)(50226002)(81166006)(3846002)(36756003)(42186005)(2361001)(2351001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0156; H:brijesh-build-machine.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0156; 23:VIFEaYaUJRtt472zH/SY/ksYuGVpekSq/4TuUPD/O?= =?us-ascii?Q?eLq4b+fy0C2nzr1dx00g8Qd8qMjl3wnk3xonPlgmvtFO+ZvDERnEgRUxRl6P?= =?us-ascii?Q?1vnk+mS6ugs/m/sKgmQFWZm9VokEW6/zvtCV6Xs6yFy1jOoWWxD1eSIQXuEo?= =?us-ascii?Q?gg+oazdGqq6nXNx+cEO5UIfvtjAP8jmUQmUxe/L3nZfo4pXuyL7o8kGx8rVC?= =?us-ascii?Q?2CWTnDHwPqDG+ap0boNxE6Gq7LYIlaYOE50C0EOtO+8sQegNI3MOHAU3HNs4?= =?us-ascii?Q?n3lA/J+gQ/EtRf74mNOjn8Juibi07CNlhekCJXwiZ/qHIOzvLR8zo1AzKhFP?= =?us-ascii?Q?46KQyZtt8b5IHaC3Ik4Xc6ZBxrKpoKoaVf4NkAFhQ15hSLngT9Gqkw2ZxNcA?= =?us-ascii?Q?rMv1Pd5JaPBHdaYbvxYsf3+Hqv7Tvs7I+dH9twgNy8PXF+wfUEsxzDqt+Khv?= =?us-ascii?Q?QhWXti6pNvnCluHJbP7lN3doS9NzRqBBjWZ8Bxp9wsNnISvnai1xWGEj30SZ?= =?us-ascii?Q?3dXxrgXTw+/CZw/58BO7b0AXf/Lnv1aUCfJ1Nbq4OybkXi5bK+Y/YkYnhyyI?= =?us-ascii?Q?o6DuWjLx/Pjz+GhOQ26cfuIQvVTek9M+iARZNzeE25yUxXLpl7HDSY0ZpxIb?= =?us-ascii?Q?plGzhM9Y914CJBCBHyh66GwuSv0X0dqOo/PWLxWRJk8U1PXyshKjPrdKp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Zh6PYz/pUYsaIuI5CX/tyOuQ==; 24:7KmVwd+P+JAOkmu7NFxNmytFsRucflEvF3mfbxw/Z4YAczTUk36v1QCYpwt6tLwki7qihG2/Uf0DtWciD3OqQOFTu/X9rC9SKaw+hWHYCNc=; 7:sx9+C9L0tr3Gq+qWZDX64nyunjSv+olTvrwIpOR5SBqVphY0oOAoeFKhx0fUp/jAODDsPVDgs4OVnVmhWt9uN586haDStrddXt3Pnab6Eb2Xl+rJT6G6Cu2MiDWaDtvNYQ4VytA+U3AWHHQxP67u+ZxYb9gjDlcvFbhRGBjjlW+YD08nxfOJGZskweId8ObeUy5ASav2UZ3cRxXL+cRS5v8aoAkYed9ovKlU83SNdGg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:HGdhRLjxGkxO/NxaDrv7kBCbktekJ5RCE/OHtz2q2DIAT9dcKhuXhrvJv8hni6Awt/wNQw57aQJqD7bNVAADxQX0zpLPlNW5iHJpmfsI9JthLA5zUPZ2T6tpvEL/eDnGom/4xNxj6VB/nuCBF0nTNYyS6qI5ChDyVncHwnTIp8qxINYr8XZAMMC5xv4sG8ys7OiCx3852NoJMtlK9rxN/D6gnLohEVHoTyOF2JjsjUyyVuqULoWYiTmcnT8QBNur X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 21:43:47.7522 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0156 Subject: [edk2] [PATCH 2/3] Ovmfpkg/VirtioBlkDxe: map virtio-blk request and response buffers 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: , Cc: Jordan Justen , Tom Lendacky , Laszlo Ersek , Ard Biesheuvel Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When device is behind the IOMMU, driver is require to pass the device address of virtio request, response and any memory referenced by those request/response to the bus master. The patch uses IOMMU-like member functions from VIRTIO_DEVICE_PROTOCOL to map request and response buffers system physical address to the device address. - If the buffer need to be accessed by both the processor and a bus master then map with BusMasterCommonBuffer. - If the buffer need to be accessed for a write operation by a bus master then map with BusMasterWrite. - If the buffer need to be accessed for a read operation by a bus master then map with BusMasterRead. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Tom Lendacky Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh --- OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 157 ++++++++++++++++++-- 1 file changed, 143 insertions(+), 14 deletions(-) diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/Virtio= Blk.c index 663ba281ab73..ab69cb08a625 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -232,7 +232,8 @@ VerifyReadWriteRequest ( =20 @retval EFI_DEVICE_ERROR Failed to notify host side via VirtIo write= , or unable to parse host response, or host resp= onse - is not VIRTIO_BLK_S_OK. + is not VIRTIO_BLK_S_OK or failed to map Buf= fer + for a bus master operation. =20 **/ =20 @@ -249,8 +250,16 @@ SynchronousRequest ( { UINT32 BlockSize; volatile VIRTIO_BLK_REQ Request; - volatile UINT8 HostStatus; + volatile UINT8 *HostStatus; + VOID *HostStatusBuffer; DESC_INDICES Indices; + VOID *RequestMapping; + VOID *StatusMapping; + VOID *BufferMapping; + EFI_PHYSICAL_ADDRESS BufferDeviceAddress; + EFI_PHYSICAL_ADDRESS HostStatusDeviceAddress; + EFI_PHYSICAL_ADDRESS RequestDeviceAddress; + EFI_STATUS Status, Ret; =20 BlockSize =3D Dev->BlockIoMedia.BlockSize; =20 @@ -278,9 +287,89 @@ SynchronousRequest ( VirtioPrepare (&Dev->Ring, &Indices); =20 // + // Host status is bi-directional (we preset with a value and expect the + // device to update it). Allocate a host status buffer which can be mapp= ed + // to access equally by both processor and the device. + // + Status =3D Dev->VirtIo->AllocateSharedPages ( + Dev->VirtIo, + EFI_SIZE_TO_PAGES (sizeof *HostStatus), + &HostStatusBuffer + ); + if (EFI_ERROR (Status)) { + return EFI_DEVICE_ERROR; + } + + // + // Map virtio-blk request header (must be done after request header is + // populated) + // + Status =3D VirtioMapAllBytesInSharedBuffer ( + Dev->VirtIo, + VirtioOperationBusMasterRead, + (VOID *) &Request, + sizeof Request, + &RequestDeviceAddress, + &RequestMapping + ); + if (EFI_ERROR (Status)) { + Status =3D EFI_DEVICE_ERROR; + goto FreeHostStatusBuffer; + } + + // + // Map data buffer + // + if (BufferSize > 0) { + if (RequestIsWrite) { + Status =3D VirtioMapAllBytesInSharedBuffer ( + Dev->VirtIo, + VirtioOperationBusMasterRead, + (VOID *) Buffer, + BufferSize, + &BufferDeviceAddress, + &BufferMapping + ); + } else { + Status =3D VirtioMapAllBytesInSharedBuffer ( + Dev->VirtIo, + VirtioOperationBusMasterWrite, + (VOID *) Buffer, + BufferSize, + &BufferDeviceAddress, + &BufferMapping + ); + } + + if (EFI_ERROR (Status)) { + Status =3D EFI_DEVICE_ERROR; + goto UnmapRequestBuffer; + } + } + + // + // Map the Status Buffer with VirtioOperationBusMasterCommonBuffer so th= at + // both processor and device can access it. + // + Status =3D VirtioMapAllBytesInSharedBuffer ( + Dev->VirtIo, + VirtioOperationBusMasterCommonBuffer, + HostStatusBuffer, + sizeof *HostStatus, + &HostStatusDeviceAddress, + &StatusMapping + ); + if (EFI_ERROR (Status)) { + Status =3D EFI_DEVICE_ERROR; + goto UnmapDataBuffer; + } + + HostStatus =3D HostStatusBuffer; + + // // preset a host status for ourselves that we do not accept as success // - HostStatus =3D VIRTIO_BLK_S_IOERR; + *HostStatus =3D VIRTIO_BLK_S_IOERR; =20 // // ensured by VirtioBlkInit() -- this predicate, in combination with the @@ -291,8 +380,13 @@ SynchronousRequest ( // // virtio-blk header in first desc // - VirtioAppendDesc (&Dev->Ring, (UINTN) &Request, sizeof Request, - VRING_DESC_F_NEXT, &Indices); + VirtioAppendDesc ( + &Dev->Ring, + RequestDeviceAddress, + sizeof Request, + VRING_DESC_F_NEXT, + &Indices + ); =20 // // data buffer for read/write in second desc @@ -311,27 +405,62 @@ SynchronousRequest ( // // VRING_DESC_F_WRITE is interpreted from the host's point of view. // - VirtioAppendDesc (&Dev->Ring, (UINTN) Buffer, (UINT32) BufferSize, + VirtioAppendDesc ( + &Dev->Ring, + BufferDeviceAddress, + (UINT32) BufferSize, VRING_DESC_F_NEXT | (RequestIsWrite ? 0 : VRING_DESC_F_WRITE), - &Indices); + &Indices + ); } =20 // // host status in last (second or third) desc // - VirtioAppendDesc (&Dev->Ring, (UINTN) &HostStatus, sizeof HostStatus, - VRING_DESC_F_WRITE, &Indices); + VirtioAppendDesc ( + &Dev->Ring, + HostStatusDeviceAddress, + sizeof *HostStatus, + VRING_DESC_F_WRITE, + &Indices + ); =20 // // virtio-blk's only virtqueue is #0, called "requestq" (see Appendix D). // - if (VirtioFlush (Dev->VirtIo, 0, &Dev->Ring, &Indices, - NULL) =3D=3D EFI_SUCCESS && - HostStatus =3D=3D VIRTIO_BLK_S_OK) { - return EFI_SUCCESS; + Status =3D VirtioFlush (Dev->VirtIo, 0, &Dev->Ring, &Indices, NULL); + + // + // Unmap the HostStatus buffer before accessing it + // + Ret =3D Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, StatusMapping); + if (EFI_ERROR (Ret)) { + Status =3D EFI_DEVICE_ERROR; + } + + if (!EFI_ERROR (Status) && + *HostStatus =3D=3D VIRTIO_BLK_S_OK) { + Status =3D EFI_SUCCESS; + } else { + Status =3D EFI_DEVICE_ERROR; } =20 - return EFI_DEVICE_ERROR; +UnmapDataBuffer: + if (BufferSize > 0) { + Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, BufferMapping); + } + +UnmapRequestBuffer: + Dev->VirtIo->UnmapSharedBuffer (Dev->VirtIo, RequestMapping); + +FreeHostStatusBuffer: + Dev->VirtIo->FreeSharedPages ( + Dev->VirtIo, + EFI_SIZE_TO_PAGES (sizeof *HostStatus), + HostStatusBuffer + ); + + return Status; } =20 =20 --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel