Page MenuHomeFreeBSD

ipmi: support getting address from EFI
ClosedPublic

Authored by yinlong.lu_dell.com on Apr 27 2021, 6:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 6:47 PM
Unknown Object (File)
Oct 6 2024, 8:48 PM
Unknown Object (File)
Oct 5 2024, 4:47 PM
Unknown Object (File)
Oct 5 2024, 10:49 AM
Unknown Object (File)
Oct 5 2024, 7:55 AM
Unknown Object (File)
Oct 5 2024, 5:07 AM
Unknown Object (File)
Oct 5 2024, 4:13 AM
Unknown Object (File)
Oct 5 2024, 12:01 AM

Details

Summary

The original implementation only support get address from legacy BIOS (search the SMBIOS_SIG pattern in fix address space).

This new patch would try to get the SMBIOS table from EFI through efirt (EFI Runtime Services) firstly and would continuous search in the legacy BIOS if NULL address returned from EFI.

By this way the ipmi function could support both legacy BIOS and UEFI system.

This solution is also based on the following commits.
https://reviews.freebsd.org/D29270
ipmi,smbios: move smbios_walk_table to smbios.h

https://reviews.freebsd.org/D29276
smbios: support getting address from EFI

Test Plan

Use dmidecode to get the SMBIOS entry address in both legacy BIOS and EFI system and compare this address with the one return in efi_get_table or bios_sigsearch in the ipmi_smbios_probe.

Test with UEFI:
root@Freebsd:~ # dmidecode | less

  1. dmidecode 3.3
  2. SMBIOS entry point at 0x0ff74000

The address returned in ipmi_smbios_probe by efi_get_table is also 0xff74000 which means we got the correct address from efirt.

Test with legacy BIOS:
The address return by efi_get_table is 0 and returned by bios_sigsearch is 0xf69b0 which is same address as before.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

yinlong.lu_dell.com created this revision.
dab requested changes to this revision.Apr 27 2021, 1:46 PM

Looks good; just a few style nits.

sys/dev/ipmi/ipmi_smbios.c
155

style(9) discourages initialization of variables in their declaration, so the initialization here should be dropped and moved to inside the condition compilation block at line 164:

	struct uuid efi_smbios;
160

style(9) discourages initialization of variables in their declaration, so this would be preferred:

	u_int32_t addr;

	addr = 0;
164

Initialize efi_smbios here:

	efi_smbios = EFI_TABLE_SMBIOS;
This revision now requires changes to proceed.Apr 27 2021, 1:46 PM
sys/dev/ipmi/ipmi_acpi.c
216–218 ↗(On Diff #88237)

Are the changes in this file really necessary? This file uses ACPI to find the device, not SMBIOS.

Did some change according to the comments.

Did some change according to the comments.

Did some change according to the comments.

This revision is now accepted and ready to land.Apr 29 2021, 2:44 PM
This revision was automatically updated to reflect the committed changes.