[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/17] pc: Postpone SMBIOS table installation to pos
From: |
minyard |
Subject: |
[Qemu-devel] [PATCH 13/17] pc: Postpone SMBIOS table installation to post machine init |
Date: |
Thu, 23 Apr 2015 17:57:54 -0500 |
From: Corey Minyard <address@hidden>
This is the same place that the ACPI SSDT table gets added, so that
devices can add themselves to the SMBIOS table.
Signed-off-by: Corey Minyard <address@hidden>
---
hw/i386/pc.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a8e6be1..efe3c2f 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -680,8 +680,6 @@ static unsigned int pc_apic_id_limit(unsigned int max_cpus)
static FWCfgState *bochs_bios_init(void)
{
FWCfgState *fw_cfg;
- uint8_t *smbios_tables, *smbios_anchor;
- size_t smbios_tables_len, smbios_anchor_len;
uint64_t *numa_fw_cfg;
int i, j;
unsigned int apic_id_limit = pc_apic_id_limit(max_cpus);
@@ -707,21 +705,6 @@ static FWCfgState *bochs_bios_init(void)
acpi_tables, acpi_tables_len);
fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override());
- smbios_tables = smbios_get_table_legacy(&smbios_tables_len);
- if (smbios_tables) {
- fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
- smbios_tables, smbios_tables_len);
- }
-
- smbios_get_tables(&smbios_tables, &smbios_tables_len,
- &smbios_anchor, &smbios_anchor_len);
- if (smbios_anchor) {
- fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables",
- smbios_tables, smbios_tables_len);
- fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
- smbios_anchor, smbios_anchor_len);
- }
-
fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE,
&e820_reserve, sizeof(e820_reserve));
fw_cfg_add_file(fw_cfg, "etc/e820", e820_table,
@@ -1119,7 +1102,25 @@ void pc_guest_info_machine_done(Notifier *notifier, void
*data)
PcGuestInfoState *guest_info_state = container_of(notifier,
PcGuestInfoState,
machine_done);
+ uint8_t *smbios_tables, *smbios_anchor;
+ size_t smbios_tables_len, smbios_anchor_len;
+ FWCfgState *fw_cfg = guest_info_state->info.fw_cfg;
+
acpi_setup(&guest_info_state->info);
+
+ smbios_tables = smbios_get_table_legacy(&smbios_tables_len);
+ if (smbios_tables) {
+ fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
+ smbios_tables, smbios_tables_len);
+ }
+ smbios_get_tables(&smbios_tables, &smbios_tables_len,
+ &smbios_anchor, &smbios_anchor_len);
+ if (smbios_anchor) {
+ fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables",
+ smbios_tables, smbios_tables_len);
+ fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
+ smbios_anchor, smbios_anchor_len);
+ }
}
PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure, (continued)
- [Qemu-devel] [PATCH 03/17] ipmi: Add a KCS low-level interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 04/17] ipmi: Add a BT low-level interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 05/17] ipmi: Add a local BMC simulation, minyard, 2015/04/23
- [Qemu-devel] [PATCH 06/17] ipmi: Add an external connection simulation interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 07/17] ipmi: Add tests, minyard, 2015/04/23
- [Qemu-devel] [PATCH 08/17] ipmi: Add documentation, minyard, 2015/04/23
- [Qemu-devel] [PATCH 09/17] ipmi: Add migration capability to the IPMI device., minyard, 2015/04/23
- [Qemu-devel] [PATCH 10/17] ipmi: Add a firmware configuration repository, minyard, 2015/04/23
- [Qemu-devel] [PATCH 12/17] smbios: Add a function to directly add an entry, minyard, 2015/04/23
- [Qemu-devel] [PATCH 13/17] pc: Postpone SMBIOS table installation to post machine init,
minyard <=
- [Qemu-devel] [PATCH 14/17] ipmi: Add SMBIOS table entry, minyard, 2015/04/23
- [Qemu-devel] [PATCH 15/17] acpi: Add a way for devices to add ACPI tables, minyard, 2015/04/23
- [Qemu-devel] [PATCH 16/17] ipmi: Add ACPI table entries, minyard, 2015/04/23
- [Qemu-devel] [PATCH 17/17] bios: Add tests for the IPMI ACPI and SMBIOS entries, minyard, 2015/04/23
- Re: [Qemu-devel] [PATCH 00/17] Update to adding an IPMI device to qemu, Eric Blake, 2015/04/23