Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2444910ybl; Sun, 11 Aug 2019 01:46:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDP6N0GavDYZxuxyiswqs6aEUUnydwBtRq9ni7pDqTyjGPpNOWkzGGZPA0Z1vxCCS1YwE0 X-Received: by 2002:a17:90a:28e4:: with SMTP id f91mr17546857pjd.99.1565513161392; Sun, 11 Aug 2019 01:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565513161; cv=none; d=google.com; s=arc-20160816; b=zgen+Dfg9nxbbiDqIBsWrubvsk5Fyr05xWnDKTQRMEmx218HLFvePjrr2nbyjlBVjz YeslV4RYChoag5O3eScZTNADFhHehOuINHpFyYqL8fVr3Xfoue72fKNQUnna+i5OygTP bHdGS34+aP2ovdeeyoGF/F0ZAg9ry2GWzgFcy7aEeLJppJXck9GGmloBNd3OI4d+yWJG ZnGi11mfSB0MnfOjwJxjctQh60FZP3YtSVLKHDFDNsda4lzPrXGAyGxNfc7pff4pH/Ps 7GDIn6ImTkkm23kLurEexDnB776UKpMXjSsPdiE9aNhMWWabFeYaQRXCcFt1XCGf2HAr J3aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=hcr1GZOkXo/SpBuFQN2sn5O4znC3vPI6qwtk9Hnv4bM=; b=WJZM+epp/au4DUcIbdGyFn1CHV1PREEpGtA+wXco6MFJ0VlgOUPBSf9bNqNgS9VOms CwwR/0hteGbtuXlqJPMeOnnLt7zthbMJ7HlermjntBFHESAROZIceKxedAVXBS+NA5ib 2sbyLXavauaGRwThNaOqbWiJfJIOdpGUu90HWPxh+q/Gf+ukvTwxl8qpPj5jpxTqB8W8 YXGjWBXFLSYuJcaLVx5FdF1rBVTiiLJRyMKnFWwL4aDWdKTQlnGtdldZgwvfBJUxt/y6 xKfC+fDOp6nw9N0SQScAypFGGo3wcgvpyEZvVrBgrbDtbOYXCab0it4kJ0ApDjcv9fQu 4NOQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o61si59955583pld.392.2019.08.11.01.45.45; Sun, 11 Aug 2019 01:46:01 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfHKIoY (ORCPT + 99 others); Sun, 11 Aug 2019 04:44:24 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35774 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfHKIoY (ORCPT ); Sun, 11 Aug 2019 04:44:24 -0400 Received: by mail-qk1-f196.google.com with SMTP id r21so74957911qke.2 for ; Sun, 11 Aug 2019 01:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hcr1GZOkXo/SpBuFQN2sn5O4znC3vPI6qwtk9Hnv4bM=; b=g2bGvZkA0JSKqZNhxcNaZrlUsq6SjfZrwahmt16MFJ86y9RwK4shxK+muKdvBImABD 2vgQskyEUJ98R+AiLdts57h0mXyLvtQRrQBREdl3odX2ju6xsDQT1mFEm70hQ17zAisc H4TS6PnKMPFsnUu2c6izwaDNs/1aCbephdkdbNjhj9qjonGntG7fsD7+jKELo0WlNmE3 E8l0K9BwdeeJFgDDz0Fcyrr6lUPQ88ekd6DeuORYAHS0mOPSiGq6U2ymlgt74mNyaa93 8VCrUKbCQ51+ehjP5QKmYnICS7/+Sco7wkKhwSQLQbn4zTP+vBOjJ75QPHpOF71/olma 8zKA== X-Gm-Message-State: APjAAAXuIbx3NUC+H13C2XrM7CVgny0TYwlXbuUgq2NFe7LPyWHSzqpQ 29iDh4U2CefW1KQPsKW6utXwZg== X-Received: by 2002:a37:b303:: with SMTP id c3mr25443520qkf.253.1565513063479; Sun, 11 Aug 2019 01:44:23 -0700 (PDT) Received: from redhat.com (bzq-79-181-91-42.red.bezeqint.net. [79.181.91.42]) by smtp.gmail.com with ESMTPSA id 23sm42858742qkk.121.2019.08.11.01.44.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 01:44:22 -0700 (PDT) Date: Sun, 11 Aug 2019 04:44:17 -0400 From: "Michael S. Tsirkin" To: Ram Pai Cc: Christoph Hellwig , 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 , David Gibson , Alexey Kardashevskiy , Paul Mackerras , Benjamin Herrenschmidt Subject: Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted Message-ID: <20190811044256-mutt-send-email-mst@kernel.org> References: <87zhrj8kcp.fsf@morokweng.localdomain> <20190810143038-mutt-send-email-mst@kernel.org> <20190810220702.GA5964@ram.ibm.com> <20190811055607.GA12488@lst.de> <20190811064621.GB5964@ram.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190811064621.GB5964@ram.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 10, 2019 at 11:46:21PM -0700, Ram Pai wrote: > On Sun, Aug 11, 2019 at 07:56:07AM +0200, Christoph Hellwig wrote: > > sev_active() is gone now in linux-next, at least as a global API. > > > > And once again this is entirely going in the wrong direction. The only > > way using the DMA API is going to work at all is if the device is ready > > for it. 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. > > > > And that means on power and s390 qemu will always have to set thos if > > you want to be ready for the ultravisor and co games. It's not like we > > haven't been through this a few times before, have we? > > > We have been through this so many times, but I dont think, we ever > understood each other. I have a fundamental question, the answer to > which was never clear. Here it is... > > If the hypervisor (hardware for hw virtio devices) does not mandate a > DMA API, why is it illegal for the driver to request, special handling > of its i/o buffers? Why are we associating this special handling to > always mean, some DMA address translation? Can't there be > any other kind of special handling needs, that has nothing to do with > DMA address translation? I think the answer to that is, extend the DMA API to cover that special need then. And that's exactly what dma_addr_is_phys_addr is trying to do. > > -- > Ram Pai