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 EA69521D2E62C for ; Wed, 23 Aug 2017 05:20:36 -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=k2F49mUvzgSgld7mnxLQZq9ybHsDZiARHWSQkJZrFJc=; b=KXDvY9V2aSmhBTM4FEa/psxzKEU8YKA00c0nLvgsMCyPaegVkMqh495nKHZIsQjTeH61CA0v1V5ZwHXFUoVivLbSk3oS8lNTIL1ki2CtWjP/0bNKS5e839eQhrkFnlZ12Hwe55Ow5dN3rsvlNl5PpjnOBb+nkoZGAzE+2i6wkcQ= 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:46 -0400 Message-Id: <1503490967-5559-23-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: e6b9aef7-f8c6-44d9-1598-08d4ea21b683 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:l5nzVSzbTyt9wBy7qWSx3+1X9E3UxSXlEePEvA9zkWUSVP/l3bGqMujoy8DqObamL5cCh/nJ80Vc92bdpKZD+m/7jgUNBHg1Ad+E+iZq79Nbd69wxLCrXPlNYNG+N2usTnv+e2YlSuhnYib25mub5oCzlV4W577BLGEv424Z70ZDeN0U4FPBlL464X0AOHn6OidWwwJkDiH8r40o2uUyyXcIfOP37nPCpWVOw7Uf8cOLQKddlT/r4jHPNQYnKSmx; 25:MN7L0Jem6NpXUVfGRflIP2dfnYBzB75Nxa2iUrmZ2wd5OFCFpnIteE8hwtp+e8UROFSZRGGn7HOHxQHD0dZIH8TlZF2vrpZE8DnMppxuPNRlOAY+1k78h6J0S9rT57oJUtNRXSRM48eQr0kt7HJhueHvLgngDyW5GhFi6DENDSKclv5JQLXsH1YTPlqm2ugJdhXWibkP5OQUj7PpFfmqjQzI2wy4xtNJFYBsPiprNm9J0P0thFaZoEjV3GDuZ9+zEos0hWwfVEx1NLHd2kKKsZn4hzsEnxjrM7OOeKFHhRXREhmyCB6cu2Gkwn0lIDCDJOjY2i5XwrPjFq6u0dR8lg==; 31:UcfJvdq8uQjbHonkXpAhBCVVLbWYpnNxJA3P0pOTz7lhMsa3i3fiaVUHzQa8U+XbdMp8vJNPDBlBJfoD58CxCVmoFBfoywILGoc2XZMAHolckaVWagRSvXjFhKVyTo25vY10yTP4dxM435vwdk3aalOHo3371haF48EwGoyKFVcE9fq0jKqufXNDQeAzJVDhuV3i67IKYcyzE+9C57+AKLltq8XsZD5QLi5ARvp1A6k= X-MS-TrafficTypeDiagnostic: DM2PR12MB0155: X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:4axyKLosZQ0c7cJzFL46vtYChQd/qneKNXfmfPhZ1CEhnCiKmvX5aB/RXwcFwB3E7O6dTots10rM5V7mwewwqjTMKV32EbfZq1FRXnlg1bVGj5STQ8FEm0uqvyqmMewIzTj9nidJ5drp4BmHUPTUNZsgk7qnjZKugg+B1D+EtfrC3pr2JANDG3/wtiEuh6ZRuH9ziFDdfSow37GdmhI/mm6+9qdVA2rZ/MjtQm463JXtkr11p5fH6lGUZZB8kliVHj+9UWdaQOEbIUe7XlUCpV5sCb0OUlKW2Tchi3Pg+A0sHkD0WruzRsXG0IPtFop4c/ueedcjs2TbtZRNezG8yXXBpuUyDJ8vccdSECkYEVa67FeGivuw9tQBuOKK85Nlun92kUWm2WrPU9f9FRFn3S8egCFsALA9zZLGqUMyaZkgayupF/zjnBhjj3nMS4ria1VWht1pZtB3jniFqg2SEoe/CDl0alDYK0ItbuC2aRjVGr6LDj1HmKT5RxNA5VTv; 4:2V1f+hz6YC80cPiq7Yq4LVc/bR5yfz5QlsPwiCMvw36ZHkOjYxG01KLtydutXJ1pT1gtYNWJRMqH1dL76jgVDTw3bb1mZ9N1hs+VC86mUxb0zxpnJizEvbcpvwCzox/grtn/5GujBUObnuclOhdP/byeUCDuU6SrAJxab9Y5wI/WHXzGJZ3Kj6wjpKWl7cSZYxRghDTwJBAuLPntBEW76W3zRFWfMtReNIRMwHma1qIFqxJGG8i6MhWR7EBao1QxL+yZq3hOkp5GOc+3OfD6AnGFrAuckAmlHZ26jnuwXtZSMGR1d/T2rty4U2wZirOPY2EkvZ7i7drRdNl+wKNsKg== 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:lpKTwPPC7gtd0sYfYZAsZeY112eeqbCqzu4c/JKQ+?= =?us-ascii?Q?A9PNWGhP7geQpbePsRf3eWnnQN8SabFf8GG3rmvzhrymGaSE0mLRdxfk3k5I?= =?us-ascii?Q?3uia3JoL11x0trnN5Cc6D25wNwWGW/O161Lta9pmtceewA4D85VbWQcd6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PM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:5YDHhYBFyuqygerCBFg/lSdapIjLQez5vOKmQGHtyRIl/UwBjEV7U71X5thgbaMakJHQJDP21hEHgVvGtfqP8ABz+os5a9TcNO3+ox+OmasszqPsHJKOeUg/F1+Os2/YF7ty5xEEe3Sws5TbglsmPW7QkIFVfdWp6pTDKAqcK+ZY8EbAGoYX7tq4Jly4X2RktFmmEUrI5gkA+dsN0JDiWKulU2BS+uELPjrPbAc9GmmlhxXeDdERClakRw7HeM3K X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 12:23:08.1228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Subject: [PATCH v3 22/23] OvmfPkg/VirtioScsiDxe: 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/VirtioScsiDxe/VirtioScsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c index ed7fd1dd58a8..91a008b2caa4 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c @@ -934,7 +934,8 @@ VirtioScsiInit ( goto Failed; } - Features &= VIRTIO_SCSI_F_INOUT | VIRTIO_F_VERSION_1; + Features &= VIRTIO_SCSI_F_INOUT | VIRTIO_F_VERSION_1 | + VIRTIO_F_IOMMU_PLATFORM; // // In virtio-1.0, feature negotiation is expected to complete before queue @@ -1014,7 +1015,7 @@ VirtioScsiInit ( // step 5 -- Report understood features and guest-tuneables. // 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 UnmapQueue; -- 2.7.4