Skip to contentSkip to conversation

riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled

PATCH In review Dawei Li 2 participants 3 messages Mar 12, 2024 – Mar 20, 2024 RISC-V

lore
Share & tools
lore

Dawei Li

author
#0 lore raw

PATCH 1/1 riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled

IS_ENABLED(CONFIG_64BIT) in assignment of pgtable_l{4,5}_enabled is redundant, remove it.

While at it, annotate pgtable_l{4,5}_enabled with __ro_after_init.

---
 arch/riscv/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/mm/init.c +2 -2
index fa34cf55037b..204cdf5b829d 100644
@@ -50,8 +50,8 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
 EXPORT_SYMBOL(satp_mode);
 
 #ifdef CONFIG_64BIT
-bool pgtable_l4_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
-bool pgtable_l5_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l4_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
 EXPORT_SYMBOL(pgtable_l4_enabled);
 EXPORT_SYMBOL(pgtable_l5_enabled);
 #endif
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Dawei,

Quoted 4 lines · Dawei Li

IS_ENABLED(CONFIG_64BIT) in assignment of pgtable_l{4,5}_enabled is redundant, remove it.

While at it, annotate pgtable_l{4,5}_enabled with __ro_after_init.

I guess this comment ^ implies that you need to split this patch into 2 :)

Feel free to add on both:

Thanks,

Alex

Quoted 21 lines
---
  arch/riscv/mm/init.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/mm/init.c +2 -2
index fa34cf55037b..204cdf5b829d 100644
@@ -50,8 +50,8 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
  EXPORT_SYMBOL(satp_mode);
 
  #ifdef CONFIG_64BIT
-bool pgtable_l4_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
-bool pgtable_l5_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l4_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
  EXPORT_SYMBOL(pgtable_l4_enabled);
  EXPORT_SYMBOL(pgtable_l5_enabled);
  #endif
author
#2 lore raw

Hi Alex,

Thanks for review.

Quoted 10 lines · Alexandre Ghiti

Hi Dawei,

Quoted 4 lines · Dawei Li

IS_ENABLED(CONFIG_64BIT) in assignment of pgtable_l{4,5}_enabled is redundant, remove it.

While at it, annotate pgtable_l{4,5}_enabled with __ro_after_init.

I guess this comment ^ implies that you need to split this patch into 2 :)

Indeed. I Will respin v2 as you suggested.

Quoted 8 lines

Feel free to add on both:

Thanks,

Alex

Thanks,

Dawei

Quoted 19 lines
Quoted 19 lines
---
  arch/riscv/mm/init.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/mm/init.c +2 -2
index fa34cf55037b..204cdf5b829d 100644
@@ -50,8 +50,8 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
  EXPORT_SYMBOL(satp_mode);
  #ifdef CONFIG_64BIT
-bool pgtable_l4_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
-bool pgtable_l5_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l4_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
Quoted 9 lines

arch/riscv/mm/init.c u64 satp_mode __ro_after_init = SATP_MODE_32; · line 57

Quoted 3 lines
arch/riscv/mm/init.c +0 -0
  EXPORT_SYMBOL(pgtable_l4_enabled);
  EXPORT_SYMBOL(pgtable_l5_enabled);
  #endif

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv