Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162941AbdD0Ott (ORCPT ); Thu, 27 Apr 2017 10:49:49 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:48773 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162909AbdD0Oth (ORCPT ); Thu, 27 Apr 2017 10:49:37 -0400 Authentication-Results: suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=none action=none header.from=fb.com; Date: Thu, 27 Apr 2017 07:49:02 -0700 From: Shaohua Li To: Joerg Roedel CC: Ingo Molnar , , , , , , , Subject: Re: [PATCH V2] x86/tboot: add an option to disable iommu force on Message-ID: <20170427144901.GA98840@dhcp-172-26-110-153.dhcp.thefacebook.com> References: <1c2cadcf5cd7d19cea93c56435610e61b551bd1e.1493223474.git.shli@fb.com> <20170427065142.lnsdegq7zwxacqo2@gmail.com> <20170427084207.GU5077@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170427084207.GU5077@suse.de> User-Agent: Mutt/1.8.0 (2017-02-23) X-Originating-IP: [2620:10d:c090:180::573f] X-ClientProxiedBy: MWHPR20CA0006.namprd20.prod.outlook.com (10.171.151.144) To BN6PR15MB1635.namprd15.prod.outlook.com (10.175.131.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64241494-5540-4fb1-6ace-08d48d7c9197 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BN6PR15MB1635; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1635;3:1yXaeGj5lZzitQroxQ+6/eJIK7ggjZVaeFc17BnKQLB/zQw92EPLoENNoG0CdUVpxXG+fVT5ZboHTFXvFgAG76xvYUl70fCfRTdb66Gu69varbhUDiawG7WcJKui9+2PRY5/ZJ/OeXYPpvWEYLABdzz4m7dUG2jwLGS97n4s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ji2CdWyvqUZZ+y8UuG4IymhmI5567r9F7Sf8YDjQKO2V2y5Q9WRBOINUiuP6d1YSM+doyD5g7VolOB+Lx+GKG+o4jtWkYvXJubuquEqoQskhh9Ej0ChPHBPG+Gjt/DA7dXH4oUrLDeSrPNRfNOeJaxPL7VzqeaUaqO50vCQmXoG8X3jCZzF05f68MFL90POgfb3mTp3+DOFrLldQ1jSZxtAdOS6khg3cOBKbszHwItApe2Hhd3qhGG9Qu+f4Q5ONEMaajz2L8Zqw2yoSFzWLnCBipsYatUz9eCq4E2HwmTxGTdqQKXGJqAs7fp1j+teANj3Zzpmf1yIa2u5GlmnPpXOm2j4dsntw7OknhjWyJI1C8n5unQEJpWIRrjiYzWN7c+8xZdJEgKiyiFa41BkokH0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148);SRVR:BN6PR15MB1635;BCL:0;PCL:0;RULEID:;SRVR:BN6PR15MB1635; X-Microsoft-Exchange-Diagnostics: 1;BN6PR15MB1635;4:df9WahHad47OjQeaI9/4QJC6XqWwb2xXamGiDr94fJ018xu7fWcPymf63O54WzcK8/lu/AOJELSekhvMEDT3o1uC0qLaV8Mx70e9C8gOhL6OwXCVfTXC6DqAJTAuWX/tE3iYnoQj3f8t8peBn11i+ixlHVH3xcA0GzoFbuh//OObUJ7yUA90loFqLUHAjP9tP9W8E2L9BI5IKWf0VGeyOykn1duFYdFA2SqSyFBxSd5xRCRhW8EfxAtYrATOHZkuHYYeAwxbtcgBtuYvw5x1d1WOwz9r6WdmMloBzegv/pDRY2F5mvJECBldRBWzzkcik800ZPOmM/HBDX7KQ7b0bLMu/KevdFUUy1WHKCYw4HIZaNsl7TycrnBK2X/0Mt7yM4a3XOkU0Z3O8L5+GyKcoysuczHWnocnUR5yTBp/I3e+QRpDJtlTDVx7KwqMJlAxZSbuz6l93agjV/svd/Kt+ysL/qyx5pCWTe6X+R3dglCk+AZmMJRtfVZjaW1Fd+1vCXZtM4uoHDsp6BQwU5jX5gW1hqVqcY3en0Geu/lJxwbHDZwfWT9gj6H7o5Cit3QiVizyBHGlsR7x8hIrBG6rpyZXAYHZGfkeiOK8ESQZZ6pELYbHRxeraI2y1VGd5sw2z19hu/KoRMHUzrHVJXxYmDxgP92NNOr6U2v54NoiugVsBsaeNALZoODamFuoxpwB9dwPT32lKCWDqFYUgd209JTdTpv9etwoCAe9yRmBUyUZwrclOnvlt+vSQKFjEfbx0j90BNbaBRN5n5p26+p3FA== X-Forefront-PRVS: 029097202E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39850400002)(39410400002)(39400400002)(39450400003)(39840400002)(24454002)(305945005)(42186005)(86362001)(53936002)(4326008)(6246003)(47776003)(97756001)(6506006)(33656002)(54356999)(8676002)(50986999)(76176999)(55016002)(81166006)(38730400002)(110136004)(9686003)(54906002)(2906002)(50466002)(6116002)(229853002)(23726003)(46406003)(1076002)(25786009)(5660300001)(189998001)(2950100002)(6916009)(6666003)(18370500001)(102196002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1635;H:dhcp-172-26-110-153.dhcp.thefacebook.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR15MB1635;23:9EJ2wNsBAyUdq+Ib69SrTw7sZ1EXP2OKqJDKVaK2W?= =?us-ascii?Q?Nn9fRv5GJcxXLZg1L0g8FKN/ZkHsCom/xJ2GgDPDg41lcb1mtLaz0dDiUGr+?= =?us-ascii?Q?hqp/YF/mfFbLdrN+UGF+/sgN7mviP+6KDTVisaC6WcFU6HZbHiEhhIbzUyAP?= =?us-ascii?Q?ipBGVr+T9wQSs0BZBkHtrKM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A8TNV4eGyf+CcWuWT+9EjcV3MV6bf8kcPASvDV9g+EIXEDKdJ84JksF9bDnXsyz0YLtuDWcHWQTahR9yfHCr/xtRqGXF8eJr9DoWm7PYxF1FeTRN8vaLec4rJnzXD2ra/X3HeHXAJ7QVCmejB7NhKS1y65lxTWutmLlZMVHvW5lVSdqBi5P891bCvCoMlWDgg+iaoUgyh/BfKQ4q2Zen/ZINaFkhXC0PfnOA==;20:f8z/ZqURsZk+7wPOlXo7dUL7bux32gS4cGeZIxgMcf7bVlWVzFmvFE3Rq9TzCXkgRjCpDke6Fq84ZR5q8Q3rFUMYZI8V59FK66Hc69kpPH4qM/xg8bj6cU5ALr/QHWSCoXCzLVrnMAeS5nnoL/en+jv/q7DJZo+fY+QFZTs+vUw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2017 14:49:11.0291 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1635 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-27_13:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1766 Lines: 37 On Thu, Apr 27, 2017 at 10:42:07AM +0200, Joerg Roedel wrote: > On Thu, Apr 27, 2017 at 08:51:42AM +0200, Ingo Molnar wrote: > > > + tboot_noforce [Default Off] > > > + Do not force the Intel IOMMU enabled under tboot. > > > + By default, tboot will force Intel IOMMU on, which > > > + could harm performance of some high-throughput > > > + devices like 40GBit network cards, even if identity > > > + mapping is enabled. > > > + Note that using this option lowers the security > > > + provided by tboot because it makes the system > > > + vulnerable to DMA attacks. > > > > So what's the purpose of this kernel option? > > > > It sure isn't the proper solution for correctly architectured hardware/firmware > > (which can just choose not to expose the IOMMU!), and for one-time hacks for > > special embedded systems or for debugging why not just add an iommu=off option to > > force it off? > > I guess that tboot requires an IOMMU to be present in order to work. It > will do initial IOMMU setup and hands the hardware over to Linux later > on. > > The problem solved here is that someone wants tboot for security > reasons, but doesn't want the performance penalty of having the IOMMU > enabled and can live with the risk of an DMA attack. This is exactly the usage for us. And please note, not everybody should sacrifice the DMA security. It is only required when the pcie device hits iommu hardware limitation. In our enviroment, normal network workloads (as high as 60k pps) are completely ok with iommu enabled. Only the XDP workload, which can do around 200k pps, is suffering from the problem. So completely forcing iommu off for some workloads without the performance issue isn't good because of the DMA security. Thanks, Shaohua