Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp188040ybv; Tue, 4 Feb 2020 19:14:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxfwX5vJkbXDnWF66cXg28rMP8GE1nt/FUWlZCxeVf2E8SO0/HrB5EIcj//cRPPVdmf5Sr5 X-Received: by 2002:a9d:d0b:: with SMTP id 11mr25342107oti.287.1580872458376; Tue, 04 Feb 2020 19:14:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580872458; cv=none; d=google.com; s=arc-20160816; b=WInAd89YwVI2CLI4cAewH1qrd3hjvsf6KluvH9txp2A3aq1wa3W6zb5guS/g+zjnDb Tz3XoB1IN+RiRHDd2TG5tWnAKwexB20LBh7qsbEFQeaCsaBmsRCMT6FAHnOgzqto7Sv7 4TrlRSrf/hhtWEqJC+Zl8ih0PZAGXtCNOuBBDBxmqPqncVaOm+dl8MdgQlF4CvLALA6W TLXjRX/TjHmAAANKSGUatRh8DRqM3BlDTk5ygm06gc/dLdqwJr8N3aywIATixaDOpUEz jdI38JNG7u5edtnSsaQY6pE9kWJQnvCx14hTNEY5VdnQAOq35RJofLclyIBSt1RyTOfE mWhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=om97GEVSncDJoKUqo0m8J3j6AU1bMxcse0uk6TffhCM=; b=pP8yN3X7fOSOasaOLPCl6pHDCfNl+Uyf2Lti2Xgem93nV2pIIBpTIQv8dTxPlqEaDL 8JTAuq467UtDecbWUJwckrO3PP9tCpYY+FK4Cu6dthLiGJz1mCuBsiyj49XDD566XrEl 2aB3B6zNdlOIkrxe/Cjv0cIqtdJisB0CP0caYbCXz/b2Z1x1UdFUrf9wW6KJ2qh8wfnZ u1F785Yh4EbIm7Si+OzbPHg6WHUGY6CnnsqgytUAJs46FQqI7d0kZWr3jcQWBjJQ3wBS 7oeeVsjBeiwuA8gwl+DlZ7jLjbSZHLfEsu2kSPVW2ziU8KGsdHDFiqmSAj4crfv4UN7S zYCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A5AkKv7G; 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=pass (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 l13si12859517otq.30.2020.02.04.19.14.06; Tue, 04 Feb 2020 19:14:18 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A5AkKv7G; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727926AbgBEDLc (ORCPT + 99 others); Tue, 4 Feb 2020 22:11:32 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:56645 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727792AbgBEDL2 (ORCPT ); Tue, 4 Feb 2020 22:11:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580872287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=om97GEVSncDJoKUqo0m8J3j6AU1bMxcse0uk6TffhCM=; b=A5AkKv7GLFnT2eXTnbIR4CjiAIySxEQNACkZJ/nMdcUwj7tgBOchdNtR5PzZJ+4XmEe6jO 6irU9cFJbtEr/eC68W0tRVqoECeb1DRENHis63dBMhRVay19rfDqQfTg706YJpWBXrUV4H +H5I9/JURytqbg/Cd+ndctjqecGitiM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-LmJy843xOnG34ARnkUMuyQ-1; Tue, 04 Feb 2020 22:11:25 -0500 X-MC-Unique: LmJy843xOnG34ARnkUMuyQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5499618AB2C0; Wed, 5 Feb 2020 03:11:23 +0000 (UTC) Received: from [10.72.13.188] (ovpn-13-188.pek2.redhat.com [10.72.13.188]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5734C87B12; Wed, 5 Feb 2020 03:11:10 +0000 (UTC) Subject: Re: [PATCH] vhost: introduce vDPA based backend To: Tiwei Bie Cc: mst@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, shahafs@mellanox.com, jgg@mellanox.com, rob.miller@broadcom.com, haotian.wang@sifive.com, eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com, rdunlap@infradead.org, hch@infradead.org, jiri@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, maxime.coquelin@redhat.com, lingshan.zhu@intel.com, dan.daly@intel.com, cunming.liang@intel.com, zhihong.wang@intel.com References: <20200131033651.103534-1-tiwei.bie@intel.com> <7aab2892-bb19-a06a-a6d3-9c28bc4c3400@redhat.com> <20200205020247.GA368700@___> From: Jason Wang Message-ID: Date: Wed, 5 Feb 2020 11:11:08 +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: <20200205020247.GA368700@___> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/2/5 =E4=B8=8A=E5=8D=8810:02, Tiwei Bie wrote: >> Before trying to do this it looks to me we need the following during t= he >> probe >> >> 1) if set_map() is not supported by the vDPA device probe the IOMMU th= at is >> supported by the vDPA device >> 2) allocate IOMMU domain >> >> And then: >> >> 3) pin pages through GUP and do proper accounting >> 4) store GPA->HPA mapping in the umem >> 5) generate diffs of memory table and using IOMMU API to setup the dma >> mapping in this method >> >> For 1), I'm not sure parent is sufficient for to doing this or need to >> introduce new API like iommu_device in mdev. > Agree. We may also need to introduce something like > the iommu_device. > Right, this is what I plan to do in next version. Thanks