linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Leon Romanovsky <leon@kernel.org>,
	Andrey Konovalov <andreyknvl@google.com>,
	Will Deacon <will.deacon@arm.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Kees Cook <keescook@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Yishai Hadas <yishaih@mellanox.com>,
	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 <dvyukov@google.com>,
	Kostya Serebryany <kcc@google.com>,
	Evgeniy Stepanov <eugenis@google.com>,
	Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
	Ruben Ayrapetyan <Ruben.Ayrapetyan@arm.com>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Dave Martin <Dave.Martin@arm.com>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Szabolcs Nagy <Szabolcs.Nagy@arm.com>
Subject: Re: [PATCH v13 16/20] IB/mlx4, arm64: untag user pointers in mlx4_get_umem_mr
Date: Fri, 3 May 2019 17:28:46 +0100	[thread overview]
Message-ID: <20190503162846.GI55449@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190502184442.GA31165@ziepe.ca>

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


  reply	other threads:[~2019-05-03 16:28 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 14:51 [PATCH v13 00/20] arm64: untag user pointers passed to the kernel Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 01/20] uaccess: add untagged_addr definition for other arches Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 02/20] arm64: untag user pointers in access_ok and __uaccess_mask_ptr Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 03/20] lib, arm64: untag user pointers in strn*_user Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls Andrey Konovalov
2019-03-22 11:43   ` Catalin Marinas
2019-03-28 18:10     ` Andrey Konovalov
2019-03-28 18:19       ` Steven Rostedt
2019-03-29 10:30         ` Catalin Marinas
2019-04-02 12:47           ` Andrey Konovalov
2019-04-11 16:40             ` Andrey Konovalov
2019-04-26 14:17             ` Catalin Marinas
2019-04-29 14:22               ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 05/20] mm, arm64: untag user pointers in mm/gup.c Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 06/20] mm, arm64: untag user pointers in get_vaddr_frames Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 07/20] fs, arm64: untag user pointers in copy_mount_options Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 08/20] fs, arm64: untag user pointers in fs/userfaultfd.c Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive Andrey Konovalov
2019-03-22 12:04   ` Catalin Marinas
2019-03-25 13:54     ` Kevin Brodsky
2019-04-01 16:04       ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 10/20] kernel, arm64: untag user pointers in prctl_set_mm* Andrey Konovalov
2019-03-21 17:52   ` Kevin Brodsky
2019-03-22 15:41   ` Catalin Marinas
2019-04-01 16:44     ` Andrey Konovalov
2019-04-11 16:40       ` Andrey Konovalov
2019-04-26 14:50       ` Catalin Marinas
2019-04-29 14:23         ` Andrey Konovalov
2019-05-01 14:43           ` Vincenzo Frascino
2019-03-20 14:51 ` [PATCH v13 11/20] tracing, arm64: untag user pointers in seq_print_user_ip Andrey Konovalov
2019-03-22 15:45   ` Catalin Marinas
2019-04-01 15:38     ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 12/20] uprobes, arm64: untag user pointers in find_active_uprobe Andrey Konovalov
2019-03-22 15:46   ` Catalin Marinas
2019-03-20 14:51 ` [PATCH v13 13/20] bpf, arm64: untag user pointers in stack_map_get_build_id_offset Andrey Konovalov
2019-03-22 15:52   ` Catalin Marinas
2019-04-01 16:00     ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages Andrey Konovalov
2019-03-22 15:59   ` Catalin Marinas
2019-03-25 14:02     ` Kevin Brodsky
2019-03-25 22:21   ` Kuehling, Felix
2019-04-02 14:37     ` Andrey Konovalov
2019-04-02 17:52       ` Kuehling, Felix
2019-03-20 14:51 ` [PATCH v13 15/20] drm/radeon, arm64: untag user pointers in radeon_ttm_tt_pin_userptr Andrey Konovalov
2019-03-22 16:00   ` Catalin Marinas
2019-04-02 14:17     ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 16/20] IB/mlx4, arm64: untag user pointers in mlx4_get_umem_mr Andrey Konovalov
2019-04-29 18:09   ` Leon Romanovsky
2019-04-30 11:16     ` Catalin Marinas
2019-04-30 12:03       ` Leon Romanovsky
2019-05-02 18:44       ` Jason Gunthorpe
2019-05-03 16:28         ` Catalin Marinas [this message]
2019-05-03 23:52           ` Jason Gunthorpe
2019-03-20 14:51 ` [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get Andrey Konovalov
2019-03-22 16:07   ` Catalin Marinas
2019-03-25 14:08     ` Kevin Brodsky
2019-04-01 16:13       ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 18/20] tee/optee, arm64: untag user pointers in check_mem_type Andrey Konovalov
2019-03-22 16:22   ` Catalin Marinas
2019-04-01 16:31     ` Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 19/20] vfio/type1, arm64: untag user pointers in vaddr_get_pfn Andrey Konovalov
2019-03-20 14:51 ` [PATCH v13 20/20] selftests, arm64: add a selftest for passing tagged pointers to kernel Andrey Konovalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190503162846.GI55449@arrakis.emea.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Dave.Martin@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Ruben.Ayrapetyan@arm.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=davem@davemloft.net \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=eugenis@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=kcc@google.com \
    --cc=keescook@chromium.org \
    --cc=kevin.brodsky@arm.com \
    --cc=leon@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=will.deacon@arm.com \
    --cc=yishaih@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).