lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] x86/entry_64: Add VERW just before userspace transition
On Mon, Oct 23, 2023 at 02:47:52PM -0700, Josh Poimboeuf wrote:
> > > > /*
> > > > * RSP now points to an ordinary IRET frame, except that the page
> > > > * is read-only and RSP[31:16] are preloaded with the userspace
> > > > @@ -1502,6 +1511,9 @@ nmi_restore:
> > > > std
> > > > movq $0, 5*8(%rsp) /* clear "NMI executing" */
> > > >
> > > > + /* Mitigate CPU data sampling attacks .e.g. MDS */
> > > > + USER_CLEAR_CPU_BUFFERS
> > > > +
> > > > /*
> > > > * iretq reads the "iret" frame and exits the NMI stack in a
> > > > * single instruction. We are returning to kernel mode, so this
> > >
> > > This isn't needed here. This is the NMI return-to-kernel path.
> >
> > Yes, the VERW here can be omitted. But probably need to check if an NMI
> > occuring between VERW and ring transition will still execute VERW after
> > the NMI.
>
> That window does exist, though I'm not sure it's worth worrying about.

I am in favor of omitting the VERW here, unless someone objects with a
rationale. IMO, precisely timing the NMIs in such a narrow window is
impractical.

\
 
 \ /
  Last update: 2023-10-24 00:32    [W:0.094 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site