qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] qapi: New command query-mtree


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC] qapi: New command query-mtree
Date: Thu, 21 Aug 2014 11:56:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

Il 21/08/2014 11:18, Marc Marí ha scritto:
> El Thu, 21 Aug 2014 11:06:51 +0200
> Paolo Bonzini <address@hidden> escribió:
>> Il 20/08/2014 19:46, Marc Marí ha scritto:
>>> Add command query-mtree to get the memory tree of the guest.
>>>
>>> As we were looking for a flexible solution on accessing the guest
>>> memory from qtests, Stefan came with the idea to implement this new
>>> qmp command.
>>>
>>> This way, the result can be parsed, and the RAM direction
>>> extracted, so only a generic qtest malloc is necessary and not one
>>> per machine, as it is implemented at the moment (malloc-pc uses
>>> fw_cfg).
>>>
>>> The actual output is this: http://pastebin.com/nHAH9Jie
>>> Which corresponds to this info mtree: http://pastebin.com/B5vw8DDf
>>
>> I don't like this idea very much.  libqos should be using the real
>> memory map information from the machine.  In the case of x86, that
>> means fw_cfg; in the case of ARM, that would mean using the device
>> tree. Getting the information from an out-of-band channel (such as
>> QMP) is basically cheating. :)
> 
> As we were looking at how to access the device tree, we found that the
> device tree is saved in memory with the bootloader or the kernel. So
> tests should be using a kernel every time a ARM machine is booted
> (and /dev/null, at least in virt machine, does not work). Do you have
> any better idea on how to do it?

It works for me:

$ qemu-system-arm -M virt -S -kernel /dev/null -initrd /dev/null \
     -qtest stdio -qtest-log /dev/null
readl 0x40000014
OK 0x0000000044000000
read 0x44000084 20
OK 0x6c696e75782c64756d6d792d7669727400000000

where this string is "linux,dummy-virt".  QMP could be used to provide
the program counter (via "query-cpus"), but it currently doesn't on ARM.
 Perhaps you could make a simple patch to cpus.c for that?

Paolo



reply via email to

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