Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp842399ybv; Thu, 20 Feb 2020 08:14:42 -0800 (PST) X-Google-Smtp-Source: APXvYqy+w54BkaayVSfesTGRYQJw7f+1D8fPdS0sbKUdQexcFjA4Qdt9GvXoCKiV25cJgdpkitfJ X-Received: by 2002:a05:6830:1198:: with SMTP id u24mr23508024otq.215.1582215282555; Thu, 20 Feb 2020 08:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582215282; cv=none; d=google.com; s=arc-20160816; b=L+KHVmpm3SEHlNcgS+o/nCPskscX4kn+1LBqUxRKt7/K3R7KrN+ErUZMw79MwgMApl 2w7uk6mL2WDzPdBa3J6zTiNdM56b+NuAkvK2DtDichVV1iqkNQG8KAqyyZobdLoOsbnd vTuqZkzn7jSexyNBlPGxrH1Rv/uFAdJgY2icVzvAsh4CJS+66C2hi489fMyjEzY2tCc9 SfDhY4I18T7PYM3gSSzjYi5Wl2bIZw3U6Gghl3RB9+0Mg5mNgb38dYbgB8gTKSFU6f8+ ttpXyX1TcVg0Cr6yhpdtUAxFCGBj6TiaXFohnEhf28F5To53iMnwOeV2WuC5gZ5/yIzK Q6yQ== 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; bh=hNgJli3nEVUFUINFS38YRyp1+87H2RLlmCY5xJNgxpg=; b=otcMelDYOHTKHf9MYOLTDm0G3dXF8uFDlMF5yaC1RIZsX+4pYskq2an4oPo5/JMABD UQ6PZ+BZnENRloec48Bv+8vPHgnXDN0LokWY+r0wlMrIoF3icW/Ns7Pzf3BUEkHHAVzA 2b7dwxEtK3/uMw9h7bRVPmnHQQlcu4uT60WrQ5Ds3h0cd9RQqZRkvCK4v3HfIo6uE+b0 NZrZrnmREu32yrrNhYTCpfUuXwFxWdgzT7lNWJHsy55+Ejk2eZEEDSWZurn7l2FyUypo My+sbIkuVVSCeZ17Tpu7m7jl0mwJQ2bdi6TnoYIsEg9Jj978HTaoreznTuyNiFlsVJiP EnKQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h18si1873122otj.114.2020.02.20.08.14.29; Thu, 20 Feb 2020 08:14:42 -0800 (PST) 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; 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 S1728567AbgBTQNM (ORCPT + 99 others); Thu, 20 Feb 2020 11:13:12 -0500 Received: from verein.lst.de ([213.95.11.211]:50190 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbgBTQNM (ORCPT ); Thu, 20 Feb 2020 11:13:12 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 02BC668BFE; Thu, 20 Feb 2020 17:13:10 +0100 (CET) Date: Thu, 20 Feb 2020 17:13:09 +0100 From: Christoph Hellwig To: Halil Pasic Cc: "Michael S. Tsirkin" , Jason Wang , Marek Szyprowski , Robin Murphy , Christoph Hellwig , linux-s390@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Christian Borntraeger , Janosch Frank , Viktor Mihajlovski , Cornelia Huck , Ram Pai , Thiago Jung Bauermann , David Gibson , "Lendacky, Thomas" , Michael Mueller Subject: Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected Message-ID: <20200220161309.GB12709@lst.de> References: <20200220160606.53156-1-pasic@linux.ibm.com> <20200220160606.53156-3-pasic@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200220160606.53156-3-pasic@linux.ibm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 867c7ebd3f10..fafc8f924955 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -243,6 +243,9 @@ static bool vring_use_dma_api(struct virtio_device *vdev) > if (!virtio_has_iommu_quirk(vdev)) > return true; > > + if (force_dma_unencrypted(&vdev->dev)) > + return true; Hell no. This is a detail of the platform DMA direct implementation. Drivers have no business looking at this flag, and virtio finally needs to be fixed to use the DMA API properly for everything but legacy devices. No amount of desparate hacks is going to fix that fundamental problem, and I'm starting to get really sick and tired of all the crap patches published in this area.