From: Javier Martinez Canillas <javierm@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Peter Jones <pjones@redhat.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Alexander Larsson <alexl@redhat.com>, Al Stone <ahs3@redhat.com>,
linux-efi@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Andrew Halaney <ahalaney@redhat.com>,
linux-rt-users@vger.kernel.org, Brian Masney <bmasney@redhat.com>,
Robbie Harwood <rharwood@redhat.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] efi: Allow to enable EFI runtime services with PREEMPT_RT
Date: Thu, 31 Mar 2022 16:10:38 +0200 [thread overview]
Message-ID: <20220331141038.171204-1-javierm@redhat.com> (raw)
Commit d9f283ae71af ("efi: Disable runtime services on RT") disabled EFI
runtime services when the CONFIG_PREEMPT_RT option is enabled.
The rationale for the change is that some EFI calls could take too much
time, leading to large latencies which are an issue for RT kernels.
But a side effect of that commit is that now is not possible anymore to
enable the EFI runtime services by default when CONFIG_PREEMPT_RT is set
to y, even for platforms that could guarantee bounded time for EFI calls.
Instead, let's add a new EFI_DISABLE_RUNTIME boolean Kconfig option, that
would be set to n by default but to y if CONFIG_PREEMPT_RT is enabled.
That way, the current behaviour is preserved but gives users a mechanism
to enable the EFI runtimes services in their kernels if that is required.
Reported-by: Alexander Larsson <alexl@redhat.com>
Fixes: d9f283ae71af ("efi: Disable runtime services on RT")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/firmware/efi/Kconfig | 15 +++++++++++++++
drivers/firmware/efi/efi.c | 2 +-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig
index 2c3dac5ecb36..3c5373de86fc 100644
--- a/drivers/firmware/efi/Kconfig
+++ b/drivers/firmware/efi/Kconfig
@@ -284,3 +284,18 @@ config EFI_CUSTOM_SSDT_OVERLAYS
See Documentation/admin-guide/acpi/ssdt-overlays.rst for more
information.
+
+config EFI_DISABLE_RUNTIME
+ bool "Disable EFI runtime services support by default"
+ default y if PREEMPT_RT
+ help
+ Allow to disable the EFI runtime services support by default. This can
+ already be achieved by using the efi=noruntime option, but it could be
+ useful to have this default without any kernel command line parameter.
+
+ The EFI runtime services are disabled by default when PREEMPT_RT is
+ enabled, because measurements have shown that some EFI functions calls
+ might take too much time to complete, causing large latencies which are
+ an issue for RT.
+
+ This default can be overridden by using the efi=runtime option.
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 5502e176d51b..ff57db8f8d05 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -66,7 +66,7 @@ struct mm_struct efi_mm = {
struct workqueue_struct *efi_rts_wq;
-static bool disable_runtime = IS_ENABLED(CONFIG_PREEMPT_RT);
+static bool disable_runtime = IS_ENABLED(CONFIG_EFI_DISABLE_RUNTIME);
static int __init setup_noefi(char *arg)
{
disable_runtime = true;
--
2.35.1
next reply other threads:[~2022-03-31 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 14:10 Javier Martinez Canillas [this message]
2022-03-31 14:13 ` [PATCH] efi: Allow to enable EFI runtime services with PREEMPT_RT Sebastian Andrzej Siewior
2022-03-31 14:25 ` Javier Martinez Canillas
2022-03-31 14:40 ` Sebastian Andrzej Siewior
2022-03-31 14:50 ` Javier Martinez Canillas
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=20220331141038.171204-1-javierm@redhat.com \
--to=javierm@redhat.com \
--cc=ahalaney@redhat.com \
--cc=ahs3@redhat.com \
--cc=alexl@redhat.com \
--cc=ardb@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=bmasney@redhat.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=pjones@redhat.com \
--cc=rharwood@redhat.com \
--cc=tglx@linutronix.de \
/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