From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0056.outbound.protection.outlook.com [104.47.36.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6B61121E70D50 for ; Wed, 30 Aug 2017 13:45:18 -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=WXrz4+M8kGolhxPPhHrvomBfyFhBcVMG/50K6y+jg+8=; b=L8WkqtacDFqgXrbOZKDOiStal8FEwMTxZBJdOA+L4Fq3Okjmk/7Jlr1xdB93KvFVIePa8TxcVLOA5QydtPOAZYasmDcJjr53Hk5pgf0yCWVMCS4CdJ5XaSFIll1jCFc1kJJiltjt+xW3Q3dCDTshThjlo3W9FZpl7qWTY68c1RY= 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 DM2PR12MB0154.namprd12.prod.outlook.com (2a01:111:e400:50ce::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Wed, 30 Aug 2017 20:45:20 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Ard Biesheuvel , Jordan Justen , Tom Lendacky , Laszlo Ersek Date: Wed, 30 Aug 2017 16:45:03 -0400 Message-Id: <1504125903-29816-5-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504125903-29816-1-git-send-email-brijesh.singh@amd.com> References: <1504125903-29816-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0040.namprd22.prod.outlook.com (2603:10b6:301:16::14) To DM2PR12MB0154.namprd12.prod.outlook.com (2a01:111:e400:50ce::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cb87fa50-0e1d-4cce-9237-08d4efe80809 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:DM2PR12MB0154; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0154; 3:htBqt8V44TbtFseIL/lLaZRkrOMcta7j7jrBgRH2tOY5G8RKROu3hKTBYzpsdbWhGV0qzdryJUN7PzbM+ABANV0ELtiJYH97krTx4fTvZXvJlbz/aINJqDeDGHmxoVpDnqnYlCwdFzH8z5b7fn5m0DFdmPy+h4GbMrp4Ey6Z07oasbTjrwmy+eCfZ3qFIE2jBqB/wFH+ompDmfugPHwYhHqbOrfGU49cH1y5/0rMAf7AKj2WAaGBfh7bANDlXVMA; 25:BSBnA3kN2NolPUv22gLlzUigyEBrmDPOJL6PKtxM+hKNEIC/bNuztUjvHRZQoLrNZ72vP9t/TkrE7ENQN5u+Gs5lJKnv7EG1db9mgMPAajpL9/HgZD/fE0ULbOd6Pe4p6VwcQyVtnrtyheGh2Xz5ws/S+ig0OZxPFr98r7JVPRqY9e68EK6Zng/GyXnC5hGKVePkZBLtzCcGeV6ySvehyhT1zPoqv+gknmlPo1YGCgSADuO4DUPeLX6cqLZoteyReQOK47MOkFFlwP8zOMDBFPT6Eh98Zgxpf0mTc73wL6Hlb/Cq3dmJY3Ih3vlunm6RczqYcjRc3HV+gem2X9ewaA==; 31:6cTCk1RVndxDAic1+AbapZS1Q2ChqMvVhNb1n0K0htSvgZZyJu7MpfCxZDVowlaYzX/C9Cqs21OkYgOVMWiVHn8qLKC3t6Bk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IP4br4EtvygMlINg== 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)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR12MB0154; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR12MB0154; X-Forefront-PRVS: 041517DFAB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(50466002)(86362001)(53936002)(3846002)(6916009)(54906002)(2950100002)(6116002)(478600001)(7736002)(33646002)(68736007)(189998001)(2906002)(48376002)(66066001)(47776003)(4326008)(8676002)(81166006)(97736004)(2351001)(50986999)(25786009)(2361001)(8936002)(101416001)(106356001)(5003940100001)(50226002)(105586002)(6666003)(110136004)(81156014)(36756003)(305945005)(53416004)(6486002)(42186005)(5660300001)(76176999)(344415003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0154; H:brijesh-build-machine.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DM2PR12MB0154; 23:WtVtRJS/WQVrwEIvbY0hkPV71Niexk8SH9crFoWxm?= =?us-ascii?Q?huJU+UlKUFJp4/I/6a8FnxkGADkC0ohAz2v5cXpaqfzjuY7epRAT8TEjkYko?= =?us-ascii?Q?NJSRD12Umq8xeqirGh5q9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ZYAMP?= =?us-ascii?Q?q+oHQClbTXsnl0LXBjlspWGg2x8nOswrlFT6qil65Ypz/cpYiFx9cVtDRFMR?= =?us-ascii?Q?n6+kHMheg+/chwtt7z0TQvutECLjOjifgGRowf+z8ATOf0Ghw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0154; 6:ARDUVpBxSjHJ2cvVwwo+sIl8whlcgLquz06cSkALRJOPLn0yTXwmEBaLkbD3oxAHUSOaDKEnmwj0Eo+k+lnHNqF4vtW96+Bxm6D5Gyt2PC9J7qNywLadO8OqdzZWGNZDJqI/aOPTeT5RQzotU41LCn1WjkrHBpBS+tHBsMwKu5OqOj7aJUW8N+IJ7Qa/PUaM8V/zflKbU6AlLMalU/T/tAKdbzK61lHls8CmAiLPlpZpcygsAuzDQ7pF7apN7QBWkuYTXlwIwpZMfzLUAq3NXjmb0m9Ug9HF1McHQVWjFahCpz8yeGp+7HlPDhZArXBmeTKmCLE2b71im60gM4576A==; 5:yT86yuQB1+Fp8Blll3oosimWP05Ezasod/ekvjsNf+0GazpvQdGTR/2EfAINcMuNBP8ts3SpvHg7wG1m3Chrk+7b4+wYOGp9a60lanVRMdw72t3VWisMczSTokG/xUP96d+ljmSCBRG1xnjGAG0RYQ==; 24:p4OqIym0sCuJ7ZyDnDCZMqzA5Jfev/yW/Q3dzH2fozF6pjvBV3okxbAeuXibgqVmJqRIRFuugeIUNtslzZrjY1b2pcM/GNZR+35P4vhXiZc=; 7:l3Yey29/bmR0g5KayFI3fD2TlfaW5NN1AbIUPrMMO80fr06csyna8+cz/9nlo8O3NMatFrHm1Np8ggcwSoufRCC8MLjPnnpDWOcAybMCvon7E8nM7TCLN285nPlTj6YjK3UUfNboygBodgWbr+6YoM4RjU7Lcf7ldDXxgZZzLpZe9tbi4fGHBobQ3FjM3pX1BB8zr1qptFFIE2b2dXlOxxSk5E+Ig69QFuNHi0zadGI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0154; 20:rE3IP4u5YCqbzTLw3trfPTnYOcC2DYI5ldyNOSQ6WyYshWKAt9fP9wh1nAG9cDTMXCof0xjXCHPxMaC7cLdnoQshf3whjG8f6/nc0SLRCCznn0YLZftJs1rpQBd05eSzECL2m1TGsNzfBj2KgICRN7vvLY9qQHf99iVu6ohvZtAj6uud7LUlDW8S+Xd2MLpOqJUs20yr1PpfdFNuyVB7+71lTgixWH9D2D3qLAGwDZzAq+h60l+5k+jOnGCDIhOQ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2017 20:45:20.5191 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0154 Subject: [PATCH v2 4/4] OvmfPkg/VirtioScsiDxe: 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: Wed, 30 Aug 2017 20:45:18 -0000 Content-Type: text/plain VirtioScsiDxe 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 Reviewed-by: Laszlo Ersek 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 3e04097ddd11..4ec22ccd1abe 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c @@ -1009,7 +1009,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 @@ -1089,7 +1090,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