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

Re: [PATCH v5 10/11] xen/arm: fix duplicate /reserved-memory node in Dom0


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 7 Dec 2023 12:14:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com 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 (0)
  • 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=SauPA79bymWKrMvjTmM2TMRpZe9pqSp1BuXurZZVn6U=; b=II5bkTC/JkDaHQ5gZDv6yeCL6JPlTY6O1qjZGIWWyfhFqXShbCX5Q8ac/52ATBpDtWVkNHG7yuVk7UPtRwVEIsvmP7+/0Jyp8keh6alRgg/aox9K+D3sKdZjiRIhS7f2wKBnq9Fcufhq9Ap7dQTQw84txfVQGOWBHFZyRT0ihpwV8vugrc7iLlUOlJnDoP0uF1mP/q8kXgQ7INq5ONyGNXUzWsj5lqSjSFfqYXne6Gk41IbNHMYEIWX6kNYc6W8RSNtZfYoOTZC/qRAjo3WmSTjapwgbRODwb/Goc3aIbJQwZ84qij1E+Wv55idDtrgzgIfYcJUYtPP+H2jU/Zk/ig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=daDGcZYMG9xRyEOm3Pk/1xq4JrME9usqwpfA6dua4SZKAXU4j9q3YP4BvXmEGDy/Z5ur/MNLlw8cHwtX02MWNUK1llZzOtN7L/TFaMzD9N8uqj6JRV61kPKr8AWhDNz7otz83D6DGobgEgpuBJp7IyLHOWhFeNCYUHdulRIfiFMc7udKqoHsq6XnE9cKkPh+Hsi2aXuVUQ87K4Z4wtrwrU67ugzh9ndYtv5pbT5C+xrPb9QF8IMYBabwFSO0Hfy8G6oengIjFyHjdejoqRcPvFiV/Ay3Pz79RJA3qpvVDxy0R6f+Oq1PgWlUaV9rT6dqa/YUVsG1mNX4t5P0v64t0w==
  • Cc: <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 07 Dec 2023 11:15:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Penny,

On 06/12/2023 10:06, Penny Zheng wrote:
> 
> 
> In case there is a /reserved-memory node already present in the host dtb,
> current Xen codes would create yet another /reserved-memory node specially
> for the static shm in Dom0 Device Tree.
Rational missing:
This would result in an incorrect device tree generation and guest would not be 
able
to detect the static shared memory region.

> 
> Xen will use write_properties() to copy the reserved memory nodes from host 
> dtb
> to Dom0 FDT, so we want to insert the shm node along with the copying.
> And avoiding duplication, we add a checking before make_resv_memory_node().
> 
> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> 
> ---
> v3 -> v4:
> new commit
> ---
> v4 -> v5:
> rebase and no change
> ---
>  xen/arch/arm/domain_build.c             | 27 ++++++++++++++++++++++---
>  xen/arch/arm/include/asm/kernel.h       |  2 ++
>  xen/arch/arm/include/asm/static-shmem.h | 14 +++++++++++++
>  xen/arch/arm/static-shmem.c             |  6 +++---
>  4 files changed, 43 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index e040f8a6d9..f098678ea3 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -752,6 +752,23 @@ static int __init write_properties(struct domain *d, 
> struct kernel_info *kinfo,
>          }
>      }
> 
> +    if ( dt_node_path_is_equal(node, "/reserved-memory") )
> +    {
> +        kinfo->resv_mem = true;
I think I raised this concern last time. kinfo is used to store per-domain 
configuration.
Information whether the reserved memory is present in host dtb or not does not 
fit there.
Therefore, I would move this flag to bootinfo.

> +
> +        /* shared memory provided. */
> +        if ( kinfo->shminfo.nr_banks != 0 )
> +        {
> +            uint32_t addrcells = dt_n_addr_cells(node),
> +                     sizecells = dt_n_size_cells(node);
I find this always a bit odd. Just uint32_t sizecells on the next line, just 
like you did in all the other patches.

~Michal




 


Rackspace

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