All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe DUBOIS <jcd@tribudubois.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v13 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support
Date: Mon, 10 Aug 2015 19:01:35 +0200	[thread overview]
Message-ID: <55C8D8EF.4090304@tribudubois.net> (raw)
In-Reply-To: <CAFEAcA935YbME9JFX_g0e7HN5Q+gxco3NJGzCDgK9U8z1s1Ddw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2159 bytes --]

Le 10/08/2015 18:23, Peter Maydell a écrit :
> On 10 August 2015 at 17:15, Jean-Christophe DUBOIS <jcd@tribudubois.net> wrote:
>> Le 07/08/2015 15:45, Peter Maydell a écrit :
>>
>> On 16 July 2015 at 22:21, Jean-Christophe Dubois <jcd@tribudubois.net>
>> wrote:
>> memory_region_allocate_system_memory() needs to be called once and
>> only once by a board init. You're going to end up calling it twice here.
>>
>>
>> Actually, I may be calling it up 3 time because there is also an internal
>> (16KB) memory range that is allocated during the SOC init (fsl-imx31.c
>> file).
> Small blocks of stuff like 16KB are not the "main lump of RAM", so
> should not be initialized with memory_region_allocate_system_memory().
> Use memory_region_init_ram() followed by vmstate_register_ram_global()
> for that sort of small RAM region.

OK, I'll do it but it seems to me that in our case 
memory_region_allocate_system_memory() basically do:

  * memory_region_init_ram()
  * vmstate_register_ram_global()

>
>> Now as my memory (the 3 memory banks) is  (partially) discontiguous how am I
>> suppose to init all of it in one call?
> Your main RAM will be all contiguous, the only reason it would be
> discontiguous is if you were trying to model 128MB + 128MB,
> which you can't specify anyway with a single 'this much memory' ram_size
> argument.

Yes, It will make things a little more complex for the alias memory (if 
any).
I'll work something up.

>
>> And if memory_region_allocate_system_memory() should really be called only
>> once, why is it not enforced in this function? After all,
>> memory_region_allocate_system_memory() only calls memory_region_init_ram()
>> and vmstate_register_ram_global() in one step ...
> It does a lot more complicated things than that, potentially.

For NUMA platforms, it seems. But in our simple case it seems that it 
doesn't do a lot more. But OK, I'll change things.

> I agree that it ought to assert the once-and-only-once property;
> in fact I suggested on IRC last week that that would be a good
> plan, since it's an easy mistake to make.
>
> thanks
> -- PMM
>


[-- Attachment #2: Type: text/html, Size: 3694 bytes --]

  reply	other threads:[~2015-08-10 17:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 21:21 [Qemu-devel] [PATCH v13 00/19] i.MX: Add i.MX25 support through the PDK evaluation board Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 01/19] i.MX: Split UART emulator in a header file and a source file Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 02/19] i.MX: Move serial initialization to init/realize of DeviceClass Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 03/19] i.MX:Fix Coding style for UART emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 04/19] i.MX: Split AVIC emulator in a header file and a source file Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 05/19] i.MX: Fix Coding style for AVIC emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 06/19] i.MX: Split CCM emulator in a header file and a source file Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 07/19] i.MX: Fix Coding style for CCM emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 08/19] i.MX: Split EPIT emulator in a header file and a source file Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 09/19] i.MX: Fix Coding style for EPIT emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 10/19] i.MX: Split GPT emulator in a header file and a source file Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 11/19] i.MX: Fix Coding style for GPT emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 12/19] i.MX: Add SOC support for i.MX31 Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 13/19] i.MX: KZM now uses the standalone i.MX31 SOC support Jean-Christophe Dubois
2015-08-07 13:45   ` Peter Maydell
2015-08-10 16:15     ` Jean-Christophe DUBOIS
2015-08-10 16:23       ` Peter Maydell
2015-08-10 17:01         ` Jean-Christophe DUBOIS [this message]
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 14/19] i.MX: Add I2C controller emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 15/19] i.MX: Add FEC Ethernet Emulator Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 16/19] i.MX: Add SOC support for i.MX25 Jean-Christophe Dubois
2015-08-07 13:50   ` Peter Maydell
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 17/19] i.MX: Add the i.MX25 PDK plateform Jean-Christophe Dubois
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 18/19] i.MX: Add qtest support for I2C device emulator Jean-Christophe Dubois
2015-08-07 13:05   ` Peter Maydell
2015-08-10 16:19     ` Jean-Christophe DUBOIS
2015-07-16 21:21 ` [Qemu-devel] [PATCH v13 19/19] i.MX: Adding i2C devices to i.MX31 SOC Jean-Christophe Dubois
2015-08-07 14:02   ` Peter Maydell
2015-07-30 21:36 ` [Qemu-devel] [PATCH v13 00/19] i.MX: Add i.MX25 support through the PDK evaluation board Jean-Christophe DUBOIS
2015-07-30 22:32   ` Peter Maydell
2015-08-07 14:13 ` Peter Maydell
2015-08-10 16:20   ` Jean-Christophe DUBOIS

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=55C8D8EF.4090304@tribudubois.net \
    --to=jcd@tribudubois.net \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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.