From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A09137DAD7 for ; Mon, 1 Jun 2026 21:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780350300; cv=none; b=gS83VJ1At0mtFz0rwC/doncIpBqU3mbmgh2Fg24X2dYUB7oo51ewoyyLOZmitX8j6ZEq8Zha53dElBf3vlV/puSqqlOnvMM8T/nMhSSfkbNqoxOYX6WI0M481gOxaARJujD4JXw0YQIU7BPC/iZP/YSuZIhJP3yUh32b91IUA6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780350300; c=relaxed/simple; bh=06+ZTg2IMj+XQsqUcGWu4NUbSE9fbOBPtiriF8Tdufg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n/A39/qHcRepQ5KikvjHV6KcxN1aEk93VJUNfwfwXo4wvThAir3J4vZajSI6OIwP81XYmqpN30ODQrwseKGyfHLpgx2SUvrggTwWDx1KcP4KNa9EnO9AUlAGOMLr66Sh+XXSj++/InAzxGajbeeef/r6bpPmLqI9NO8C1j44W0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3+Z+YS0A; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HSSFazrc; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3+Z+YS0A"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HSSFazrc" Date: Mon, 1 Jun 2026 23:44:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780350297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y3HcDJ3eNd+pbWaea/Wz7MyYv5ryJAzzWd6P3TDkVqQ=; b=3+Z+YS0A8kPGgIWOuKWbOnto/V258dpTI5Z7a8Ci8b/M81VnXM5sRWVOx9uI+6o0ufCSwE xD8XiTTRLRbzzlzYFK1RYiuM0FG6D4lD8mNCZMYAEBbMQn+zLRhsRwDdfgVgAoQg5Ert1P 5NcD4QQD1C6cmmofImSf5gqhasDXuewMiYZXdWpj7YKqtPz2aFGjgXn8aRlAYOBUcsOTNy d+T6qb+qQJVGWQOzGqeIbUskZ0F0hOJNMpVgL+Jz2ielwLGHN0gsruPV1X9zVobqZgHH3q JWS1wRhdxyNbSMZnJuxUo9RsHLGQalAsr1DiocgbntqjZBv7cNhQ3qUaqsLmYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780350297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y3HcDJ3eNd+pbWaea/Wz7MyYv5ryJAzzWd6P3TDkVqQ=; b=HSSFazrcXbX8KXZb0epf1n/Chx0WWT2psBBUUTV2c3J2IDLI9ANSw9cwz/Ed+Tiwsmm2Ar es7e8QckWwejmWBA== From: Sebastian Andrzej Siewior To: Arnd Bergmann Cc: "H. Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov , Dave Hansen , Ingo Molnar , Jonathan Corbet , Thomas Gleixner Subject: Re: [PATCH] x86: Start removing X86_X32_ABI Message-ID: <20260601214456.NLyqoEer@linutronix.de> References: <20260523093734.A3AR7reJ@linutronix.de> <10BF3F18-4709-43D6-979C-49067707F1C1@zytor.com> <20260526104051.MmQQ03a8@linutronix.de> <5FC3AA08-47C8-46CE-9758-20ECDE6CE018@zytor.com> <20260526204306.0YTo1ClU@linutronix.de> <29bdbdc4-caef-4486-8816-84422c23bc20@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <29bdbdc4-caef-4486-8816-84422c23bc20@app.fastmail.com> On 2026-05-31 23:46:10 [+0200], Arnd Bergmann wrote: > On Tue, May 26, 2026, at 22:43, Sebastian Andrzej Siewior wrote: > > On 2026-05-26 08:54:56 [-0700], H. Peter Anvin wrote: > > > >> System call numbers or even mechanisms are in no wise tied to the ELF > >> type. An x86-64 binary can issue x86-64, x32 or i386 system calls, > >> even from 64-bit mode! > > > > But *why* have syscalls if nothing else works? It is not that you have a > > natural environment where these things work and in a later kernel they > > behave differently. It just not working. > > It's not about having the syscalls, it's whether we need to keep > them as 'reserved' indefinitely, the same way we don't reuse > any other number that ever did something. > > The problem is what happens when you run new userspace that calls > a syscall >512 on a kernel before v5.4 with x32 enabled, see commit > 6365b842aae4 ("x86/syscalls: Split the x32 syscalls into their own > table"). Okay, that is point. That would be something like new Debian distro but still the old kernel. > The normal rule is that any new syscall should return -ENOSYS on > old kernels to make it safe to detect from userspace whether it > is available or not. On linux-5.4 or newer kernels, that is what > happens. On older ones this would call one of the 35 x32 syscalls > that were available at the time. > > Skipping these numbers is clearly annoying, given that we now > synchronize them across all architectures, but it's probably > the right thing to do, at least if C libraries that want to > support future syscalls >511 also want to keep running on old > kernels. glibc still officially supports linux-3.2 (2.6.32 > on x86), and musl tries to support even older versions. I see. That is unfortunate then. But just to check one thing: From the referenced commit "ioctl() is nr 16 on x86_64 but 514 on x32". So the kernel knows if it is x-64 or x-32? But we can't reuse 514 on x-64 and return -1 on -x32 simply because the pre v5.4 kernel do the ioctl() instead of an error? > Arnd Sebastian