diff mbox

[25/25] arm64:ilp32: add ARM64_ILP32 to Kconfig

Message ID 1459894127-17698-26-git-send-email-ynorov@caviumnetworks.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yury Norov April 5, 2016, 10:08 p.m. UTC
From: Andrew Pinski <apinski@cavium.com>

This patch adds the config option for ILP32.

Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/arm64/Kconfig | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Catalin Marinas April 29, 2016, 4:03 p.m. UTC | #1
On Wed, Apr 06, 2016 at 01:08:47AM +0300, Yury Norov wrote:
> +config ARM64_ILP32
> +	bool "Kernel support for ILP32"
> +	select COMPAT_WRAPPER
> +	help
> +	  This option enables support for AArch64 ILP32 user space.  ILP32
> +	  is an ABI where long and pointers are 32bits but it uses the AARCH64
> +	  instruction set.

Is there any penalty for AArch32 tasks when selecting COMPAT_WRAPPER?
Yury Norov April 29, 2016, 4:08 p.m. UTC | #2
On Fri, Apr 29, 2016 at 05:03:34PM +0100, Catalin Marinas wrote:
> On Wed, Apr 06, 2016 at 01:08:47AM +0300, Yury Norov wrote:
> > +config ARM64_ILP32
> > +	bool "Kernel support for ILP32"
> > +	select COMPAT_WRAPPER
> > +	help
> > +	  This option enables support for AArch64 ILP32 user space.  ILP32
> > +	  is an ABI where long and pointers are 32bits but it uses the AARCH64
> > +	  instruction set.
> 
> Is there any penalty for AArch32 tasks when selecting COMPAT_WRAPPER?
> 
> -- 
> Catalin

No. AARCH32 doesn't define __SC_WRAP and so __SYSCALL macro is used,
which fills syscall table with sys_xxx versions, not compat_sys_xxx.
Catalin Marinas April 29, 2016, 4:14 p.m. UTC | #3
On Fri, Apr 29, 2016 at 07:08:55PM +0300, Yury Norov wrote:
> On Fri, Apr 29, 2016 at 05:03:34PM +0100, Catalin Marinas wrote:
> > On Wed, Apr 06, 2016 at 01:08:47AM +0300, Yury Norov wrote:
> > > +config ARM64_ILP32
> > > +	bool "Kernel support for ILP32"
> > > +	select COMPAT_WRAPPER
> > > +	help
> > > +	  This option enables support for AArch64 ILP32 user space.  ILP32
> > > +	  is an ABI where long and pointers are 32bits but it uses the AARCH64
> > > +	  instruction set.
> > 
> > Is there any penalty for AArch32 tasks when selecting COMPAT_WRAPPER?
> 
> No. AARCH32 doesn't define __SC_WRAP and so __SYSCALL macro is used,
> which fills syscall table with sys_xxx versions, not compat_sys_xxx.

Ah, I forgot it has its own unistd32.h.

Thanks.
Yury Norov April 29, 2016, 4:26 p.m. UTC | #4
On Fri, Apr 29, 2016 at 05:14:46PM +0100, Catalin Marinas wrote:
> On Fri, Apr 29, 2016 at 07:08:55PM +0300, Yury Norov wrote:
> > On Fri, Apr 29, 2016 at 05:03:34PM +0100, Catalin Marinas wrote:
> > > On Wed, Apr 06, 2016 at 01:08:47AM +0300, Yury Norov wrote:
> > > > +config ARM64_ILP32
> > > > +	bool "Kernel support for ILP32"
> > > > +	select COMPAT_WRAPPER
> > > > +	help
> > > > +	  This option enables support for AArch64 ILP32 user space.  ILP32
> > > > +	  is an ABI where long and pointers are 32bits but it uses the AARCH64
> > > > +	  instruction set.
> > > 
> > > Is there any penalty for AArch32 tasks when selecting COMPAT_WRAPPER?
> > 
> > No. AARCH32 doesn't define __SC_WRAP and so __SYSCALL macro is used,
> > which fills syscall table with sys_xxx versions, not compat_sys_xxx.
> 
> Ah, I forgot it has its own unistd32.h.
> 
> Thanks.

Even if it was sharing generic unistd,h, it's OK as well. To use
wrappers, you have to enable COMPAT_WRAPPER (which is enabled even if
only a single ABI needs it) *and* define  __SC_WRAP in corresponding
sys_xxx.c, which is individual for each abi, of course.

> 
> -- 
> Catalin
diff mbox

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 46fc295..19d8e31 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -926,7 +926,7 @@  source "fs/Kconfig.binfmt"
 
 config COMPAT
 	def_bool y
-	depends on AARCH32_EL0
+	depends on AARCH32_EL0 || ARM64_ILP32
 
 config AARCH32_EL0
 	bool "Kernel support for 32-bit EL0"
@@ -946,6 +946,14 @@  config AARCH32_EL0
 
 	  If you want to execute 32-bit userspace applications, say Y.
 
+config ARM64_ILP32
+	bool "Kernel support for ILP32"
+	select COMPAT_WRAPPER
+	help
+	  This option enables support for AArch64 ILP32 user space.  ILP32
+	  is an ABI where long and pointers are 32bits but it uses the AARCH64
+	  instruction set.
+
 config SYSVIPC_COMPAT
 	def_bool y
 	depends on COMPAT && SYSVIPC