From 94fe7a15aaf0a0ebb874aaff7b5d6499b79c099e Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Sat, 8 Oct 2016 22:03:16 +0300 Subject: 8213 uts: get smbios from bootloader Reviewed by: Yuri Pankov Reviewed by: Robert Mustacchi Approved by: Hans Rosenfeld --- usr/src/uts/i86pc/dboot/dboot_startkern.c | 4 ++++ usr/src/uts/i86pc/os/ddi_impl.c | 3 +++ usr/src/uts/i86pc/os/fakebop.c | 7 ++++++- usr/src/uts/intel/sys/bootinfo.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/i86pc/dboot/dboot_startkern.c b/usr/src/uts/i86pc/dboot/dboot_startkern.c index d835f2b311..396e1aafec 100644 --- a/usr/src/uts/i86pc/dboot/dboot_startkern.c +++ b/usr/src/uts/i86pc/dboot/dboot_startkern.c @@ -1602,6 +1602,9 @@ dboot_multiboot_get_fwtables(void) if (multiboot_version != 2) return; + /* only provide SMBIOS pointer in case of UEFI */ + bi->bi_smbios = NULL; + nacpitagp = (multiboot_tag_new_acpi_t *) dboot_multiboot2_find_tag(mb2_info, MULTIBOOT_TAG_TYPE_ACPI_NEW); @@ -2009,6 +2012,7 @@ startup_kernel(void) if (mb2_info != NULL) DBG(mb2_info->mbi_total_size); DBG(bi->bi_acpi_rsdp); + DBG(bi->bi_smbios); #endif /* diff --git a/usr/src/uts/i86pc/os/ddi_impl.c b/usr/src/uts/i86pc/os/ddi_impl.c index fa07371303..50d1e174ff 100644 --- a/usr/src/uts/i86pc/os/ddi_impl.c +++ b/usr/src/uts/i86pc/os/ddi_impl.c @@ -1906,6 +1906,9 @@ get_boot_properties(void) } else if (strcmp(name, "acpi-root-tab") == 0) { (void) ndi_prop_update_int64(DDI_DEV_T_NONE, devi, property_name, *((int64_t *)bop_staging_area)); + } else if (strcmp(name, "smbios-address") == 0) { + (void) ndi_prop_update_int64(DDI_DEV_T_NONE, devi, + property_name, *((int64_t *)bop_staging_area)); } else if (strcmp(name, "stdout") == 0) { (void) ndi_prop_update_int(DDI_DEV_T_NONE, devi, property_name, *((int *)bop_staging_area)); diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c index 8616ef9f40..eb29b2d6cb 100644 --- a/usr/src/uts/i86pc/os/fakebop.c +++ b/usr/src/uts/i86pc/os/fakebop.c @@ -2734,11 +2734,16 @@ build_firmware_properties(struct xboot_info *xbp) ACPI_TABLE_HEADER *tp = NULL; #ifndef __xpv - if (xbp->bi_acpi_rsdp) { + if (xbp->bi_acpi_rsdp != NULL) { bsetprop64("acpi-root-tab", (uint64_t)(uintptr_t)xbp->bi_acpi_rsdp); } + if (xbp->bi_smbios != NULL) { + bsetprop64("smbios-address", + (uint64_t)(uintptr_t)xbp->bi_smbios); + } + if ((tp = find_fw_table(ACPI_SIG_MSCT)) != NULL) msct_ptr = process_msct((ACPI_TABLE_MSCT *)tp); else diff --git a/usr/src/uts/intel/sys/bootinfo.h b/usr/src/uts/intel/sys/bootinfo.h index fa60e6ac41..8f1d205a10 100644 --- a/usr/src/uts/intel/sys/bootinfo.h +++ b/usr/src/uts/intel/sys/bootinfo.h @@ -111,6 +111,7 @@ struct xboot_info { native_ptr_t bi_mb_info; /* multiboot 1 or 2 info */ int bi_mb_version; /* multiboot version */ native_ptr_t bi_acpi_rsdp; + native_ptr_t bi_smbios; #endif }; #pragma pack() -- cgit v1.2.3