From patchwork Sun Sep 29 15:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Hx114WNM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpYK4Z33z1xt8 for ; Mon, 30 Sep 2024 01:49:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5EF60385E459 for ; Sun, 29 Sep 2024 15:49:39 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 13298385841E for ; Sun, 29 Sep 2024 15:49:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13298385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 13298385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727624963; cv=none; b=S2KaeaUFK3smOE60tN+30uMgv7WnerzItEoLLYlTMn2sfvai/uXZVOIkRYzKDidFhrB94L2/o4dP0PI/uZPClRFuBBkfESZYMchqBnNRzNRI/Ff4gpfckmXFrwZ6kZZrBWj2Zd0N8rX6potJ6Dw/MweFoSOiU6F+z+DXyDruyY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727624963; c=relaxed/simple; bh=VHXDOZ4XYKRZ5q8Hhbpn6Cw1Tx1jlzTVxA1GGGcS3KE=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=kBLLj4Xk0GuVJ9KwkZhqYA66naO87Py9iWaMuvfxlZEQHvy/xUTYIR88wNTCL6dRxQut4VEsMFEBhWdbxaa2MBcjLmo4lX3jgGxKbZoKVpSZgXkZpF3kbbEqJlwoI671Zd3JJN7dlWuh0As8jNW20u0hbd/i0dpJyviqRe3Nr1w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727624960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TuviB5990IC64NJL73O8DbEvVjz8BnnAqnqqdbepXRk=; b=Hx114WNMaotH1SfgAMUEuTo/ENMq4q5W/8rOlWoWgTnFuxe35TqoszUyXPwh+Ev5mmewtc 0De12hUPNFPsJy2Pw5NXyK7cAcJmtm5qJO6921XZxinrHIQiARk9ZrtXjDzqx8fFk0TPis BcuFoDmzT3IXK0g3aoYawMwqGdi5Od8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-EdH7L3ciN12zTHzh_03n0w-1; Sun, 29 Sep 2024 11:49:19 -0400 X-MC-Unique: EdH7L3ciN12zTHzh_03n0w-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 37E48190ECDA for ; Sun, 29 Sep 2024 15:49:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 292D91955DC7 for ; Sun, 29 Sep 2024 15:49:16 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 01/29] elf: Add tests to verify that l_contiguous reflects reality In-Reply-To: Message-ID: <656f54790acc248f827f7b6c2eb8c06ecaf79318.1727624528.git.fweimer@redhat.com> References: X-From-Line: 656f54790acc248f827f7b6c2eb8c06ecaf79318 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 17:49:14 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Test elf/tst-link-map-contiguous-ldso iterates over the loader image, reading every word to make sure memory is actually mapped. It only does that if the l_contiguous flag is set for the link map. The test elf/tst-link-map-contiguous-main does the same thing for the libc.so shared object. This only works if the kernel loaded the main program because the glibc dynamic loader may fill the gaps with PROT_NONE mappings in some cases, making it contiguous, but accesses to individual words may still fault. Test elf/tst-link-map-contiguous-libc is again slightly different because the dynamic loader always fills the gaps with PROT_NONE mappings, so a different form of probing has to be used. --- elf/Makefile | 6 ++++ elf/tst-link-map-contiguous-ldso.c | 43 ++++++++++++++++++++++ elf/tst-link-map-contiguous-libc.c | 57 ++++++++++++++++++++++++++++++ elf/tst-link-map-contiguous-main.c | 45 +++++++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 elf/tst-link-map-contiguous-ldso.c create mode 100644 elf/tst-link-map-contiguous-libc.c create mode 100644 elf/tst-link-map-contiguous-main.c diff --git a/elf/Makefile b/elf/Makefile index 09d77093a7..77e211b821 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -514,6 +514,8 @@ tests-internal += \ tst-dl_find_object \ tst-dl_find_object-threads \ tst-dlmopen2 \ + tst-link-map-contiguous-ldso \ + tst-link-map-contiguous-libc \ tst-ptrguard1 \ tst-stackguard1 \ tst-tls-surplus \ @@ -525,6 +527,10 @@ tests-internal += \ unload2 \ # tests-internal +ifeq ($(build-hardcoded-path-in-tests),yes) +tests-internal += tst-link-map-contiguous-main +endif + tests-container += \ tst-dlopen-self-container \ tst-dlopen-tlsmodid-container \ diff --git a/elf/tst-link-map-contiguous-ldso.c b/elf/tst-link-map-contiguous-ldso.c new file mode 100644 index 0000000000..ae66806365 --- /dev/null +++ b/elf/tst-link-map-contiguous-ldso.c @@ -0,0 +1,43 @@ +/* Check that the entire ld.so program image is readable if contiguous. + Copyright (C) 2014-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +static int +do_test (void) +{ + struct link_map *l = xdlopen (LD_SO, RTLD_NOW); + if (!l->l_contiguous) + FAIL_UNSUPPORTED ("ld.so link map is not contiguous"); + + volatile long int *p = (volatile long int *) l->l_map_start; + volatile long int *end = (volatile long int *) l->l_map_end; + while (p < end) + { + *p; + ++p; + } + + xdlclose (l); + + return 0; +} +#include diff --git a/elf/tst-link-map-contiguous-libc.c b/elf/tst-link-map-contiguous-libc.c new file mode 100644 index 0000000000..c5abae325b --- /dev/null +++ b/elf/tst-link-map-contiguous-libc.c @@ -0,0 +1,57 @@ +/* Check that the entire libc.so program image is readable if contiguous. + Copyright (C) 2014-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include +#include +#include + +static int +do_test (void) +{ + struct link_map *l = xdlopen (LIBC_SO, RTLD_NOW); + + /* The dynamic loader fills holes with PROT_NONE mappings. */ + if (!l->l_contiguous) + FAIL_EXIT1 ("libc.so link map is not contiguous"); + + /* Direct probing does not work because not everything is readable + due to PROT_NONE mappings. */ + int pagesize = getpagesize (); + ElfW(Addr) addr = l->l_map_start; + TEST_COMPARE (addr % pagesize, 0); + while (addr < l->l_map_end) + { + void *expected = (void *) addr; + void *ptr = xmmap (expected, 1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1); + if (ptr == expected) + FAIL ("hole in libc.so memory image after %lu bytes", + (unsigned long int) (addr - l->l_map_start)); + xmunmap (ptr, 1); + addr += pagesize; + } + + xdlclose (l); + + return 0; +} +#include diff --git a/elf/tst-link-map-contiguous-main.c b/elf/tst-link-map-contiguous-main.c new file mode 100644 index 0000000000..037c51e655 --- /dev/null +++ b/elf/tst-link-map-contiguous-main.c @@ -0,0 +1,45 @@ +/* Check that the entire main program image is readable if contiguous. + Copyright (C) 2014-2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +static int +do_test (void) +{ + struct link_map *l = xdlopen ("", RTLD_NOW); + if (!l->l_contiguous) + FAIL_UNSUPPORTED ("main link map is not contiguous"); + + /* This check only works if the kernel loaded the main program. The + dynamic loader replaces gaps with PROT_NONE mappings, resulting + in faults. */ + volatile long int *p = (volatile long int *) l->l_map_start; + volatile long int *end = (volatile long int *) l->l_map_end; + while (p < end) + { + *p; + ++p; + } + + xdlclose (l); + + return 0; +} +#include From patchwork Sun Sep 29 15:49:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990593 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=d2mF29VX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpYW5YX6z1xt9 for ; Mon, 30 Sep 2024 01:49:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9CDAC385E837 for ; Sun, 29 Sep 2024 15:49:49 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 41069385E457 for ; Sun, 29 Sep 2024 15:49:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41069385E457 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 41069385E457 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727624975; cv=none; b=XviwldI7eISatkDgzzzOwGpZp67XO+6rV47zDWvQKScXDF6kNLpVGN38XStTqxQEpJjTrgHG1ckly5KADM53k1QSVETGW7vf9Up/APGVyx5i4g9Jmmy1eB6nnA2Rt8IncdMlBeLkLs0bCGCFqxVFkHXlf93kAD6amjlMVx5haDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727624975; c=relaxed/simple; bh=StYLu0kxdmEt8/8blCW7u+BFAJNDmx2HBUFESbVVDig=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=YRoqRHzOhvXFEIXzH1AlgDnp9HvpiYaSZOoE2drY+qawROhP1OJ9VVVGjqBH1dDtpf0rMn0zx6zXJspx/r45b8j6wsxkoSJSJdT7cfbHZXY2V2a6IXb1whfNKiTib7ys9DQFJ2SrvEuEPRxevnsyFU49vjCRYO8c4FAWks5dIvo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727624973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EawNQQlgen9CLO3wG8e3di3JEfCg7VVm7TGAQAyEGds=; b=d2mF29VXccMPG8rY2m13Njcp/w5PfZwuLlLyKCxaP+5mT0qFzXt3I2PICo8Ckctm8fDSRG D5lfBH4bk+zRsJXaZQkAqWBffyURAajZGT5TPWmDEKIks7g7uggMF07dE64gDwEE71GXyo 9CmXBCqwCNt56qzCY/GIf59Q0LOfacA= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-678-Ba5V3TUxOUqojLxefvJNMg-1; Sun, 29 Sep 2024 11:49:31 -0400 X-MC-Unique: Ba5V3TUxOUqojLxefvJNMg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DE38A190599D for ; Sun, 29 Sep 2024 15:49:30 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC9571944B22 for ; Sun, 29 Sep 2024 15:49:29 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 02/29] Prepare for the addition of the header In-Reply-To: Message-ID: <2f833cc18d427bf1db6c2653f9ff43a69a5baa70.1727624528.git.fweimer@redhat.com> References: X-From-Line: 2f833cc18d427bf1db6c2653f9ff43a69a5baa70 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 17:49:26 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Add a stub version of . This header is similar to in that every port must define its own version. Add , which will become the installed version of this header. --- bits/pagesize.h | 10 ++++++++++ include/sys/pagesize.h | 1 + misc/sys/pagesize.h | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 bits/pagesize.h create mode 100644 include/sys/pagesize.h create mode 100644 misc/sys/pagesize.h diff --git a/bits/pagesize.h b/bits/pagesize.h new file mode 100644 index 0000000000..d83561d0c1 --- /dev/null +++ b/bits/pagesize.h @@ -0,0 +1,10 @@ +#error "This file must be written based on the possible page sizes" + +/* 1 << __GLIBC_PAGE_SHIFT_MIN is the minimum possible page size. + The least significant __GLIBC_PAGE_SHIFT_MIN bits of pointers + return by mmap are guaranteed to be cleared. */ +#define __GLIBC_PAGE_SHIFT_MIN + +/* 1 << __GLIBC_PAGE_SHIFT_MAX is the maximum possible page size. + On-disk file formats must not require smaller mapping offsets. */ +#define __GLIBC_PAGE_SHIFT_MAX diff --git a/include/sys/pagesize.h b/include/sys/pagesize.h new file mode 100644 index 0000000000..2533ee7e90 --- /dev/null +++ b/include/sys/pagesize.h @@ -0,0 +1 @@ +#include diff --git a/misc/sys/pagesize.h b/misc/sys/pagesize.h new file mode 100644 index 0000000000..b54b6e6396 --- /dev/null +++ b/misc/sys/pagesize.h @@ -0,0 +1,32 @@ +/* Information about supported page sizes. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_PAGESIZE_H +#define _SYS_PAGESIZE_H + +#include + +/* Minimum and maximum possible page sizes, in bytes. */ +#define PAGE_SIZE_MIN (1UL << __GLIBC_PAGE_SHIFT_MIN) +#define PAGE_SIZE_MAX (1UL << __GLIBC_PAGE_SHIFT_MAX) + +/* Base-2 logarithm of the size limits. */ +#define PAGE_SHIFT_MIN __GLIBC_PAGE_SHIFT_MIN +#define PAGE_SHIFT_MAX __GLIBC_PAGE_SHIFT_MAX + +#endif /* _SYS_PAGESIZE_H */ From patchwork Sun Sep 29 15:53:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ot20JGkM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpf470wYz1xt9 for ; Mon, 30 Sep 2024 01:53:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 93F35385DDC4 for ; Sun, 29 Sep 2024 15:53:46 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id ACAAB385841E for ; Sun, 29 Sep 2024 15:53:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACAAB385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ACAAB385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625213; cv=none; b=CUoaURW/xfitpMZ1d/ZZR1DP6aFqbvh4Qr/c54s/Xo7/Eb3+4i5SzpC/a9Jcy5NmBJcguu6KiW9r8X3ZYU2K0/+QlcdJBB0mO89FuYibdoGyaxtMlyHDRZ1ZWHA9SKfCZRH3gNKIK1aNGwhElirDaDyZmMliJqmy3b0/3v70/B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625213; c=relaxed/simple; bh=a7xZBvP3n33CG4nRuAxFV8kJiHzR9U3RgvtRuzjvG98=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=l0ibc8Xu5kRvr0ugEqVURVlDnLNC/UijXwWoQJh4+IKM4EWIOZK8Qtuo6dFstxzBqUZkVwHH7dmHkxzWZkUL5or0NuQp3XFcMhsU4y3BcUF6NSkuEw20HxoFDnTBMH9bkccVkEJsk4oIR+ccRIilyECwnLhtW8WE8Vfh0GCaUNg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727625211; 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=RqvqJe2FOWPDQwYG6Pymo5lmCbdLlG53+Z3k4654T6s=; b=Ot20JGkMQyQzvwv5OJbOHd3vx+pPJ8gdMppK53PZyH0QfCFyy425D6yMhCNjaD02p5xqdB vTLvYrAm3vozohjlyN0nVtWT9FWAVM8GgA245Dxhh9KFIrx2hE770xpNiDNmB/LsPJ6Esh zrRTEvbt3DMd6w/FntGyjqFiqAvWJoQ= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-X1tPF0itNj2ZrBcEFd8nIQ-1; Sun, 29 Sep 2024 11:53:30 -0400 X-MC-Unique: X1tPF0itNj2ZrBcEFd8nIQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1AE1A195395E; Sun, 29 Sep 2024 15:53:29 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74AB919373D7; Sun, 29 Sep 2024 15:53:27 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Adhemerval Zanella , Wilco Dijkstra Subject: [PATCH v3 03/29] aarch64: Add In-Reply-To: Message-ID: References: X-From-Line: e0e3a312df29f0ab692a502e4eb3e8833575ddaf Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 17:53:24 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to Program Loading and Dynamic Linking in , the maximum supported page size by the ABI is 64 KiB, so the maximum page shift is 16 bits. --- sysdeps/aarch64/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/aarch64/bits/pagesize.h diff --git a/sysdeps/aarch64/bits/pagesize.h b/sysdeps/aarch64/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/aarch64/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 15:56:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ap69W2bH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpjn3D6dz1xtM for ; Mon, 30 Sep 2024 01:57:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A879385E003 for ; Sun, 29 Sep 2024 15:56:59 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 68B45385841E for ; Sun, 29 Sep 2024 15:56:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68B45385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 68B45385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625405; cv=none; b=VsOSlLXRIUmGGJxXG4NTS6ClOTSVr9t+bX3A0W8eTPQjSoXv+SoF9NF399F6hnBFT3RUGhJFQ3YTc/p2YSnGGPDVCVM4C+Gzc9nZeUeCkDmXWu+GQdGZJ9EuVYTPLxFtLbaI6TTL9IUn6YVLP+t+8X+IqMAyxtCI7CMo6WVQ+1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625405; c=relaxed/simple; bh=WVwrky3djyKLONBPRgxfYfldRBRkAPWfOkSvGFxvnI4=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=QC2Ni17kajSz2+DpjN71xX8a+QAs+wXbiAJqAmy6qITXo4cddTq6M3o3Kwi8Cxy+k/UQSgJmx0Vvo/7KnynmHaxQyegmRNbkOx3KuuB7g2sBkbJa9fsSPyAf16yNWdaXlFm1cbVZdvzknIXIgV5I177uqKA88DPgmtVLVJWkhuM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727625404; 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=0D/j+10jXvfrBE4zTFyha45RMobI8A6tWeCKxdwFWbA=; b=ap69W2bH08NM8z8EZluSb4/zgluU1EvW6QOhmc2gG+C4JpHCy5xr/nybeXwVD2hjWpX8cI IbcaWbw1EW5vYAFCW+NLgR+u0IjVKf1ZhpQ1+Xbka6BPUw1b4FxFyWp8Vfz9qXuu4CIQ3Q fZweqc83WOBVZrUw4j9iDxBcEpEavfc= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-zZu7GKaEO_q760tIauVgHg-1; Sun, 29 Sep 2024 11:56:40 -0400 X-MC-Unique: zZu7GKaEO_q760tIauVgHg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC288195FE22; Sun, 29 Sep 2024 15:56:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B1A8A1955DC7; Sun, 29 Sep 2024 15:56:38 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Richard Henderson Subject: [PATCH v3 04/29] alpha: Add In-Reply-To: Message-ID: <4b9385fbcd4b2a93c27f8fb5b5d7e4bca120b190.1727624528.git.fweimer@redhat.com> References: X-From-Line: 4b9385fbcd4b2a93c27f8fb5b5d7e4bca120b190 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 17:56:35 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/alpha/Kconfig, alpha always has a page size of 8 KiB (only HAVE_PAGE_SIZE_8KB is used). However, the toolchain defaults support a maximum page size of 64 KiB, so adjust the maximum accordingly. (Note: We could XFAIL the gaps test added later and fix the page size at 8 KiB, despite what binutils does today.) --- sysdeps/alpha/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/alpha/bits/pagesize.h diff --git a/sysdeps/alpha/bits/pagesize.h b/sysdeps/alpha/bits/pagesize.h new file mode 100644 index 0000000000..81824b5ab6 --- /dev/null +++ b/sysdeps/alpha/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 13 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 15:59:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gEMpserV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpmk3K8Yz1xtM for ; Mon, 30 Sep 2024 01:59:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0911E385E83F for ; Sun, 29 Sep 2024 15:59:32 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 1EB79385841E for ; Sun, 29 Sep 2024 15:59:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1EB79385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1EB79385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625559; cv=none; b=HOxKmMVjPbx0hWjTH/u/tWX8VTbxDB4jTgRdizUs+VfG2Xl/TK2dUGGWRyNXiwJrVJVLdMFHPOt+IpDr6yzH383bQbfqDZ0zTnQ/ATNUKKmQ6tjHIMGqsE6cY7LUzf4iKuKdq/163jjjGipEa6jyKW8X7HNEnJJMvkIHrNW3S0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625559; c=relaxed/simple; bh=Z/2gEf+g4r3sBuMLVr3bb7h0Yc9NUSCS7p0sHYeFafg=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=r0QCUWDW4IOlEbG/De0UbSezGfoJCLOGH3M7YBYoHFIJGJS/lVY/J8KV93mgNwwuwZiIZeOdFW9K0ZeiNN54ouLDep1BRNCfONINauz453+LE1KBN5/GKAI4oCZGBwS3w7bSwOtJJsAGNZZP+nf9bSRGagLYH1QZR33yqS2nfHE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727625556; 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=+ID1Y0YWtU/Dxe+MwRDsY34pLfJkx2ww3OIyD4/ful4=; b=gEMpserVw/nC53vJrrpdTf1Oj438JFUcAfOOu2xZ9O20fcGR8mwYLyS+J8uUFKNUDteURF UebrveoJ7cAArQIPN5FzyD/KF1zTsrnRvf901cBRKN3ZVuG8NaSwGwKkoWxuJi2BawnS3M Hk1qXAm6edXwxdPtvDbqmXAzAuoTEzw= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-251-F3uo74wLMtyay-9ZP7Zqhg-1; Sun, 29 Sep 2024 11:59:15 -0400 X-MC-Unique: F3uo74wLMtyay-9ZP7Zqhg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E522195FE1E; Sun, 29 Sep 2024 15:59:14 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4394C3003E40; Sun, 29 Sep 2024 15:59:11 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Pavel Kozlov , Vineet Gupta , Alexey Brodkin , Luis Manuel Silva Subject: [PATCH v3 05/29] arc: Add In-Reply-To: Message-ID: References: X-From-Line: cf5e65ba1eb9652008a9ca21a5502bf7907af6c3 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 17:59:09 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/arc/Kconfig in the Linux kernel sources, arc supports pagge sizes 4 KiB, 8 KiB, 16 KiB. However, the toolchain defaults are not compatible with 16 KiB pages, so xfail the future elf/tst-load-alignment test. (Note: Alternatively, we could fix the maximum page size at 8 KiB, if that's closer to reality.) --- sysdeps/arc/bits/pagesize.h | 2 ++ sysdeps/unix/sysv/linux/arc/Makefile | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 sysdeps/arc/bits/pagesize.h diff --git a/sysdeps/arc/bits/pagesize.h b/sysdeps/arc/bits/pagesize.h new file mode 100644 index 0000000000..16a4d49136 --- /dev/null +++ b/sysdeps/arc/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 14 diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile index dd3da52c39..cfade7a347 100644 --- a/sysdeps/unix/sysv/linux/arc/Makefile +++ b/sysdeps/unix/sysv/linux/arc/Makefile @@ -1,3 +1,8 @@ +ifeq ($(subdir),elf) +# The toolchain defaults to 8K pages even though Linux supports 16K pages. +test-xfail-tst-load-alignment = yes +endif + ifeq ($(subdir),stdlib) gen-as-const-headers += ucontext_i.sym endif From patchwork Sun Sep 29 16:00:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990597 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XqOHBx5d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGppK202jz1xt8 for ; Mon, 30 Sep 2024 02:00:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F103385E44D for ; Sun, 29 Sep 2024 16:00:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 8811C385841E for ; Sun, 29 Sep 2024 16:00:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8811C385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8811C385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625642; cv=none; b=W8CmisIsyhQNP9pHCECBzoZc8zMF9doyjUgIit0KZrqkBVDC2wrqtwkXX059WsfsS4IPbFPPZz+eWhatSADHm9Ao9cSoprjVzRbuDdt6aC8AW0KctY+G4KaVAi7h5qlDvvYl6MTac6mkO1ltHZWE3D1Fog9C/6WDBKPmxSZD/mM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625642; c=relaxed/simple; bh=beVYNgPXCvq1UEOazQW9QW44A/QKe7l5Pjf4fn/xYws=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=Eo/PfDYnMVXy6MhgGi3rwQzzEVlM+aUQ88CijALBGyR7fC8ehgoCWkJiiRayTOv1uU9M5M/ev3fIn+UptWq9cOkVz/c8KeZEoIhQaJ/M520VZ6i402sT0VAm9VxirrBCW2lu9k4i/dBGbzVWXS7OkmCtx6c8SmA9d9PW1xmJSl8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727625640; 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=3ZK6TQsPlXy0Db79R6mwshtT4ZlfutCam+32L3LBuZE=; b=XqOHBx5d/RgBGdCvFYB/so1ddYb/MSCe5vd0p/TPxVDCkvCyPo7VWTYduo2/UiYgwFzvvC 4jmTfA7mgyZgxJ93TL6yYb6Ty91Kk//AtnhsLsJN8mwPU1Q98nkzjb2phpFBm586IMj/f2 Y0+do8KOnUT8Do1hS90F8bzCgvOiMsk= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-eRS_JxH6Mxe4VHkImrBjUg-1; Sun, 29 Sep 2024 12:00:37 -0400 X-MC-Unique: eRS_JxH6Mxe4VHkImrBjUg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4F1CD195395E; Sun, 29 Sep 2024 16:00:36 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C4C751944B22; Sun, 29 Sep 2024 16:00:34 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Adhemerval Zanella , Wilco Dijkstra Subject: [PATCH v3 06/29] arm: Add In-Reply-To: Message-ID: References: X-From-Line: e297f66c0046821adf1598b6694d3ee87893e2b5 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:00:31 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org While Linux only use HAVE_PAGE_SIZE_4KB in arch/arm/Kconfig, 32-bit Arm binaries can run on AArch64 kernels in compat mode, so they can observe the full range of page sizes that are possible on AArch64. The toolchain defaults do not reflect this, so xfail the future elf/tst-load-alignment test. Note: Alternatively, we could fix the page size at 4 KiB and tell people to use a 4 KiB kernel if running on AArch64. Maybe that's the right approach here? --- sysdeps/arm/bits/pagesize.h | 2 ++ sysdeps/unix/sysv/linux/arm/Makefile | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 sysdeps/arm/bits/pagesize.h diff --git a/sysdeps/arm/bits/pagesize.h b/sysdeps/arm/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/arm/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile index a73c897f43..5f9e03978d 100644 --- a/sysdeps/unix/sysv/linux/arm/Makefile +++ b/sysdeps/unix/sysv/linux/arm/Makefile @@ -1,5 +1,8 @@ ifeq ($(subdir),elf) sysdep-rtld-routines += aeabi_read_tp libc-do-syscall +# The toolchain defaults to 4K pages even though compat mode on 64-bit +# kernels may require larger page sizes. +test-xfail-tst-load-alignment = yes endif ifeq ($(subdir),misc) From patchwork Sun Sep 29 16:01:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i5d31c+G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGpqZ1PVxz1xt8 for ; Mon, 30 Sep 2024 02:02:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F769385E837 for ; Sun, 29 Sep 2024 16:02:00 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 00FAD385841E for ; Sun, 29 Sep 2024 16:01:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00FAD385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 00FAD385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625708; cv=none; b=gbSCKzjG+nJ/MAh3ezb73MFdwPPduFql5KNx1+0HeGXfNfcLDVwYIAak4xPF967VG5dVBJJDJuFwLKgrkydx/nddLERqg3jKx5ly4oxHQxEEfiQBHgMVMVg862GWa4+fqwWY1jpXhLLk9aXpNJ7pmawbMxZtrBI0bSPr5nE+1pw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727625708; c=relaxed/simple; bh=exVzeq0QOmQ968VZOQd+ZD8KbdvJJ5iJ1HJSaxGYk1M=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=tP7MBtq2uipRj5YiTugsILsLFnittWO7n8HI+VtrGJNdO3bKNG39rewgGl8cgxcsr1ZZjmnx4K+zhh7xPvZoMedoPsXgTXITaIDCTx6UMZl+HSY0KLNwkgaaQfKfAUnnLRz1/EMhxDRZ8Ko7fJ0ctsO2brUgIwQAhoB0X1qrsrU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727625706; 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=ZbX3w7PugYlOBqgOLrgaNGkPKEu4oqjRro2DgUrwfIQ=; b=i5d31c+GxpFixn2cDtxcB+hJkRy6MyTx1WspV5ACAkwh/xjpqQ1A7++/SFtf5/ZfoldISm yeQdNSY9CvHjM/5SQv4ix/d0DLwH9FimY6wkHc0bdDENi31OjLWbSgrDLqeuPiRQu2Fjxy bHCo6bBAIc9K1m24h6j6+w92RyVZc90= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-b0yoTmEJPlWoptSaVrQVNw-1; Sun, 29 Sep 2024 12:01:43 -0400 X-MC-Unique: b0yoTmEJPlWoptSaVrQVNw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 89F22190599D; Sun, 29 Sep 2024 16:01:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 60E891955DC7; Sun, 29 Sep 2024 16:01:41 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Mao Han Subject: [PATCH v3 07/29] csky: Add In-Reply-To: Message-ID: <8b3fc39051421e70680c30b8263f445f03c3a18b.1727624528.git.fweimer@redhat.com> References: X-From-Line: 8b3fc39051421e70680c30b8263f445f03c3a18b Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:01:38 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Linux only supports 4 KiB pages per arch/csky/Kconfig in the kernel sources: only HAVE_PAGE_SIZE_4KB is ever selected. --- sysdeps/csky/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/csky/bits/pagesize.h diff --git a/sysdeps/csky/bits/pagesize.h b/sysdeps/csky/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/csky/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:10:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KQtGM+y6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGq1d256Dz1xtM for ; Mon, 30 Sep 2024 02:10:45 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21A82385E837 for ; Sun, 29 Sep 2024 16:10:43 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4B8FD385E458 for ; Sun, 29 Sep 2024 16:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B8FD385E458 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4B8FD385E458 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626225; cv=none; b=YdFeW6Z9705pPXOA6rO7Hb/rYG9yqco6Vo9RA53PZiIS7Q37+IUKsb+NtpxHjJ7pvn5b9TDd6pZQqDkI/eJsaeVSVmp8SONlWvqC7H85UpyxMMlEsKQYYZiweF0vFxsXny/J0r3FNE37h8dISQFwIsCjEvj6Ohq8HINOr4Fv6fg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626225; c=relaxed/simple; bh=SvBs0T0ItxRiPDSNBSDX/4gmI3TeVPvxjDooTslYae4=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=UgSLV/T/uz7pg+QMo7OkWqlJKehMwpOUjvXTpLLbI20mW4dzS5WouiMz+rGfAWsTqi7YlLfeNrtisPuxiwvkI94Ycm08jCAFqUke2Y4Gz8Ylvq2T/POA1n/m3cO4kgjID4HE2ZGEZs/ZnJu2zamb6Zpn/rojBd5YMoNGCdd+oFM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626216; 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=gC+ZdnegkVSBqZb/pvz2WIjp0IiyfWj3ks6lVTnU1SM=; b=KQtGM+y6WMoAfvlXsoIW7XKFEQzBGX90283DKFqyFdTRxjMJdSJO5mJrrAxBHDo8UX1XfU A6scX5uqL2d+LWVwRxP4s0RqrDudkLIWg9GXZ1HW82STpZd+RpbUjbL2yJmYAPluAhQd75 XGjYi1DGXBIT3mMkKDIbjeuUsysS7o0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-jkvclmmcMDONA-gBQ1BJNw-1; Sun, 29 Sep 2024 12:10:14 -0400 X-MC-Unique: jkvclmmcMDONA-gBQ1BJNw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B83371944D46; Sun, 29 Sep 2024 16:10:13 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8F131955DC7; Sun, 29 Sep 2024 16:10:11 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Carlos O'Donell , Helge Deller , John David Anglin Subject: [PATCH v3 08/29] hppa: Add In-Reply-To: Message-ID: <5775def9240283ebb7cbe2f65e137dbbb69a66d6.1727624528.git.fweimer@redhat.com> References: X-From-Line: 5775def9240283ebb7cbe2f65e137dbbb69a66d6 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:10:08 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to the Linux sources (in arch/parisc/Kconfig), a variety of page sizes from 4 KiB to 64 KiB are supported on PA-RISC (although everything but 4 KiB is labeled as broken). --- sysdeps/hppa/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/hppa/bits/pagesize.h diff --git a/sysdeps/hppa/bits/pagesize.h b/sysdeps/hppa/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/hppa/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 16:12:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Bmq9Sswp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGq3t4218z1xtM for ; Mon, 30 Sep 2024 02:12:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 44ABB385DDFE for ; Sun, 29 Sep 2024 16:12:40 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 2ECA7385841E for ; Sun, 29 Sep 2024 16:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2ECA7385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2ECA7385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626345; cv=none; b=w1M9vsqoWsWNKoOHlAvKhHL0d0O1/zcN/NaOB8H7VhGO8Dj8ep4YFiIAe5DkTHSOH2mBcnOqRrTS0kNZPyR2fQdLNBR5fJfZ8ZgstKWdC3HXr+54Fg4ZMUZd8d82DKP0UFWxgu7Sa5k7R3y3xX582hbKgDQGUWnnj18NAjEgq24= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626345; c=relaxed/simple; bh=dmXVWdc8SFasuu+SggmRuW1+Xi55ytfMA1AqcD6dh1c=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=MSKHXTn0USxmPQdApEgz094Mfr4wbv/5Ur0hGptCtmfASK6QQd/Krmm+1Z3D+eFHhdFeW5eOFHUR//2Awrx7MbF8UaiZCxT1RDB6NhaqzFMueTMYk0Rx7f1bhd8JmCoKpta9unCoyPWNF0wZ6uBzcHjqUSjLlwjpD/9f0zBffWQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626343; 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=i0cvDJmSytLc2iYZPEMWEmlfpgeU2Bo7T+RtIn8jqo0=; b=Bmq9Sswp/h9fAnWhwAQux+ywEI/EUvTBoex6thes1ckH9FSj1nmjJfP1rY3vEF2I8lAl+a XqlsYj2TLFQpziwC3+B4k9URYl0FiigBMe1ROLbWgrfPSoV52b+36pvbGu1d2IswwSw8ta uHsazg441MfkrQdyXSc9KYAVR+pcRy4= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-IW1B9_nEPfqKHlrZcbnoNQ-1; Sun, 29 Sep 2024 12:12:20 -0400 X-MC-Unique: IW1B9_nEPfqKHlrZcbnoNQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C3CC91953955; Sun, 29 Sep 2024 16:12:19 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 390933003E4D; Sun, 29 Sep 2024 16:12:17 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: caiyinyu , mengqinggang Subject: [PATCH v3 09/29] loongarch: Add In-Reply-To: Message-ID: References: X-From-Line: bac0d3dd136a994bdf014dd1243e86a9095cce1c Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:12:14 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/loongarch/Kconfig in the kernel sources, LoongArch supports 4 KiB, 16 KiB, and 64 KiB page sizes. Note: The entire series runs into a GCC compilation problem on LoongArch, which appears to be a GCC bug: Section type conflict on loongarch with .data.rel.ro section attribute https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116887 --- sysdeps/loongarch/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/loongarch/bits/pagesize.h diff --git a/sysdeps/loongarch/bits/pagesize.h b/sysdeps/loongarch/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/loongarch/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 16:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DVrLaQN9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGq9g4QPhz1xt8 for ; Mon, 30 Sep 2024 02:17:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 85594385EC1E for ; Sun, 29 Sep 2024 16:17:41 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 79729385E83D for ; Sun, 29 Sep 2024 16:17:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79729385E83D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 79729385E83D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626646; cv=none; b=Gs6U/uNpawYJK7kobU0aY0VL2P3JOpGvkkiCwKiqJooK8+lheKe/w+pWwaZMw5QTI0+MWF+rwA2CrK5rqlqbvOi1HwudiLtnZdnf1VYCMIB5/RTjiGwCmRMANPUq5J0rf9WE+0ngbOXFwfeK0GeNKMAlko8P6pxqaS1zAzoJNb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626646; c=relaxed/simple; bh=M0OmNrb/9vFsBKrUNRTOKn1RyRYqdpEee2GBlnKOtUU=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=IvkMYubezj6KJ2FzTRUl5Kly6mBnwEpkoVJxuYGdUMcX+oFOouCylEidQLYEKjA7Iplhyf/7838VhCRo2qYsRcMuVz8X6oiLNK5t3tRY+CEfE85jni09R/Y3SN3mHlMXt5jj1LmJ7IVJWJx2VXAG2bNylZLfgfK3GahII3GWxBY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626644; 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=xjENWH8OiirUl68026cMGi45vkhQrqRCKPfW8fA6Tik=; b=DVrLaQN9Njf1076/x0tBqx2Gev3zNok2q6SCV14fuyJSvF1TcmWMVW3A9FdIqb6D6q++LO qMq4e5bKBoSCGDQbWC8rKEv+TLlFJ7OzubeT+kG2r5uBZQM1fTneEmVamMtDWEti1LK/ZD e9+dk51uXQCpTvO0ZixISPA1KcVfLnI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-LffWm5F8PHmPW6Xqb6MXzA-1; Sun, 29 Sep 2024 12:17:21 -0400 X-MC-Unique: LffWm5F8PHmPW6Xqb6MXzA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3293C195FE13; Sun, 29 Sep 2024 16:17:20 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CFBDA19541A0; Sun, 29 Sep 2024 16:17:18 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Andreas Schwab Subject: [PATCH v3 10/29] m68k: Add In-Reply-To: Message-ID: <12ac67f1b63ed8dc7c54cd267de4ffbf4cee5926.1727624528.git.fweimer@redhat.com> References: X-From-Line: 12ac67f1b63ed8dc7c54cd267de4ffbf4cee5926 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:17:15 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This commit assumes that traditional m68k and Coldfire binaries are incompatible and cannot run with the opposite kernel. Based on available information, Sun3 kernels (with 8 KiB pages according to arch/m68k/Kconfig) can run traditional m68k userspace code, so the page size for such binaries is either 4 KiB or 8 KiB. Page size on Coldfire kernels is always 8 KiB. --- sysdeps/m68k/bits/pagesize.h | 2 ++ sysdeps/m68k/coldfire/bits/pagesize.h | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 sysdeps/m68k/bits/pagesize.h create mode 100644 sysdeps/m68k/coldfire/bits/pagesize.h diff --git a/sysdeps/m68k/bits/pagesize.h b/sysdeps/m68k/bits/pagesize.h new file mode 100644 index 0000000000..373d367b7b --- /dev/null +++ b/sysdeps/m68k/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 13 diff --git a/sysdeps/m68k/coldfire/bits/pagesize.h b/sysdeps/m68k/coldfire/bits/pagesize.h new file mode 100644 index 0000000000..3a01770005 --- /dev/null +++ b/sysdeps/m68k/coldfire/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 13 +#define __GLIBC_PAGE_SHIFT_MAX 13 From patchwork Sun Sep 29 16:19:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=h3ljrQHN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqD33Dd5z1xt9 for ; Mon, 30 Sep 2024 02:19:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28F49385EC0F for ; Sun, 29 Sep 2024 16:19:45 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id D3BBA385841E for ; Sun, 29 Sep 2024 16:19:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3BBA385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D3BBA385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626773; cv=none; b=B/d+2x7aCupc0VmYU6UA6t9wOviW/zlS/tLiL/7TJWD6SHrW1BMoCK76AzxZWbna+5rLKUWKnWiphe+r3Ku9fmGiAgU2/0GtVVneUzqnbOoi3Bvnv1uf3xkjQTjp1T5+3DdvfUmL9wZdeB+RMzviGgYllgJ617lZlnaX/VRLrv8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626773; c=relaxed/simple; bh=WDs9lOg2wxX85Bc0ceX9Aru31A65HDctUdesaGzVCuw=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=DPoudICxmLU8bLi7+EHNtD2rEQCXF89Po7CpRQ1OihHV0d0JN+0GumSSdGXb1GUFq0gIl9561YzbpGIIBQHGD0GcXmqh5a1FiUEm6to59bpfHRIvkDeu3Ad98Kmv5YLvcM8v0bve/Z1b4c0chb0U4HuSLqv6H9INRueDtJoa+8k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626771; 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=sCOCeoAmh/l0YwwE9KXExs5PiuJ1+DRtPB9RS4Uy/5Y=; b=h3ljrQHNcvqbnVt3jpK+3RlpZsMsh9jB/cq66MZzskHvf0ollRjUmWzEjG5djHbATOiO3g ejW6f3HKTyTSIVKGnfcV0eToI1n40rs426gCe3QP6Dl30e+mB2Wd2O8/IR4gvzALg5iUPt 75mDuCeaHp08HZ4eBsaZbMTHjhVrN2E= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-CqCUX3kwMIqssL5pd5QfTg-1; Sun, 29 Sep 2024 12:19:28 -0400 X-MC-Unique: CqCUX3kwMIqssL5pd5QfTg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5282B190ECE8; Sun, 29 Sep 2024 16:19:27 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3130819373D7; Sun, 29 Sep 2024 16:19:24 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: David Holsgrove , Matthew Fortune , Petazzoni Subject: [PATCH v3 11/29] microblaze: Add In-Reply-To: Message-ID: References: X-From-Line: e83cd8d2f5bd4b14d87664bfcf131209dbd627cd Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:19:21 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/microblaze/Kconfig in the Linux kernel sources, only HAVE_PAGE_SIZE_4KB is selected, so the page size is 4096 bytes. --- sysdeps/microblaze/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/microblaze/bits/pagesize.h diff --git a/sysdeps/microblaze/bits/pagesize.h b/sysdeps/microblaze/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/microblaze/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:20:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990608 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IUVbgMXy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqFq1lQ6z1xt9 for ; Mon, 30 Sep 2024 02:21:19 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D58A385DDFE for ; Sun, 29 Sep 2024 16:21:17 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 99C22385C6E3 for ; Sun, 29 Sep 2024 16:21:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99C22385C6E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 99C22385C6E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626865; cv=none; b=PFXWzxBHTf5I1muKTN/XtdNP46GUP7AaOlHqOSU32khXk8lyE3tXRKjnIA7zEzhK50WLjh6UDjvzGwA/B3n79j8hZYcg8GcUM9QokVvHiZdNJRjm36E/EVOcbQvSWQ/OMfk8QkEprHDBzz1I48GUI+h/61g8kqMrI/DA/ohyoGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626865; c=relaxed/simple; bh=6zsRmvSWDsRTX8EK0Qre4xEx0qfG2zKPKbr0SqX47TY=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=DCJgWzQ8P0iuj5qST4L6rcnMqcrUmMX0Or5WOA9MwZE1507zqVO/I0xkdvBubr/OiJW5NocQpDhlEbkOM6UD1oqKbpmsF3lhlyT/DOrODVm9P/o9OLXdQ6n8o6hp5sWusOJgIhA1o1VZF5zmPwWhCrpJSOBVoGJUdkAKkS2R6WY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626863; 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=LThxXQW0iUAGr+omAWdyk8Ef8Ebutp84MAtxUzOYQic=; b=IUVbgMXyq7TV+/plHRsKZpHhPKEjtGbuBjtJu4vJo9gBiSCNqXIyXDyc60o8cZ/3fOgStX E+bTRv+UinmLDi55lD26bsbAD2nFRlWsdWj+1mScxRlTe5ukTL+61dvou92mFJJLrCx7ki YPCnsQl5TBio78oh1AjzpNYo3z6MbEE= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-556-Gq6pIdxlMbOMraE3T4P3uQ-1; Sun, 29 Sep 2024 12:21:01 -0400 X-MC-Unique: Gq6pIdxlMbOMraE3T4P3uQ-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F27C1955F29 for ; Sun, 29 Sep 2024 16:21:01 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 015791944B22; Sun, 29 Sep 2024 16:20:59 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Joseph Myers Subject: [PATCH v3 12/29] mips: Add In-Reply-To: Message-ID: References: X-From-Line: e8cd2a53433fd235d4a3e141053928edaf782688 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:20:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/mips/Kconfig in the Linux sources, MIPS supports 4 KiB, 8 KiB, 16 KiB, 32 KiB, 64 KiB page sizes depending on CPU/configuration. --- sysdeps/mips/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/mips/bits/pagesize.h diff --git a/sysdeps/mips/bits/pagesize.h b/sysdeps/mips/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/mips/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 16:22:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DkQ1aS2x; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqJ46lskz1xt9 for ; Mon, 30 Sep 2024 02:23:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E2FB385E839 for ; Sun, 29 Sep 2024 16:23:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id C7AD3385C6E3 for ; Sun, 29 Sep 2024 16:23:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7AD3385C6E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C7AD3385C6E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626982; cv=none; b=H/xx29mgLYo8/e/yCIQ2xwqI5E802Y0nKFVUz4/jpIf2nE8XP3go6W/JHCD7GFXoTfnnwmWRYS2ZzQIdUJuu7cPXwMGXrOV0q+oKz75KD9xpqw2OjC7l00bmXz8G5aImYUznwfxpE2UMNfvUApfUQcfBn4mw/zPGfmOvVwtUx/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727626982; c=relaxed/simple; bh=Lgo6UJI94dW1Nm65FpFArixd4arLE1f0kB8hfaD+RLg=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=TY2N4Yn7Soqymy+tfI1CMxgrNxRV/6yBO4wVdiPIsoF9970Ponlx7R4obsJq6a7rEeTXvcHOs/hStY5JHSmu85byeZWAjPS+AWTEN+o2F7MGFoCeQ39TaGWysXGtMrjUo1Q9/B5Ixnq+LGOT/hEVGZrAgsDdTVdTfCUo+iBLCWE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727626980; 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=+Ad3eBQ768lVhskThuV5SeDgXTFvOM0DytKlp6MRClg=; b=DkQ1aS2xGv67SqZvLRMghEoQg84UW36A3MadnHjLvizTglJzpqEC81xJ/utxlW0HFiZsK0 0yLTczSi+aG3O1IUR2dnjuq6W4O2n8aw0WtWwha7Tp3E0/0NCte0cdafOcv/cMvN8PhmGA qhdidQI7uRB9aK7rnvNK0keBSHzzj4k= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-1KGdB7egPYWtITjDr-b0Eg-1; Sun, 29 Sep 2024 12:22:57 -0400 X-MC-Unique: 1KGdB7egPYWtITjDr-b0Eg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 925C018E6E25; Sun, 29 Sep 2024 16:22:56 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4BBD519BC542; Sun, 29 Sep 2024 16:22:50 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Chung-Lin Tang Subject: [PATCH v3 13/29] nios2: Add In-Reply-To: Message-ID: <42f50c13d392183035e04e19bdd71423b9bdf666.1727624528.git.fweimer@redhat.com> References: X-From-Line: 42f50c13d392183035e04e19bdd71423b9bdf666 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:22:47 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org The arch/nios2/Kconfig file in the Linux kernel sources uses HAVE_PAGE_SIZE_4KB only, so the page size is always 4 KiB. --- sysdeps/nios2/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/nios2/bits/pagesize.h diff --git a/sysdeps/nios2/bits/pagesize.h b/sysdeps/nios2/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/nios2/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XEmPWGbw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqJk0G8xz1xt9 for ; Mon, 30 Sep 2024 02:23:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2C82385E45B for ; Sun, 29 Sep 2024 16:23:47 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4B364385EC14 for ; Sun, 29 Sep 2024 16:23:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B364385EC14 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4B364385EC14 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627014; cv=none; b=KJiI79jT1xT8u7jUx777YHAnRr98vCAk1n09auKRIqC51XqaN0At4G7fnVIzOptYqm1dMcvhNgnHbbf9qSK9Y0KEOdzti5jzPLNJyBPxE5e/vneFMvBYjpmxHpPPI/FeR78TvlTfpGlgMINo5z1nVx5BXBXOyS/0vaOH8ipJtd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627014; c=relaxed/simple; bh=o0GDjz6/zIe6VCMrfQKtsIvq6KP/phhiir/2WhViRoY=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=ru4gFVOhR/LxtUxlmsdV78yFm+JU4+7EtvuirpKp+U+SAXK1jT7PeJholOwVLa4gU1ssP6z8V+vOopliHUPSwr/WtW18Ky+FkzSWq+CxwUwggT+FEgQnTRTAnwJr1Nst8R9+bW6p9BQNfUT/Y4Uwx7lFisSZQ1p0HOLBiUPdRcQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627013; 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=1upaSBhwNGRhR/q0JVePIkQ1y/neYnBymCcfIC6J7rU=; b=XEmPWGbwQnwKgqMNeIFqQzIzVs3MaU7eDZIPFCaCEmoLh+c1TCd/DKr8Rgd/Xq7MqQbNEv 6ulFqKFyOaqA7AfuwhMfHBeCBDKfh+SNKvaWkMHZfAXRacoxvndfHIwFk+HT8oI9R/QhzM 4Pb8/FPgBCej8mvdemasz0Eglxoym6k= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-F5yK8QP7PsWDtRFrXzl_Zg-1; Sun, 29 Sep 2024 12:23:29 -0400 X-MC-Unique: F5yK8QP7PsWDtRFrXzl_Zg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D939219030BC; Sun, 29 Sep 2024 16:23:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B66F019373D7; Sun, 29 Sep 2024 16:23:27 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Stafford Horne Subject: [PATCH v3 14/29] or1k: Add In-Reply-To: Message-ID: References: X-From-Line: e26dfcaf2f1f9ed5173e79e1010dbed4db52d389 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:23:24 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org The Linux sources in arch/openrisc/Kconfig use HAVE_PAGE_SIZE_8KB only, so the page size is fixed at 8 KiB. --- sysdeps/or1k/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/or1k/bits/pagesize.h diff --git a/sysdeps/or1k/bits/pagesize.h b/sysdeps/or1k/bits/pagesize.h new file mode 100644 index 0000000000..3a01770005 --- /dev/null +++ b/sysdeps/or1k/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 13 +#define __GLIBC_PAGE_SHIFT_MAX 13 From patchwork Sun Sep 29 16:23:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Tz34TL1G; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqKD32Wkz1xt9 for ; Mon, 30 Sep 2024 02:24:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 431C4385EC19 for ; Sun, 29 Sep 2024 16:24:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 78656385E45C for ; Sun, 29 Sep 2024 16:23:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78656385E45C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 78656385E45C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627041; cv=none; b=DRkpNp/c/rMU0YprfB7gOyVwGjRqW2grSFGf1e2bHMZWl6mKCg2fymXAqt4B/i3s42JuMzLPVQTsFBzSChxtlsuFUmK3AFvDxIHsBYOXHp+pOVixYXin7BmDZB4TJJjuYxET3HEVUej9z/dASGjCOoTXwiUVXAjkfouWkMJmIdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627041; c=relaxed/simple; bh=hmBip7TAg3TQr0KAv4O7oOmtdQKktwB1balIEPtUrIA=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=ADWq0rmFvl6p8XAFI2XaaRUxq2/rax06rIERc8rhVGKiktNFbR+nEYPtop5abix4vigwKex+ENZENoLDmHcQvLLBKcMh6nnXG+JaXoBkvc9UwQMi01I2JwM2s87fs1L/R/b2hv+nYEoxIn/qmj4h5+Zvts0mM1yNp85wAwW+2q8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627039; 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=qXmp/ijhmGNZwgyc2TdXHREYS9OMeEYO7qDerL75KkM=; b=Tz34TL1GgqU+P/qbIKbTQXbVEBYgJEJd67Wmmfi7UZU53ootOZUpltVj/8lFRvtMS3qrcU RzFGBwnZVJtuZfewo4KqUQB3XPKTyfLQiZLuKz+kQc2REdW5dHl2CSrvwIl3MKgdIoXrgp CZg+7nhMZ8whvQ99ssqM7auvaep9qMA= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-132-tkQbRKi6PLCw7rqkKvo90Q-1; Sun, 29 Sep 2024 12:23:56 -0400 X-MC-Unique: tkQbRKi6PLCw7rqkKvo90Q-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3579B195394C; Sun, 29 Sep 2024 16:23:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1228C3003E4D; Sun, 29 Sep 2024 16:23:53 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Peter Bergner Subject: [PATCH v3 15/29] powerpc: Add In-Reply-To: Message-ID: References: X-From-Line: ad4e04090afc7409127ad85f3ce77f0ab67b80bf Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:23:50 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/powerpc/Kconfig in the Linux kernel sources, PowerPC supports page sizes up to 256 KiB. However, in practice, only page sizes up to 64 KiB are used, especially on 64-bit targets. If 256 KiB page support is needed, it is probably best to add a configure check for linker LOAD segment alignment and generate a file that has 256 KiB as the maximum page size. Regular toolchain defaults only support 64 KiB as the maximum page size. Reviewed-by: Peter Bergner --- sysdeps/powerpc/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/powerpc/bits/pagesize.h diff --git a/sysdeps/powerpc/bits/pagesize.h b/sysdeps/powerpc/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/powerpc/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 16:29:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Xclkmzg+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqSJ5kzDz1xt8 for ; Mon, 30 Sep 2024 02:30:24 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D63EC385E45B for ; Sun, 29 Sep 2024 16:30:21 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id E3405385C6E3 for ; Sun, 29 Sep 2024 16:30:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3405385C6E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E3405385C6E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627409; cv=none; b=ayB21+1Ia4SL7eGsnTcYTzvqp0miVXGtJmHNzReagdaZgXugjB0O65qXgqUIma+LsmtsUdp6SaA8Ht28BA6pmmctzYSYzV+j9a2XjOToLIqgxPL02zoo/Djkux3n4PRxiE/kKC0IWn53rAPdJJaTtJlrVq03+4tf/LaKnMx4qgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627409; c=relaxed/simple; bh=/kk+lLiJLns6tOsxjXF5x7bOCGLT4qrbictsHgnwdY8=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=pYjVnyWl3J74CIgcyk3Nc0N7QE5OtWizvZoNZDUVIlg79/koIpxLyYZ4jRSzmhGhESbDji+CDE3lRBG1fk96mtQRRxWUz0oJKKV0wt0Z7OISo/LftjwJvg3ERpNqGz9YdDrQbX03mnwwkH/ahJ7/v2xvC5ojTbV3f+EKZ/m482k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627407; 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=NsbM7WETzmOKNbP6jsmeUzJQ4wQqJph4QuxJOCCa4fg=; b=Xclkmzg+f7HRmBKCoMvrE6j5HOf0EnpQHfDAhH4GeHsKIQZ+cTXiZE8liIH5BCkVb9dCdR GUJ72vHh0V0SFHXjTR9BETvxP2AmXhli17ySRBz7S1JzK3fR5slrOD7ZHqp+XR42g3Tkq4 ws7nZ/zcHOOQ+O9HTnwGHlTB4UA5Vus= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-nIRXA2dYONWTlb6Ddd1yag-1; Sun, 29 Sep 2024 12:30:04 -0400 X-MC-Unique: nIRXA2dYONWTlb6Ddd1yag-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D5F9192DE37; Sun, 29 Sep 2024 16:30:03 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D9BDD1979064; Sun, 29 Sep 2024 16:30:01 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Jeff Law , Palmer Dabbelt Subject: [PATCH v3 16/29] riscv: Add In-Reply-To: Message-ID: References: X-From-Line: d17ce3756ff69b8eea07b0d23f18aa76009871e1 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:29:58 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org The GNU toolchain defaults to 4 KiB as the maximum page size, and this is also the only page size supported by Linux (according to arch/riscv/Kconfig; only HAVE_PAGE_SIZE_4KB is used). There has been a proposal for 64 KiB page sizes: [RFC PATCH V1 00/11] riscv: Introduce 64K base page But this has not been merged, and it would be necessary to rebuild all binaries anyway due to the toolchain default, so this commit claims that the page size is fixed at 4096 bytes. --- sysdeps/riscv/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/riscv/bits/pagesize.h diff --git a/sysdeps/riscv/bits/pagesize.h b/sysdeps/riscv/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/riscv/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:30:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=db+H0ViA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqT00hQgz1xt8 for ; Mon, 30 Sep 2024 02:31:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3BD46385E45C for ; Sun, 29 Sep 2024 16:30:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id DB389385EC10 for ; Sun, 29 Sep 2024 16:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB389385EC10 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB389385EC10 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627442; cv=none; b=sjfbOzqyVJPR7w8IiW08idwuE+KbNxaPdvW984rfEzOvRGWScoFlMfjqE1t4tQWCl+M15+omkM8+i0BWJTFdS5pOqGRhdU7kjUlSy9V72xJ9P6S5QoYKMzvClMetBi2sR8rB4vXZO35nu7ITBQotFYb6Ir1vkOXy9MYpLU+hDb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627442; c=relaxed/simple; bh=kjEW4cczxQv+CQudnp8k+JaEcJ7Hl4SYE4mIelcZINQ=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=lIZx35CW3GqqUp8QrDeKmpzL5Wd3/0rRegZdyqaWTRoeEMIedOgGSdTOQ2AFADDcmqj74GE4Mo9V6QMCB/6YI8ozG5CpZ4xrj/yBy/kcB/t/o19lq0G+qfnRTQAGqj56p51aC2FXpHeGGyWYy40Ak054GCeEXkezkF0Y+u3rmQ4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627440; 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=/KFMuDGOCCy6u2n8pU7b28iaoGN7+scppnBN8d+5i5E=; b=db+H0ViACR4Be1vmqGNuVs53u6zfEjjgmrl6HQykAnAneMZdJko/PiAG+9BiNwK9pfCQHc bpdnC8EmclduR59TbbKaIsC7QA8+gJ82a9XDVmzBPEa9kz7Qq1XgDagNJg0qVaGAzhdDGj YEii+EToRE1/PsigB2YwU2UPUnbd7VM= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-fa0A1uAUMjaTO_jtDJ9ogw-1; Sun, 29 Sep 2024 12:30:39 -0400 X-MC-Unique: fa0A1uAUMjaTO_jtDJ9ogw-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4F73C195FE21; Sun, 29 Sep 2024 16:30:38 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4ABAF1944B22; Sun, 29 Sep 2024 16:30:36 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH v3 17/29] s390: Add In-Reply-To: Message-ID: <62b57bc06bd5f6cf422b9e93c28ba768a72f3482.1727624528.git.fweimer@redhat.com> References: X-From-Line: 62b57bc06bd5f6cf422b9e93c28ba768a72f3482 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:30:34 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org The s390 and 390x psABI supplements specify that the page size is 4096 bytes, and that is what Linux supports. Reviewed-by: Stefan Liebler --- sysdeps/s390/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/s390/bits/pagesize.h diff --git a/sysdeps/s390/bits/pagesize.h b/sysdeps/s390/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/s390/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:31:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990614 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UVXOjiVi; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqTq6w82z1xt8 for ; Mon, 30 Sep 2024 02:31:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB300385DDE2 for ; Sun, 29 Sep 2024 16:31:41 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 9F204385DDDB for ; Sun, 29 Sep 2024 16:31:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F204385DDDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9F204385DDDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627488; cv=none; b=pqmmr76/26b5/hQ0+Dzbjpf7USRH6E87GQyvgmDwcyarDQS705i/AvupxG4qzHcgjmqKZIOH834vL2DlYKqhXyGIOhLo7+IEwKMPueTQwWIh+vuUXYOXYQow9iMr8ZEambYxfbh86eVvqK2B81q2+3wB5UQ6zKv64LIef5mDuW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627488; c=relaxed/simple; bh=9fkJ6jWHI1UYaS7t5xl9sFfuIJXa9vIn2Uyo7RZNO4M=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=emS5Rssyl/i7A3BhDTmXXNjpoEosHVLfLVeTbbMrJSpuPhv6VS4G1/u/1c+NzMrEV+ZLD/AHP+J7XABdRAaUq9nuBj9U4oAM+3qh4cEXXlOQkemAaDro6uLUFI8uDbgbQhloNcGi9KJlx8pU6SwDNq/zXqQp+pvlN+oFsfJmBR4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=l0mukZM6ZVuevWjvB7OYMHr1CUWhGGwpEr2+iNSjHDI=; b=UVXOjiViMFADrBJz+zFhsthD5hfmoRIlTYGwpWo0i2EhJ5i2Pp84/s9TpjvxHKiBykb2cR L4+lUkK17ucXLuLjyTioWBVdNG56ctvoJ1m33grPv9BuAlKlhsGi9y3F2Ai9bcTd03z+Hl f7HcDonv7UR5uTdFqR9aOKRWsz1VRxI= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-196-AbClcfXCOBme5t48hvwTbA-1; Sun, 29 Sep 2024 12:31:25 -0400 X-MC-Unique: AbClcfXCOBme5t48hvwTbA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5262B191915F for ; Sun, 29 Sep 2024 16:31:24 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 69C431979061 for ; Sun, 29 Sep 2024 16:31:23 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 18/29] sh: Add In-Reply-To: Message-ID: <14c287eb4d33a573bf17682ca68113d6fdb941bb.1727624528.git.fweimer@redhat.com> References: X-From-Line: 14c287eb4d33a573bf17682ca68113d6fdb941bb Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:31:20 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Linux supports page sizes from 4 KiB to 64 KiB depending on CPU type (per arch/sh/mm/Kconfig). SH4 kernels are expected to run SH3 binaries according to: Re: Bootstrapping Debian GNU/Linux distribution on SuperH Therefore, this commit supports the entire range of page sizes for all variants. --- sysdeps/sh/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/sh/bits/pagesize.h diff --git a/sysdeps/sh/bits/pagesize.h b/sysdeps/sh/bits/pagesize.h new file mode 100644 index 0000000000..cd688d3fb0 --- /dev/null +++ b/sysdeps/sh/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 16 From patchwork Sun Sep 29 16:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SOLg5Zfa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqXZ4zqvz1xt8 for ; Mon, 30 Sep 2024 02:34:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E6E3385EC06 for ; Sun, 29 Sep 2024 16:34:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 1FEFC385C6E3 for ; Sun, 29 Sep 2024 16:33:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FEFC385C6E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1FEFC385C6E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627631; cv=none; b=MgBJvY7zI4DCdur/zSYjVq7VKdRxcy+ZxRqFLNvDPOtzSVYEf3nvc4iyNLjFs0e+8fyRAUT2Ka4jwJ4TBWm15ph8t2BcxMPwAf3DJXFdpINU82H7lMHzV1JEEyZF44bf/v5ST/4nzJ1syP4T0mpO57V0cRsFuzv8EV1pL4Jna3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627631; c=relaxed/simple; bh=0qbABRK2pHd24g6kQXn5Zhiu+OMAjERP7RpxNViIpzU=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=HRGmkVnTVzYgwwWEzkVjrANz9AuY3e6sZMvwhEaBoXbsMPSFn2EFIiW4KhW5IUtlcdjaycZufbgpKdVoyGCqg3xDM2UTDTJXFObcV0Dqd61BhR/3teRHUZDWdSgpXKELhWEKYiWNu9GQ/EjQYdupJJlcQ3eFgPK3kAEO1KMI5d4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627629; 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=2eRhvhMUITvWADU+0dSJdikRv0vXEoEzBSFU/txqYkU=; b=SOLg5Zfa6GeOwkMkkcghdIhle3eN0by1cUDu/AO7rezy9mA7ew955rWKlelpBfXhYm7KPI UIq2Ad02m3oMbUHgsS3y1zSOmhPSqe1/ty17/cU1+mM6ilUFN3Gqdl1zPqJDpq5bN0gHP3 EAwskAyWkVMGKpHXSAYj10oOhrQ/nL8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-uD3i0lfLNWSkBa__z3tRag-1; Sun, 29 Sep 2024 12:33:48 -0400 X-MC-Unique: uD3i0lfLNWSkBa__z3tRag-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 917EF19792DA; Sun, 29 Sep 2024 16:33:47 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6924F1979061; Sun, 29 Sep 2024 16:33:45 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: David S. Miller Subject: [PATCH v3 19/29] sparc: Add In-Reply-To: Message-ID: <7a042a691b91dd0450e53228b5682d227aae1799.1727624528.git.fweimer@redhat.com> References: X-From-Line: 7a042a691b91dd0450e53228b5682d227aae1799 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:33:42 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org According to arch/sparc/Kconfig in the Linux sources, 32-bit SPARC has 4K pages, while 64-bit SPARC has 8K pages. To enable running 32-bit binaries in compat mode on 64-bit kernels, support 4 KiB and 8 KiB page sizes for 32-bit, but only 8 KiB pages for 64-bit. The 64-bit toolchain defaults to 1 MiB page size support, so bump the page size range on 64-bit to that, disregarding Linux support. Note: We could fix the 64-bit page size at 8 KiB and XFAIL a future alignment test (currently the gaps test will fail because of the excess load segment alignment). --- sysdeps/sparc/sparc32/bits/pagesize.h | 2 ++ sysdeps/sparc/sparc64/bits/pagesize.h | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 sysdeps/sparc/sparc32/bits/pagesize.h create mode 100644 sysdeps/sparc/sparc64/bits/pagesize.h diff --git a/sysdeps/sparc/sparc32/bits/pagesize.h b/sysdeps/sparc/sparc32/bits/pagesize.h new file mode 100644 index 0000000000..373d367b7b --- /dev/null +++ b/sysdeps/sparc/sparc32/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 13 diff --git a/sysdeps/sparc/sparc64/bits/pagesize.h b/sysdeps/sparc/sparc64/bits/pagesize.h new file mode 100644 index 0000000000..aec8f97a10 --- /dev/null +++ b/sysdeps/sparc/sparc64/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 13 +#define __GLIBC_PAGE_SHIFT_MAX 20 From patchwork Sun Sep 29 16:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TuNDgc/f; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqYc42gjz1xt9 for ; Mon, 30 Sep 2024 02:35:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AF45385EC1E for ; Sun, 29 Sep 2024 16:34:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id B9FFC385E45B for ; Sun, 29 Sep 2024 16:34:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9FFC385E45B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B9FFC385E45B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627673; cv=none; b=MjSRXKgnN41TXtOojXEXuGQwPghE4wHuW/rwRW/8b/ASKFVJqxRPXFoInB7iOt7HEeoeH8+LKxJ82WLimXjHQsYw4+2CWIRRrEiL40JgG1GSt1d9yt4ohhh+q+c6qYRgMAa0eHwCkzCPRx0pMPLR1bZmXTfVEMkCBBs6XmKrxHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627673; c=relaxed/simple; bh=imdPSzILu5AqhocXld8O0pGPnI5LmDR/40TWecIt8MQ=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=xTqLZLevebnbsjPr1bSj9xA7Ie6BqfdGnlfp6598bEj4E7LT2Uu4cGNlMDgiXjRQMe/pEYDXFOD3FtxK+tkNG0GmLiBIlt0kFwIMMUOuIFPcaN/CPq0mwzIvifURTrDa1QDBgf8JHYD40C99CRzKh3J/ZJ7qeb53p5spM0OkbDU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627670; 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=HSqMjOXqVhaTTucLTtAxTbEsd4AU7BWennpK46hpf+Q=; b=TuNDgc/fASvntZKQmMX7q3mr0FdhRyRuDuX99H4FdP3TOSXGkgcWYw1pLeujmqqtHAJiyP QF3MIiivprigEu1SIf7AbyaQl0wk8HZZiG2tML8ucQZhxh8H/DH5x+4bFwx5vN1n7g9bKP csuAemhJ9K2a6QdAGr0yRnXC1fLQPi0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-pUFpuJOpME6x7tbkFD25xg-1; Sun, 29 Sep 2024 12:34:27 -0400 X-MC-Unique: pUFpuJOpME6x7tbkFD25xg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 63D41192DE2C; Sun, 29 Sep 2024 16:34:26 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D165A19541A0; Sun, 29 Sep 2024 16:34:24 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Cc: H.J. Lu , Noah Goldstein Subject: [PATCH v3 20/29] x86: Add In-Reply-To: Message-ID: <2bdd28ea16cce41e0ae911eead8470f0ce0cdd36.1727624528.git.fweimer@redhat.com> References: X-From-Line: 2bdd28ea16cce41e0ae911eead8470f0ce0cdd36 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:34:21 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org It is well-known that the page size on i386 and x86-64 is 4096 bytes. --- sysdeps/x86/bits/pagesize.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sysdeps/x86/bits/pagesize.h diff --git a/sysdeps/x86/bits/pagesize.h b/sysdeps/x86/bits/pagesize.h new file mode 100644 index 0000000000..352fb732d7 --- /dev/null +++ b/sysdeps/x86/bits/pagesize.h @@ -0,0 +1,2 @@ +#define __GLIBC_PAGE_SHIFT_MIN 12 +#define __GLIBC_PAGE_SHIFT_MAX 12 From patchwork Sun Sep 29 16:34:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=c2PcQSJ1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqYl1tWqz1xt9 for ; Mon, 30 Sep 2024 02:35:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F68D385EC1B for ; Sun, 29 Sep 2024 16:35:05 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 640C6385EC1B for ; Sun, 29 Sep 2024 16:34:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 640C6385EC1B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 640C6385EC1B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627687; cv=none; b=gZovd7NdK8iCglmQgE4wTMLQAWgDaFwjDGY+vDTS5iIjQvCsbd1moBOB9qha0RFkL1FvmEhrakPH/ux1OSDcDWrxYWm13ak7cL5rxuObScOnBbTEZAlliY/lu4CwWeoY60lAz0eYmQsjp8npSmCCHYlFtkBmLpnzQCbDyymSy28= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627687; c=relaxed/simple; bh=P8zAWo2zh8eus5ssPaZPkIhSksL7gp57+xQtuw3Mojs=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=uN+vGSXG74UJOsMHUhrwsM8CwIkmiSoaxD/IN+3UN2UeHO1smJx8zZrQaAS7Wtc/M88Zm1X+c5BYUJziepz7lFm+K0plb31SiE5tFWVbTdHOvXUcRGGrWwXWNLhWjMfbnUWFzvYcGzAKcPUu7gEYBJImh4JwGpGCs/hda5QoVjQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EIuCI2yklA2h588wyzZKFeufHCn0sxhgne9Mv4VjsCI=; b=c2PcQSJ1D6BfnIXGtz+GrFoljxmwMwXB4ttS/FAZ8+qkv53WVkseFnMsfZQMHwzMyd/YPa u8JU0QQB+UcOQs+PqMLMi3tt8u6i/kUUp/sXfuze63z9bC54bq8Rb+IcvR9LORg4rfftW4 qPQIPPg3/3zJ/RQbj/021YasLrem15E= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-eLJwSITVMHSthnCn6WJ4lw-1; Sun, 29 Sep 2024 12:34:43 -0400 X-MC-Unique: eLJwSITVMHSthnCn6WJ4lw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C439F19792DA for ; Sun, 29 Sep 2024 16:34:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C6EED19541A0 for ; Sun, 29 Sep 2024 16:34:41 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 21/29] misc: Add tst-getpagesize In-Reply-To: Message-ID: References: X-From-Line: a4d305f48d27c5fc07cf8c9ddbf85d43d6e22386 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:34:38 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This test checks the system page size against the hard-coded range in . --- misc/Makefile | 1 + misc/tst-getpagesize.c | 65 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 misc/tst-getpagesize.c diff --git a/misc/Makefile b/misc/Makefile index a932b1aab4..4250b789d1 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -243,6 +243,7 @@ tests := \ tst-empty \ tst-error1 \ tst-fdset \ + tst-getpagesize \ tst-hsearch \ tst-insremque \ tst-ioctl \ diff --git a/misc/tst-getpagesize.c b/misc/tst-getpagesize.c new file mode 100644 index 0000000000..d8bcdc6dc5 --- /dev/null +++ b/misc/tst-getpagesize.c @@ -0,0 +1,65 @@ +/* Run-time tests for page size. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __linux__ +# define HAVE_AUXV 1 +# include +#else +# define HAVE_AUXV 0 +#endif + +static int +do_test (void) +{ + printf ("info: getpagesize (): %d\n", getpagesize ()); + TEST_COMPARE (getpagesize (), sysconf (_SC_PAGE_SIZE)); + TEST_COMPARE (_SC_PAGE_SIZE, _SC_PAGESIZE); + + /* The page size in the auxiliary vector is not optimized. */ +#ifdef HAVE_AUX + TEST_COMPARE (getpagesize (), getauxval (AT_PAGESZ)); +#endif + + /* Test against the page size ranges from . */ + TEST_VERIFY (getpagesize () >= PAGE_SIZE_MIN); + TEST_VERIFY (getpagesize () <= PAGE_SIZE_MAX); + _Static_assert (PAGE_SHIFT_MIN == __GLIBC_PAGE_SHIFT_MIN, "PAGE_SHIFT_MIN"); + _Static_assert (PAGE_SHIFT_MAX == __GLIBC_PAGE_SHIFT_MAX, "PAGE_SHIFT_MAX"); + _Static_assert (PAGE_SIZE_MIN == (1UL << PAGE_SHIFT_MIN), "PAGE_SIZE_MIN"); + _Static_assert (PAGE_SIZE_MAX == (1UL << PAGE_SHIFT_MAX), "PAGE_SIZE_MAX"); + _Static_assert (PAGE_SIZE_MIN <= PAGE_SIZE_MAX, "page size ordering"); + + /* Create a few mappings to verify that the address is a multiple of + the page size. */ + for (int i = 0; i < 1000; i++) + TEST_COMPARE ((uintptr_t) xmmap (NULL, 1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1) + % 4096, 0); + + return 0; +} + +#include From patchwork Sun Sep 29 16:34:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DNSrUbc2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqZx2t0rz1xt9 for ; Mon, 30 Sep 2024 02:36:09 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33730385E45C for ; Sun, 29 Sep 2024 16:36:07 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 01BC8385EC29 for ; Sun, 29 Sep 2024 16:34:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01BC8385EC29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 01BC8385EC29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627698; cv=none; b=sBFiMW8KvSUc0A+o4nYjys+vj/Ngcf6MjnrpJ4qUMZOBuNNRq3y4myzJP3k+qdSVv3sMWaV559wip+SrDjPlEkShNev4rZLa58Po8gapXwPifx5IH5IHPCVkUgJ6rgwJaocgxLNsIMJWF53yLJHrKEmBsbXEGoOVtRv4XnIpFxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627698; c=relaxed/simple; bh=73Vl9uW3GnZ2CZGcHAptm6ArgGySjpp+KjxghOtCMmI=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=oH13ySt4lg74ZwNbHWxmT5hwdMaWK2hRHqj/NleESXViT7+7S1BcDZs2q7CuWc4N6xB2G7kF+lYj8vlxUcqv6YEmMmUCecIKH6cfrxg33COMHlsWnyEli0WHm7JG8gitk1CXQP0Ts90GPOx6F58Dvv3VgChXRVsViHbkmlZ7Fsw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S7VQElD9KlvOJTO81HseF0KP6oD5f6T6LSXTSPOFN2k=; b=DNSrUbc215fWUv/OLp0YbpYhCe/vyBLvBGQe4ZzEkD5fMHlvpiEk/BvqPtN4vYFqKa2Hg1 DlWwsuBUQK4qoE2u4RwvdCXs5Y0vwdks5S5TT30U3vSO1tnzMOXtTG0+XtqJOb1BONsOWK CHFuTp9yNMjkivPu36wNoVrAzvMw0Lg= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-44-SXIgS_btNMG0Kxbui_IgRg-1; Sun, 29 Sep 2024 12:34:52 -0400 X-MC-Unique: SXIgS_btNMG0Kxbui_IgRg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD851190ECE8 for ; Sun, 29 Sep 2024 16:34:51 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B9AC61979061 for ; Sun, 29 Sep 2024 16:34:50 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 22/29] elf: Extract rtld_setup_phdr function from dl_main In-Reply-To: Message-ID: <50e5862208a5814248c0c4ff3c496cff1d9f20d0.1727624528.git.fweimer@redhat.com> References: X-From-Line: 50e5862208a5814248c0c4ff3c496cff1d9f20d0 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:34:47 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Remove historic binutils reference from comment and update how this data is used by applications. --- elf/rtld.c | 58 +++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/elf/rtld.c b/elf/rtld.c index cb6b61d570..50c01b9bb4 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1260,6 +1260,36 @@ rtld_setup_main_map (struct link_map *main_map) return has_interp; } +/* Set up the program header information for the dynamic linker + itself. It can be accessed via _r_debug and dl_iterate_phdr + callbacks. */ +static void +rtld_setup_phdr (void) +{ + /* Starting from binutils-2.23, the linker will define the magic + symbol __ehdr_start to point to our own ELF header if it is + visible in a segment that also includes the phdrs. */ + + const ElfW(Ehdr) *rtld_ehdr = &__ehdr_start; + assert (rtld_ehdr->e_ehsize == sizeof *rtld_ehdr); + assert (rtld_ehdr->e_phentsize == sizeof (ElfW(Phdr))); + + const ElfW(Phdr) *rtld_phdr = (const void *) rtld_ehdr + rtld_ehdr->e_phoff; + + GL(dl_rtld_map).l_phdr = rtld_phdr; + GL(dl_rtld_map).l_phnum = rtld_ehdr->e_phnum; + + /* PT_GNU_RELRO is usually the last phdr. */ + size_t cnt = rtld_ehdr->e_phnum; + while (cnt-- > 0) + if (rtld_phdr[cnt].p_type == PT_GNU_RELRO) + { + GL(dl_rtld_map).l_relro_addr = rtld_phdr[cnt].p_vaddr; + GL(dl_rtld_map).l_relro_size = rtld_phdr[cnt].p_memsz; + break; + } +} + /* Adjusts the contents of the stack and related globals for the user entry point. The ld.so processed skip_args arguments and bumped _dl_argv and _dl_argc accordingly. Those arguments are removed from @@ -1730,33 +1760,7 @@ dl_main (const ElfW(Phdr) *phdr, ++GL(dl_ns)[LM_ID_BASE]._ns_nloaded; ++GL(dl_load_adds); - /* Starting from binutils-2.23, the linker will define the magic symbol - __ehdr_start to point to our own ELF header if it is visible in a - segment that also includes the phdrs. If that's not available, we use - the old method that assumes the beginning of the file is part of the - lowest-addressed PT_LOAD segment. */ - - /* Set up the program header information for the dynamic linker - itself. It is needed in the dl_iterate_phdr callbacks. */ - const ElfW(Ehdr) *rtld_ehdr = &__ehdr_start; - assert (rtld_ehdr->e_ehsize == sizeof *rtld_ehdr); - assert (rtld_ehdr->e_phentsize == sizeof (ElfW(Phdr))); - - const ElfW(Phdr) *rtld_phdr = (const void *) rtld_ehdr + rtld_ehdr->e_phoff; - - GL(dl_rtld_map).l_phdr = rtld_phdr; - GL(dl_rtld_map).l_phnum = rtld_ehdr->e_phnum; - - - /* PT_GNU_RELRO is usually the last phdr. */ - size_t cnt = rtld_ehdr->e_phnum; - while (cnt-- > 0) - if (rtld_phdr[cnt].p_type == PT_GNU_RELRO) - { - GL(dl_rtld_map).l_relro_addr = rtld_phdr[cnt].p_vaddr; - GL(dl_rtld_map).l_relro_size = rtld_phdr[cnt].p_memsz; - break; - } + rtld_setup_phdr (); /* Add the dynamic linker to the TLS list if it also uses TLS. */ if (GL(dl_rtld_map).l_tls_blocksize != 0) From patchwork Sun Sep 29 16:36:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ae9IwAvC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqbl6STTz1xt9 for ; Mon, 30 Sep 2024 02:36:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABA43385EC1C for ; Sun, 29 Sep 2024 16:36:49 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 7BC7A385EC1F for ; Sun, 29 Sep 2024 16:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BC7A385EC1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7BC7A385EC1F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627788; cv=none; b=YX3jStXZ9SjGFIbE1drIRzWndIA3Ob6hDgfoSOItZbOXDBUJYzoVqyOxCVRodgoA0Y7zMp1K/XhSNxXsgncru+m1f5yYLzeGQX34sa6Y2d3vj/rKpIn+6UEs0pdHZbqxkkzzz+WKZRrkByxgynv6QaqxLR+cItZgwrgRFoohRS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627788; c=relaxed/simple; bh=IUKBOhZo1PCf8/NZSwabvzmnrgqAjEqXcQaIqE/qUg0=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=sy9AscA7cCh9cg1BNhGOR9I1ZEOcPESXVeXvutD6tro/zT7OjUQgLpFQx8tknFPPqAiYvXWk6qQfIKT9SwqLf/o/LfitO9Ghj2pEIJxTuG8vdaxOn4fT1psDH+as7Hs7jU+k07ryKlWfOMViF/cPUbDzCcEFrbCjiy2fRm9dEX8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZUgWIO+UUX9QJjyuQSGVYS7rv66mhO5cJJFmwXaq4fs=; b=ae9IwAvCsqplkFRR/ZbmQimr2RpugeLMma38opqkgL/JEp9fYFHMJ6hhOp8yEWfd0AEAgl pKxwer1L8n40kTcQGFzdQ6fu2cB2B9cf2p6jAVI++7qQG3IuuqAsHqGpL2+cokbiUp9vBE 01thtigMsgdkeX3rRKNBx99xCs1DBgY= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-TB4F9xC6PCCSqFwUn5fDUQ-1; Sun, 29 Sep 2024 12:36:23 -0400 X-MC-Unique: TB4F9xC6PCCSqFwUn5fDUQ-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CE00E195395C for ; Sun, 29 Sep 2024 16:36:22 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DAFBA1944B22 for ; Sun, 29 Sep 2024 16:36:21 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 23/29] configure: Add --with-ld-relro-load-gaps configure option and test In-Reply-To: Message-ID: References: X-From-Line: a35a2ec02aa680d73bec566dc6cc913404fa12e8 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:36:18 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Related to binutils bug 28743. The new test elf/tst-gaps-ldso verifies that ld.so does not have gaps if the configure check indicates that the linker does not produce such gaps, and the architecture supports a single page size only. The companion test elf/tst-load-alignment checks that the LOAD segments produced during the build permit loading glibc on the largest supported page size. --- INSTALL | 12 ++++ config.h.in | 3 + configure | 39 +++++++++++ configure.ac | 20 ++++++ elf/Makefile | 25 +++++++ elf/tst-program-headers.py | 137 +++++++++++++++++++++++++++++++++++++ manual/install.texi | 12 ++++ 7 files changed, 248 insertions(+) create mode 100644 elf/tst-program-headers.py diff --git a/INSTALL b/INSTALL index 24e3c8d25b..91a1e5e984 100644 --- a/INSTALL +++ b/INSTALL @@ -90,6 +90,18 @@ if 'CFLAGS' is specified it must enable optimization. For example: library will still be usable, but functionality may be lost--for example, you can't build a shared libc with old binutils. +'--with-ld-relro-load-gaps=CHOICE' + If CHOICE is 'yes', assume that the linker may produce gaps between + LOAD segments when linking 'ld.so', related to RELRO processing. + With 'no', assume that no such gaps are produced. The default for + CHOICE is 'check', which performs a version-only linker check. The + binutils linker bug in question is + . + + There is another source of LOAD segment gaps on architectures which + support multiple page sizes. The '--with-ld-relro-load-gaps' is + not related to that. + '--with-nonshared-cflags=CFLAGS' Use additional compiler flags CFLAGS to build the parts of the library which are always statically linked into applications and diff --git a/config.h.in b/config.h.in index 6c25c923fa..00c0d391d4 100644 --- a/config.h.in +++ b/config.h.in @@ -263,6 +263,9 @@ any external dependencies such as making a function call. */ #define HAVE_BUILTIN_TRAP 0 +/* Define if ld may produce gaps in load segments, related to RELRO. */ +#undef HAVE_LD_RELRO_LOAD_GAPS + /* ports/sysdeps/mips/configure.in */ /* Define if using the IEEE 754-2008 NaN encoding on the MIPS target. */ #undef HAVE_MIPS_NAN2008 diff --git a/configure b/configure index ec0b62db36..33f63911c6 100755 --- a/configure +++ b/configure @@ -610,6 +610,7 @@ PACKAGE_URL='https://www.gnu.org/software/glibc/' ac_unique_file="include/features.h" enable_option_checking=no +with_ld_relro_load_gaps=check ac_subst_vars='LTLIBOBJS LIBOBJS pthread_in_libc @@ -809,6 +810,7 @@ enable_cet enable_scv enable_fortify_source with_cpu +with_ld_relro_load_gaps ' ac_precious_vars='build_alias host_alias @@ -1513,6 +1515,9 @@ Optional Packages: --with-man-pages=VERSION tie manual to a specific man-pages version --with-cpu=CPU select code for CPU variant + --with-ld-relro-load-gaps + support linker with RELRO LOAD segment gap bug + [default=check] Some influential environment variables: CC C compiler command @@ -5319,6 +5324,40 @@ esac config_vars="$config_vars with-lld = $libc_cv_with_lld" + +# Check whether --with-ld_relro_load_gaps was given. +if test ${with_ld_relro_load_gaps+y} +then : + withval=$with_ld_relro_load_gaps; +else case e in #( + e) : ;; +esac +fi + +if test "x$with_ld_relro_load_gaps" = xcheck +then : + echo "Checking binutils ld version:" >&5 + if LC_ALL=C $LD --version | grep -E '^GNU ld version 2\.(2[0-9]|3[0-8])[^0-9]' >&5 +then : + with_ld_relro_load_gaps=yes +else case e in #( + e) with_ld_relro_load_gaps=no + echo "(linker not binutils or not impacted)" >&5 ;; +esac +fi +fi +if test "x$with_ld_relro_load_gaps" != xyes && test "x$with_ld_relro_load_gaps" != xno +then : + as_fn_error $? "invalid --with-ld-load-gaps argument: $with_ld_relro_load_gaps" "$LINENO" 5 +fi +if test "x$with_ld_relro_load_gaps" = xyes +then : + printf "%s\n" "#define HAVE_LD_RELRO_LOAD_GAPS 1" >>confdefs.h + +fi +config_vars="$config_vars +have-ld-relro-load-gaps = $with_ld_relro_load_gaps" + # These programs are version sensitive. for ac_prog in gnumake gmake make do diff --git a/configure.ac b/configure.ac index 7c9b57789e..e4a3ff98a4 100644 --- a/configure.ac +++ b/configure.ac @@ -535,6 +535,26 @@ case $($LD --version) in esac LIBC_CONFIG_VAR([with-lld], [$libc_cv_with_lld]) +dnl Workaround for binutils LOAD segment gaps bug (swbz#28743) +dnl Fixed in commit 9833b7757d246f22db4eb24b8e5db7eb5e05b6d9 +dnl ("PR28824, relro security issues"), part of binutils 2.39. +AC_ARG_WITH([ld_relro_load_gaps], + [AS_HELP_STRING([--with-ld-relro-load-gaps], + [support linker with RELRO LOAD segment gap bug @<:@default=check@:>@])], + [], + [: m4_divert_text([DEFAULTS], [with_ld_relro_load_gaps=check])]) +AS_IF([test "x$with_ld_relro_load_gaps" = xcheck], + [echo "Checking binutils ld version:" >&AS_MESSAGE_LOG_FD + AS_IF([LC_ALL=C $LD --version | grep -E '^GNU ld version 2\.(2[[0-9]]|3[[0-8]])[[^0-9]]' >&AS_MESSAGE_LOG_FD], + [with_ld_relro_load_gaps=yes], + [with_ld_relro_load_gaps=no + echo "(linker not binutils or not impacted)" >&AS_MESSAGE_LOG_FD])]) +AS_IF([test "x$with_ld_relro_load_gaps" != xyes && test "x$with_ld_relro_load_gaps" != xno], + AC_MSG_ERROR([invalid --with-ld-load-gaps argument: $with_ld_relro_load_gaps])) +AS_IF([test "x$with_ld_relro_load_gaps" = xyes], + [AC_DEFINE(HAVE_LD_RELRO_LOAD_GAPS)]) +LIBC_CONFIG_VAR([have-ld-relro-load-gaps], [$with_ld_relro_load_gaps]) + # These programs are version sensitive. AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version, [GNU Make[^0-9]*\([0-9][0-9.]*\)], diff --git a/elf/Makefile b/elf/Makefile index 77e211b821..03ae0a34ea 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -627,6 +627,31 @@ $(objpfx)tst-relro-libc.out: tst-relro-symbols.py $(..)/scripts/glibcelf.py \ --required=__io_vtables \ > $@ 2>&1; $(evaluate-test) +# Only test ld.so because libc.so et al. are mapped by ld.so, which +# avoids creating gaps even if they are present in the ELF file. +tests-special += $(objpfx)tst-gaps-ldso.out +tst-program-headers-invocation = \ + $(PYTHON) tst-program-headers.py \ + --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))" +$(objpfx)tst-gaps-ldso.out: tst-program-headers.py \ + $(..)/scripts/glibcelf.py $(objpfx)ld.so + $(tst-program-headers-invocation) --mode=gaps $(objpfx)ld.so \ + > $@ 2>&1; $(evaluate-test) +ifeq ($(have-ld-relro-load-gaps),yes) +# This test may fail if the linker has bug swbz#28743. +test-xfail-tst-gaps-ldso = yes +else +# Otherwise this test fails if the architecture supports multiple page sizes. +test-xfail-tst-gaps-ldso = $(shell $(tst-program-headers-invocation) --mode=gaps-xfail $(objpfx)ld.so) +endif + +tests-special += $(objpfx)tst-load-alignment.out +$(objpfx)tst-load-alignment.out: tst-program-headers.py \ + $(..)/scripts/glibcelf.py $(objpfx)ld.so $(common-objpfx)libc.so + $(tst-program-headers-invocation) --mode=alignment \ + $(objpfx)ld.so $(common-objpfx)libc.so \ + > $@ 2>&1; $(evaluate-test) + ifeq ($(run-built-tests),yes) tests-special += $(objpfx)tst-valgrind-smoke.out endif diff --git a/elf/tst-program-headers.py b/elf/tst-program-headers.py new file mode 100644 index 0000000000..1ea8982def --- /dev/null +++ b/elf/tst-program-headers.py @@ -0,0 +1,137 @@ +#!/usr/bin/python3 +# Verify properties of ELF program headers. +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +import argparse +import os.path +import sys + +# Make available glibc Python modules. +sys.path.append(os.path.join( + os.path.dirname(os.path.realpath(__file__)), os.path.pardir, 'scripts')) + +import glibcelf +import glibcextract + +def rounddown(val, align): + """Round down VAL to a multiple of ALIGN (which is a power of two).""" + assert (align & (align - 1)) == 0, align + return val & -align + +def roundup(val, align): + """Round up VAL to a multiple of ALIGN (which is a power of two).""" + assert (align & (align - 1)) == 0, align + return (val + align - 1) & -align + +errors_encountered = 0 + +def init_page_sizes(cc): + """Initializes page_size_min and page_size_max.""" + consts = glibcextract.compute_macro_consts( + source_text='#include ', + cc=cc, + macro_re='^PAGE_SIZE_.*$') + global page_size_min + page_size_min = int(consts['PAGE_SIZE_MIN']) + global page_size_max + page_size_max = int(consts['PAGE_SIZE_MAX']) + if page_size_min > page_size_max: + print('error: minimum page size {} is greater than maximum page size' + .format(page_size_min, page_size_max)) + +def check_variant_gaps(path, img): + """Check that there are no gaps between load segments.""" + print('info: mininum page size:', page_size_min) + global errors_encountered + loads = [phdr for phdr in img.phdrs() + if phdr.p_type == glibcelf.Pt.PT_LOAD] + if not loads: + # Nothing to check. + return + current_address = None + for idx, phdr in enumerate(loads): + this_address = rounddown(phdr.p_vaddr, page_size_min) + next_address = roundup(phdr.p_vaddr + phdr.p_memsz, page_size_min) + print('info: {}: LOAD segment {}: address 0x{:x}, size {},' + ' range [0x{:x},0x{:x})' + .format(path, idx, phdr.p_vaddr, phdr.p_memsz, + this_address, next_address)) + if current_address is not None: + gap = this_address - current_address + if gap != 0: + errors_encountered += 1 + print('error: {}: gap between load segments: {} bytes'.format( + path, gap)) + current_address = next_address + +def check_variant_gaps_xfail(path, img): + """Print 'yes' if the gaps test is expected to fail.""" + # This is not an actual check. + if page_size_min != page_size_max: + print('yes') + +def check_variant_alignment(path, img): + """Check that the binary can be loaded with the maximum page size.""" + print('info: maximum page size:', page_size_max) + global errors_encountered + for phdr in img.phdrs(): + if phdr.p_type != glibcelf.Pt.PT_LOAD: + continue + page_file_offset = phdr.p_offset % page_size_max + page_virtual_offset = phdr.p_vaddr % page_size_max + if page_file_offset != page_virtual_offset: + print('error: {}: LOAD segment {} cannot be loaded for page size {}' + .format(path, phdr, page_size_max)) + print('note: file offset in page:', page_file_offset) + print('note: virtual offset:', page_virtual_offset) + errors_encountered += 1 + +def main(): + """The main entry point.""" + parser = argparse.ArgumentParser( + description="Test script for analyzing ELF progam headers") + parser.add_argument('--cc', metavar='CC', + help='C compiler (including options to use)') + parser.add_argument('--mode', metavar='MODE', + choices='gaps gaps-xfail alignment'.split(), + help='ELF program header analysis to carry out') + parser.add_argument('objects', metavar='PATH', nargs='*', + help='Main programs and shared objects to process') + args = parser.parse_args() + + global errors_encountered + + if not args.cc: + print('error: missing --cc argument') + errors_encountered += 1 + if not args.mode: + print('error: missing --mode argument') + errors_encountered += 1 + + if errors_encountered == 0: + init_page_sizes(args.cc) + check = globals()['check_variant_' + args.mode.replace('-', '_')] + for path in args.objects: + check(path, glibcelf.Image.readfile(path)) + + if errors_encountered > 0: + print('note: errors encountered:', errors_encountered) + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/manual/install.texi b/manual/install.texi index 3e68a3d823..e37bb958c1 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -117,6 +117,18 @@ problem and suppress these constructs, so that the library will still be usable, but functionality may be lost---for example, you can't build a shared libc with old binutils. +@item --with-ld-relro-load-gaps=@var{choice} +If @var{choice} is @samp{yes}, assume that the linker may produce gaps +between LOAD segments when linking @code{ld.so}, related to RELRO +processing. With @samp{no}, assume that no such gaps are produced. The +default for @var{choice} is @samp{check}, which performs a version-only +linker check. The binutils linker bug in question is +@url{https://sourceware.org/bugzilla/show_bug.cgi?id=28743}. + +There is another source of LOAD segment gaps on architectures which +support multiple page sizes. The @option{--with-ld-relro-load-gaps} is +not related to that. + @item --with-nonshared-cflags=@var{cflags} Use additional compiler flags @var{cflags} to build the parts of the library which are always statically linked into applications and From patchwork Sun Sep 29 16:36:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PpCXFiCy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqby1R4gz1xt9 for ; Mon, 30 Sep 2024 02:37:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 103C4385EC25 for ; Sun, 29 Sep 2024 16:37:00 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 44112385C6E3 for ; Sun, 29 Sep 2024 16:36:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 44112385C6E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 44112385C6E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627798; cv=none; b=n4r55scC3vVuaOE5QogEWBThSrtQ8KHBs37iSYAw1TEPvipgXwi6GhJ7nGuV/0SlG4jw7T8w6L9drtbZoDGIrxiwDEjxNp7xDtrDGWr5JhBRxm6OO+uumKCTWNmlESxWmfMvMq513fQrMj+yP8nhVOM/1kZL9muTywoF8zjK8Hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627798; c=relaxed/simple; bh=HyhyzRLBdAYlo4bCIHWLGQrNQXWjqvmoQO89e0yQZ5E=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=n06WA1zBzmuZRI7e+RRw8RJhL834bCMBaEPM+BMqsXIdU2p7fz8Gu3F1gTUmwb1L6MV/HDA/BUfL1ylE2dmkYMR7hoLZh0QG2nA7I5EaV4VX/BG5MsY4jpbokastsfUl/BOwnZYEoSt1sbI2HPtomiiub3ZuhnmrmAYOKHAURCk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2uMo6qtqvLzNRYS04QYyY3nZF3WngczoZms2ipqvDwA=; b=PpCXFiCyhTO6h8Zrzy5tMTUfcuLg9c1GQoAxCELU+fZiSiLOTLzCJutRPWwOEBHuXkroEE GCBt+1dtcfEkum5AVZAgg/kmGjgHKMwU7XhSWbkIz0qovCCSX+HJx6CaQOCBHzzrNT692R 6JVXOPYONDZr7Nhxklauptoh8E7iaBU= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-Gd-PQFSmNcu_jHowPaNbWQ-1; Sun, 29 Sep 2024 12:36:34 -0400 X-MC-Unique: Gd-PQFSmNcu_jHowPaNbWQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0179719344C2 for ; Sun, 29 Sep 2024 16:36:34 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E80B19541A0 for ; Sun, 29 Sep 2024 16:36:32 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 24/29] elf: Handle ld.so with LOAD segment gaps in _dl_find_object (bug 31943) In-Reply-To: Message-ID: <86de3d1d9e32d296241d5939f1ffe07203672625.1727624528.git.fweimer@redhat.com> References: X-From-Line: 86de3d1d9e32d296241d5939f1ffe07203672625 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:36:29 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org If binutils bug 28743 is present (if HAVE_LD_RELRO_LOAD_GAPS is defined), compile in code into ld.so that checks if ld.so has such gaps, and if so, update the _dl_find_object data structures accordingly. Likewise, if the architecture supports multiple page sizes, compile in the same code to support ld.so with gaps. --- elf/dl-find_object.c | 78 ++++++++++++++++++++++++++++---------------- elf/rtld.c | 28 +++++++++++++++- 2 files changed, 77 insertions(+), 29 deletions(-) diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c index 449302eda3..997cc0078b 100644 --- a/elf/dl-find_object.c +++ b/elf/dl-find_object.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Fallback implementation of _dl_find_object. It uses a linear search, needs locking, and is not async-signal-safe. It is used in @@ -466,6 +467,38 @@ __dl_find_object (void *pc1, struct dl_find_object *result) hidden_def (__dl_find_object) weak_alias (__dl_find_object, _dl_find_object) +/* Subroutine of _dlfo_process_initial to split out noncontigous link + maps. NODELETE is the number of used _dlfo_nodelete_mappings + elements. It is incremented as needed, and the new NODELETE value + is returned. */ +static size_t +_dlfo_process_initial_noncontiguous_map (struct link_map *map, + size_t nodelete) +{ + struct dl_find_object_internal dlfo; + _dl_find_object_from_map (map, &dlfo); + + /* PT_LOAD segments for a non-contiguous link map are added to the + non-closeable mappings. */ + const ElfW(Phdr) *ph = map->l_phdr; + const ElfW(Phdr) *ph_end = map->l_phdr + map->l_phnum; + for (; ph < ph_end; ++ph) + if (ph->p_type == PT_LOAD) + { + if (_dlfo_nodelete_mappings != NULL) + { + /* Second pass only. */ + _dlfo_nodelete_mappings[nodelete] = dlfo; + _dlfo_nodelete_mappings[nodelete].map_start + = ph->p_vaddr + map->l_addr; + _dlfo_nodelete_mappings[nodelete].map_end + = _dlfo_nodelete_mappings[nodelete].map_start + ph->p_memsz; + } + ++nodelete; + } + return nodelete; +} + /* _dlfo_process_initial is called twice. First to compute the array sizes from the initial loaded mappings. Second to fill in the bases and infos arrays with the (still unsorted) data. Returns the @@ -477,29 +510,8 @@ _dlfo_process_initial (void) size_t nodelete = 0; if (!main_map->l_contiguous) - { - struct dl_find_object_internal dlfo; - _dl_find_object_from_map (main_map, &dlfo); - - /* PT_LOAD segments for a non-contiguous are added to the - non-closeable mappings. */ - for (const ElfW(Phdr) *ph = main_map->l_phdr, - *ph_end = main_map->l_phdr + main_map->l_phnum; - ph < ph_end; ++ph) - if (ph->p_type == PT_LOAD) - { - if (_dlfo_nodelete_mappings != NULL) - { - /* Second pass only. */ - _dlfo_nodelete_mappings[nodelete] = dlfo; - _dlfo_nodelete_mappings[nodelete].map_start - = ph->p_vaddr + main_map->l_addr; - _dlfo_nodelete_mappings[nodelete].map_end - = _dlfo_nodelete_mappings[nodelete].map_start + ph->p_memsz; - } - ++nodelete; - } - } + /* Contiguous case already handled in _dl_find_object_init. */ + nodelete = _dlfo_process_initial_noncontiguous_map (main_map, nodelete); size_t loaded = 0; for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns) @@ -511,11 +523,21 @@ _dlfo_process_initial (void) /* lt_library link maps are implicitly NODELETE. */ if (l->l_type == lt_library || l->l_nodelete_active) { - if (_dlfo_nodelete_mappings != NULL) - /* Second pass only. */ - _dl_find_object_from_map - (l, _dlfo_nodelete_mappings + nodelete); - ++nodelete; +#if defined SHARED && (defined HAVE_LD_RELRO_LOAD_GAPS \ + || PAGE_SIZE_MIN != PAGE_SIZE_MAX) + /* The kernel may have loaded ld.so with gaps. */ + if (!l->l_contiguous && l == &GL(dl_rtld_map)) + nodelete + = _dlfo_process_initial_noncontiguous_map (l, nodelete); + else +#endif /* HAVE_LD_RELRO_LOAD_GAPS */ + { + if (_dlfo_nodelete_mappings != NULL) + /* Second pass only. */ + _dl_find_object_from_map + (l, _dlfo_nodelete_mappings + nodelete); + ++nodelete; + } } else if (l->l_type == lt_loaded) { diff --git a/elf/rtld.c b/elf/rtld.c index 50c01b9bb4..ac64e38346 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -53,6 +53,7 @@ #include #include #include +#include #include @@ -1262,7 +1263,7 @@ rtld_setup_main_map (struct link_map *main_map) /* Set up the program header information for the dynamic linker itself. It can be accessed via _r_debug and dl_iterate_phdr - callbacks. */ + callbacks, and it is used by _dl_find_object. */ static void rtld_setup_phdr (void) { @@ -1279,6 +1280,31 @@ rtld_setup_phdr (void) GL(dl_rtld_map).l_phdr = rtld_phdr; GL(dl_rtld_map).l_phnum = rtld_ehdr->e_phnum; + GL(dl_rtld_map).l_contiguous = 1; +#if defined HAVE_LD_RELRO_LOAD_GAPS || PAGE_SIZE_MIN != PAGE_SIZE_MAX + /* The linker may not have produced a contiguous object. The kernel + will load the object with actual gaps (unlike the glibc loader + for shared objects, which always produces a contiguous mapping). + See similar logic in rtld_setup_main_map above. */ + { + ElfW(Addr) expected_load_address = 0; + for (const ElfW(Phdr) *ph = rtld_phdr; ph < &rtld_phdr[rtld_ehdr->e_phnum]; + ++ph) + if (ph->p_type == PT_LOAD) + { + ElfW(Addr) mapstart = ph->p_vaddr & ~(GLRO(dl_pagesize) - 1); + if (GL(dl_rtld_map).l_contiguous && expected_load_address != 0 + && expected_load_address != mapstart) + GL(dl_rtld_map).l_contiguous = 0; + ElfW(Addr) allocend = ph->p_vaddr + ph->p_memsz; + /* The next expected address is the page following this load + segment. */ + expected_load_address = ((allocend + GLRO(dl_pagesize) - 1) + & ~(GLRO(dl_pagesize) - 1)); + } + } +#endif /* HAVE_LD_RELRO_LOAD_GAPS */ + /* PT_GNU_RELRO is usually the last phdr. */ size_t cnt = rtld_ehdr->e_phnum; while (cnt-- > 0) From patchwork Sun Sep 29 16:36:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L9PCRObJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqcn4zHmz1xt9 for ; Mon, 30 Sep 2024 02:37:45 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BF67385EC27 for ; Sun, 29 Sep 2024 16:37:43 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 5B435385EC22 for ; Sun, 29 Sep 2024 16:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B435385EC22 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B435385EC22 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627804; cv=none; b=pFtO3PebGbH02hOx3HT14GT4R122XBuu7/LTlDg6DV+vzNWHhNrlhtvdbBqzHqhgHsDVcMRnpFy+vt0mxlz3wyQTbGSyw0Q7kcEagcHkY7lVjYuofQ8uPNARicQm1Vl5q/FfLzw7nzvJjbSQ+z/vSrPyc0AxPMA9cZSfKrlSpoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627804; c=relaxed/simple; bh=BRr2UWFCXObhlfSIcqjjsy/fqChrOSxdd21G17HtOF4=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=q60YdbkpBwO3cMxI0UzVn3BLj8v1Y5sDvTfhwJF6NTYf34ufaqZjqsHhlzSVT11UUepPrU0dZ34wLQWdBU7qQFFqd0D/5r5KInF0nWBMg1ckuoH4Gkt4az5mWGtGY6sfCzPOPaEei9gd+aP95V7FoadxggJocYAuw8hW6eFZckg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E5idQQZ8fjo5r63YzhEm8VYOKJ7CIcJDkpZzSQy+YKg=; b=L9PCRObJxivfsKxGZ2YcvFyxiGrSmXHVKmxHmQ7nMkZYuMY6y4InRJ92ARZqqTXT4BkCPV CSzycsASBSC05f83rFulP2sSEmudaTI9pxDdR0h0T85h2fNLZCBaUyM9XIJsNZ46vwRWuz GpJoMRXeDasqzO3nN9g5LhNJqKCmVls= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-2ca3FcdBNRiwt8Kay-vNmw-1; Sun, 29 Sep 2024 12:36:41 -0400 X-MC-Unique: 2ca3FcdBNRiwt8Kay-vNmw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB30319792DA for ; Sun, 29 Sep 2024 16:36:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 063CD19373D7 for ; Sun, 29 Sep 2024 16:36:39 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 25/29] Install the header file In-Reply-To: Message-ID: References: X-From-Line: cce1fcc9785e01c0c4c7198dae073d9d434ca92f Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:36:37 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org --- NEWS | 5 +++++ manual/resource.texi | 31 +++++++++++++++++++++++++++++++ misc/Makefile | 2 ++ 3 files changed, 38 insertions(+) diff --git a/NEWS b/NEWS index b1ae1c31ca..d7b522e869 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,11 @@ Major new features: * The iconv program now supports converting files in place. The program automatically uses a temporary file if required. +* The header file is now available. It contains macros + PAGE_SIZE_MIN, PAGE_SIZE_MAX, PAGE_SHIFT_MIN, PAGE_SHIFT_MAX, + reflecting the possible range of page sizes for the target + architecture. + Deprecated and removed features, and other changes affecting compatibility: * The big-endian ARC port (arceb-linux-gnu) has been removed. diff --git a/manual/resource.texi b/manual/resource.texi index 612520d4d9..32142dc103 100644 --- a/manual/resource.texi +++ b/manual/resource.texi @@ -1620,6 +1620,37 @@ different runs of the application. The function is declared in @file{unistd.h}. @end deftypefun +The header file @file{sys/pagesize.h} provides information about the +possible page sizes an architecture can support. + +@deftypevar {unsigned long int} PAGE_SIZE_MIN +@standards{GNU, sys/pagesize.h} +The smallest value that @code{getpagesize} can return on this +architecture. The pointers returned by @code{mmap} are +always a multiple of this constant (once cast to @code{uintptr_t}). +@xref{Memory-mapped I/O}. +@end deftypevar + +@deftypevar {unsigned long int} PAGE_SIZE_MAX +@standards{GNU, sys/pagesize.h} +The largest value that @code{getpagesize} can return on this +architecture. It is guaranteed that @code{mmap} can create +mappings at file offsets that are multiples of this constants. +@xref{Memory-mapped I/O}. +@end deftypevar + +@deftypevar int PAGE_SHIFT_MIN +@standards{GNU, sys/pagesize.h} +Base-2 logarithm of @code{PAGE_SIZE_MIN}. +The @code{PAGE_SHIFT_MIN} lowest bits of pointers +returned by @code{mmap} are always zero. +@end deftypevar + +@deftypevar int PAGE_SHIFT_MAX +@standards{GNU, sys/pagesize.h} +Base-2 logarithm of @code{PAGE_SIZE_MAX}. +@end deftypevar + Widely available on @w{System V} derived systems is a method to get information about the physical memory the system has. The call diff --git a/misc/Makefile b/misc/Makefile index 4250b789d1..ff10b3763e 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -79,6 +79,8 @@ headers := \ bits/err-ldbl.h \ bits/error-ldbl.h \ sys/single_threaded.h \ + bits/pagesize.h \ + sys/pagesize.h \ # headers routines := \ From patchwork Sun Sep 29 16:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eqbopadB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqn65m0hz1xt8 for ; Mon, 30 Sep 2024 02:44:58 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 749FF385DDDB for ; Sun, 29 Sep 2024 16:44:56 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 5F4C8385DDDB for ; Sun, 29 Sep 2024 16:44:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F4C8385DDDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5F4C8385DDDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628282; cv=none; b=sH0pRUjwgMABIs6PzVz5HTVEIJ1sugFgZ+pi/r8xLlE2zfiJsq1WhRlzk66tbqX/K8jB1KIkQg2ivXvZeNpkUi+X/9IwZWF3XilVp9R7qB1xYec+18tMP7SJeZsOci/LT1ZlXloCOTp6fiLvjWzW3ncIjUzQwFDYrZvQeLHxb8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628282; c=relaxed/simple; bh=9ny0j/JxnSAwy6ktmZZJ9x7nCkp/9/8o57lbJK9tW6k=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=Pik8QQW2E4pIHTFfNKOPKnqtOX9SPMNjnMI/loBaaWz2U3ypfgcc68eMw22vBYDPGilVdVHBOr/kZdwiQnOTUz6Rk0kQEniSwkFTl+FY0362955glDc5/0orQuKS+S5BJvlOFW7/DyU2OV3GgoPZ6Ho6YaqbOolm6X/gy6JBxJs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727628280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B4MxRXWDtFM+h+zDmMW2uUzKSe0tB24lkDQtxs0Zbew=; b=eqbopadBxqRPkvN7KD69He+wX/SmOd3rZe+ylzSlYH2+bjVwZHOL5Mbv220DWzbMqJPrrM /udbVzUjun6hHJRVupdzAhRyFzrUN/FFHo4p5WP3EDDVE0ImmSvqrdfG3k88mvZgxcmYz9 yDVZksptdIcei6+IDfd8VFX1Mr/ktpo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-uQx9GK42OvOFSEUkJL6hKQ-1; Sun, 29 Sep 2024 12:44:38 -0400 X-MC-Unique: uQx9GK42OvOFSEUkJL6hKQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E45B18F49B7 for ; Sun, 29 Sep 2024 16:44:38 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1ABD31979060 for ; Sun, 29 Sep 2024 16:44:36 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 26/29] Linux: Optimize getpagesize using In-Reply-To: Message-ID: References: X-From-Line: a4b61975d55c0ea13d3251391cde52bc9632dbdc Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:44:34 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org --- sysdeps/unix/sysv/linux/getpagesize.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/unix/sysv/linux/getpagesize.c b/sysdeps/unix/sysv/linux/getpagesize.c index dd5e6fcf6c..dec68b3200 100644 --- a/sysdeps/unix/sysv/linux/getpagesize.c +++ b/sysdeps/unix/sysv/linux/getpagesize.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -25,8 +26,12 @@ int __getpagesize (void) { +#if PAGE_SIZE_MIN == PAGE_SIZE_MAX + return PAGE_SIZE_MIN; +#else assert (GLRO(dl_pagesize) != 0); return GLRO(dl_pagesize); +#endif } libc_hidden_def (__getpagesize) weak_alias (__getpagesize, getpagesize) From patchwork Sun Sep 29 16:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990624 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JFHNaqJE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqnr3h12z1xt8 for ; Mon, 30 Sep 2024 02:45:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A922385E83F for ; Sun, 29 Sep 2024 16:45:34 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1BEFC385EC1D for ; Sun, 29 Sep 2024 16:45:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BEFC385EC1D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1BEFC385EC1D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628316; cv=none; b=dI/DSc73JV8Q7pmasIMN+vVqx+Ssrpf2KqY5ngFR3QwgyyxJENLK2BdMqA35EU2dmU5WRjqmexGM8i74HNKyCCzfTD4QfpABdrnYLMX1JRZcMU1Q+LsJoRSSysiSNqafxbrRIaQmsNBDYE5QydroiVOg/vUf8QK8E3PwZP23MtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628316; c=relaxed/simple; bh=kX2oe6adTCY2c6iwMr6qZ+fmC8AZkPyspibHg29u23Q=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=p6DXlcoEGpJlk7JcxHuvaILf1tOfZtWuGnaCM4QhH45ZEd8J+4eSkNvSrIHoAJz4wcYp9gQCZhn1PZhWk9UtNQUm6MGnqxIHqTcwXHgX6aVBeFlgege6ALITb8iqsaXXuH6l+oEyIj04XtmoKO4/d4dLlmSV+nI2olO4yPR9Xas= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727628313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BPrg+m2U4LYXqHUmZG77idG7IF1ECTfgjZpo9npkZ3Y=; b=JFHNaqJEbCG9XQBi/JVogV6TP+N21Lg5BEaQpgX+1DcDOJEev8tHk3JK771z0R914mYKO0 CiC7VYxD2IoOm0VxBFjp/IhrOki+uIdKa/Vy0bj6WncAPJuJHpq83sjpTqnIptNSFr/hs0 rrcU+mqvAjmf7jxW4VCPcoyq7jSFfH4= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-9SVMp5p3PcSJW-Rvt7ckgQ-1; Sun, 29 Sep 2024 12:45:12 -0400 X-MC-Unique: 9SVMp5p3PcSJW-Rvt7ckgQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D876C190ECE8 for ; Sun, 29 Sep 2024 16:45:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 123053003E4D for ; Sun, 29 Sep 2024 16:45:10 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 27/29] malloc: Use volatile as compiler barrier in tst-memalign, tst-valloc In-Reply-To: Message-ID: References: X-From-Line: a53c320699b268fd618aaa96bc416dd51724ca22 Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:45:07 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This is a simpler way to avoid compiler warnings. Apply this to the pagesize variable as well, to enable future optimizations. --- malloc/tst-memalign.c | 17 ++++++----------- malloc/tst-valloc.c | 17 ++++++----------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c index 563f6413d2..1cfe9312dd 100644 --- a/malloc/tst-memalign.c +++ b/malloc/tst-memalign.c @@ -35,25 +35,20 @@ merror (const char *msg) static int do_test (void) { + /* Use volatile for compiler barriers, to avoid + Walloc-size-larger-than warnings. */ + volatile unsigned long int pagesize = getpagesize (); + volatile int minus1 = -1; void *p; - unsigned long pagesize = getpagesize (); - unsigned long ptrval; + unsigned long int ptrval; int save; errno = 0; DIAG_PUSH_NEEDS_COMMENT; -#if __GNUC_PREREQ (7, 0) - /* GCC 7 warns about too-large allocations; here we want to test - that they fail. */ - DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); -#endif /* An attempt to allocate a huge value should return NULL and set errno to ENOMEM. */ - p = memalign (sizeof (void *), -1); -#if __GNUC_PREREQ (7, 0) - DIAG_POP_NEEDS_COMMENT; -#endif + p = memalign (sizeof (void *), minus1); save = errno; diff --git a/malloc/tst-valloc.c b/malloc/tst-valloc.c index 9bab8c6470..b27a6c0fc0 100644 --- a/malloc/tst-valloc.c +++ b/malloc/tst-valloc.c @@ -35,25 +35,20 @@ merror (const char *msg) static int do_test (void) { + /* Use volatile for compiler barriers, to avoid + Walloc-size-larger-than warnings. */ + volatile unsigned long int pagesize = getpagesize (); + volatile int minus1 = -1; void *p; - unsigned long pagesize = getpagesize (); - unsigned long ptrval; + unsigned long int ptrval; int save; errno = 0; DIAG_PUSH_NEEDS_COMMENT; -#if __GNUC_PREREQ (7, 0) - /* GCC 7 warns about too-large allocations; here we want to test - that they fail. */ - DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than="); -#endif /* An attempt to allocate a huge value should return NULL and set errno to ENOMEM. */ - p = valloc (-1); -#if __GNUC_PREREQ (7, 0) - DIAG_POP_NEEDS_COMMENT; -#endif + p = valloc (minus1); save = errno; From patchwork Sun Sep 29 16:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=X1X3H+/v; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqp35jS2z1xt8 for ; Mon, 30 Sep 2024 02:45:47 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98C98385EC55 for ; Sun, 29 Sep 2024 16:45:45 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 3F1FB385EC1E for ; Sun, 29 Sep 2024 16:45:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F1FB385EC1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3F1FB385EC1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628327; cv=none; b=kwTH16mY/C01Dx8j95z17BgOKXu8igs/Y8+bMH/4HF2BxXuYeMp3cdI6yKfJdSU5PVkoB7CeUjPa495Mt52EzrnC3bpEfC+j7asgOo+3mS61+Y+MEcwZzr3GDjG0WLeY35CYMbRC6RlNFOmdA/b9TWnAVdm1zqOumtbRmQUjTn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628327; c=relaxed/simple; bh=QhpckRkzMt4mK5AUCj8hBZG5eStsXinQICSWndW1F3A=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=vAybtIr/8Rl+QsO+R9GjJe88Ikp8bjJZCHiC7joO+7GPzLtb6zaoyjcjhh76XDYW9TCqT0OY8UHQLOAJMhM9aZ2lnoP0NlAwaigcYkPO/yg6LuaW/9gbaW7v5GfpJCzfFbxXdRkFlRjir3lXcLZwPRsoFze8dZo8gPo/jtYQMI4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727628324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9Q/1XvWfm24cyz/GyxOnqNNbOFzPNOaoVv6Fc7yqwTU=; b=X1X3H+/vFkb2QqpX3eJKWTtF07ye5YzExxylNjgnKzczBHhOr6b+LFWZrYqabroRIH60ht 8XhLB5SgMC7sJ5632AXxrR1fNCRCgoAtFJ4Ehw8S265KN+oQKCNrygMVJFdeiCedU+Wbbb LnbWt2IxVyThlM04HM6LZ8ev+aOV+Is= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-247-DFO_vDjXNnScTrBb-fKmJg-1; Sun, 29 Sep 2024 12:45:22 -0400 X-MC-Unique: DFO_vDjXNnScTrBb-fKmJg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EED3B19344C2 for ; Sun, 29 Sep 2024 16:45:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0D2401979060 for ; Sun, 29 Sep 2024 16:45:20 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 28/29] posix: Use in tst-fnmatch3 In-Reply-To: Message-ID: <1ed97cb59a7a97c0648bf3b2d21185fdb41358ba.1727624528.git.fweimer@redhat.com> References: X-From-Line: 1ed97cb59a7a97c0648bf3b2d21185fdb41358ba Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:45:18 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org This papers over GCC PR116884 because the triggering memset is gone, and the strcpy call does not have bounds information available. Verified that the test still finds the original bug by partially reverting commit c2c6d39fab901c97c18fa3a3a3658d9dc3f7df61 ("Fix BZ 18036 buffer overflow (read past end of buffer) in internal_fnmatch"). --- posix/tst-fnmatch3.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/posix/tst-fnmatch3.c b/posix/tst-fnmatch3.c index 258ce035c4..ef51d7a0d4 100644 --- a/posix/tst-fnmatch3.c +++ b/posix/tst-fnmatch3.c @@ -20,22 +20,18 @@ #include #include #include +#include +#include -int +void do_bz18036 (void) { const char p[] = "**(!()"; - const int pagesize = getpagesize (); - - char *pattern = mmap (0, 2 * pagesize, PROT_READ|PROT_WRITE, - MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - if (pattern == MAP_FAILED) return 1; - - mprotect (pattern + pagesize, pagesize, PROT_NONE); - memset (pattern, ' ', pagesize); - strcpy (pattern, p); - - return fnmatch (pattern, p, FNM_EXTMATCH); + struct support_next_to_fault ntf + = support_next_to_fault_allocate (sizeof (p)); + strcpy (ntf.buffer, p); + TEST_COMPARE (fnmatch (ntf.buffer, p, FNM_EXTMATCH), 0); + support_next_to_fault_free (&ntf); } int @@ -45,7 +41,8 @@ do_test (void) return 1; if (fnmatch ("[a[.\0.]]", "a", 0) != FNM_NOMATCH) return 1; - return do_bz18036 (); + do_bz18036 (); + return 0; } #define TEST_FUNCTION do_test () From patchwork Sun Sep 29 16:45:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=B/M/A4tU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqp62wmdz1xt8 for ; Mon, 30 Sep 2024 02:45:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F92F385EC3A for ; Sun, 29 Sep 2024 16:45:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id E4E2A385DDDB for ; Sun, 29 Sep 2024 16:45:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E4E2A385DDDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E4E2A385DDDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628333; cv=none; b=SnbSjI1ito0hKzNafn3rlFu/P0dQJ7VPK3/fw7PJTd+trgw2qoRV1eIs1k71kXseWEdH4vxezK8onw6vXDJnTEK5QoUtzT97UOwZu9riqqVPldvJUjKV5Uk6+Qr8i9POwkHIeA462lpr5JOGu+x5dNBPGVXxCKOSTxyCTraaS2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727628333; c=relaxed/simple; bh=iv34/f2yxfI+Km1MBxL06wXaC9qfN6vT7J200QaG/q0=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=klkfXaaPo34cftbDbvRwDjRvIfI/m/DDNWu7PZ46D2ncd/kcVWAjEdZ/5pFJh0Oq+sEAwjAtYXhrxU45Q3hNSXmD74YcGAgaxz9DazydSmtnEVF7u5WJL3WnDGOEh2QsCEejT8g6wkFsbmEBu5J5XU4B7JFe1yOsVl7dh1QxD1Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727628330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ohYgmgQHHdBZ078yApEDor1N09SqkeccTi/vR74Jb0g=; b=B/M/A4tUQg5vSb2Ewdn/W6Pw0L4utUIhHIgFUF8NLofxqhEy8C3k55LIwV/w871JM4pTHH MxQUv267feh6EK0cYewIcM3SV8G3/bFov/II7Qab3vIXM9xLso6i1HF8pHx0H5AGqpaHj+ YVZ6Sl4sVB4HQJx6wQZygb88YwuO64A= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-8GduJZtdOOCrL-8wOkqScA-1; Sun, 29 Sep 2024 12:45:29 -0400 X-MC-Unique: 8GduJZtdOOCrL-8wOkqScA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9AE321953940 for ; Sun, 29 Sep 2024 16:45:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2A2E1955DCB for ; Sun, 29 Sep 2024 16:45:27 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 29/29] Optimize various ways to obtain the page size using In-Reply-To: Message-ID: <52aa57f9ba1971262b8aaa5c705b2a260e6c09eb.1727624528.git.fweimer@redhat.com> References: X-From-Line: 52aa57f9ba1971262b8aaa5c705b2a260e6c09eb Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:45:24 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org Create inline definitions of getpagesize and __getpagesize if they are constant. Expand sysconf (_SC_PAGE_SIZE) inline if possible. --- bits/shm.h | 9 +++++++++ posix/unistd.h | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/bits/shm.h b/bits/shm.h index ab0864cb9c..c6a235e33d 100644 --- a/bits/shm.h +++ b/bits/shm.h @@ -20,6 +20,7 @@ #endif #include +#include /* Flags for `shmat'. */ #define SHM_RDONLY 010000 /* attach read-only else read-write */ @@ -35,6 +36,14 @@ __BEGIN_DECLS /* Segment low boundary address multiple. */ #define SHMLBA (__getpagesize ()) extern int __getpagesize (void) __THROW __attribute__ ((__const__)); +#if defined __USE_EXTERN_INLINES && defined __REDIRECT_NTH \ + && __GLIBC_PAGE_SHIFT_MIN == __GLIBC_PAGE_SHIFT_MAX +__extern_inline int +__NTH (__getpagesize (void)) +{ + return 1 << __GLIBC_PAGE_SHIFT_MIN; +} +#endif /* Type to count number of attaches. */ diff --git a/posix/unistd.h b/posix/unistd.h index 54d7d7527e..a5fa6768c9 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -639,6 +639,19 @@ extern long int fpathconf (int __fd, int __name) __THROW; /* Get the value of the system variable NAME. */ extern long int sysconf (int __name) __THROW; +#include +#if defined __USE_EXTERN_INLINES && defined __REDIRECT_NTH \ + && __GLIBC_PAGE_SHIFT_MIN == __GLIBC_PAGE_SHIFT_MAX +__extern_inline long int +__NTH (sysconf (int __name)) +{ + if (__builtin_constant_p (__name) && __name == _SC_PAGESIZE) + return 1L << __GLIBC_PAGE_SHIFT_MIN; + extern long int __REDIRECT_NTH (__sysconf_alias, (int), sysconf); + return __sysconf_alias (__name); +} +#endif /* __USE_EXTERN_INLINES */ + #ifdef __USE_POSIX2 /* Get the value of the string-valued system variable NAME. */ extern size_t confstr (int __name, char *__buf, size_t __len) __THROW @@ -1010,6 +1023,14 @@ extern void sync (void) __THROW; which is not necessarily the same as the hardware page size. */ extern int getpagesize (void) __THROW __attribute__ ((__const__)); +# if defined __USE_EXTERN_INLINES && defined __REDIRECT_NTH \ + && __GLIBC_PAGE_SHIFT_MIN == __GLIBC_PAGE_SHIFT_MAX +__extern_inline int +__NTH (getpagesize (void)) +{ + return 1 << __GLIBC_PAGE_SHIFT_MIN; +} +# endif /* Return the maximum number of file descriptors the current process could possibly have. */