Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1036694ybl; Tue, 13 Aug 2019 06:29:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy587sDFq9t4VIAZQ8qTolEmPNZKDwvEKOe9uAb8Qm2P2nSkTb1Jrd77Omb8nhdgyYnwL4z X-Received: by 2002:a17:902:d894:: with SMTP id b20mr32337503plz.134.1565702977177; Tue, 13 Aug 2019 06:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565702977; cv=none; d=google.com; s=arc-20160816; b=yJyQOv/SvE51q2l3u6gNeua6oIMd0mh+XSI4dGufxzn/dNMiN/XXodNEsHuaRBc0T1 mxGLkgv9E3zOFE3LaoWo/omi2jqK+gWiRNui6W4gPqWHgZDpNjqsz36h2kN5Gk9myO5a WwJRb4Hc34aHgnU8kezbs396evyjsct4Tb01pUbAosQQvVPjqVVjq44pJO12jbFvfN0E qKBk2jjm2paqVe5N+2J8PfRChub0AuMzJQlum2QhZe77P2ipMheVfhx4YCS26mWxRz2C VMJHKXotheCCBTZyPhvoHlphuALpEw+gyEdBV9bksUUYXP5VqeyoDyt9Ofj3TqHw9V9e 0aEg== 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=sNu0xQQZbdWEFZJ0g3B72k4oWGJZIN4BkI6FAQI/0fo=; b=f3GXRjq2g7+GGyReuGcFNqzDklcFey92fQEnb/i2APvcKuGc7vMs8x4w+A77nDlHim XZitHT2zI2K/civbKBHGDpo4v++hncscIcwXn4jmY7dSfb34oxy6UhbtdpAHHQxeq19e iQFfngP6v6IiwerAlA+REFGz6u2zKPuZ4Wa0Z1sbeQXL3nE6ic7iyz4s4/6ynWO0ZIxB VCABsyeylqQOjFrNiFXZaJBEj3kwC3fcPmNnPQHz9QDSoWc07983ykl7zYyAQPvNoFQN N+igeJ9/5G4myXdXBJ9jDxV+QVfxtKOMnQeafepvvqdL4Icu6M09mXy5989ibpNBn8wX nS6A== 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 c127si68893258pga.569.2019.08.13.06.29.21; Tue, 13 Aug 2019 06:29:37 -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; 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 S1729143AbfHMN0V (ORCPT + 99 others); Tue, 13 Aug 2019 09:26:21 -0400 Received: from verein.lst.de ([213.95.11.211]:57266 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728215AbfHMN0V (ORCPT ); Tue, 13 Aug 2019 09:26:21 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 77F5C68B02; Tue, 13 Aug 2019 15:26:17 +0200 (CEST) Date: Tue, 13 Aug 2019 15:26:17 +0200 From: Christoph Hellwig To: David Gibson Cc: Christoph Hellwig , Ram Pai , "Michael S. Tsirkin" , Thiago Jung Bauermann , virtualization@lists.linux-foundation.org, linuxppc-devel@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jason Wang , Alexey Kardashevskiy , Paul Mackerras , Benjamin Herrenschmidt Subject: Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted Message-ID: <20190813132617.GA6426@lst.de> References: <87zhrj8kcp.fsf@morokweng.localdomain> <20190810143038-mutt-send-email-mst@kernel.org> <20190810220702.GA5964@ram.ibm.com> <20190811055607.GA12488@lst.de> <20190812095156.GD3947@umbus.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190812095156.GD3947@umbus.fritz.box> 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 Mon, Aug 12, 2019 at 07:51:56PM +1000, David Gibson wrote: > AFAICT we already kind of abuse this for the VIRTIO_F_IOMMU_PLATFORM, > because to handle for cases where it *is* a device limitation, we > assume that if the hypervisor presents VIRTIO_F_IOMMU_PLATFORM then > the guest *must* select it. > > What we actually need here is for the hypervisor to present > VIRTIO_F_IOMMU_PLATFORM as available, but not required. Then we need > a way for the platform core code to communicate to the virtio driver > that *it* requires the IOMMU to be used, so that the driver can select > or not the feature bit on that basis. I agree with the above, but that just brings us back to the original issue - the whole bypass of the DMA OPS should be an option that the device can offer, not the other way around. And we really need to fix that root cause instead of doctoring around it.