Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5527832ybp; Tue, 15 Oct 2019 00:36:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfsIwmWYJM6aeWDceyPdgaQinVE/DeR/exEy08oPXELyYp+RKqiEezNH0CoXXeZ98LpV1t X-Received: by 2002:a17:906:3797:: with SMTP id n23mr32564774ejc.284.1571124964327; Tue, 15 Oct 2019 00:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571124964; cv=none; d=google.com; s=arc-20160816; b=XvGRCWXD34wjxuMrjP9RKkUW7bSye8+cvPuOoas1lG2XaAkYHLk0Qy9FDL6pFnWjWE Oj3fC3tQL3YYsTCz+i7Rju+xH2dP2Kdhg7QbtYZ1LN02Rc0Y1O0bpViYxinw95a1It4l kO/froHu66u7E6NFrWrRDG/3U6wzUR0RX1oYLbuxsoQpiJ/oiUOenG4LxWxyvxrnPkJE O0lmA3agg2Cc+w7wSTW+QJrhJslW4PDbfMWFysX6469/EpBCDVqDqXEDhsdvNhwaDdP9 BInJD7okkOBA0uugCxFqC1/UKp29hgIParduKspjAvzYR1flZaoICsjy4VmtVHBIcmJx P09g== 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=DtoUoEMr/OHlRO/n1wP8mlIoj3rm+S9QxWXFF61yFTU=; b=ucgFIr+WMjEF2mfOR2Naqt7WqGTK92gfUEwQMHUJowC+Nr4TX3TJISleqFdxG1A5p5 mPdKJnO3h3WBCJCA/pkVYrUL0kgSm39HnJWsizw3M6jtGXo91A/uDKr5kKzWYTg9Avg2 frrrCTTBKnwHC0Ci0SfUoWvrI2+jU6yc9W4rmshq2dx5zGF5q8dX3aPkvC35xdDVXCwE ELEivbPxlJXuOC07i2cTemq36yifsG3bHiJwzNPaw1niYlToPTEJmAUu9HZBUQ66qbNW KLf0MFQ5UzZKAf/ZtYJbOhBgkmZlYzLn4nD6HiXEXfLXDSFGPurfU+vwOqco4YEzasEg fo0Q== 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 i13si12014923edv.182.2019.10.15.00.35.39; Tue, 15 Oct 2019 00:36:04 -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 S1727427AbfJOHfJ (ORCPT + 99 others); Tue, 15 Oct 2019 03:35:09 -0400 Received: from verein.lst.de ([213.95.11.211]:53300 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbfJOHfJ (ORCPT ); Tue, 15 Oct 2019 03:35:09 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 4C96D68CEE; Tue, 15 Oct 2019 09:35:02 +0200 (CEST) Date: Tue, 15 Oct 2019 09:35:01 +0200 From: Christoph Hellwig To: Ram Pai Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, virtualization@lists.linux-foundation.org, benh@kernel.crashing.org, david@gibson.dropbear.id.au, mpe@ellerman.id.au, paulus@ozlabs.org, mdroth@linux.vnet.ibm.com, aik@linux.ibm.com, paul.burton@mips.com, robin.murphy@arm.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, hch@lst.de, jasowang@redhat.com, andmike@us.ibm.com, sukadev@linux.vnet.ibm.com Subject: Re: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted Message-ID: <20191015073501.GA32345@lst.de> References: <1570843519-8696-1-git-send-email-linuxram@us.ibm.com> <1570843519-8696-2-git-send-email-linuxram@us.ibm.com> <1570843519-8696-3-git-send-email-linuxram@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570843519-8696-3-git-send-email-linuxram@us.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 Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote: > From: Thiago Jung Bauermann > > Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must > be set by both device and guest driver. However, as a hack, when DMA API > returns physical addresses, guest driver can use the DMA API; even though > device does not set VIRTIO_F_IOMMU_PLATFORM and just uses physical > addresses. Sorry, but this is a complete bullshit hack. Driver must always use the DMA API if they do DMA, and if virtio devices use physical addresses that needs to be returned through the platform firmware interfaces for the dma setup. If you don't do that yet (which based on previous informations you don't), you need to fix it, and we can then quirk old implementations that already are out in the field. In other words: we finally need to fix that virtio mess and not pile hacks on top of hacks.