arm64: Do not include linux/uaccess.h from assembler files
Subsystems (2)
PATCH 1/1 arm64: Do not include linux/uaccess.h from assembler files
Including linux/uaccess.h from assembler files in arm64 builds results in the following build errors.
In file included from arm64/include/asm/asm-offsets.h:1:0,
from arch/arm64/include/asm/assembler.h:26, from arch/arm64/include/asm/alternative.h:68, from arch/arm64/kernel/entry.S
include/linux/sched/prio.h: Assembler messages:include/linux/sched/prio.h:47: Error:
unknown mnemonic `static' --
`static inline long nice_to_rlimit(long nice)'build/include/linux/sched/prio.h:48: Error:
junk at end of line, first unrecognized character is `{'
[and many more]
If asm/uaccess.h is not included, many of the affected files fail to build with errors such as the following.
arch/arm64/lib/copy_to_user.S: Assembler messages:arch/arm64/lib/copy_to_user.S:66: Error:
unknown mnemonic `uaccess_enable_not_uao' -- `uaccess_enable_not_uao x3,x4' arch/arm64/lib/copy_template.S:71: Error: unknown mnemonic `uao_user_alternative' -- `uao_user_alternative 9998f,strb,st trb,tmp1w,dst,#1'
Either drop the include if unnecessary or, if needed, replace with asm/uaccess.h.
--- arch/arm64/kernel/entry.S | 1 - arch/arm64/lib/clear_user.S | 2 +- arch/arm64/lib/copy_from_user.S | 2 +- arch/arm64/lib/copy_in_user.S | 2 +- arch/arm64/lib/copy_to_user.S | 2 +- arch/arm64/mm/cache.S | 2 +- arch/arm64/xen/hypercall.S | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-)
arch/arm64/kernel/entry.S +0 -1
@@ -31,7 +31,6 @@ #include <asm/memory.h> #include <asm/ptrace.h> #include <asm/thread_info.h> -#include <linux/uaccess.h> #include <asm/unistd.h> /*
arch/arm64/lib/clear_user.S +1 -1
@@ -17,7 +17,7 @@ */ #include <linux/linkage.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> .text
arch/arm64/lib/copy_from_user.S +1 -1
@@ -17,7 +17,7 @@ #include <linux/linkage.h> #include <asm/cache.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> /* * Copy from user space to a kernel buffer (alignment handled by the hardware)
arch/arm64/lib/copy_in_user.S +1 -1
@@ -19,7 +19,7 @@ #include <linux/linkage.h> #include <asm/cache.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> /* * Copy from user space to user space (alignment handled by the hardware)
arch/arm64/lib/copy_to_user.S +1 -1
@@ -17,7 +17,7 @@ #include <linux/linkage.h> #include <asm/cache.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> /* * Copy to user space from a kernel buffer (alignment handled by the hardware)
arch/arm64/mm/cache.S +1 -1
@@ -23,7 +23,7 @@ #include <asm/assembler.h> #include <asm/cpufeature.h> #include <asm/alternative.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> /* * flush_icache_range(start,end)
arch/arm64/xen/hypercall.S +1 -1
@@ -49,7 +49,7 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <linux/uaccess.h> +#include <asm/uaccess.h> #include <xen/interface/xen.h>
Signature · 1 line
2.7.4
Hello,
Quoted 28 lines · Guenter Roeck
Including
linux/uaccess.hfrom assembler files in arm64 builds results in the following build errors.In file included from
arm64/include/asm/asm-offsets.h:1:0,from arch/arm64/include/asm/assembler.h:26, from arch/arm64/include/asm/alternative.h:68, from arch/arm64/kernel/entry.S
include/linux/sched/prio.h: Assembler messages:include/linux/sched/prio.h:47: Error:
unknown mnemonic `static' --
`static inline longnice_to_rlimit(long nice)'build/include/linux/sched/prio.h:48: Error:
junk at end of line, first unrecognized character is `{'[and many more]
If
asm/uaccess.his not included, many of the affected files fail to build with errors such as the following.
arch/arm64/lib/copy_to_user.S: Assembler messages:arch/arm64/lib/copy_to_user.S:66: Error:unknown mnemonic `uaccess_enable_not_uao' -- `uaccess_enable_not_uao x3,x4' arch/arm64/lib/copy_template.S:71: Error: unknown mnemonic `uao_user_alternative' -- `uao_user_alternative 9998f,strb,st trb,tmp1w,dst,#1'
Quoted 7 lines
Either drop the include if unnecessary or, if needed, replace with
asm/uaccess.h.Fixes 7c0f6ba682b9 ("Replace <asm/uaccess.h> with <linux/uaccess.h> globally")Cc Linus Torvalds <[email protected]>Cc Al Viro <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
(fixes the arm64 build, result boot tested on real HW)
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Hello,
Quoted 28 lines · Guenter Roeck
Including
linux/uaccess.hfrom assembler files in arm64 builds results in the following build errors.In file included from
arm64/include/asm/asm-offsets.h:1:0,from arch/arm64/include/asm/assembler.h:26, from arch/arm64/include/asm/alternative.h:68, from arch/arm64/kernel/entry.S
include/linux/sched/prio.h: Assembler messages:include/linux/sched/prio.h:47: Error:
unknown mnemonic `static' --
`static inline longnice_to_rlimit(long nice)'build/include/linux/sched/prio.h:48: Error:
junk at end of line, first unrecognized character is `{'[and many more]
If
asm/uaccess.his not included, many of the affected files fail to build with errors such as the following.
arch/arm64/lib/copy_to_user.S: Assembler messages:arch/arm64/lib/copy_to_user.S:66: Error:unknown mnemonic `uaccess_enable_not_uao' -- `uaccess_enable_not_uao x3,x4' arch/arm64/lib/copy_template.S:71: Error: unknown mnemonic `uao_user_alternative' -- `uao_user_alternative 9998f,strb,st trb,tmp1w,dst,#1'
Quoted 7 lines
Either drop the include if unnecessary or, if needed, replace with
asm/uaccess.h.Fixes 7c0f6ba682b9 ("Replace <asm/uaccess.h> with <linux/uaccess.h> globally")Cc Linus Torvalds <[email protected]>Cc Al Viro <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
(fixes the arm64 build, result boot tested on real HW)
Thanks,
Thomas
Signature · 8 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel