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 11:22:11AM -0700, Josh Poimboeuf wrote:
    > On Fri, Oct 20, 2023 at 01:45:03PM -0700, Pawan Gupta wrote:
    > > + /* Mitigate CPU data sampling attacks .e.g. MDS */
    > > + USER_CLEAR_CPU_BUFFERS
    > > +
    > > jmp .Lnative_iret
    > >
    > >
    > > @@ -774,6 +780,9 @@ native_irq_return_ldt:
    > > */
    > > popq %rax /* Restore user RAX */
    > >
    > > + /* Mitigate CPU data sampling attacks .e.g. MDS */
    > > + USER_CLEAR_CPU_BUFFERS
    > > +
    >
    > I'm thinking the comments add unnecessary noise here. The macro name is
    > self-documenting enough.
    >
    > The detail about what mitigations are being done can go above the macro
    > definition itself, which the reader can refer to if they want more
    > detail about what the macro is doing and why.

    Sure, I will move the comments to definition.

    > Speaking of the macro name, I think just "CLEAR_CPU_BUFFERS" is
    > sufficient. The "USER_" prefix makes it harder to read IMO.

    Ok, will drop "USER_".

    \
     
     \ /
      Last update: 2023-10-23 21:13    [W:2.096 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site