Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] efi: Allow to auto-disable it on RT
@ 2019-08-16 15:57 Sebastian Andrzej Siewior
  2019-08-16 15:57 ` [PATCH 1/2] efi: Allow efi=runtime Sebastian Andrzej Siewior
  2019-08-16 15:57 ` [PATCH 2/2] efi: Disable runtime services on RT Sebastian Andrzej Siewior
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-08-16 15:57 UTC (permalink / raw)
  To: linux-efi; +Cc: Ard Biesheuvel, tglx

Hi,

since we have CONFIG_PREEMPT_RT these two patches allow to auto-disable
EFI runtime services on RT while it is still possible to override it and
use it if needed.

Sebastian


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] efi: Allow efi=runtime
  2019-08-16 15:57 [PATCH 0/2] efi: Allow to auto-disable it on RT Sebastian Andrzej Siewior
@ 2019-08-16 15:57 ` Sebastian Andrzej Siewior
  2019-08-16 15:57 ` [PATCH 2/2] efi: Disable runtime services on RT Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-08-16 15:57 UTC (permalink / raw)
  To: linux-efi; +Cc: Ard Biesheuvel, tglx, Sebastian Andrzej Siewior

In case the option "efi=noruntime" is default at built-time, the user
could overwrite its state by `efi=runtime' and allow it again.

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/firmware/efi/efi.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -114,6 +114,9 @@ static int __init parse_efi_cmdline(char
 	if (parse_option_str(str, "noruntime"))
 		disable_runtime = true;
 
+	if (parse_option_str(str, "runtime"))
+		disable_runtime = false;
+
 	return 0;
 }
 early_param("efi", parse_efi_cmdline);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] efi: Disable runtime services on RT
  2019-08-16 15:57 [PATCH 0/2] efi: Allow to auto-disable it on RT Sebastian Andrzej Siewior
  2019-08-16 15:57 ` [PATCH 1/2] efi: Allow efi=runtime Sebastian Andrzej Siewior
@ 2019-08-16 15:57 ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-08-16 15:57 UTC (permalink / raw)
  To: linux-efi; +Cc: Ard Biesheuvel, tglx, Sebastian Andrzej Siewior

Based on meassurements the EFI functions get_variable /
get_next_variable take up to 2us which looks okay.
The functions get_time, set_time take around 10ms. Those 10ms are too
much. Even one ms would be too much.
Ard mentioned that SetVariable might even trigger larger latencies if
the firware will erase flash blocks on NOR.

The time-functions are used by efi-rtc and can be triggered during
runtimed (either via explicit read/write or ntp sync).

The variable write could be used by pstore.
These functions can be disabled without much of a loss. The poweroff /
reboot hooks may be provided by PSCI.

Disable EFI's runtime wrappers.

This was observed on "EFI v2.60 by SoftIron Overdrive 1000".

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/firmware/efi/efi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -88,7 +88,7 @@ struct mm_struct efi_mm = {
 
 struct workqueue_struct *efi_rts_wq;
 
-static bool disable_runtime;
+static bool disable_runtime = IS_ENABLED(CONFIG_PREEMPT_RT);
 static int __init setup_noefi(char *arg)
 {
 	disable_runtime = true;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 15:57 [PATCH 0/2] efi: Allow to auto-disable it on RT Sebastian Andrzej Siewior
2019-08-16 15:57 ` [PATCH 1/2] efi: Allow efi=runtime Sebastian Andrzej Siewior
2019-08-16 15:57 ` [PATCH 2/2] efi: Disable runtime services on RT Sebastian Andrzej Siewior

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org linux-efi@archiver.kernel.org
	public-inbox-index linux-efi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox