From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAA6FE7719A for ; Sat, 11 Jan 2025 10:37:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BDDE6B0083; Sat, 11 Jan 2025 05:37:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36E506B0085; Sat, 11 Jan 2025 05:37:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 234BC6B0088; Sat, 11 Jan 2025 05:37:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 06E9B6B0083 for ; Sat, 11 Jan 2025 05:37:24 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5DFAB44814 for ; Sat, 11 Jan 2025 10:37:23 +0000 (UTC) X-FDA: 82994819166.12.97C3A33 Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by imf27.hostedemail.com (Postfix) with ESMTP id 207004000C for ; Sat, 11 Jan 2025 10:37:20 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=fu-berlin.de header.s=fub01 header.b=YKpb07l+; spf=pass (imf27.hostedemail.com: domain of glaubitz@zedat.fu-berlin.de designates 130.133.4.66 as permitted sender) smtp.mailfrom=glaubitz@zedat.fu-berlin.de; dmarc=pass (policy=none) header.from=fu-berlin.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736591841; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s+65UPhjiNYX126VZsqD9OJK1GZ2ijFtoFRRiqh52Rg=; b=xRPxQ6s5Bm0u1ooQRGOZELqOpw2NM49g8C14jBbtDo3ei4NRs1zey0YEpKr/5YXiAL4JNn NMKoVDaaHRuCDNYy2yBLoh3t/WsDNFnhuCRj6/6pVSHXSUOnHue1E96luAcKtUubPybraQ Ke6iJMiaxdqXe5ZPe/egAxh/mv/LcfM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736591841; a=rsa-sha256; cv=none; b=C1A0jlht6FHa4aVjg2rDw4Mq6wTju+Fdv35wbhrRkduVBbXZ3UTgWR3HtsTVMx8IwWoojF VIYMnBZV19g2qHiJRiRh0PaURjCPYq74baNoqRnyCyeAtr6rZ/MYc/b2hp2k5TP2OzeSOX pYE28MGVurwZtRuRtZWW99NuTSEjfEk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=fu-berlin.de header.s=fub01 header.b=YKpb07l+; spf=pass (imf27.hostedemail.com: domain of glaubitz@zedat.fu-berlin.de designates 130.133.4.66 as permitted sender) smtp.mailfrom=glaubitz@zedat.fu-berlin.de; dmarc=pass (policy=none) header.from=fu-berlin.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fu-berlin.de; s=fub01; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s+65UPhjiNYX126VZsqD9OJK1GZ2ijFtoFRRiqh52Rg=; t=1736591841; x=1737196641; b=YKpb07l+tskdFvYkZN2H/TRvzs1w7Sdoo7/OM2Yh2abo+A0ApbBZ6WuysYhdq6ZoGEkkqETO7L6 CVchQAJ7UndYHN3jnEFzDxXffYQ2zabLaqDJ0PV9jvSlF+2UlF1ScVdogQ8s+wWzXBJYs0RuPrq0i jHs+oSBDtlbtz0/Q0Tav4N1Vc8Ohov5ZrZYT4Vwap0HlBdrXHus9zCiDL+7t119iy9czcceWUOjDh LSkzwoS1uxcgbUqxn1MnHso17KnT1E6DcP1YhGVtGNQNYJShQJVsSIrUOBkditQN0NKcGDlnPplwY ruUImPp6WAQXLeRdAgQb/vRiap1tMg75AJXQ==; Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.98) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1tWYrh-00000000tpC-1n5X; Sat, 11 Jan 2025 11:37:13 +0100 Received: from p57bd9274.dip0.t-ipconnect.de ([87.189.146.116] helo=[192.168.178.61]) by inpost2.zedat.fu-berlin.de (Exim 4.98) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1tWYrh-00000002S89-0gIa; Sat, 11 Jan 2025 11:37:13 +0100 Message-ID: <2758fa70d237ff972b0c8d7114777dc4a20c8f3b.camel@physik.fu-berlin.de> Subject: Re: [PATCH] alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support From: John Paul Adrian Glaubitz To: "Eric W. Biederman" Cc: Arnd Bergmann , Richard Henderson , Matt Turner , Kees Cook , "Paul E. McKenney" , linux-alpha@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michael Cree , Sam James , "Maciej W. Rozycki" , Geert Uytterhoeven , Michael Karcher , Chris Hofstaedtler , util-linux@vger.kernel.org, linux-mips@vger.kernel.org, loongarch@lists.linux.dev Date: Sat, 11 Jan 2025 11:37:12 +0100 In-Reply-To: <87jzb2tdb7.fsf_-_@email.froward.int.ebiederm.org> References: <20250103140148.370368-1-glaubitz@physik.fu-berlin.de> <24f03227-1b55-4e50-b6e9-7ac74fda2602@app.fastmail.com> <678ee681-12c3-4e79-a04b-495daf343846@app.fastmail.com> <82d33a2d-dffe-4268-a175-4536b3f9c07f@app.fastmail.com> <87jzb2tdb7.fsf_-_@email.froward.int.ebiederm.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.2 MIME-Version: 1.0 X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 87.189.146.116 X-ZEDAT-Hint: PO X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 207004000C X-Stat-Signature: gczcs3ifuu1rs5fr75g4mg8pukfnqb5c X-Rspam-User: X-HE-Tag: 1736591840-705933 X-HE-Meta: U2FsdGVkX18K6VgZ18QhIQI1YPJjlt1BiGBz9C5z6NPbjmoxF1iomXinD4Tc3Dv0+8wWFzQitirUMbycIZp0Bw3l0R6hKCbBxass4Qo6c3vyk32U3y3ZfynE+4L9uMyUgdAJe7yEH0u5722FdQVxrnmXsmJ4Rle51xFRFLLqSQYc7rlnoBQy3tH/t+L1nZmbz5dGnIFPrvuTluoBOTkLKJTh7zzF7O0aaV1HA3EmJ6kgCVAOGfMWehGMjXeTEJoKCteXEJKZ0Al4U0kIItC6maN8dRI60vpiuG//xrBmeOBbCb9OVJQ9SQRFa7dZzGhOqn2j5+eQEAOvy0vDJW2MgQOD5qwLCGA/fue5OBXnwBj8PjTgTd5q6f3mi7pRxqIXBK3IhGMMlFJEJ6lAH/dsFwSUNSVEAPoogEmqZ/fnuYW+faccmHJ2xOJAMIMv3wfHprhgx6tuHIeG8fI/ICVKZcRpfjwMN3zNFgzWDQkiLsE7iIkr301fXkNpJXlXaE1WCv2ZUFlLKEgZDvJ6SdQ683EGLVANcYfbSAQiur9yT7mQZIeSXiy9MrjwQpmc8qh+el9mQzGuepTYFB/xii2ZwXS0XG/YFBCvFmXM5c4jUuiSritCodfREC0DtfMCFcoIEeStH+hg5p5TMOJtOwUacmz/6dcA5P46WS8ofQXhyR53XdErHBpbvPDB5yHcJP+3voatcQ7GYlUylFKZLHu1CVhNiSv65CciwFZ6o3p+PIT2iTFW+ppq9GwyvgImqmfpeQvW4T+wOzlbIO5cphl7V945zZpYKDgiunzuSkW0Zl/siwx9NIIuNdS48+KF/6+OEycwR6IbLh8/MfhhuWBCer3jC6l6h/R3zny+tlzE1WuSsTrnt4b7eNsCmrlr2MfFD0+R8ZAyvX5LR/zWGhJoTEhzTw11tB90CDQc8OBwOgtze7adIyZpFnhyWs9mY6/oyZxO97FNOYlWLNRCsYa LekVNbqk +BAegBrcI7MgtbLiee/S5iFkEAsvtzgU9ljfdENCPEiHKNAlW/6xYh07QdaBaKQ7+cbkjsWNrLTPeDl+sbyRdV2HeLKLd+RoT2g1V2hRj34Y0MIZJiZRQG+jiuJwrqExJiqwXTkHVm8tQjTJVD6dN/dLQYeqA3YWwm3nP1q8BgnrQP+YDCFfSkKNqCyHJq1AvRxEDdUE1RZdMTRtwQTq/YrmQlmJpm6O2kumRS3ipwLuWwNCuSC2K2y1MQhBcayBLudInG4/UGbJ+XJ0fHYureX1JVD7bCREKKQHiGcRnIMI8UCem7wNSUuZyWnR0u6gl0PFheLenb4xhznH8REvOqvTx57Pd91yFK5qUf7pnhvRbukFIJumDXHVlye4K24UOs+8qac9Q8SKR2u9myfmBnLZR/0dtV8YfgV66fMPz5oLfq5OUEBf7siT8R5EBhuMr4YUtwDmbv4KtdpLiHA2oxl/LGKzRnDVajmE5whRcYnS1WkKQajSFDB9rZKH6z0fg9M+4XIcmsl8zyQzVUdo9AXOzX0fhMgFnTix9LaugU6htRo4JaJmMS3rjZLErkfkFxi8oOkFb25yyLz3K9OIB8vhqStvpMhVSi2BMMwDeZeaRciDkZNfv13OyVQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Eric, On Fri, 2025-01-10 at 18:16 -0600, Eric W. Biederman wrote: > Richard Henderson writes[1]: >=20 > > There was a Spec benchmark (I forget which) which was memory bound and = ran > > twice as fast with 32-bit pointers. > >=20 > > I copied the idea from DEC to the ELF abi, but never did all the other = work > > to allow the toolchain to take advantage. > >=20 > > Amusingly, a later Spec changed the benchmark data sets to not fit into= a > > 32-bit address space, specifically because of this. > >=20 > > I expect one could delete the ELF bit and personality and no one would > > notice. Not even the 10 remaining Alpha users. >=20 > In [2] it was pointed out that parts of setarch weren't working > properly on alpha because it has it's own SET_PERSONALITY > implementation. In the discussion that followed Richard Henderson > pointed out that the 32bit pointer support for alpha was never > completed. >=20 > Fix this by removing alpha's 32bit pointer support. >=20 > As a bit of paranoia refuse to execute any alpha binaries that hafe ^^^^ hafe-= >have > the EF_ALPHA_32BIT flag set. Just to fail explicitly in case someone > somewhere has binaries that trying to use alpha's 32bit pointer ^^^ are > support. >=20 > [1] https://lkml.kernel.org/r/CAFXwXrkgu=3D4Qn-v1PjnOR4SG0oUb9LSa0g6QXpBq= 4ttm52pJOQ@mail.gmail.com > [2] https://lkml.kernel.org/r/20250103140148.370368-1-glaubitz@physik.fu-= berlin.de > Signed-off-by: "Eric W. Biederman" > --- > arch/alpha/include/asm/elf.h | 6 +----- > arch/alpha/include/asm/pgtable.h | 2 +- > arch/alpha/include/asm/processor.h | 8 ++------ > arch/alpha/kernel/osf_sys.c | 11 ++--------- > 4 files changed, 6 insertions(+), 21 deletions(-) >=20 > diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h > index 4d7c46f50382..50c82187e60e 100644 > --- a/arch/alpha/include/asm/elf.h > +++ b/arch/alpha/include/asm/elf.h > @@ -74,7 +74,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; > /* > * This is used to ensure we don't load something for the wrong architec= ture. > */ > -#define elf_check_arch(x) ((x)->e_machine =3D=3D EM_ALPHA) > +#define elf_check_arch(x) (((x)->e_machine =3D=3D EM_ALPHA) && !((x)->e_= flags & EF_ALPHA_32BIT)) > =20 > /* > * These are used to set parameters in the core dumps. > @@ -137,10 +137,6 @@ extern int dump_elf_task(elf_greg_t *dest, struct ta= sk_struct *task); > : amask (AMASK_CIX) ? "ev6" : "ev67"); \ > }) > =20 > -#define SET_PERSONALITY(EX) \ > - set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ > - ? PER_LINUX_32BIT : PER_LINUX) > - > extern int alpha_l1i_cacheshape; > extern int alpha_l1d_cacheshape; > extern int alpha_l2_cacheshape; > diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pg= table.h > index 635f0a5f5bbd..02e8817a8921 100644 > --- a/arch/alpha/include/asm/pgtable.h > +++ b/arch/alpha/include/asm/pgtable.h > @@ -360,7 +360,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte= ) > =20 > extern void paging_init(void); > =20 > -/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT. */ > +/* We have our own get_unmapped_area */ > #define HAVE_ARCH_UNMAPPED_AREA > =20 > #endif /* _ALPHA_PGTABLE_H */ > diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/= processor.h > index 55bb1c09fd39..5dce5518a211 100644 > --- a/arch/alpha/include/asm/processor.h > +++ b/arch/alpha/include/asm/processor.h > @@ -8,23 +8,19 @@ > #ifndef __ASM_ALPHA_PROCESSOR_H > #define __ASM_ALPHA_PROCESSOR_H > =20 > -#include /* for ADDR_LIMIT_32BIT */ > - > /* > * We have a 42-bit user address space: 4TB user VM... > */ > #define TASK_SIZE (0x40000000000UL) > =20 > -#define STACK_TOP \ > - (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000U= L) > +#define STACK_TOP (0x00120000000UL) > =20 > #define STACK_TOP_MAX 0x00120000000UL > =20 > /* This decides where the kernel will search for a free chunk of vm > * space during mmap's. > */ > -#define TASK_UNMAPPED_BASE \ > - ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / = 2) > +#define TASK_UNMAPPED_BASE (TASK_SIZE / 2) > =20 > /* This is dead. Everything has been moved to thread_info. */ > struct thread_struct { }; > diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c > index 86185021f75a..a08e8edef1a4 100644 > --- a/arch/alpha/kernel/osf_sys.c > +++ b/arch/alpha/kernel/osf_sys.c > @@ -1210,8 +1210,7 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user= *, txc_p) > return ret; > } > =20 > -/* Get an address range which is currently unmapped. Similar to the > - generic version except that we know how to honor ADDR_LIMIT_32BIT. *= / > +/* Get an address range which is currently unmapped. */ > =20 > static unsigned long > arch_get_unmapped_area_1(unsigned long addr, unsigned long len, > @@ -1230,13 +1229,7 @@ arch_get_unmapped_area(struct file *filp, unsigned= long addr, > unsigned long len, unsigned long pgoff, > unsigned long flags, vm_flags_t vm_flags) > { > - unsigned long limit; > - > - /* "32 bit" actually means 31 bit, since pointers sign extend. */ > - if (current->personality & ADDR_LIMIT_32BIT) > - limit =3D 0x80000000; > - else > - limit =3D TASK_SIZE; > + unsigned long limit =3D TASK_SIZE; > =20 > if (len > limit) > return -ENOMEM; Looks good to me besides the two spelling mistakes above in the comment. Reviewed-by: John Paul Adrian Glaubitz Will also test and report back shortly. Adrian --=20 .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913