public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 00/24] ILP32 for ARM64
Date: Mon, 20 Apr 2015 19:40:37 +0200	[thread overview]
Message-ID: <3662254.2ZhTAQGuKR@wuerfel> (raw)
In-Reply-To: <20150420155600.GF24715@e104818-lin.cambridge.arm.com>

On Monday 20 April 2015 16:56:00 Catalin Marinas wrote:
> On Fri, Apr 17, 2015 at 05:49:44PM +0200, Arnd Bergmann wrote:
> > On Friday 17 April 2015 15:46:57 Catalin Marinas wrote:
> > > On Fri, Apr 17, 2015 at 02:17:32PM +0100, Arnd Bergmann wrote:
> > | typedef unsigned short          __kernel_mode_t;
> > | typedef unsigned short          __kernel_ipc_pid_t;
> > 
> > Both of these affect all sysvipc, but very little else
> > 
> > | typedef unsigned short          __kernel_uid_t;
> > | typedef unsigned short          __kernel_gid_t;
> > 
> > sysvipc, ncpfs, and core dumps (probably fine since they are separate
> > anyway), 
> 
> Not all ipc functions are affected AFAICT. msgsnd, msgrcv, msgctl look
> to me like we can just use the compat variants with the generic
> definitions for the types above (unless I missed something). Similarly
> for shmat, compat_sys_shmat just does some compat_ptr casting.

Right.

> > | typedef unsigned short          __kernel_old_dev_t; /* compat gets this wrong */
> > 
> > old-style loopdev ioctl
> > 
> > | struct stat { ... } /* possibly not needed */
> > 
> >  - lustre ioctls (needs to be fixed anyway)
> >  - old stat syscalls (won't be used with asm-generic/unistd.h)
> > 
> > | struct stat64 { ... }
> > 
> >  - lustre ioctls
> >  - new style stat syscalls
> 
> For stat64 the wrappers don't look complicated, so we could add arm64
> ILP32-specific ones.

stat is never easy ;-)

Note that for new architectures, we use 'struct stat64' on 32-bit systems
but 'struct stat' on 64-bit systems. Old architectures like arch/arm has
both, and neither of them matches the on from arch/arm64.

Also, the asm-generic definition of 'struct stat64' is wrong and really
needs to be fixed to have the same layout that 'struct stat' has on
a 64-bit architecture. The only difference between the two is the size
of the time related 'st_atime' etc members, and having them defined
this way was my biggest mistake when I created the uapi/asm-generic
headers.

> > So, in essence the difference comes down to the syscalls for stat
> > and ipc. If we use the aarch32 data types, we can share the
> > fstatat64, fstat64, semctl, msgsnd, msgrcv, msgctl, shmat,
> > and shmctl compat system calls between aarch32-compat and
> > aarch64-ilp32-compat. Otherwise we have to duplicate or extend
> > them to cover both cases at runtime. That would be rather ugly
> > but entirely doable. The ioctls are hardly affected, the few
> > ones that differ once __kernel_long_t matches could easily be
> > fixed up as you say.
> 
> I'd prefer a cleaner ABI even if we are to write some specific wrappers.

Ok, makes sense. As I replied to Philipp later, even with the
cleaner definition of 'stat64' and the sysipc syscalls, we should
be able to trivially reuse the native 64-bit version in the way that
the current patch set does for a lot of other syscalls, but keep all
the other syscalls using the normal 32-bit __kernel_long_t variants
that we already have.

	Arnd

  reply	other threads:[~2015-04-20 17:40 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 19:44 [PATCH v4 00/24] ILP32 for ARM64 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 01/24] arm64:ilp32: add documentation on the ILP32 ABI " Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 02/24] arm64: ensure the kernel is compiled for LP64 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 03/24] arm64: rename COMPAT to AARCH32_EL0 in Kconfig Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 04/24] arm64: change some CONFIG_COMPAT over to use CONFIG_AARCH32_EL0 instead Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 05/24] arm64:ilp32: expose 'kernel_long' as 'long long' for ILP32 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 06/24] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 07/24] arm64:ilp32: share signal structures between ILP32 and LP64 ABIs Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 08/24] arm64:ilp32: use 64bit syscall-names for ILP32 when passing 64bit registers Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 09/24] arm64:ilp32: use non-compat syscall names for ILP32 as for LP64 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 10/24] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat) Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 11/24] arm64:ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 12/24] arm64:ilp32: COMPAT_USE_64BIT_TIME is true for ILP32 tasks Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 13/24] arm64:ilp32: share HWCAP between LP64 and ILP32 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 14/24] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 15/24] arm64:ilp32: support core dump generation for ILP32 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 16/24] arm64: add support for starting ILP32 (ELFCLASS32) binaries Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 17/24] arm64:ilp32: add vdso-ilp32 and use for signal return Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 18/24] ptrace: Allow compat to use the native siginfo Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 19/24] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 20/24] arm64:ilp32: use compat-syscalls for msgsnd and msgrcv for ILP32 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 21/24] arm64:ilp32: use the native siginfo instead of the compat siginfo Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 22/24] arm64:ilp32: use compat for stack_t Philipp Tomsich
2015-05-05  0:03   ` Pinski, Andrew
2015-04-13 19:44 ` [PATCH v4 23/24] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32 Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 24/24] arm64:ilp32: add ARM64_ILP32 to Kconfig Philipp Tomsich
2015-04-13 21:01 ` [PATCH v4 00/24] ILP32 for ARM64 Arnd Bergmann
2015-04-13 22:58   ` Dr. Philipp Tomsich
2015-04-14  9:33     ` Dr. Philipp Tomsich
2015-04-14 10:08       ` Arnd Bergmann
2015-04-14 10:45         ` Pinski, Andrew
2015-04-14 11:14           ` Arnd Bergmann
2015-04-14 11:50             ` Dr. Philipp Tomsich
2015-04-14 14:07               ` Arnd Bergmann
2015-04-14 14:54                 ` Dr. Philipp Tomsich
2015-04-15 12:25                   ` Arnd Bergmann
2015-04-14 15:00                 ` Catalin Marinas
2015-04-14 22:28                   ` Arnd Bergmann
2015-04-15  9:18                     ` Dr. Philipp Tomsich
2015-04-15 10:01                       ` Catalin Marinas
2015-04-15 15:15                         ` Arnd Bergmann
2015-04-15 15:38                           ` Catalin Marinas
2015-04-15 17:01                             ` Dr. Philipp Tomsich
2015-04-15 17:22                               ` Catalin Marinas
2015-04-15 22:25                                 ` Alexander Graf
2015-04-16 11:03                                   ` Catalin Marinas
2015-04-16 11:19                                     ` Dr. Philipp Tomsich
2015-04-16 11:33                                       ` Pinski, Andrew
2015-04-16 13:31                                         ` Catalin Marinas
2015-04-16 15:21                                           ` Arnd Bergmann
2015-04-17  9:01                                             ` Catalin Marinas
2015-04-17 13:17                                               ` Arnd Bergmann
2015-04-17 14:06                                                 ` Alexander Graf
2015-04-17 14:46                                                 ` Catalin Marinas
2015-04-17 15:15                                                   ` Dr. Philipp Tomsich
2015-04-18 19:24                                                     ` Arnd Bergmann
2015-05-04 10:29                                                       ` Arnd Bergmann
2015-05-04 10:32                                                         ` Dr. Philipp Tomsich
2015-05-04 14:43                                                           ` Arnd Bergmann
2015-05-05 13:11                                                         ` Arnd Bergmann
2015-04-17 15:49                                                   ` Arnd Bergmann
2015-04-20 15:56                                                     ` Catalin Marinas
2015-04-20 17:40                                                       ` Arnd Bergmann [this message]
2015-04-20 14:37                                                 ` Zhangjian (Bamvor)
2015-04-16 14:27                                       ` Catalin Marinas
2015-04-14 11:51             ` Pinski, Andrew
2015-04-14 14:56               ` Catalin Marinas
2015-04-14 13:38           ` Catalin Marinas
2015-04-14 14:47         ` Catalin Marinas
2015-04-14 15:29           ` Dr. Philipp Tomsich
2015-04-14 16:55             ` Catalin Marinas
2015-04-15 10:31               ` Dr. Philipp Tomsich
2015-04-15 12:47               ` Arnd Bergmann
2015-04-15 12:42             ` Arnd Bergmann
2015-04-14 15:44           ` Arnd Bergmann
2015-04-15 11:22             ` Catalin Marinas
2015-04-15 11:50               ` Dr. Philipp Tomsich
2015-04-15 15:49                 ` Catalin Marinas
2015-04-14  9:40     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3662254.2ZhTAQGuKR@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox