From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id 6CD323857C55 for ; Fri, 18 Sep 2020 16:07:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CD323857C55 Received: by mail-pf1-x442.google.com with SMTP id k15so3719406pfc.12 for ; Fri, 18 Sep 2020 09:07:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4eIEY/QTOuSW3qJHBN+zyUViTQsML5zglBLK2GRm3lA=; b=qssc2bqhcxo5FD/63/3KIF9/KMHNcldZ4/V1MOGnxCqLOcm8bLW9hgNU82LwZ+EyWB ZRAY4KU9MO30CXc6uXphZdFu0nLATdBS95Jul0r6nfjdbeB5asvfrglUMEp3YhlNqkyR HZj8D195ytdGt88LFkAiKQzlRvNns+jnIV7+j9v+R6J39y8fiBpOe+X7gy+pP8xGRlz5 j0qm9O5Kf9W4CW6MK+HZy8rEFBE7jk9C+yUfMVo9NzJy62m44y0595uvPbIj+i+AKe89 wCLhVZU5Rhfk+iCi2mfV3QNf8k8xPEt3Ej9Wlj7+Wa4lo24TDCyc6JqRjkUYsxZJ/+kG QoWA== X-Gm-Message-State: AOAM531J3ZVmTKQu+yjAT1UfjJzGOoW1HvKv4jIH5YYGhlyhQTOn7At5 mroGDPOGzTLYos6efse0QTCxZyhmdYU= X-Google-Smtp-Source: ABdhPJy+ElCTcmeP+Jch32dsb2bbgdPbIdrXMHxhvUrh6svqYga95cPCu6nxMbcF2+N47AJpA4bNxA== X-Received: by 2002:a63:ee02:: with SMTP id e2mr2529286pgi.291.1600445231436; Fri, 18 Sep 2020 09:07:11 -0700 (PDT) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id v26sm3577963pgo.83.2020.09.18.09.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 09:07:10 -0700 (PDT) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id D0C2C1A0169; Fri, 18 Sep 2020 09:07:09 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: Florian Weimer , Carlos O'Donell Subject: V2 [PATCH 0/4] ld.so: Add --list-tunables to print tunable values Date: Fri, 18 Sep 2020 09:07:05 -0700 Message-Id: <20200918160709.949608-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.5 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, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 16:07:13 -0000 Tunable values and their minimum/maximum values are invisible to users. This patch set adds --list-tunables to ld.so to print tunable values with their minimum and maximum values. For these tunables whose values and minimum/maximum values are determinted at run-time, TUNABLE_SET_ALL and TUNABLE_SET_ALL_FULL are added to update tunable values together with their minimum and maximum values. --list-tunables works on i686 and x86-64. Please test --list-tunables on your native processors. users/hjl/tunable/master branch at: https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/tunable/master contains the same set of patches. On x86, to make cache info accessible to --list-tunables, they are moved to cpu_features in ld.so. CPU features are initialized by DL_PLATFORM_INIT in dynamic executable and by ARCH_INIT_CPU_FEATURES in static executable. To initialize CPU features and cache info when loading ld.so and libc.so inside of static executable, also initialize them by dummy function pointers via IFUNC relocation like other fields in _rtld_global_ro in ld.so. H.J. Lu (4): x86: Initialize CPU info via IFUNC relocation [BZ 26203] Set tunable value as well as min/max values x86: Move x86 processor cache info to cpu_features ld.so: Add --list-tunables to print tunable values NEWS | 2 + elf/Makefile | 8 + elf/dl-tunables.c | 53 +- elf/dl-tunables.h | 20 +- elf/rtld.c | 31 +- manual/README.tunables | 24 +- manual/tunables.texi | 37 ++ sysdeps/i386/dl-machine.h | 3 +- sysdeps/x86/cacheinfo.c | 873 ++------------------------- sysdeps/x86/cpu-cacheinfo.c | 922 +++++++++++++++++++++++++++++ sysdeps/x86/cpu-features.c | 25 +- sysdeps/x86/dl-get-cpu-features.c | 25 +- sysdeps/x86/include/cpu-features.h | 23 + sysdeps/x86_64/dl-machine.h | 3 +- 14 files changed, 1198 insertions(+), 851 deletions(-) create mode 100644 sysdeps/x86/cpu-cacheinfo.c -- 2.26.2