mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
target-i386: Attach ICC bus to CPU on its creation
X86CPU should have parent bus so it could provide bus for child APIC. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
f0513d2c01
commit
62fc403f11
6 changed files with 24 additions and 10 deletions
10
hw/i386/pc.c
10
hw/i386/pc.c
|
@ -894,12 +894,13 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)
|
|||
}
|
||||
}
|
||||
|
||||
static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id, Error **errp)
|
||||
static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id,
|
||||
DeviceState *icc_bridge, Error **errp)
|
||||
{
|
||||
X86CPU *cpu;
|
||||
Error *local_err = NULL;
|
||||
|
||||
cpu = cpu_x86_create(cpu_model, errp);
|
||||
cpu = cpu_x86_create(cpu_model, icc_bridge, errp);
|
||||
if (!cpu) {
|
||||
return cpu;
|
||||
}
|
||||
|
@ -917,7 +918,7 @@ static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id, Error **errp)
|
|||
return cpu;
|
||||
}
|
||||
|
||||
void pc_cpus_init(const char *cpu_model)
|
||||
void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge)
|
||||
{
|
||||
int i;
|
||||
Error *error = NULL;
|
||||
|
@ -932,7 +933,8 @@ void pc_cpus_init(const char *cpu_model)
|
|||
}
|
||||
|
||||
for (i = 0; i < smp_cpus; i++) {
|
||||
pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i), &error);
|
||||
pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i),
|
||||
icc_bridge, &error);
|
||||
if (error) {
|
||||
fprintf(stderr, "%s\n", error_get_pretty(error));
|
||||
error_free(error);
|
||||
|
|
|
@ -95,7 +95,7 @@ static void pc_init1(MemoryRegion *system_memory,
|
|||
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
||||
OBJECT(icc_bridge), NULL);
|
||||
|
||||
pc_cpus_init(cpu_model);
|
||||
pc_cpus_init(cpu_model, icc_bridge);
|
||||
pc_acpi_init("acpi-dsdt.aml");
|
||||
|
||||
if (kvmclock_enabled) {
|
||||
|
|
|
@ -82,7 +82,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
|
|||
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
||||
OBJECT(icc_bridge), NULL);
|
||||
|
||||
pc_cpus_init(cpu_model);
|
||||
pc_cpus_init(cpu_model, icc_bridge);
|
||||
pc_acpi_init("q35-acpi-dsdt.aml");
|
||||
|
||||
kvmclock_create();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue