All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Luis Chamberlain <mcgrof@kernel.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-modules@vger.kernel.org
Subject: [PATCH 3/3] powerpc: Simplify strict_kernel_rwx_enabled()
Date: Thu, 21 Dec 2023 10:02:48 +0100	[thread overview]
Message-ID: <c54d7059af678e68a44f308b5b7257de1f185593.1703149011.git.christophe.leroy@csgroup.eu> (raw)
In-Reply-To: <7b5df1782e94a755b4a18733af44d17d8dd8b37b.1703149011.git.christophe.leroy@csgroup.eu>

Now that rodata_enabled is always declared, remove #ifdef
and define a single version of strict_kernel_rwx_enabled().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/include/asm/mmu.h | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index d8b7e246a32f..24241995f740 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -330,17 +330,10 @@ static __always_inline bool early_radix_enabled(void)
 	return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
 }
 
-#ifdef CONFIG_STRICT_KERNEL_RWX
 static inline bool strict_kernel_rwx_enabled(void)
 {
-	return rodata_enabled;
+	return IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) && rodata_enabled;
 }
-#else
-static inline bool strict_kernel_rwx_enabled(void)
-{
-	return false;
-}
-#endif
 
 static inline bool strict_module_rwx_enabled(void)
 {
-- 
2.41.0


WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-modules@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] powerpc: Simplify strict_kernel_rwx_enabled()
Date: Thu, 21 Dec 2023 10:02:48 +0100	[thread overview]
Message-ID: <c54d7059af678e68a44f308b5b7257de1f185593.1703149011.git.christophe.leroy@csgroup.eu> (raw)
In-Reply-To: <7b5df1782e94a755b4a18733af44d17d8dd8b37b.1703149011.git.christophe.leroy@csgroup.eu>

Now that rodata_enabled is always declared, remove #ifdef
and define a single version of strict_kernel_rwx_enabled().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/include/asm/mmu.h | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index d8b7e246a32f..24241995f740 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -330,17 +330,10 @@ static __always_inline bool early_radix_enabled(void)
 	return early_mmu_has_feature(MMU_FTR_TYPE_RADIX);
 }
 
-#ifdef CONFIG_STRICT_KERNEL_RWX
 static inline bool strict_kernel_rwx_enabled(void)
 {
-	return rodata_enabled;
+	return IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) && rodata_enabled;
 }
-#else
-static inline bool strict_kernel_rwx_enabled(void)
-{
-	return false;
-}
-#endif
 
 static inline bool strict_module_rwx_enabled(void)
 {
-- 
2.41.0


  parent reply	other threads:[~2023-12-21  9:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  9:02 [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time Christophe Leroy
2023-12-21  9:02 ` Christophe Leroy
2023-12-21  9:02 ` [PATCH 2/3] modules: Remove #ifdef CONFIG_STRICT_MODULE_RWX around rodata_enabled Christophe Leroy
2023-12-21  9:02   ` Christophe Leroy
2023-12-21  9:02 ` Christophe Leroy [this message]
2023-12-21  9:02   ` [PATCH 3/3] powerpc: Simplify strict_kernel_rwx_enabled() Christophe Leroy
2023-12-21 12:16 ` [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time Michael Ellerman
2023-12-21 12:16   ` Michael Ellerman
2023-12-22  5:35   ` Kees Cook
2023-12-22  5:35     ` Kees Cook
2023-12-22 18:23     ` Christophe Leroy
2023-12-22 18:23       ` Christophe Leroy
2024-01-29 20:09 ` Luis Chamberlain
2024-01-29 20:09   ` Luis Chamberlain
2024-01-30  9:16   ` Chen-Yu Tsai
2024-01-30  9:16     ` Chen-Yu Tsai
2024-01-30 11:03     ` Christophe Leroy
2024-01-30 11:03       ` Christophe Leroy
     [not found]       ` <CGME20240130174812eucas1p166f62549457fd188fed6ed72b6b4b9cd@eucas1p1.samsung.com>
2024-01-30 17:48         ` Marek Szyprowski
2024-01-30 17:48           ` Marek Szyprowski
2024-01-30 20:27           ` Luis Chamberlain
2024-01-30 20:27             ` Luis Chamberlain
2024-01-31  6:53             ` Christophe Leroy
2024-01-31  6:53               ` Christophe Leroy
2024-01-31 22:16               ` Luis Chamberlain
2024-01-31 22:16                 ` Luis Chamberlain
2024-01-31 11:58           ` Christophe Leroy
2024-01-31 11:58             ` Christophe Leroy
2024-01-31 15:17             ` Marek Szyprowski
2024-01-31 15:17               ` Marek Szyprowski
2024-01-31 20:07               ` Christophe Leroy
2024-01-31 20:07                 ` Christophe Leroy
2024-01-31 20:07                 ` Christophe Leroy
2024-01-31 22:10                 ` Marek Szyprowski
2024-01-31 22:10                   ` Marek Szyprowski
2024-01-31 22:10                   ` Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c54d7059af678e68a44f308b5b7257de1f185593.1703149011.git.christophe.leroy@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mcgrof@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.