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

Re: [PATCH v3] xen/arm: Skip memory nodes if not enabled


  • To: Leo Yan <leo.yan@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 13 Oct 2023 13:00:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=4wxa7cmTOlFj1JNCBPMas48ph9C1hXvAAp+gzL0an44=; b=nOKEqn+BI/AOnzWI5mPCqnMkRpGbmErdBfZtuY/uT5bvAm8KDdoIlySriED1Bek+tOwbjgHd+2AglPEwGVZoEmxDsjVJViEQWEW5n0PhJjJZvQg9wwie55VwwpvsPVj8IXhc8AUgtbwbYfj8675qkdY+qQHpgiBMhhq8wMae0KbwUyvhrd3guMgc9bV/JY1YRHMNS5rG5EYWc+REVd4iM3LNmjm3A1O+djD7C8rXyS3wRQ0AIUGopc+nGwAYN6Nqmv1FFJywPf/VkuurQfXv7Fn1elHlj5sWAfmQZIvmePm3hUPULq7TVT/iWYFJfV1gRrxmQt7glPSGVQ23Mu4mrQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ra+VyTk0E0/Uh6Cv5mHHdZbTSnByDnguguD5cBJPmLIfOJyFjx46kYwh4902TWaF5KzLtOkigC8oaVDTfDWuWL65ghNPXq1UnNfZ54NsbnhdL223hyV6234QUQLjkIDpKENieLfYp7TyRSyIJkzpj2uHwwbc8mn/QG47ctdTNmTbXRg2T77S/iIfVBTr+fhyq7IgwkARpAJtrxXJIl9YX5WN/akJUnXDXDc0V/Rf3qYimmelqAVuGtclN53EFMUOtIdlV90EyfUUvJNKe+gbKmK189fI7n3LEy4fWWWo0V8AqpJDnSUJjrutnGaTf45iKyHtmNw5IdmOGbQwOnUi9g==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 13 Oct 2023 11:00:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Leo,

On 13/10/2023 12:29, Leo Yan wrote:
> 
> 
> Currently, the Xen hypervisor doesn't handle the status, the issue can
> be described from two perspectives: the memory nodes and the reserved
> memory nodes.
The first part about the status is a bit ambiguous.
How about (this can be done on commit):
Currently, Xen doesn't check the status property of memory/reserved
memory nodes, which may lead to the following issues:

> 
> - If a memory node has a status "disabled" it implies that it should
>   not be used. Xen does not handle the status property for the memory
>   node and ends up using it.
> 
> - If a reserved memory node has a status "disabled", it means that this
>   region is no longer reserved and can be used, but the "disabled"
>   status is not handled by Xen.
> 
>   Xen passes the intact device tree binding of the reserved memory nodes
>   to Dom0 and creates a memory node to cover reserved regions. Disabled
>   reserved memory nodes are ignored by the Dom0 Linux kernel, thus the
>   Dom0 Linux kernel will continue to allocate pages from such a region.
> 
>   On the other hand, since the disabled status is not handled by Xen,
>   the disabled reserved memory regions are excluded from the page
>   management in Xen which results in Xen being unable to obtain the
>   corresponding MFN, in the end, Xen reports error like:
> 
>   (XEN) arch/arm/p2m.c:2202: d0v0: Failing to acquire the MFN 0x1a02dc
> 
> This patch introduces a function device_tree_node_is_available(). If it
> detects a memory node is not enabled, Xen will not add the memory region
> into the memory lists. In the end, this avoids to generate the memory
> node for the disabled memory regions sent to the kernel and the kernel
> cannot use the disabled memory nodes any longer.
> 
> Since this patch adds checking device node's status in the
> device_tree_get_meminfo() function, except it checks for memory nodes
> and reserved memory nodes, it also supports status for static memory
> and static heap.
> 
> Suggested-by: Michal Orzel <michal.orzel@xxxxxxx>
> Signed-off-by: Leo Yan <leo.yan@xxxxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal



 


Rackspace

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