Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-10-01 Thread Peter Zijlstra
Your MUA is having trouble wrapping text at 78 chars. On Thu, Oct 01, 2020 at 09:49:30AM +1000, Singh, Balbir wrote: > So this is the change I am playing with, I don't like the idea of > killing the task, but it's better than silently not flushing, I guess > system administrators will learn

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-10-01 Thread Thomas Gleixner
On Thu, Oct 01 2020 at 10:48, Balbir Singh wrote: > On 1/10/20 9:49 am, Singh, Balbir wrote: >> >> +static void l1d_flush_kill(struct callback_head *ch) >> +{ >> +clear_ti_thread_flag(>thread_info, TIF_SPEC_L1D_FLUSH); >> +force_signal(SIGBUS); >> +} >> + >> void switch_mm(struct

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Singh, Balbir
On 1/10/20 9:49 am, Singh, Balbir wrote: > On 1/10/20 7:38 am, Thomas Gleixner wrote: > >> >> >> >> On Wed, Sep 30 2020 at 20:35, Peter Zijlstra wrote: >>> On Wed, Sep 30, 2020 at 08:00:59PM +0200, Thomas Gleixner wrote: On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: > On Wed, Sep

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Singh, Balbir
On 1/10/20 7:38 am, Thomas Gleixner wrote: > > > > On Wed, Sep 30 2020 at 20:35, Peter Zijlstra wrote: >> On Wed, Sep 30, 2020 at 08:00:59PM +0200, Thomas Gleixner wrote: >>> On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: On Wed, Sep 30, 2020 at 05:40:08PM +0200, Thomas Gleixner

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Singh, Balbir
On 1/10/20 7:38 am, Thomas Gleixner wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you can confirm the sender and know the > content is safe. > > > > On Wed, Sep 30 2020 at 20:35, Peter Zijlstra wrote: >> On Wed, Sep

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Singh, Balbir
On 1/10/20 4:00 am, Thomas Gleixner wrote: > CAUTION: This email originated from outside of the organization. Do not click > links or open attachments unless you can confirm the sender and know the > content is safe. > > > > On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: >> On Wed, Sep

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Thomas Gleixner
On Wed, Sep 30 2020 at 20:35, Peter Zijlstra wrote: > On Wed, Sep 30, 2020 at 08:00:59PM +0200, Thomas Gleixner wrote: >> On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: >> > On Wed, Sep 30, 2020 at 05:40:08PM +0200, Thomas Gleixner wrote: >> > Also, that preempt_disable() in there doesn't

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Peter Zijlstra
On Wed, Sep 30, 2020 at 08:00:59PM +0200, Thomas Gleixner wrote: > On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: > > On Wed, Sep 30, 2020 at 05:40:08PM +0200, Thomas Gleixner wrote: > > Also, that preempt_disable() in there doesn't actually do anything. > > Worse, preempt_disable();

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Thomas Gleixner
On Wed, Sep 30 2020 at 19:03, Peter Zijlstra wrote: > On Wed, Sep 30, 2020 at 05:40:08PM +0200, Thomas Gleixner wrote: > Also, that preempt_disable() in there doesn't actually do anything. > Worse, preempt_disable(); for_each_cpu(); is an anti-pattern. It mixes > static_cpu_has() and

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Peter Zijlstra
On Wed, Sep 30, 2020 at 05:40:08PM +0200, Thomas Gleixner wrote: > On Tue, Sep 29 2020 at 10:37, Peter Zijlstra wrote: > > Here, I fixed it.. > > Well, no. What Balbir is trying to do here is to establish whether a > task runs on a !SMT core. sched_smt_active() is system wide, but their > setup

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Lukas Bulwahn
On Wed, 30 Sep 2020, Thomas Gleixner wrote: > On Tue, Sep 29 2020 at 10:37, Peter Zijlstra wrote: > > Here, I fixed it.. > > Well, no. What Balbir is trying to do here is to establish whether a > task runs on a !SMT core. sched_smt_active() is system wide, but their > setup is to have a bunch

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-30 Thread Thomas Gleixner
On Tue, Sep 29 2020 at 10:37, Peter Zijlstra wrote: > Here, I fixed it.. Well, no. What Balbir is trying to do here is to establish whether a task runs on a !SMT core. sched_smt_active() is system wide, but their setup is to have a bunch of SMT enabled cores and cores where SMT is off because the

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-29 Thread Peter Zijlstra
On Tue, Sep 29, 2020 at 09:12:11AM +0200, Peter Zijlstra wrote: > On Mon, Sep 28, 2020 at 02:44:57PM +0200, Lukas Bulwahn wrote: > > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > > index 6b0f4c88b07c..90515c04d90a 100644 > > --- a/arch/x86/mm/tlb.c > > +++ b/arch/x86/mm/tlb.c > > @@ -316,7

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-29 Thread Lukas Bulwahn
On Tue, 29 Sep 2020, Peter Zijlstra wrote: > On Mon, Sep 28, 2020 at 02:44:57PM +0200, Lukas Bulwahn wrote: > > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > > index 6b0f4c88b07c..90515c04d90a 100644 > > --- a/arch/x86/mm/tlb.c > > +++ b/arch/x86/mm/tlb.c > > @@ -316,7 +316,7 @@

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-29 Thread Peter Zijlstra
On Mon, Sep 28, 2020 at 02:44:57PM +0200, Lukas Bulwahn wrote: > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > index 6b0f4c88b07c..90515c04d90a 100644 > --- a/arch/x86/mm/tlb.c > +++ b/arch/x86/mm/tlb.c > @@ -316,7 +316,7 @@ EXPORT_SYMBOL_GPL(leave_mm); > > int

Re: [PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-28 Thread Nathan Chancellor
On Mon, Sep 28, 2020 at 02:44:57PM +0200, Lukas Bulwahn wrote: > Commit b6724f118d44 ("prctl: Hook L1D flushing in via prctl") checks the > validity for enable_l1d_flush_for_task() and introduces some superfluous > local variables for that implementation. > > make clang-analyzer on x86_64

[PATCH -next for tip:x86/pti] x86/tlb: drop unneeded local vars in enable_l1d_flush_for_task()

2020-09-28 Thread Lukas Bulwahn
Commit b6724f118d44 ("prctl: Hook L1D flushing in via prctl") checks the validity for enable_l1d_flush_for_task() and introduces some superfluous local variables for that implementation. make clang-analyzer on x86_64 tinyconfig caught my attention with: arch/x86/mm/tlb.c:332:2: warning: Value