All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: zhugh.fnst@cn.fujitsu.com, qemu-devel@nongnu.org,
	tangchen@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com,
	guz.fnst@cn.fujitsu.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 1/2] cpu/apic: drop icc bus/bridge/
Date: Thu, 19 Mar 2015 18:08:32 +0800	[thread overview]
Message-ID: <550AA020.7050209@cn.fujitsu.com> (raw)
In-Reply-To: <20150317172951.7825eace@nial.brq.redhat.com>


On 03/18/2015 12:29 AM, Igor Mammedov wrote:
> On Tue, 17 Mar 2015 17:08:30 +0800
> Chen Fan <chen.fan.fnst@cn.fujitsu.com> wrote:
>
>> ICC bus was invented only to provide hotplug capability to
>> CPU and APIC because at the time being hotplug was available only for
>> BUS attached devices.
>>
>> Now this patch is to drop ICC bus impl, and switch to bus-less
>> CPU+APIC hotplug, handling them in the same manner as pc-dimm.
>>
>> Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
>> ---
> [...]
>
>> diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
>> index 0858b45..020219e 100644
>> --- a/hw/intc/apic_common.c
>> +++ b/hw/intc/apic_common.c
>> @@ -27,6 +27,8 @@
>>   static int apic_irq_delivered;
>>   bool apic_report_tpr_access;
>>   
>> +static MemoryRegion *apic_container;
>> +
>>   void cpu_set_apic_base(DeviceState *dev, uint64_t val)
>>   {
>>       trace_cpu_set_apic_base(val);
>> @@ -314,8 +316,11 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
>>       info = APIC_COMMON_GET_CLASS(s);
>>       info->realize(dev, errp);
>>       if (!mmio_registered) {
>> -        ICCBus *b = ICC_BUS(qdev_get_parent_bus(dev));
>> -        memory_region_add_subregion(b->apic_address_space, 0, &s->io_memory);
>> +        memory_region_add_subregion(apic_container, 0, &s->io_memory);
>> +        memory_region_add_subregion_overlap(CPU(s->cpu)->as->root,
>> +                                            APIC_DEFAULT_ADDRESS,
>> +                                            apic_container,
>> +                                            0x1000);
>>           mmio_registered = true;
>>       }
> Provided per CPU address spaces are used,
> why do you need static apic_container and mmio_registered thing?
> Shouldn't it be possible to register &s->io_memory of each APIC
> in CPU's own AS and avoid using globals?
it seems only need to do
memory_region_add_subregion_overlap(CPU(s->cpu)->as->root,
                                             APIC_DEFAULT_ADDRESS,
                                             &io_memory,
                                             0x1000);

at here, right?

Thanks,
Chen
>
>>   
>> @@ -431,15 +436,23 @@ static Property apic_properties_common[] = {
>>       DEFINE_PROP_END_OF_LIST(),
>>   };
>>   
>> +static void apic_common_initfn(Object *obj)
>> +{
>> +    if (!apic_container) {
>> +        apic_container = g_malloc(sizeof(*apic_container));
>> +        memory_region_init(apic_container, obj, "apic-container",
>> +                           APIC_SPACE_SIZE);
>> +    }
>> +}
>> +
>
>
> .
>

  reply	other threads:[~2015-03-19 10:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  9:08 [Qemu-devel] [PATCH 1/2] cpu/apic: drop icc bus/bridge/ Chen Fan
2015-03-17  9:08 ` [Qemu-devel] [PATCH 2/2] icc_bus: remove icc related files Chen Fan
2015-03-17 10:39 ` [Qemu-devel] [PATCH 1/2] cpu/apic: drop icc bus/bridge/ Andreas Färber
2015-03-18  1:16   ` Chen Fan
2015-03-19  9:07   ` Chen Fan
2015-03-19 11:49     ` Andreas Färber
2015-03-17 16:29 ` Igor Mammedov
2015-03-19 10:08   ` Chen Fan [this message]
2015-03-19 10:28     ` Igor Mammedov

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=550AA020.7050209@cn.fujitsu.com \
    --to=chen.fan.fnst@cn.fujitsu.com \
    --cc=afaerber@suse.de \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=zhugh.fnst@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.