From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 17F13385C6C2 for ; Tue, 11 Jun 2024 18:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 17F13385C6C2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 17F13385C6C2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718132286; cv=none; b=CdjLIRK7V5K1VmdOn13ik//X7YP9Htz7FA+xcULFgds5NlJ/9NG4bInLVF5op5TussjGPxA+cM0aPVfHoVaAm+P2PyYIU726zF54s1JLCHkZ8JyYTs/aLz6hys8u2hNYvHGp+nk00S2FQfQvyQg/9dp7+99jxDEtQ7mozYWbJS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718132286; c=relaxed/simple; bh=0rtzrYtRKKLI8EMC/29E4Dn1qxoAvWHvXQEofVbuGgM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=jWVYlSxx1B0L8ah8oCJXmAWrCK7Ki3cDtwpXEBX/UKR6NrjaLXi3huJ/wuEtF3rMCwSUA4vcmzawTLpvkB9YXrxYXz9IrBj0S497NDyZ51WefiZZtCnsaK4aZx3aIzbushMNfY9BE9ZClnLVidz7QUnWtu7z7La7vwXOr1/hbOA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-7042ee09f04so2935475b3a.0 for ; Tue, 11 Jun 2024 11:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718132283; x=1718737083; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=lqHCVoKzcWXea1LGiyvxN7MHve9LFCMbhKNdLROJAG0=; b=kPg4phGTdzJtdabER+7j48rncEeh7QzXvBTU+yxsDQKz6VDXGg4DgA5bZPqfrmBjSI EoTf7od2HAfh56qiLYM+W57448BwenndKBmcRISGKa3OMNqvIUkpW77929tJjjkhCRvf Jtf7hA/aHkDBhIN4Uzs7FVEv7h4JxB5fYL8zcAOvn9rFz09Ie6bhyD6nYoSrOC3/JHmV nVWZqM+Ozg0vlgmwHw1NE/rucQ5wCBBXaiYZ5m3d+RK0iTnToB02CGNKT3DP0IlonOxD pMStrBOeZIsjlsK2/Pjk3EW56GpDjVoIkuK345jXPiKKdliPm7E9Cye2R3smHGVsqWUc TZEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718132283; x=1718737083; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lqHCVoKzcWXea1LGiyvxN7MHve9LFCMbhKNdLROJAG0=; b=cc0Le6Vhaj70OfevCotYbage92SfkuvT0enm92UQRivn+XC+ht4UBfl8FbVjmmD8sP kpGR0L9YcuTFt51IxtZ6GT/j/QKCptf/2sjDpV7E4+bJIHR6A97z2VmOmJXUg59eJ1yn 8smV028r9AGFLR/Bhr9lDWrPWokykPu7S5jc9+B+Rk+S23OabqrH+zyE7+V6SZiZgoBp 0sj7WqCHuSlk9VA7ngZx4J6C7l81H5rXr/E0Ryet4AWJPZ/VaK0CMVuGYtmj3tvsm085 FrunZr5qke6JJyycN/Bp6wb60lTUxRDMSGj/ubNTHO9Vic/Ko/JSuK+Fj9NKunLkAEo4 PKQA== X-Forwarded-Encrypted: i=1; AJvYcCX5cjRM6NSWDPkndjdWgUmtXfflCT/NZDLjUXglc5EnpF2tj9LcJQvLx2gfJrLx67ntFJNMgWMpkmLcgudlxronu+2UJLwpcYqV X-Gm-Message-State: AOJu0YxyukCNgibtEG4KcbEx+5AcpzU9zBlcH1TH5RnDIMk1l6t0KpSf jvhcHMaRUUyF8E4l+jddH1NpiMVIhSA1iTxMe+8ZhV/D++f/AfEX701Kfh50MYg= X-Google-Smtp-Source: AGHT+IFjrBXEFA4Cw3Vcju26Fh5XJtFeJwEjscyclVvvuTxljORg0ZzxOnH3W8ZyYOfK3AYjT8z2yw== X-Received: by 2002:a05:6a20:7483:b0:1b7:bdb3:7bc6 with SMTP id adf61e73a8af0-1b7bdb384b2mr6972507637.45.1718132282885; Tue, 11 Jun 2024 11:58:02 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:c5fb:e1da:f9b7:66da:199? ([2804:1b3:a7c0:c5fb:e1da:f9b7:66da:199]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7042f11b2acsm5430590b3a.197.2024.06.11.11.58.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 11:58:01 -0700 (PDT) Message-ID: <99b22594-d7d6-4605-ae41-1adacfc4f3e7@linaro.org> Date: Tue, 11 Jun 2024 15:57:56 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 2/9] elf: Remove loading legacy hwcaps/platform entries in dynamic loader To: Stefan Liebler , libc-alpha@sourceware.org Cc: fweimer@redhat.com, devel@otheo.eu, bergner@linux.ibm.com References: <20240607114543.659306-1-stli@linux.ibm.com> <20240607114543.659306-3-stli@linux.ibm.com> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20240607114543.659306-3-stli@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_LOTSOFHASH,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 List-Id: On 07/06/24 08:42, Stefan Liebler wrote: > The legacy hwcaps mechanism was removed with glibc 2.37: > See this commit series: > - d178c67535f0d159df73843e7c18cbdb39b4d25d > x86_64: Remove platform directory library loading test > - 6099908fb84debee4c3bcb05d88769410c2aecd1 > elf: Remove legacy hwcaps support from the dynamic loader > - b78ff5a25dc8ba9d8c6df10bb0a533254bdd193f > elf: Remove legacy hwcaps support from ldconfig > - 4a7094119ce05cadf927f52cc5d723e2195e65f9 > elf: Remove hwcap parameter from add_to_cache signature > - cfbf883db36727a84ef7929af49ef68c195b5972 > elf: Remove hwcap and bits_hwcap fields from struct cache_entry > - 78d9a1620b840deb0880686e4159eaf70708866a > Add NEWS entry for legacy hwcaps removal > - ab40f20364f4a417a63dd51fdd943742070bfe96 > elf: Remove _dl_string_hwcap > - e76369ed6371734f77f468eab097ef4e5b5db1c5 > elf: Simplify output of hwcap subdirectories in ld.so help > > According to Florian Weimer, this was an oversight and should also > have been removed. > > As ldconfig does not generate ld.so.cache entries with hwcap/platform > bits in the hwcap-field anymore, this patch now skips those entries. > Thus currently only named-hwcap-entries and the default entries are > allowed. > For named-hwcap entries bit 62 is set and also the isa-level bits can > be set. > For the default entries the hwcap-field is 0. LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > elf/dl-cache.c | 22 +++------------------- > 1 file changed, 3 insertions(+), 19 deletions(-) > > diff --git a/elf/dl-cache.c b/elf/dl-cache.c > index 85f3f179ed..7c7dc58745 100644 > --- a/elf/dl-cache.c > +++ b/elf/dl-cache.c > @@ -27,10 +27,6 @@ > #include > #include > > -#ifndef _DL_PLATFORMS_COUNT > -# define _DL_PLATFORMS_COUNT 0 > -#endif > - > /* This is the starting address and the size of the mmap()ed file. */ > static struct cache_file *cache; > static struct cache_file_new *cache_new; > @@ -201,15 +197,6 @@ search_cache (const char *string_table, uint32_t string_table_size, > struct file_entry *libs, uint32_t nlibs, uint32_t entry_size, > const char *name) > { > - /* Used by the HWCAP check in the struct file_entry_new case. */ > - uint64_t platform = _dl_string_platform (GLRO (dl_platform)); > - if (platform != (uint64_t) -1) > - platform = 1ULL << platform; > - uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL); > -#define _DL_HWCAP_TLS_MASK (1LL << 63) > - uint64_t hwcap_exclude = ~((GLRO (dl_hwcap) & hwcap_mask) > - | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK); > - > int left = 0; > int right = nlibs - 1; > const char *best = NULL; > @@ -295,12 +282,9 @@ search_cache (const char *string_table, uint32_t string_table_size, > if (!named_hwcap && best != NULL) > break; > > - if ((libnew->hwcap & hwcap_exclude) && !named_hwcap) > - continue; > - if (_DL_PLATFORMS_COUNT > - && (libnew->hwcap & _DL_HWCAP_PLATFORM) != 0 > - && ((libnew->hwcap & _DL_HWCAP_PLATFORM) > - != platform)) > + /* Skip entries with the legacy hwcap/platform mechanism > + which was removed with glibc 2.37. */ > + if (!named_hwcap && libnew->hwcap != 0) > continue; > > #ifdef SHARED