public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds
@ 2024-04-25 12:10 Florian Weimer
  2024-04-25 14:50 ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2024-04-25 12:10 UTC (permalink / raw)
  To: libc-alpha

At this point, this is mainly a tool for testing the early ld.so
CPU compatibility diagnostics: GCC uses the new instructions in most
functions, so it's easy to spot if some of the early code is not
built correctly.  (No such problems were flagged for the current
tree.)

---
 sysdeps/x86/dl-get-cpu-features.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c
index 4d6c5c59a6..579d02d638 100644
--- a/sysdeps/x86/dl-get-cpu-features.c
+++ b/sysdeps/x86/dl-get-cpu-features.c
@@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4);
 #    endif /* ISA level 4 */
 #   endif /* ISA level 3 */
 #  endif /* ISA level 2 */
+# ifdef GCCMACRO__APX_F__
+      if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F))
+	_dl_fatal_printf ("\
+Fatal glibc error: CPU does not support APX\n");
+# endif
 # endif /* IS_IN (rtld) */
     }
 }

base-commit: 3a3a4497421422aa854c855cbe5110ca7d598ffc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds
  2024-04-25 12:10 [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds Florian Weimer
@ 2024-04-25 14:50 ` H.J. Lu
  2024-04-25 14:57   ` H.J. Lu
  2024-04-25 14:58   ` Florian Weimer
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 2024-04-25 14:50 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Thu, Apr 25, 2024 at 5:11 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> At this point, this is mainly a tool for testing the early ld.so
> CPU compatibility diagnostics: GCC uses the new instructions in most
> functions, so it's easy to spot if some of the early code is not
> built correctly.  (No such problems were flagged for the current
> tree.)
>
> ---
>  sysdeps/x86/dl-get-cpu-features.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c
> index 4d6c5c59a6..579d02d638 100644
> --- a/sysdeps/x86/dl-get-cpu-features.c
> +++ b/sysdeps/x86/dl-get-cpu-features.c
> @@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4);
>  #    endif /* ISA level 4 */
>  #   endif /* ISA level 3 */
>  #  endif /* ISA level 2 */
> +# ifdef GCCMACRO__APX_F__
> +      if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F))
> +       _dl_fatal_printf ("\
> +Fatal glibc error: CPU does not support APX\n");
> +# endif
>  # endif /* IS_IN (rtld) */
>      }
>  }
>
> base-commit: 3a3a4497421422aa854c855cbe5110ca7d598ffc
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

BTW, this patch:

https://patchwork.sourceware.org/project/glibc/list/?series=33161

is also required.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds
  2024-04-25 14:50 ` H.J. Lu
@ 2024-04-25 14:57   ` H.J. Lu
  2024-04-25 14:58   ` Florian Weimer
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2024-04-25 14:57 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha

On Thu, Apr 25, 2024 at 7:50 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Apr 25, 2024 at 5:11 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > At this point, this is mainly a tool for testing the early ld.so
> > CPU compatibility diagnostics: GCC uses the new instructions in most
> > functions, so it's easy to spot if some of the early code is not
> > built correctly.  (No such problems were flagged for the current
> > tree.)
> >
> > ---
> >  sysdeps/x86/dl-get-cpu-features.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c
> > index 4d6c5c59a6..579d02d638 100644
> > --- a/sysdeps/x86/dl-get-cpu-features.c
> > +++ b/sysdeps/x86/dl-get-cpu-features.c
> > @@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4);
> >  #    endif /* ISA level 4 */
> >  #   endif /* ISA level 3 */
> >  #  endif /* ISA level 2 */
> > +# ifdef GCCMACRO__APX_F__
> > +      if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F))
> > +       _dl_fatal_printf ("\
> > +Fatal glibc error: CPU does not support APX\n");
> > +# endif
> >  # endif /* IS_IN (rtld) */
> >      }
> >  }
> >
> > base-commit: 3a3a4497421422aa854c855cbe5110ca7d598ffc
> >
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
>
> BTW, this patch:
>
> https://patchwork.sourceware.org/project/glibc/list/?series=33161

The v2 patch:

https://patchwork.sourceware.org/project/glibc/list/?series=33162

to keep # in gdb backtrace.

> is also required.
>
> Thanks.
>
> --
> H.J.



-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds
  2024-04-25 14:50 ` H.J. Lu
  2024-04-25 14:57   ` H.J. Lu
@ 2024-04-25 14:58   ` Florian Weimer
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2024-04-25 14:58 UTC (permalink / raw)
  To: H.J. Lu; +Cc: libc-alpha

* H. J. Lu:

> On Thu, Apr 25, 2024 at 5:11 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> At this point, this is mainly a tool for testing the early ld.so
>> CPU compatibility diagnostics: GCC uses the new instructions in most
>> functions, so it's easy to spot if some of the early code is not
>> built correctly.  (No such problems were flagged for the current
>> tree.)
>>
>> ---
>>  sysdeps/x86/dl-get-cpu-features.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c
>> index 4d6c5c59a6..579d02d638 100644
>> --- a/sysdeps/x86/dl-get-cpu-features.c
>> +++ b/sysdeps/x86/dl-get-cpu-features.c
>> @@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4);
>>  #    endif /* ISA level 4 */
>>  #   endif /* ISA level 3 */
>>  #  endif /* ISA level 2 */
>> +# ifdef GCCMACRO__APX_F__
>> +      if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F))
>> +       _dl_fatal_printf ("\
>> +Fatal glibc error: CPU does not support APX\n");
>> +# endif
>>  # endif /* IS_IN (rtld) */
>>      }
>>  }
>>
>> base-commit: 3a3a4497421422aa854c855cbe5110ca7d598ffc
>>
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

> BTW, this patch:
>
> https://patchwork.sourceware.org/project/glibc/list/?series=33161
>
> is also required.

Oh, I didn't test with GLIBC_TUNABLES.  I'm going to remove the
incorrect claim from the commit message.

Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-25 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 12:10 [PATCH] x86: In ld.so, diagnose missing APX support in APX-only builds Florian Weimer
2024-04-25 14:50 ` H.J. Lu
2024-04-25 14:57   ` H.J. Lu
2024-04-25 14:58   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).