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

[for-4.20][PATCH v2 2/2] xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 28 Jan 2025 10:40:02 +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=p5PS00aovMc/LXTzX3cWiC6NVUzhB6/IMA3gbnyVqzM=; b=D7wN9AMda9m9+7wBgZXIYNwl5b3EeSGrsrJ9goF+DX5EFBWU2xDVkoKR3ZdvPP6XVkt7GWsL7itieM8OmklV4oPt6gxPaBfQ2yPHsWUGK11u1TY8T1zyYre07IW2uXyePSo3pyTgpmL8JczZXo3UyvWa/g3OhGYXD67jNNLICizZ1zgPoQhIkT08IsH/03skzEKVLzhO6XNigo+/M9lqE5n4Jh1OlMH6lq0zpo5lVZMYgijj2XdYDw7QOXGd/3Ug0GuI69ViNZeTmKAQROj5slJh2qaSm82riIs6uEMWAhtrEjx/EofBnAozQ3h5zWpnBQ/0I3MSHT+CfsNfJASBMg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YlVU8/zyJz0/QZoEmFgMCxhJ/nrFEHtP75M2w6+PM0uNBu9gcT7qS/5FhJr0+71S9g6a6qecbNmQ6Djh8qphRRjSxkIumXFv3mL30DCt5kELTfeFdRahIXD466vYji2MK63Rz5bnRsoQ3XYHDDxQ9cB5wtp4Tiyl51F3n8JnKNVtepVWAMzeE5yXYybCugsOQXvD+8Lj5GniYSbFgOv6b3MEZlGjiz/QaCbRo/dJSDGCqsEMNdiuG/Yuq5ACWR+uDDMTyOwOn9gyhM4sO816xMJNI018p1Jx4qF9KS2hA0YqxatNLPRnt8Z+shUcoWiMDrjJkQhuYZwPcwxxBUiXOw==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, <oleksii.kurochko@xxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>
  • Delivery-date: Tue, 28 Jan 2025 09:40:26 +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:
arch/arm/platforms/vexpress.c: In function 'vexpress_smp_init':
arch/arm/platforms/vexpress.c:102:12: error: format '%lx' expects argument of 
type 'long unsigned int', but argument 2 has type 'long long unsigned int' 
[-Werror=format=]
  102 |     printk("Set SYS_FLAGS to %"PRIpaddr" (%p)\n",

When CONFIG_PHYS_ADDR_T_32 is set, paddr_t is defined as unsigned long.
Commit 96f35de69e59 dropped __virt_to_maddr() which used paddr_t as a
return type. Without a cast, the expression type is unsigned long long
which causes the issue. Fix it.

Fixes: 96f35de69e59 ("x86+Arm: drop (rename) __virt_to_maddr() / 
__maddr_to_virt()")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
Changes in v2:
 - none
---
 xen/arch/arm/include/asm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index f91ff088f6b1..a0d8e5afe977 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -263,7 +263,7 @@ static inline void __iomem *ioremap_wc(paddr_t start, 
size_t len)
 
 #define virt_to_maddr(va) ({                                        \
     vaddr_t va_ = (vaddr_t)(va);                                    \
-    (va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK); \
+    (paddr_t)((va_to_par(va_) & PADDR_MASK & PAGE_MASK) | (va_ & ~PAGE_MASK)); 
\
 })
 
 #ifdef CONFIG_ARM_32
-- 
2.25.1




 


Rackspace

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