From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752172AbdJROXf (ORCPT ); Wed, 18 Oct 2017 10:23:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887AbdJROXe (ORCPT ); Wed, 18 Oct 2017 10:23:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D43F621879 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=leon@kernel.org Date: Wed, 18 Oct 2017 17:23:28 +0300 From: Leon Romanovsky To: "Wei Hu (Xavier)" Cc: lijun_nudt@163.com, linux-rdma@vger.kernel.org, shaobohsu@163.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, dledford@redhat.com, zhangxiping3@huawei.com, shaoboxu@tom.com, shaobo.xu@intel.com, "Liuyixian (Eason)" , "Chenxin (Charles)" Subject: Re: [PATCH for-next 2/4] RDMA/hns: Add IOMMU enable support in hip08 Message-ID: <20171018142328.GQ2106@mtr-leonro.local> References: <1506763741-81429-1-git-send-email-xavier.huwei@huawei.com> <1506763741-81429-3-git-send-email-xavier.huwei@huawei.com> <20170930161023.GI2965@mtr-leonro.local> <59E713EE.5040703@huawei.com> <59E71AE2.6080202@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QV9egoCq9O4JbpTr" Content-Disposition: inline In-Reply-To: <59E71AE2.6080202@huawei.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --QV9egoCq9O4JbpTr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 18, 2017 at 05:12:02PM +0800, Wei Hu (Xavier) wrote: > > > On 2017/10/18 16:42, Wei Hu (Xavier) wrote: > > > > > > On 2017/10/1 0:10, Leon Romanovsky wrote: > > > On Sat, Sep 30, 2017 at 05:28:59PM +0800, Wei Hu (Xavier) wrote: > > > > If the IOMMU is enabled, the length of sg obtained from > > > > __iommu_map_sg_attrs is not 4kB. When the IOVA is set with the sg > > > > dma address, the IOVA will not be page continuous. and the VA > > > > returned from dma_alloc_coherent is a vmalloc address. However, > > > > the VA obtained by the page_address is a discontinuous VA. Under > > > > these circumstances, the IOVA should be calculated based on the > > > > sg length, and record the VA returned from dma_alloc_coherent > > > > in the struct of hem. > > > > > > > > Signed-off-by: Wei Hu (Xavier) > > > > Signed-off-by: Shaobo Xu > > > > Signed-off-by: Lijun Ou > > > > --- > > > Doug, > > > > > > I didn't invest time in reviewing it, but having "is_vmalloc_addr" in > > > driver code to deal with dma_alloc_coherent is most probably wrong. > > > > > > Thanks > > > > > Hi, Doug > > When running in ARM64 platform, there probably be calltrace > > currently. > > Now our colleague will report it to iommu maillist and try to solve > > it. > > I also think RoCE driver shouldn't sense the difference. > > I will pull it out of this series and send v2. > > Thanks. > > > Hi, Doug & Leon > I have sent patch v2. > Thanks > Thanks --QV9egoCq9O4JbpTr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAlnnY+AACgkQ5GN7iDZy WKelfhAAm2g/HrQIN9yp3IT4TPlrgMIbb8JSf3e2ewkLEzmPNb4+IWgQukawfCYo KP9aOaynoHLxkePEjuu4jj5ufFdjMeZKjGBmW70u9F2WaMN3T/ix/xYZMs+xIr36 nrirQxoe38E+V1oNknAsz0I1YYb2HcbTlXOZ+fxE9jznrocKScZCyC0Ny4/LR16D meyzfx21bQNReALUR1bjfbuw2zxIB6y+V3OkQoTdiKxh0RS+H1bK0m6r2AD6s6Ps s4lPfdp8NqIyN97X+I9el4DSV6NFu3YKosMHEGMupQdLJBTsOjLoi95fncC1rpLj T2V3eIt2hequaAtQUGWfG3tpfkNXxXGSbpMekQDkAHLmCsXXXhMKgmlDOw9IsuTc eGJt2vbl89jyvS7c3PmKXj8rHtt3zXUs67i5lhBDRt2kx9XujEsErjSiIhwU+oCY WnzGSqTP1N0qIxbCVOgK7m+39j5kg9/yS6hm8srIJUxuBneAqclA3kbimMQoP7Kg dx5uw/pC0qP4E5rQNOvjJ67Wq/g5jQwQV0sdBWpU5onrUXNgxWgdAn1/KkBUY1JM Yb4HFereHLQFHBc1F5AJoX4/s+6V2X9r99HD5BLPhEMO6aIh59F8RUrgvr0I8FkY tqN6vFR1DvuylUptU5RWhB3kWsKUDGrGCx+t4n1/aKSj9U656Xc= =2/sh -----END PGP SIGNATURE----- --QV9egoCq9O4JbpTr--