[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initializatio
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code |
Date: |
Wed, 23 May 2012 17:08:21 -0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2012-05-23 13:44, Peter Maydell wrote:
> On 23 May 2012 17:39, Igor Mammedov <address@hidden> wrote:
>> @@ -295,6 +297,15 @@ static int apic_init_common(SysBusDevice *dev)
>>
>> sysbus_init_mmio(dev, &s->io_memory);
>>
>> + /* XXX: mapping more APICs at the same memory location */
>> + if (apic_mapped == 0) {
>> + /* NOTE: the APIC is directly connected to the CPU - it is not
>> + on the global memory bus. */
>> + /* XXX: what if the base changes? */
>> + sysbus_mmio_map(sysbus_from_qdev(&s->busdev.qdev), 0,
>> MSI_ADDR_BASE);
>> + apic_mapped = 1;
>> + }
>> +
>> if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK) {
>> vapic = sysbus_create_simple("kvmvapic", -1, NULL);
>> }
>
> This looks wrong -- sysbus device init functions shouldn't
> be mapping MMIO regions themselves, in general. They should
> expose MMIO regions to be mapped by whichever device or board
> model creates them. Which is what the code before this patch
> was doing -- why do you want to move this code?
I fact, the CPU normally decides about where the APIC is mapped,
specifically when it is remapped via the MSR (which QEMU cannot support
yet). Well, unless we are talking about an external APIC and a 486 CPU.
Then the board decides. But I guess we could live with ignoring that
corner case and stick the mapping setup into the CPU initialization code.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
- [Qemu-devel] [PATCH qom-next v2 0/6] target-i386: re-factor CPU creation/initialization to QOM, Igor Mammedov, 2012/05/23
- [Qemu-devel] [PATCH qom-next 2/6] target-i386: move cpu halted decision into x86_cpu_reset, Igor Mammedov, 2012/05/23
- [Qemu-devel] [PATCH qom-next 1/6] pc: Enable MSI support at APIC level, Igor Mammedov, 2012/05/23
- [Qemu-devel] [PATCH qom-next 5/6] target-i386: make initialize CPU in QOM way, Igor Mammedov, 2012/05/23
- [Qemu-devel] [PATCH qom-next 3/6] target-i386: add cpu-model property to x86_cpu, Igor Mammedov, 2012/05/23
- [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Igor Mammedov, 2012/05/23
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Peter Maydell, 2012/05/23
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code,
Jan Kiszka <=
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Igor Mammedov, 2012/05/23
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Peter Maydell, 2012/05/23
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Igor Mammedov, 2012/05/24
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Peter Maydell, 2012/05/24
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Jan Kiszka, 2012/05/24
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Igor Mammedov, 2012/05/24
- Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code, Andreas Färber, 2012/05/24
[Qemu-devel] [PATCH qom-next 6/6] target-i386: move reset callback to cpu.c, Igor Mammedov, 2012/05/23