Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp278659ybg; Thu, 17 Oct 2019 22:58:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyw64dbwBZ8JsWz9FgJ/HeYfhp9FLTIj9weYGWV4s0JoKjyvSxovnA4fvn5L2IT3pGv6QPc X-Received: by 2002:a17:906:b74f:: with SMTP id fx15mr6970755ejb.69.1571378306395; Thu, 17 Oct 2019 22:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571378306; cv=none; d=google.com; s=arc-20160816; b=xmR1QaAAZpwjyZ+BHx9hqwXQGIvL8sKanPL7TvKS76fqLETy0wTjQJTE553KthiQ96 8dgd3acaO0afO/rCUAwsYx79icyAsxJW8RrSRwrmErGdpN9MyZks99cNA8CjRe2RZ2BY M6aH1MPJcnDD0sR4LQQlNjye/HAClmbE7cuGtKioMfq9n7Rs0X0Rn3ILRSRW32OqMCHQ skbUaXU8wCxm7YCZpcBroPqvKCs2qe/HRJuK/eJOyIxFVwBsSrw1M8s4uFVM5kliDJ26 gu+rW4Huq01Kq8aNQrnNbv6nFkMixOXELLjfQ7TNp3LIP7fCtDG8abz3lpup0j+GG2kM hytQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=4b2lsSY6RpiCQ3cZk7ooZlkDzGldjLe+k3Kr+VMYl7Q=; b=rkalu5RlcCmdZ/EHsFlrza0kQfx+aA0+PVBghb2YAuscZDWza5VPt7gkHeG695QdRQ j64B0wV96nyqrvxIduUQQzvOkcuQRri5xClsiFKdNwX8lqx+2GRmdqA4oxxKYlCWpb24 /8YjFSdBDhVEwqaoxiaLtM6Owby+qQIqiv9UE0jnTF3rh3tbZHrIaRXiKXp46ibzgYEl +Nma+6Vky4hvTICevBvqYDJpU8Du58gjEzIlQuPHp3Q4rXLFa79IPFskYSuGP3DtTdkf 7N1PrlHh8T+1Q9edyu14+ilVGrD57yJqSlqltoH9x5+IISH24uE/gaYaIOYZkxA4BKsb TTXg== 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 f45si3260959eda.345.2019.10.17.22.58.02; Thu, 17 Oct 2019 22:58:26 -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 S2407146AbfJQCeJ (ORCPT + 99 others); Wed, 16 Oct 2019 22:34:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34792 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392062AbfJQCeJ (ORCPT ); Wed, 16 Oct 2019 22:34:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED16410DCC97; Thu, 17 Oct 2019 02:34:07 +0000 (UTC) Received: from [10.72.12.185] (ovpn-12-185.pek2.redhat.com [10.72.12.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 138295D9DC; Thu, 17 Oct 2019 02:34:00 +0000 (UTC) Subject: Re: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted To: Christoph Hellwig , 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, andmike@us.ibm.com, sukadev@linux.vnet.ibm.com 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> <20191015073501.GA32345@lst.de> From: Jason Wang Message-ID: <398dce4b-9290-0b14-28b1-e521331ec309@redhat.com> Date: Thu, 17 Oct 2019 10:33:59 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191015073501.GA32345@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Thu, 17 Oct 2019 02:34:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/15 下午3:35, Christoph Hellwig wrote: > 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. I agree, the only reason for IOMMU_PLATFORM is to make sure guest works for some old and buggy qemu when vIOMMU is enabled which seems useless (note we don't even support vIOMMU migration in that case). Thanks