Skip to contentSkip to conversation

xen/arm CONFIG_PHYS_ADDR_T_32=y fixes

PATCH Superseded Michal Orzel 6 participants 15 messages Jan 27, 2025 – Jan 28, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover xen/arm CONFIG_PHYS_ADDR_T_32=y fixes

This series contains build fixes when CONFIG_PHYS_ADDR_T_32=y.

@Oleksii:
This is a release blocker.

Michal Orzel (2):
device-tree: bootfdt: Fix build issue when CONFIG_PHYS_ADDR_T_32=y xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

 xen/arch/arm/include/asm/mm.h    | 2 +-
 xen/common/device-tree/bootfdt.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 device-tree: bootfdt: 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:
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")
---
 xen/common/device-tree/bootfdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/common/device-tree/bootfdt.c +2 -2
index 47386d4fffea..511700ccc2ba 100644
@@ -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)
Signature · 1 line
2.25.1
#2 lore raw

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

Quoted 6 lines · Michal Orzel

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
")"); })

Quoted 7 lines
      |                               ^~~~~~~~~~~~~~

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.

Usually, we add a BUILD_BUG_ON when other parts of the code rely on a specific property (in this case alignment). Can you explain in the commit message why the new check is still ok?

Cheers,

Quoted 29 lines
Fixes 2209c1e35b47 ("xen/arm: Introduce a generic way to access memory

bank structures")

---
 xen/common/device-tree/bootfdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/common/device-tree/bootfdt.c +2 -2
index 47386d4fffea..511700ccc2ba 100644
@@ -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

#3 lore raw

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

Quoted 15 lines · Julien Grall

On Mon, 27 Jan 2025 at 07:46, Michal Orzel <[email protected] <mailto:[email protected]>> wrote:

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);

Quoted 5 lines

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

Usually, we add a BUILD_BUG_ON when other parts of the code rely on a specific property (in this case alignment). Can you explain in the commit message why the new check is still ok?

Well, the change itself reflects the change in alignment requirement. When paddr_t is 64b (Arm64, Arm32 with PA=40b) the alignment is 8B. On Arm32 with PA=32b, the alignment is 4B because paddr_t is 4B.

AFAICT you requested this check back then, because struct membanks contains flexible array member 'bank' of type struct membank. The alignment requirement of struct membanks becomes the requirement of struct membank whose largest type is paddr_t. Let me know how you would like to have this written in commit msg.

~Michal

#4 lore raw

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

Quoted 35 lines · Michal Orzel
Quoted 6 lines · Julien Grall

On Mon, 27 Jan 2025 at 07:46, Michal Orzel <[email protected]

Quoted 2 lines · <mailto:[email protected]>> wrote:

On Arm32, when CONFIG_PHYS_ADDR_T_32 is set, a build failure is

observed:

Quoted 2 lines

common/device-tree/bootfdt.c: In function 'build_assertions':
./include/xen/macros.h:47:31: error: static assertion failed:

"!(alignof(struct membanks) != 8)"

Quoted 1 line
       47 | #define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!("

#cond ")"); })

Quoted 2 lines

| ^~~~~~~~~~~~~~
common/device-tree/bootfdt.c:31:5: note: in expansion of macro

'BUILD_BUG_ON'

Quoted 3 lines

31 | BUILD_BUG_ON(alignof(struct membanks) != 8);

When CONFIG_PHYS_ADDR_T_32 is set, paddr_t is defined as unsigned

long,

Quoted 4 lines

therefore the struct membanks alignment is 4B. Fix it.

Usually, we add a BUILD_BUG_ON when other parts of the code rely on a

specific property (in this case alignment). Can you explain in the commit message why the new check is still ok?
Well, the change itself reflects the change in alignment requirement. When paddr_t is 64b (Arm64, Arm32 with PA=40b) the alignment is 8B. On Arm32 with PA=32b, the alignment is 4B because paddr_t is 4B.

Quoted 4 lines

AFAICT you requested this check back then, because struct membanks contains flexible array member 'bank' of type struct membank. The alignment requirement of struct membanks becomes the requirement of struct membank whose largest type is paddr_t.

Reading this, it sounds like you want to check against the alignment of « struct membank ». This is because the structure could gain a 64-bit field in the future and this would not be caught by the BUILD_BUG_ON.

Quoted 1 line

Let me know how you would like to have this written in commit msg.

I think it needs to be rephrased to make clear the alignment of struct membanks should be the same as struct membank.

Cheers,

Quoted 4 lines

~Michal

#5 lore raw

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

Quoted 38 lines · Julien Grall

On Mon, 27 Jan 2025 at 09:52, Michal Orzel <[email protected] <mailto:[email protected]>> wrote:

On 27/01/2025 12:19, Julien Grall wrote:
>
>
>
>
>
> On Mon, 27 Jan 2025 at 07:46, Michal Orzel <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>
>     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.
>
>
> Usually, we add a BUILD_BUG_ON when other parts of the code rely on a specific property (in this case alignment). Can you explain in the commit message why the new check is still ok? Well, the change itself reflects the change in alignment requirement.
When paddr_t is 64b (Arm64, Arm32 with PA=40b) the alignment is 8B.
On Arm32 with PA=32b, the alignment is 4B because paddr_t is 4B.

AFAICT you requested this check back then, because struct membanks contains flexible array member 'bank' of type struct membank. The alignment requirement of struct membanks becomes the requirement of struct membank whose largest type is paddr_t.

Quoted 7 lines

Reading this, it sounds like you want to check against the alignment of « struct membank ». This is because the structure could gain a 64-bit field in the future and this would not be caught by the BUILD_BUG_ON.

Let me know how you would like to have this written in commit msg.

I think it needs to be rephrased to make clear the alignment of  struct membanks should be the same as struct membank.

Shouldn't this check therefore be changed to:
BUILD_BUG_ON(alignof(struct membanks) != alignof(struct membank));

~Michal

#6 lore raw

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

Hi Michal,

Quoted 4 lines · Michal Orzel
Quoted 1 line

I think it needs to be rephrased to make clear the alignment of struct

membanks should be the same as struct membank. Shouldn't this check therefore be changed to:
BUILD_BUG_ON(alignof(struct membanks) != alignof(struct membank));

Yes it should be changed.

Cheers,

Quoted 3 lines

~Michal

Reviewed-by Tested-by on v1 1/2
#7 lore raw

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

In reply to Michal Orzel

Hi Michal,

Quoted 10 lines · Michal Orzel

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);

Quoted 6 lines

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")

---

Apart from Julien’s comments for which I’ll leave you both to agree on a solution, I’ve reproduced the issue and tested that your change is fixing it and it’s not breaking a different setup (e.g. 64 bit).

#8 lore raw

PATCH 2/2 xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

In reply to Michal Orzel

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()")
---
 xen/arch/arm/include/asm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/include/asm/mm.h +1 -1
index f91ff088f6b1..a0d8e5afe977 100644
@@ -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
Signature · 1 line
2.25.1
Reviewed-by Tested-by on v1 2/2
#9 lore raw

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

Hi Michal,

Quoted 7 lines · Michal Orzel

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",

Quoted 8 lines

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()")

---

I’ve tested this one and it fix the compilation issue on the above setup, I’ve also tested that it doesn’t introduce issues on other setup (e.g. arm64)

Reviewed-by
#10 lore raw

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

Quoted 18 lines · Luca Fancellu

Hi Michal,

Quoted 7 lines · Michal Orzel

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",

Quoted 8 lines

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()")

---

Quoted 5 lines

I’ve tested this one and it fix the compilation issue on the above setup, I’ve also tested that it doesn’t introduce issues on other setup (e.g. arm64)

#11 lore raw

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

In reply to Michal Orzel

Hi,

Quoted 21 lines · Michal Orzel

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()")
---
 xen/arch/arm/include/asm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/include/asm/mm.h +0 -0
index f91ff088f6b1..a0d8e5afe977 100644

xen/arch/arm/include/asm/mm.h static inline void __iomem *ioremap_wc(paddr_t start, size_t len) · line 269

Quoted 8 lines
xen/arch/arm/include/asm/mm.h +1 -1
@@ -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

Out of curiosity, why not make va_to_par() and __va_to_par() return paddr_t rather than uint64_t? Then this cast would be unnecessary and the expression end up as unsigned long.

That would also cover any other uses outside this macro.

Unless I'm missing something else...

Cheers,
Alejandro

#12 lore raw

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

Quoted 39 lines · Alejandro Vallejo

Hi,

Quoted 21 lines · Michal Orzel

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()")
---
 xen/arch/arm/include/asm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/include/asm/mm.h +0 -0
index f91ff088f6b1..a0d8e5afe977 100644

xen/arch/arm/include/asm/mm.h static inline void __iomem *ioremap_wc(paddr_t start, size_t len) · line 269

Quoted 8 lines
xen/arch/arm/include/asm/mm.h +1 -1
@@ -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

Out of curiosity, why not make va_to_par() and __va_to_par() return paddr_t rather than uint64_t? Then this cast would be unnecessary and the expression end up as unsigned long.

Quoted 3 lines

That would also cover any other uses outside this macro.

Unless I'm missing something else...

va_to_par() returns uint64_t because PAR_EL1 on Arm64 or PAR on Arm32 system registers are both 64bit. So, it would not make sense (also it would be confusing) for va_to_par() to return already casted value. The function ends with _par so it should reflect the register size as the name suggests. Macro is there to cast this value as it also takes into account PADDR_MASK and PAGE_MASK.

~Michal

#13 lore raw

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

Quoted 44 lines · Michal Orzel
Quoted 41 lines · Alejandro Vallejo

Hi,

Quoted 21 lines · Michal Orzel

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()")
---
 xen/arch/arm/include/asm/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/include/asm/mm.h +0 -0
index f91ff088f6b1..a0d8e5afe977 100644

xen/arch/arm/include/asm/mm.h static inline void __iomem *ioremap_wc(paddr_t start, size_t len) · line 269

Quoted 8 lines
xen/arch/arm/include/asm/mm.h +1 -1
@@ -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

Out of curiosity, why not make va_to_par() and __va_to_par() return paddr_t rather than uint64_t? Then this cast would be unnecessary and the expression end up as unsigned long.

That would also cover any other uses outside this macro.

Quoted 7 lines
Quoted 1 line

Unless I'm missing something else...

va_to_par() returns uint64_t because PAR_EL1 on Arm64 or PAR on Arm32 system registers are both 64bit. So, it would not make sense (also it would be confusing) for va_to_par() to return already casted value. The function ends with _par so it should reflect the register size as the name suggests. Macro is there to cast this value as it also takes into account PADDR_MASK and PAGE_MASK.

~Michal

I see. The point is to keep va_to_par() in sync with PAR's width then.

Fair enough then.

Cheers,
Alejandro

#14 lore raw
In reply to Michal Orzel
Quoted 4 lines · Michal Orzel

This series contains build fixes when CONFIG_PHYS_ADDR_T_32=y.

@Oleksii:
This is a release blocker.

Agree, we can't proceed with release if we have build issues. So with proper review:

Thanks.

~ Oleksii

Quoted 9 lines

Michal Orzel (2):
device-tree: bootfdt: Fix build issue when CONFIG_PHYS_ADDR_T_32=y xen/arm: Fix build issue when CONFIG_PHYS_ADDR_T_32=y

  xen/arch/arm/include/asm/mm.h    | 2 +-
  xen/common/device-tree/bootfdt.c | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)