[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 2/5] apic: map APIC's MMIO region at each CPU's a
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PULL 2/5] apic: map APIC's MMIO region at each CPU's address space |
Date: |
Wed, 03 Jun 2015 10:30:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 03/06/2015 10:29, Igor Mammedov wrote:
>>> > > + root = address_space_root_memory_region(cpu->as);
>> >
>> > I think just using cpu->as->root is okay.
>> >
>>> > > + memory_region_add_subregion_overlap(root,
>>> > > + s->apicbase &
>>> > > MSR_IA32_APICBASE_BASE,
>>> > > + &s->io_memory,
>>> > > + 0x1000);
>> >
>> > 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())".
> Don't we need it be mapped on for KVM for MSI to work
> when using kvm-apic?
>
> kvm_apic_io_ops->write = kvm_apic_mem_write->kvm_irqchip_send_msi()
Yes, and the reason this patch worked is simply that by default cpu->as
is &address_space_memory. The patch was just registering the same
region once per VCPU instead of 1, in the same place as before.
Paolo