[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86: enable interrupts around dump_execstate()
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 14 Sep 2022 10:31:34 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JybTfpscvAvH3KtABBW8YPzzHqukwqh1lv3Qv1WzSHs=; b=KNNImCL7fiBA9UJ47C3Sbw76ry1ErZza9jUCRghjaHZ5GT0UYeZ4n/QoxfDneTqwH8Sa3pdV4No1yFS5aFi/6yDOllRd0b/fUgqhkC+/ORnbToVibgQ+Twwwd3oFmeqDtMb0uzEpy/bwq5r4XwG6olnwvzQQF5r25iIZBpBZLchDb0HdK3FAoIOfrFtYNolCyss5SfzRbbXgKVK81Jx+NoFOsIT4j+IjP7+69QRIpMQc2dBNu8W/Gl0SL1cc0w0rsk5WJ62caUnW5UYDmJrtO4SaD+n6ChQsqCa8QcdkipRLpprPQBSrX3iKDyjsj0/fiaAdSLrxCQzO4BWlDD8xeA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcK+4DMrllOROweGiYI75Wg3WTaiM2FJ7c46s1norPjaaOByO4KtXOEV2hkwtAi23aDNJoiDutSh4DVkT9HywmqggVD4i1qSCU3Xa+tGLvVQTg9z5kZPMmHN4Py2jEsGX8Mdd30o5uDD7CzGygZXs4BOlwntaSXV1W2lHIu8tpcErm7WdZbawO0lHgxhmzKb/qnVBpg1IGCNafQC+OCT0+eB6Df5Wg6CHLc/UY5bySVKSbRAaAIW6EWlO6Vlrx8QtNKl/ZHeln7khrCysYnl9Kp2BvXdFA7l1cRQrusUKtOCIWzpFt5rQ/Y0BrW5UFhxU5OmYwh8a912cusg7NEwJA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Wed, 14 Sep 2022 08:31:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|