Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp858214yba; Fri, 3 May 2019 11:37:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcsxRfBFnk3H8quwWuvQNRssmnUEitvwOF4W2VhDCqYBsMmljPsjHv2YOfo+mefyYHXA5p X-Received: by 2002:a65:408b:: with SMTP id t11mr12390649pgp.372.1556908645222; Fri, 03 May 2019 11:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556908645; cv=none; d=google.com; s=arc-20160816; b=sMFiDCygyBn0mPvpvspRYy1OtHMQdpiiUdaMaCjOIT7M2a1KVlEh1WehakxZ7Gy1lE i2eA+A1NiqgMPGonDxUvka2khqAD0EI9yIkmL7480Ox3GPgGpcKLFy8rx/FWoCzD5ufC N1mJfr84/eMfmUTl4b0SRF82AgoEDA+adYNGAZHOkyF0heLRH4ygw0VUg21x2Hk6NQay 339R4f3jCij0Z9UWLYnRp1aoqN/oVeAkNYkgFLSSbDN00/gWSt7HszIxnHNMfBgBePCi pJCri74PQsSd19qT+JKQbSxIQbI26RMbN7yPjMcSvT7Ndycv1HKua6gZ6G6fVQgLw3ky mzRw== 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=Q7hZet5D3Y1KVXgtMlzA/VSVTbOwwYSjk7AC+3BuoLM=; b=KvnrOqztvBcPhHnSn4yP/GApgkkw5tASBjhik8/9XDw78iqtXPffcR7yBd2fd1d69N gVJQgeSSSMhUqS7vF1JelV/9posFZ8n8hlq+fOt5wq/HHY7yz25ASuvZbDw1j1XwXqL5 apkQjexrhOeQBk3zim5hPM9SewQGu5Kqsbb0hJ7vttQo0SpwPtXQXG+dQ/S+2DeZRGw6 gSHUqK8LSGp5YYTBhLSuVbrJrsWfYT+PMGMGeQx0ek9BzIc9Tf24uGtPuzLfc5Am9CpY fV3d4uV83enwh5uPIFtK0Q6wREKcTKsSYqTEcU+g5V+RzfBYF4/fIRNRnerzdkcSZfab iHvw== 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 j9si3497019pgh.206.2019.05.03.11.36.55; Fri, 03 May 2019 11:37:25 -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 S1728386AbfECQ2z (ORCPT + 99 others); Fri, 3 May 2019 12:28:55 -0400 Received: from foss.arm.com ([217.140.101.70]:36690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726444AbfECQ2y (ORCPT ); Fri, 3 May 2019 12:28:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 17C7FA78; Fri, 3 May 2019 09:28:54 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E4AE3F557; Fri, 3 May 2019 09:28:49 -0700 (PDT) Date: Fri, 3 May 2019 17:28:46 +0100 From: Catalin Marinas To: Jason Gunthorpe 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: <20190503162846.GI55449@arrakis.emea.arm.com> References: <1e2824fd77e8eeb351c6c6246f384d0d89fd2d58.1553093421.git.andreyknvl@google.com> <20190429180915.GZ6705@mtr-leonro.mtl.com> <20190430111625.GD29799@arrakis.emea.arm.com> <20190502184442.GA31165@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502184442.GA31165@ziepe.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The tag is a property of the buffer address/pointer when accessed by the CPU at that specific address range. Any DMA or even kernel accessing it through the linear mapping (get_user_pages()) would drop such tag. -- Catalin