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

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


  • To: Andrew Cooper <amc96@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Dec 2021 14:33:20 +0100
  • 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=f++dYPPioHlXlt3NfMV6kobxpdWr5FyNTo0G7BlRj5M=; b=X6FL4DwD2JpXUqh1h4EBT56aLzaTdiERMbUjRa8S0SO8mRFlLMhN0FEo3saDPmdJSr3DdNmi9wAAtjWTrFfnl3OH6DXwLiKtZmxHoQv4Q8Dr7x8zSEbGzLa3Js2ZPBmSMn7Gu0Ba14RN09zYi8XTiSYdGT1pPjgZTgtw9wFL+bajtsdZPM0vodxK1TYV6H1LfhkfkhvqoGWc2/GMp8FoPyasqhvIy52eTX7jhT8uFfjt2Ei6JvMv2yAfzEvfitYrrD7dIYaVVRVzCf+WfnkG6+2DI6wIsy3yCnLEALRZaNlQRY9TB8QhSEebfuYgOcvZ2zSQrAVqOa1nR5ptSqt43w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOAm/RkZMg5O8gyjDGXmZx6quz0SAt6cJ/RPG46thzNlUJLoVu1vlpr2oLlj/lH+w8PiPou1ZPH1I2lihWDQFyiKFhxaTlf7miP3EiHjhlO/Ym/onhsiuIWL2HAY64q89bmjmXLIZ6n3RVEsiRzE2wmTC+ecREbgOGsZ+DwaB3C1z7Mq1evDO2uABiVMSXcptdvS80mjkoDeRMN3QluxKwOnNcy6ktwkNtdYmMQ1KlH4e8ztAyOo7Kj4VonEf659vJuACXdJygXDSUzLp17VC9RHGxGYYLfMVIoWJazLCOsq1mfCgWn2BlQShPXDdv9bKS+pvCreOAO3mRJReHC/HA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 16 Dec 2021 13:33:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.12.2021 12:54, Andrew Cooper wrote:
> 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,

Why? There's no show_execution_state() on that path.

> 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...

Well, yes, it does. If you have any better idea ...

> 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.

First - how do you suggest to signal to the page walk logic that there
should be no lock acquired? And then I don't think there's a direct
relationship here with what we need to guarantee correct hardware page
walk behavior. Unless you mean to suggest that here we want to rely on
either locking or interrupts being off (the latter guaranteeing that
flush IPIs wouldn't complete while we're still doing software walking
here).

Jan




 


Rackspace

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