From nobody Fri Dec 27 02:25:43 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 1503491012272447.3469554963258; Wed, 23 Aug 2017 05:23:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 24FC221E49BBC; Wed, 23 Aug 2017 05:20:34 -0700 (PDT) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0052.outbound.protection.outlook.com [104.47.40.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CD99921D2E652 for ; Wed, 23 Aug 2017 05:20:28 -0700 (PDT) Received: from brijesh-build-machine.amd.com (165.204.77.1) by DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Wed, 23 Aug 2017 12:23:01 +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=D40x+5qW6PXsjHQ/ZZW/gzpQ9FiCu8Bd/oNcktmA3fQ=; b=r6rPL9HUPH8k46/6ohjtrva0qx0ULDBVhPSZsARlo/ugXAea/5wjsZeBH5Ps2ygqQWxQpC5YJBJgF/XwnBilLnQeKZSXC0v51nam27KElw4XTuN8OWKkWjBp0/EOx6XrzS9trH0+Jt29DqGJQ08CO2N7gNwxtPfzWkSU3nUpRS0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: edk2-devel@lists.01.org Date: Wed, 23 Aug 2017 08:22:32 -0400 Message-Id: <1503490967-5559-9-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503490967-5559-1-git-send-email-brijesh.singh@amd.com> References: <1503490967-5559-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR12CA0069.namprd12.prod.outlook.com (2603:10b6:3:103::31) To DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35610fa7-7aff-4666-bd09-08d4ea21b27a 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:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 3:SIXJCJo1NF8c4Dgi2bgSPYSJ+A9rKvus57a2GGXl6xCp7cMvTo7id+/FCdbea+HA/Ynz+MDUwfjBS7LFaFhDlA2hOoSOvgMVX8C3r3QY8hce08R04W84FfrU/lXxLCGUgEk9EIBaBimQ5oLXpj9dGT4RjEOChBs5bCIjCD/+9jAXKTSfn2Db29rhZ5O9GcsSzjcak91MtN3e7YT0zHrS9Mc/ERa5sxNOI/tla0N/uX8s7M+V1+6XywFMLeZ2LiDH; 25:WXF5j9qHeHTtrpTXHrEoca7Xm1h484XWjKwZSPjUuI7uIkbU363SVQkaFE+MSfqzIbkBuT/qJa62xds6LrmVzqxO2vtZrD7C159iXa7Z7K2j+gfG8XBhBy0HddWVxZnmyNZcYuEcIjW4aIuUnxoc0AhqjVKRVehYH+phnLcWs9Bq7m7gwqmczjCC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QCF2iFQfjbte52zIG+r0J+127w9bjMMUy8vcyo+Q+iufcXMf2KpM+elnblHOcoaJvHYTSHFQ9Zd/TY+xCZDzbuhm2MfTwZduRHehdcje8CXJVsoxZ0DrQWCku1bHiM2g72J/sPrLmVG1w5KdpPiRIwYDxDbtRJOOab00KtEnyCGUTqATK42tqdmvD9VVafxiQk/lGmM38EWvnTkF2VdtrlQqWAMZPK8q53UlZezw9nV2CVKWMpTrAoys0xFg== 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)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR12MB0155; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR12MB0155; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(189002)(199003)(305945005)(47776003)(97736004)(101416001)(110136004)(6666003)(189998001)(478600001)(7736002)(3846002)(66066001)(5003940100001)(6116002)(6486002)(48376002)(86362001)(105586002)(2950100002)(4326008)(106356001)(36756003)(6916009)(50466002)(2906002)(50226002)(42186005)(2351001)(33646002)(53416004)(25786009)(7350300001)(81156014)(76176999)(5660300001)(68736007)(54906002)(8676002)(53936002)(50986999)(81166006)(2361001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0155; H:brijesh-build-machine.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DM2PR12MB0155; 23:gE+Xo0NBYMm/F7Hb3ZLnQD5qbu+M13+Vpuy1sVCXN?= =?us-ascii?Q?PmXB5KXseeAQ3G3ClWJ+a0vIDd2VLTInaQdo/2a7XwG3ki/qAcdaC0l/zPmj?= =?us-ascii?Q?spZercfJ8pkhDJpItI+pxenkxv6l66KOEJHlOYRkVGbA/9Eofx9S8LOcZEf2?= =?us-ascii?Q?Lu3RkWZyjVlH4gesJR/ET1COmuP7arYb5fGNoaAvWwkZ7WIJrTeIbwn8hJtC?= =?us-ascii?Q?DpPgjp146pXE+gmxqVwtrCvEzghEiq0k+VnGLsPhjO6IuX4Jf26aiP7fVe90?= =?us-ascii?Q?znGQ8/bllYLcLyPV2GXbP0n6tNJpUGYfCX65zh3c5d30a2+75MCjsXEHagVv?= =?us-ascii?Q?StN9uFzHpwjm+45kQ/TCOLtwhpwN7SIJ7lDs6MPNM97D1DNjQkOv6ambCTeH?= =?us-ascii?Q?s0yxvKYY2GmTv6l+RxVZ+71DRZqs6F4vHfOiS4Jkmp4EbtbnVG9K/yLmwWVM?= =?us-ascii?Q?Ev+zNLYSQPX6FojQ/AsRWyl2YEGknWiu2BFAPI9Tuiq4/iiUsyhosE2BE9o8?= =?us-ascii?Q?M2KU8Be0UnVeHL5NKI/0RupNkZ1ldObvC286gR0XZuySnPYj0lJlo2yWtM+P?= =?us-ascii?Q?kQKLhoSitIp8CbLWZ7IawA4dLrDdVSHwd8NlGlUzs9+t0/59YrpluB21fQa4?= =?us-ascii?Q?Oz52vNflx1ulieyv8mn2mFFRcQK+a4nrfhP651gY9Kk2uuOcXiUc12Kya+K1?= =?us-ascii?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3l7okCvQ8cmr0VSdECx744+qnIQ3Ngua5UT3zashC4GDjPqIj9u1Pgs62GkZltuqiLRw==; 24:PNFF5xC6Ra2F4dlc9FLqWRB97qNsBbFeawBuibvNzbsi5+nvbFPEfb/6x84uWlUUuq1RWYdcXejSOCqtKWo2H1f4rnlGgrgLrGg5H3xqFjM=; 7:lCtwd+cFuXqhklBZGn817IZ4IOZls1Y62FusigVgimGiWHvMEz7FHZCo+K/HB1ZbNvrmSHlU9dhaAGEnFZhJkY9fGYapY8WnfZvqlVl5W8WlnvKQcepYzaJvmGAxwNYl7uXkZ6k2kfnA3h4F9oqDI1Y3LJIWK0ba99pccLttGutuyp92iprQOxmKpsUgK56tGgCveGtrzKTcCFSvcYOktKgd3qRjgy/KaHo5jy/E/Ao= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:ZLFheW3XyPmzCgkwvFTLy0QmZjH9UqJ4MPO9B3/0W7i24ZO0RhR8DazCPdBqqafgp7w4kWPWM7S/dpWg1z0W404yv0e8uLRUzzTlSfIn41tNDY81UE9HPlsC9+xCwveCzs7aEx+kXFPtqn8d26A+a7g3Oe6efYHWtK2/pe/Q91rpH/WWfWxMRsHxr2ivCvMc1KMlS2gwUH3BTmocAIFVmgIp5KgNW+MpJ3vNY9xYYbP7HiJSY7ovYDcLbPNgbIuW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 12:23:01.3572 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Subject: [edk2] [PATCH v3 08/23] OvmfPkg/Virtio10Dxe: add the RingBaseShift offset 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" virtio drivers use VIRTIO_DEVICE_PROTOCOL.MapSharedBuffer() to map the ring buffer host address to a device address. If an IOMMU is present then RingBaseShift contains the offset from the host address. Suggested-by: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Tom Lendacky Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh Reviewed-by: Laszlo Ersek --- OvmfPkg/Virtio10Dxe/Virtio10.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Virtio10Dxe/Virtio10.c b/OvmfPkg/Virtio10Dxe/Virtio10.c index ef9a00710668..e9b50b6e437b 100644 --- a/OvmfPkg/Virtio10Dxe/Virtio10.c +++ b/OvmfPkg/Virtio10Dxe/Virtio10.c @@ -498,11 +498,10 @@ Virtio10SetQueueAddress ( UINT64 Address; UINT16 Enable; =20 - ASSERT (RingBaseShift =3D=3D 0); - Dev =3D VIRTIO_1_0_FROM_VIRTIO_DEVICE (This); =20 Address =3D (UINTN)Ring->Desc; + Address +=3D RingBaseShift; Status =3D Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE, OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueDesc), sizeof Address, &Address); @@ -511,6 +510,7 @@ Virtio10SetQueueAddress ( } =20 Address =3D (UINTN)Ring->Avail.Flags; + Address +=3D RingBaseShift; Status =3D Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE, OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueAvail), sizeof Address, &Address); @@ -519,6 +519,7 @@ Virtio10SetQueueAddress ( } =20 Address =3D (UINTN)Ring->Used.Flags; + Address +=3D RingBaseShift; Status =3D Virtio10Transfer (Dev->PciIo, &Dev->CommonConfig, TRUE, OFFSET_OF (VIRTIO_PCI_COMMON_CFG, QueueUsed), sizeof Address, &Address); --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel