On 04/30/2018 12:36 PM, speck for Thomas Gleixner wrote: > On Mon, 30 Apr 2018, speck for Tim Chen wrote: > >> On 04/29/2018 12:31 PM, speck for Thomas Gleixner wrote: >> >>> +static int sbb_prctl_set(unsigned long ctrl) >>> +{ >>> + bool rds = !!test_tsk_thread_flag(current, TIF_RDS); >>> + >>> + if (ssb_mode != SPEC_STORE_BYPASS_PRCTL) >>> + return -ENXIO; >> >> Perhaps we should not use the prctl if we don't have >> the SSB bug. Something like: >> >> if (ssb_mode != SPEC_STORE_BYPASS_PRCTL || >> !boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS)) >> return -ENXIO; > > What? If the CPU does not have the bug then the kernel does not enable > PRCTL mode at all unless > > 1) RDS is available > > AND > > 2) The user enforced PRTCL mode on the kernel command line. > > So what exactly are you trying to solve? Right, we will only do the PRCTL only for the case when admin explicitly ask for it at kernel command line. We'll let the admin have the choice to do prctl, if he explicitly ask for it. Even though it is unnecessary for cpus that don't have the SSB bug and there will be some added cost in changing the MSR on context switches. Just want to clear in my mind that this is the choice we are making. Tim