lkml.org 
[lkml]   [2022]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH V6 3/8] x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()
    On Thu, Apr 21, 2022 at 10:10:50PM +0800, Lai Jiangshan wrote:
    > From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
    >
    > The macro idtentry calls error_entry() unconditionally even on XENPV.
    > But the code XENPV needs in error_entry() is PUSH_AND_CLEAR_REGS only.
    > And error_entry() also calls sync_regs() which has to deal with the
    > case of XENPV via an extra branch so that it doesn't copy the pt_regs.

    What extra branch?

    Do you mean the

    if (regs != eregs)

    test in sync_regs()?

    I'm confused. Are you, per chance, aiming to optimize XENPV here or
    what's up?

    > And PUSH_AND_CLEAR_REGS in error_entry() makes the stack not return to
    > its original place when the function returns, which means it is not
    > possible to convert it to a C function.
    >
    > Move PUSH_AND_CLEAR_REGS out of error_entry(), add a function to wrap
    > PUSH_AND_CLEAR_REGS and call it before error_entry().
    >
    > The new function call adds two instructions (CALL and RET) for every
    > interrupt or exception.

    Not only - it pushes all the regs in PUSH_AND_CLEAR_REGS too. I don't
    understand why that matters here? It was done in error_entry anyway.

    --
    Regards/Gruss,
    Boris.

    https://people.kernel.org/tglx/notes-about-netiquette

    \
     
     \ /
      Last update: 2022-04-27 19:47    [W:6.022 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site