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

RE: [EXT] Re: xen arm64 low power sleep support


  • To: Dan Waqar <danishnzapp@xxxxxxxxx>
  • From: Dan Waqar <danwaqar@xxxxxxxxxx>
  • Date: Wed, 30 Aug 2023 14:39:04 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nureva.com; dmarc=pass action=none header.from=nureva.com; dkim=pass header.d=nureva.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=d6iAVqAHS9d/SMMVkOjbuf1SiV6oznBLuxEIohaYnyA=; b=TPybq7ADke07bnFYg28TjuC2dZ8wFDCA8MKx1WQRu3yLlZJhhwe3ZmrGgjKuy8yQ29GfO1gk7QGZLRMRgC7akqdVIIk7M3olAJgKXeQ45b4vIcwfacqV2MqwTBla7fJzOpaTsS7LBCBN5ilUxDTLFcoaXhEZ6NnDc3FD4xXSRu1GnlhFO0LNOtmleDtvqxqojUtl+XolyD3lXtbceduQSyvUb7zHaxSTyY692ZwjD3ErQk2YBt3EDGT0vfnHJ4xM5EfzPABS8gkl7RU6LxYWnQMMtDLC2naIAXFnbiZfPN3w2Neg7e3XKOg5LG9eUZTYLLNgPOvi77kyYGF99CLUbA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P9OPtH4CNyg2YZ1Rr0D4KLvb9vKPn1Qn0xFaL2AMwoQVupHqbOGX1eymTxWPlCnDeEQZhQjx3OUZkUcyek221YBbBO3dbchcA69mhzKydk+LlxLD+aOGVuNeR4nDhhFtnc7y6Ljh/aoVwPZSE3s5bgrf9LISHhj2y0hpvUpDeVclBUPxvRaf4tcDgOVPa5SoVUcuOE6TY2pK1CE3bwJKt3MGlUwO7Cj8I/ugrvDTYTUK8f5Koco+fZASlURF+LCHkSEyRKtHMNascf2tCGxn4Ox8ql/BNefedVFQsJZ02DtfDe+AakLFcblLa2Y+BYZEQuUbEOiS3ikoXLweB48eOg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nureva.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "bertrand.marquis@xxxxxxx" <bertrand.marquis@xxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 30 Aug 2023 15:37:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_ActionId=6284961f-2114-4113-b191-8a72ecdf93dc;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_ContentBits=0;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_Enabled=true;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_Method=Privileged;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_Name=PUBLIC;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_SetDate=2023-08-30T14:38:20Z;MSIP_Label_2214f2e3-d3e7-4b81-8952-aef73521b876_SiteId=5aeb77fa-643b-473e-aee0-cb54a11ccba3;
  • Thread-index: AQHZ2sXujaKHIRxg0Ui8Q8pm/6lEKrAC6Tjg
  • Thread-topic: [EXT] Re: xen arm64 low power sleep support


-----Original Message-----
From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Sent: Tuesday, August 29, 2023 4:13 PM
To: Anthony Chan <anthonychan@xxxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; bertrand.marquis@xxxxxxx; julien@xxxxxxx; 
Volodymyr_Babchuk@xxxxxxxx; michal.orzel@xxxxxxx; Dan Waqar 
<danwaqar@xxxxxxxxxx>; sstabellini@xxxxxxxxxx
Subject: [EXT] Re: xen arm64 low power sleep support

On Tue, 29 Aug 2023, Anthony Chan wrote:
> Hi all,
>
> My name is Tony and I've been researching/developing using Xen for potential 
> upcoming uses in our embedded systems.  I started with Xen using Xilinx tools 
> about a year ago and still have lots to learn about what it can to do in the 
> embedded space.  So far, I've managed to integrate Xen and Linux into an 
> existing product that exclusively runs bare-metal code on a ZynqMP SoC and 
> migrate some of the functionality into custom Linux driver/userspace.
>
> I'm now looking at low power support, for now at least between Xen (4.16) and 
> Linux (5.15) dom0.  I've tried a few different Linux kernel configs around 
> power management and each time I try to suspend from linux dom0 (via sysfs or 
> systemctl), Xen will watchdog on dom0 guest.  AFAIK, Xen should trap on a 
> 'WFI' from guests, but from what I can tell debugging through the linux 
> suspend process is it's spinning in a 'suspend-to-idle' loop before it can 
> get to issuing a 'WFI' or using PSCI interface to notify Xen.  I'm beginning 
> to suspect that 'low power' support for embedded arm64 just isn't quite there 
> yet, or am I missing something in the configs?
>
> I realize this could very well be a Linux 'issue' but checking here first.  I 
> know Xen presents a flattened device tree to Linux without CPU idle-state 
> nodes and maybe this is causing the linux guest to only do the 
> suspend-to-idle mode?  I should mention that I'm booting up using dom0less 
> feature if that matters.


Hi Anthony,

Assuming you are using the default Xen command line parameters for Xilinx 
boards: sched=null vwfi=native, then if the guest uses WFI, the CPU will 
execute WFI directly and go into low power mode.

Given the issue you are describing, I am suspecting the guest is not issuing 
WFI: that is simple and known to work. Instead, I suspect that Linux might be 
trying to use PSCI_suspend in a way that is not supported or well-implemented 
by Xen.

Can you check? You can add a printk in Linux 
drivers/firmware/psci/psci.c:__psci_cpu_suspend or in Xen 
xen/arch/arm/vpsci.c:do_psci_0_2_cpu_suspend

If that is the case, the attached patch might work because it disables 
PSCI_suspend support in Xen and Linux should fall back to WFI. (There is no 
power saving in using PSCI_suspend versus WFI.)

Cheers,

Stefano

CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may contain 
information that is confidential and privileged. Any unauthorized disclosure, 
reproduction or use of this e-mail is prohibited. If you are not the intended 
recipient, please notify the sender by reply e-mail or telephone and 
permanently delete this e-mail and any reproductions immediately.



 


Rackspace

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