From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 960BE3858C5E for ; Mon, 3 Apr 2023 10:10:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 960BE3858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-x330.google.com with SMTP id 72-20020a9d064e000000b006a2f108924cso3849370otn.1 for ; Mon, 03 Apr 2023 03:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680516652; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bSb6ZWtf+/85iifSdRKLw4ycTDgCjkNsCXgMDeWvU7I=; b=MKwiuhHx9duata9uSKJfSU0Rf0QVcZgHW/Apzkc06iIMZLBFGK4bXjiXmf+p9Fxcc6 +Q3GnP2OQnfpyfG6kQbQMTp/p3WzhUYAtx43SLlQPASiMZRZiZgZwtrFVXwKJ2gv5ETF 4bu9G1BanM6I1EtFIFLqJ7sJkIr4vX/eQov1LpqqAas466f9pxq3jzvJZSgdACGf6OU1 Lmc9CJbEFYuHjf3QvOLwU014HGS1lV3x97uyjMp8G6iaiHO7u0qgaUlenM+XMO9TKAV3 Kbtu3AKX12E/u6bggudhOjcOnS8aHnOaHPYZva0a9RL5xxfrAMO/ySrAAWuKFjo9OFES mU3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680516652; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bSb6ZWtf+/85iifSdRKLw4ycTDgCjkNsCXgMDeWvU7I=; b=gUu9pt51fLCPXFtNkB85v8s+Io9mEQtPQ2Uk4d5hn+4tKwmVQQ6kgscPkth6LzSLah uJ0EQwklHlPuQ4JTk5BHZjhgCZepNC/QdttGvockfGEStv2YXtPb1zNRbIFOvGS3wf/A 7rRn+T054Ny69JLkanz5/w1mkM3udSvppkwIzGZ/Kh1Q0Sm5HMMBuoqAT7OsgK73FC+l OMGnOEYdt9Ppi29fMc0iQ+Cd4SqDQ0NY8nsDowGUwMQbcmVVjBz4T1Ux/y1yKnqdky9x LhzVjRux79CObPpa54p2xeDKaQPoqWunrASaYqqub2oRHEJKpkkKe4ADX103gHd4Uv40 m4cw== X-Gm-Message-State: AO0yUKWR4ZeyftNo3Zx0EYL06oe8EgHJ1KgTTJRtha9CHeJHNb58XHSB ESAAkcQStRs9nV4KCVrCyls0iY3RHvNquBkFFDQ= X-Google-Smtp-Source: AK7set9qqzOYsbub+w8EavCjSPLQJXUJSv/EJuDs9+baD6+0khSQigC0MuHm3UiZnIV9goQvj9TbNIsQE86VdKmy5n4= X-Received: by 2002:a9d:744d:0:b0:699:7883:940d with SMTP id p13-20020a9d744d000000b006997883940dmr11448069otk.7.1680516651863; Mon, 03 Apr 2023 03:10:51 -0700 (PDT) MIME-Version: 1.0 References: <20230319151017.531737-1-bugaevc@gmail.com> <20230319151017.531737-14-bugaevc@gmail.com> <20230402230934.djvtyoh5dayv23c2@begin> In-Reply-To: <20230402230934.djvtyoh5dayv23c2@begin> From: Sergey Bugaev Date: Mon, 3 Apr 2023 13:10:40 +0300 Message-ID: Subject: Re: [RFC PATCH glibc 13/34] x86-64: Disable prefer_map_32bit_exec tunable on non-Linux To: Samuel Thibault Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org, "H.J. Lu" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Mon, Apr 3, 2023 at 2:09=E2=80=AFAM Samuel Thibault wrote: > Sergey Bugaev, le dim. 19 mars 2023 18:09:56 +0300, a ecrit: > > While we could/should implement MAP_32BIT for the Hurd port by setting > > all the high bits of mask in a vm_map () call, neither MAP_32BIT nor > > glibc.cpu.prefer_map_32bit_exec exist on the Hurd as of now. Compile > > this code out to fix build failures. > > Rather use defined(MAP_32BIT)? That way it will nicely work for BSD > ports as well, and when hurd eventually supports MAP_32BIT. Not really. What breaks compilation here is not missing MAP_32BIT, but rather the undefined set_prefer_map_32bit_exec tunable. It is defined declaratively in sysdeps/unix/sysv/linux/x86_64/64/dl-tunables.list (see commit 317f1c0a8a71a862b1e600ff5386b08e02cf4b95); so as-is, it really is x86_64 Linux specific. Is there some way to check if a specific tunable is defined, like #if HAVE_TUNABLE (prefer_map_32bit_exec)? AFAICS the generated dl-tunable-list.h defines the C enum members, but not any checkable preprocessor macros. Alternatively: maybe this part of cpu-features.c should be moved into sysdeps/unix/sysv/linux/x86_64/64/cpu-features.c and #include_next the common cpu-features.c? Sergey