Skip to contentSkip to conversation

arm64: Add FIX_HOLE to permanent fixed addresses

PATCH New Laura Abbott 2 participants 2 messages Nov 26, 2014 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Add FIX_HOLE to permanent fixed addresses

Every other architecture with permanent fixed addresses has FIX_HOLE as the first entry. This seems to be designed as a debugging aid but there are a couple of side effects of not having FIX_HOLE:

- If the first fixed address is 0, fix_to_virt -> virt_to_fix triggers a BUG_ON for the virtual address being equal to FIXADDR_TOP
- fix_to_virt may return a value outside of FIXADDR_START and FIXADDR_TOP which may look like a bug to a developer.

Match up with other architectures and make everything clearer by adding FIX_HOLE.

---
 arch/arm64/include/asm/fixmap.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/include/asm/fixmap.h +1 -0
index 5f7bfe6..424a10f 100644
@@ -31,6 +31,7 @@
  *
  */
 enum fixed_addresses {
+	FIX_HOLE,
 	FIX_EARLYCON_MEM_BASE,
 	__end_of_permanent_fixed_addresses,
 
Signature · 2 lines
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
#1 lore raw

PATCH 1/1 arm64: Add FIX_HOLE to permanent fixed addresses

Quoted 24 lines · Laura Abbott

Every other architecture with permanent fixed addresses has FIX_HOLE as the first entry. This seems to be designed as a debugging aid but there are a couple of side effects of not having FIX_HOLE:

- If the first fixed address is 0, fix_to_virt -> virt_to_fix triggers a BUG_ON for the virtual address being equal to FIXADDR_TOP
- fix_to_virt may return a value outside of FIXADDR_START and FIXADDR_TOP which may look like a bug to a developer.

Match up with other architectures and make everything clearer by adding FIX_HOLE.

---
 arch/arm64/include/asm/fixmap.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/include/asm/fixmap.h +0 -0
index 5f7bfe6..424a10f 100644

arch/arm64/include/asm/fixmap.h line 36

Quoted 6 lines
arch/arm64/include/asm/fixmap.h +1 -0
@@ -31,6 +31,7 @@
  *
  */
 enum fixed_addresses {
+	FIX_HOLE,
 	FIX_EARLYCON_MEM_BASE,
 	__end_of_permanent_fixed_addresses,

Looks sensible to me, thanks.

Will