Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3716070ybl; Mon, 12 Aug 2019 05:17:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzO0DpaIWlPob6YImIrKbDmfgYdwnRw2I1Qbw9YBOOK/eb2qQ9AjYN6zk67QIqbGsMBwczb X-Received: by 2002:a17:90a:1c17:: with SMTP id s23mr23275305pjs.108.1565612276677; Mon, 12 Aug 2019 05:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565612276; cv=none; d=google.com; s=arc-20160816; b=KE0YDfntGK0Fj6JfuVT3bOOkz4vGTLpikTDXAIMTmOyhGtIoCScMbCl/NoBB/IONgZ 9X+8TIxg262beB9hLWKNveRqUmdA3w3G6E7i0/05w0QA/qtaiq87YOVsR1MW/G7zUHye MC+GDZzHUfmBmvrQFCTfZyomcZQTkOXLw66AQSij/JGXcUomFCD0igE1DX8KXN48zaB3 zxEY1gzC6ya183eY2TsYLsIHLXe7QtdW3AjRlhcifCXaBDn5ha7A9mnl2BhdNxltRXeI cGf7AHqy4ambPrb8/obYLWYRaVJvx8xLiJgu1FK/Vper0TwLgCPyO50CaUo9leVJvdyB ICSg== 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=+S99rEHg1EGofQDRw585sN7UDTePVqxRlmBzxIe2kgI=; b=IpmrrySfHdqahU5mJrqKiHmfewPazFKhEyrGHfwLfTFaG/q2gQVbIbNVWuCEvpBQZA uf/GXDog73Cg0IB2vDwegJz1iT/v/dk/pYTiopHehQEl8HIOvI1EbAoWFlI7C6XqRQTR 06SgNgtvYIDHoXuzkHJnuemZN4LfuNQ3RumMwTA5hB1d4V02EBUrjdpjC3eXTxlcpCaT ui+OXOZkN9lztpeNTv7c5eLF7gBh23vEBSU0IaHqVOeaO7UJoh739gzuahZtq2brRyqL wTvzk3xmc0yhDkeyvqwh/zqqFT4IKN6+35eCoMrLjG+HiZdUaNt6+6fuXyTdnjmElzJG hs/Q== 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 p2si4709502pff.169.2019.08.12.05.17.40; Mon, 12 Aug 2019 05:17:56 -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 S1728417AbfHLMPk (ORCPT + 99 others); Mon, 12 Aug 2019 08:15:40 -0400 Received: from verein.lst.de ([213.95.11.211]:47888 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbfHLMPk (ORCPT ); Mon, 12 Aug 2019 08:15:40 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id EC352227A8C; Mon, 12 Aug 2019 14:15:33 +0200 (CEST) Date: Mon, 12 Aug 2019 14:15:32 +0200 From: Christoph Hellwig To: "Michael S. Tsirkin" Cc: Christoph Hellwig , Ram Pai , Thiago Jung Bauermann , virtualization@lists.linux-foundation.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jason Wang , David Gibson , Alexey Kardashevskiy , Paul Mackerras , Benjamin Herrenschmidt Subject: Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted Message-ID: <20190812121532.GB9405@lst.de> References: <87zhrj8kcp.fsf@morokweng.localdomain> <20190810143038-mutt-send-email-mst@kernel.org> <20190810220702.GA5964@ram.ibm.com> <20190811055607.GA12488@lst.de> <20190811044431-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190811044431-mutt-send-email-mst@kernel.org> 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 Sun, Aug 11, 2019 at 04:55:27AM -0400, Michael S. Tsirkin wrote: > On Sun, Aug 11, 2019 at 07:56:07AM +0200, Christoph Hellwig wrote: > > So we need a flag on the virtio device, exposed by the > > hypervisor (or hardware for hw virtio devices) that says: hey, I'm real, > > don't take a shortcut. > > The point here is that it's actually still not real. So we would still > use a physical address. However Linux decides that it wants extra > security by moving all data through the bounce buffer. The distinction > made is that one can actually give device a physical address of the > bounce buffer. Sure. The problem is just that you keep piling hacks on top of hacks. We need the per-device flag anyway to properly support hardware virtio device in all circumstances. Instead of coming up with another ad-hoc hack to force DMA uses implement that one proper bit and reuse it here.