[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZoEx8S0_eUDM6Cjq@wunner.de>
Date: Sun, 30 Jun 2024 12:22:41 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Aditya Garg <gargaditya08@...e.com>
Cc: Ard Biesheuvel <ardb@...nel.org>, Hans de Goede <hdegoede@...hat.com>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Orlando Chamberlain <orlandoch.dev@...il.com>,
Kerem Karabay <kekrby@...il.com>
Subject: Re: [PATCH] efi: libstub: add support for the apple_set_os protocol
On Sun, Jun 30, 2024 at 04:42:55AM +0000, Aditya Garg wrote:
> +struct apple_set_os_protocol {
> + u64 version;
> + efi_status_t (__efiapi *set_os_version) (const char *);
> + efi_status_t (__efiapi *set_os_vendor) (const char *);
> + struct {
> + u32 version;
> + u32 set_os_version;
> + u32 set_os_vendor;
> + } mixed_mode;
> +};
Only the very first MacBooks that shipped in 2006 used a 32-bit EFI.
We don't need to call apple_set_os on those, so just get rid of the
mixed_mode portion of this struct and then ...
> @@ -321,6 +345,9 @@ static void setup_quirks(struct boot_params *boot_params)
> if (IS_ENABLED(CONFIG_APPLE_PROPERTIES) &&
> !memcmp(efistub_fw_vendor(), apple, sizeof(apple)))
> retrieve_apple_device_properties(boot_params);
> +
> + if (efi_apple_set_os)
> + apple_set_os();
> }
... make the call to apple_set_os() conditional on:
if (efi_is_64bit() &&
!memcmp(efistub_fw_vendor(), apple, sizeof(apple)))
We don't want to call this on non-Apple hardware if we can help it.
Thanks,
Lukas
Powered by blists - more mailing lists