From patchwork Wed Dec 20 00:04:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 82535 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31C37385E00E for ; Wed, 20 Dec 2023 00:05:11 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 94BA3385842F for ; Wed, 20 Dec 2023 00:04:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94BA3385842F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94BA3385842F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703030697; cv=none; b=Ot2863YOwdiFpm7ORTmZIpkrkEpdBi+TZJ8Q6Ecow0Dc4VBk0lNmBtnbg7o9WBsDwA2Tv4ObCXJxcxiEnvtDbvJrjcef3o0ZxPqazRFgTH8NRJXI552lZmTZc5WEDgCMhdSOibLjivAh4VWSKr5UGMqSE9to4Vw82pAw1j5HU2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703030697; c=relaxed/simple; bh=DwscVyUNtFXdPjD3NMLsIl5z68WZWWC+4lnVAcWCJMM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GN7WwDA2HBomc8lCaM08y7o4oGacEta0A5VFtzN1EjWtCv34rua49IJP0Keto9oB0MNyanNQAhgvZu9FKaldtlqHPETJ6POe6BHEhJwM8WkzClHqEZ+RutSenmkRW+YpToXlEX06+kcH8DDZ+YaAAIDVsqzpfSAbkea5VXmHJgI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6d9338bc11fso1076698b3a.1 for ; Tue, 19 Dec 2023 16:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703030694; x=1703635494; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=N4ULE9DeILidI1YOAo9mDp05Tftj9uKrs5O3yk/gR24=; b=g/HpDMu47sj3YSOdVtDC2Wsr/fFo5AgyUIRPwaYDP6KTPDVZGkomUhydzftJ4tz0TH MO2Vpm6Zm4nsbCbq9IbQK58b6mxJVe/Uqaw3kG0+sLaNAGoNYbyMwpSsChHScT8tgWf1 bcD63jOcIx/7qk4r8tk9xZ48Q/FcqSRxi/DCQijuzht7DaQvxHcIu7FqfAlWfGCaBGG9 RZiujZLCRgx1JbmSsBKKBOpvNU5d7/iqoGnUuR3Ki/XWpImSJqUv6dXakrcVkssJqZC6 bUB1oAPyvnHUYXjgxrba6nv32MBjQt1fj5bR49DEkL5jQH0KiHnX1Y5RpgwNgEYZ0I+c +bqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703030694; x=1703635494; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N4ULE9DeILidI1YOAo9mDp05Tftj9uKrs5O3yk/gR24=; b=Do2L3px9Fr7JQGr7CWq0cHyr4rkzE1y7TMpo8Vodsk8eIbTklQ+84wljUWLFgSKW2e +RF1aR4rV0n/+EX0fTGdvVQSIyoHvY3am4CB4mockVfEC/kMootxDHmfNUNuML6LYfwu bw5zbcdBRW3wjfUfUlKzUqRFWjWCOCCe0omuSjdIRX+Q5P0zrNEO78XNHHEWCY4ZnOCu n54n3Zm/DwlLu5r6uA1YOvL4DqMDlCcn+6KcAanjfY0BX8c8bf/PK6MyLOfKReDcTpB8 Zz5YM+JbzcaiiRP0A4+yuUckdxIOqhvr2pGofcdRT3E72XhdKTBvrkdD2w4KjGMz1Dbn qJDw== X-Gm-Message-State: AOJu0Yx5rhc8sfyXsjgiT1xjY16blDaGbHbyFMUg0xS0HvQhgW8e+eY3 hNOOGqbWRPKffhf6Efcce7fkkr/7xlk= X-Google-Smtp-Source: AGHT+IFFZb0r9BRzmSB8BaeFHgLml1MYg/wVIdn0+SkJa6O6V+deHQpyj2I+FabXP8cZ9FUFiBREig== X-Received: by 2002:a17:902:e551:b0:1d3:dda1:f16b with SMTP id n17-20020a170902e55100b001d3dda1f16bmr2010991plf.9.1703030694131; Tue, 19 Dec 2023 16:04:54 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.59.129.147]) by smtp.gmail.com with ESMTPSA id b23-20020a170902b61700b001d0ca40158dsm21447711pls.280.2023.12.19.16.04.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 16:04:51 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id E63EB7402D2 for ; Tue, 19 Dec 2023 16:04:48 -0800 (PST) From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH] Fix elf: Do not duplicate the GLIBC_TUNABLES string Date: Tue, 19 Dec 2023 16:04:48 -0800 Message-ID: <20231220000448.1420614-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3024.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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+patchwork=sourceware.org@sourceware.org commit 2a969b53c0b02fed7e43473a92f219d737fd217a Author: Adhemerval Zanella Date: Wed Dec 6 10:24:01 2023 -0300 elf: Do not duplicate the GLIBC_TUNABLES string has @@ -38,7 +39,7 @@ which isn't available. */ #define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len) \ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \ - if (memcmp (f, #name, len) == 0) \ + if (tunable_str_comma_strcmp_cte (&f, #name) == 0) \ { \ cpu_features->preferred[index_arch_##name] \ &= ~bit_arch_##name; \ @@ -46,12 +47,11 @@ Fix it by removing "== 0" after tunable_str_comma_strcmp_cte. --- sysdeps/x86/cpu-tunables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c index ef96148d30..142c6b9240 100644 --- a/sysdeps/x86/cpu-tunables.c +++ b/sysdeps/x86/cpu-tunables.c @@ -39,7 +39,7 @@ which isn't available. */ #define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len) \ _Static_assert (sizeof (#name) - 1 == len, #name " != " #len); \ - if (tunable_str_comma_strcmp_cte (&f, #name) == 0) \ + if (tunable_str_comma_strcmp_cte (&f, #name)) \ { \ cpu_features->preferred[index_arch_##name] \ &= ~bit_arch_##name; \