[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/13] pc: cleanup: move smbios_set_cpuid() into pc_b
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 06/13] pc: cleanup: move smbios_set_cpuid() into pc_build_smbios() |
Date: |
Mon, 23 Jan 2017 21:27:31 -0200 |
From: Igor Mammedov <address@hidden>
move smbios_set_cpuid() close to the rest of smbios init code
where it belongs to instead of calling it from pc_cpus_init().
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/i386/pc.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f721fde0c2..c0d0d2c6a1 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -701,16 +701,20 @@ static uint32_t x86_cpu_apic_id_from_index(unsigned int
cpu_index)
}
}
-static void pc_build_smbios(FWCfgState *fw_cfg)
+static void pc_build_smbios(PCMachineState *pcms)
{
uint8_t *smbios_tables, *smbios_anchor;
size_t smbios_tables_len, smbios_anchor_len;
struct smbios_phys_mem_area *mem_array;
unsigned i, array_count;
+ X86CPU *cpu = X86_CPU(pcms->possible_cpus->cpus[0].cpu);
+
+ /* tell smbios about cpuid version and features */
+ smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
smbios_tables = smbios_get_table_legacy(&smbios_tables_len);
if (smbios_tables) {
- fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
+ fw_cfg_add_bytes(pcms->fw_cfg, FW_CFG_SMBIOS_ENTRIES,
smbios_tables, smbios_tables_len);
}
@@ -731,9 +735,9 @@ static void pc_build_smbios(FWCfgState *fw_cfg)
g_free(mem_array);
if (smbios_anchor) {
- fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables",
+ fw_cfg_add_file(pcms->fw_cfg, "etc/smbios/smbios-tables",
smbios_tables, smbios_tables_len);
- fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
+ fw_cfg_add_file(pcms->fw_cfg, "etc/smbios/smbios-anchor",
smbios_anchor, smbios_anchor_len);
}
}
@@ -1191,9 +1195,6 @@ void pc_cpus_init(PCMachineState *pcms)
object_unref(OBJECT(cpu));
}
}
-
- /* tell smbios about cpuid version and features */
- smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
}
static void pc_build_feature_control_file(PCMachineState *pcms)
@@ -1266,7 +1267,7 @@ void pc_machine_done(Notifier *notifier, void *data)
acpi_setup();
if (pcms->fw_cfg) {
- pc_build_smbios(pcms->fw_cfg);
+ pc_build_smbios(pcms);
pc_build_feature_control_file(pcms);
/* update FW_CFG_NB_CPUS to account for -device added CPUs */
fw_cfg_modify_i16(pcms->fw_cfg, FW_CFG_NB_CPUS, pcms->boot_cpus);
--
2.11.0.259.g40922b1
- [Qemu-devel] [PULL 00/13] x86, machine, numa queue (2017-01-23), Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 01/13] x86: add AVX512_VPOPCNTDQ features, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 02/13] i386: Remove AMD feature flag aliases from Opteron models, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 03/13] i386: Return migration-safe field on query-cpu-definitions, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 05/13] arch_init: Remove unnecessary default_config_files table, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 04/13] vl: Ensure the numa_post_machine_init func in the appropriate location, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 06/13] pc: cleanup: move smbios_set_cpuid() into pc_build_smbios(),
Eduardo Habkost <=
- [Qemu-devel] [PULL 07/13] pc: don't return cpu pointer from pc_new_cpu() as it's not needed anymore, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 09/13] MAINTAINERS: Add an entry for hw/core/null-machine.c, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 08/13] machine: Make possible_cpu_arch_ids() return const pointer, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 10/13] qemu-options: Rename variables on the -numa "cpus" option, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 11/13] hw/core/null-machine: Add the possibility to instantiate a CPU and RAM, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 12/13] kvm: Simplify invtsc check, Eduardo Habkost, 2017/01/23
- [Qemu-devel] [PULL 13/13] kvm: Allow invtsc migration if tsc-khz is set explicitly, Eduardo Habkost, 2017/01/23
- Re: [Qemu-devel] [PULL 00/13] x86, machine, numa queue (2017-01-23), Peter Maydell, 2017/01/24