Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <shijie@os.amperecomputing.com>
To: catalin.marinas@arm.com, will@kernel.org
Cc: patches@amperecomputing.com, cl@os.amperecomputing.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, adamli@os.amperecomputing.com,
	Huang Shijie <shijie@os.amperecomputing.com>
Subject: [PATCH] arm64: set "rodata=on" as default
Date: Mon, 21 Oct 2024 13:39:48 +0800	[thread overview]
Message-ID: <20241021053948.5848-1-shijie@os.amperecomputing.com> (raw)

From Documentation/admin-guide/kernel-parameters.txt, we know that:
 rodata=	[KNL,EARLY]
	on	Mark read-only kernel memory as read-only (default).
	off	Leave read-only kernel memory writable for debugging.
	full	Mark read-only kernel memory and aliases as read-only
		[arm64]

So the "rodata=on" is the default.

But the current code does not follow the document, it makes "rodata=full"
as the default.

After patch
  commit acfa60dbe038 ("arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y")
the "rodata=on" can works fine now.

The "rodata=on" can provide us more block mappings and contiguous hits
to map the linear region which minimize the TLB footprint. And the
linear aliases of pages belonging to read-only mappings in vmalloc
region are also marked as read-only now.

This patch disables RODATA_FULL_DEFAULT_ENABLED by default,
so the default value:
     rodata_full=false, rodata_enabled=true
then the default behavior follows the "rodata=on".
And we can get better performance with the "rodata=on" as the default
too.

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
---
 arch/arm64/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index fd9df6dcc593..6f30f749156e 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1649,7 +1649,6 @@ config MITIGATE_SPECTRE_BRANCH_HISTORY
 
 config RODATA_FULL_DEFAULT_ENABLED
 	bool "Apply r/o permissions of VM areas also to their linear aliases"
-	default y
 	help
 	  Apply read-only attributes of VM areas to the linear alias of
 	  the backing pages as well. This prevents code or read-only data
-- 
2.40.1



             reply	other threads:[~2024-10-21  5:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  5:39 Huang Shijie [this message]
2024-10-23 16:35 ` [PATCH] arm64: set "rodata=on" as default Will Deacon
2024-10-24  3:57   ` Shijie Huang

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=20241021053948.5848-1-shijie@os.amperecomputing.com \
    --to=shijie@os.amperecomputing.com \
    --cc=adamli@os.amperecomputing.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@os.amperecomputing.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@amperecomputing.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox