2024-03-20 06:49:02

by Dawei Li

[permalink] [raw]
Subject: [PATCH 0/2] Minor cleanup of pgtable_l{4,5}_enabled

Hi,

This is a trivial series of minor cleanup of pgtable_l{4,5}_enabled.

Change since v1:
- Split into 2 patches, as suggested by Alex.
- Add Reviewed-by from Alex.

v1:
https://lore.kernel.org/all/[email protected]/

Dawei Li (2):
riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled
riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init

arch/riscv/mm/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
2.27.0



2024-03-20 06:49:16

by Dawei Li

[permalink] [raw]
Subject: [PATCH 1/2] riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled

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

Signed-off-by: Dawei Li <[email protected]>
Reviewed-by: Alexandre Ghiti <[email protected]>
---
arch/riscv/mm/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index fa34cf55037b..bab3e9943bb5 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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 = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled = !IS_ENABLED(CONFIG_XIP_KERNEL);
EXPORT_SYMBOL(pgtable_l4_enabled);
EXPORT_SYMBOL(pgtable_l5_enabled);
#endif
--
2.27.0


2024-03-20 06:49:29

by Dawei Li

[permalink] [raw]
Subject: [PATCH 2/2] riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init

pgtable_l{4,5}_enabled are read only after initialization, make explicit
annotation of __ro_after_init on them.

Signed-off-by: Dawei Li <[email protected]>
Reviewed-by: Alexandre Ghiti <[email protected]>
---
arch/riscv/mm/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index bab3e9943bb5..204cdf5b829d 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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_XIP_KERNEL);
-bool pgtable_l5_enabled = !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
--
2.27.0


Subject: Re: [PATCH 0/2] Minor cleanup of pgtable_l{4,5}_enabled

Hello:

This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <[email protected]>:

On Wed, 20 Mar 2024 14:47:10 +0800 you wrote:
> Hi,
>
> This is a trivial series of minor cleanup of pgtable_l{4,5}_enabled.
>
> Change since v1:
> - Split into 2 patches, as suggested by Alex.
> - Add Reviewed-by from Alex.
>
> [...]

Here is the summary with links:
- [1/2] riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled
https://git.kernel.org/riscv/c/3a0dc44899d4
- [2/2] riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init
https://git.kernel.org/riscv/c/7a04dd8fd75b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html