All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Xu <peterx@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	qemu-devel@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	"Alexander Bulekov" <alxndr@bu.edu>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Joel Stanley" <joel@jms.id.au>
Subject: Re: [PATCH 1/2] hw/mips/jazz: Use generic I/O bus via get_system_io()
Date: Thu, 11 Mar 2021 18:41:26 +0100	[thread overview]
Message-ID: <1f25782b-abcb-a3bc-fddc-0b585536ffcf@amsat.org> (raw)
In-Reply-To: <a64ff8f0-5db1-c338-b99b-7a74a150a770@amsat.org>

On 3/11/21 5:21 PM, Philippe Mathieu-Daudé wrote:
> +Aspeed team
> 
> On 3/11/21 1:18 PM, Philippe Mathieu-Daudé wrote:
>> On 3/10/21 9:29 PM, Peter Xu wrote:
> 
>>> Yeah no worry - it's just that I feel one memory_region_init_alias() call is
>>> probably missing in your huge series somewhere, so that you'll take that alias
>>> MR as subregion rather than the real MR (which is the root of one AS).
>>
>> OK, with your earlier comments start + Mark other comment I start
>> to understand better.
>>
>> So far:
>>
>> (1a) AddressSpace is a physical view, its base address must be zero
>>
>> (1b) AddressSpace aperture is fixed (depends on hardware design,
>> not changeable at runtime
>>
>> Therefore due to (1a):
>> (2) AddressSpace root MemoryRegion is a container and must not be
>> mmio-mapped anywhere (in particular not on SysBus).
>>
>> (3) If hardware has a MMIO view of an AddressSpace, it has to be
>> via a MemoryRegion alias. That way the alias handles paddr offset
>> adjustment to the zero-based AddressSpace root container MR.
>> Aliasing allows resizing the alias size without modifying the AS
>> aperture size (1b).
>>
>> I'll start adding assertions for (1a) and (2) in the code base and
>> see if (3) adjustments are required.
> 
> So using:
> 
> -- >8 --
> diff --git a/softmmu/memory.c b/softmmu/memory.c
> index 874a8fccdee..8ce2d7f83b9 100644
> --- a/softmmu/memory.c
> +++ b/softmmu/memory.c
> @@ -713,6 +713,12 @@ static MemoryRegion
> *memory_region_get_flatview_root(MemoryRegion *mr)
>                  continue;
>              }
>          }
> +        if (mr && mr->addr) {
> +            error_report("Detected flatview root memory region '%s' with"
> +                         " non-zero base address (0x%"HWADDR_PRIx"):
> aborting",
> +                         memory_region_name(mr), mr->addr);
> +            abort();
> +        }
> 
>          return mr;
>      }
> ---
> 
> I get:
> 
> $ ./qemu-system-arm -M ast2600-evb
> qemu-system-arm: Detected flatview root memory region
> 'aspeed.fmc-ast2600.flash' with non-zero base address (0x20000000): aborting
> Aborted (core dumped)

Another one (PPC):

$ ./qemu-system-ppc -S -monitor stdio -M 40p
QEMU 5.2.50 monitor - type 'help' for more information
(qemu) qemu-system-ppc: Detected flatview root memory region 'pci-io'
with non-zero base address (0x80000000): aborting
Aborted (core dumped)

$ ./qemu-system-ppc -S -monitor stdio -M 40p
QEMU 5.2.50 monitor - type 'help' for more information
(qemu) info mtree
address-space: raven-io
  0000000080000000-00000000bf7fffff (prio 0, i/o): pci-io
    0000000080000000-0000000080000007 (prio 0, i/o): dma-chan
    0000000080000008-000000008000000f (prio 0, i/o): dma-cont
    0000000080000020-0000000080000021 (prio 0, i/o): pic
    0000000080000040-0000000080000043 (prio 0, i/o): pit
    0000000080000060-0000000080000060 (prio 0, i/o): i8042-data
    0000000080000061-0000000080000061 (prio 0, i/o): pcspk
    0000000080000064-0000000080000064 (prio 0, i/o): i8042-cmd
    0000000080000070-0000000080000071 (prio 0, i/o): rtc
      0000000080000070-0000000080000070 (prio 0, i/o): rtc-index
    0000000080000074-0000000080000077 (prio 0, i/o): m48t59
    0000000080000081-0000000080000083 (prio 0, i/o): dma-page
    0000000080000087-0000000080000087 (prio 0, i/o): dma-page
    ...

address-space: lsi-pci-io
  0000000080000000-00000000bf7fffff (prio 0, i/o): pci-io
    0000000080000000-0000000080000007 (prio 0, i/o): dma-chan
    0000000080000008-000000008000000f (prio 0, i/o): dma-cont
    0000000080000020-0000000080000021 (prio 0, i/o): pic
    0000000080000040-0000000080000043 (prio 0, i/o): pit
    0000000080000060-0000000080000060 (prio 0, i/o): i8042-data
    0000000080000061-0000000080000061 (prio 0, i/o): pcspk
    0000000080000064-0000000080000064 (prio 0, i/o): i8042-cmd
    0000000080000070-0000000080000071 (prio 0, i/o): rtc
      0000000080000070-0000000080000070 (prio 0, i/o): rtc-index
      ...

memory-region: pci-memory
  00000000c0000000-00000000feffffff (prio 0, i/o): pci-memory
    00000000c00a0000-00000000c00bffff (prio 1, i/o): vga-lowmem


  parent reply	other threads:[~2021-03-11 17:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 23:54 [PATCH 0/3] memory: Display AddressSpace zero-based in 'info mtree' Philippe Mathieu-Daudé
2021-03-05 23:54 ` [PATCH 1/3] memory: Better name 'offset' argument in mtree_print_mr() Philippe Mathieu-Daudé
2021-03-05 23:54 ` [PATCH 2/3] memory: Provide 'base address' argument to mtree_print_mr() Philippe Mathieu-Daudé
2021-03-08 23:40   ` Peter Xu
2021-03-09  9:39     ` Philippe Mathieu-Daudé
2021-03-09 21:54       ` Philippe Mathieu-Daudé
2021-03-10 17:06         ` Peter Xu
2021-03-10 19:09           ` Philippe Mathieu-Daudé
2021-03-10 19:12             ` [PATCH 1/2] hw/mips/jazz: Use generic I/O bus via get_system_io() Philippe Mathieu-Daudé
2021-03-10 19:12               ` [PATCH 2/2] NOTFORMERGE memory: Ensure AddressSpace physical base address is zero Philippe Mathieu-Daudé
2021-03-10 19:49               ` [PATCH 1/2] hw/mips/jazz: Use generic I/O bus via get_system_io() Peter Xu
2021-03-10 20:11                 ` Philippe Mathieu-Daudé
2021-03-10 20:29                   ` Peter Xu
2021-03-11 12:18                     ` Philippe Mathieu-Daudé
2021-03-11 16:21                       ` Philippe Mathieu-Daudé
2021-03-11 17:27                         ` Peter Xu
2021-03-11 17:59                           ` Philippe Mathieu-Daudé
2021-03-12  9:08                           ` Cédric Le Goater
2021-03-11 17:27                         ` Peter Xu
2021-03-11 17:41                         ` Philippe Mathieu-Daudé [this message]
2021-03-11  0:48               ` Jiaxun Yang
2021-03-10 19:31             ` [PATCH 2/3] memory: Provide 'base address' argument to mtree_print_mr() Peter Xu
2021-03-10 22:00         ` Mark Cave-Ayland
2021-03-05 23:54 ` [PATCH 3/3] memory: Make memory_region_to_absolute_addr() take a const MemoryRegion Philippe Mathieu-Daudé
2021-03-11 12:19   ` Philippe Mathieu-Daudé

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=1f25782b-abcb-a3bc-fddc-0b585536ffcf@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alxndr@bu.edu \
    --cc=andrew@aj.id.au \
    --cc=aurelien@aurel32.net \
    --cc=clg@kaod.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=hpoussin@reactos.org \
    --cc=joel@jms.id.au \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --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.