Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2150683pxb; Fri, 5 Feb 2021 10:06:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzajfSzmRQFcMLSeXtaVkQmQvBK8kWwpxgdG+L9pzHarqs44n7s1m3zarMy4ygyVorqCy0w X-Received: by 2002:a17:907:3e1b:: with SMTP id hp27mr4899113ejc.506.1612548392012; Fri, 05 Feb 2021 10:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612548392; cv=none; d=google.com; s=arc-20160816; b=en0yjGUxRdhtea0SV9Cjyfh72eE0v47lEYQrrti8vXsmVfxRIDuWNsaZ3EvS+AV4vw Tj0FuzVFaCrzvJ74NpH6tC+dAFsuEykIFfLu1SzAKXEMyJX9ekuDfM90zUgxxqtjwtqq EwM69jjewkcxVO5icY4apWoYZ6/no1zXeyeXhxENj5EsBx8Fs+oR6p7HJnFa7+cZvoS2 HRQi/bNg9W+BqGFFD2WbgCHQdKADsdUAubYfY4R8uosgaGjHtTeSZrszVjZzg+kO1SE1 myL+H8He4Uf5Epp1hGA77V/FtClxxycMIy2xuPIZyCAKc0t81sF2NkT9nQ1NSvCEFIb1 DA9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TkBDsoTDzjC5BiFjN6HO3oiB0URgvy+gmDjBCL+KA3Y=; b=bATFjsuJg92LLnBZ804sSwvAUcZy83ldz88E32l5/jy0gIlqb2wj5OECHQ7TvtTG0T oCRKCgSDp2D3JEZNLgTVA/Up5wgtY5gAtCmbV7awuucnX7w8hF1XWGBg0vNND5MULXs2 c7fyxyBtSApE5zi2JZr1tk1iRLeBU0fyCkQ3sVFlbGtn1zBcdGTqgwEGiuvS4PyXY9JZ UPnxqjyRleWPk3mk0IC7n1hgC+lRkqiVpAnC31c7mQK7Ub48ygzRxtmRx+DAEaeL/OPw SmvGM1n4kFjGDH4hildRmUBngLJan+AbXmN56BkzDLJYqWwHoikCSOFkw/FVim8vXiEj F5AA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by12si5637000edb.611.2021.02.05.10.05.59; Fri, 05 Feb 2021 10:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233658AbhBEQTw (ORCPT + 99 others); Fri, 5 Feb 2021 11:19:52 -0500 Received: from verein.lst.de ([213.95.11.211]:32946 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233524AbhBEQRR (ORCPT ); Fri, 5 Feb 2021 11:17:17 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 1A3F667373; Fri, 5 Feb 2021 18:58:53 +0100 (CET) Date: Fri, 5 Feb 2021 18:58:52 +0100 From: Christoph Hellwig To: Konrad Rzeszutek Wilk Cc: Christoph Hellwig , Martin Radev , m.szyprowski@samsung.com, robin.murphy@arm.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, joro@8bytes.org, kirill.shutemov@linux.intel.com, thomas.lendacky@amd.com, robert.buhren@sect.tu-berlin.de, file@sect.tu-berlin.de, mathias.morbitzer@aisec.fraunhofer.de, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org Subject: Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path Message-ID: <20210205175852.GA1021@lst.de> References: <20210113113017.GA28106@lst.de> <20210203124922.GB16923@lst.de> <20210203193638.GA325136@fedora> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203193638.GA325136@fedora> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 02:36:38PM -0500, Konrad Rzeszutek Wilk wrote: > > So what? If you guys want to provide a new capability you'll have to do > > work. And designing a new protocol based around the fact that the > > hardware/hypervisor is not trusted and a copy is always required makes > > a lot of more sense than throwing in band aids all over the place. > > If you don't trust the hypervisor, what would this capability be in? Well, they don't trust the hypervisor to not attack the guest somehow, except through the data read. I never really understood the concept, as it leaves too many holes. But the point is that these schemes want to force bounce buffering because they think it is more secure. And if that is what you want you better have protocol build around the fact that each I/O needs to use bounce buffers, so you make those buffers the actual shared memory use for communication, and build the protocol around it. E.g. you don't force the ridiculous NVMe PRP offset rules on the block layer, just to make a complicated swiotlb allocation that needs to preserve the alignment just do I/O. But instead you have a trivial ring buffer or whatever because you know I/O will be copied anyway and none of all the hard work higher layers do to make the I/O suitable for a normal device apply.