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

[for-4.20][PATCH 1/2] device-tree: bootfdt: Fix build issue when CONFIG_PHYS_ADDR_T_32=y


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 27 Jan 2025 11:45:55 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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 (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=WNR0ouBbqbHHAoSjXLlBdAQfyyv0rL4tNCyhR0MJ/FQ=; b=rRGL45nohGf+G9snm88Aqb/jroYLkCDCWiOld3fFWFxqHA8u3ByT/q/sNWXECgjhnP8n8Wo788sBsP1nqSG6xL+4pR1xr1eP5klU2FDFVHH5CDNI/3eLuc9kEUugIwBuhSgMh28UrFbTG6n977SaybO5k/84tmMn9G4r8Yo2SzOn3MIjElhrbcLgZMcxn7nAjvAsIJwIuArtlfoKuXQOOxWVmSRPoCHWmYJK4MUDTsSooLnWO6h9+7ox5/VI13UcmQoRqc2IDVOf6jptVrI503WqQ2ZkSjQkIrSG65CEaKHZ2NpZjrwkDybabr4MgXM7Nn47MAIC8O5sytl/vHYbbg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ED4aLuJWT/OrDx7T1wKZVT6NozYck4aZOw727gZ0me8beid5T9DHmuxJA+UuFDDRlMFJjvBbwf7y2ZnDCyR9EO5FnF2r4xq9/6JS7Okqyw61J3o26NmIeRbnNT1Zy9uDHy8lM80VoixDfJvnE2Warsq8j5RObaA6mAohasea3Tu+bXxSHsgoD4x+WC2tnTrQPuSp6e89sIUDm6m4e7vPztkVEylE/rklgEY5P1TsguY7CyBaiYaHzqI4jBnZFn9PqGtGJRRd53Wd+S2Wd8+dk5JHY7x+ljXhEy0gGtW/kT6Zc+h46sg4zvGRIpJryHK+JxSFEWm22zYdTUYitWz3vA==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Mon, 27 Jan 2025 10:46:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Arm32, when CONFIG_PHYS_ADDR_T_32 is set, a build failure is observed:
common/device-tree/bootfdt.c: In function 'build_assertions':
./include/xen/macros.h:47:31: error: static assertion failed: "!(alignof(struct 
membanks) != 8)"
   47 | #define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); 
})
      |                               ^~~~~~~~~~~~~~
common/device-tree/bootfdt.c:31:5: note: in expansion of macro 'BUILD_BUG_ON'
   31 |     BUILD_BUG_ON(alignof(struct membanks) != 8);

When CONFIG_PHYS_ADDR_T_32 is set, paddr_t is defined as unsigned long,
therefore the struct membanks alignment is 4B. Fix it.

Fixes: 2209c1e35b47 ("xen/arm: Introduce a generic way to access memory bank 
structures")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/common/device-tree/bootfdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
index 47386d4fffea..511700ccc2ba 100644
--- a/xen/common/device-tree/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -27,8 +27,8 @@ static void __init __maybe_unused build_assertions(void)
      */
     BUILD_BUG_ON((offsetof(struct membanks, bank) !=
                  offsetof(struct meminfo, bank)));
-    /* Ensure "struct membanks" is 8-byte aligned */
-    BUILD_BUG_ON(alignof(struct membanks) != 8);
+    /* Ensure "struct membanks" is paddr aligned */
+    BUILD_BUG_ON(alignof(struct membanks) != sizeof(paddr_t));
 }
 
 static bool __init device_tree_node_is_available(const void *fdt, int node)
-- 
2.25.1




 


Rackspace

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