Thread (38 messages) 38 messages, 4 authors, 2020-12-02

Re: [PATCHv4 12/17] arm64: uaccess: split user/kernel routines

flat view

From: Mark Rutland <mark.rutland@arm.com>
Date: 2020-12-01 11:04:50

On Thu, Nov 26, 2020 at 06:42:24PM +0000, James Morse wrote:
Hi Mark,
Hi James,

Thanks for the comments. I've applied most of those below, but I have
one follow-up question.
On 13/11/2020 12:49, Mark Rutland wrote:
quoted
+#define __get_mem_asm(ldr, reg, x, addr, err)				\
('ldr' as variable name where you need to output something other than ldr does my head in)
quoted
 	asm volatile(							\
-	"1:"ALTERNATIVE(instr "     " reg "1, [%2]\n",			\
-			alt_instr " " reg "1, [%2]\n", feature)		\
+	"1:	" ldr "	" reg "1, [%2]\n"				\
I've changed this to 'load', and used 'store' in __put_mem_asm().

[...]
quoted
+#define __get_kernel_nofault(dst, src, type, err_label)			\
+do {									\
+	int __gkn_err = 0;						\
+									\
+	__raw_get_mem("ldr", *((type *)(dst)),				\
+		      (__force type __user *)(src), __gkn_err);		\
Is the __user needed as you moved __chk_user_ptr() out of __raw_get_mem() in the previous
patch?
You're right; the __user portion can go as neither __raw_get_mem() or
__get_mem_asm() needs that. Likewise for __put_kernel_nofault(),
__raw_put_mem(), and __put_mem_asm().

I've removed those.
(your branch on kernel.org does something different here, not sure if its ahead or behind v4)
AFAICT this portion of the patch is up-to-date with what's on
kernel.org. I might have pushed that out-of-order with posting the
series -- does this look the same now, or am I missing something?
quoted
+	if (unlikely(__gkn_err))					\
+		goto err_label;						\
+} while(0)
I'll fix the whitespace for the while(0), too...

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help