Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1738181rwd; Sun, 28 May 2023 01:29:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ClOZfvsvlBikoy6OYMlxmgbwR3UGNfpiTVSZSBK8G2mexcIJiMaI4M9BLTOwlrVnRESF2 X-Received: by 2002:a05:6a00:c86:b0:63d:3595:26db with SMTP id a6-20020a056a000c8600b0063d359526dbmr11338318pfv.23.1685262543700; Sun, 28 May 2023 01:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685262543; cv=none; d=google.com; s=arc-20160816; b=SdE6yiEycc3f5eG3h5OrXZ8elvMwD4DgMmjE2KilcFEaQ5q23kXoYbnPgjXJxRDmmK FRqSbZK4jRzQVxg0cM5hWMaV7gVlRLHtrAq6GV/iDZTnF/HGZLKkLI+ax09cmygDAtkL HjfPauIgwYiWZjXdKyEa6z18KDpnNNDF0QfTAW2NiN51G/ZCNvNryaOsqgi+TPsMi+Qw bgESX8n5xd0fWip/uCZsUBBtz83lC0podWGjS/Ylsjwkj6AG4gGe8ZXWEER65s7cXpQL zqtMJ3oENvg6q1guwRSaZdTUCPscl/vCk6oh+eOPUWWEs9XSTBVhee61vlIrq6StuNpl ayHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=RQ0EJ4YOOjKzukNaJdp3RRoDpGh0O633yjDT5laO8nE=; b=CriVG1OGOhxnPYbMvf3uz5leTJjYZYEo8YeixY+r8DX4I/+OtYAzpJSVe5KJdF/f/5 k0natcc28dmVvO6zzQl9AanrHc+TvXlvAU07XxkZFCI2myPHuoaf9e0jXQgVL0t9TFRE PXengsxnsRyPNXhxH0l6dWTEvxV6iUI+ParZ9p5c/y/SzqBg1Bm74c8j9WyQ2HjYtnmj cZzQT0YpCdqQ1eTxvtCUhG4v+KHd8aP8uwPFUmxSeY03KMxqNvbh4MJZOxBxqvT/j2z1 HvSWlAmuJChkty33XUyHg6+QWIfLuWN0QSa/OzRLeaXO4AIYyLJ+MC0NGRrXD9AQj+Wq NeDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dz4dOwD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z29-20020aa7949d000000b0064d5aab3ec5si5351916pfk.156.2023.05.28.01.28.49; Sun, 28 May 2023 01:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dz4dOwD8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjE1H7M (ORCPT + 99 others); Sun, 28 May 2023 03:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjE1H7K (ORCPT ); Sun, 28 May 2023 03:59:10 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FE6D8; Sun, 28 May 2023 00:59:09 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-b9daef8681fso1766387276.1; Sun, 28 May 2023 00:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685260749; x=1687852749; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RQ0EJ4YOOjKzukNaJdp3RRoDpGh0O633yjDT5laO8nE=; b=dz4dOwD8yLWJsXuYSJDvP8Ot0Y+Y5dFBExUr8K+KpRfAL0oEsuh6WALEGRrQSdvYHB tUtrkFRZi16ZydeDYYqBalKheEKbzHk7/Ev5302t8NWW2F6WVXae8BrH6CPetXgP0Fil yH/VuRtzDmgZNtN49kgwkJsbfXeyKe9y4D7fV4BVL+f4nuUQKFl/VhEZfqiCEPQd3pLe dgRliz30C6Z+5TwFqrC0e1oLpqT8q9Cf/YQRDLiftNQwUse3xzYA2lTIgX4t5PgjElAN ng0g4Pw7bzfrV4xUkx7ijxQcT1wzJsKReUZXotT8PzI9mAIVd9qPtLcAqYXurjIRafvq gmNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685260749; x=1687852749; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RQ0EJ4YOOjKzukNaJdp3RRoDpGh0O633yjDT5laO8nE=; b=JAI5wDzWi33SkNraaoaC6Sc33mR53SdkcsykGw/90DUuXCLxlcVv6THlzVCPBMjEEl Ptgu/UHYoR8OiGh19kCj67FB85JUKC0K3bFrPGAKikAsnx0+RLJyER+/o60stGdioJqN q4BlHJxJGOpINdJCtz3c80U9qBib3F3uBRTYnVM52ldXwT48smIHaw7COrzDoyNYE3qL 510hUCollcJnKgtagEAwT09sP20oMxloqTCrMdBX1hjiR1/y1DIx1wAJmn7Pr+DG6luD 074blReq5HRiDvmwJqio15D3s15FsKrypOC+plK1AdDmljt3an4XYjXWwOqU54Axn2Qg GRdg== X-Gm-Message-State: AC+VfDylPFfG11J3SGtTCzy5WQw+MJi3uNjHsMi4ngOeKvDCgyZMVHPY EfFy+Xy1MLHy0OVh4J+vhJ151CbiTHk75B6DkxT+lDDrYPlymQ== X-Received: by 2002:a81:4fcd:0:b0:561:8ffb:5b72 with SMTP id d196-20020a814fcd000000b005618ffb5b72mr7747342ywb.48.1685260748889; Sun, 28 May 2023 00:59:08 -0700 (PDT) MIME-Version: 1.0 From: Akihiro Suda Date: Sun, 28 May 2023 16:58:57 +0900 Message-ID: Subject: [PATCH] efi: bump efistub version from 1.1 to 3.0 for VZLinuxBootLoader compatibility To: Linux Kernel Mailing List , Ard Biesheuvel , linux-efi@vger.kernel.org, Linux x86 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - 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 --- 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