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

[xen master] xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y



commit 45c65669bf34bfad9ff6de0dabae2cb201239e34
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Tue Jan 28 10:40:02 2025 +0100
Commit:     Michal Orzel <michal.orzel@xxxxxxx>
CommitDate: Wed Jan 29 08:34:43 2025 +0100

    xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y
    
    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>
---
 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 f91ff088f6..a0d8e5afe9 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
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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