qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"sw@weilnetz.de" <sw@weilnetz.de>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"agraf@suse.de" <agraf@suse.de>,
	"blauwirbel@gmail.com" <blauwirbel@gmail.com>,
	"avi@redhat.com" <avi@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"anthony.perard@citrix.com" <anthony.perard@citrix.com>,
	Igor Mammedov <imammedo@redhat.com>,
	"afaerber@suse.de" <afaerber@suse.de>
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	[thread overview]
Message-ID: <4FBD43B5.1010008@siemens.com> (raw)
In-Reply-To: <CAFEAcA9eZ0uSTZahn_MYR2+pMH5PLPwGomdLisDxGJjJ-peQGg@mail.gmail.com>

On 2012-05-23 13:44, Peter Maydell wrote:
> On 23 May 2012 17:39, Igor Mammedov <imammedo@redhat.com> 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

  reply	other threads:[~2012-05-23 20:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 16:39 [Qemu-devel] [PATCH qom-next v2 0/6] target-i386: re-factor CPU creation/initialization to QOM Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 1/6] pc: Enable MSI support at APIC level Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 2/6] target-i386: move cpu halted decision into x86_cpu_reset Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 3/6] target-i386: add cpu-model property to x86_cpu Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code Igor Mammedov
2012-05-23 16:44   ` Peter Maydell
2012-05-23 20:08     ` Jan Kiszka [this message]
2012-05-23 21:09     ` Igor Mammedov
2012-05-23 21:26       ` Peter Maydell
2012-05-24 13:10         ` Igor Mammedov
2012-05-24 13:21           ` Peter Maydell
2012-05-24 13:25           ` Jan Kiszka
2012-05-24 13:39             ` Igor Mammedov
2012-05-24 13:45           ` Andreas Färber
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 5/6] target-i386: make initialize CPU in QOM way Igor Mammedov
2012-05-23 21:27   ` Andreas Färber
2012-05-24  9:29     ` Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 6/6] target-i386: move reset callback to cpu.c 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=4FBD43B5.1010008@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=sw@weilnetz.de \
    --cc=wei.liu2@citrix.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).