linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akihiro Suda <suda.kyoto@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-efi@vger.kernel.org, Linux x86 <x86@kernel.org>
Subject: [PATCH] efi: bump efistub version from 1.1 to 3.0 for VZLinuxBootLoader compatibility
Date: Sun, 28 May 2023 16:58:57 +0900	[thread overview]
Message-ID: <CAG8fp8Te=oT1JJhTpOZvgWJrgcTq2DXan8UOVZ=KYCYNa8cKog@mail.gmail.com> (raw)

- LINUX_EFISTUB_MAJOR_VERSION is bumped from 1 (0b1) to 3 (0b11).
  The value is now a bitfield. The next version will be 7 (0b111).

- LINUX_EFISTUB_MINOR_VERSION is pinned to 0x0, because Apple's
  VZLinuxBootLoader [1] cannot boot a kernel with other minor version value [2],
  even though it does not use UEFI. Tested with macOS 13.4 (x86_64).

[1] https://developer.apple.com/documentation/virtualization/vzlinuxbootloader
[2] https://lore.kernel.org/linux-efi/CAG8fp8Teu4G9JuenQrqGndFt2Gy+V4YgJ=hN1xX7AD940YKf3A@mail.gmail.com/

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217485
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
---
 include/linux/pe.h | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/include/linux/pe.h b/include/linux/pe.h
index 5e1e11540870..ee5ade19b7eb 100644
--- a/include/linux/pe.h
+++ b/include/linux/pe.h
@@ -27,9 +27,25 @@
  * On x86, LoadImage() and StartImage() can be omitted if the EFI handover
  * protocol is implemented, which can be inferred from the version,
  * handover_offset and xloadflags fields in the bootparams structure.
+ *
+ * Linux EFI stub v1.1 unconditionally enabled initrd command line loader,
+ * which was previously gated by CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER.
+ *
+ * Linux EFI stub v3.0 changed the major version to be a bitfield (0b11).
+ * The rightmost bit means that it is compatible with v1.0 at least.
+ * The second rightmost bit means that initrd command line loader is enabled.
+ * So, there is no v2.0 (0b10), and the next version will be v7.0 (0b111).
+ */
+#define LINUX_EFISTUB_MAJOR_VERSION            0x3
+
+/*
+ * LINUX_EFISTUB_MINOR_VERSION is pinned to 0x0, because Apple's
+ * VZLinuxBootLoader cannot boot a kernel with other minor version value, even
+ * though it does not use UEFI. Tested with macOS 13.4 (x86_64).
+ *
+ * https://lore.kernel.org/linux-efi/CAG8fp8Teu4G9JuenQrqGndFt2Gy+V4YgJ=hN1xX7AD940YKf3A@mail.gmail.com/
  */
-#define LINUX_EFISTUB_MAJOR_VERSION            0x1
-#define LINUX_EFISTUB_MINOR_VERSION            0x1
+#define LINUX_EFISTUB_MINOR_VERSION            0x0

 /*
  * LINUX_PE_MAGIC appears at offset 0x38 into the MS-DOS header of EFI bootable
-- 
2.39.2

             reply	other threads:[~2023-05-28  7:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-28  7:58 Akihiro Suda [this message]
2023-05-28 18:48 ` [PATCH] efi: bump efistub version from 1.1 to 3.0 for VZLinuxBootLoader compatibility Ard Biesheuvel
2023-05-29  0:51   ` Akihiro Suda
2023-06-02 20:29     ` Akihiro Suda
2023-06-02 22:52       ` Ard Biesheuvel
2023-06-03 10:50         ` Akihiro Suda

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='CAG8fp8Te=oT1JJhTpOZvgWJrgcTq2DXan8UOVZ=KYCYNa8cKog@mail.gmail.com' \
    --to=suda.kyoto@gmail.com \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).