Il 05/04/2013 16:37, Igor Mammedov ha scritto: > @@ -282,12 +284,14 @@ static int apic_load_old(QEMUFile *f, void *opaque, int > version_id) > return 0; > } > > -static int apic_init_common(SysBusDevice *dev) > +static int apic_init_common(ICCDevice *dev) > { > APICCommonState *s = APIC_COMMON(dev); > + DeviceState *d = DEVICE(dev); > APICCommonClass *info; > static DeviceState *vapic; > static int apic_no; > + static bool mmio_registered; > > if (apic_no >= MAX_APICS) { > return -1; > @@ -296,8 +300,11 @@ static int apic_init_common(SysBusDevice *dev) > > info = APIC_COMMON_GET_CLASS(s); > info->init(s); > - > - sysbus_init_mmio(dev, &s->io_memory); > + if (!mmio_registered) { > + MemoryRegion *as = ICC_BUS(d->parent_bus)->apic_address_space; > + memory_region_add_subregion(as, 0, &s->io_memory); > + mmio_registered = true; > + }
Ok for now. When we get IOMMU regions, we could use them to dispatch on the current CPU's APIC. Paolo