Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1127874yba; Fri, 3 May 2019 16:55:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6N11lteOlrwR9IzzKYT0zbFlZ50IwHX0rRCrgQLiXEBfvo/YgR7cazI5IPJps9J43ZmGf X-Received: by 2002:a17:902:2dc3:: with SMTP id p61mr14377888plb.308.1556927718873; Fri, 03 May 2019 16:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556927718; cv=none; d=google.com; s=arc-20160816; b=f8FlcSswewvF9KDqGUyhokcVNMbYdo+EvT7muMZLvWTJRzk6a8frtmFpyw7NOGw1ab ggZRDC2AxS50OfGr3UQ3Do8BfBVVwkljs30+DEMk2b0MspFvYyQQTkuAkRSRdf+Ky51w +3lOsP7n7vbZIxgg95EL4gFDyYpGwf63/jwiL9ZCJILjetBKs4VK1xjI28C+9WqjfvP0 N45HqYJYv2lPxXrMWgukKciG4i1WHNqK1erMjSVaM7p3nqgX+UTD1u5xoGy8ak1ixovq E7XXhyFUEk9vHD1BuVnTWIVqIRVeQNj1IMpCTma5cUfBOKzEQkr6WdTjcwKixW8m1x9s 15ZQ== 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:dkim-signature; bh=Y9uds37g7f4813/ZqlKEDnGn948IiuDvboVC7bPadlI=; b=zU7nrXw0S70mxCgOyxoLiVvkjCNxIwcHFVq0vmD24MA2vgMopyxiBwhdX3MfCDWGfv V++Mon2+yAXzQIScMG/NpippOfwnhmWoa5U4ZfwYud232NYK7vTQfJNF9OjHP4hwZZ1L 8dH9T7J472xPUpZq6Dt1ZsYqlv+M4xv9ZKLegi++fpIxHopzWgVPt2niIR9RLg2ZEEcL FQq0QNT5HXYLZpxlfmMQUb8WmdsJsIb0HlorGHu+xtYfhvJlEUmI2CQ1/eUUq0RHD/oO g24alNp0QTtMVHiYjPGzHUNfDxmdy8HzftYRsvYohyzWSbvN1cURBgEbaWJjxhiuXiFI 4+Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=N9BE3PqM; 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 d37si4662972plb.401.2019.05.03.16.54.59; Fri, 03 May 2019 16:55:18 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=N9BE3PqM; 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 S1727093AbfECXw7 (ORCPT + 99 others); Fri, 3 May 2019 19:52:59 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39213 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbfECXw6 (ORCPT ); Fri, 3 May 2019 19:52:58 -0400 Received: by mail-qt1-f195.google.com with SMTP id y42so8714634qtk.6 for ; Fri, 03 May 2019 16:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y9uds37g7f4813/ZqlKEDnGn948IiuDvboVC7bPadlI=; b=N9BE3PqMA0nL0NvpOU63kepSs17NWxuaQGMx7Tupv6wpFQNuRqB6tenh0G/BWpJ1PP HEd7ZRYuplIPMrp/i3Cbd8pyLv65lE/Kcn6MATxFD0LAM764ONzAI9CGs51aZh5QkF2i IUvMmfzMxlcfJSqngQx2TZEML8ZbCAHWTFmHtqfhFJeQ8JVqaTAgfiqfKRaZhlNd6jZX Xiy8j3oAf41/Kg4WEp6FuwvI9DlafHuBxOiRzLclafXL2AMIXhBmFJmJrK5KHtm2pgmi Pkc8sfsyJqh6zaTpfCu0T9ewb4rk6AtpL8uJLJA4xZTB0LSOR9blqcrj5s/eIqJuMPaw q8oA== 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:user-agent; bh=Y9uds37g7f4813/ZqlKEDnGn948IiuDvboVC7bPadlI=; b=t+TTuajcYJMoUZMMWXQOPdchC0V0eKSTEIE+Sfu8Em+nJ01Mmta2GmlE4Xqe1x5s7d NEciRXfxOJ3TUPiw9U3z2Az8jOgKLUGr2w3r9AxZ6Hv9D5EjAL2pf4Zv8g2G4pZe7x94 U9hgVft3VJo5DFN5IvvGWHhYZ4JAzQ8gm6bEVLV2yjIkvadMLm+na5p22i8iaWNb5YuZ LSGTKX5ac/RVLZYV3b4faWokBMgSFlfwMFbokH90uWrLaxtg7FqDxzG6ITXlCePEFhZk +bbj4+ZlXh9E9vZIBskklEtULnM7c2boOt31BItJupsPtUPFgElBpTmeppKkKvbChAwW s2QQ== X-Gm-Message-State: APjAAAWIrAh/B64NCjRN67+T+9vyIpftu6bf3sx/IS5p2hSeE+RASEkG 9f9P/8Dz91cMoO3FArMBkZAepg== X-Received: by 2002:ac8:8ad:: with SMTP id v42mr10692638qth.337.1556927577786; Fri, 03 May 2019 16:52:57 -0700 (PDT) Received: from ziepe.ca ([65.119.211.164]) by smtp.gmail.com with ESMTPSA id r1sm1636491qtp.77.2019.05.03.16.52.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 16:52:56 -0700 (PDT) Received: from jgg by jggl.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hMhz6-0001lg-BL; Fri, 03 May 2019 20:52:56 -0300 Date: Fri, 3 May 2019 20:52:56 -0300 From: Jason Gunthorpe To: Catalin Marinas Cc: Leon Romanovsky , Andrey Konovalov , Will Deacon , Robin Murphy , Kees Cook , Greg Kroah-Hartman , Andrew Morton , Vincenzo Frascino , Eric Dumazet , "David S. Miller" , Yishai Hadas , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Vyukov , Kostya Serebryany , Evgeniy Stepanov , Ramana Radhakrishnan , Ruben Ayrapetyan , Luc Van Oostenryck , Dave Martin , Kevin Brodsky , Szabolcs Nagy Subject: Re: [PATCH v13 16/20] IB/mlx4, arm64: untag user pointers in mlx4_get_umem_mr Message-ID: <20190503235256.GB6660@ziepe.ca> References: <1e2824fd77e8eeb351c6c6246f384d0d89fd2d58.1553093421.git.andreyknvl@google.com> <20190429180915.GZ6705@mtr-leonro.mtl.com> <20190430111625.GD29799@arrakis.emea.arm.com> <20190502184442.GA31165@ziepe.ca> <20190503162846.GI55449@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503162846.GI55449@arrakis.emea.arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 03, 2019 at 05:28:46PM +0100, Catalin Marinas wrote: > Thanks Jason and Leon for the information. > > On Thu, May 02, 2019 at 03:44:42PM -0300, Jason Gunthorpe wrote: > > On Tue, Apr 30, 2019 at 12:16:25PM +0100, Catalin Marinas wrote: > > > > Interesting, the followup question is why mlx4 is only one driver in IB which > > > > needs such code in umem_mr. I'll take a look on it. > > > > > > I don't know. Just using the light heuristics of find_vma() shows some > > > other places. For example, ib_umem_odp_get() gets the umem->address via > > > ib_umem_start(). This was previously set in ib_umem_get() as called from > > > mlx4_get_umem_mr(). Should the above patch have just untagged "start" on > > > entry? > > > > I have a feeling that there needs to be something for this in the odp > > code.. > > > > Presumably mmu notifiers and what not also use untagged pointers? Most > > likely then the umem should also be storing untagged pointers. > > Yes. > > > This probably becomes problematic because we do want the tag in cases > > talking about the base VA of the MR.. > > It depends on whether the tag is relevant to the kernel or not. The only > useful case so far is for the kernel performing copy_form_user() etc. > accesses so they'd get checked in the presence of hardware memory > tagging (MTE; but it's not mandatory, a 0 tag would do as well). > > If we talk about a memory range where the content is relatively opaque > (or irrelevant) to the kernel code, we don't really need the tag. I'm > not familiar to RDMA but I presume it would be a device accessing such > MR but not through the user VA directly. RDMA exposes the user VA directly (the IOVA) as part of the wire protocol, we must preserve the tag in these cases as that is what the userspace is using for the pointer. So the ODP stuff will definately need some adjusting when it interacts with the mmu notifiers and get user pages. Jason