linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can we drop upstream Linux x32 support?
@ 2018-12-11  1:23 Andy Lutomirski
  2018-12-11  1:40 ` Linus Torvalds
                   ` (4 more replies)
  0 siblings, 5 replies; 78+ messages in thread
From: Andy Lutomirski @ 2018-12-11  1:23 UTC (permalink / raw)
  To: X86 ML, LKML, Linux API, H. Peter Anvin, Peter Zijlstra,
	Borislav Petkov, Florian Weimer, Mike Frysinger, H. J. Lu,
	Rich Felker, x32, Arnd Bergmann, Will Deacon, Catalin Marinas,
	Linus Torvalds

Hi all-

I'm seriously considering sending a patch to remove x32 support from
upstream Linux.  Here are some problems with it:

1. It's not entirely clear that it has users.  As far as I know, it's
supported on Gentoo and Debian, and the Debian popcon graph for x32
has been falling off dramatically.  I don't think that any enterprise
distro has ever supported x32.

2. The way that system calls work is very strange.  Most syscalls on
x32 enter through their *native* (i.e. not COMPAT_SYSCALL_DEFINE)
entry point, and this is intentional.  For example, adjtimex() uses
the native entry, not the compat entry, because x32's struct timex
matches the x86_64 layout.  But a handful of syscalls have separate
entry points -- these are the syscalls starting at 512.  These enter
through the COMPAT_SYSCALL_DEFINE entry points.

The x32 syscalls that are *not* in the 512 range violate all semblance
of kernel syscall convention.  In the syscall handlers,
in_compat_syscall() returns true, but the COMPAT_SYSCALL_DEFINE entry
is not invoked.   This is nutty and risks breaking things when people
refactor their syscall implementations.  And no one tests these
things.  Similarly, if someone calls any of the syscalls below 512 but
sets bit 31 in RAX, then the native entry will be called with
in_compat_set().

Conversely, if you call a syscall in the 512 range with bit 31
*clear*, then the compat entry is set with in_compat_syscall()
*clear*.  This is also nutty.

Finally, the kernel has a weird distinction between CONFIG_X86_X32_ABI
and and CONFIG_X86_X32, which I suspect results in incorrect builds if
the host doesn't have an x32 toolchain installed.

I propose that we make CONFIG_X86_X32 depend on BROKEN for a release
or two and then remove all the code if no one complains.  If anyone
wants to re-add it, IMO they're welcome to do so, but they need to do
it in a way that is maintainable.

--Andy

^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: Can we drop upstream Linux x32 support?
@ 2018-12-11 20:38 Shawn Rutledge
  2018-12-12  0:00 ` Maciej W. Rozycki
  0 siblings, 1 reply; 78+ messages in thread
From: Shawn Rutledge @ 2018-12-11 20:38 UTC (permalink / raw)
  To: linux-kernel

I like the idea of x32 in theory: any machine with 4GB or less of memory
for sure does not really need to waste any precious space storing 64-bit
pointers; and even if more memory is available, software that needs to
access more than 4GB per process is somewhat rare (as it should be).  I
used a laptop every day with 4GB until recently, so was generally trying to
run relatively lean software.  I have played around with the Gentoo x32
variant on another machine, just to see how that would go.  I haven't used
it for much...  but tried out some basic things; and as long as it is
powered on, it functions fine as a node in an icecream cluster, too.
The icecream statistics shown in icemon tell me that this machine seems to
be performing faster than it should be, for its age.  So I think there is
some worthwhile average speedup (without being more scientific about it).

As a Qt developer, I have some interest that Qt and Qt Quick ought to work
well on this architecture.  (When it breaks, I write up bugs like
QTBUG-52658 and QTBUG-42759.)  There is still no JIT support for QML, but
perhaps there could be (I could try, if I ever find time to learn how the
existing QML/V4 JIT works on other architectures well enough to add another
one); and meanwhile, at least the interpreter works AFAIK.  I was just
thinking of testing this again, maybe running gentoo or debian x32 on that
old 4GB laptop; so I did a quick google search, and found this thread right
away.

Linux supports a lot of rarely-used hardware and features; so as long as
the burden of supporting x32 is not too great, I'd like to put in my vote to
keep it working.  And I will keep testing from time to time and do my bit
to keep Qt working on this architecture, as long as I'm not wasting my time
(if it's going to disappear, it would be a waste of time).

I can't explain why there aren't more users, and more distros.  It seems
to me it would be a good choice for the compact or small-is-beautiful
distros, like Puppy.

(CC me on this thread if you like, since I'm not currently subscribed to LKML)


^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: Can we drop upstream Linux x32 support?
@ 2018-12-12  9:12 Steven Newbury
  2018-12-12 10:48 ` Thorsten Glaser
  2018-12-12 14:01 ` Rich Felker
  0 siblings, 2 replies; 78+ messages in thread
From: Steven Newbury @ 2018-12-12  9:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Torvalds, macro, tg, luto, arnd, dalias, s,
	catalin.marinas, fweimer, glaubitz, christian.brauner, hjl.tools,
	hpa

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

First off I'd like to request: Please don't break my userspace!

I have a number of systems running with x32-abi as native.  They work
well, I've no want or desire to upgrade their memory or CPUs to make
keep them working as well as they do now.  Let alone the hassle of
having to redeploy with a completely different ABI.


I've been working on getting as much userspace as I can working with
x32 since it first became somewhat usable, I've sent patches upstream
and pushed to encourage projects to write portable code.  Sometimes
that has meant just little tweaks to build systems, or sometimes
disabling asm where I consider it isn't worth the effort of making it
work.  For other projects I've converted the asm or even in some cases
got the JIT working, mozjs17 for example.

So I'm both a user and a developer.

Breaking support for x32 would be really bad for me, but if I'm the
only one using it I suppose I can't really justify it being kept on
that basis.  I know CERN has sucessfully experimented with it over the
years though, so I wouldn't be surprised if there are other users
hiding out there.

I can't help but wonder if it wouldn't make more sense to drop x86
support from long mode than x32.  AMD64 x86 support was always intended
 as a compatibility feature, I very much doubt there are more people
out there using an x86 native userspace on a 64 bit kernel than there
are native x32 users.  x86 support could be implemented via KVM and/or
qemu-user.  There is no reason to keep the extra complexity in the
kernel for what is effectively an emulation layer anyway.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEWa1B4K0Hk12RDstE+lAa6BzrmeAFAlwQ0QQACgkQ+lAa6Bzr
meBILQf9EF1GqHKfnRC7AOFnNCm0235OmH1dJJd4+6zzLWTKGAAvFF6T1F1IG3fu
QTZTEok5s238BapjrvgZ5bxtMP0TGNK++vGZ8ESb6Hi+Q975duemWD8ZsSVPw7SH
YcqEgmxKn28iHq/W//SUPo1kqz7D0jFCDU9dIA1wQY+AwTIzjfMPltWGrKbMbOBQ
LsW+VlL7PfoEzx9sXvaMpjgINEouCvLcuTvhTRclCOO5MWqTQLdIdL9urrBGukUN
7dvKiWWAk6c/Af1W5jnLtYIijaztu3hrZ7lykFmOnwyDoeOhqzIhUkcDaLJcy7Vo
Rsrb1CjzFngpbgTJeOkyC9ZGZ2CZ0g==
=TCpw
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 78+ messages in thread
* Re: Can we drop upstream Linux x32 support?
@ 2018-12-13 16:17 tedheadster
  0 siblings, 0 replies; 78+ messages in thread
From: tedheadster @ 2018-12-13 16:17 UTC (permalink / raw)
  To: Linux Kernel Mailing List

I will also complain. I use the 32 bit x86 environment regularly for
testing. I have found several bugs and worked with upstream developers
to create fixes.

The developers never said anything like "this is a waste of time
because it was found on 32 bit". Instead, they were universally
supportive.

As an example, Thomas Gleixner said that the problem we found would
only show up on older hardware, and he affirmed that it was a bug that
certainly needed to be fixed ("NOHZ: Check for nohz active instead of
nohz enabled").

I actually think this is an _opportunity_ to engage aspiring kernel
programmers. Give them some guidance and have them actively test and
do simple maintenance of 32 bit x86. Yes, I am prepared to take the
lead on this if it is something you want to pursue.

- Matthew Whitehead

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

end of thread, other threads:[~2019-01-22 13:34 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11  1:23 Can we drop upstream Linux x32 support? Andy Lutomirski
2018-12-11  1:40 ` Linus Torvalds
2018-12-11  2:22   ` hpa
2018-12-11  8:16   ` Florian Weimer
2018-12-11 21:53   ` Thorsten Glaser
2018-12-11 23:22     ` Andy Lutomirski
2018-12-11 23:35       ` Thorsten Glaser
2018-12-11 23:55         ` Arnd Bergmann
2018-12-12  2:24         ` Andy Lutomirski
2018-12-12  2:33           ` Thorsten Glaser
2018-12-12  9:04             ` Arnd Bergmann
2018-12-12 18:14               ` Joseph Myers
2018-12-12 18:50                 ` Ivan Ivanov
2018-12-12 19:12                   ` Andy Lutomirski
2018-12-12 19:18                     ` Ivan Ivanov
2018-12-12 16:39             ` Andy Lutomirski
2018-12-12 16:52               ` Rich Felker
2018-12-12 18:03                 ` Andy Lutomirski
2018-12-13 12:40                   ` Catalin Marinas
2018-12-13 15:57                     ` Rich Felker
2018-12-13 16:04                       ` Florian Weimer
2018-12-13 16:28                         ` Rich Felker
2018-12-14 11:42                           ` Florian Weimer
2018-12-14 16:13                             ` Rich Felker
2018-12-13 18:42                         ` Joseph Myers
2018-12-15  4:53               ` Thorsten Glaser
2018-12-11 23:38       ` Rich Felker
2018-12-11 23:40     ` Maciej W. Rozycki
2018-12-13 14:38   ` Olof Johansson
2018-12-13 15:46     ` Lance Richardson
2018-12-13 16:11   ` Richard Purdie
2018-12-11  3:14 ` H.J. Lu
2018-12-11  5:35   ` Andy Lutomirski
2018-12-11  9:02     ` Arnd Bergmann
2018-12-11 11:32       ` Catalin Marinas
2018-12-11 11:37         ` Florian Weimer
2018-12-11 11:52           ` Catalin Marinas
2018-12-11  5:46 ` Christian Brauner
2018-12-11 10:29 ` John Paul Adrian Glaubitz
2018-12-11 10:37   ` Florian Weimer
2018-12-11 10:44     ` John Paul Adrian Glaubitz
2018-12-11 21:59   ` Thorsten Glaser
2018-12-11 23:33     ` Rich Felker
2018-12-13  5:03   ` Kevin Easton
2018-12-13  9:05     ` Richard Weinberger
2018-12-13  9:37       ` Sven Hartrumpf
2018-12-13  9:57         ` Adam Borowski
2018-12-13 18:50         ` Sven Hartrumpf
2018-12-13 12:12       ` Kevin Easton
2018-12-14 14:38       ` David Laight
2018-12-14 15:17         ` Richard Weinberger
2018-12-13 16:02   ` Rich Felker
2018-12-14 14:13     ` Bernd Petrovitsch
2018-12-14 16:17       ` Rich Felker
2018-12-14 16:29         ` Bernd Petrovitsch
2018-12-14 16:38         ` Florian Weimer
2018-12-14 16:55           ` Rich Felker
2018-12-14 18:58             ` Andy Lutomirski
2018-12-14 19:59               ` Lance Richardson
2018-12-14 20:13               ` Linus Torvalds
2018-12-14 21:27                 ` Andy Lutomirski
2018-12-14 21:16 ` Thomas Schöbel-Theuer
2018-12-14 21:24   ` Andy Lutomirski
2018-12-14 21:41     ` Thomas Schöbel-Theuer
2018-12-15  7:41       ` Thomas Schoebel-Theuer
2018-12-15 15:30         ` Andy Lutomirski
2019-01-09 12:41   ` Florian Weimer
2019-01-09 16:02     ` Rich Felker
2019-01-22 13:34   ` Enrico Weigelt, metux IT consult
2018-12-11 20:38 Shawn Rutledge
2018-12-12  0:00 ` Maciej W. Rozycki
2018-12-12  9:12 Steven Newbury
2018-12-12 10:48 ` Thorsten Glaser
2018-12-12 13:27   ` Steven Newbury
2018-12-12 14:01 ` Rich Felker
2018-12-12 14:46   ` Steven Newbury
2018-12-12 16:05     ` Rich Felker
2018-12-13 16:17 tedheadster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).