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.133.124]) by sourceware.org (Postfix) with ESMTPS id 0244B3858C30 for ; Tue, 7 Mar 2023 08:40:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0244B3858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678178452; 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=aaOzIrkjImsz6Xe3aXc5h0lvoELF79dRxoEd2/2gST4=; b=Hi4/qt5EW7wbpAynxy+wDnUvqERjogcB67dbCo5UEZnwZvWL0eHAoftgZfMXmGnpxfeoq0 WshdTTzRZmcMq6Pb7luK47WJYRYyVK7en3UuweaSLkJDXvX9DX/kw7g1FewhQvcUyUn/N8 7u77O7Um18XdRVrpyFmRqS2TBYrDp88= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-MaK40fvcNBa119lI0ed2hg-1; Tue, 07 Mar 2023 03:40:49 -0500 X-MC-Unique: MaK40fvcNBa119lI0ed2hg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F392E101A5B4; Tue, 7 Mar 2023 08:40:48 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.80]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED08F400F8FA; Tue, 7 Mar 2023 08:40:47 +0000 (UTC) From: Florian Weimer To: Jan Kratochvil via Libc-alpha Cc: Jan Kratochvil , Anton Kozlov Subject: Re: [PATCH] RFC: Provide a function to reset IFUNC PLTs References: Date: Tue, 07 Mar 2023 09:40:46 +0100 In-Reply-To: (Jan Kratochvil via Libc-alpha's message of "Mon, 6 Mar 2023 09:04:34 +0100") Message-ID: <87v8jdq7ht.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.5 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_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: * Jan Kratochvil via Libc-alpha: > Some projects snapshot+restore process images to migrate them to > a different machine. The target machine may have different (particularly > lower) set of CPU features. Restored process does crash in glibc IFUNC > functions which have been already set in PLTs due to the former more > rich CPU features on the snapshotting machine. > > Providing a glibc function which can be called during the restore. > > I understand the code may need more adjustments before its upstreaming > but is this an acceptable approach? Do you have a high-level overview how this is supposed to work? Is CRIU expected to call the new _dl_reset_ifunc symbol after restore? Use of is somewhat rare. Not even GCC uses it AFAIK. It has its own cached CPU data used for target clones and similar features. Re-running those IFUNC resolvers will just give the same results. Distributions have started to deploy alternate builds in glibc-hwcaps/x86-64-v3 directories: openSUSE Tumbleweed gains optional x86-64-v3 optimization This might be a common situation fairly soon. This is not IFUNC-based at all, so any IFUNC-based approach is not going to help with that. Practically speaking, I think cluster heterogeneity needs to be hidden at the cluster level. Thanks, Florian