[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: enable interrupts around dump_execstate()



On 13/12/2021 15:12, Jan Beulich wrote:
> show_hvm_stack() requires interrupts to be enabled to avoids triggering
> the consistency check in check_lock() for the p2m lock. To do so in
> spurious_interrupt() requires adding reentrancy protection / handling
> there.
>
> Fixes: adb715db698b ("x86/HVM: also dump stacks from show_execution_state()")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> The obvious (but imo undesirable) alternative is to suppress the call to
> show_hvm_stack() when interrupts are disabled.

show_execution_state() need to work in any context including the #DF
handler, and

    /*
     * Stop interleaving prevention: The necessary P2M lookups
     * involve locking, which has to occur with IRQs enabled.
     */
    console_unlock_recursive_irqrestore(flags);
    
    show_hvm_stack(curr, regs);

is looking distinctly dodgy...

For these kinds of purposes, it ought to be entirely fine to do a
lockless pagewalk of the p2m, because we have to maintain atomicity of
updates vs the hardware pagewalk anyway.  We do not care about any side
effects if the target isn't a RAM page.

That ought to remove any IRQ problems from the equation.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.