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

Re: [PATCH] xen/arm: Initialise memory type for struct kernel_info


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 23 Dec 2024 08:58:30 +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=arcselector10001; 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=OSNWnsO7qYRDox0AYIv661NFImBFH14dpdkcFo++nE8=; b=FzvlWfIbWOMGSe5qxGB9jpKmaRcghJ2T1OAit635rY2vashM3uat7/MeYj2bKzIonm6LTxW0epi6EJ74uvx3eirL8kfFoLV9kFUrD/MHZNugxojsdpRDa5FhPA7eQr9EzcHwbl0+3GVnHB75qGA6jO8nTnmEk2OX+yK+JnUn2R4grW1YpDU1gA8cwN9+kGmKH8lP/hhsuBT7l4dtBmdumj9/QK6Y5JX7pBG3O7r2BCCeiPtQA+s+5DjZUZNKoUrvlfjbvCkc6Vei6ROwwF8S4Ad5519smBxUCSxSLAy+w+x9lil906wv46bdN/kj6N+shfCso9NdF2MATdj6VCHA1g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L2djVaDPLVBaf6GQdK7AhSBIIyUysPMeo6bImlMwGPBdloSQUKPJ8GT1gE/ARKr4XQwl+tU3/GejK3xMbjN/3B2lqGSGfnFba07R4WP89Vfemg8aPLmNKUdWnJhB5zaUokgt1E9q69SrVzV4HGt5dGXBHsgprQN2Wwc8f/BSbm5jXrzToptfy9x2k0HsCwtgWMf1nRgmWzWDWuqFAwDcnXW+B+WDgXcUQKFJn72GV3gxtjB7aAOH1/uvKBRuFrfRM2uu49d3xnuh2Y1JRsdtyigTYsw1QUpA7DI4kiqiiZbmQgDlOiEglez8gzGypCXBO5mQgcmp3/E62lnqe95IlA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 23 Dec 2024 07:58:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 20/12/2024 16:19, Luca Fancellu wrote:
> 
> 
> Commit a14593e3995a ("xen/device-tree: Allow region overlapping with
> /memreserve/ ranges") introduced a type in the 'struct membanks_hdr'
> but forgot to update the 'struct kernel_info' initialiser, while
> it doesn't lead to failures because the field is not currently
> used while managing kernel_info structures, it's good to have it
> for completeness.
The last part "good to have it" does not sound like we need a Fixes tag.
I'm in two minds here. At the moment we do have some consistency because
we use and therefore initialize .type member only for bootinfo related 
structures.

You suggest to expand this also to kernel_info. But what about other places 
using
struct membanks that, after all, is a useful generic structure? One example you 
can find
is static struct shm_heap_banks in static-shmem.c for which you do not set a 
type. Another
example is allocate_memory() or find_host_extended_regions() where we have to 
convert gnttab
region into struct membanks and there is no need to use the type at all. So, do 
you suggest
we should initialize (explicitly) .type only for *meminfo based structures or 
all the structures
using struct membanks?

> 
> Fixes: a14593e3995a ("xen/device-tree: Allow region overlapping with 
> /memreserve/ ranges")
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
>  xen/arch/arm/include/asm/kernel.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/include/asm/kernel.h 
> b/xen/arch/arm/include/asm/kernel.h
> index 7e6e3c82a477..de3f945ae54c 100644
> --- a/xen/arch/arm/include/asm/kernel.h
> +++ b/xen/arch/arm/include/asm/kernel.h
> @@ -92,7 +92,9 @@ kernel_info_get_mem_const(const struct kernel_info *kinfo)
>  }
> 
>  #ifdef CONFIG_STATIC_SHM
> -#define KERNEL_INFO_SHM_MEM_INIT .shm_mem.common.max_banks = NR_SHMEM_BANKS,
> +#define KERNEL_INFO_SHM_MEM_INIT                \
> +    .shm_mem.common.max_banks = NR_SHMEM_BANKS, \
> +    .shm_mem.common.type = STATIC_SHARED_MEMORY,
>  #else
>  #define KERNEL_INFO_SHM_MEM_INIT
>  #endif
> @@ -100,6 +102,7 @@ kernel_info_get_mem_const(const struct kernel_info *kinfo)
>  #define KERNEL_INFO_INIT                        \
>  {                                               \
>      .mem.common.max_banks = NR_MEM_BANKS,       \
> +    .mem.common.type = MEMORY,                  \
>      KERNEL_INFO_SHM_MEM_INIT                    \
>  }
> 
> --
> 2.34.1
> 

~Michal





 


Rackspace

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