Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-10-06 Thread Andrey Konovalov

Hi Yury,

With this patch set 4.3 kernel fails to build with both 
arch/arm64/configs/defconfig,
and with arch/arm64/configs/defconfig plus CONFIG_AARCH32_EL0=y and 
CONFIG_ARM64_ILP32=y.
See the details below.

Thanks,
Andrey

On 09/30/2015 01:14 AM, Yury Norov wrote:

From: Andrew Pinski 

Signed-off-by: Philipp Tomsich 
Signed-off-by: Christoph Muellner 
Signed-off-by: Yury Norov 

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index faad6df..f40c51b 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -166,10 +166,13 @@ extern int arch_setup_additional_pages(struct 
linux_binprm *bprm,

  #define COMPAT_ELF_ET_DYN_BASE(2 * TASK_SIZE_32 / 3)

+
+#ifdef CONFIG_AARCH32_EL0
+
  /* AArch32 registers. */
-#define COMPAT_ELF_NGREG   18
+#define COMPAT_A32_ELF_NGREG   18
  typedef unsigned int  compat_elf_greg_t;
-typedef compat_elf_greg_t  compat_elf_gregset_t[COMPAT_ELF_NGREG];
+typedef compat_elf_greg_t  
compat_elf_gregset_t[COMPAT_A32_ELF_NGREG];

  /* AArch32 EABI. */
  #define EF_ARM_EABI_MASK  0xff00
@@ -179,11 +182,25 @@ typedef compat_elf_greg_t 
compat_elf_gregset_t[COMPAT_ELF_NGREG];
  #define compat_start_thread   compat_start_thread
  #define COMPAT_SET_PERSONALITY(ex)set_thread_flag(TIF_32BIT);
  #define COMPAT_ARCH_DLINFO
+
+
  extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
  int uses_interp);
  #define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page

+#else
+
+typedef elf_greg_t compat_elf_greg_t;
+typedef elf_gregset_t  compat_elf_gregset_t;
+#define compat_a32_elf_check_arch(x)   0
+#define COMPAT_SET_PERSONALITY(ex)
+#define COMPAT_ARCH_DLINFO
+
+#endif
+
+#define compat_elf_check_arch(x)   compat_a32_elf_check_arch(x)
+
  #endif /* CONFIG_COMPAT */

  #endif
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index 50f559f..63b19f1 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
  };


-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
  /* Masks for extracting the FPSR and FPCR from the FPSCR */
  #define VFP_FPSCR_STAT_MASK   0xf89f
  #define VFP_FPSCR_CTRL_MASK   0x07f79f00
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 536274e..1059b3f 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -120,7 +120,7 @@ struct pt_regs {

  #define arch_has_single_step()(1)

-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
  #define compat_thumb_mode(regs) \
(((regs)->pstate & COMPAT_PSR_T_BIT))
  #else
diff --git a/arch/arm64/include/asm/signal32.h 
b/arch/arm64/include/asm/signal32.h
index eeaa975..4302909 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -20,6 +20,7 @@
  #ifdef CONFIG_COMPAT
  #include 

+#ifdef CONFIG_AARCH32_EL0
  #define AARCH32_KERN_SIGRET_CODE_OFFSET   0x500

  extern const compat_ulong_t aarch32_sigret_code[6];
@@ -47,6 +48,7 @@ static inline int compat_setup_rt_frame(int usig, struct 
ksignal *ksig, sigset_t
  static inline void compat_setup_restart_syscall(struct pt_regs *regs)
  {
  }
+#endif /* CONFIG_AARCH32_EL0 */
  #endif /* CONFIG_COMPAT */
  #endif /* __KERNEL__ */
  #endif /* __ASM_SIGNAL32_H */
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e3559..af04276 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -22,6 +22,7 @@

  #include 

+#ifdef CONFIG_AARCH32_EL0
  /*
   * struct stat64 is needed for compat tasks only. Its definition is different
   * from the generic struct stat64.
@@ -59,3 +60,4 @@ struct stat64 {

  #endif
  #endif
+#endif
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 3bc498c..759c433 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,7 +13,7 @@
   * You should have received a copy of the GNU General Public License
   * along with this program.  If not, see .
   */
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
  #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
  #define __ARCH_WANT_COMPAT_STAT64
  #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -26,7 +26,9 @@
  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
+#endif

+#ifdef CONFIG_COMPAT
  /*
   * Compat syscall numbers used by the AArch64 kernel.
   */
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 22dc9bc..1470332 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -20,7 +20,7 @@ arm64-obj-y   := debug-monitors.o 

Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-10-06 Thread Andrey Konovalov

Hi Yury,

With this patch set 4.3 kernel fails to build with both 
arch/arm64/configs/defconfig,
and with arch/arm64/configs/defconfig plus CONFIG_AARCH32_EL0=y and 
CONFIG_ARM64_ILP32=y.
See the details below.

Thanks,
Andrey

On 09/30/2015 01:14 AM, Yury Norov wrote:

From: Andrew Pinski 

Signed-off-by: Philipp Tomsich 
Signed-off-by: Christoph Muellner 
Signed-off-by: Yury Norov 

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index faad6df..f40c51b 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -166,10 +166,13 @@ extern int arch_setup_additional_pages(struct 
linux_binprm *bprm,

  #define COMPAT_ELF_ET_DYN_BASE(2 * TASK_SIZE_32 / 3)

+
+#ifdef CONFIG_AARCH32_EL0
+
  /* AArch32 registers. */
-#define COMPAT_ELF_NGREG   18
+#define COMPAT_A32_ELF_NGREG   18
  typedef unsigned int  compat_elf_greg_t;
-typedef compat_elf_greg_t  compat_elf_gregset_t[COMPAT_ELF_NGREG];
+typedef compat_elf_greg_t  
compat_elf_gregset_t[COMPAT_A32_ELF_NGREG];

  /* AArch32 EABI. */
  #define EF_ARM_EABI_MASK  0xff00
@@ -179,11 +182,25 @@ typedef compat_elf_greg_t 
compat_elf_gregset_t[COMPAT_ELF_NGREG];
  #define compat_start_thread   compat_start_thread
  #define COMPAT_SET_PERSONALITY(ex)set_thread_flag(TIF_32BIT);
  #define COMPAT_ARCH_DLINFO
+
+
  extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
  int uses_interp);
  #define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page

+#else
+
+typedef elf_greg_t compat_elf_greg_t;
+typedef elf_gregset_t  compat_elf_gregset_t;
+#define compat_a32_elf_check_arch(x)   0
+#define COMPAT_SET_PERSONALITY(ex)
+#define COMPAT_ARCH_DLINFO
+
+#endif
+
+#define compat_elf_check_arch(x)   compat_a32_elf_check_arch(x)
+
  #endif /* CONFIG_COMPAT */

  #endif
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index 50f559f..63b19f1 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
  };


-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
  /* Masks for extracting the FPSR and FPCR from the FPSCR */
  #define VFP_FPSCR_STAT_MASK   0xf89f
  #define VFP_FPSCR_CTRL_MASK   0x07f79f00
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 536274e..1059b3f 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -120,7 +120,7 @@ struct pt_regs {

  #define arch_has_single_step()(1)

-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
  #define compat_thumb_mode(regs) \
(((regs)->pstate & COMPAT_PSR_T_BIT))
  #else
diff --git a/arch/arm64/include/asm/signal32.h 
b/arch/arm64/include/asm/signal32.h
index eeaa975..4302909 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -20,6 +20,7 @@
  #ifdef CONFIG_COMPAT
  #include 

+#ifdef CONFIG_AARCH32_EL0
  #define AARCH32_KERN_SIGRET_CODE_OFFSET   0x500

  extern const compat_ulong_t aarch32_sigret_code[6];
@@ -47,6 +48,7 @@ static inline int compat_setup_rt_frame(int usig, struct 
ksignal *ksig, sigset_t
  static inline void compat_setup_restart_syscall(struct pt_regs *regs)
  {
  }
+#endif /* CONFIG_AARCH32_EL0 */
  #endif /* CONFIG_COMPAT */
  #endif /* __KERNEL__ */
  #endif /* __ASM_SIGNAL32_H */
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e3559..af04276 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -22,6 +22,7 @@

  #include 

+#ifdef CONFIG_AARCH32_EL0
  /*
   * struct stat64 is needed for compat tasks only. Its definition is different
   * from the generic struct stat64.
@@ -59,3 +60,4 @@ struct stat64 {

  #endif
  #endif
+#endif
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 3bc498c..759c433 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,7 +13,7 @@
   * You should have received a copy of the GNU General Public License
   * along with this program.  If not, see .
   */
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
  #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
  #define __ARCH_WANT_COMPAT_STAT64
  #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -26,7 +26,9 @@
  #define __ARCH_WANT_COMPAT_SYS_SENDFILE
  #define __ARCH_WANT_SYS_FORK
  #define __ARCH_WANT_SYS_VFORK
+#endif

+#ifdef CONFIG_COMPAT
  /*
   * Compat syscall numbers used by the AArch64 kernel.
   */
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 22dc9bc..1470332 100644
--- 

Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread kbuild test robot
Hi Andrew,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please 
ignore]

config: arm64-allmodconfig (attached as .config)
reproduce:
  wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git checkout 4035143523cbf0106ee81f3ea585b363110c1ab6
  # save the attached .config to linux build tree
  make.cross ARCH=arm64 

Note: the linux-review/Yury-Norov/ILP32-for-ARM64 HEAD 
3dd1a64760c74c774056fb5635ff933762dd6453 builds fine.
  It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmdomain.c:27:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmdomain.c:27:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
--
   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmthread.c:28:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
--
   In file included from include/linux/elf.h:4:0,
from arch/arm64/kernel/ptrace.c:39:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
>> arch/arm64/kernel/ptrace.c:880:8: error: 'COMPAT_ELF_NGREG' undeclared here 
>> (not in a function)
  .n = COMPAT_ELF_NGREG,
   ^
--
   In file included from include/linux/elf.h:4:0,
from include/linux/elfcore-compat.h:4,
from fs/compat_binfmt_elf.c:20:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
   In file included from fs/compat_binfmt_elf.c:145:0:
   fs/binfmt_elf.c: In function 'load_elf_interp':
>> fs/binfmt_elf.c:533:2: error: implicit declaration of function 
>> 'compat_a32_elf_check_arch' [-Werror=implicit-function-declaration]
 if (!elf_check_arch(interp_elf_ex))
 ^
   cc1: some warnings being treated as errors

vim +/COMPAT_ELF_NGREG +880 arch/arm64/kernel/ptrace.c

478fcb2c Will Deacon 2012-03-05  874.regsets = aarch32_regsets, .n 
= ARRAY_SIZE(aarch32_regsets)
478fcb2c Will Deacon 2012-03-05  875  };
478fcb2c Will Deacon 2012-03-05  876  
5d220ff9 Catalin Marinas 2015-07-14  877  static const struct user_regset 
aarch32_ptrace_regsets[] = {
5d220ff9 Catalin Marinas 2015-07-14  878[REGSET_GPR] = {
5d220ff9 Catalin Marinas 2015-07-14  879.core_note_type = 
NT_PRSTATUS,
5d220ff9 Catalin Marinas 2015-07-14 @880.n = COMPAT_ELF_NGREG,
5d220ff9 Catalin Marinas 2015-07-14  881.size = 
sizeof(compat_elf_greg_t),
5d220ff9 Catalin Marinas 2015-07-14  882.align = 
sizeof(compat_elf_greg_t),
5d220ff9 Catalin Marinas 2015-07-14  883.get = compat_gpr_get,

:: The code at line 880 was first introduced by commit
:: 5d220ff9420f8b1689805ba2d938bedf9e0860a4 arm64: Better native ptrace 
support for compat tasks

:: TO: Catalin Marinas 
:: CC: Will Deacon 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread kbuild test robot
Hi Andrew,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please 
ignore]

config: arm64-allnoconfig (attached as .config)
reproduce:
  wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git checkout 4035143523cbf0106ee81f3ea585b363110c1ab6
  # save the attached .config to linux build tree
  make.cross ARCH=arm64 

All error/warnings (new ones prefixed by >>):

>> arch/arm64/kernel/ptrace.c:1190:56: error: unknown type name 'compat_long_t'
long compat_a32_arch_ptrace(struct task_struct *child, compat_long_t 
request,
   ^
>> arch/arm64/kernel/ptrace.c:1191:8: error: unknown type name 'compat_ulong_t'
   compat_ulong_t caddr, compat_ulong_t cdata)
   ^
   arch/arm64/kernel/ptrace.c:1191:30: error: unknown type name 'compat_ulong_t'
   compat_ulong_t caddr, compat_ulong_t cdata)
 ^
--
   arch/arm64/kernel/signal.c: In function 'setup_restart_syscall':
>> arch/arm64/kernel/signal.c:280:3: error: implicit declaration of function 
>> 'compat_setup_restart_syscall' [-Werror=implicit-function-declaration]
  compat_setup_restart_syscall(regs);
  ^
   arch/arm64/kernel/signal.c: In function 'handle_signal':
>> arch/arm64/kernel/signal.c:300:4: error: implicit declaration of function 
>> 'compat_setup_rt_frame' [-Werror=implicit-function-declaration]
   ret = compat_setup_rt_frame(usig, ksig, oldset, regs);
   ^
>> arch/arm64/kernel/signal.c:302:4: error: implicit declaration of function 
>> 'compat_setup_frame' [-Werror=implicit-function-declaration]
   ret = compat_setup_frame(usig, ksig, oldset, regs);
   ^
   cc1: some warnings being treated as errors

vim +/compat_long_t +1190 arch/arm64/kernel/ptrace.c

  1184  break;
  1185  }
  1186  
  1187  return ret;
  1188  }
  1189  #else /* !CONFIG_AARCH32_EL0 */
> 1190  long compat_a32_arch_ptrace(struct task_struct *child, compat_long_t 
> request,
> 1191  compat_ulong_t caddr, compat_ulong_t cdata)
  1192  {
  1193  return -1;
  1194  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread Yury Norov
From: Andrew Pinski 

Signed-off-by: Philipp Tomsich 
Signed-off-by: Christoph Muellner 
Signed-off-by: Yury Norov 

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index faad6df..f40c51b 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -166,10 +166,13 @@ extern int arch_setup_additional_pages(struct 
linux_binprm *bprm,
 
 #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3)
 
+
+#ifdef CONFIG_AARCH32_EL0
+
 /* AArch32 registers. */
-#define COMPAT_ELF_NGREG   18
+#define COMPAT_A32_ELF_NGREG   18
 typedef unsigned int   compat_elf_greg_t;
-typedef compat_elf_greg_t  compat_elf_gregset_t[COMPAT_ELF_NGREG];
+typedef compat_elf_greg_t  
compat_elf_gregset_t[COMPAT_A32_ELF_NGREG];
 
 /* AArch32 EABI. */
 #define EF_ARM_EABI_MASK   0xff00
@@ -179,11 +182,25 @@ typedef compat_elf_greg_t 
compat_elf_gregset_t[COMPAT_ELF_NGREG];
 #define compat_start_threadcompat_start_thread
 #define COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT);
 #define COMPAT_ARCH_DLINFO
+
+
 extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
  int uses_interp);
 #define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page
 
+#else
+
+typedef elf_greg_t compat_elf_greg_t;
+typedef elf_gregset_t  compat_elf_gregset_t;
+#define compat_a32_elf_check_arch(x)   0
+#define COMPAT_SET_PERSONALITY(ex)
+#define COMPAT_ARCH_DLINFO
+
+#endif
+
+#define compat_elf_check_arch(x)   compat_a32_elf_check_arch(x)
+
 #endif /* CONFIG_COMPAT */
 
 #endif
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index 50f559f..63b19f1 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
 };
 
 
-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
 /* Masks for extracting the FPSR and FPCR from the FPSCR */
 #define VFP_FPSCR_STAT_MASK0xf89f
 #define VFP_FPSCR_CTRL_MASK0x07f79f00
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 536274e..1059b3f 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -120,7 +120,7 @@ struct pt_regs {
 
 #define arch_has_single_step() (1)
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define compat_thumb_mode(regs) \
(((regs)->pstate & COMPAT_PSR_T_BIT))
 #else
diff --git a/arch/arm64/include/asm/signal32.h 
b/arch/arm64/include/asm/signal32.h
index eeaa975..4302909 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -20,6 +20,7 @@
 #ifdef CONFIG_COMPAT
 #include 
 
+#ifdef CONFIG_AARCH32_EL0
 #define AARCH32_KERN_SIGRET_CODE_OFFSET0x500
 
 extern const compat_ulong_t aarch32_sigret_code[6];
@@ -47,6 +48,7 @@ static inline int compat_setup_rt_frame(int usig, struct 
ksignal *ksig, sigset_t
 static inline void compat_setup_restart_syscall(struct pt_regs *regs)
 {
 }
+#endif /* CONFIG_AARCH32_EL0 */
 #endif /* CONFIG_COMPAT */
 #endif /* __KERNEL__ */
 #endif /* __ASM_SIGNAL32_H */
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e3559..af04276 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -22,6 +22,7 @@
 
 #include 
 
+#ifdef CONFIG_AARCH32_EL0
 /*
  * struct stat64 is needed for compat tasks only. Its definition is different
  * from the generic struct stat64.
@@ -59,3 +60,4 @@ struct stat64 {
 
 #endif
 #endif
+#endif
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 3bc498c..759c433 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see .
  */
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -26,7 +26,9 @@
 #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_VFORK
+#endif
 
+#ifdef CONFIG_COMPAT
 /*
  * Compat syscall numbers used by the AArch64 kernel.
  */
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 22dc9bc..1470332 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -20,7 +20,7 @@ arm64-obj-y   := debug-monitors.o entry.o irq.o 
fpsimd.o  \
   cpufeature.o alternative.o cacheinfo.o   
\
   smp.o smp_spin_table.o topology.o
 
-arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o 
\
+arm64-obj-$(CONFIG_AARCH32_EL0)

[PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread Yury Norov
From: Andrew Pinski 

Signed-off-by: Philipp Tomsich 
Signed-off-by: Christoph Muellner 
Signed-off-by: Yury Norov 

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index faad6df..f40c51b 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -166,10 +166,13 @@ extern int arch_setup_additional_pages(struct 
linux_binprm *bprm,
 
 #define COMPAT_ELF_ET_DYN_BASE (2 * TASK_SIZE_32 / 3)
 
+
+#ifdef CONFIG_AARCH32_EL0
+
 /* AArch32 registers. */
-#define COMPAT_ELF_NGREG   18
+#define COMPAT_A32_ELF_NGREG   18
 typedef unsigned int   compat_elf_greg_t;
-typedef compat_elf_greg_t  compat_elf_gregset_t[COMPAT_ELF_NGREG];
+typedef compat_elf_greg_t  
compat_elf_gregset_t[COMPAT_A32_ELF_NGREG];
 
 /* AArch32 EABI. */
 #define EF_ARM_EABI_MASK   0xff00
@@ -179,11 +182,25 @@ typedef compat_elf_greg_t 
compat_elf_gregset_t[COMPAT_ELF_NGREG];
 #define compat_start_threadcompat_start_thread
 #define COMPAT_SET_PERSONALITY(ex) set_thread_flag(TIF_32BIT);
 #define COMPAT_ARCH_DLINFO
+
+
 extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
  int uses_interp);
 #define compat_arch_setup_additional_pages \
aarch32_setup_vectors_page
 
+#else
+
+typedef elf_greg_t compat_elf_greg_t;
+typedef elf_gregset_t  compat_elf_gregset_t;
+#define compat_a32_elf_check_arch(x)   0
+#define COMPAT_SET_PERSONALITY(ex)
+#define COMPAT_ARCH_DLINFO
+
+#endif
+
+#define compat_elf_check_arch(x)   compat_a32_elf_check_arch(x)
+
 #endif /* CONFIG_COMPAT */
 
 #endif
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index 50f559f..63b19f1 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -52,7 +52,7 @@ struct fpsimd_partial_state {
 };
 
 
-#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
+#if defined(__KERNEL__) && defined(CONFIG_AARCH32_EL0)
 /* Masks for extracting the FPSR and FPCR from the FPSCR */
 #define VFP_FPSCR_STAT_MASK0xf89f
 #define VFP_FPSCR_CTRL_MASK0x07f79f00
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index 536274e..1059b3f 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -120,7 +120,7 @@ struct pt_regs {
 
 #define arch_has_single_step() (1)
 
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define compat_thumb_mode(regs) \
(((regs)->pstate & COMPAT_PSR_T_BIT))
 #else
diff --git a/arch/arm64/include/asm/signal32.h 
b/arch/arm64/include/asm/signal32.h
index eeaa975..4302909 100644
--- a/arch/arm64/include/asm/signal32.h
+++ b/arch/arm64/include/asm/signal32.h
@@ -20,6 +20,7 @@
 #ifdef CONFIG_COMPAT
 #include 
 
+#ifdef CONFIG_AARCH32_EL0
 #define AARCH32_KERN_SIGRET_CODE_OFFSET0x500
 
 extern const compat_ulong_t aarch32_sigret_code[6];
@@ -47,6 +48,7 @@ static inline int compat_setup_rt_frame(int usig, struct 
ksignal *ksig, sigset_t
 static inline void compat_setup_restart_syscall(struct pt_regs *regs)
 {
 }
+#endif /* CONFIG_AARCH32_EL0 */
 #endif /* CONFIG_COMPAT */
 #endif /* __KERNEL__ */
 #endif /* __ASM_SIGNAL32_H */
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e3559..af04276 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -22,6 +22,7 @@
 
 #include 
 
+#ifdef CONFIG_AARCH32_EL0
 /*
  * struct stat64 is needed for compat tasks only. Its definition is different
  * from the generic struct stat64.
@@ -59,3 +60,4 @@ struct stat64 {
 
 #endif
 #endif
+#endif
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 3bc498c..759c433 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see .
  */
-#ifdef CONFIG_COMPAT
+#ifdef CONFIG_AARCH32_EL0
 #define __ARCH_WANT_COMPAT_SYS_GETDENTS64
 #define __ARCH_WANT_COMPAT_STAT64
 #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -26,7 +26,9 @@
 #define __ARCH_WANT_COMPAT_SYS_SENDFILE
 #define __ARCH_WANT_SYS_FORK
 #define __ARCH_WANT_SYS_VFORK
+#endif
 
+#ifdef CONFIG_COMPAT
 /*
  * Compat syscall numbers used by the AArch64 kernel.
  */
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 22dc9bc..1470332 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -20,7 +20,7 @@ arm64-obj-y   := debug-monitors.o entry.o irq.o 
fpsimd.o  \
   cpufeature.o alternative.o cacheinfo.o   
\
   smp.o smp_spin_table.o topology.o
 

Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread kbuild test robot
Hi Andrew,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please 
ignore]

config: arm64-allmodconfig (attached as .config)
reproduce:
  wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git checkout 4035143523cbf0106ee81f3ea585b363110c1ab6
  # save the attached .config to linux build tree
  make.cross ARCH=arm64 

Note: the linux-review/Yury-Norov/ILP32-for-ARM64 HEAD 
3dd1a64760c74c774056fb5635ff933762dd6453 builds fine.
  It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmdomain.c:27:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmdomain.c:27:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
--
   In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from fs/ocfs2/dlm/dlmthread.c:28:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
--
   In file included from include/linux/elf.h:4:0,
from arch/arm64/kernel/ptrace.c:39:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
>> arch/arm64/kernel/ptrace.c:880:8: error: 'COMPAT_ELF_NGREG' undeclared here 
>> (not in a function)
  .n = COMPAT_ELF_NGREG,
   ^
--
   In file included from include/linux/elf.h:4:0,
from include/linux/elfcore-compat.h:4,
from fs/compat_binfmt_elf.c:20:
>> arch/arm64/include/asm/elf.h:202:0: warning: "compat_elf_check_arch" 
>> redefined
#define compat_elf_check_arch(x) compat_a32_elf_check_arch(x)
^
   arch/arm64/include/asm/elf.h:179:0: note: this is the location of the 
previous definition
#define compat_elf_check_arch(x) (((x)->e_machine == EM_ARM) && \
^
   In file included from fs/compat_binfmt_elf.c:145:0:
   fs/binfmt_elf.c: In function 'load_elf_interp':
>> fs/binfmt_elf.c:533:2: error: implicit declaration of function 
>> 'compat_a32_elf_check_arch' [-Werror=implicit-function-declaration]
 if (!elf_check_arch(interp_elf_ex))
 ^
   cc1: some warnings being treated as errors

vim +/COMPAT_ELF_NGREG +880 arch/arm64/kernel/ptrace.c

478fcb2c Will Deacon 2012-03-05  874.regsets = aarch32_regsets, .n 
= ARRAY_SIZE(aarch32_regsets)
478fcb2c Will Deacon 2012-03-05  875  };
478fcb2c Will Deacon 2012-03-05  876  
5d220ff9 Catalin Marinas 2015-07-14  877  static const struct user_regset 
aarch32_ptrace_regsets[] = {
5d220ff9 Catalin Marinas 2015-07-14  878[REGSET_GPR] = {
5d220ff9 Catalin Marinas 2015-07-14  879.core_note_type = 
NT_PRSTATUS,
5d220ff9 Catalin Marinas 2015-07-14 @880.n = COMPAT_ELF_NGREG,
5d220ff9 Catalin Marinas 2015-07-14  881.size = 
sizeof(compat_elf_greg_t),
5d220ff9 Catalin Marinas 2015-07-14  882.align = 
sizeof(compat_elf_greg_t),
5d220ff9 Catalin Marinas 2015-07-14  883.get = compat_gpr_get,

:: The code at line 880 was first introduced by commit
:: 5d220ff9420f8b1689805ba2d938bedf9e0860a4 arm64: Better native ptrace 
support for compat tasks

:: TO: Catalin Marinas 
:: CC: Will Deacon 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH v5 04/23] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead

2015-09-29 Thread kbuild test robot
Hi Andrew,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please 
ignore]

config: arm64-allnoconfig (attached as .config)
reproduce:
  wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git checkout 4035143523cbf0106ee81f3ea585b363110c1ab6
  # save the attached .config to linux build tree
  make.cross ARCH=arm64 

All error/warnings (new ones prefixed by >>):

>> arch/arm64/kernel/ptrace.c:1190:56: error: unknown type name 'compat_long_t'
long compat_a32_arch_ptrace(struct task_struct *child, compat_long_t 
request,
   ^
>> arch/arm64/kernel/ptrace.c:1191:8: error: unknown type name 'compat_ulong_t'
   compat_ulong_t caddr, compat_ulong_t cdata)
   ^
   arch/arm64/kernel/ptrace.c:1191:30: error: unknown type name 'compat_ulong_t'
   compat_ulong_t caddr, compat_ulong_t cdata)
 ^
--
   arch/arm64/kernel/signal.c: In function 'setup_restart_syscall':
>> arch/arm64/kernel/signal.c:280:3: error: implicit declaration of function 
>> 'compat_setup_restart_syscall' [-Werror=implicit-function-declaration]
  compat_setup_restart_syscall(regs);
  ^
   arch/arm64/kernel/signal.c: In function 'handle_signal':
>> arch/arm64/kernel/signal.c:300:4: error: implicit declaration of function 
>> 'compat_setup_rt_frame' [-Werror=implicit-function-declaration]
   ret = compat_setup_rt_frame(usig, ksig, oldset, regs);
   ^
>> arch/arm64/kernel/signal.c:302:4: error: implicit declaration of function 
>> 'compat_setup_frame' [-Werror=implicit-function-declaration]
   ret = compat_setup_frame(usig, ksig, oldset, regs);
   ^
   cc1: some warnings being treated as errors

vim +/compat_long_t +1190 arch/arm64/kernel/ptrace.c

  1184  break;
  1185  }
  1186  
  1187  return ret;
  1188  }
  1189  #else /* !CONFIG_AARCH32_EL0 */
> 1190  long compat_a32_arch_ptrace(struct task_struct *child, compat_long_t 
> request,
> 1191  compat_ulong_t caddr, compat_ulong_t cdata)
  1192  {
  1193  return -1;
  1194  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data