On 25/06/2015 18:10, Andreas Färber wrote: > Am 25.06.2015 um 18:02 schrieb Paolo Bonzini: >> On 25/06/2015 18:00, Andreas Färber wrote: >>>> - 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; >>>> - } >>>> + >>>> + root = address_space_root_memory_region(cpu->as); >>>> + memory_region_add_subregion_overlap(root, >>>> + s->apicbase & >>>> MSR_IA32_APICBASE_BASE, >>>> + &s->io_memory, >>>> + 0x1000); >>>> >> >> I had already remarked that this patch is wrong. cpu->as is completely >> unused on KVM, for example. > > Ah, then I don't understand this [RESEND]. ;) > Either way, not on my plate ATM, it seems. > > Did you also outline how it is supposed to be done instead?
I said "I think this patch is incorrect, because you do not install a separate address space for each CPU. Also, the CPU address space is only used with TCG so it should be guarded by "if (tcg_enabled())"." By the way, now TCG _is_ installing a separate address space per CPU already, so the patch can simply guard the code with "if (tcg_enabled())". Paolo