All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Dr. Philipp Tomsich" <philipp.tomsich@theobroma-systems.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Andreas Kraschitzer <andreas.kraschitzer@theobroma-systems.com>,
	"Pinski, Andrew" <Andrew.Pinski@caviumnetworks.com>,
	Andreas Schwab <schwab@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"agraf@suse.de" <agraf@suse.de>,
	Andrew Pinski <apinski@cavium.com>,
	Kumar Sankaran <ksankaran@apm.com>,
	Benedikt Huber <benedikt.huber@theobroma-systems.com>,
	Christoph Muellner <christoph.muellner@theobroma-systems.com>
Subject: Re: [PATCH v4 00/24] ILP32 for ARM64
Date: Sat, 18 Apr 2015 21:24:19 +0200	[thread overview]
Message-ID: <6299275.Ntfb3Dzi12@wuerfel> (raw)
In-Reply-To: <0394DFCE-2D52-4028-A9F5-BE4285AFC5D9@theobroma-systems.com>

On Friday 17 April 2015 17:15:46 Dr. Philipp Tomsich wrote:
> More comments below.
> 
> > On 17 Apr 2015, at 16:46, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > 
> > Even in this case, we could enable AArch32 compat knowing that ioctls
> > wouldn't work. If this is important, we can add an option to enable
> > ioctl support for ILP32 and re-target the asm/compat.h definitions.
> > 
> >>  g) create a new ABI that does things in exactly the way that we
> >>     would use as the native syscall interface if we had an ilp32
> >>     kernel running on aarch64 with the asm-generic/unistd.h.
> >>     This would mean a 32-bit __kernel_long_t and time_t, but extending
> >>     time_t in the long run, together with aarch32 and i386.
> >>     This one is particularly interesting for people that are interested
> >>     in maximum posix compliance and in having a "nice" ABI, in particular
> >>     if there is a slight chance that within the next decade we have
> >>     reason to support building an arch/arm64 kernel itself in
> >>     aarch64-ilp32 mode.
> 
> I don’t believe that an ILP32 kernel wouldn’t use an uint64_t for time_t, as it
> has full support for 64bit arithmetic anyway.  I also believe that other kernel 
> internals (e.g. filesystems and inode-numbering) would use native 64bit types.
> 
> The differences on the kernel side would mainly rest in that only a 32bit address
> space could reasonably be managed. So a native ILP32 ABI would differ from
> the LP64 ABI mainly in how sizeof(long) is represented in the user-space.
> 
> In other works: a native ILP32 ABI on an ILP32 kernel would have a 64bit time_t.

We normally like to all newly architectures to have an identical ABI though,
which I think would be more important here. 64-bit time_t of course is what
we want all architectures to have in principle, but we didn't do it for nios2
because of the added complexity. I think it's more likely to have no
__kernel_time_t to defined at some point and only provide __kernel_time64_t
in the future for new architectures, but we have not even introduced that.

> >>>> However, it would be nice to get agreement on the normal 32-bit ABI
> >>>> for time_t and timespec first, and then use the same thing everywhere.
> >>> 
> >>> Do you mean for native 32-bit architectures? I think OpenBSD uses a
> >>> 64-bit time_t already on 32-bit arches, it's doable in Linux as well.
> >> 
> >> Yes, and I'm working on that for Linux. The first step involves fixing
> >> the kernel, one file at a time, changing all users of time_t to use
> >> some other type (ktime_t or time64_t in most cases) instead, and introducing
> >> additional system calls to handle the boundary to user space without
> >> breaking stuff. See my presentation at http://elinux.org/ELC_2015_Presentations
> >> for more detail.
> > 
> > The approach here is primarily to fix the problem for existing 32-bit
> > architectures by adding a new syscall and that's fine. But what if we
> > enforce 64-bit time_t for all _new_ architectures?
> 
> This boils down to whether we can define all the new syscalls _right now_ and
> get the new (extended) compat-layer set up. In this case we could have a userspace 
> implementation that already conforms to this for ILP32.
> 
> Otherwise, we can just put a (MIPS64) N32-alike (AArch64) ILP32 in and migrate
> with everyone else.
> 
> Although it feels wrong to add another ABI that has a known limitation, this may
> in fact be the easiest way, as any fix to ILP32 would be done together with the
> fixes to all other 32bit ABIs.
> 
> So, while I would like to have a 64bit time_t for ILP32 based on principle, I do see
> the 32bit time_t path as the most pragmatic way forward… especially, as this unlinks
> getting “some form of” ILP32 merged from resolving the 64bit time_t issue across
> all architectures.

Given Catalin's comments from yesterday, I think we can just fix the
definitions of 'struct stat64' for asm-generic to make it have the same
layout as the 64-bit version of 'struct stat', and use that for aarch64-ilp32.

Similarly for the four sysvipc headers, we can have a modified version of
the asm-generic ones in arch/arm64/uapi/asm, which will use the same layout
for ilp32 and lp64 without having to set __kernel_ulong_t to 64-bit.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 00/24] ILP32 for ARM64
Date: Sat, 18 Apr 2015 21:24:19 +0200	[thread overview]
Message-ID: <6299275.Ntfb3Dzi12@wuerfel> (raw)
In-Reply-To: <0394DFCE-2D52-4028-A9F5-BE4285AFC5D9@theobroma-systems.com>

On Friday 17 April 2015 17:15:46 Dr. Philipp Tomsich wrote:
> More comments below.
> 
> > On 17 Apr 2015, at 16:46, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > 
> > Even in this case, we could enable AArch32 compat knowing that ioctls
> > wouldn't work. If this is important, we can add an option to enable
> > ioctl support for ILP32 and re-target the asm/compat.h definitions.
> > 
> >>  g) create a new ABI that does things in exactly the way that we
> >>     would use as the native syscall interface if we had an ilp32
> >>     kernel running on aarch64 with the asm-generic/unistd.h.
> >>     This would mean a 32-bit __kernel_long_t and time_t, but extending
> >>     time_t in the long run, together with aarch32 and i386.
> >>     This one is particularly interesting for people that are interested
> >>     in maximum posix compliance and in having a "nice" ABI, in particular
> >>     if there is a slight chance that within the next decade we have
> >>     reason to support building an arch/arm64 kernel itself in
> >>     aarch64-ilp32 mode.
> 
> I don?t believe that an ILP32 kernel wouldn?t use an uint64_t for time_t, as it
> has full support for 64bit arithmetic anyway.  I also believe that other kernel 
> internals (e.g. filesystems and inode-numbering) would use native 64bit types.
> 
> The differences on the kernel side would mainly rest in that only a 32bit address
> space could reasonably be managed. So a native ILP32 ABI would differ from
> the LP64 ABI mainly in how sizeof(long) is represented in the user-space.
> 
> In other works: a native ILP32 ABI on an ILP32 kernel would have a 64bit time_t.

We normally like to all newly architectures to have an identical ABI though,
which I think would be more important here. 64-bit time_t of course is what
we want all architectures to have in principle, but we didn't do it for nios2
because of the added complexity. I think it's more likely to have no
__kernel_time_t to defined at some point and only provide __kernel_time64_t
in the future for new architectures, but we have not even introduced that.

> >>>> However, it would be nice to get agreement on the normal 32-bit ABI
> >>>> for time_t and timespec first, and then use the same thing everywhere.
> >>> 
> >>> Do you mean for native 32-bit architectures? I think OpenBSD uses a
> >>> 64-bit time_t already on 32-bit arches, it's doable in Linux as well.
> >> 
> >> Yes, and I'm working on that for Linux. The first step involves fixing
> >> the kernel, one file at a time, changing all users of time_t to use
> >> some other type (ktime_t or time64_t in most cases) instead, and introducing
> >> additional system calls to handle the boundary to user space without
> >> breaking stuff. See my presentation at http://elinux.org/ELC_2015_Presentations
> >> for more detail.
> > 
> > The approach here is primarily to fix the problem for existing 32-bit
> > architectures by adding a new syscall and that's fine. But what if we
> > enforce 64-bit time_t for all _new_ architectures?
> 
> This boils down to whether we can define all the new syscalls _right now_ and
> get the new (extended) compat-layer set up. In this case we could have a userspace 
> implementation that already conforms to this for ILP32.
> 
> Otherwise, we can just put a (MIPS64) N32-alike (AArch64) ILP32 in and migrate
> with everyone else.
> 
> Although it feels wrong to add another ABI that has a known limitation, this may
> in fact be the easiest way, as any fix to ILP32 would be done together with the
> fixes to all other 32bit ABIs.
> 
> So, while I would like to have a 64bit time_t for ILP32 based on principle, I do see
> the 32bit time_t path as the most pragmatic way forward? especially, as this unlinks
> getting ?some form of? ILP32 merged from resolving the 64bit time_t issue across
> all architectures.

Given Catalin's comments from yesterday, I think we can just fix the
definitions of 'struct stat64' for asm-generic to make it have the same
layout as the 64-bit version of 'struct stat', and use that for aarch64-ilp32.

Similarly for the four sysvipc headers, we can have a modified version of
the asm-generic ones in arch/arm64/uapi/asm, which will use the same layout
for ilp32 and lp64 without having to set __kernel_ulong_t to 64-bit.

	Arnd

  reply	other threads:[~2015-04-18 19:24 UTC|newest]

Thread overview: 155+ 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 ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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 11/24] arm64:ilp32: add is_ilp32_compat_{task, thread} " 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 22/24] arm64:ilp32: use compat for stack_t Philipp Tomsich
2015-04-13 19:44   ` Philipp Tomsich
2015-05-05  0:03   ` Pinski, Andrew
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   ` Philipp Tomsich
2015-04-13 19:44 ` [PATCH v4 24/24] arm64:ilp32: add ARM64_ILP32 to Kconfig Philipp Tomsich
2015-04-13 19:44   ` Philipp Tomsich
2015-04-13 21:01 ` [PATCH v4 00/24] ILP32 for ARM64 Arnd Bergmann
2015-04-13 21:01   ` Arnd Bergmann
2015-04-13 22:58   ` Dr. Philipp Tomsich
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:08         ` Arnd Bergmann
2015-04-14 10:45         ` Pinski, Andrew
2015-04-14 10:45           ` Pinski, Andrew
2015-04-14 11:14           ` Arnd Bergmann
2015-04-14 11:14             ` Arnd Bergmann
2015-04-14 11:50             ` Dr. Philipp Tomsich
2015-04-14 11:50               ` Dr. Philipp Tomsich
2015-04-14 14:07               ` Arnd Bergmann
2015-04-14 14:07                 ` Arnd Bergmann
2015-04-14 14:54                 ` Dr. Philipp Tomsich
2015-04-15 12:25                   ` Arnd Bergmann
2015-04-15 12:25                     ` Arnd Bergmann
2015-04-14 15:00                 ` Catalin Marinas
2015-04-14 15:00                   ` Catalin Marinas
2015-04-14 22:28                   ` Arnd Bergmann
2015-04-14 22:28                     ` Arnd Bergmann
2015-04-15  9:18                     ` Dr. Philipp Tomsich
2015-04-15  9:18                       ` Dr. Philipp Tomsich
2015-04-15 10:01                       ` Catalin Marinas
2015-04-15 10:01                         ` Catalin Marinas
2015-04-15 15:15                         ` Arnd Bergmann
2015-04-15 15:15                           ` Arnd Bergmann
2015-04-15 15:38                           ` Catalin Marinas
2015-04-15 15:38                             ` Catalin Marinas
2015-04-15 17:01                             ` Dr. Philipp Tomsich
2015-04-15 17:01                               ` Dr. Philipp Tomsich
2015-04-15 17:22                               ` Catalin Marinas
2015-04-15 17:22                                 ` Catalin Marinas
2015-04-15 22:25                                 ` Alexander Graf
2015-04-15 22:25                                   ` Alexander Graf
2015-04-16 11:03                                   ` Catalin Marinas
2015-04-16 11:03                                     ` Catalin Marinas
2015-04-16 11:19                                     ` Dr. Philipp Tomsich
2015-04-16 11:19                                       ` Dr. Philipp Tomsich
2015-04-16 11:33                                       ` Pinski, Andrew
2015-04-16 11:33                                         ` Pinski, Andrew
2015-04-16 13:31                                         ` Catalin Marinas
2015-04-16 13:31                                           ` Catalin Marinas
2015-04-16 15:21                                           ` Arnd Bergmann
2015-04-16 15:21                                             ` Arnd Bergmann
2015-04-17  9:01                                             ` Catalin Marinas
2015-04-17  9:01                                               ` Catalin Marinas
2015-04-17 13:17                                               ` Arnd Bergmann
2015-04-17 13:17                                                 ` Arnd Bergmann
2015-04-17 14:06                                                 ` Alexander Graf
2015-04-17 14:06                                                   ` Alexander Graf
2015-04-17 14:46                                                 ` Catalin Marinas
2015-04-17 14:46                                                   ` Catalin Marinas
2015-04-17 15:15                                                   ` Dr. Philipp Tomsich
2015-04-17 15:15                                                     ` Dr. Philipp Tomsich
2015-04-18 19:24                                                     ` Arnd Bergmann [this message]
2015-04-18 19:24                                                       ` Arnd Bergmann
2015-05-04 10:29                                                       ` Arnd Bergmann
2015-05-04 10:29                                                         ` Arnd Bergmann
2015-05-04 10:32                                                         ` Dr. Philipp Tomsich
2015-05-04 10:32                                                           ` Dr. Philipp Tomsich
2015-05-04 14:43                                                           ` Arnd Bergmann
2015-05-04 14:43                                                             ` Arnd Bergmann
2015-05-05 13:11                                                         ` Arnd Bergmann
2015-05-05 13:11                                                           ` Arnd Bergmann
2015-04-17 15:49                                                   ` Arnd Bergmann
2015-04-17 15:49                                                     ` Arnd Bergmann
2015-04-20 15:56                                                     ` Catalin Marinas
2015-04-20 15:56                                                       ` Catalin Marinas
2015-04-20 17:40                                                       ` Arnd Bergmann
2015-04-20 17:40                                                         ` Arnd Bergmann
2015-04-20 14:37                                                 ` Zhangjian (Bamvor)
2015-04-20 14:37                                                   ` Zhangjian (Bamvor)
2015-04-16 14:27                                       ` Catalin Marinas
2015-04-16 14:27                                         ` Catalin Marinas
2015-04-14 11:51             ` Pinski, Andrew
2015-04-14 11:51               ` Pinski, Andrew
2015-04-14 14:56               ` Catalin Marinas
2015-04-14 14:56                 ` Catalin Marinas
2015-04-14 13:38           ` Catalin Marinas
2015-04-14 13:38             ` Catalin Marinas
2015-04-14 14:47         ` Catalin Marinas
2015-04-14 14:47           ` Catalin Marinas
2015-04-14 15:29           ` Dr. Philipp Tomsich
2015-04-14 15:29             ` Dr. Philipp Tomsich
2015-04-14 16:55             ` Catalin Marinas
2015-04-14 16:55               ` Catalin Marinas
2015-04-15 10:31               ` Dr. Philipp Tomsich
2015-04-15 10:31                 ` Dr. Philipp Tomsich
2015-04-15 12:47               ` Arnd Bergmann
2015-04-15 12:47                 ` Arnd Bergmann
2015-04-15 12:42             ` Arnd Bergmann
2015-04-15 12:42               ` Arnd Bergmann
2015-04-14 15:44           ` Arnd Bergmann
2015-04-14 15:44             ` Arnd Bergmann
2015-04-15 11:22             ` Catalin Marinas
2015-04-15 11:22               ` Catalin Marinas
2015-04-15 11:50               ` Dr. Philipp Tomsich
2015-04-15 15:49                 ` Catalin Marinas
2015-04-15 15:49                   ` Catalin Marinas
2015-04-14  9:40     ` Arnd Bergmann
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=6299275.Ntfb3Dzi12@wuerfel \
    --to=arnd@arndb.de \
    --cc=Andrew.Pinski@caviumnetworks.com \
    --cc=agraf@suse.de \
    --cc=andreas.kraschitzer@theobroma-systems.com \
    --cc=apinski@cavium.com \
    --cc=benedikt.huber@theobroma-systems.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoph.muellner@theobroma-systems.com \
    --cc=ksankaran@apm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philipp.tomsich@theobroma-systems.com \
    --cc=schwab@suse.de \
    /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 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.