lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 3/5] arch/x86/mm: Refactor cond_ibpb() to support other use cases
Date
On Sat, 2020-04-18 at 11:59 +0200, Thomas Gleixner wrote:
>
> "Singh, Balbir" <sblbir@amazon.com> writes:
> > On Fri, 2020-04-17 at 15:07 +0200, Thomas Gleixner wrote:
> > >
> > > Balbir Singh <sblbir@amazon.com> writes:
> > > >
> > > > /*
> > > > - * Use bit 0 to mangle the TIF_SPEC_IB state into the mm pointer
> > > > which is
> > > > - * stored in cpu_tlb_state.last_user_mm_ibpb.
> > > > + * Bits to mangle the TIF_SPEC_IB state into the mm pointer which is
> > > > + * stored in cpu_tlb_state.last_user_mm_spec.
> > > > */
> > > > #define LAST_USER_MM_IBPB 0x1UL
> > > > +#define LAST_USER_MM_SPEC_MASK (LAST_USER_MM_IBPB)
> > > >
> > > > /* Reinitialize tlbstate. */
> > > > - this_cpu_write(cpu_tlbstate.last_user_mm_ibpb,
> > > > LAST_USER_MM_IBPB);
> > > > + this_cpu_write(cpu_tlbstate.last_user_mm_spec,
> > > > LAST_USER_MM_IBPB);
> > >
> > > Shouldn't that be LAST_USER_MM_MASK?
> > >
> >
> > No, that crashes the system for SW flushes, because it tries to flush the
> > L1D
> > via the software loop and early enough we don't have the l1d_flush_pages
> > allocated. LAST_USER_MM_MASK has LAST_USER_MM_FLUSH_L1D bit set.
>
> You can trivially prevent this by checking l1d_flush_pages != NULL.
>

But why would we want to flush on reinit? It is either coming back from a low
power state or initialising, is it worth adding a check for != NULL everytime
we flush to handle this case?

Thanks,
Balbir

\
 
 \ /
  Last update: 2020-04-21 05:48    [W:0.057 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site