[PATCH 1/2] xen/arm32: head: Move earlyprintk 'hex' to .rodata.idmap

Michal Orzel posted 2 patches 2 years ago
[PATCH 1/2] xen/arm32: head: Move earlyprintk 'hex' to .rodata.idmap
Posted by Michal Orzel 2 years ago
Thanks to 1ec3fe1f664f ("xen/arm32: head: Improve logging in head.S"),
we can now use PRINT_ID() macro to print messages when running on
identity mapping. For that, all the strings need to be part of the first
page that is mapped. This is not the case for a 'hex' string (used by
asm_putn when printing register values), which currently resides in
.rodata.str. Move it to .rodata.idmap to allow making use of print_reg
macro from anywhere (mostly to aid debugging).

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm32/head.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 99d7d4aa63d1..b488a21a71ba 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -320,7 +320,7 @@ ENTRY(asm_putn)
         mov   pc, lr
 ENDPROC(asm_putn)
 
-RODATA_STR(hex, "0123456789abcdef")
+RODATA_SECT(.rodata.idmap, hex, "0123456789abcdef")
 
 #endif /* CONFIG_EARLY_PRINTK */
 
-- 
2.25.1
Re: [PATCH 1/2] xen/arm32: head: Move earlyprintk 'hex' to .rodata.idmap
Posted by Julien Grall 2 years ago
Hi Michal,

On 15/01/2024 12:48, Michal Orzel wrote:
> Thanks to 1ec3fe1f664f ("xen/arm32: head: Improve logging in head.S"),
> we can now use PRINT_ID() macro to print messages when running on
> identity mapping. For that, all the strings need to be part of the first
> page that is mapped. This is not the case for a 'hex' string (used by
> asm_putn when printing register values), which currently resides in
> .rodata.str. Move it to .rodata.idmap to allow making use of print_reg
> macro from anywhere (mostly to aid debugging).
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall