From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKOVj-0001ZO-K8 for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:18:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKOVd-0006hu-Kd for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:18:23 -0400 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:44779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKOVd-0006hl-Du for qemu-devel@nongnu.org; Thu, 21 Aug 2014 05:18:17 -0400 Received: by mail-wg0-f51.google.com with SMTP id b13so8814456wgh.34 for ; Thu, 21 Aug 2014 02:18:16 -0700 (PDT) Date: Thu, 21 Aug 2014 11:18:10 +0200 From: Marc =?UTF-8?B?TWFyw60=?= Message-ID: <20140821111810.785eaad2@crunchbang> In-Reply-To: <53F5B6AB.7010205@redhat.com> References: <1408556804-5266-1-git-send-email-marc.mari.barcelo@gmail.com> <53F5B6AB.7010205@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] qapi: New command query-mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , qemu-devel@nongnu.org, Stefan Hajnoczi , Andreas =?UTF-8?B?RsOkcmJlcg==?= El Thu, 21 Aug 2014 11:06:51 +0200 Paolo Bonzini escribi=C3=B3: > Il 20/08/2014 19:46, Marc Mar=C3=AD ha scritto: > > Add command query-mtree to get the memory tree of the guest. > >=20 > > 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. > >=20 > > 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). > >=20 > > The actual output is this: http://pastebin.com/nHAH9Jie > > Which corresponds to this info mtree: http://pastebin.com/B5vw8DDf >=20 > 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? > If you had a memory map abstraction in libqos, malloc could be > generic. Perhaps you can start doing that for PC? Do you mean, start implementing malloc using this "query-mtree"? Or you have another idea in mind? Marc