All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
@ 2014-09-09  3:59 ` Yang Yingliang
  0 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-09  3:59 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel; +Cc: catalin.marinas, will.deacon

Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm64/include/asm/unistd.h      | 5 +++++
 arch/arm64/include/uapi/asm/unistd.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 6d2bf41..21a7dec 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,6 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD_H
+#define __ASM_ARM64_UNISTD_H
+
 #ifdef CONFIG_COMPAT
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
@@ -48,3 +51,5 @@
 #include <uapi/asm/unistd.h>
 
 #define NR_syscalls (__NR_syscalls)
+
+#endif /* __ASM_ARM64_UNISTD_H */
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 1caadc2..ab72cac 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -13,4 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef _UAPI__ASM_ARM64_UNISTD_H
+#define _UAPI__ASM_ARM64_UNISTD_H
+
 #include <asm-generic/unistd.h>
+
+#endif /* _UAPI__ASM_ARM64_UNISTD_H */
-- 
1.8.0



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

* [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
@ 2014-09-09  3:59 ` Yang Yingliang
  0 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-09  3:59 UTC (permalink / raw)
  To: linux-arm-kernel

Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm64/include/asm/unistd.h      | 5 +++++
 arch/arm64/include/uapi/asm/unistd.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 6d2bf41..21a7dec 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,6 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD_H
+#define __ASM_ARM64_UNISTD_H
+
 #ifdef CONFIG_COMPAT
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
@@ -48,3 +51,5 @@
 #include <uapi/asm/unistd.h>
 
 #define NR_syscalls (__NR_syscalls)
+
+#endif /* __ASM_ARM64_UNISTD_H */
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 1caadc2..ab72cac 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -13,4 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef _UAPI__ASM_ARM64_UNISTD_H
+#define _UAPI__ASM_ARM64_UNISTD_H
+
 #include <asm-generic/unistd.h>
+
+#endif /* _UAPI__ASM_ARM64_UNISTD_H */
-- 
1.8.0

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

* Re: [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
  2014-09-09  3:59 ` Yang Yingliang
@ 2014-09-09 12:39   ` Will Deacon
  -1 siblings, 0 replies; 14+ messages in thread
From: Will Deacon @ 2014-09-09 12:39 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, linux-arm-kernel, Catalin Marinas

On Tue, Sep 09, 2014 at 04:59:45AM +0100, Yang Yingliang wrote:
> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  arch/arm64/include/asm/unistd.h      | 5 +++++
>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>  2 files changed, 10 insertions(+)

We probably need something similar for unistd32.h too, as lib/compat_audit.c
now includes that.

Can you post a v2 please?

Will

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

* [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
@ 2014-09-09 12:39   ` Will Deacon
  0 siblings, 0 replies; 14+ messages in thread
From: Will Deacon @ 2014-09-09 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 09, 2014 at 04:59:45AM +0100, Yang Yingliang wrote:
> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  arch/arm64/include/asm/unistd.h      | 5 +++++
>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>  2 files changed, 10 insertions(+)

We probably need something similar for unistd32.h too, as lib/compat_audit.c
now includes that.

Can you post a v2 please?

Will

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

* Re: [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
  2014-09-09 12:39   ` Will Deacon
@ 2014-09-11  7:55     ` Yang Yingliang
  -1 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-11  7:55 UTC (permalink / raw)
  To: Will Deacon; +Cc: linux-kernel, linux-arm-kernel, Catalin Marinas

On 2014/9/9 20:39, Will Deacon wrote:
> On Tue, Sep 09, 2014 at 04:59:45AM +0100, Yang Yingliang wrote:
>> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>  arch/arm64/include/asm/unistd.h      | 5 +++++
>>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>>  2 files changed, 10 insertions(+)
> 
> We probably need something similar for unistd32.h too, as lib/compat_audit.c
> now includes that.
> 
> Can you post a v2 please?
> 
> Will
> 
> 
OK, I'll send a v2.

Regards,
Yang


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

* [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
@ 2014-09-11  7:55     ` Yang Yingliang
  0 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-11  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 2014/9/9 20:39, Will Deacon wrote:
> On Tue, Sep 09, 2014 at 04:59:45AM +0100, Yang Yingliang wrote:
>> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>  arch/arm64/include/asm/unistd.h      | 5 +++++
>>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>>  2 files changed, 10 insertions(+)
> 
> We probably need something similar for unistd32.h too, as lib/compat_audit.c
> now includes that.
> 
> Can you post a v2 please?
> 
> Will
> 
> 
OK, I'll send a v2.

Regards,
Yang

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

* [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
  2014-09-11  7:55     ` Yang Yingliang
@ 2014-09-11  9:21       ` Yang Yingliang
  -1 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-11  9:21 UTC (permalink / raw)
  To: Will Deacon
  Cc: linux-kernel, linux-arm-kernel, Catalin Marinas, Yang Yingliang

From: Yang Yingliang <yangyingliang@huawei.com>

Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
asm/unistd32.h.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm64/include/asm/unistd.h      | 5 +++++
 arch/arm64/include/asm/unistd32.h    | 4 ++++
 arch/arm64/include/uapi/asm/unistd.h | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 6d2bf41..21a7dec 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,6 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD_H
+#define __ASM_ARM64_UNISTD_H
+
 #ifdef CONFIG_COMPAT
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
@@ -48,3 +51,5 @@
 #include <uapi/asm/unistd.h>
 
 #define NR_syscalls (__NR_syscalls)
+
+#endif /* __ASM_ARM64_UNISTD_H */
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index da1f06b..8f5e78e 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -16,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD32_H
+#define __ASM_ARM64_UNISTD32_H
 
 #ifndef __SYSCALL
 #define __SYSCALL(x, y)
@@ -792,3 +794,5 @@ __SYSCALL(__NR_renameat2, sys_renameat2)
 __SYSCALL(__NR_getrandom, sys_getrandom)
 #define __NR_memfd_create 385
 __SYSCALL(__NR_memfd_create, sys_memfd_create)
+
+#endif /* __ASM_ARM64_UNISTD32_H */
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 1caadc2..ab72cac 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -13,4 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef _UAPI__ASM_ARM64_UNISTD_H
+#define _UAPI__ASM_ARM64_UNISTD_H
+
 #include <asm-generic/unistd.h>
+
+#endif /* _UAPI__ASM_ARM64_UNISTD_H */


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

* [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
@ 2014-09-11  9:21       ` Yang Yingliang
  0 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-11  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

From: Yang Yingliang <yangyingliang@huawei.com>

Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
asm/unistd32.h.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm64/include/asm/unistd.h      | 5 +++++
 arch/arm64/include/asm/unistd32.h    | 4 ++++
 arch/arm64/include/uapi/asm/unistd.h | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 6d2bf41..21a7dec 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,6 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD_H
+#define __ASM_ARM64_UNISTD_H
+
 #ifdef CONFIG_COMPAT
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
@@ -48,3 +51,5 @@
 #include <uapi/asm/unistd.h>
 
 #define NR_syscalls (__NR_syscalls)
+
+#endif /* __ASM_ARM64_UNISTD_H */
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index da1f06b..8f5e78e 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -16,6 +16,8 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef __ASM_ARM64_UNISTD32_H
+#define __ASM_ARM64_UNISTD32_H
 
 #ifndef __SYSCALL
 #define __SYSCALL(x, y)
@@ -792,3 +794,5 @@ __SYSCALL(__NR_renameat2, sys_renameat2)
 __SYSCALL(__NR_getrandom, sys_getrandom)
 #define __NR_memfd_create 385
 __SYSCALL(__NR_memfd_create, sys_memfd_create)
+
+#endif /* __ASM_ARM64_UNISTD32_H */
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 1caadc2..ab72cac 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -13,4 +13,9 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef _UAPI__ASM_ARM64_UNISTD_H
+#define _UAPI__ASM_ARM64_UNISTD_H
+
 #include <asm-generic/unistd.h>
+
+#endif /* _UAPI__ASM_ARM64_UNISTD_H */

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

* Re: [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
  2014-09-11  9:21       ` Yang Yingliang
@ 2014-09-11 15:02         ` Will Deacon
  -1 siblings, 0 replies; 14+ messages in thread
From: Will Deacon @ 2014-09-11 15:02 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, linux-arm-kernel, Catalin Marinas

On Thu, Sep 11, 2014 at 10:21:18AM +0100, Yang Yingliang wrote:
> From: Yang Yingliang <yangyingliang@huawei.com>
> 
> Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
> asm/unistd32.h.

Hmm, so I applied this and now my machine panics when we hit userspace. I
think the issue is that we no longer generate our syscall table in
arch/arm64/kernel/sys.c, because unistd.h is already included via
linux/syscalls.h but without the __SYSCALL definition.

So, a couple of questions:

  (1) Is the lack of header guards actually causing you a problem?
  (2) How did you test this?

I've dropped the patch.

Will

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

* [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
@ 2014-09-11 15:02         ` Will Deacon
  0 siblings, 0 replies; 14+ messages in thread
From: Will Deacon @ 2014-09-11 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 11, 2014 at 10:21:18AM +0100, Yang Yingliang wrote:
> From: Yang Yingliang <yangyingliang@huawei.com>
> 
> Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
> asm/unistd32.h.

Hmm, so I applied this and now my machine panics when we hit userspace. I
think the issue is that we no longer generate our syscall table in
arch/arm64/kernel/sys.c, because unistd.h is already included via
linux/syscalls.h but without the __SYSCALL definition.

So, a couple of questions:

  (1) Is the lack of header guards actually causing you a problem?
  (2) How did you test this?

I've dropped the patch.

Will

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

* Re: [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
  2014-09-09  3:59 ` Yang Yingliang
@ 2014-09-11 15:14   ` Arnd Bergmann
  -1 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2014-09-11 15:14 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Yang Yingliang, linux-kernel, catalin.marinas, will.deacon

On Tuesday 09 September 2014 11:59:45 Yang Yingliang wrote:
> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  arch/arm64/include/asm/unistd.h      | 5 +++++
>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>  2 files changed, 10 insertions(+)

This will lead to an empty system call table, because asm/unistd.h
is intentionally included multiple times in order to get both the
syscall definition and the macros, which are defined in pairs in
this file.

How did you come up with this patch?

	Arnd

> diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
> index 6d2bf41..21a7dec 100644
> --- a/arch/arm64/include/asm/unistd.h
> +++ b/arch/arm64/include/asm/unistd.h
> @@ -13,6 +13,9 @@
>   * You should have received a copy of the GNU General Public License
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> +#ifndef __ASM_ARM64_UNISTD_H
> +#define __ASM_ARM64_UNISTD_H
> +
>  #ifdef CONFIG_COMPAT
>  #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
>  #define __ARCH_WANT_COMPAT_STAT64
> @@ -48,3 +51,5 @@
>  #include <uapi/asm/unistd.h>
>  
>  #define NR_syscalls (__NR_syscalls)
> +
> +#endif /* __ASM_ARM64_UNISTD_H */
> diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
> index 1caadc2..ab72cac 100644
> --- a/arch/arm64/include/uapi/asm/unistd.h
> +++ b/arch/arm64/include/uapi/asm/unistd.h
> @@ -13,4 +13,9 @@
>   * You should have received a copy of the GNU General Public License
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> +#ifndef _UAPI__ASM_ARM64_UNISTD_H
> +#define _UAPI__ASM_ARM64_UNISTD_H
> +
>  #include <asm-generic/unistd.h>
> +
> +#endif /* _UAPI__ASM_ARM64_UNISTD_H */
> 


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

* [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion
@ 2014-09-11 15:14   ` Arnd Bergmann
  0 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2014-09-11 15:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 09 September 2014 11:59:45 Yang Yingliang wrote:
> Add guard macros in both uapi/asm/unistd.h and asm/unistd.h.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  arch/arm64/include/asm/unistd.h      | 5 +++++
>  arch/arm64/include/uapi/asm/unistd.h | 5 +++++
>  2 files changed, 10 insertions(+)

This will lead to an empty system call table, because asm/unistd.h
is intentionally included multiple times in order to get both the
syscall definition and the macros, which are defined in pairs in
this file.

How did you come up with this patch?

	Arnd

> diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
> index 6d2bf41..21a7dec 100644
> --- a/arch/arm64/include/asm/unistd.h
> +++ b/arch/arm64/include/asm/unistd.h
> @@ -13,6 +13,9 @@
>   * You should have received a copy of the GNU General Public License
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> +#ifndef __ASM_ARM64_UNISTD_H
> +#define __ASM_ARM64_UNISTD_H
> +
>  #ifdef CONFIG_COMPAT
>  #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
>  #define __ARCH_WANT_COMPAT_STAT64
> @@ -48,3 +51,5 @@
>  #include <uapi/asm/unistd.h>
>  
>  #define NR_syscalls (__NR_syscalls)
> +
> +#endif /* __ASM_ARM64_UNISTD_H */
> diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
> index 1caadc2..ab72cac 100644
> --- a/arch/arm64/include/uapi/asm/unistd.h
> +++ b/arch/arm64/include/uapi/asm/unistd.h
> @@ -13,4 +13,9 @@
>   * You should have received a copy of the GNU General Public License
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
> +#ifndef _UAPI__ASM_ARM64_UNISTD_H
> +#define _UAPI__ASM_ARM64_UNISTD_H
> +
>  #include <asm-generic/unistd.h>
> +
> +#endif /* _UAPI__ASM_ARM64_UNISTD_H */
> 

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

* Re: [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
  2014-09-11 15:02         ` Will Deacon
@ 2014-09-12  9:03           ` Yang Yingliang
  -1 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-12  9:03 UTC (permalink / raw)
  To: Will Deacon, arnd; +Cc: linux-kernel, linux-arm-kernel, Catalin Marinas

On 2014/9/11 23:02, Will Deacon wrote:
> On Thu, Sep 11, 2014 at 10:21:18AM +0100, Yang Yingliang wrote:
>> From: Yang Yingliang <yangyingliang@huawei.com>
>>
>> Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
>> asm/unistd32.h.
> 
> Hmm, so I applied this and now my machine panics when we hit userspace. I
> think the issue is that we no longer generate our syscall table in
> arch/arm64/kernel/sys.c, because unistd.h is already included via
> linux/syscalls.h but without the __SYSCALL definition.
> 
> So, a couple of questions:
> 
>   (1) Is the lack of header guards actually causing you a problem?
>   (2) How did you test this?
> 
> I've dropped the patch.
> 
> Will
> 
> 
Oh, my bad, sorry for that.

I found asm/unistd.h have no guard macro when I was migrate a userspace
program from x86_64 to arm64. The program uses the macro _ASM_X86_UNISTD_64_H,
but arm64 does not have this(arm has __ASM_ARM_UNISTD_H). So I tried to add
the guard macro.

Regards,
Yang



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

* [PATCH v2] arm64: add guard macros of unistd.h to prevent double inclusion
@ 2014-09-12  9:03           ` Yang Yingliang
  0 siblings, 0 replies; 14+ messages in thread
From: Yang Yingliang @ 2014-09-12  9:03 UTC (permalink / raw)
  To: linux-arm-kernel

On 2014/9/11 23:02, Will Deacon wrote:
> On Thu, Sep 11, 2014 at 10:21:18AM +0100, Yang Yingliang wrote:
>> From: Yang Yingliang <yangyingliang@huawei.com>
>>
>> Add guard macros for uapi/asm/unistd.h, asm/unistd.h and
>> asm/unistd32.h.
> 
> Hmm, so I applied this and now my machine panics when we hit userspace. I
> think the issue is that we no longer generate our syscall table in
> arch/arm64/kernel/sys.c, because unistd.h is already included via
> linux/syscalls.h but without the __SYSCALL definition.
> 
> So, a couple of questions:
> 
>   (1) Is the lack of header guards actually causing you a problem?
>   (2) How did you test this?
> 
> I've dropped the patch.
> 
> Will
> 
> 
Oh, my bad, sorry for that.

I found asm/unistd.h have no guard macro when I was migrate a userspace
program from x86_64 to arm64. The program uses the macro _ASM_X86_UNISTD_64_H,
but arm64 does not have this(arm has __ASM_ARM_UNISTD_H). So I tried to add
the guard macro.

Regards,
Yang

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

end of thread, other threads:[~2014-09-12  9:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09  3:59 [PATCH] arm64: add guard macro of unistd.h to prevent double inclusion Yang Yingliang
2014-09-09  3:59 ` Yang Yingliang
2014-09-09 12:39 ` Will Deacon
2014-09-09 12:39   ` Will Deacon
2014-09-11  7:55   ` Yang Yingliang
2014-09-11  7:55     ` Yang Yingliang
2014-09-11  9:21     ` [PATCH v2] arm64: add guard macros " Yang Yingliang
2014-09-11  9:21       ` Yang Yingliang
2014-09-11 15:02       ` Will Deacon
2014-09-11 15:02         ` Will Deacon
2014-09-12  9:03         ` Yang Yingliang
2014-09-12  9:03           ` Yang Yingliang
2014-09-11 15:14 ` [PATCH] arm64: add guard macro " Arnd Bergmann
2014-09-11 15:14   ` Arnd Bergmann

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.