|
From: | Igor Mammedov |
Subject: | Re: [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code |
Date: | Thu, 24 May 2012 15:10:49 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 05/23/2012 11:26 PM, Peter Maydell wrote:
On 23 May 2012 22:09, Igor Mammedov<address@hidden> wrote:For cpu-hotplug it was suggested to use device_add/del interface for it. To do so in a generalized way hot-plugged cpu should follow general QOM object creation sequence, i.e. - create new cpu instance - set properties - realize instance without creating precedent of special case for cpus in device_add/del if possible. So goal is to have a self-sufficient cpu object that doesn't require external hooks to create/initialize it. It looks possible do so for target-i386 at least.I think your self-sufficient CPU object should probably be a container QOM object which contains the CPU core itself and the APIC device. Then the container object's initialisation can map the APIC device.
For x86 it would be artificial thing without a real hardware to model after, that would needlessly complicate code and interface. I'd rather avoid this. Meanwhile I've found only two devices that do mapping inside device's initfn :( hw/lm32_sys.c hw/bonito.c and lm32_sys has comment: /* Note: This device is not created in the board initialization, * instead it has to be added with the -device parameter. Therefore, * the device maps itself. */ So for some devices it's possible to do so. And since APIC after power-on/reset should have it's regs mapped at initial APIC base, APIC's initfn looks like a legitimate place to do it. However if you are strongly opposed to this idea, I'll try Jan's idea to put mapping into CPU code that creates APIC instance. It would be uglier than if mapping were in APIC itself, but at least it could be justified by fact that Integrated APIC is a part of cpu and manuals don't specify which of them is responsible for setting mapping (mapping just exists after cpu power-on/reset). -- ----- Thanks, Igor
[Prev in Thread] | Current Thread | [Next in Thread] |