lkml.org 
[lkml]   [2022]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] x86/mce: Add workaround for SKX/CLX/CPX spurious machine checks
    On Wed, Feb 16, 2022 at 2:28 AM Borislav Petkov <bp@alien8.de> wrote:
    >
    > On Tue, Feb 15, 2022 at 02:22:33PM -0800, Luck, Tony wrote:
    > > This early in do_machine check we don't know whether this was from
    > > a over enthusistic REP;MOVS fetch, or a "normal" machine check.
    > > I don't think there is an easy way to tell the difference.
    >
    > That's what I am wondering: whether we can compare the buffers REP;
    > MOVS was accessing and determine whether the access was out of bounds.
    > Something ala _ASM_EXTABLE_ as it is done in arch/x86/lib/copy_mc_64.S,
    > for example, which will land us in fixup_exception().
    >
    > Now there we'd need to know the range the thing was copying which should
    > be in pt_regs and the address the MCE reported. If latter is not in the
    > former range, we say ignore.

    This is a great idea.

    My slight reservation is that this suggests all use cases of "REP; MOVS*" must
    take the _ASM_EXTABLE_ form, which is not possible; considering
    "REP; MOVS*" can be exercised from any user space program.

    >
    > There's even some blurb about "recovering from fast-string exceptions"
    > over copy_mc_enhanced_fast_string...
    >
    > Hmmm?
    If there is a way to get all users of "REP; MOVS*" to use
    copy_mc_enhanced_fast_string, this could work. I am not sure this is possible.

    >
    > > The first check:
    > >
    > > if ((mcgstatus & MCG_STATUS_LMCES)
    > >
    > > is for "is this a local machine check"? So no broadcast sync
    > > needed. But that needs a comment.
    >
    > Yap.
    Updated in the latest patch sent.
    >
    > --
    > Regards/Gruss,
    > Boris.
    >
    > https://people.kernel.org/tglx/notes-about-netiquette

    \
     
     \ /
      Last update: 2022-02-16 16:51    [W:5.383 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site