efi: dmi: List SMBIOS3 table before SMBIOS table
PATCH v2 1/1 efi: dmi: List SMBIOS3 table before SMBIOS table
The SMBIOS3 table should appear before the SMBIOS table in /sys/firmware/efi/systab. This allows user-space utilities which support both to pick the SMBIOS3 table with a single pass on systems where both are implemented. The SMBIOS3 entry point is more capable than the SMBIOS entry point so it should be preferred.
This follows the same logic as the ACPI20 table being listed before the ACPI table.
---
Changes since v1:
* Added a comment explaining why SMBIOS3 must be listed before SMBIOS, so that it doesn't get accidentally broken in the future.
drivers/firmware/efi/efi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/firmware/efi/efi.c +7 -2
@@ -85,10 +85,15 @@ static ssize_t systab_show(struct kobjec str +=sprintf (str,"ACPI20=0x%lx\n" , efi.acpi20);if (efi.acpi !=EFI_INVALID_TABLE_ADDR ) str +=sprintf (str,"ACPI=0x%lx\n" , efi.acpi); -if (efi.smbios !=EFI_INVALID_TABLE_ADDR ) - str +=sprintf (str,"SMBIOS=0x%lx\n" , efi.smbios); +/* +* If both SMBIOS and SMBIOS3 entry points are implemented, the +* SMBIOS3 entry point shall be preferred, so we list it first to +* let applications stop parsing after the first match. +*/ if (efi.smbios3 !=EFI_INVALID_TABLE_ADDR ) str +=sprintf (str,"SMBIOS3=0x%lx\n" , efi.smbios3); +if (efi.smbios !=EFI_INVALID_TABLE_ADDR ) + str +=sprintf (str,"SMBIOS=0x%lx\n" , efi.smbios);if (efi.hcdp !=EFI_INVALID_TABLE_ADDR ) str +=sprintf (str,"HCDP=0x%lx\n" , efi.hcdp);if (efi.boot_info !=EFI_INVALID_TABLE_ADDR )
Signature · 2 lines
Jean Delvare SUSE L3 Support
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 13 lines · Jean Delvare
The SMBIOS3 table should appear before the SMBIOS table in
/sys/firmware/efi/systab. This allows user-space utilities which support both to pick the SMBIOS3 table with a single pass on systems where both are implemented. The SMBIOS3 entry point is more capable than the SMBIOS entry point so it should be preferred.This follows the same logic as the ACPI20 table being listed before the ACPI table.
Signed-off-by Jean Delvare <[email protected]>Cc Ard Biesheuvel <[email protected]>Cc Leif Lindholm <[email protected]>Cc Matt Fleming <[email protected]>
Quoted 7 lines
---
Changes since v1:
* Added a comment explaining why SMBIOS3 must be listed before SMBIOS, so that it doesn't get accidentally broken in the future.drivers/firmware/efi/efi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Thanks Jean. This looks OK to me but I'd really like to see some ACKs from Leif, Ard or Ivan.
Signature · 1 line
Matt Fleming, Intel Open Source Technology Center
A message that is not in the archive (sent off-list or not yet received): 20150430160401.GF3014-mF/unelCI9GS6iBeEJttW/[email protected]
Ard Biesheuvel
Acked-byQuoted 19 lines · Matt Fleming
Quoted 18 lines · Jean Delvare
The SMBIOS3 table should appear before the SMBIOS table in
/sys/firmware/efi/systab. This allows user-space utilities which support both to pick the SMBIOS3 table with a single pass on systems where both are implemented. The SMBIOS3 entry point is more capable than the SMBIOS entry point so it should be preferred.This follows the same logic as the ACPI20 table being listed before the ACPI table.
Signed-off-by Jean Delvare <[email protected]>Cc Ard Biesheuvel <[email protected]>Cc Leif Lindholm <[email protected]>Cc Matt Fleming <[email protected]>---
Changes since v1:
* Added a comment explaining why SMBIOS3 must be listed before SMBIOS, so that it doesn't get accidentally broken in the future.
Quoted 6 lines
Quoted 2 lines
drivers/firmware/efi/efi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)Thanks Jean. This looks OK to me but I'd really like to see some ACKs from Leif, Ard or Ivan.
I don't have any objections to this patch per se, but I am not crazy about the fact that the way the output is ordered is kernel<->userland ABI now
But since there appears to be a precedent with ACPI20 before ACPI, that was already the case, apparently.
So,
A message that is not in the archive (sent off-list or not yet received): CAKv+Gu-7cakYGoz8oq5CoqgDvLWxyGwAK++yS8A6tvWo5d1taA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 9 lines · Ard Biesheuvel
I don't have any objections to this patch per se, but I am not crazy about the fact that the way the output is ordered is kernel<->userland ABI now
But since there appears to be a precedent with ACPI20 before ACPI, that was already the case, apparently.
So,Acked-by Ard Biesheuvel <[email protected]>
Thanks Ard.
I've thought about this for a long while and we always kinda treat the results of sysfs files as ABI anyway. If SMBIOS 3 wasn't so new I wouldn't entertain doing this, but I think it's OK in this situation.
Signature · 1 line
Matt Fleming, Intel Open Source Technology Center
A message that is not in the archive (sent off-list or not yet received): 20150526181152.GA3030-mF/unelCI9GS6iBeEJttW/[email protected]
Quoted 9 lines · Matt Fleming
Quoted 8 lines · Ard Biesheuvel
I don't have any objections to this patch per se, but I am not crazy about the fact that the way the output is ordered is kernel<->userland ABI now
But since there appears to be a precedent with ACPI20 before ACPI, that was already the case, apparently.
So,
Quoted 8 lines
Quoted 1 line
Acked-by Ard Biesheuvel <[email protected]>Thanks Ard.
I've thought about this for a long while and we always kinda treat the results of sysfs files as ABI anyway. If SMBIOS 3 wasn't so new I wouldn't entertain doing this, but I think it's OK in this situation.
OK. Then I guess we should at least document in Documentation/ABI/stable/sysfs-firmware-efi-systab that the order in which the entries are enumerated is part of the ABI.
Regards,
Ard.
A message that is not in the archive (sent off-list or not yet received): CAKv+Gu-SeWYkqiwj+Hin5AiVW188dtLr+GHG80SxJV-uzrkA9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 4 lines · Ard Biesheuvel
OK. Then I guess we should at least document in
Documentation/ABI/stable/sysfs-firmware-efi-systabthat the order in which the entries are enumerated is part of the ABI.
Makes perfect sense to me. How about this?
---
Quoted 1 line
From
ccb5f08bb71ae4199c75668c6beacd6b47fa186cMon Sep 17 00:00:00 2001
From: Matt Fleming <[email protected]>
Date: Wed, 27 May 2015 14:14:22 +0100
Subject: [PATCH] efi: Add 'systab' information to Documentation/ABI
It's not clear right now that the order in which entries are displayed in /sys/firmware/efi/systab actually forms an ABI that userspace tools rely upon.
Document the ABI along with the userspace tool that cares.
--- Documentation/ABI/testing/sysfs-firmware-efi | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/ABI/testing/sysfs-firmware-efi +10 -0
@@ -18,3 +18,13 @@ Contact: Dave Young <[email protected]> Description: It shows the physical address of config table entry in the EFI system table. Users: Kexec + +What: /sys/firmware/efi/systab +Date: April 2005 +Contact: [email protected] +Description: Displays the physical addresses of all EFI Configuration + Tables found via the EFI System Table. The order in + which the tables are printed forms an ABI and newer + versions are always printed first, i.e. ACPI20 comes + before ACPI. +Users: dmidecode
Signature · 4 lines
2.1.0 -- Matt Fleming, Intel Open Source Technology Center
A message that is not in the archive (sent off-list or not yet received): 20150527131857.GD3030-mF/unelCI9GS6iBeEJttW/[email protected]
Ard Biesheuvel
Acked-byQuoted 19 lines · Matt Fleming
Quoted 4 lines · Ard Biesheuvel
OK. Then I guess we should at least document in
Documentation/ABI/stable/sysfs-firmware-efi-systabthat the order in which the entries are enumerated is part of the ABI.Makes perfect sense to me. How about this?
---
From
ccb5f08bb71ae4199c75668c6beacd6b47fa186cMon Sep 17 00:00:00 2001
From: Matt Fleming <[email protected]>
Date: Wed, 27 May 2015 14:14:22 +0100
Subject: [PATCH] efi: Add 'systab' information toDocumentation/ABIIt's not clear right now that the order in which entries are displayed in
/sys/firmware/efi/systabactually forms an ABI that userspace tools rely upon.
Quoted 7 lines
Document the ABI along with the userspace tool that cares.
Suggested-by Ard Biesheuvel <[email protected]>Cc Jean Delvare <[email protected]>Cc Leif Lindholm <[email protected]>Cc Ivan Khoronzhuk <ivan.khoronzhuk-hExfYMNmJl/[email protected]>Signed-off-by Matt Fleming <[email protected]>
Still not crazy about it but here it goes :-)
Quoted 27 lines
--- Documentation/ABI/testing/sysfs-firmware-efi | 10 ++++++++++ 1 file changed, 10 insertions(+)Documentation/ABI/testing/sysfs-firmware-efi +10
-1@@ -18,3 +18,13 @@ Contact: Dave Young <[email protected]> Description: It shows the physical address of config table entry in the EFI system table. Users: Kexec + +What: /sys/firmware/efi/systab +Date: April 2005 +Contact: [email protected] +Description: Displays the physical addresses of all EFI Configuration + Tables found via the EFI System Table. The order in + which the tables are printed forms an ABI and newer + versions are always printed first, i.e. ACPI20 comes + before ACPI. +Users: dmidecode --2.1.0
--
Matt Fleming, Intel Open Source Technology Center
Jean Delvare
Reviewed-byQuoted 38 lines · Matt Fleming
Quoted 4 lines · Ard Biesheuvel
OK. Then I guess we should at least document in
Documentation/ABI/stable/sysfs-firmware-efi-systabthat the order in which the entries are enumerated is part of the ABI.Makes perfect sense to me. How about this?
---
From
ccb5f08bb71ae4199c75668c6beacd6b47fa186cMon Sep 17 00:00:00 2001
From: Matt Fleming <[email protected]>
Date: Wed, 27 May 2015 14:14:22 +0100
Subject: [PATCH] efi: Add 'systab' information toDocumentation/ABIIt's not clear right now that the order in which entries are displayed in
/sys/firmware/efi/systabactually forms an ABI that userspace tools rely upon.Document the ABI along with the userspace tool that cares.
Suggested-by Ard Biesheuvel <[email protected]>Cc Jean Delvare <[email protected]>Cc Leif Lindholm <[email protected]>Cc Ivan Khoronzhuk <ivan.khoronzhuk-hExfYMNmJl/[email protected]>Signed-off-by Matt Fleming <[email protected]>--- Documentation/ABI/testing/sysfs-firmware-efi | 10 ++++++++++ 1 file changed, 10 insertions(+)Documentation/ABI/testing/sysfs-firmware-efi +0
-0@@ -18,3 +18,13 @@ Contact: Dave Young <[email protected]> Description: It shows the physical address of config table entry in the EFI system table. Users: Kexec
Documentation/ABI/testing/sysfs-firmware-efi Contact: Dave Young <[email protected]> · line 30
Quoted 10 lines
Documentation/ABI/testing/sysfs-firmware-efi +10
-0+ +What: /sys/firmware/efi/systab +Date: April 2005 +Contact: [email protected] +Description: Displays the physical addresses of all EFI Configuration + Tables found via the EFI System Table. The order in + which the tables are printed forms an ABI and newer + versions are always printed first, i.e. ACPI20 comes + before ACPI. +Users: dmidecode
Thank you,
Signature · 2 lines
Jean Delvare SUSE L3 Support