@@ -144,6 +144,9 @@ typedef struct PCMachineClass {
/* Enables contiguous-apic-ID mode */
bool compat_apic_id_mode;
+
+ /* expose x86 CPU topology over fw_cfg */
+ bool fwcfg_topology;
} PCMachineClass;
#define TYPE_PC_MACHINE "generic-pc-machine"
@@ -1739,7 +1739,7 @@ void pc_memory_init(PCMachineState *pcms,
1);
fw_cfg = fw_cfg_arch_create(machine, pcms->boot_cpus, pcms->apic_id_limit,
- pcms->smp_dies, false);
+ pcms->smp_dies, pcmc->fwcfg_topology);
rom_set_fw(fw_cfg);
@@ -2798,6 +2798,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pcmc->save_tsc_khz = true;
pcmc->linuxboot_dma_enabled = true;
pcmc->pvh_enabled = true;
+ pcmc->fwcfg_topology = true;
assert(!mc->get_hotplug_handler);
mc->get_hotplug_handler = pc_get_hotplug_handler;
mc->hotplug_allowed = pc_hotplug_allowed;
@@ -445,9 +445,11 @@ DEFINE_I440FX_MACHINE(v4_2, "pc-i440fx-4.2", NULL,
static void pc_i440fx_4_1_machine_options(MachineClass *m)
{
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_i440fx_4_2_machine_options(m);
m->alias = NULL;
m->is_default = 0;
+ pcmc->fwcfg_topology = false;
compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len);
compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
}
@@ -377,8 +377,10 @@ DEFINE_Q35_MACHINE(v4_2, "pc-q35-4.2", NULL,
static void pc_q35_4_1_machine_options(MachineClass *m)
{
+ PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
pc_q35_4_2_machine_options(m);
m->alias = NULL;
+ pcmc->fwcfg_topology = false;
compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len);
compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
}
Enable the small feature added in the last patch on 4.2+ PC machine types. Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- include/hw/i386/pc.h | 3 +++ hw/i386/pc.c | 3 ++- hw/i386/pc_piix.c | 2 ++ hw/i386/pc_q35.c | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-)