On 11/27/2018 02:36 PM, Thomas Gleixner wrote: >> >> We need this special handling only if the next task has TIF_SPEC_UPDATE >> set, which is one-off event globally (when seccomp marks all its threads >> so due to seccomp filter change), and once all the TIF_SPEC_UPDATE tasks >> schedule at least once, we're in a consistent state again and don't need >> this, as every running task will then have its TIF consistent with MSR >> value. > > And how so? You set the bits is spec_flags. And then you set the TIF_UPDATE > bit which is evaluated once. > > Then you OR the bits into tifp which is a local variable and has nothing to > do with the TIF flags of the next task. So on the next context switch this > will evaluate the previous state of the TIF bits and you could have spared > the whole exercise :) >
This is better than my original implementation which was racy. Using task_spec_ssb_disable and task_spec_ib_disable to update TIF_* flags at context switch time makes the update logic very clear and extensible. Thanks. Tim