mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <mol@pengutronix.de>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/6] efi: efi-image: don't mask x86 interrupts on boot
Date: Wed, 23 Oct 2019 18:55:57 +0200	[thread overview]
Message-ID: <20191023165601.16441-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20191023165601.16441-1-a.fatoum@pengutronix.de>

55da0cf1 ("efi: add support for initrd loading") introduced support for
the Linux v3.6+ handover protocol[1]. As part of this change a x86 cli
(Clear Interrupt Flag) instruction was introduced just prior to the jump
into the kernel's EFI handover protocol entry point.

While the normal Linux x86 boot protocols require that interrupts are
masked on entry, this doesn't apply to the EFI stub, because the EFI
stub itself is the one implementing the boot protocol and as such
masks the interrupts itself[2].

EFI watchdogs may, and often are, implemented using a timer interrupt.
Dropping the cli will allow monitoring the boot of the kernel up to it
calling ExitBootServices.

In absence of a hardware watchdog, this is the only watchdog available
to users with EFI 1.0+, so it seems prudent to not make it even more
useless.

[1]: https://www.kernel.org/doc/Documentation/x86/boot.txt
[2]: Linux v5.4-rc4, arch/x86/boot/compressed/eboot.c

Cc: Michael Olbrich <mol@pengutronix.de>
Fixes: 55da0cf1 ("efi: add support for initrd loading")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/efi/efi-image.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/common/efi/efi-image.c b/common/efi/efi-image.c
index 939663a6e250..9c66c9f882c5 100644
--- a/common/efi/efi-image.c
+++ b/common/efi/efi-image.c
@@ -174,7 +174,6 @@ static inline void linux_efi_handover(efi_handle_t handle,
 {
 	handover_fn handover;
 
-	asm volatile ("cli");
 	handover = (handover_fn)((long)header->code32_start + 512 +
 				 header->handover_offset);
 	handover(handle, efi_sys_table, header);
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-10-23 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 16:55 [PATCH 1/6] Documentation: efi: emphasize watchdog deactivation on ExitBootServices Ahmad Fatoum
2019-10-23 16:55 ` Ahmad Fatoum [this message]
2019-10-23 16:55 ` [PATCH 3/6] watchdog: efi: bump down priority below default Ahmad Fatoum
2019-10-23 16:55 ` [PATCH 4/6] watchdog: export priority as device parameter Ahmad Fatoum
2019-10-23 16:56 ` [PATCH 5/6] watchdog: export API to configure watchdogs by name Ahmad Fatoum
2019-10-23 16:56 ` [PATCH 6/6] commands: wd: support configuring watchdog " Ahmad Fatoum
2019-10-24  6:34 ` [PATCH 1/6] Documentation: efi: emphasize watchdog deactivation on ExitBootServices Oleksij Rempel
2019-10-24  7:59 ` Sascha Hauer

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=20191023165601.16441-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mol@pengutronix.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