aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2025-02-28 16:54:42 +0000
committerOlivier Certner <olce@FreeBSD.org>2025-03-07 16:42:45 +0000
commitbc7f6508363c5cf4544044e00bbaf71de8f0168d (patch)
tree46636418c1bad86c4aff77ae18d1d4ed54f2e37b
parent69cf9e9a451df3b0bff92f879365f604811e394b (diff)
smbios: Search for v3 (64-bit) entry point first on BIOS boot
When booted from BIOS (i.e., not EFI), also search for a 64-bit version of the SMBIOS Entry Point. This allows us to detect and report the proper SMBIOS version with BIOSes that only provide the v3 table, as happens on Hetzner virtual machines. For machines that provide both, leverage the v3 table in priority consistently with the EFI case. PR: 284460 Reviewed by: markj, imp (both older version) MFC after: 2 weeks Relnotes: yes Event: February src bug-busting session Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49179
-rw-r--r--sys/dev/smbios/smbios.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c
index bbfe80a6a8a6..f4a6453fd043 100644
--- a/sys/dev/smbios/smbios.c
+++ b/sys/dev/smbios/smbios.c
@@ -102,9 +102,15 @@ smbios_identify (driver_t *driver, device_t parent)
#endif
#if defined(__amd64__) || defined(__i386__)
- if (addr == 0)
- addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN,
+ if (addr == 0) {
+ addr = bios_sigsearch(SMBIOS_START, SMBIOS3_SIG, SMBIOS3_LEN,
SMBIOS_STEP, SMBIOS_OFF);
+ if (addr != 0)
+ map_size = sizeof(*eps3);
+ else
+ addr = bios_sigsearch(SMBIOS_START,
+ SMBIOS_SIG, SMBIOS_LEN, SMBIOS_STEP, SMBIOS_OFF);
+ }
#endif
if (addr != 0) {