All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Al Viro <viro@ZenIV.linux.org.uk>,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Will Deacon <will.deacon@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>
Subject: Re: Linux 4.10-rc1
Date: Mon, 26 Dec 2016 17:38:12 +0800	[thread overview]
Message-ID: <5860E504.8070406@huawei.com> (raw)
In-Reply-To: <20161226091854.GO1555@ZenIV.linux.org.uk>

On 2016/12/26 17:18, Al Viro wrote:
> On Mon, Dec 26, 2016 at 05:05:37PM +0800, Kefeng Wang wrote:
>> It looks like we need revert the changes from assembly files.
> Better yet, split the damn thing in two and include the asm-only part.
>
>> diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
>> diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> Missed those two...  OK, how about this?

It happens some where else,

./include/asm-generic/rwsem.h:48: Error: junk at end of line, first unrecognized character is `}'
./include/asm-generic/rwsem.h:49: Error: junk at end of line, first unrecognized character is `}'
./include/asm-generic/rwsem.h:50: Error: unknown mnemonic `return' -- `return 0'
./include/asm-generic/rwsem.h:51: Error: junk at end of line, first unrecognized character is `}'
./include/asm-generic/rwsem.h:56: Error: unknown mnemonic `static' -- `static inline void __down_write(struct rw_semaphore*sem)'
./include/asm-generic/rwsem.h:57: Error: junk at end of line, first unrecognized character is `{'
./include/asm-generic/rwsem.h:58: Error: unknown mnemonic `long' -- `long tmp'
./include/asm-generic/rwsem.h:60: Error: junk at end of line, first unrecognized character is `('
./include/asm-generic/rwsem.h:61: Error: junk at end of line, first unrecognized character is `('
./include/asm-generic/rwsem.h:62: Error: unknown mnemonic `if' -- `if (unlikely(tmp!=((-0xffffffffL-1)+0x00000001L)))'
./include/asm-generic/rwsem.h:63: Error: unknown mnemonic `rwsem_down_write_failed' -- `rwsem_down_write_failed(sem)'
./include/asm-generic/rwsem.h:64: Error: junk at end of line, first unrecognized character is `}'
./include/asm-generic/rwsem.h:66: Error: unknown mnemonic `static' -- `static inline int __down_write_killable(struct rw_semaphore*sem)'
./include/asm-generic/rwsem.h:67: Error: junk at end of line, first unrecognized character is `{'
./include/asm-generic/rwsem.h:68: Error: unknown mnemonic `long' -- `long tmp'
./include/asm-generic/rwsem.h:70: Error: junk at end of line, first unrecognized character is `('
./include/asm-generic/rwsem.h:71: Error: junk at end of line, first unrecognized character is `('
./include/asm-generic/rwsem.h:72: Error: unknown mnemonic `if' -- `if (unlikely(tmp!=((-0xffffffffL-1)+0x00000001L)))'
./include/asm-generic/rwsem.h:73: Error: unknown mnemonic `if' -- `if (IS_ERR(rwsem_down_write_failed_killable(sem)))'
./include/asm-generic/rwsem.h:74: Error: unknown mnemonic `return' -- `return -4'
./include/asm-generic/rwsem.h:75: Error: unknown mnemonic `return' -- `return 0'
./include/asm-generic/rwsem.h:76: Error: junk at end of line, first unrecognized character is `}'
./include/asm-generic/rwsem.h:78: Error: unknown mnemonic `static' -- `static inline int __down_write_trylock(struct rw_semaphore*sem)'
./include/asm-generic/rwsem.h:79: Error: junk at end of line, first unrecognized character is `{'

./include/linux/highuid.h:34: Error: unknown mnemonic `extern' -- `extern int overflowuid'
./include/linux/highuid.h:35: Error: unknown mnemonic `extern' -- `extern int overflowgid'
./include/linux/highuid.h:37: Error: unknown mnemonic `extern' -- `extern void __bad_uid(void)'

./include/linux/uidgid.h:21: Error: unknown mnemonic `uid_t' -- `uid_t val'
./include/linux/uidgid.h:22: Error: junk at end of line, first unrecognized character is `}'
./include/linux/uidgid.h:25: Error: unknown mnemonic `typedef' -- `typedef struct{'
./include/linux/uidgid.h:26: Error: unknown mnemonic `gid_t' -- `gid_t val'
./include/linux/uidgid.h:27: Error: junk at end of line, first unrecognized character is `}'

./include/uapi/linux/sysctl.h:34: Error: unknown mnemonic `struct' -- `struct __sysctl_args{'
./include/uapi/linux/sysctl.h:35: Error: unknown mnemonic `int' -- `int __user*name'
./include/uapi/linux/sysctl.h:36: Error: unknown mnemonic `int' -- `int nlen'
./include/uapi/linux/sysctl.h:37: Error: unknown mnemonic `void' -- `void __user*oldval'

Thanks
Hanjun

>
> arm64: don't pull uaccess.h into *.S
>
> Split asm-only parts of arm64 uaccess.h into a new header and use that
> from *.S.
>     
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>
> diff --git a/arch/arm64/include/asm/asm-uaccess.h b/arch/arm64/include/asm/asm-uaccess.h
> new file mode 100644
> index 000000000000..df411f3e083c
> --- /dev/null
> +++ b/arch/arm64/include/asm/asm-uaccess.h
> @@ -0,0 +1,65 @@
> +#ifndef __ASM_ASM_UACCESS_H
> +#define __ASM_ASM_UACCESS_H
> +
> +#include <asm/alternative.h>
> +#include <asm/kernel-pgtable.h>
> +#include <asm/sysreg.h>
> +#include <asm/assembler.h>
> +
> +/*
> + * User access enabling/disabling macros.
> + */
> +#ifdef CONFIG_ARM64_SW_TTBR0_PAN
> +	.macro	__uaccess_ttbr0_disable, tmp1
> +	mrs	\tmp1, ttbr1_el1		// swapper_pg_dir
> +	add	\tmp1, \tmp1, #SWAPPER_DIR_SIZE	// reserved_ttbr0 at the end of swapper_pg_dir
> +	msr	ttbr0_el1, \tmp1		// set reserved TTBR0_EL1
> +	isb
> +	.endm
> +
> +	.macro	__uaccess_ttbr0_enable, tmp1
> +	get_thread_info \tmp1
> +	ldr	\tmp1, [\tmp1, #TSK_TI_TTBR0]	// load saved TTBR0_EL1
> +	msr	ttbr0_el1, \tmp1		// set the non-PAN TTBR0_EL1
> +	isb
> +	.endm
> +
> +	.macro	uaccess_ttbr0_disable, tmp1
> +alternative_if_not ARM64_HAS_PAN
> +	__uaccess_ttbr0_disable \tmp1
> +alternative_else_nop_endif
> +	.endm
> +
> +	.macro	uaccess_ttbr0_enable, tmp1, tmp2
> +alternative_if_not ARM64_HAS_PAN
> +	save_and_disable_irq \tmp2		// avoid preemption
> +	__uaccess_ttbr0_enable \tmp1
> +	restore_irq \tmp2
> +alternative_else_nop_endif
> +	.endm
> +#else
> +	.macro	uaccess_ttbr0_disable, tmp1
> +	.endm
> +
> +	.macro	uaccess_ttbr0_enable, tmp1, tmp2
> +	.endm
> +#endif
> +
> +/*
> + * These macros are no-ops when UAO is present.
> + */
> +	.macro	uaccess_disable_not_uao, tmp1
> +	uaccess_ttbr0_disable \tmp1
> +alternative_if ARM64_ALT_PAN_NOT_UAO
> +	SET_PSTATE_PAN(1)
> +alternative_else_nop_endif
> +	.endm
> +
> +	.macro	uaccess_enable_not_uao, tmp1, tmp2
> +	uaccess_ttbr0_enable \tmp1, \tmp2
> +alternative_if ARM64_ALT_PAN_NOT_UAO
> +	SET_PSTATE_PAN(0)
> +alternative_else_nop_endif
> +	.endm
> +
> +#endif
> diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
> index d26750ca6e06..46da3ea638bb 100644
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h
> @@ -22,8 +22,6 @@
>  #include <asm/kernel-pgtable.h>
>  #include <asm/sysreg.h>
>  
> -#ifndef __ASSEMBLY__
> -
>  /*
>   * User space memory access functions
>   */
> @@ -424,66 +422,4 @@ extern long strncpy_from_user(char *dest, const char __user *src, long count);
>  extern __must_check long strlen_user(const char __user *str);
>  extern __must_check long strnlen_user(const char __user *str, long n);
>  
> -#else	/* __ASSEMBLY__ */
> -
> -#include <asm/assembler.h>
> -
> -/*
> - * User access enabling/disabling macros.
> - */
> -#ifdef CONFIG_ARM64_SW_TTBR0_PAN
> -	.macro	__uaccess_ttbr0_disable, tmp1
> -	mrs	\tmp1, ttbr1_el1		// swapper_pg_dir
> -	add	\tmp1, \tmp1, #SWAPPER_DIR_SIZE	// reserved_ttbr0 at the end of swapper_pg_dir
> -	msr	ttbr0_el1, \tmp1		// set reserved TTBR0_EL1
> -	isb
> -	.endm
> -
> -	.macro	__uaccess_ttbr0_enable, tmp1
> -	get_thread_info \tmp1
> -	ldr	\tmp1, [\tmp1, #TSK_TI_TTBR0]	// load saved TTBR0_EL1
> -	msr	ttbr0_el1, \tmp1		// set the non-PAN TTBR0_EL1
> -	isb
> -	.endm
> -
> -	.macro	uaccess_ttbr0_disable, tmp1
> -alternative_if_not ARM64_HAS_PAN
> -	__uaccess_ttbr0_disable \tmp1
> -alternative_else_nop_endif
> -	.endm
> -
> -	.macro	uaccess_ttbr0_enable, tmp1, tmp2
> -alternative_if_not ARM64_HAS_PAN
> -	save_and_disable_irq \tmp2		// avoid preemption
> -	__uaccess_ttbr0_enable \tmp1
> -	restore_irq \tmp2
> -alternative_else_nop_endif
> -	.endm
> -#else
> -	.macro	uaccess_ttbr0_disable, tmp1
> -	.endm
> -
> -	.macro	uaccess_ttbr0_enable, tmp1, tmp2
> -	.endm
> -#endif
> -
> -/*
> - * These macros are no-ops when UAO is present.
> - */
> -	.macro	uaccess_disable_not_uao, tmp1
> -	uaccess_ttbr0_disable \tmp1
> -alternative_if ARM64_ALT_PAN_NOT_UAO
> -	SET_PSTATE_PAN(1)
> -alternative_else_nop_endif
> -	.endm
> -
> -	.macro	uaccess_enable_not_uao, tmp1, tmp2
> -	uaccess_ttbr0_enable \tmp1, \tmp2
> -alternative_if ARM64_ALT_PAN_NOT_UAO
> -	SET_PSTATE_PAN(0)
> -alternative_else_nop_endif
> -	.endm
> -
> -#endif	/* __ASSEMBLY__ */
> -
>  #endif /* __ASM_UACCESS_H */
> diff --git a/arch/arm64/lib/clear_user.S b/arch/arm64/lib/clear_user.S
> index add4a1334085..e88fb99c1561 100644
> --- a/arch/arm64/lib/clear_user.S
> +++ b/arch/arm64/lib/clear_user.S
> @@ -17,7 +17,7 @@
>   */
>  #include <linux/linkage.h>
>  
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  
>  	.text
>  
> diff --git a/arch/arm64/lib/copy_from_user.S b/arch/arm64/lib/copy_from_user.S
> index fd6cd05593f9..4b5d826895ff 100644
> --- a/arch/arm64/lib/copy_from_user.S
> +++ b/arch/arm64/lib/copy_from_user.S
> @@ -17,7 +17,7 @@
>  #include <linux/linkage.h>
>  
>  #include <asm/cache.h>
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  
>  /*
>   * Copy from user space to a kernel buffer (alignment handled by the hardware)
> diff --git a/arch/arm64/lib/copy_in_user.S b/arch/arm64/lib/copy_in_user.S
> index d828540ded6f..47184c3a97da 100644
> --- a/arch/arm64/lib/copy_in_user.S
> +++ b/arch/arm64/lib/copy_in_user.S
> @@ -19,7 +19,7 @@
>  #include <linux/linkage.h>
>  
>  #include <asm/cache.h>
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  
>  /*
>   * Copy from user space to user space (alignment handled by the hardware)
> diff --git a/arch/arm64/lib/copy_to_user.S b/arch/arm64/lib/copy_to_user.S
> index 3e6ae2663b82..351f0766f7a6 100644
> --- a/arch/arm64/lib/copy_to_user.S
> +++ b/arch/arm64/lib/copy_to_user.S
> @@ -17,7 +17,7 @@
>  #include <linux/linkage.h>
>  
>  #include <asm/cache.h>
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  
>  /*
>   * Copy to user space from a kernel buffer (alignment handled by the hardware)
> diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
> index 17f422a4dc55..83c27b6e6dca 100644
> --- a/arch/arm64/mm/cache.S
> +++ b/arch/arm64/mm/cache.S
> @@ -23,7 +23,7 @@
>  #include <asm/assembler.h>
>  #include <asm/cpufeature.h>
>  #include <asm/alternative.h>
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  
>  /*
>   *	flush_icache_range(start,end)
> diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
> index 47cf3f9d89ff..947830a459d2 100644
> --- a/arch/arm64/xen/hypercall.S
> +++ b/arch/arm64/xen/hypercall.S
> @@ -49,7 +49,7 @@
>  
>  #include <linux/linkage.h>
>  #include <asm/assembler.h>
> -#include <linux/uaccess.h>
> +#include <asm/asm-uaccess.h>
>  #include <xen/interface/xen.h>
>  
>  
>
> .
>

  reply	other threads:[~2016-12-26  9:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-26  0:41 Linux 4.10-rc1 Linus Torvalds
2016-12-26  8:38 ` Hanjun Guo
2016-12-26  9:05   ` Kefeng Wang
2016-12-26  9:18     ` Al Viro
2016-12-26  9:38       ` Hanjun Guo [this message]
2016-12-26  9:45       ` Hanjun Guo
2016-12-26 14:23         ` Al Viro
2016-12-26 15:14           ` Al Viro
2016-12-26  9:15   ` Al Viro
2016-12-26 12:17 ` linux-next: stats (Was: Linux 4.10-rc1) Stephen Rothwell
2016-12-26 12:17   ` Stephen Rothwell

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=5860E504.8070406@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.