public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/fw/x86-diagnostics] x86: Introduce _dl_x86_init_cpu_failure for startup failure reporting Date: Fri, 7 Jun 2024 14:44:23 +0000 (GMT) [thread overview] Message-ID: <20240607144423.3FB4D396B22C@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=815c04826929e41e350f9e1f8e0d297725d14064 commit 815c04826929e41e350f9e1f8e0d297725d14064 Author: Florian Weimer <fweimer@redhat.com> Date: Tue May 28 09:04:24 2024 +0200 x86: Introduce _dl_x86_init_cpu_failure for startup failure reporting Diff: --- sysdeps/x86/dl-get-cpu-features.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sysdeps/x86/dl-get-cpu-features.c b/sysdeps/x86/dl-get-cpu-features.c index 579d02d638..f36d42d6af 100644 --- a/sysdeps/x86/dl-get-cpu-features.c +++ b/sysdeps/x86/dl-get-cpu-features.c @@ -32,6 +32,17 @@ extern void __x86_cpu_features (void) attribute_hidden; void (*const __x86_cpu_features_p) (void) attribute_hidden = __x86_cpu_features; +_Noreturn static void __attribute__ ((unused)) +_dl_x86_init_cpu_failure (const struct cpu_features *cpu_features, int level) +{ + if (level == 5) + _dl_fatal_printf ("\ +Fatal glibc error: CPU does not support APX\n"); + else + _dl_fatal_printf ("\ +Fatal glibc error: CPU does not support x86-64-v%d\n", level); +} + void _dl_x86_init_cpu_features (void) { @@ -47,27 +58,23 @@ _dl_x86_init_cpu_features (void) && defined GCCMACRO__SSE3__ && defined GCCMACRO__SSSE3__ \ && defined GCCMACRO__SSE4_1__ && defined GCCMACRO__SSE4_2__ if (!(cpu_features->isa_1 & GNU_PROPERTY_X86_ISA_1_V2)) - _dl_fatal_printf ("\ -Fatal glibc error: CPU does not support x86-64-v%d\n", 2); + _dl_x86_init_cpu_failure (cpu_features, 2); # if defined GCCMACRO__AVX__ && defined GCCMACRO__AVX2__ \ && defined GCCMACRO__F16C__ && defined GCCMACRO__FMA__ \ && defined GCCMACRO__LZCNT__ && defined HAVE_X86_MOVBE if (!(cpu_features->isa_1 & GNU_PROPERTY_X86_ISA_1_V3)) - _dl_fatal_printf ("\ -Fatal glibc error: CPU does not support x86-64-v%d\n", 3); + _dl_x86_init_cpu_failure (cpu_features, 3); # if defined GCCMACRO__AVX512F__ && defined GCCMACRO__AVX512BW__ \ && defined GCCMACRO__AVX512CD__ && defined GCCMACRO__AVX512DQ__ \ && defined GCCMACRO__AVX512VL__ if (!(cpu_features->isa_1 & GNU_PROPERTY_X86_ISA_1_V4)) - _dl_fatal_printf ("\ -Fatal glibc error: CPU does not support x86-64-v%d\n", 4); + _dl_x86_init_cpu_failure (cpu_features, 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"); + _dl_x86_init_cpu_failure (cpu_features, 5); # endif # endif /* IS_IN (rtld) */ }
reply other threads:[~2024-06-07 14:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240607144423.3FB4D396B22C@sourceware.org \ --to=fw@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).