All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] x86: enable interrupts around dump_execstate()
Date: Wed, 14 Sep 2022 10:31:34 +0200	[thread overview]
Message-ID: <0ccfe125-9455-8f40-430e-cfa1347b0aed@suse.com> (raw)
In-Reply-To: <74fcfb7c-a699-03d5-c8aa-5f654515c566@suse.com>

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	other threads:[~2022-09-14  8:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 15:12 [PATCH] x86: enable interrupts around dump_execstate() Jan Beulich
2021-12-16 11:54 ` Andrew Cooper
2021-12-16 13:33   ` Jan Beulich
2022-01-11 10:08     ` Ping: " Jan Beulich
2022-07-05 16:19       ` Ping²: " Jan Beulich
2022-07-19 10:59         ` Fwd: " Jan Beulich
2022-07-19 12:54           ` Henry Wang
2022-07-19 11:22     ` Andrew Cooper
2022-07-19 12:53       ` Jan Beulich
2022-09-13 14:50 ` Roger Pau Monné
2022-09-14  8:14   ` Jan Beulich
2022-09-14  8:31     ` Jan Beulich [this message]
2022-09-14  9:13       ` Roger Pau Monné
2022-09-14 10:13         ` Jan Beulich
2022-09-14 14:23           ` Roger Pau Monné
2022-09-15  8:01             ` Jan Beulich
2022-09-15 15:43               ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ccfe125-9455-8f40-430e-cfa1347b0aed@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.