From: Peter Maydell <peter.maydell@linaro.org>
To: "Andreas Färber" <afaerber@suse.de>
Cc: pcrost@xilinx.com, QEMU Developers <qemu-devel@nongnu.org>,
Blue Swirl <blauwirbel@gmail.com>,
Anthony Liguori <aliguori@amazon.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v1 22/22] petalogix-ml605: Make the LMB visible only to the CPU
Date: Mon, 16 Dec 2013 13:29:47 +0000 [thread overview]
Message-ID: <CAFEAcA8TbmtSsedWz0sk7NdUKnihB7U0NrkwgSYGzqbLLujhoQ@mail.gmail.com> (raw)
In-Reply-To: <52AEF641.7050401@suse.de>
On 16 December 2013 12:46, Andreas Färber <afaerber@suse.de> wrote:
> Thanks for this series. I've been on vacation so couldn't review the
> previous RFC yet... I'm not entirely happy with the way this is pushing
> work to the machines here and wonder if we can simplify that some more:
>
> For one, I don't like the allocation of AddressSpace and MemoryRegion at
> machine level. Would it be possible to enforce allocating a per-CPU
> AddressSpace and MemoryRegion at cpu.c level, ideally as embedded value
> rather than pointer field? Otherwise CPU hot-add is going to get rather
> complicated and error-prone.
This seems like a good place to stick my oar in about how I
think this should work in the long term...
My view is that AddressSpace and/or MemoryRegion pointers
(links?) should be how we wire up the addressing on machine
models, in an analogous manner to the way we wire up IRQs.
So to take A9MPCore as an example:
* each individual ARMCPU has an AddressSpace * property
* the 'a9mpcore' device should create those ARMCPU objects,
and also the AddressSpaces to pass to them
* the AddressSpace for each core is different, because it
has the private peripherals for that CPU only (this
allows us to get rid of all the shim memory regions which
look up the CPU via current_cpu->cpu_index)
* each core's AddressSpace has as a 'background region'
the single AddressSpace which the board and/or SoC model
has passed to the a9mpcore device
* if there's a separate SoC device object from the board
model, then again the AddressSpace the SoC device passes
to a9mpcore is the result of the SoC mapping the various
SoC-internal devices into an AddressSpace it got passed
by the board
* if the SoC has a DMA engine of some kind then the DMA
engine should also be passed an appropriate AddressSpace
[and we thus automatically correctly model the way the
hardware DMA engine can't see the per-CPU peripherals]
You'll notice that this essentially gets rid of the "system
memory" idea...
I don't have a strong opinion about the exact details of who
is allocating what at what level, but I do think we need to
move towards an idea of handing the consumer of an address
space be passed an appropriate AS/MR which is constructed
by the same thing that creates that consumer.
I'm also not entirely clear on which points in this API
should be dealing with MemoryRegions and which with
AddressSpaces. Perhaps the CPU object should create its
AddressSpace internally and the thing it's passed as a
property should be a MemoryRegion * ?
> TCG loads/saves should always have a CPU[Arch]State associated. Would it
> work to always alias the system MemoryRegion again at cpu.c level with
> lowest priority for range [0,UINT64_MAX] and let derived CPUs do per-CPU
> MemoryRegions by adding MemoryRegions with higher priority?
I think that we should definitely not have individual CPUs
looking at the system memory region directly.
thanks
-- PMM
next prev parent reply other threads:[~2013-12-16 13:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 8:05 [Qemu-devel] [PATCH v1 00/22] Steps towards per CPU address-spaces edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 01/22] exec: Make tb_invalidate_phys_addr input an AS edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 02/22] exec: Make iotlb_to_region " edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 03/22] exec: Always initialize MemorySection address spaces edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 04/22] exec: Make memory_region_section_get_iotlb use section AS edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 05/22] memory: Add MemoryListener to typedefs.h edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 06/22] memory: Add address_space_find_by_name() edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 07/22] qdev: Add qdev property type for AddressSpaces edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 08/22] cpu: Add per-cpu address space edgar.iglesias
2013-12-16 12:11 ` Andreas Färber
2013-12-17 0:34 ` Edgar E. Iglesias
2013-12-17 0:54 ` Peter Maydell
2013-12-17 0:57 ` Peter Crosthwaite
2013-12-17 1:01 ` Edgar E. Iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 09/22] target-microblaze: Add address-space property edgar.iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 10/22] exec: On AS changes, only flush affected CPU TLBs edgar.iglesias
2013-12-16 12:54 ` Andreas Färber
2013-12-17 0:57 ` Edgar E. Iglesias
2013-12-16 8:05 ` [Qemu-devel] [PATCH v1 11/22] exec: Make ldl_*_phys input an AddressSpace edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 12/22] exec: Make ldq/ldub_*_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 13/22] exec: Make lduw_*_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 14/22] exec: Make stq_*_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 15/22] exec: Make stl_*_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 16/22] exec: Make stl_phys_notdirty " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 17/22] exec: Make stw_*_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 18/22] exec: Make stb_phys " edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 19/22] exec: Make cpu_physical_memory_write_rom input an AS edgar.iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 20/22] exec: Make cpu_memory_rw_debug use the CPUs AS edgar.iglesias
2013-12-16 12:48 ` Andreas Färber
2013-12-17 0:52 ` Edgar E. Iglesias
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 21/22] petalogix-ml605: Create the CPU with object_new() edgar.iglesias
2013-12-16 12:14 ` Andreas Färber
2013-12-16 8:06 ` [Qemu-devel] [PATCH v1 22/22] petalogix-ml605: Make the LMB visible only to the CPU edgar.iglesias
2013-12-16 12:46 ` Andreas Färber
2013-12-16 13:29 ` Peter Maydell [this message]
2013-12-16 13:44 ` Andreas Färber
2013-12-16 13:51 ` Peter Maydell
2013-12-16 14:03 ` Andreas Färber
2013-12-16 15:09 ` Peter Maydell
2013-12-17 1:24 ` Edgar E. Iglesias
2013-12-17 1:36 ` Edgar E. Iglesias
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=CAFEAcA8TbmtSsedWz0sk7NdUKnihB7U0NrkwgSYGzqbLLujhoQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=pbonzini@redhat.com \
--cc=pcrost@xilinx.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).