From nobody Tue Feb 10 01:00:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1713425855534198.23292992838094; Thu, 18 Apr 2024 00:37:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.708014.1106565 (Exim 4.92) (envelope-from ) id 1rxMKW-00059Q-6N; Thu, 18 Apr 2024 07:37:12 +0000 Received: by outflank-mailman (output) from mailman id 708014.1106565; Thu, 18 Apr 2024 07:37:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rxMKW-00059B-1o; Thu, 18 Apr 2024 07:37:12 +0000 Received: by outflank-mailman (input) for mailman id 708014; Thu, 18 Apr 2024 07:37:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rxMKU-00046V-Rx for xen-devel@lists.xenproject.org; Thu, 18 Apr 2024 07:37:10 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 7600a980-fd56-11ee-94a3-07e782e9044d; Thu, 18 Apr 2024 09:37:08 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FBCD339; Thu, 18 Apr 2024 00:37:36 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C104C3F64C; Thu, 18 Apr 2024 00:37:07 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7600a980-fd56-11ee-94a3-07e782e9044d From: Luca Fancellu To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v3 05/12] xen/arm: Conditional compilation of kernel_info.shm_mem member Date: Thu, 18 Apr 2024 08:36:45 +0100 Message-Id: <20240418073652.3622828-6-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418073652.3622828-1-luca.fancellu@arm.com> References: <20240418073652.3622828-1-luca.fancellu@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1713425857868100001 Content-Type: text/plain; charset="utf-8" The user of shm_mem member of the 'struct kernel_info' is only the code managing the static shared memory feature, which can be compiled out using CONFIG_STATIC_SHM, so in case the feature is not requested, that member won't be used and will waste memory space. To address this issue, protect the member with the Kconfig parameter and modify the signature of the only function using it to remove any reference to the member from outside the static-shmem module. Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel --- v2: - add Michal R-by - Removed the signature modification of make_resv_memory_node from this patch v1: - new patch --- --- xen/arch/arm/include/asm/kernel.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/include/asm/kernel.h b/xen/arch/arm/include/asm/k= ernel.h index d46f29ee6ce5..eb3cb7809ccf 100644 --- a/xen/arch/arm/include/asm/kernel.h +++ b/xen/arch/arm/include/asm/kernel.h @@ -39,7 +39,9 @@ struct kernel_info { void *fdt; /* flat device tree */ paddr_t unassigned_mem; /* RAM not (yet) assigned to a bank */ struct meminfo mem; +#ifdef CONFIG_STATIC_SHM struct meminfo shm_mem; +#endif =20 /* kernel entry point */ paddr_t entry; @@ -80,10 +82,16 @@ struct kernel_info { =20 #define kernel_info_get_mem(kinfo) (&(kinfo)->mem.common) =20 +#ifdef CONFIG_STATIC_SHM +#define KERNEL_INFO_SHM_MEM_INIT .shm_mem.common.max_banks =3D NR_MEM_BANK= S, +#else +#define KERNEL_INFO_SHM_MEM_INIT +#endif + #define KERNEL_INFO_INIT \ { \ .mem.common.max_banks =3D NR_MEM_BANKS, \ - .shm_mem.common.max_banks =3D NR_MEM_BANKS, \ + KERNEL_INFO_SHM_MEM_INIT \ } =20 /* --=20 2.34.1