linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitaly Wool <vitaly.wool@konsulko.com>
To: linux-kernel@vger.kernel.org, linux-mm <linux-mm@kvack.org>
Cc: Nicolas Pitre <nico@fluxnic.net>, Vitaly Wool <vitaly.wool@konsulko.com>
Subject: [PATCH] arch/Kconfig: JUMP_LABEL should depend on !XIP
Date: Mon, 21 Dec 2020 22:40:05 +0200	[thread overview]
Message-ID: <20201221204004.16138-1-vitaly.wool@konsulko.com> (raw)

There's no point in trying to optimize the code when the code is
executed from a read-only medium (e. g. NOR flash) as in the XIP
case. Moreover, trying to do so in a XIP kernel may result in
faults and kernel crashes so let's explicitly disallow JUMP_LABEL
if XIP_KERNEL configuration option is set.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
---
 arch/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 56b6ccc0e32d..88632c9588ae 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -81,6 +81,7 @@ config JUMP_LABEL
 	bool "Optimize very unlikely/likely branches"
 	depends on HAVE_ARCH_JUMP_LABEL
 	depends on CC_HAS_ASM_GOTO
+	depends on !XIP_KERNEL
 	help
 	 This option enables a transparent branch optimization that
 	 makes certain almost-always-true or almost-always-false branch
-- 
2.29.2


                 reply	other threads:[~2020-12-21 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20201221204004.16138-1-vitaly.wool@konsulko.com \
    --to=vitaly.wool@konsulko.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nico@fluxnic.net \
    /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;
as well as URLs for NNTP newsgroup(s).