[PATCH] RFC: Provide a function to reset IFUNC PLTs

Florian Weimer fweimer@redhat.com
Tue Mar 7 08:40:46 GMT 2023


* 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 <sys/platform/x86.h> 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
  <https://news.opensuse.org/2023/03/02/tw-gains-optional-optimizations/>

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



More information about the Libc-alpha mailing list