[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXG03-0AdM_ROf2UhH-N2Z52v7ox_emSQw=y5p3sMeTrMA@mail.gmail.com>
Date: Wed, 19 Oct 2022 23:23:00 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Aditya Garg <gargaditya08@...e.com>
Cc: "matthew.garrett@...ula.com" <matthew.garrett@...ula.com>,
"jk@...abs.org" <jk@...abs.org>,
"linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Orlando Chamberlain <redecorating@...tonmail.com>
Subject: Re: [REGRESSION] Failure to write the NVRAM variables starting from
kernel 6.0 on T2 Macs
Hello Aditya
On Wed, 19 Oct 2022 at 21:26, Aditya Garg <gargaditya08@...e.com> wrote:
>
> Starting from linux kernel 6.0, the ability to write to the NVRAM has been lost on T2 Macs.
>
> This has been observed especially during installation of boot loaders like GRUB, causing errors as shown :-
>
> Installing for x86_64-efi platform.
> grub-install: warning: Cannot set EFI variable Boot0001.
> grub-install: warning: efivarfs_set_variable: writing to fd 7 failed: Invalid argument.
> grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Invalid argument.
> grub-install: error: failed to register the EFI boot entry: Invalid argument.
>
Thanks for the report. I did identify an issue in some refactoring
work of the efivars layer that went into 6.0
Can you please check whether the change below fixes the issue for you?
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c
index dd74d2ad3184..35edba93cf14 100644
--- a/drivers/firmware/efi/vars.c
+++ b/drivers/firmware/efi/vars.c
@@ -209,7 +209,7 @@ efivar_set_variable_blocking(efi_char16_t *name,
efi_guid_t *vendor,
if (data_size > 0) {
status = check_var_size(attr, data_size +
ucs2_strsize(name, 1024));
- if (status != EFI_SUCCESS)
+ if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED)
return status;
}
return __efivars->ops->set_variable(name, vendor, attr,
data_size, data);
@@ -242,7 +242,7 @@ efi_status_t
efivar_set_variable_locked(efi_char16_t *name, efi_guid_t *vendor,
if (data_size > 0) {
status = check_var_size_nonblocking(attr, data_size +
ucs2_strsize(name, 1024));
- if (status != EFI_SUCCESS)
+ if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED)
return status;
}
return setvar(name, vendor, attr, data_size, data);
Powered by blists - more mailing lists