qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] memory: Have 'info mtree' remove duplicated Address Space


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3] memory: Have 'info mtree' remove duplicated Address Space information
Date: Wed, 1 Sep 2021 18:13:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]