qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-devel@nongnu.org, Liu Ping Fan <qemulist@gmail.com>,
	Blue Swirl <blauwirbel@gmail.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer
Date: Wed, 11 Jul 2012 10:41:57 +0200	[thread overview]
Message-ID: <4FFD3C55.30804@redhat.com> (raw)
In-Reply-To: <4FFC06EC.5080100@suse.de>

On 07/10/2012 12:41 PM, Andreas Färber wrote:
> Am 10.07.2012 10:45, schrieb Paolo Bonzini:
>> Il 10/07/2012 08:16, Liu Ping Fan ha scritto:
>>> Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
>>> ---
>>>   hw/pc.c |   10 +++++-----
>>>   1 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/hw/pc.c b/hw/pc.c
>>> index c7e9ab3..8df58c9 100644
>>> --- a/hw/pc.c
>>> +++ b/hw/pc.c
>>> @@ -886,17 +886,17 @@ DeviceState *cpu_get_current_apic(void)
>>>       }
>>>   }
>>>
>>> -static DeviceState *apic_init(void *env, uint8_t apic_id)
>>> +static DeviceState *apic_init(void *cpu, void *env, uint8_t apic_id)
>>>   {
>>>       DeviceState *dev;
>>>       static int apic_mapped;
>>>
>>>       if (kvm_irqchip_in_kernel()) {
>>> -        dev = qdev_create(NULL, "kvm-apic");
>>> +        dev = qdev_create_kid(OBJECT(cpu), "kvm-apic");
>>>       } else if (xen_enabled()) {
>>> -        dev = qdev_create(NULL, "xen-apic");
>>> +        dev = qdev_create_kid(OBJECT(cpu), "xen-apic");
>>>       } else {
>>> -        dev = qdev_create(NULL, "apic");
>>> +        dev = qdev_create_kid(OBJECT(cpu), "apic");
>>>       }
>>
>> Does it make sense instead to do this in the realize method of the CPU?
>
> Igor was working on patches to do that. We ran into other design issues
> on that road, yesterday I made a proposal how we might proceed with his
> approach:
>
> http://lists.nongnu.org/archive/html/qemu-devel/2012-07/msg00992.html
>
> Andreas


I was trying to put APIC by-value inside of X86_CPU and do in-place initialization
in x86_cpu_initfn(), but that has it's own drawbacks:
   1. currently all apic flavors have common instance sizeof(APICCommonState) that
      could be used as a way to reserve space in CPUX86State. But they could diverge
      and create problems later when nobody remembers that sizeof(whatever apic) must
      be equal to sizeof(APICCommonState)
   2. it won't solve OOM anyway because of a initfn could fail due to OOM in any
      object_property_add() call

So if not-inplace apic creation in realize() is acceptable alternative then I'd like to
respin apic patches with this change.

-- 
-----
  Igor

      reply	other threads:[~2012-07-11  8:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10  6:16 [Qemu-devel] make apic hot-plugable Liu Ping Fan
2012-07-10  6:16 ` [Qemu-devel] [PATCH 1/5] qdev: introduce qdev_create_kid(Object *parent, const char *type) Liu Ping Fan
2012-07-10  8:12   ` Andreas Färber
2012-07-10  8:45   ` Paolo Bonzini
2012-07-11  1:17     ` liu ping fan
2012-07-11  7:01       ` Paolo Bonzini
2012-07-10  6:16 ` [Qemu-devel] [PATCH 2/5] qom: introduce object_is_type_str(), so we can judge its type Liu Ping Fan
2012-07-10  8:39   ` Paolo Bonzini
2012-07-11  1:17     ` liu ping fan
2012-07-10  6:16 ` [Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface Liu Ping Fan
2012-07-10  8:40   ` Paolo Bonzini
2012-07-10  6:16 ` [Qemu-devel] [PATCH 4/5] qom-cpu: during cpu reset, it will reset its child Liu Ping Fan
2012-07-10  8:41   ` Paolo Bonzini
2012-07-10 10:12     ` Andreas Färber
2012-07-11  1:17       ` liu ping fan
2012-07-11 12:37         ` Igor Mammedov
2012-07-11  1:17     ` liu ping fan
2012-07-11  7:02       ` Paolo Bonzini
2012-07-10  6:16 ` [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer Liu Ping Fan
2012-07-10  8:45   ` Paolo Bonzini
2012-07-10 10:41     ` Andreas Färber
2012-07-11  8:41       ` Igor Mammedov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFD3C55.30804@redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=blauwirbel@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemulist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).