Skip to contentSkip to conversation

arm64: Do not include linux/uaccess.h from assembler files

PATCH In review Guenter Roeck 2 participants 3 messages Dec 26, 2016 – Dec 28, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 7c0f6ba682b9 ("Replace <asm/uaccess.h> with <linux/uaccess.h> globally")
Cc Linus Torvalds <[email protected]>
Cc Al Viro <[email protected]>
---
 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
index a7504f40d7ee..fb93f8c25ff0 100644
@@ -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
index add4a1334085..d7150e30438a 100644
@@ -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
index fd6cd05593f9..cfe13396085b 100644
@@ -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
index d828540ded6f..718b1c4e2f85 100644
@@ -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
index 3e6ae2663b82..e99e31c9acac 100644
@@ -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
index 17f422a4dc55..da9576932322 100644
@@ -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
index 47cf3f9d89ff..b41aff25426d 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw

Hello,

Quoted 28 lines · Guenter Roeck

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'
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]>

(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
Tested-by on v1 1/1
#2 lore raw
In reply to Guenter Roeck

Hello,

Quoted 28 lines · Guenter Roeck

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'
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]>

(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