From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0040.outbound.protection.outlook.com [104.47.40.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 18C2C21D2E634 for ; Wed, 23 Aug 2017 05:20:37 -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=BL8utUKNh5PkzBm+YssswrjFN+WXQEHtPi03QYTshTI=; b=4x+F3GWmW2NT2gr7zrIFMSdwSI97R+3bomIa2eAv1Z46MvYRToI1rVjcWg/hIxgQEyGthpV2hvYzP7gMvkuTlOfBwYVpMejhIs7G0S7cR3clgX0MtWGdZqKR2j5G7ID079YcFKLRTAoSfatofAlA4bQ2QNun11U4ivOxMByZKFE= 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 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:08 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Ard Biesheuvel , Jordan Justen , Tom Lendacky , Laszlo Ersek Date: Wed, 23 Aug 2017 08:22:47 -0400 Message-Id: <1503490967-5559-24-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: 5c93408f-f0ae-441e-9c12-08d4ea21b6ca 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:CitpCChcCNeuFMN7otFfYxiDoNKuT0FssBaCJ9+TToNRxbu0owUEzhmKjt9F2h3nJGQVq8OQBlbUToz4J9wCLsm88MM3PZ72XNxN9j4ehkaihwhGDnYIv0V6A5PU82AA7quGyrJ6m9cmBX5U7/iSRrrPp+jgMLrSVpNWQrOzUu+O2c/J7nbQxmOocnDYfA4fEaSRL5IpNX63a+a5ZnOTCaRKdu0rjkTntpoiqJcitdbLpFXjCoprqZq8/k+L3/s9; 25:lfJDlLXejCRysVMwAU0cYMdZBC7dzPTr9Glrnq+Eh/Qulx+4v/9Zav/G8QHKXihnswtpmxgs4k98rsktVkmX3dKEAvhFdHQl496unfyh+h0tuA5rOVb8jYo85titVMQ459JhGs2Nnf7RI4d9pgZvjOyiV0t5r8epYmSlx/EFFINSTGTV4y9TfedXYqkZvaNXBKrETO+jtw+14pQRx3Vnks2Ou/8NOtpTY/hEfirD1KqyNDcdN1ngw7AoUm3AWyNyhhgphXYoZBAAWJC4sO/UmpTOcf+pVdkBv+t2Dypq87xk3pklrCzWG8aSXYuLHPqZb1WE8eJ1y6QH9NtFqRFs2g==; 31:gue7omRvZgbPJvMQWP3ZCQgshyhkaVbOdXwq+Xxm9hbdt0KboCPpXqeOd17NKvMDn7kro0UuydV8wiTpBxCGgF7ybbEVXvHN+MP2XpNEKZz+3YaufDe3+KVs6xJLNGzvLz6YWa4n57vA2UyEo29QP9YnKPKB8UeSA4CdMea+baf6wp9oeWUH33hSDP14wvbVA+1z5Dxrjcm5J27Rjl+r7F+lv7Bic4Y2rAaZprX+8B0= X-MS-TrafficTypeDiagnostic: DM2PR12MB0155: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:t07Q2ZJ8Ql1zK3+2gQz/4soasT+BVtYLxCPlFH73Kdo9ngTpJxoY8KZCM5VL2sQQZE3vgR4hfjYaD9HTiHfL6mIomc8SUWPbjmYz7AwNo5IkisaFmbYP/XXayq0aXEYJo+F674idgtFUhnyYpfkNVx90U7gacko9c6KOnsgSum/8AJ5YZluxze8Mrga0SlijAA/2k+FiMz0BL0N7dkh3Jl8XD7iOSwpgVnCzrjT+EOTQiEPmC7a5k9kR97LXlp22WnoDSuZ1gCY8oaWCIrLdr86gQw/X8BtGJTaGzaI8u3c7EIFj9dujkE6Twmq86jNtj+9YMh20cyQHWh/szryyotDvo1sIN5lZaG0Mz+f76eD775yFkT6Abc0H8k78Nsva70oQ6BSN2gfkeUssbkPopuplB3oS010GUTdEo64+yO2cluc6OUxdTWyaiNS23Y/r3ot5t0BCwzZv9FkCRdqeRVrsTFyHgZEOyE9S3b1Kly7sASDsglQMzkR+AgW4DNKx; 4:1H/9JEiV+hwV03xFt0Kcc8/DPd0s6fVnKKMRafy17QbM/jzJclMmc8LmXF/Nn0h9v6iVHsPlVhJANriM6ynfvjKQ6YCwe0jYKHLCayjJYOs6nXr6PMN9hhEXfsTVGBpLIFCvmseiwq4NoANiZcN8DENWjRWS6jKd622Usa2Iho+Tu9q3kVQSOO67uOvY7hzf8h6PxbewWr+ge5D2YX+xvjoYrnWuj43pUxmYXFRLnTKFX+CwVI4yXTngNZzmkfnNwSJhlR7cuSCXEKP9T6kOntu/bznu02KNHzTQjbRicxqpMQE7q/utRp8ETZQd/ohc8SSm4MrhiKqPTymv5DNCTA== 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); 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 (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0155; 23:zCzx88ZXdNCj8y6P4DtsNQPKeiDE52RuesyDlThq6?= =?us-ascii?Q?9f+6OlipNZyGu09A3A5UU+kVHAoVBvDdTsKK8PDIZhGyqGPjuvg5HRzdTZOn?= =?us-ascii?Q?F83ksfSWwlYXuR7DN5DTeVVkB8Hi39okXRPen3Ea9S7rrWhyL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1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:2QnftZ3LnTh7x+SlY+M4IOXkUva2Assz1gcxxnAcOEwoRpMiYYZZOkGJ9tikuY+DAIRYYKuRJbKoGJ+q/PVuYKI7OOJbmggVtVTOXWjvGvanBxNjzY5esNRF9Uk0ZFV0rjTMqjayTnKF8fXwFd+K4wsCTUAzLdo1nzHISwKZEELSMbv4VTY0BQK3AQ+egsavKKvLBOYX5xlDzGmrYdOuHM2lAOKiLJlyJ6vdkBem+I4DyTjWQ9rmjjx/8LYQETNA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 12:23:08.5759 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Subject: [PATCH v3 23/23] OvmfPkg/VirtioNetDxe: negotiate VIRITO_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: Wed, 23 Aug 2017 12:20:37 -0000 Content-Type: text/plain In previous patches, we have implemented IOMMU-like member functions in VIRTIO_DEVICE_PROTOCOL to translate the physical address to bus address and virtio drivers are updated to use those member functions. 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 --- 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 3d4eb70aa630..750cea10abe7 100644 --- a/OvmfPkg/VirtioNetDxe/SnpInitialize.c +++ b/OvmfPkg/VirtioNetDxe/SnpInitialize.c @@ -551,7 +551,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 @@ -591,7 +592,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.7.4