static void apic_common_realize(DeviceState *dev, Error **errp) { APICCommonState *s = APIC_COMMON(dev); APICCommonClass *info; static DeviceState *vapic; static int apic_no; if (apic_no >= MAX_APICS) { error_setg(errp, "%s initialization failed.", object_get_typename(OBJECT(dev))); return; } s->idx = apic_no++; info = APIC_COMMON_GET_CLASS(s); info->realize(dev, errp); /* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK && ram_size >= 1024 * 1024) { vapic = sysbus_create_simple("kvmvapic", -1, NULL); } s->vapic = vapic; if (apic_report_tpr_access && info->enable_tpr_reporting) { info->enable_tpr_reporting(s, true); } }
static void apic_common_realize(DeviceState *dev, Error **errp) { APICCommonState *s = APIC_COMMON(dev); APICCommonClass *info; static DeviceState *vapic; int instance_id = s->id; info = APIC_COMMON_GET_CLASS(s); info->realize(dev, errp); /* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK && ram_size >= 1024 * 1024) { vapic = sysbus_create_simple("kvmvapic", -1, NULL); } s->vapic = vapic; if (apic_report_tpr_access && info->enable_tpr_reporting) { info->enable_tpr_reporting(s, true); } if (s->legacy_instance_id) { instance_id = -1; } vmstate_register_with_alias_id(NULL, instance_id, &vmstate_apic_common, s, -1, 0); }
static void apic_common_realize(struct uc_struct *uc, DeviceState *dev, Error **errp) { APICCommonState *s = APIC_COMMON(uc, dev); APICCommonClass *info; if (uc->apic_no >= MAX_APICS) { error_setg(errp, "%s initialization failed.", object_get_typename(OBJECT(dev))); return; } s->idx = uc->apic_no++; info = APIC_COMMON_GET_CLASS(uc, s); info->realize(uc, dev, errp); if (!uc->mmio_registered) { ICCBus *b = ICC_BUS(uc, qdev_get_parent_bus(dev)); memory_region_add_subregion(b->apic_address_space, 0, &s->io_memory); uc->mmio_registered = true; } /* Note: We need at least 1M to map the VAPIC option ROM */ if (!uc->vapic && s->vapic_control & VAPIC_ENABLE_MASK) { // ram_size >= 1024 * 1024) { // FIXME uc->vapic = NULL; } s->vapic = uc->vapic; if (uc->apic_report_tpr_access && info->enable_tpr_reporting) { info->enable_tpr_reporting(s, true); } }
static void apic_common_realize(DeviceState *dev, Error **errp) { APICCommonState *s = APIC_COMMON(dev); APICCommonClass *info; static DeviceState *vapic; static int apic_no; static bool mmio_registered; if (apic_no >= MAX_APICS) { error_setg(errp, "%s initialization failed.", object_get_typename(OBJECT(dev))); return; } s->idx = apic_no++; info = APIC_COMMON_GET_CLASS(s); info->realize(dev, errp); if (!mmio_registered) { ICCBus *b = ICC_BUS(qdev_get_parent_bus(dev)); memory_region_add_subregion(b->apic_address_space, 0, &s->io_memory); mmio_registered = true; } /* Note: We need at least 1M to map the VAPIC option ROM */ if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK && ram_size >= 1024 * 1024) { vapic = sysbus_create_simple("kvmvapic", -1, NULL); } s->vapic = vapic; if (apic_report_tpr_access && info->enable_tpr_reporting) { info->enable_tpr_reporting(s, true); } }