From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
To: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Ard Biesheuvel
<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Leif Lindholm
<leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Matt Fleming
<matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"Ivan.khoronzhuk"
<ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
Subject: [PATCH v2] efi: dmi: List SMBIOS3 table before SMBIOS table
Date: Thu, 30 Apr 2015 15:23:05 +0200 [thread overview]
Message-ID: <20150430152305.26b89bd3@endymion.delvare> (raw)
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 <jdelvare-l3A5Bk7waGM@public.gmane.org>
Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Leif Lindholm <leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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(-)
--- linux-4.1-rc1.orig/drivers/firmware/efi/efi.c 2015-04-28 16:31:46.614397242 +0200
+++ linux-4.1-rc1/drivers/firmware/efi/efi.c 2015-04-30 15:15:46.414862079 +0200
@@ -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)
--
Jean Delvare
SUSE L3 Support
next reply other threads:[~2015-04-30 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 13:23 Jean Delvare [this message]
[not found] ` <20150430152305.26b89bd3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-04-30 16:04 ` [PATCH v2] efi: dmi: List SMBIOS3 table before SMBIOS table Matt Fleming
[not found] ` <20150430160401.GF3014-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-04-30 16:10 ` Ard Biesheuvel
[not found] ` <CAKv+Gu-7cakYGoz8oq5CoqgDvLWxyGwAK++yS8A6tvWo5d1taA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-26 18:11 ` Matt Fleming
[not found] ` <20150526181152.GA3030-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-05-27 10:30 ` Ard Biesheuvel
[not found] ` <CAKv+Gu-SeWYkqiwj+Hin5AiVW188dtLr+GHG80SxJV-uzrkA9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-27 13:18 ` Matt Fleming
[not found] ` <20150527131857.GD3030-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-05-27 13:41 ` Ard Biesheuvel
2015-05-27 14:33 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150430152305.26b89bd3@endymion.delvare \
--to=jdelvare-l3a5bk7wagm@public.gmane.org \
--cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org \
--cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox