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

Re: [PATCH 1/2] xen/arm: Add imx8q{m,x} platform glue


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 13 Mar 2024 10:07:58 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=tN7r9mIZHEPOlNH367+zhhdBwovKJXuQKqZam/V0Q9s=; b=csTAXBAQvG0FNQlMRAqgt8bwJWebXpN5bv6365NlI4IHKzWumKWqN6FW5b70X0e/H6EXKnfWL+mo0fOkeDDyt9qXgFt93ycf9TnTPWp2mzMG+rt0L1jIYfhS2rfYD+YWAy0lkesfEud9yrjngKOREyaBege3IwnBC565vUNIB1w42Yz2Blm1a8w3vxgcDVU9B8gtAyyAOkfqtzCcuyvIqHpI1X3QpJnIp77c8PpRIsz3YTG9eljBWKR48hM5Jux0Uf+DcjgCnUXQb1ddcaMMkK8gOUMNe64M8gGV6ssPmExmPhZnuWfQx8qIuEoBCFPb/C6ETiVkEJT2/UDrknL2/Q==
  • 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=tN7r9mIZHEPOlNH367+zhhdBwovKJXuQKqZam/V0Q9s=; b=LUzmOYD51jJ9RSX91dHEr5083EKA20hAXrn2aF41L+xdqXvNYLwXqAj8DjGlpDO5Ls/gPjrSez//FacvXM2j/Rzr+2Ph5umgCT0aIx/iZfoHRpTuo1HA2qZrY9QSfJlzsYWo1AoXuB6+1yye7qtXdPwk4r42fMA9G/IFBmLdfwjt/oBtIjvsBKNW0Jg/YgRgkOZ0ycI7KkQFpP1wUJz+2ejISWBj8ne9yKeFkowMr05AN+YsJf8DNbVhGoNlWUuKcChWVFrk3aAFTI9SE/lTanOSLX1rX85QNjYqWaq3W0L6TSMa+/v47oOH6sYba+c7Z+nbP8WIvbqP+SjzU0XSPA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=hV5RfcllN/BUofXVX4Vs/7JVL+UMmPxyj9VdZIOELxc7j8fh7GbrK1BVNQfULY0ryCIeJegvzMQ/9xQ2itRn+5AOlpK/8r6hZEEPljDLTrOMdGEktptdIIYNt1pEaIaT0AZ9CF3jydxq5Vi51PHIErnX6fkVyDuHlLx91kGgHghH+LrgS1iJ2wsdEAnfBSLsx/dnjfSijJzbOWTI8v1FzycLtVBts5/W9frLxehN1HyGxOAkHaUIeozEbFE3qN1ZT3QjsF+aWSeiojkJveom91whl58goLH4jugdVzYzwKnDo8DUD0KXdeBBRCq5ye+CWs4TPWZAxGIkWl0On9pGjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aJQtzryGiINhu+UuUwOjJ9/xDIFjBDx+tc3KLonsKZ9+pUdEfG4Wo4fy26lBK0wYOi8rPRlnNrL9FgmFchMd4pFpXukxbbHPBP0nYMMyPV60awCimH46xeXjyLWNJF+eBZW7SxY9+AQXDT4gaNZFWrvGVK25F3eSUmJVWZmTikSVTYLZDEcotKaZhW/w28HoHLXnaDKlyhtQU9K/Zfy+dcOGFoMsjbPK10PsA0xQwyBjYN3f7yy5hZtwoKayQg9ZNuc/NCn41nwZDTerDD4RVqMli9cOi7/56KjSbIIL2v3j6pHtTM5AkMGMIb7VgyY5vOaVHwl/5likLDObaa8VHA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: John Ernberg <john.ernberg@xxxxxxxx>, Peng Fan <peng.fan@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jonas Blixt <jonas.blixt@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 13 Mar 2024 10:08:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHaVDuqVQ/kgxLZgUK/m8/hE0ez5bDz198AgAA1LICAAVx4AIAAQjaAgAEdtQCAAynKwIABnCuAgAZ8E4CAKNxCgIAApf0AgAKGQwCAAAbHgIAHmWEA
  • Thread-topic: [PATCH 1/2] xen/arm: Add imx8q{m,x} platform glue

Hi,

> On 8 Mar 2024, at 15:04, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi John,
> 
> Thank you for the reply.
> 
> On 08/03/2024 13:40, John Ernberg wrote:
>> On 3/7/24 00:07, Julien Grall wrote:
>>>  > Ping on the watchdog discussion bits.
>>> 
>>> Sorry for the late reply.
>>> 
>>> On 06/03/2024 13:13, John Ernberg wrote:
>>>> On 2/9/24 14:14, John Ernberg wrote:
>>>>> 
>>>>>>     * IMX_SIP_TIMER_*:  This seems to be related to the watchdog.
>>>>>> Shouldn't dom0 rely on the watchdog provided by Xen instead? So those
>>>>>> call will be used by Xen.
>>>>> 
>>>>> That is indeed a watchdog SIP, and also for setting the SoC internal RTC
>>>>> if it is being used.
>>>>> 
>>>>> I looked around if there was previous discussion and only really
>>>>> found [3].
>>>>> Is the xen/xen/include/watchdog.h header meant to be for this kind of
>>>>> watchdog support or is that more for the VM watchdog? Looking at the x86
>>>>> ACPI NMI watchdog it seems like the former, but I have never worked with
>>>>> x86 nor ACPI.
>>> 
>>> include/watchdog.h contains helper to configure the watchdog for Xen. We
>>> also have per-VM watchdog and this is configured by the hypercall
>>> SCHEDOP_watchdog.
>>> 
>>>>> 
>>>>> Currently forwarding it to Dom0 has not caused any watchdog resets with
>>>>> our watchdog timeout settings, our specific Dom0 setup and VM count.
>>> 
>>> IIUC, the SMC API for the watchdog would be similar to the ACPI NMI
>>> watchdog. So I think it would make more sense if this is not exposed to
>>> dom0 (even if Xen is doing nothing with it).
>>> 
>>> Can you try to hide the SMCs and check if dom0 still behave properly?
>>> 
>>> Cheers,
>>> 
>> This SMC manages a hardware watchdog, if it's not pinged within a
>> specific interval the entire board resets.
> 
> Do you know what's the default interval? Is it large enough so Xen + dom0 can 
> boot (at least up to when the watchdog driver is initialized)?
> 
>> If I block the SMCs the watchdog driver in Dom0 will fail to ping the
>> watchdog, triggering a board reset because the system looks to have
>> become unresponsive. The reason this patch set started is because we
>> couldn't ping the watchdog when running with Xen.
>> In our specific system the bootloader enables the watchdog as early as
>> possible so that we can get watchdog protection for as much of the boot
>> as we possibly can.
>> So, if we are to block the SMC from Dom0, then Xen needs to take over
>> the pinging. It could be implemented similarly to the NMI watchdog,
>> except that the system will reset if the ping is missed rather than
>> backtrace.
>> It would also mean that Xen will get a whole watchdog driver-category
>> due to the watchdog being vendor and sometimes even SoC specific when it
>> comes to Arm.
>> My understanding of the domain watchdog code is that today the domain
>> needs to call SCHEDOP_watchdog at least once to start the watchdog
>> timer. Since watchdog protection through the whole boot process is
>> desirable we'd need some core changes, such as an option to start the
>> domain watchdog on init. >
>> It's quite a big change to make
> 
> For clarification, above you seem to mention two changes:
> 
> 1) Allow Xen to use the HW watchdog
> 2) Allow the domain to use the watchdog early
> 
> I am assuming by big change, you are referring to 2?
> 
> , while I am not against doing it if it
>> makes sense, I now wonder if Xen should manage hardware watchdogs.
>> Looking at the domain watchdog code it looks like if a domain does not
>> get enough execution time, the watchdog will not be pinged enough and
>> the guest will be reset. So either watchdog approach requires Dom0 to
>> get execution time. Dom0 also needs to service all the PV backends it's
>> responsible for. I'm not sure it's valuable to add another layer of
>> watchdog for this scenario as the end result (checking that the entire
>> system works) is achieved without it as well.
>> So, before I try to find the time to make a proposal for moving the
>> hardware watchdog bit to Xen, do we really want it?
> 
> Thanks for the details. Given that the watchdog is enabled by the bootloader, 
> I think we want Xen to drive the watchdog for two reasons:
> 1) In true dom0less environment, dom0 would not exist
> 2) You are relying on Xen + Dom0 to boot (or at least enough to get the 
> watchdog working) within the watchdog interval.

Definitely we need to consider the case where there is no Dom0.

I think there are in fact 3 different use cases here:
- watchdog fully driven in a domain (dom0 or another): would work if it is 
expected
  that Xen + Domain boot time is under the watchdog initial refresh rate. I 
think this
  could make sense on some applications where your system depends on a specific
  domain to be properly booted to work. This would require an initial refresh 
time
  configurable in the boot loader probably.
- watchdog fully driven by Xen. One might want to just make sure the hypervisor 
is alive.
- hybrid model where the watchdog is driven by Xen until a domain comes up to 
drive it.
  This could make sense to relax the stress on boot time but would raise the 
question of
   what should be done if the domain dies. This is also kind of complex as Xen 
should stop
   refreshing the watchdog when a domain starts doing it (might require a trap 
and emulate
   initially that is then mapped directly to a domain). I am not completely 
sure this makes sense.

Regards
Bertrand


> 
> Let see what the other Arm maintainer thinks.
> 
> -- 
> Julien Grall




 


Rackspace

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