On 14.09.2022 10:14, Jan Beulich wrote:
> On 13.09.2022 16:50, Roger Pau Monné wrote:
>> On Mon, Dec 13, 2021 at 04:12:55PM +0100, 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.
>>
>> There's also an ASSERT(!in_irq()) in _percpu_write_lock() that will
>> trigger when trying to acquire the p2m lock from spurious_interrupt()
>> context, as p2m_lock() -> mm_write_lock() -> _mm_write_lock ->
>> percpu_write_lock().
> 
> s/will/may/ since spurious_interrupt() doesn't itself use irq_enter(),
> but yes - we could nest inside a lower priority interrupt. I'll make
> local_irq_enable() depend on !in_irq().

Upon further thought I guess more precautions are necessary: We might
have interrupted code holding the P2M lock already, and we might also
have interrupted code holding another MM lock precluding acquiring of
the P2M lock. All of this probably plays into Andrew's concerns, yet
still I don't view it as a viable route to omit the stack dump for HVM
domains, and in particular for PVH Dom0. Sadly I can't think of any
better approach ...

Jan

Reply via email to