From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: David Hildenbrand <david@redhat.com>,
qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Gerd Hoffmann <kraxel@redhat.com>, Peter Xu <peterx@redhat.com>
Subject: Re: [PATCH v3] memory: Have 'info mtree' remove duplicated Address Space information
Date: Wed, 1 Sep 2021 18:13:54 +0200 [thread overview]
Message-ID: <1dc33d51-e953-6443-cea5-961b5548d3c8@redhat.com> (raw)
In-Reply-To: <14bef4b3-6a2a-2a53-1a7d-8d52b285c7f5@redhat.com>
On 9/1/21 6:01 PM, Philippe Mathieu-Daudé wrote:
> On 8/23/21 11:20 AM, David Hildenbrand wrote:
>> On 23.08.21 10:54, Philippe Mathieu-Daudé wrote:
>>> Per Peter Maydell [*]:
>>>
>>> 'info mtree' monitor command was designed on the assumption that
>>> there's really only one or two interesting address spaces, and
>>> with more recent developments that's just not the case any more.
>>>
>>> Similarly about how the FlatView are sorted using a GHashTable,
>>> sort the AddressSpace objects to remove the duplications (AS
>>> using the same root MemoryRegion).
>>>
>>> This drastically reduce 'info mtree' on some boards.
>>
>> s/reduce/reduces the output of/
>>
>>>
>>> Before:
>>>
>>> $ (echo info mtree; echo q) \
>>> | qemu-system-aarch64 -S -monitor stdio -M raspi3b \
>>> | wc -l
>>> 423
>>>
>>> After:
>>>
>>> $ (echo info mtree; echo q) \
>>> | qemu-system-aarch64 -S -monitor stdio -M raspi3b \
>>> | wc -l
>>> 106
>>>
>>> (qemu) info mtree
>>> address-space: I/O
>>> 0000000000000000-000000000000ffff (prio 0, i/o): io
>>>
>>> address-space: cpu-memory-0
>>> address-space: cpu-memory-1
>>> address-space: cpu-memory-2
>>> address-space: cpu-memory-3
>>> address-space: cpu-secure-memory-0
>>> address-space: cpu-secure-memory-1
>>> address-space: cpu-secure-memory-2
>>> address-space: cpu-secure-memory-3
>>
>> We can still distinguish from a completely empty AS, because we don't
>> have an empty line here, correct?
>
> Yes:
>
> (qemu) info mtree
> address-space: I/O
> 0000000000000000-000000000000ffff (prio 0, i/o): io
Wrong answer because there is 1 MR here.
We can create address_space_init() with NULL MR, because
memory_region_ref() checks for NULL mr, but QEMU aborts
quickly:
(gdb) bt
#0 memory_region_get_flatview_root (mr=0x0) at softmmu/memory.c:685
#1 0x0000555555eec7ef in address_space_update_topology
(as=0x5555567f2a20 <address_space_io>) at softmmu/memory.c:1073
#2 address_space_init (as=0x5555567f2a20 <address_space_io2>, root=0x0,
name=<optimized out>) at softmmu/memory.c:2934
#3 0x0000555555edc7a9 in memory_map_init () at softmmu/physmem.c:2672
#4 cpu_exec_init_all () at softmmu/physmem.c:3070
#5 0x0000555555ef5480 in qemu_create_machine (qdict=0x7fffffffcec0) at
softmmu/vl.c:2126
#6 qemu_init (argc=<optimized out>, argv=0x7fffffffd0e8,
envp=<optimized out>) at softmmu/vl.c:3639
#7 0x00005555559c2fe9 in main (argc=<optimized out>, argv=<optimized
out>, envp=<optimized out>) at softmmu/main.c:49
What is your "completely empty AS" case?
next prev parent reply other threads:[~2021-09-01 16:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 8:54 [PATCH v3] memory: Have 'info mtree' remove duplicated Address Space information Philippe Mathieu-Daudé
2021-08-23 9:20 ` David Hildenbrand
2021-08-23 9:28 ` Peter Maydell
2021-08-23 9:35 ` David Hildenbrand
2021-08-23 10:11 ` Philippe Mathieu-Daudé
2021-09-01 16:01 ` Philippe Mathieu-Daudé
2021-09-01 16:13 ` Philippe Mathieu-Daudé [this message]
2021-08-31 20:27 ` Peter Maydell
2021-08-31 22:08 ` 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=1dc33d51-e953-6443-cea5-961b5548d3c8@redhat.com \
--to=philmd@redhat.com \
--cc=david@redhat.com \
--cc=kraxel@redhat.com \
--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 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).