From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91574 invoked by alias); 7 Sep 2016 06:25:58 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 91561 invoked by uid 89); 7 Sep 2016 06:25:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB,SPF_NEUTRAL autolearn=no version=3.3.2 spammy=sk:init_cp, HX-HELO:sk:homiema X-HELO: homiemail-a80.g.dreamhost.com Reply-To: siddhesh@sourceware.org Subject: Re: [PATCHv4 0/2] tunables for glibc References: <1471291484-27379-1-git-send-email-siddhesh@sourceware.org> To: "H.J. Lu" Cc: GNU C Library , Carlos O'Donell , Florian Weimer From: Siddhesh Poyarekar Message-ID: <9e066dc5-fe7e-5925-0e43-f65fb4fa41f6@sourceware.org> Date: Wed, 07 Sep 2016 06:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-09/txt/msg00102.txt.bz2 On Wednesday 24 August 2016 12:37 AM, H.J. Lu wrote: > It needs to be called before init_cpu_features on x86. I've been thinking about this and it seems that init_cpu_features is called too early and I can't call __tunables_init any earlier without impacting what it can read, i.e. __libc_enable_secure for example. So one approach to solving this could be to find a place in init-first where init_cpu_features can be called early enough and still later than __tunables_init. I haven't done a thorough analysis but it seems it can be done. However a cleaner approach seems to me to be to keep the cpu features stuff separate from the overriding and then modify the ifunc resolvers to use the overrides if necessary. That is, let the cpu features show what the cpu is actually capable of and have a separate overriding structure that is initialized later (via __init_tunables or before ifunc resolution) and used when necessary, i.e. not used for AT_SECURE executables or any other condition that may arise in future. Siddhesh