public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: H.J. Lu <hjl@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/release/2.33/master] x86: Copy IBT and SHSTK usable only if CET is enabled Date: Tue, 1 Feb 2022 14:03:54 +0000 (GMT) [thread overview] Message-ID: <20220201140354.046A138515E5@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5cb6edb6cd193d4b0462c718f4b6071f8b84ff90 commit 5cb6edb6cd193d4b0462c718f4b6071f8b84ff90 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Jun 23 14:27:58 2021 -0700 x86: Copy IBT and SHSTK usable only if CET is enabled IBT and SHSTK usable bits are copied from CPUID feature bits and later cleared if kernel doesn't support CET. Copy IBT and SHSTK usable only if CET is enabled so that they aren't set on CET capable processors with non-CET enabled glibc. (cherry picked from commit ea26ff03227d7cacef5de6036df57734373449b4) Diff: --- sysdeps/x86/cpu-features.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index dfad82f14c..7a524dbae6 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -75,7 +75,6 @@ update_usable (struct cpu_features *cpu_features) CPU_FEATURE_SET_USABLE (cpu_features, PREFETCHWT1); CPU_FEATURE_SET_USABLE (cpu_features, OSPKE); CPU_FEATURE_SET_USABLE (cpu_features, WAITPKG); - CPU_FEATURE_SET_USABLE (cpu_features, SHSTK); CPU_FEATURE_SET_USABLE (cpu_features, GFNI); CPU_FEATURE_SET_USABLE (cpu_features, RDPID); CPU_FEATURE_SET_USABLE (cpu_features, RDRAND); @@ -85,7 +84,6 @@ update_usable (struct cpu_features *cpu_features) CPU_FEATURE_SET_USABLE (cpu_features, FSRM); CPU_FEATURE_SET_USABLE (cpu_features, SERIALIZE); CPU_FEATURE_SET_USABLE (cpu_features, TSXLDTRK); - CPU_FEATURE_SET_USABLE (cpu_features, IBT); CPU_FEATURE_SET_USABLE (cpu_features, LAHF64_SAHF64); CPU_FEATURE_SET_USABLE (cpu_features, LZCNT); CPU_FEATURE_SET_USABLE (cpu_features, SSE4A); @@ -97,6 +95,11 @@ update_usable (struct cpu_features *cpu_features) CPU_FEATURE_SET_USABLE (cpu_features, FSRS); CPU_FEATURE_SET_USABLE (cpu_features, FSRCS); +#if CET_ENABLED + CPU_FEATURE_SET_USABLE (cpu_features, IBT); + CPU_FEATURE_SET_USABLE (cpu_features, SHSTK); +#endif + /* Can we call xgetbv? */ if (CPU_FEATURES_CPU_P (cpu_features, OSXSAVE)) {
reply other threads:[~2022-02-01 14:03 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=20220201140354.046A138515E5@sourceware.org \ --to=hjl@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).