kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls
       [not found]   ` <44ad2d0c55dbad449edac23ae46d151a04102a1d.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 11:43     ` Catalin Marinas
       [not found]       ` <20190322114357.GC13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 11:43 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:18PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> This patch allows tagged pointers to be passed to the following memory
> syscalls: madvise, mbind, get_mempolicy, mincore, mlock, mlock2, brk,
> mmap_pgoff, old_mmap, munmap, remap_file_pages, mprotect, pkey_mprotect,
> mremap, msync and shmdt.
> 
> This is done by untagging pointers passed to these syscalls in the
> prologues of their handlers.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  ipc/shm.c      | 2 ++
>  mm/madvise.c   | 2 ++
>  mm/mempolicy.c | 5 +++++
>  mm/migrate.c   | 1 +
>  mm/mincore.c   | 2 ++
>  mm/mlock.c     | 5 +++++
>  mm/mmap.c      | 7 +++++++
>  mm/mprotect.c  | 1 +
>  mm/mremap.c    | 2 ++
>  mm/msync.c     | 2 ++
>  10 files changed, 29 insertions(+)

I wonder whether it's better to keep these as wrappers in the arm64
code.

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive
       [not found]   ` <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 12:04     ` Catalin Marinas
       [not found]       ` <20190322120434.GD13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 12:04 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:23PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> tcp_zerocopy_receive() uses provided user pointers for vma lookups, which
> can only by done with untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  net/ipv4/tcp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 6baa6dc1b13b..855a1f68c1ea 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -1761,6 +1761,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
>  	if (address & (PAGE_SIZE - 1) || address != zc->address)
>  		return -EINVAL;
>  
> +	address = untagged_addr(address);
> +
>  	if (sk->sk_state == TCP_LISTEN)
>  		return -ENOTCONN;

I don't think we need this patch if we stick to Vincenzo's ABI
restrictions. Can zc->address be an anonymous mmap()? My understanding
of TCP_ZEROCOPY_RECEIVE is that this is an mmap() on a socket, so user
should not tag such pointer.

We want to allow tagged pointers to work transparently only for heap and
stack, hence the restriction to anonymous mmap() and those addresses
below sbrk(0).

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 10/20] kernel, arm64: untag user pointers in prctl_set_mm*
       [not found]   ` <76f96eb9162b3a7fa5949d71af38bf8fdf6924c4.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 15:41     ` Catalin Marinas
       [not found]       ` <20190322154136.GP13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 15:41 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:24PM +0100, Andrey Konovalov wrote:
> @@ -2120,13 +2135,14 @@ static int prctl_set_mm(int opt, unsigned long addr,
>  	if (opt == PR_SET_MM_AUXV)
>  		return prctl_set_auxv(mm, addr, arg4);
>  
> -	if (addr >= TASK_SIZE || addr < mmap_min_addr)
> +	if (untagged_addr(addr) >= TASK_SIZE ||
> +			untagged_addr(addr) < mmap_min_addr)
>  		return -EINVAL;
>  
>  	error = -EINVAL;
>  
>  	down_write(&mm->mmap_sem);
> -	vma = find_vma(mm, addr);
> +	vma = find_vma(mm, untagged_addr(addr));
>  
>  	prctl_map.start_code	= mm->start_code;
>  	prctl_map.end_code	= mm->end_code;

Does this mean that we are left with tagged addresses for the
mm->start_code etc. values? I really don't think we should allow this,
I'm not sure what the implications are in other parts of the kernel.

Arguably, these are not even pointer values but some address ranges. I
know we decided to relax this notion for mmap/mprotect/madvise() since
the user function prototypes take pointer as arguments but it feels like
we are overdoing it here (struct prctl_mm_map doesn't even have
pointers).

What is the use-case for allowing tagged addresses here? Can user space
handle untagging?

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 11/20] tracing, arm64: untag user pointers in seq_print_user_ip
       [not found]   ` <c9553c3a4850d43c8af0c00e97850d70428b7de7.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 15:45     ` Catalin Marinas
       [not found]       ` <20190322154513.GQ13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 15:45 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:25PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> seq_print_user_ip() uses provided user pointers for vma lookups, which
> can only by done with untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  kernel/trace/trace_output.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> index 54373d93e251..6376bee93c84 100644
> --- a/kernel/trace/trace_output.c
> +++ b/kernel/trace/trace_output.c
> @@ -370,6 +370,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
>  {
>  	struct file *file = NULL;
>  	unsigned long vmstart = 0;
> +	unsigned long untagged_ip = untagged_addr(ip);
>  	int ret = 1;
>  
>  	if (s->full)
> @@ -379,7 +380,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
>  		const struct vm_area_struct *vma;
>  
>  		down_read(&mm->mmap_sem);
> -		vma = find_vma(mm, ip);
> +		vma = find_vma(mm, untagged_ip);
>  		if (vma) {
>  			file = vma->vm_file;
>  			vmstart = vma->vm_start;
> @@ -388,7 +389,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
>  			ret = trace_seq_path(s, &file->f_path);
>  			if (ret)
>  				trace_seq_printf(s, "[+0x%lx]",
> -						 ip - vmstart);
> +						 untagged_ip - vmstart);
>  		}
>  		up_read(&mm->mmap_sem);
>  	}

How would we end up with a tagged address here? Does "ip" here imply
instruction pointer, which we wouldn't tag?

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 12/20] uprobes, arm64: untag user pointers in find_active_uprobe
       [not found]   ` <88d5255400fc6536d6a6895dd2a3aef0f0ecc899.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 15:46     ` Catalin Marinas
  0 siblings, 0 replies; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 15:46 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:26PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> find_active_uprobe() uses user pointers (obtained via
> instruction_pointer(regs)) for vma lookups, which can only by done with
> untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  kernel/events/uprobes.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index c5cde87329c7..d3a2716a813a 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -1992,6 +1992,8 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
>  	struct uprobe *uprobe = NULL;
>  	struct vm_area_struct *vma;
>  
> +	bp_vaddr = untagged_addr(bp_vaddr);
> +
>  	down_read(&mm->mmap_sem);
>  	vma = find_vma(mm, bp_vaddr);
>  	if (vma && vma->vm_start <= bp_vaddr) {

Similarly here, that's a breakpoint address, hence instruction pointer
(PC) which is untagged.

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 13/20] bpf, arm64: untag user pointers in stack_map_get_build_id_offset
       [not found]   ` <09d6b8e5c8275de85c7aba716578fbcb3cbce924.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 15:52     ` Catalin Marinas
       [not found]       ` <20190322155227.GS13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 15:52 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:27PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> stack_map_get_build_id_offset() uses provided user pointers for vma
> lookups, which can only by done with untagged pointers.
> 
> Untag user pointers in this function for doing the lookup and
> calculating the offset, but save as is in the bpf_stack_build_id
> struct.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  kernel/bpf/stackmap.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> index 950ab2f28922..bb89341d3faf 100644
> --- a/kernel/bpf/stackmap.c
> +++ b/kernel/bpf/stackmap.c
> @@ -320,7 +320,9 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
>  	}
>  
>  	for (i = 0; i < trace_nr; i++) {
> -		vma = find_vma(current->mm, ips[i]);
> +		u64 untagged_ip = untagged_addr(ips[i]);
> +
> +		vma = find_vma(current->mm, untagged_ip);
>  		if (!vma || stack_map_get_build_id(vma, id_offs[i].build_id)) {
>  			/* per entry fall back to ips */
>  			id_offs[i].status = BPF_STACK_BUILD_ID_IP;
> @@ -328,7 +330,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
>  			memset(id_offs[i].build_id, 0, BPF_BUILD_ID_SIZE);
>  			continue;
>  		}
> -		id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + ips[i]
> +		id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + untagged_ip
>  			- vma->vm_start;
>  		id_offs[i].status = BPF_STACK_BUILD_ID_VALID;
>  	}

Can the ips[*] here ever be tagged?

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages
       [not found]   ` <017804b2198a906463d634f84777b6087c9b4a40.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 15:59     ` Catalin Marinas
       [not found]       ` <20190322155955.GT13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 15:59 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:28PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> amdgpu_ttm_tt_get_user_pages() uses provided user pointers for vma
> lookups, which can only by done with untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 73e71e61dc99..891b027fa33b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -751,10 +751,11 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
>  		 * check that we only use anonymous memory to prevent problems
>  		 * with writeback
>  		 */
> -		unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
> +		unsigned long userptr = untagged_addr(gtt->userptr);
> +		unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
>  		struct vm_area_struct *vma;
>  
> -		vma = find_vma(mm, gtt->userptr);
> +		vma = find_vma(mm, userptr);
>  		if (!vma || vma->vm_file || vma->vm_end < end) {
>  			up_read(&mm->mmap_sem);
>  			return -EPERM;

I tried to track this down but I failed to see whether user could
provide an tagged pointer here (under the restrictions as per Vincenzo's
ABI document).

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 15/20] drm/radeon, arm64: untag user pointers in radeon_ttm_tt_pin_userptr
       [not found]   ` <038360a0a9dc0abaaaf3ad84a2d07fd544abce1a.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 16:00     ` Catalin Marinas
       [not found]       ` <20190322160057.GU13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 16:00 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:29PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> radeon_ttm_tt_pin_userptr() uses provided user pointers for vma
> lookups, which can only by done with untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  drivers/gpu/drm/radeon/radeon_ttm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 9920a6fc11bf..872a98796117 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -497,9 +497,10 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)
>  	if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) {
>  		/* check that we only pin down anonymous memory
>  		   to prevent problems with writeback */
> -		unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
> +		unsigned long userptr = untagged_addr(gtt->userptr);
> +		unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
>  		struct vm_area_struct *vma;
> -		vma = find_vma(gtt->usermm, gtt->userptr);
> +		vma = find_vma(gtt->usermm, userptr);
>  		if (!vma || vma->vm_file || vma->vm_end < end)
>  			return -EPERM;
>  	}

Same comment as on the previous patch.

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get
       [not found]   ` <ae6961bcdd82e529c76d0747abd310546f81e58e.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 16:07     ` Catalin Marinas
       [not found]       ` <20190322160726.GV13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 16:07 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:31PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> videobuf_dma_contig_user_get() uses provided user pointers for vma
> lookups, which can only by done with untagged pointers.
> 
> Untag the pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  drivers/media/v4l2-core/videobuf-dma-contig.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
> index e1bf50df4c70..8a1ddd146b17 100644
> --- a/drivers/media/v4l2-core/videobuf-dma-contig.c
> +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
> @@ -160,6 +160,7 @@ static void videobuf_dma_contig_user_put(struct videobuf_dma_contig_memory *mem)
>  static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
>  					struct videobuf_buffer *vb)
>  {
> +	unsigned long untagged_baddr = untagged_addr(vb->baddr);
>  	struct mm_struct *mm = current->mm;
>  	struct vm_area_struct *vma;
>  	unsigned long prev_pfn, this_pfn;
> @@ -167,22 +168,22 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
>  	unsigned int offset;
>  	int ret;
>  
> -	offset = vb->baddr & ~PAGE_MASK;
> +	offset = untagged_baddr & ~PAGE_MASK;
>  	mem->size = PAGE_ALIGN(vb->size + offset);
>  	ret = -EINVAL;
>  
>  	down_read(&mm->mmap_sem);
>  
> -	vma = find_vma(mm, vb->baddr);
> +	vma = find_vma(mm, untagged_baddr);
>  	if (!vma)
>  		goto out_up;
>  
> -	if ((vb->baddr + mem->size) > vma->vm_end)
> +	if ((untagged_baddr + mem->size) > vma->vm_end)
>  		goto out_up;
>  
>  	pages_done = 0;
>  	prev_pfn = 0; /* kill warning */
> -	user_address = vb->baddr;
> +	user_address = untagged_baddr;
>  
>  	while (pages_done < (mem->size >> PAGE_SHIFT)) {
>  		ret = follow_pfn(vma, user_address, &this_pfn);

I don't think vb->baddr here is anonymous mmap() but worth checking the
call paths.

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 18/20] tee/optee, arm64: untag user pointers in check_mem_type
       [not found]   ` <665632a911273ab537ded9acb78f4bafd91cbc19.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
@ 2019-03-22 16:22     ` Catalin Marinas
       [not found]       ` <20190322162223.GW13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Catalin Marinas @ 2019-03-22 16:22 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On Wed, Mar 20, 2019 at 03:51:32PM +0100, Andrey Konovalov wrote:
> This patch is a part of a series that extends arm64 kernel ABI to allow to
> pass tagged user pointers (with the top byte set to something else other
> than 0x00) as syscall arguments.
> 
> check_mem_type() uses provided user pointers for vma lookups (via
> __check_mem_type()), which can only by done with untagged pointers.
> 
> Untag user pointers in this function.
> 
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---
>  drivers/tee/optee/call.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
> index a5afbe6dee68..e3be20264092 100644
> --- a/drivers/tee/optee/call.c
> +++ b/drivers/tee/optee/call.c
> @@ -563,6 +563,7 @@ static int check_mem_type(unsigned long start, size_t num_pages)
>  	int rc;
>  
>  	down_read(&mm->mmap_sem);
> +	start = untagged_addr(start);
>  	rc = __check_mem_type(find_vma(mm, start),
>  			      start + num_pages * PAGE_SIZE);
>  	up_read(&mm->mmap_sem);

I guess we could just untag this in tee_shm_register(). The tag is not
relevant to a TEE implementation (firmware) anyway.

-- 
Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive
       [not found]       ` <20190322120434.GD13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-03-25 13:54         ` Kevin Brodsky
       [not found]           ` <e5ed4fff-acf6-7b85-bf8f-df558a9cd33f-5wv7dgnIgG8@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Kevin Brodsky @ 2019-03-25 13:54 UTC (permalink / raw)
  To: Catalin Marinas, Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On 22/03/2019 12:04, Catalin Marinas wrote:
> On Wed, Mar 20, 2019 at 03:51:23PM +0100, Andrey Konovalov wrote:
>> This patch is a part of a series that extends arm64 kernel ABI to allow to
>> pass tagged user pointers (with the top byte set to something else other
>> than 0x00) as syscall arguments.
>>
>> tcp_zerocopy_receive() uses provided user pointers for vma lookups, which
>> can only by done with untagged pointers.
>>
>> Untag user pointers in this function.
>>
>> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>> ---
>>   net/ipv4/tcp.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
>> index 6baa6dc1b13b..855a1f68c1ea 100644
>> --- a/net/ipv4/tcp.c
>> +++ b/net/ipv4/tcp.c
>> @@ -1761,6 +1761,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
>>   	if (address & (PAGE_SIZE - 1) || address != zc->address)
>>   		return -EINVAL;
>>   
>> +	address = untagged_addr(address);
>> +
>>   	if (sk->sk_state == TCP_LISTEN)
>>   		return -ENOTCONN;
> I don't think we need this patch if we stick to Vincenzo's ABI
> restrictions. Can zc->address be an anonymous mmap()? My understanding
> of TCP_ZEROCOPY_RECEIVE is that this is an mmap() on a socket, so user
> should not tag such pointer.

Good point, I hadn't looked into the interface properly. The `vma->vm_ops != 
&tcp_vm_ops` check just below makes sure that the mapping is specifically tied to a 
TCP socket, so definitely not included in the ABI relaxation.

> We want to allow tagged pointers to work transparently only for heap and
> stack, hence the restriction to anonymous mmap() and those addresses
> below sbrk(0).

That's not quite true: in the ABI relaxation v2, all private mappings that are either 
anonymous or backed by a regular file are included. The scope is quite a bit larger 
than heap and stack, even though this is what we're primarily interested in for now.

Kevin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages
       [not found]       ` <20190322155955.GT13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-03-25 14:02         ` Kevin Brodsky
  0 siblings, 0 replies; 24+ messages in thread
From: Kevin Brodsky @ 2019-03-25 14:02 UTC (permalink / raw)
  To: Catalin Marinas, Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On 22/03/2019 15:59, Catalin Marinas wrote:
> On Wed, Mar 20, 2019 at 03:51:28PM +0100, Andrey Konovalov wrote:
>> This patch is a part of a series that extends arm64 kernel ABI to allow to
>> pass tagged user pointers (with the top byte set to something else other
>> than 0x00) as syscall arguments.
>>
>> amdgpu_ttm_tt_get_user_pages() uses provided user pointers for vma
>> lookups, which can only by done with untagged pointers.
>>
>> Untag user pointers in this function.
>>
>> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 73e71e61dc99..891b027fa33b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -751,10 +751,11 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
>>   		 * check that we only use anonymous memory to prevent problems
>>   		 * with writeback
>>   		 */
>> -		unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
>> +		unsigned long userptr = untagged_addr(gtt->userptr);
>> +		unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
>>   		struct vm_area_struct *vma;
>>   
>> -		vma = find_vma(mm, gtt->userptr);
>> +		vma = find_vma(mm, userptr);
>>   		if (!vma || vma->vm_file || vma->vm_end < end) {
>>   			up_read(&mm->mmap_sem);
>>   			return -EPERM;
> I tried to track this down but I failed to see whether user could
> provide an tagged pointer here (under the restrictions as per Vincenzo's
> ABI document).

->userptr is set by radeon_ttm_tt_set_userptr(), itself called from 
radeon_gem_userptr_ioctl(). Any page-aligned value is allowed.

Kevin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get
       [not found]       ` <20190322160726.GV13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-03-25 14:08         ` Kevin Brodsky
       [not found]           ` <bfaae923-98aa-63e7-c50b-8649dc5fe2bb-5wv7dgnIgG8@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Kevin Brodsky @ 2019-03-25 14:08 UTC (permalink / raw)
  To: Catalin Marinas, Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, David (ChunMing) Zhou,
	Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov, Ramana Radhakrishnan, Dave Martin

On 22/03/2019 16:07, Catalin Marinas wrote:
> On Wed, Mar 20, 2019 at 03:51:31PM +0100, Andrey Konovalov wrote:
>> This patch is a part of a series that extends arm64 kernel ABI to allow to
>> pass tagged user pointers (with the top byte set to something else other
>> than 0x00) as syscall arguments.
>>
>> videobuf_dma_contig_user_get() uses provided user pointers for vma
>> lookups, which can only by done with untagged pointers.
>>
>> Untag the pointers in this function.
>>
>> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>> ---
>>   drivers/media/v4l2-core/videobuf-dma-contig.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
>> index e1bf50df4c70..8a1ddd146b17 100644
>> --- a/drivers/media/v4l2-core/videobuf-dma-contig.c
>> +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
>> @@ -160,6 +160,7 @@ static void videobuf_dma_contig_user_put(struct videobuf_dma_contig_memory *mem)
>>   static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
>>   					struct videobuf_buffer *vb)
>>   {
>> +	unsigned long untagged_baddr = untagged_addr(vb->baddr);
>>   	struct mm_struct *mm = current->mm;
>>   	struct vm_area_struct *vma;
>>   	unsigned long prev_pfn, this_pfn;
>> @@ -167,22 +168,22 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
>>   	unsigned int offset;
>>   	int ret;
>>   
>> -	offset = vb->baddr & ~PAGE_MASK;
>> +	offset = untagged_baddr & ~PAGE_MASK;
>>   	mem->size = PAGE_ALIGN(vb->size + offset);
>>   	ret = -EINVAL;
>>   
>>   	down_read(&mm->mmap_sem);
>>   
>> -	vma = find_vma(mm, vb->baddr);
>> +	vma = find_vma(mm, untagged_baddr);
>>   	if (!vma)
>>   		goto out_up;
>>   
>> -	if ((vb->baddr + mem->size) > vma->vm_end)
>> +	if ((untagged_baddr + mem->size) > vma->vm_end)
>>   		goto out_up;
>>   
>>   	pages_done = 0;
>>   	prev_pfn = 0; /* kill warning */
>> -	user_address = vb->baddr;
>> +	user_address = untagged_baddr;
>>   
>>   	while (pages_done < (mem->size >> PAGE_SHIFT)) {
>>   		ret = follow_pfn(vma, user_address, &this_pfn);
> I don't think vb->baddr here is anonymous mmap() but worth checking the
> call paths.

I spent some time on this, I didn't find any restriction on the kind of mapping 
that's allowed here. The API regarding V4L2_MEMORY_USERPTR doesn't seem to say 
anything about that either [0] [1]. It's probably best to ask the V4L2 maintainers.

Kevin

[0] https://www.kernel.org/doc/html/latest/media/uapi/v4l/vidioc-qbuf.html
[1] https://www.kernel.org/doc/html/latest/media/uapi/v4l/userp.html
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls
       [not found]       ` <20190322114357.GC13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-03-28 18:10         ` Andrey Konovalov
  2019-03-28 18:19           ` Steven Rostedt
  0 siblings, 1 reply; 24+ messages in thread
From: Andrey Konovalov @ 2019-03-28 18:10 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 12:44 PM Catalin Marinas
<catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:18PM +0100, Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > This patch allows tagged pointers to be passed to the following memory
> > syscalls: madvise, mbind, get_mempolicy, mincore, mlock, mlock2, brk,
> > mmap_pgoff, old_mmap, munmap, remap_file_pages, mprotect, pkey_mprotect,
> > mremap, msync and shmdt.
> >
> > This is done by untagging pointers passed to these syscalls in the
> > prologues of their handlers.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >  ipc/shm.c      | 2 ++
> >  mm/madvise.c   | 2 ++
> >  mm/mempolicy.c | 5 +++++
> >  mm/migrate.c   | 1 +
> >  mm/mincore.c   | 2 ++
> >  mm/mlock.c     | 5 +++++
> >  mm/mmap.c      | 7 +++++++
> >  mm/mprotect.c  | 1 +
> >  mm/mremap.c    | 2 ++
> >  mm/msync.c     | 2 ++
> >  10 files changed, 29 insertions(+)
>
> I wonder whether it's better to keep these as wrappers in the arm64
> code.

I don't think I understand what you propose, could you elaborate?
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls
  2019-03-28 18:10         ` Andrey Konovalov
@ 2019-03-28 18:19           ` Steven Rostedt
  0 siblings, 0 replies; 24+ messages in thread
From: Steven Rostedt @ 2019-03-28 18:19 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm, Peter Zijlstra, Catalin Marinas,
	Will Deacon, Alexei Starovoitov, dri-devel,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	Jacob Bramley, Daniel Borkmann, linux-rdma, amd-gfx,
	Szabolcs Nagy, Ingo Molnar, Dmitry Vyukov

On Thu, 28 Mar 2019 19:10:07 +0100
Andrey Konovalov <andreyknvl@google.com> wrote:

> > > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > > ---
> > >  ipc/shm.c      | 2 ++
> > >  mm/madvise.c   | 2 ++
> > >  mm/mempolicy.c | 5 +++++
> > >  mm/migrate.c   | 1 +
> > >  mm/mincore.c   | 2 ++
> > >  mm/mlock.c     | 5 +++++
> > >  mm/mmap.c      | 7 +++++++
> > >  mm/mprotect.c  | 1 +
> > >  mm/mremap.c    | 2 ++
> > >  mm/msync.c     | 2 ++
> > >  10 files changed, 29 insertions(+)  
> >
> > I wonder whether it's better to keep these as wrappers in the arm64
> > code.  
> 
> I don't think I understand what you propose, could you elaborate?

I believe Catalin is saying that instead of placing things like:

@@ -1593,6 +1593,7 @@ SYSCALL_DEFINE3(shmat, int, shmid, char __user *, shmaddr, int, shmflg)
 	unsigned long ret;
 	long err;
 
+	shmaddr = untagged_addr(shmaddr);

To instead have the shmaddr set to the untagged_addr() before calling
the system call, and passing the untagged addr to the system call, as
that goes through the arm64 architecture specific code first.

-- Steve
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 11/20] tracing, arm64: untag user pointers in seq_print_user_ip
       [not found]       ` <20190322154513.GQ13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-04-01 15:38         ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 15:38 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 4:45 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:25PM +0100, Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > seq_print_user_ip() uses provided user pointers for vma lookups, which
> > can only by done with untagged pointers.
> >
> > Untag user pointers in this function.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >  kernel/trace/trace_output.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
> > index 54373d93e251..6376bee93c84 100644
> > --- a/kernel/trace/trace_output.c
> > +++ b/kernel/trace/trace_output.c
> > @@ -370,6 +370,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
> >  {
> >       struct file *file = NULL;
> >       unsigned long vmstart = 0;
> > +     unsigned long untagged_ip = untagged_addr(ip);
> >       int ret = 1;
> >
> >       if (s->full)
> > @@ -379,7 +380,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
> >               const struct vm_area_struct *vma;
> >
> >               down_read(&mm->mmap_sem);
> > -             vma = find_vma(mm, ip);
> > +             vma = find_vma(mm, untagged_ip);
> >               if (vma) {
> >                       file = vma->vm_file;
> >                       vmstart = vma->vm_start;
> > @@ -388,7 +389,7 @@ static int seq_print_user_ip(struct trace_seq *s, struct mm_struct *mm,
> >                       ret = trace_seq_path(s, &file->f_path);
> >                       if (ret)
> >                               trace_seq_printf(s, "[+0x%lx]",
> > -                                              ip - vmstart);
> > +                                              untagged_ip - vmstart);
> >               }
> >               up_read(&mm->mmap_sem);
> >       }
>
> How would we end up with a tagged address here? Does "ip" here imply
> instruction pointer, which we wouldn't tag?

Yes, it's the instruction pointer. I think I got confused and decided
that it's OK to have instruction pointer tagged, but I guess it's not
a part of this ABI relaxation. I'll drop the patches that untag
instruction pointers.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 13/20] bpf, arm64: untag user pointers in stack_map_get_build_id_offset
       [not found]       ` <20190322155227.GS13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-04-01 16:00         ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 16:00 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 4:52 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:27PM +0100, Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > stack_map_get_build_id_offset() uses provided user pointers for vma
> > lookups, which can only by done with untagged pointers.
> >
> > Untag user pointers in this function for doing the lookup and
> > calculating the offset, but save as is in the bpf_stack_build_id
> > struct.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >  kernel/bpf/stackmap.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
> > index 950ab2f28922..bb89341d3faf 100644
> > --- a/kernel/bpf/stackmap.c
> > +++ b/kernel/bpf/stackmap.c
> > @@ -320,7 +320,9 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
> >       }
> >
> >       for (i = 0; i < trace_nr; i++) {
> > -             vma = find_vma(current->mm, ips[i]);
> > +             u64 untagged_ip = untagged_addr(ips[i]);
> > +
> > +             vma = find_vma(current->mm, untagged_ip);
> >               if (!vma || stack_map_get_build_id(vma, id_offs[i].build_id)) {
> >                       /* per entry fall back to ips */
> >                       id_offs[i].status = BPF_STACK_BUILD_ID_IP;
> > @@ -328,7 +330,7 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
> >                       memset(id_offs[i].build_id, 0, BPF_BUILD_ID_SIZE);
> >                       continue;
> >               }
> > -             id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + ips[i]
> > +             id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + untagged_ip
> >                       - vma->vm_start;
> >               id_offs[i].status = BPF_STACK_BUILD_ID_VALID;
> >       }
>
> Can the ips[*] here ever be tagged?

Those are instruction pointers AFAIU, so no, not within the current
ABI. I'll drop this patch. Thanks!

>
> --
> Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive
       [not found]           ` <e5ed4fff-acf6-7b85-bf8f-df558a9cd33f-5wv7dgnIgG8@public.gmane.org>
@ 2019-04-01 16:04             ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 16:04 UTC (permalink / raw)
  To: Kevin Brodsky
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Catalin Marinas, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar

On Mon, Mar 25, 2019 at 2:54 PM Kevin Brodsky <kevin.brodsky@arm.com> wrote:
>
> On 22/03/2019 12:04, Catalin Marinas wrote:
> > On Wed, Mar 20, 2019 at 03:51:23PM +0100, Andrey Konovalov wrote:
> >> This patch is a part of a series that extends arm64 kernel ABI to allow to
> >> pass tagged user pointers (with the top byte set to something else other
> >> than 0x00) as syscall arguments.
> >>
> >> tcp_zerocopy_receive() uses provided user pointers for vma lookups, which
> >> can only by done with untagged pointers.
> >>
> >> Untag user pointers in this function.
> >>
> >> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> >> ---
> >>   net/ipv4/tcp.c | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> >> index 6baa6dc1b13b..855a1f68c1ea 100644
> >> --- a/net/ipv4/tcp.c
> >> +++ b/net/ipv4/tcp.c
> >> @@ -1761,6 +1761,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
> >>      if (address & (PAGE_SIZE - 1) || address != zc->address)
> >>              return -EINVAL;
> >>
> >> +    address = untagged_addr(address);
> >> +
> >>      if (sk->sk_state == TCP_LISTEN)
> >>              return -ENOTCONN;
> > I don't think we need this patch if we stick to Vincenzo's ABI
> > restrictions. Can zc->address be an anonymous mmap()? My understanding
> > of TCP_ZEROCOPY_RECEIVE is that this is an mmap() on a socket, so user
> > should not tag such pointer.
>
> Good point, I hadn't looked into the interface properly. The `vma->vm_ops !=
> &tcp_vm_ops` check just below makes sure that the mapping is specifically tied to a
> TCP socket, so definitely not included in the ABI relaxation.
>
> > We want to allow tagged pointers to work transparently only for heap and
> > stack, hence the restriction to anonymous mmap() and those addresses
> > below sbrk(0).

Right, I'll drop this patch, thanks for noticing!

>
> That's not quite true: in the ABI relaxation v2, all private mappings that are either
> anonymous or backed by a regular file are included. The scope is quite a bit larger
> than heap and stack, even though this is what we're primarily interested in for now.
>
> Kevin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get
       [not found]           ` <bfaae923-98aa-63e7-c50b-8649dc5fe2bb-5wv7dgnIgG8@public.gmane.org>
@ 2019-04-01 16:13             ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 16:13 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Catalin Marinas, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar

On Mon, Mar 25, 2019 at 3:08 PM Kevin Brodsky <kevin.brodsky@arm.com> wrote:
>
> On 22/03/2019 16:07, Catalin Marinas wrote:
> > On Wed, Mar 20, 2019 at 03:51:31PM +0100, Andrey Konovalov wrote:
> >> This patch is a part of a series that extends arm64 kernel ABI to allow to
> >> pass tagged user pointers (with the top byte set to something else other
> >> than 0x00) as syscall arguments.
> >>
> >> videobuf_dma_contig_user_get() uses provided user pointers for vma
> >> lookups, which can only by done with untagged pointers.
> >>
> >> Untag the pointers in this function.
> >>
> >> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> >> ---
> >>   drivers/media/v4l2-core/videobuf-dma-contig.c | 9 +++++----
> >>   1 file changed, 5 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
> >> index e1bf50df4c70..8a1ddd146b17 100644
> >> --- a/drivers/media/v4l2-core/videobuf-dma-contig.c
> >> +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
> >> @@ -160,6 +160,7 @@ static void videobuf_dma_contig_user_put(struct videobuf_dma_contig_memory *mem)
> >>   static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
> >>                                      struct videobuf_buffer *vb)
> >>   {
> >> +    unsigned long untagged_baddr = untagged_addr(vb->baddr);
> >>      struct mm_struct *mm = current->mm;
> >>      struct vm_area_struct *vma;
> >>      unsigned long prev_pfn, this_pfn;
> >> @@ -167,22 +168,22 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
> >>      unsigned int offset;
> >>      int ret;
> >>
> >> -    offset = vb->baddr & ~PAGE_MASK;
> >> +    offset = untagged_baddr & ~PAGE_MASK;
> >>      mem->size = PAGE_ALIGN(vb->size + offset);
> >>      ret = -EINVAL;
> >>
> >>      down_read(&mm->mmap_sem);
> >>
> >> -    vma = find_vma(mm, vb->baddr);
> >> +    vma = find_vma(mm, untagged_baddr);
> >>      if (!vma)
> >>              goto out_up;
> >>
> >> -    if ((vb->baddr + mem->size) > vma->vm_end)
> >> +    if ((untagged_baddr + mem->size) > vma->vm_end)
> >>              goto out_up;
> >>
> >>      pages_done = 0;
> >>      prev_pfn = 0; /* kill warning */
> >> -    user_address = vb->baddr;
> >> +    user_address = untagged_baddr;
> >>
> >>      while (pages_done < (mem->size >> PAGE_SHIFT)) {
> >>              ret = follow_pfn(vma, user_address, &this_pfn);
> > I don't think vb->baddr here is anonymous mmap() but worth checking the
> > call paths.

The call path is
__videobuf_iolock()->videobuf_dma_contig_user_get()->find_vma().

>
> I spent some time on this, I didn't find any restriction on the kind of mapping
> that's allowed here. The API regarding V4L2_MEMORY_USERPTR doesn't seem to say
> anything about that either [0] [1]. It's probably best to ask the V4L2 maintainers.

Mauro, could you comment on whether the vb->baddr argument for the
V4L2_MEMORY_USERPTR API can come from an anonymous memory mapping?

>
> Kevin
>
> [0] https://www.kernel.org/doc/html/latest/media/uapi/v4l/vidioc-qbuf.html
> [1] https://www.kernel.org/doc/html/latest/media/uapi/v4l/userp.html
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 18/20] tee/optee, arm64: untag user pointers in check_mem_type
       [not found]       ` <20190322162223.GW13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-04-01 16:31         ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 16:31 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 5:22 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:32PM +0100, Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > check_mem_type() uses provided user pointers for vma lookups (via
> > __check_mem_type()), which can only by done with untagged pointers.
> >
> > Untag user pointers in this function.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >  drivers/tee/optee/call.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
> > index a5afbe6dee68..e3be20264092 100644
> > --- a/drivers/tee/optee/call.c
> > +++ b/drivers/tee/optee/call.c
> > @@ -563,6 +563,7 @@ static int check_mem_type(unsigned long start, size_t num_pages)
> >       int rc;
> >
> >       down_read(&mm->mmap_sem);
> > +     start = untagged_addr(start);
> >       rc = __check_mem_type(find_vma(mm, start),
> >                             start + num_pages * PAGE_SIZE);
> >       up_read(&mm->mmap_sem);
>
> I guess we could just untag this in tee_shm_register(). The tag is not
> relevant to a TEE implementation (firmware) anyway.

Will do in v14, thanks!

>
> --
> Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 10/20] kernel, arm64: untag user pointers in prctl_set_mm*
       [not found]       ` <20190322154136.GP13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-04-01 16:44         ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-01 16:44 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 4:41 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:24PM +0100, Andrey Konovalov wrote:
> > @@ -2120,13 +2135,14 @@ static int prctl_set_mm(int opt, unsigned long addr,
> >       if (opt == PR_SET_MM_AUXV)
> >               return prctl_set_auxv(mm, addr, arg4);
> >
> > -     if (addr >= TASK_SIZE || addr < mmap_min_addr)
> > +     if (untagged_addr(addr) >= TASK_SIZE ||
> > +                     untagged_addr(addr) < mmap_min_addr)
> >               return -EINVAL;
> >
> >       error = -EINVAL;
> >
> >       down_write(&mm->mmap_sem);
> > -     vma = find_vma(mm, addr);
> > +     vma = find_vma(mm, untagged_addr(addr));
> >
> >       prctl_map.start_code    = mm->start_code;
> >       prctl_map.end_code      = mm->end_code;
>
> Does this mean that we are left with tagged addresses for the
> mm->start_code etc. values? I really don't think we should allow this,
> I'm not sure what the implications are in other parts of the kernel.
>
> Arguably, these are not even pointer values but some address ranges. I
> know we decided to relax this notion for mmap/mprotect/madvise() since
> the user function prototypes take pointer as arguments but it feels like
> we are overdoing it here (struct prctl_mm_map doesn't even have
> pointers).
>
> What is the use-case for allowing tagged addresses here? Can user space
> handle untagging?

I don't know any use cases for this. I did it because it seems to be
covered by the relaxed ABI. I'm not entirely sure what to do here,
should I just drop this patch?

>
> --
> Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 15/20] drm/radeon, arm64: untag user pointers in radeon_ttm_tt_pin_userptr
       [not found]       ` <20190322160057.GU13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
@ 2019-04-02 14:17         ` Andrey Konovalov
  0 siblings, 0 replies; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-02 14:17 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Linux Memory Management List, Eric Dumazet,
	open list:KERNEL SELFTEST FRAMEWORK, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	David (ChunMing) Zhou, Jacob Bramley, Daniel Borkmann,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Szabolcs Nagy,
	Ingo Molnar, Dmitry Vyukov

On Fri, Mar 22, 2019 at 5:01 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Wed, Mar 20, 2019 at 03:51:29PM +0100, Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > radeon_ttm_tt_pin_userptr() uses provided user pointers for vma
> > lookups, which can only by done with untagged pointers.
> >
> > Untag user pointers in this function.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >  drivers/gpu/drm/radeon/radeon_ttm.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> > index 9920a6fc11bf..872a98796117 100644
> > --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> > +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> > @@ -497,9 +497,10 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)
> >       if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) {
> >               /* check that we only pin down anonymous memory
> >                  to prevent problems with writeback */
> > -             unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
> > +             unsigned long userptr = untagged_addr(gtt->userptr);
> > +             unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
> >               struct vm_area_struct *vma;
> > -             vma = find_vma(gtt->usermm, gtt->userptr);
> > +             vma = find_vma(gtt->usermm, userptr);
> >               if (!vma || vma->vm_file || vma->vm_end < end)
> >                       return -EPERM;
> >       }
>
> Same comment as on the previous patch.

As Kevin wrote in the amd driver related thread, the call trace is:
radeon_gem_userptr_ioctl()->radeon_ttm_tt_set_userptr()->...->radeon_ttm_tt_pin_userptr()->find_vma()

>
> --
> Catalin
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages
       [not found]     ` <574648a3-3a05-bea7-3f4e-7d71adedf1dc-5C7GfCeVMHo@public.gmane.org>
@ 2019-04-02 14:37       ` Andrey Konovalov
  2019-04-02 17:52         ` Kuehling, Felix
  0 siblings, 1 reply; 24+ messages in thread
From: Andrey Konovalov @ 2019-04-02 14:37 UTC (permalink / raw)
  To: Kuehling, Felix
  Cc: Mark Rutland, Kate Stewart, kvm-u79uwXL29TY76Z2rM5mHXA,
	Peter Zijlstra, Catalin Marinas, Will Deacon, Alexei Starovoitov,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Eric Dumazet, Lee Smith,
	linux-kselftest-u79uwXL29TY76Z2rM5mHXA, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, Zhou, David(ChunMing),
	Jacob Bramley, Daniel Borkmann,

On Mon, Mar 25, 2019 at 11:21 PM Kuehling, Felix <Felix.Kuehling@amd.com> wrote:
>
> On 2019-03-20 10:51 a.m., Andrey Konovalov wrote:
> > This patch is a part of a series that extends arm64 kernel ABI to allow to
> > pass tagged user pointers (with the top byte set to something else other
> > than 0x00) as syscall arguments.
> >
> > amdgpu_ttm_tt_get_user_pages() uses provided user pointers for vma
> > lookups, which can only by done with untagged pointers.
> >
> > Untag user pointers in this function.
> >
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 73e71e61dc99..891b027fa33b 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -751,10 +751,11 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
> >                * check that we only use anonymous memory to prevent problems
> >                * with writeback
> >                */
> > -             unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
> > +             unsigned long userptr = untagged_addr(gtt->userptr);
> > +             unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
> >               struct vm_area_struct *vma;
> >
> > -             vma = find_vma(mm, gtt->userptr);
> > +             vma = find_vma(mm, userptr);
> >               if (!vma || vma->vm_file || vma->vm_end < end) {
> >                       up_read(&mm->mmap_sem);
> >                       return -EPERM;
>
> We'll need to be careful that we don't break your change when the
> following commit gets applied through drm-next for Linux 5.2:
>
> https://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-5.2-wip&id=915d3eecfa23693bac9e54cdacf84fb4efdcc5c4
>
> Would it make sense to apply the untagging in amdgpu_ttm_tt_set_userptr
> instead? That would avoid this conflict and I think it would clearly put
> the untagging into the user mode code path where the tagged pointer
> originates.
>
> In amdgpu_gem_userptr_ioctl and amdgpu_amdkfd_gpuvm.c (init_user_pages)
> we also set up an MMU notifier with the (tagged) pointer from user mode.
> That should probably also use the untagged address so that MMU notifiers
> for the untagged address get correctly matched up with the right BO. I'd
> move the untagging further up the call stack to cover that. For the GEM
> case I think amdgpu_gem_userptr_ioctl would be the right place. For the
> KFD case, I'd do this in amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu.

Will do in v14, thanks a lot for looking at this!

Is this applicable to the radeon driver (drivers/gpu/drm/radeon) as
well? It seems to be using very similar structure.

>
> Regards,
>    Felix
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages
  2019-04-02 14:37       ` Andrey Konovalov
@ 2019-04-02 17:52         ` Kuehling, Felix
  0 siblings, 0 replies; 24+ messages in thread
From: Kuehling, Felix @ 2019-04-02 17:52 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Mark Rutland, Kate Stewart, kvm, Peter Zijlstra, Catalin Marinas,
	Will Deacon, Alexei Starovoitov, dri-devel, linux-mm,
	Eric Dumazet, Lee Smith, linux-kselftest, Chintan Pandya,
	Vincenzo Frascino, Shuah Khan, Ingo Molnar, linux-arch,
	Jacob Bramley, Daniel Borkmann, linux-rdma,

On 2019-04-02 10:37 a.m., Andrey Konovalov wrote:
> On Mon, Mar 25, 2019 at 11:21 PM Kuehling, Felix <Felix.Kuehling@amd.com> wrote:
>> On 2019-03-20 10:51 a.m., Andrey Konovalov wrote:
>>> This patch is a part of a series that extends arm64 kernel ABI to allow to
>>> pass tagged user pointers (with the top byte set to something else other
>>> than 0x00) as syscall arguments.
>>>
>>> amdgpu_ttm_tt_get_user_pages() uses provided user pointers for vma
>>> lookups, which can only by done with untagged pointers.
>>>
>>> Untag user pointers in this function.
>>>
>>> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>>> ---
>>>    drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> index 73e71e61dc99..891b027fa33b 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>> @@ -751,10 +751,11 @@ int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
>>>                 * check that we only use anonymous memory to prevent problems
>>>                 * with writeback
>>>                 */
>>> -             unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
>>> +             unsigned long userptr = untagged_addr(gtt->userptr);
>>> +             unsigned long end = userptr + ttm->num_pages * PAGE_SIZE;
>>>                struct vm_area_struct *vma;
>>>
>>> -             vma = find_vma(mm, gtt->userptr);
>>> +             vma = find_vma(mm, userptr);
>>>                if (!vma || vma->vm_file || vma->vm_end < end) {
>>>                        up_read(&mm->mmap_sem);
>>>                        return -EPERM;
>> We'll need to be careful that we don't break your change when the
>> following commit gets applied through drm-next for Linux 5.2:
>>
>> https://cgit.freedesktop.org/~agd5f/linux/commit/?h=drm-next-5.2-wip&id=915d3eecfa23693bac9e54cdacf84fb4efdcc5c4
>>
>> Would it make sense to apply the untagging in amdgpu_ttm_tt_set_userptr
>> instead? That would avoid this conflict and I think it would clearly put
>> the untagging into the user mode code path where the tagged pointer
>> originates.
>>
>> In amdgpu_gem_userptr_ioctl and amdgpu_amdkfd_gpuvm.c (init_user_pages)
>> we also set up an MMU notifier with the (tagged) pointer from user mode.
>> That should probably also use the untagged address so that MMU notifiers
>> for the untagged address get correctly matched up with the right BO. I'd
>> move the untagging further up the call stack to cover that. For the GEM
>> case I think amdgpu_gem_userptr_ioctl would be the right place. For the
>> KFD case, I'd do this in amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu.
> Will do in v14, thanks a lot for looking at this!
>
> Is this applicable to the radeon driver (drivers/gpu/drm/radeon) as
> well? It seems to be using very similar structure.

I think so. Radeon doesn't have the KFD bits any more. But the GEM 
interface and MMU notifier are very similar.

Regards,
   Felix


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-04-02 17:52 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1553093420.git.andreyknvl@google.com>
     [not found] ` <44ad2d0c55dbad449edac23ae46d151a04102a1d.1553093421.git.andreyknvl@google.com>
     [not found]   ` <44ad2d0c55dbad449edac23ae46d151a04102a1d.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 11:43     ` [PATCH v13 04/20] mm, arm64: untag user pointers passed to memory syscalls Catalin Marinas
     [not found]       ` <20190322114357.GC13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-28 18:10         ` Andrey Konovalov
2019-03-28 18:19           ` Steven Rostedt
     [not found] ` <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl@google.com>
     [not found]   ` <2280b62096ce1fa5c9e9429d18f08f82f4be1b0b.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 12:04     ` [PATCH v13 09/20] net, arm64: untag user pointers in tcp_zerocopy_receive Catalin Marinas
     [not found]       ` <20190322120434.GD13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 13:54         ` Kevin Brodsky
     [not found]           ` <e5ed4fff-acf6-7b85-bf8f-df558a9cd33f-5wv7dgnIgG8@public.gmane.org>
2019-04-01 16:04             ` Andrey Konovalov
     [not found] ` <76f96eb9162b3a7fa5949d71af38bf8fdf6924c4.1553093421.git.andreyknvl@google.com>
     [not found]   ` <76f96eb9162b3a7fa5949d71af38bf8fdf6924c4.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:41     ` [PATCH v13 10/20] kernel, arm64: untag user pointers in prctl_set_mm* Catalin Marinas
     [not found]       ` <20190322154136.GP13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:44         ` Andrey Konovalov
     [not found] ` <c9553c3a4850d43c8af0c00e97850d70428b7de7.1553093421.git.andreyknvl@google.com>
     [not found]   ` <c9553c3a4850d43c8af0c00e97850d70428b7de7.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:45     ` [PATCH v13 11/20] tracing, arm64: untag user pointers in seq_print_user_ip Catalin Marinas
     [not found]       ` <20190322154513.GQ13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 15:38         ` Andrey Konovalov
     [not found] ` <88d5255400fc6536d6a6895dd2a3aef0f0ecc899.1553093421.git.andreyknvl@google.com>
     [not found]   ` <88d5255400fc6536d6a6895dd2a3aef0f0ecc899.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:46     ` [PATCH v13 12/20] uprobes, arm64: untag user pointers in find_active_uprobe Catalin Marinas
     [not found] ` <09d6b8e5c8275de85c7aba716578fbcb3cbce924.1553093421.git.andreyknvl@google.com>
     [not found]   ` <09d6b8e5c8275de85c7aba716578fbcb3cbce924.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:52     ` [PATCH v13 13/20] bpf, arm64: untag user pointers in stack_map_get_build_id_offset Catalin Marinas
     [not found]       ` <20190322155227.GS13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:00         ` Andrey Konovalov
     [not found] ` <017804b2198a906463d634f84777b6087c9b4a40.1553093421.git.andreyknvl@google.com>
     [not found]   ` <017804b2198a906463d634f84777b6087c9b4a40.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 15:59     ` [PATCH v13 14/20] drm/amdgpu, arm64: untag user pointers in amdgpu_ttm_tt_get_user_pages Catalin Marinas
     [not found]       ` <20190322155955.GT13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 14:02         ` Kevin Brodsky
     [not found]   ` <574648a3-3a05-bea7-3f4e-7d71adedf1dc@amd.com>
     [not found]     ` <574648a3-3a05-bea7-3f4e-7d71adedf1dc-5C7GfCeVMHo@public.gmane.org>
2019-04-02 14:37       ` Andrey Konovalov
2019-04-02 17:52         ` Kuehling, Felix
     [not found] ` <038360a0a9dc0abaaaf3ad84a2d07fd544abce1a.1553093421.git.andreyknvl@google.com>
     [not found]   ` <038360a0a9dc0abaaaf3ad84a2d07fd544abce1a.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:00     ` [PATCH v13 15/20] drm/radeon, arm64: untag user pointers in radeon_ttm_tt_pin_userptr Catalin Marinas
     [not found]       ` <20190322160057.GU13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-02 14:17         ` Andrey Konovalov
     [not found] ` <ae6961bcdd82e529c76d0747abd310546f81e58e.1553093421.git.andreyknvl@google.com>
     [not found]   ` <ae6961bcdd82e529c76d0747abd310546f81e58e.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:07     ` [PATCH v13 17/20] media/v4l2-core, arm64: untag user pointers in videobuf_dma_contig_user_get Catalin Marinas
     [not found]       ` <20190322160726.GV13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-03-25 14:08         ` Kevin Brodsky
     [not found]           ` <bfaae923-98aa-63e7-c50b-8649dc5fe2bb-5wv7dgnIgG8@public.gmane.org>
2019-04-01 16:13             ` Andrey Konovalov
     [not found] ` <665632a911273ab537ded9acb78f4bafd91cbc19.1553093421.git.andreyknvl@google.com>
     [not found]   ` <665632a911273ab537ded9acb78f4bafd91cbc19.1553093421.git.andreyknvl-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-03-22 16:22     ` [PATCH v13 18/20] tee/optee, arm64: untag user pointers in check_mem_type Catalin Marinas
     [not found]       ` <20190322162223.GW13384-pQd4kjVL+RGcEQQL7YIRtlaTQe2KTcn/@public.gmane.org>
2019-04-01 16:31         ` Andrey Konovalov

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).