From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0050.outbound.protection.outlook.com [104.47.41.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3132921E3EA67 for ; Thu, 14 Sep 2017 04:05:45 -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=e13vmjhmlYr+r5r3iDawTH0Hk5kk/QFxtyHnxvybTf4=; b=jOasMtewZ7OrW3o3eLZsERYWRlelg0z3slFbCbKZRK1+Fs8E8RkYmAQFrKnJCaNax8XgNTXBIYjJXtzfeeWQclY9dPQ3cvHPae/sJ06Z9F7dGyu7H1LBe66Sor9RRbHhSokgiqnrUPC2CY4vj+tfc7vPMx/4bzRC1+uhNHE37Jw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from ubuntu-010236106000.amd.com (165.204.78.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.20.35.12; Thu, 14 Sep 2017 11:08:42 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Ard Biesheuvel , Jordan Justen , Tom Lendacky , Laszlo Ersek Date: Thu, 14 Sep 2017 06:08:22 -0500 Message-Id: <20170914110822.112540-9-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170914110822.112540-1-brijesh.singh@amd.com> References: <20170914110822.112540-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR08CA0083.namprd08.prod.outlook.com (2603:10b6:404:b6::21) To DM2PR12MB0156.namprd12.prod.outlook.com (2a01:111:e400:50ce::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5625d308-02de-4d51-06bb-08d4fb60f5e8 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)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM2PR12MB0156; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 3:tLnpstgG/ze5KkQ4bGsyCJSilnRZU4N94FpRKQfNdxZnb8dyD0QqxsuwQGnxw6C8SiBU+T9Pcwap3WVJxoYoh8/4ZNkUc9IaU74d7EtjxupXhNCFJNjUS1MQpPa6lCFF7vdVDxFGAN9Hp4ykPI7EhAObXGy6OtAk2K2qJQ73mFtJWzkB6mir1iROT94qLMcGnGPX2A7P1gNFjXjvGU8NGjOQ3gUZX3AgxJMT6BFNuW5vuCEjF5R9P2zccY+1DJiR; 25:TIuHmZJOdOUPTF1yL6FjNMzpUjpcow0uIYRYrVhV6wj8Jc8D712nmFeBEckFb3plHhPHzcS7xHja0QXbF0eWHyVqmjjrIqZwztMeY4e7F/UYIgirSkMFOUg+U9iTsQwgovAOjExH6kZHBNKd9Ix/UidClw4sWg8NYWhxoGlzMuZUxki5q2LWvTHMPK25nunvarAIgoIj6fgA/VuUx4Sg4s+iQGKJ9gw7u6xhBPh4WgPcyywg5eF5ogkMIiuZFx1bsSPeMLNE1sLOXcu+94P9yS/g8hyRF4V2qV92TKM3GzwnsBganPUiBbXoP8lC957Um3aFq5JMT/dSNeOVGF0nDQ==; 31:GcjUKQ5e/aAU68FJxPxOEorFTP0IwEJVyBz2i2uEFW8OIkzPzC0m/+GM4vXiEanvP3w/eFtq9sB+wobj9x3EEgQ1nJGmzJ+dsk97ER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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)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(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: 0430FA5CB7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(189002)(199003)(189998001)(50986999)(76176999)(105586002)(106356001)(33646002)(2361001)(2351001)(5660300001)(6666003)(6916009)(2950100002)(6116002)(25786009)(36756003)(1076002)(101416001)(68736007)(3846002)(53416004)(16586007)(6486002)(478600001)(97736004)(50226002)(110136004)(81156014)(47776003)(48376002)(16526017)(81166006)(54906002)(8676002)(8936002)(7736002)(316002)(305945005)(2906002)(4326008)(53936002)(86362001)(5003940100001)(50466002)(66066001)(344415003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0156; H:ubuntu-010236106000.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; DM2PR12MB0156; 23:2Q3O/2Z64EarMhXy6qNJjX4bxyGPokdIok3iHaDpx?= =?us-ascii?Q?Q5cCfe6mk3SQxsdQq9rVxkHhuKQYo1+skpxK34yi4LwjOERcgYRnjuXM0DmL?= =?us-ascii?Q?a5c0n8UCMkeYqDMYXlRw5SzFfuaJID6XaijSJONWtW+C8XfjYeBkU0FPMAtn?= =?us-ascii?Q?hy9bcU0TR34DwI5ShvMve+l0jTyQvhyM5vOGwonMszuDcVDltVUdpuDRehnc?= =?us-ascii?Q?iA7Rxrx7CKxpvLzNBq1ZWqDhATnkebv5ENjRmYpqbh9VxJwxuRLDd4XJUXRl?= =?us-ascii?Q?WNAwYP+ShVlP8VYFON1oO/Hsa8G71TBoSu8F4F8watKz7dUs7y0H39vb/QlS?= =?us-ascii?Q?vxYeNJSeYgrjPeq0nGC05ni8T2MjC0O41N2+u+hkRxCQ2KbY+xN1yiTmGOwF?= =?us-ascii?Q?oGUArSQ+xEPTyyNfn0qDka7YaUUFJyBJfDOIzousDBdW19CwJCXmFnraVDQQ?= =?us-ascii?Q?LZDRmWu8j4822FEsQS20an1TvuJpt38kNgWobqnPIWQUuJmAO3FWux7IGwVc?= =?us-ascii?Q?A6W9gCagNuULxG6OfDwLzWVgi611F1wrWYHAxcvSm+vEGK/013LfShTyL19N?= =?us-ascii?Q?M41aXa6jvbPwzP9pa9d363WHEPSiODMUVFAb5EMmqjEL9SD440Q735SYGVVP?= =?us-ascii?Q?20ecennX/3uPsogyh/0IkcWp1/K6GaI1BdIe5To/tiLOAr8m1S0Fe2JNBi2G?= =?us-ascii?Q?0xhk35Tt8aucuCQbbhKF9gtzeaKXZhvvX7tuDhFZa0cKIwS6DjglanUL6pIO?= =?us-ascii?Q?WaHJ68SfjYEFpNKcHaae0bl1wYdhRgj0V0ERMwuuoO3A2XGQnpH4VjnO62vU?= =?us-ascii?Q?WVDWaLcnT1oK147Vz4lYxK8giUVN5n8wkbmt2+mi3eMvPdiB7n0VUt0/jqrR?= =?us-ascii?Q?paueOPq5q7g3snLpm8lXzu0cI2EDrKhnE740sTah/S4PqpTAf/cW8bJ6KkQ7?= =?us-ascii?Q?QyX+rrxdYmRDIvFgQFuBKkjwvGuUwvh66vLW2nfoJaPhWi/As+10bxHLpXBw?= =?us-ascii?Q?z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uACuDMbCoZWjpM1g2MhJWgvOYAeNpHWVlXtnQ0XQJgLDoKJhnyUdXyKyhx3WOS+Bwdj4Yc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0156; 20:UXf0J6wY68EQV+Il0wuFsuj1kfyynRT60MVVIBiGys5xhk8p5StjssAFcXGZocwzbgBu7zRxRdTUmSSBUQd38KT8+C39eq7upfbXOvqiSoFsep+Y3rnTEd/MgRYDMUuTOQKCLTifdV/d8U1Muo93s/acvKkqpUct3D6+Mq4ERXF/DZ9xB89JPnxjjKVoM7EkzbSQCtkwwM4NX3rpz+PbBdhodwaRNZBTDeyRZpz1SKiWETyKesq0OUHkxiWbFd81 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 11:08:42.0732 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0156 Subject: [PATCH v3 8/8] OvmfPkg/VirtioNetDxe: negotiate VIRTIO_F_IOMMU_PLATFORM 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: Thu, 14 Sep 2017 11:05:45 -0000 Content-Type: text/plain VirtioNetDxe driver has been updated to use IOMMU-like member functions from VIRTIO_DEVICE_PROTOCOL to translate the system physical address to device address. We do not need to do anything special when VIRTIO_F_IOMMU_PLATFORM bit is present hence treat it in parallel with VIRTIO_F_VERSION_1. 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/VirtioNetDxe/SnpInitialize.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/VirtioNetDxe/SnpInitialize.c b/OvmfPkg/VirtioNetDxe/SnpInitialize.c index ffb3deefe00c..9dff04ce6071 100644 --- a/OvmfPkg/VirtioNetDxe/SnpInitialize.c +++ b/OvmfPkg/VirtioNetDxe/SnpInitialize.c @@ -562,7 +562,8 @@ VirtioNetInitialize ( ASSERT (Dev->Snm.MediaPresentSupported == !!(Features & VIRTIO_NET_F_STATUS)); - Features &= VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | VIRTIO_F_VERSION_1; + Features &= VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | VIRTIO_F_VERSION_1 | + VIRTIO_F_IOMMU_PLATFORM; // // In virtio-1.0, feature negotiation is expected to complete before queue @@ -602,7 +603,7 @@ VirtioNetInitialize ( // step 5 -- keep only the features we want // if (Dev->VirtIo->Revision < VIRTIO_SPEC_REVISION (1, 0, 0)) { - Features &= ~(UINT64)VIRTIO_F_VERSION_1; + Features &= ~(UINT64)(VIRTIO_F_VERSION_1 | VIRTIO_F_IOMMU_PLATFORM); Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features); if (EFI_ERROR (Status)) { goto ReleaseTxRing; -- 2.9.5