Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1960729ybz; Thu, 30 Apr 2020 08:26:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLJyVxAQsQFGG4tkqgD3DCNmgVbBJMFin88XwWhp+4YMfJsJAXyBs9nXOnacT6egxPg8/1B X-Received: by 2002:aa7:dd14:: with SMTP id i20mr3116650edv.225.1588260389727; Thu, 30 Apr 2020 08:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588260389; cv=none; d=google.com; s=arc-20160816; b=lYNoUod4YYqxsWNd5GCFMKaVWg+jkRIqVf0KXUkLQ2Rwe8QO+WXa09UuHA9deARHJk hZiFLzGe5XbCghSzHeEMyGBm8G5yR1rgljmB98Dnh4QxVRF6PvkpYs6yLhzTUQf4sYka 9EcX60XkbrbhsY3mb3vXCyLR/YrC8f17WIPaJZGe0NgxhUrwX3N4ZPGr+EyxTZ+lX3ya AthtmPFJVyFSchELNKsljRgGD3TDNKkmb+Hf5Uctpz1NrirfYBD81My2KwLkGRru/7dD Py64hZJDxuXOXlRwf30HrvjqtbIgzLxIsWCjxFayH2BtgDd66KDclbVtNFIakR6HSzE7 Ub1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BlAQ+cr28c3G7QtbaaRKhxV/AvgpV2lx9FrBL1fLgEw=; b=mjB7YWnDlRDLT89Nq3ppHMPWwlNywXDeOKfgOqbHjfNEeUZBgG+FhHEoEELz31MP7H TScKRiMYmHAVb6Be8wmAXqW4DZ6idNw8h+y26NRunO+M5Ftm3otVg7u/AoKhVT0OyETc A0LMSAghml3eV1f/5o3BMo18WNTuudi42PU39QizRarJMc1qo9qyi4cb3xMy6TIHW7Wi rc4Xjuhq0DfDqzU9PEtS+Bb2hJU44fci1IFvD5eMT1XJGKDi7ffqjtn5r9tXoxHrKQwC NHSu/c59EAef2BiONEGwM4zzT6SWmzElfpDSvDa1rPP9lpBMf2WrhDDGoedz1+Us5xAc OVhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="LHpVGc/h"; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si5804860edo.175.2020.04.30.08.26.03; Thu, 30 Apr 2020 08:26:29 -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=@oracle.com header.s=corp-2020-01-29 header.b="LHpVGc/h"; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgD3PWQ (ORCPT + 99 others); Thu, 30 Apr 2020 11:22:16 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60248 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726411AbgD3PWQ (ORCPT ); Thu, 30 Apr 2020 11:22:16 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03UFJh0b107342; Thu, 30 Apr 2020 15:19:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=BlAQ+cr28c3G7QtbaaRKhxV/AvgpV2lx9FrBL1fLgEw=; b=LHpVGc/hSWEqEyg2SK8MhCm7H9iX9+gDrfb94BbQlA18Q05XwbIkcwaInirP4E7lzBQh dreySwYT2VAGG7p3q+GTOH6ZIcl3tDs6YPeJ8V4S33aQgkw+jyKrDxxBgcXo4gJnGb3M TA1bRfDzzLS8LpfCLm3I29zMDcegOC/2InAzgB9tzlk640UicYVNqbZ69nhiqOc3dHqX 7ce1+aiANeksvHKnsJ3qrXnRKtiLuxVoygJlinn3UrYGgcYY2Fbv80BA9tT3/+7QdgpD S+KG/go1/ZVO2C6qVZzKn2iLHGUWM2EjVDovodzouUiifkg+2H3QlvwLoIO6OnfjlgCU DQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 30p2p0hhvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Apr 2020 15:19:50 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03UFISuO077365; Thu, 30 Apr 2020 15:19:49 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 30qtkwjy0e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Apr 2020 15:19:49 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03UFJlsc012797; Thu, 30 Apr 2020 15:19:48 GMT Received: from char.us.oracle.com (/10.152.32.25) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 30 Apr 2020 08:19:47 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 90C566A00FC; Thu, 30 Apr 2020 11:20:09 -0400 (EDT) Date: Thu, 30 Apr 2020 11:20:08 -0400 From: Konrad Rzeszutek Wilk To: "Michael S. Tsirkin" Cc: Srivatsa Vaddagiri , Lu Baolu , tsoni@codeaurora.org, virtio-dev@lists.oasis-open.org, jan.kiszka@siemens.com, jasowang@redhat.com, christoffer.dall@arm.com, virtualization@lists.linux-foundation.org, alex.bennee@linaro.org, iommu@lists.linux-foundation.org, stefano.stabellini@xilinx.com, will@kernel.org, linux-kernel@vger.kernel.org, pratikp@codeaurora.org Subject: Re: [PATCH 5/5] virtio: Add bounce DMA ops Message-ID: <20200430152008.GB872@char.us.oracle.com> References: <20200428174952.GA5097@quicinc.com> <20200428163448-mutt-send-email-mst@kernel.org> <275eba4b-dd35-aa95-b2e3-9c5cbf7c6d71@linux.intel.com> <20200429004531-mutt-send-email-mst@kernel.org> <20200429023842-mutt-send-email-mst@kernel.org> <20200429094410.GD5097@quicinc.com> <20200429055125-mutt-send-email-mst@kernel.org> <20200429100953.GE5097@quicinc.com> <20200429061621-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429061621-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9607 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004300124 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9607 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 clxscore=1011 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004300124 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 06:20:48AM -0400, Michael S. Tsirkin wrote: > On Wed, Apr 29, 2020 at 03:39:53PM +0530, Srivatsa Vaddagiri wrote: > > That would still not work I think where swiotlb is used for pass-thr devices > > (when private memory is fine) as well as virtio devices (when shared memory is > > required). > > So that is a separate question. When there are multiple untrusted > devices, at the moment it looks like a single bounce buffer is used. > > Which to me seems like a security problem, I think we should protect > untrusted devices from each other. There are two DMA pools code in Linux already - the TTM one for graphics and the mm/dmapool.c - could those be used instead? Or augmented at least?