Skip to contentSkip to conversation

ARM: Make pgtbl macro more robust

PATCH In review Christopher Covington 2 participants 3 messages Jan 6, 2014 – Jan 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Make pgtbl macro more robust

The pgtbl macro couldn't handle the specific (TEXT_OFFSET - PG_DIR_SIZE) value that the combination of MSM platforms and LPAE created:

head.S:163: Error: invalid constant (203000) after fixup

Regardless of whether this combination of configuration options will work on currently support platforms at run time, make it at least assemble properly.

---
 arch/arm/kernel/head.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/kernel/head.S +2 -1
index 9cf6063..af30cac 100644
@@ -52,7 +52,8 @@
 	.equ	swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE
 
 	.macro	pgtbl, rd, phys
-	add	\rd, \phys, #TEXT_OFFSET - PG_DIR_SIZE
+	add	\rd, \phys, #TEXT_OFFSET
+	sub	\rd, \rd, #PG_DIR_SIZE
 	.endm
 
 /*
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Christopher Covington

The pgtbl macro couldn't handle the specific (TEXT_OFFSET - PG_DIR_SIZE) value that the combination of MSM platforms and LPAE created:

head.S:163: Error: invalid constant (203000) after fixup

Regardless of whether this combination of configuration options will work on currently support platforms at run time, make it at least assemble properly.

Looks good to me.

I think you can put it in the patch tracker. Russell?

Quoted 18 lines
---
 arch/arm/kernel/head.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/kernel/head.S +2 -1
index 9cf6063..af30cac 100644
@@ -52,7 +52,8 @@
 	.equ	swapper_pg_dir, KERNEL_RAM_VADDR - PG_DIR_SIZE
 
 	.macro	pgtbl, rd, phys
-	add	\rd, \phys, #TEXT_OFFSET - PG_DIR_SIZE
+	add	\rd, \phys, #TEXT_OFFSET
+	sub	\rd, \rd, #PG_DIR_SIZE
 	.endm
 
 /*
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#2 lore raw
Quoted 11 lines · Stephen Boyd
Quoted 10 lines · Christopher Covington

The pgtbl macro couldn't handle the specific (TEXT_OFFSET - PG_DIR_SIZE) value that the combination of MSM platforms and LPAE created:

head.S:163: Error: invalid constant (203000) after fixup

Regardless of whether this combination of configuration options will work on currently support platforms at run time, make it at least assemble properly.

Quoted 7 lines
Quoted 1 line

Looks good to me.

I think you can put it in the patch tracker. Russell?

Added as

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7947/1

Regards,
Christopher

Signature · 3 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.