From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 61A353858D28 for ; Mon, 11 Dec 2023 09:06:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61A353858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 61A353858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702285578; cv=none; b=tpKWtAOb1wuzjpHaDD/fDUkV3GFMLeO8veBUjh2nlnfIVLQaO7bZ0oxNJQePwAQ+N65larF0SwYcV08QVWKQA4Uwl+bssrplN7Nl8OQJFuIGNsa65yBrIqIc+N21m2AabQXH8U0bJd9SMG1X7NBaJ78Q7Tet6mBl8W3fN8rQVls= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702285578; c=relaxed/simple; bh=FmBMAdPurLhcsLAdFdRME/pUyDR1liNc8sgk19D1+H0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=urZLjzWLuCr70F5qJ2qS7L+DezMlymuIPMvY+xfofrbmCQmPlVfvxe7wwRXNzuwfUMtZTT74YhnoCN/zh7FLyDB1VXO+SrWahLwW1m658rbbKDvMa7XuEta/Yprn5bOV00QDcOimYiw6lh56NGd6xAjJTaSgrluBMGaKEQlaDds= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702285576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=magxBbL/6uqX4B0UHmm7y8n7DU7h61onPeMuWxJQ6og=; b=KlVvg6M/ivFKPVQgQ3whLW7nwqeiDRzEeLSwCpQ11ZEpKIeLpGpQOTc6gU8hhzR1b7jDd2 T8chSv8gl3+EflmSnU/J+SBFcoyN3ZKVtBwujBXLJ+/+tZWFRBoyAFCmnBHTC1LEwEwSWN 0+LEDA3ehL6R3j8AKhxza4a+3emQJk8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-dreUwChrOgyGfjmsKI_rHQ-1; Mon, 11 Dec 2023 04:06:14 -0500 X-MC-Unique: dreUwChrOgyGfjmsKI_rHQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D14E6185A781; Mon, 11 Dec 2023 09:06:13 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03A632166B31; Mon, 11 Dec 2023 09:06:12 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2 0/2] Generic x86-64 CPU diagnostics dumper References: <10f99f73-7722-4329-ada3-07ffe2b9e170@linaro.org> <87bkb2i3zr.fsf@oldenburg.str.redhat.com> <01a1405d-d89f-4cc1-b466-65916b683caf@linaro.org> Date: Mon, 11 Dec 2023 10:06:11 +0100 In-Reply-To: <01a1405d-d89f-4cc1-b466-65916b683caf@linaro.org> (Adhemerval Zanella Netto's message of "Thu, 7 Dec 2023 10:11:57 -0300") Message-ID: <87o7ext8fw.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * Adhemerval Zanella Netto: > On 07/12/23 09:36, Florian Weimer wrote: >> * Adhemerval Zanella Netto: >> >>> On 07/12/23 08:05, Florian Weimer wrote: >>>> This is an unchanged repost after a rebase. >>>> >>>> I hope to get this integrated so that I can work on further CPU >>>> compatibility diagnostics. The intent behind those is to give >>>> distributions better built-in tools to diagnose compatibility issues >>>> after they incorporate CPU-specific optimizations. >>> >>> What I would expect from ld.so --list-diagnostics was to dump some >>> relevant information used on ifunc and other optimizations selection, >>> with some meaningful text on the queried data from the kernel/CPU and >>> which function would be selected based on the obtained information. >> >> We don't know what GCC (__builtin_cpu_supports etc.) bases its selection >> on because it does not use the glibc interfaces. Even if we restricted >> this to other toolchain usage, we'd end up having to update it alongside >> GCC changes that add more selection logic. The generic dumper avoids >> that. >> >> Even inside glibc, we have logic that looks at CPUID data that is >> currently not captured in the dumps. > > But my understanding is --list-diagnostics should be limited to own > glibc selection; it does not make much sense to trying to sync with > other interfaces (__builtin_cpu_supports) if there use a complete > different selection interface. I think we should consider the whole GNU toolchain, not just glibc. Just as in other cases. > Right, but currently --list-diagnostics dumps around 100 lines related to > x86 on my system. Although some are straightforward (like cache size), > some are really specific to implementation detail, like the > x86.cpu_features.features vs x86.cpu_features.preferred and the preferred > fields description. Yes, and those are required to diagnose issues with IFUNC selection and other aspects of self-configuration. Even so, the current dumps are insufficient to trace how glibc comes up with the cache information for sysconf. They also do not cover asymmetric reporting across multiple cores. > Also, such information can be queries either by accessing cpuid itself > and/or with x86.h specific ABI (from x86.h). My questioning is if this > really required to be on ld.so. If we don't put it into a cross-architecture project, then we'll have to teach everyone to use the appropriate tool for gathering such data on every architecture. This makes switching between architectures more difficult. I don't think we can get non-x86 CPU support into cpuid . Thanks, Florian