Received: by 10.213.65.68 with SMTP id h4csp626487imn; Tue, 13 Mar 2018 15:32:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELtz9Z11VstX8cR+0X+QgKDKbqFkICkWinpH5WK/S6+Tgszz2NXlCpn4ZlC2XVbRQHY5SXou X-Received: by 10.101.96.5 with SMTP id m5mr1791835pgu.374.1520980338028; Tue, 13 Mar 2018 15:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520980337; cv=none; d=google.com; s=arc-20160816; b=0Jbf/S2+dm/xmynNayyVRaP3W4qmpogzUiWb30+Pw0TqVoW626SDHPjvomFdEis/x2 /PeGei+BLaV3dMRkdMWIRMT5BcRRAaGHCluJFhLC3KbIUz7vIC+OR0e8eHPodQOXDyb8 M6njlkQPNYJU2PvOcNJyBviUNI4QLFZ5XFGSqw7d4x6HkPBGlaKTWGCChGkJYtAvo90V 9uGn1cyaMUHe0B2tKNcSK0PWHnlpxoz6w3Gd1NqD7zv8DgPkwhS2C1n+tlMn7n/RcSSC pITo60Ct/NQnQzrIzhJrpgTN/dUMWQevwR9NjmpdQSWe91rIDSTmGlyfs0S6Mkts4HHN MBBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=kusZNvv83Dn18LENYL4kugEOAGPmGuiWz4RDHli2sVA=; b=nkxBhXCo6W79pbEZJlDlLD7yHCH3do/uVEHsmwxZT7M/C60LLFQw5MxK1UCP91N+kX HUAHWJ6hiE4WQc83U1glN1f+tkKjXkygs4GQFnRtTPmMudR7f8XDmw078GYuMfrNW6Ag l4rxXnlLgvluCgfJUDMuN2TvWQ88rJ4EC5uwMsDzslpfgBOQdTIJH5qoCyTa8LEwCYkq aZBkZq52Q/7YBcyaDo5dSiGzd9jrw7FzuMR3ffQjfvRs9+3j6uYshS2mUHrRJ85BJuJb nOQxliSZXQGXwsG6I/AUgj660udB/BuxElfsO09REhAmBEjkalT6m8pcQgtRFxZ+7cXd hMFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=J3/9Dor2; dkim=pass header.i=@codeaurora.org header.s=default header.b=lmgd7Sqg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si815834pla.612.2018.03.13.15.32.01; Tue, 13 Mar 2018 15:32:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=J3/9Dor2; dkim=pass header.i=@codeaurora.org header.s=default header.b=lmgd7Sqg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932665AbeCMW3p (ORCPT + 99 others); Tue, 13 Mar 2018 18:29:45 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58290 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932205AbeCMW3l (ORCPT ); Tue, 13 Mar 2018 18:29:41 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 48C0260858; Tue, 13 Mar 2018 22:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520980181; bh=aytc/Upn2pX+90p9keYiuiWEvLSA4jq5C3Ck7w6zD3k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=J3/9Dor2esOlCjtiwzBzKllXV18XC0JHuRU/58uRwZoczPHl5BGV5IEFejZbayo86 FtXfqaeOEaXOehpma/zHBDmI9D00sAlcV8Kr1InbkEwbQx7nnak5HraEJoHu+E9oRv Zay3p3XgPFUpD2VO7uu1IUf2k9/1nUy4bhaZ7orU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.235.228.150] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0041C60590; Tue, 13 Mar 2018 22:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520980179; bh=aytc/Upn2pX+90p9keYiuiWEvLSA4jq5C3Ck7w6zD3k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=lmgd7Sqg88e/nPwoVaS9ml1343bBPtJAB+g6aR3e/EZZsTLpXSSnZN8kW3EfiHASr uKO3YytQv0o0kt6EKE3vgMSGJ96GnNd1wvl7a+7bjf3YIaDgJSLn8UJLCSIq4xUBwK lwukcAQtlx2dFOP/uGkuJL0wEYVOgddofXLj+x28= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0041C60590 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH v3 01/11] PCI/P2PDMA: Support peer-to-peer memory To: Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson References: <20180312193525.2855-1-logang@deltatee.com> <20180312193525.2855-2-logang@deltatee.com> <59fd2f5d-177f-334a-a9c4-0f8a6ec7c303@codeaurora.org> <24d8e5c2-065d-8bde-3f5d-7f158be9c578@deltatee.com> <52cbbbc4-c488-f83f-8d02-14d455b4efd7@codeaurora.org> <3e738f95-d73c-4182-2fa1-8664aafb1ab7@deltatee.com> <703aa92c-0c1c-4852-5887-6f6e6ccde0fb@codeaurora.org> <3ea80992-a0fc-08f2-d93d-ae0ec4e3f4ce@codeaurora.org> <4eb6850c-df1b-fd44-3ee0-d43a50270b53@deltatee.com> <757fca36-dee4-e070-669e-f2788bd78e41@codeaurora.org> <4f761f55-4e9a-dccb-d12f-c59d2cd689db@deltatee.com> From: Sinan Kaya Message-ID: <016dc910-f96a-8a60-4bda-fa24eea98ea5@codeaurora.org> Date: Tue, 13 Mar 2018 18:29:37 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <4f761f55-4e9a-dccb-d12f-c59d2cd689db@deltatee.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/13/2018 6:00 PM, Logan Gunthorpe wrote: > > > On 13/03/18 03:22 PM, Sinan Kaya wrote: >> It sounds like you have very tight hardware expectations for this to work >> at this moment. You also don't want to generalize this code for others and >> address the shortcomings. > > No, that's the way the community has pushed this work. Our original work > was very general and we were told it was unacceptable to put the onus on > the user and have things break if the hardware doesn't support it. I > think that's a reasonable requirement. So the hardware use-cases were > wittled down to the ones we can be confident about and support with > reasonable changes to the kernel today. If hardware doesn't support it, blacklisting should have been the right path and I still think that you should remove all switch business from the code. I did not hear enough justification for having a switch requirement for P2P. You are also saying that root ports have issues not because of functionality but because of performance. If you know what is bad, create a list and keep adding it. You can't assume universally that all root ports are broken/ have bad performance. > >> To get you going, you should limit this change to the switch products that you have >> validated via white-listing PCI vendor/device ids. Please do not enable this feature >> for all other PCI devices or by default. > > This doesn't seem necessary. We know that all PCIe switches available > today support P2P and we are highly confident that any switch that would > ever be produced would support P2P. As long as devices are behind a > switch you don't need any white listing. This is what the current patch > set implements. If you want to start including root ports then you will > need a white list (and solve all the other problems I mentioned earlier). What if I come up with a very cheap/crappy switch (something like used in data mining)? What guarantees that P2P will work with this device? You are making an assumption here that all switches have good performance. How is that any different from good switch vs. bad switch and good root port vs. bad root port? If it is universally broken, why don't you list the things that work? > >> I think your code qualifies as a virus until this issue is resolved (so NAK). > > That seems a bit hyperbolic... "a virus"??!... please keep things > constructive. > Sorry, this was harsh. I'm taking "virus" word back. I apologize. But, I hold onto my NAK opinion. I have been doing my best to provide feedback. It feels like you are throwing them over the wall to be honest. You keep implying "not my problem". > > I agree disabling globally would be bad. Somebody can always say I have > > ten switches on my system. I want to do peer-to-peer on one switch only. Now, > > this change weakened security for the other switches that I had no intention > > with doing P2P. > > > > Isn't this a problem? > > Well, if it's a problem for someone they'll have to solve it. We're > targeting JBOFs that have no use for ACS / IOMMU groups at all. IMO, you (not somebody) should address this one way or the other before this series land in upstream. >> You are delivering a general purpose P2P code with a lot of holes in it and >> expecting people to jump through it. > No, the code prevents users from screwing it up. It just requires a > switch in the hardware which is hardly a high bar to jump through > (provided you are putting some design thought into your hardware). And > given it requires semi-custom hardware today, it's not something that > needs to be on by default in any distributor kernel. > >> Turning security off by default is also not acceptable. Linux requires ACS support >> even though you don't care about it for your particular application. > > That's not true. Linux does not require ACS support. In fact it's > already off by default until you specifically turn on the IOMMU. (Which > is not always the most obvious thing to enable.) And the only thing it > really supports is enforcing isolation between VMs that are using > different pieces of hardware in the system. Another assumption: There are other architectures like ARM64 where IOMMU is enabled by default even if you don't use VMs for security reasons. IOMMU blocks stray transactions. > >> I'd hate ACS to be broken due to some operating system enabling your CONFIG option. > > ACS isn't "broken" by enabling the config option. It just makes the > IOMMU groups and isolation less granular. (ie. devices behind a switch > will be in the same group and not isolated from each-other). Didn't the ACS behavior change suddenly for no good reason when we enabled your code even though I might not be using the P2P but I happen to have a kernel with P2P config option? -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.