lkml.org 
[lkml]   [2022]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 14/29] x86/ibt: Add IBT feature, MSR and #CP handling
Date
On Fri, 2022-02-18 at 17:49 +0100, Peter Zijlstra wrote:
> +static __always_inline void setup_cet(struct cpuinfo_x86 *c)
> +{
> + u64 msr;
> +
> + if (!IS_ENABLED(CONFIG_X86_IBT) ||
> + !cpu_feature_enabled(X86_FEATURE_IBT))
> + return;
> +
> + cr4_set_bits(X86_CR4_CET);
> +
> + rdmsrl(MSR_IA32_S_CET, msr);
> + if (cpu_feature_enabled(X86_FEATURE_IBT))

It must be true because of the above check.

> + msr |= CET_ENDBR_EN;
> + wrmsrl(MSR_IA32_S_CET, msr);
> +
> + if (!ibt_selftest()) {
> + pr_err("IBT selftest: Failed!\n");
> + setup_clear_cpu_cap(X86_FEATURE_IBT);
> + }
> +}
> +
\
 
 \ /
  Last update: 2022-02-19 02:21    [W:0.468 / U:1.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site