lkml.org 
[lkml]   [2018]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch v5 08/16] smt: Create cpu_smt_enabled static key for SMT specific code
Tim,

On Mon, 19 Nov 2018, Tim Chen wrote:
> On 11/19/2018 06:57 AM, Peter Zijlstra wrote:
> > In particular, the SMT topology bits are set before we enable
> > interrrupts and similarly, are cleared after we disable interrupts for
> > the last time and die.
>
>
> Peter & Thomas,
>
> Any objection if I export sched_smt_present after including
> Peter's patch and use it in spec_ctrl_update_msr instead.
>
> Something like this?

>
> +#ifdef CONFIG_SCHED_SMT
> +
> +extern struct static_key_false sched_smt_present;
> +
> +static inline bool cpu_smt_present(void)
> +{
> + if (static_branch_unlikely(&sched_smt_present))
> + return true;
> + else
> + return false;

What's wrong with

return static_branch_unlikely(&sched_smt_present);

???

But that's just a stylistic nitpick. The real issue is that you prevent the
mitigation when CONFIG_SCHED_SMT=n.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-11-19 20:03    [W:0.611 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site