Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4671288ybz; Tue, 28 Apr 2020 16:07:15 -0700 (PDT) X-Google-Smtp-Source: APiQypKL/FvzXr4+XnH66vHYKAGAdpWKmSP1kkp8a11iaMvzcb8w5tWG2kUBYPyylLT5KvuvVWvh X-Received: by 2002:a50:ec95:: with SMTP id e21mr65426edr.253.1588115235210; Tue, 28 Apr 2020 16:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588115235; cv=none; d=google.com; s=arc-20160816; b=HiP2jkiYO8NMkMqowp4Coq80ZpxbwTb0HjPZpCUS+qkLCPjPuiWX2AcGw0hzO1MN8d tq32Dkc7HHmDurSDrA/5U0GOHwayyTIah34ocWdxvT3N2siQlRCoEnYqjS1akIp2P+p/ GJp5XelmzN7YAoSKZ2kWIBfAFhTh0hqTjk9+pFxNLPPkwtTPX1MbZhuUWQw7Vnnb7co8 C4WoROJ70yKxEtml0D+qajGh8KhlLbzuAllPf8ug4IsER9qAgzU+l9TXVjdrhmiXoP7g D4pV5VNoev9GugPtUV2vKss/RZVkkPIKEi6taqE0xFI1t4gHnoZRTdcajK+euyXNzBi6 HAiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=IHvXIGLEra5tzai8mZT/aY57RrWWuofS8+tWYSrInFI=; b=R9vYLXj6y8ghnYLsnT/gcvVRZVKiuXfZYGySM3yP0bspaMhHSgUVuMtE2xY1NZzOGu g04cizUvozzJM0s/0bsXUxddwqFThgau6zZQvq7ZahsAB3vRk8Yuh3tmJqheg98+Fq67 2vu7300S+QTVio2Wgnq946SPNgcIBlzH7QSfJhkSeXkHA2e3w9ToCny60txFo9i/nRvo toAqRg4DkgXupodWIrzelK2HDgp0YD2B1GCoIiGMl5crYhG3NCzoDYeU2qPLwA/cZab2 VemtQ8mhi/GFosfgmUsl69Qqrphb5Jp8gfloNxTco8iH6/evC0qn0KnBKqisiQogGrDW DDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yFtq8fVR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si2773154eju.232.2020.04.28.16.06.48; Tue, 28 Apr 2020 16:07:15 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=yFtq8fVR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgD1XEg (ORCPT + 99 others); Tue, 28 Apr 2020 19:04:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbgD1XEg (ORCPT ); Tue, 28 Apr 2020 19:04:36 -0400 Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E881120656; Tue, 28 Apr 2020 23:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588115075; bh=bo21LaVDiN3p5qRExTfq+J7LOaI4TxtlxHpokeU5a/o=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=yFtq8fVR/VOkhVWVlZwlZokdulMlFu18XJsQJY7pDxJcDZzrCvZYs0XLTYNZmxQFB TBC5AJbU1fcRxpBlV7gSsUZbbrInB3b/KP1iNNFQvhDadkU4ftnPdNkgd7QRwiGDNB fSoqdmY8NaFIDGsoCMkQHQ8Ab/XP58R2TcfoPOUo= Date: Tue, 28 Apr 2020 16:04:34 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: "Michael S. Tsirkin" cc: Srivatsa Vaddagiri , konrad.wilk@oracle.com, jasowang@redhat.com, jan.kiszka@siemens.com, will@kernel.org, stefano.stabellini@xilinx.com, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, tsoni@codeaurora.org, pratikp@codeaurora.org, christoffer.dall@arm.com, alex.bennee@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] virtio: Add bounce DMA ops In-Reply-To: <20200428163448-mutt-send-email-mst@kernel.org> Message-ID: References: <1588073958-1793-1-git-send-email-vatsa@codeaurora.org> <1588073958-1793-6-git-send-email-vatsa@codeaurora.org> <20200428121232-mutt-send-email-mst@kernel.org> <20200428174952.GA5097@quicinc.com> <20200428163448-mutt-send-email-mst@kernel.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Apr 2020, Michael S. Tsirkin wrote: > On Tue, Apr 28, 2020 at 11:19:52PM +0530, Srivatsa Vaddagiri wrote: > > * Michael S. Tsirkin [2020-04-28 12:17:57]: > > > > > Okay, but how is all this virtio specific? For example, why not allow > > > separate swiotlbs for any type of device? > > > For example, this might make sense if a given device is from a > > > different, less trusted vendor. > > > > Is swiotlb commonly used for multiple devices that may be on different trust > > boundaries (and not behind a hardware iommu)? The trust boundary is not a good way of describing the scenario and I think it leads to miscommunication. A better way to describe the scenario would be that the device can only DMA to/from a small reserved-memory region advertised on device tree. Do we have other instances of devices that can only DMA to/from very specific and non-configurable address ranges? If so, this series could follow their example. > Even a hardware iommu does not imply a 100% security from malicious > hardware. First lots of people use iommu=pt for performance reasons. > Second even without pt, unmaps are often batched, and sub-page buffers > might be used for DMA, so we are not 100% protected at all times.