diff mbox series

[2/3] efivarfs: Remove unused internal struct members

Message ID 20240315002616.422802-2-timschumi@gmx.de
State New
Headers show
Series [1/3] efi: pstore: Request at most 512 bytes for variable names | expand

Commit Message

Tim Schumacher March 15, 2024, 12:25 a.m. UTC
The structure was moved to the efivarfs internals in commit 2d82e6227ea1
("efi: vars: Move efivar caching layer into efivarfs") after previously
being used as the data ABI for efivars until its removal in commit
0f5b2c69a4cb ("efi: vars: Remove deprecated 'efivars' sysfs interface").

As efivarfs only uses the structure for the variable name caching layer,
the data-related members were never in use. Remove them to avoid
implying that efivarfs is bound by the same restrictions that efivars
once had.

Since we are changing the last copy of "struct efi_variable", document
the former layout in the ABI documentation of /sys/firmware/efi/vars
that is still left over.

Signed-off-by: Tim Schumacher <timschumi@gmx.de>
---
I'm unsure if this is how documentation of removed interfaces is/should
be handled, input on this would be greatly appreciated. Of course, the
alternative to what I did here is to remove the documentation
completely. If someone is running a kernel old enough to have this
interface, then the matching kernel source will still contain said
documentation.
---
 Documentation/ABI/stable/sysfs-firmware-efi-vars | 12 ++++++++++--
 fs/efivarfs/internal.h                           |  3 ---
 2 files changed, 10 insertions(+), 5 deletions(-)

--
2.44.0

Comments

Tim Schumacher March 15, 2024, 6:52 p.m. UTC | #1
On 15.03.24 10:19, Ard Biesheuvel wrote:
> On Fri, 15 Mar 2024 at 01:27, Tim Schumacher <timschumi@gmx.de> wrote:
>>
>> The structure was moved to the efivarfs internals in commit 2d82e6227ea1
>> ("efi: vars: Move efivar caching layer into efivarfs") after previously
>> being used as the data ABI for efivars until its removal in commit
>> 0f5b2c69a4cb ("efi: vars: Remove deprecated 'efivars' sysfs interface").
>>
>> As efivarfs only uses the structure for the variable name caching layer,
>> the data-related members were never in use. Remove them to avoid
>> implying that efivarfs is bound by the same restrictions that efivars
>> once had.
>>
>> Since we are changing the last copy of "struct efi_variable", document
>> the former layout in the ABI documentation of /sys/firmware/efi/vars
>> that is still left over.
>>
>> Signed-off-by: Tim Schumacher <timschumi@gmx.de>
>> ---
>> I'm unsure if this is how documentation of removed interfaces is/should
>> be handled, input on this would be greatly appreciated. Of course, the
>> alternative to what I did here is to remove the documentation
>> completely. If someone is running a kernel old enough to have this
>> interface, then the matching kernel source will still contain said
>> documentation.
>> ---
>>   Documentation/ABI/stable/sysfs-firmware-efi-vars | 12 ++++++++++--
>>   fs/efivarfs/internal.h                           |  3 ---
>>   2 files changed, 10 insertions(+), 5 deletions(-)
>>
>
> Please just rip out the doc (but in a separate patch and cc the
> Documentation maintainers)

It appears that Documentation/ABI is explicitly excluded by the Documentation
maintainers. Scrolling through MAINTAINERS seems to imply that ABI documentation
is usually maintained by the relevant subsystem, and the docs-next tree indeed
does not currently carry any ABI documentation changes. A previous attempt to
remove the documentation [1] also yielded no response.

On that note, I found that documentation on removed ABI functionality is generally
boiled down to a deprecation notice (or kept as-is) and gets moved to
`Documentation/ABI/removed` instead. I can't find where the efivars interface has
been declared deprecated, so for the purpose of a deprecation notice I'll assume
that the "lock to Intel architectures" commit [2] was that point in time.

[1] https://lore.kernel.org/lkml/20230123081905.27283-1-johan+linaro@kernel.org/
[2] https://lore.kernel.org/all/20200923161404.17811-1-ardb@kernel.org/
diff mbox series

Patch

diff --git a/Documentation/ABI/stable/sysfs-firmware-efi-vars b/Documentation/ABI/stable/sysfs-firmware-efi-vars
index 46ccd233e359..461b9139cedb 100644
--- a/Documentation/ABI/stable/sysfs-firmware-efi-vars
+++ b/Documentation/ABI/stable/sysfs-firmware-efi-vars
@@ -41,8 +41,16 @@  Description:
 		raw_var:	A binary file that can be read to obtain
 				a structure that contains everything
 				there is to know about the variable.
-				For structure definition see "struct
-				efi_variable" in the kernel sources.
+
+				The structure is defined as follows:
+				struct efi_variable {
+					efi_char16_t VariableName[512];
+					efi_guid_t VendorGuid;
+					unsigned long DataSize;
+					__u8 Data[1024];
+					efi_status_t Status;
+					__u32 Attributes;
+				} __attribute__((packed));

 				This file can also be written to in
 				order to update the value of a variable.
diff --git a/fs/efivarfs/internal.h b/fs/efivarfs/internal.h
index f7206158ee81..971560a01320 100644
--- a/fs/efivarfs/internal.h
+++ b/fs/efivarfs/internal.h
@@ -24,9 +24,6 @@  struct efivarfs_fs_info {
 struct efi_variable {
 	efi_char16_t  VariableName[EFI_VAR_NAME_LEN/sizeof(efi_char16_t)];
 	efi_guid_t    VendorGuid;
-	unsigned long DataSize;
-	__u8          Data[1024];
-	efi_status_t  Status;
 	__u32         Attributes;
 } __attribute__((packed));