From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKP6i-0001V6-8K for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKP6a-0003tu-T0 for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:56:36 -0400 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:43497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKP6a-0003to-Mj for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:56:28 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so9054568wes.35 for ; Thu, 21 Aug 2014 02:56:27 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53F5C248.1090907@redhat.com> Date: Thu, 21 Aug 2014 11:56:24 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1408556804-5266-1-git-send-email-marc.mari.barcelo@gmail.com> <53F5B6AB.7010205@redhat.com> <20140821111810.785eaad2@crunchbang> In-Reply-To: <20140821111810.785eaad2@crunchbang> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC] qapi: New command query-mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYyBNYXLDrQ==?= Cc: Peter Maydell , qemu-devel@nongnu.org, Stefan Hajnoczi , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Il 21/08/2014 11:18, Marc Marí ha scritto: > El Thu, 21 Aug 2014 11:06:51 +0200 > Paolo Bonzini 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