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

Re: vcpu_show_execution_state() difference between Arm and x86


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Sep 2021 13:55:45 +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-SenderADCheck; bh=418HGwJdiDk5kaVjZbCAcJQlFgBBx59CLraGTj8kY8c=; b=RkTumLLJ/5Gwjhl6PpE3OZL2+P1ex7wrU+hsi/Kle2d6nNw//5sSwGvr+L8UUjmTNRToeoa/D5BrfdKwwWnORzimetg5Lmhx7+z97+/0iv5UxLzTY62W+oRr0bhZ3ed06vCgu+cWwhuNr0VQNhRdX0Y+yzYkk87lfnahkkd/42hs65TSHVQjM4/fFaHm1al6oounc1nLi/xD46DhIJuo5AveBaD7AmhlXvab4oNsQDyedA0EQS/1SkxSHtj0vvEgTdRtz2MOPhp2DvGecwkhausvSIMCw/kLXP5Md9Y/TWB/hRPGmMD7wZkEn009M1g+IWEqKbI5bmucIrpwxrM9/g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFGRxR7iaqRPWBLUmJ5rm3tv8OOSUL5kCbziQHwnDLcgFFsOhRIus7T2K9jfZzdDbbNPk8BLE7uBXcCbcOT5v2Fd3yvpF4w6EkGEL31Fke5AqYOd3YarUOlHcTE5v049AOK9cqLVGhVOOZzGYFknvwmbFTJyg618n6SV+gtjD3aXhDz0Tm3/pbDu+zL88RKmyxF3WOUubxnMaIrm048E2bZCR7ugCg4PgjlmnREnctsjpVgdFPQr3x1HFRc09slFS35QjbDro+hjaJQkvYfxuLP88Jm1oXo66AvM1qxohC55Fo8oz/4a0yiKGvO3MtlWml5i79Wi0+sWijqgabuysQ==
  • Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 02 Sep 2021 11:55:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.09.2021 13:48, Julien Grall wrote:
> On 02/09/2021 07:45, Jan Beulich wrote:
>> On 01.09.2021 20:11, Julien Grall wrote:
>>> I looked at the original commit to find out the reason to use the
>>> console lock. AFAICT, this was to allow console_force_unlock() to work
>>> properly. But it is not entirely clear why we couldn't get a new lock
>>> (with IRQ enabled) that could be forced unlocked in that function.
>>>
>>> Can either you or Andrew clarify it?
>>
>> AIUI any new lock would need to be IRQ-safe as well, as the lock
>> would be on paths taken to output stuff when the system crashed.
> 
> Hmmm... Just to confirm, what you are saying is some of the callers of 
> vcpu_show_execution_state() & co may do it with IRQ-disabled. Is that 
> correct?

No, that's not what I was saying. What I was saying is that crash-
safety requires an IRQ-safe lock, because the approach taken here
should imo match that in show_execution_state(). And _that_
function can be called with IRQs in either state.

> I have tried to play with it on Arm but then I realized that 
> check_lock() is not properly working on Arm because we don't call 
> spin_debug_enable() at boot. :/ So it would make sense why we never saw 
> any issue there...

Oops.

>> Hence it would be pointless to introduce yet another lock when the
>> one we have is already good enough. But I may be missing aspects,
>> in which case I'd have to defer to Andrew.
>>
>>> The other solution I can think off is buffering the output for
>>> show_registers and only print it once at the end. The downside is we may
>>> not get any output if there is an issue in the middle of the dump.
>>
>> Indeed; I'd prefer to avoid that, the more that it may be hard to
>> predict how much output there's going to be.
> 
> And it is not going to work as we couldn't grab the P2M lock with IRQ 
> disabled.
> 
> On Arm, the only problem is going to be the P2M lock for dump the guest 
> trace. A possible controversial approach for Arm is to just not dump the 
> guest stack or move it outside of the new lock and dump when IRQ is 
> enabled (I am not aware of any places where the guest stack will be 
> dumped and we have IRQ disabled).

Well, you could certainly omit the stack dump on Arm. I for one find
it quite useful every now and then. On x86, that is.

Jan




 


Rackspace

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