public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Andrew Jones <drjones@redhat.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 6/9] Introduce a simple iomap structure
Date: Thu, 2 Jan 2014 13:05:05 -0800	[thread overview]
Message-ID: <20140102210505.GM27806@cbox> (raw)
In-Reply-To: <20140102184013.GL9725@hawk.usersys.redhat.com>

On Thu, Jan 02, 2014 at 07:40:14PM +0100, Andrew Jones wrote:
> On Thu, Jan 02, 2014 at 09:23:38AM -0800, Christoffer Dall wrote:
> > On Thu, Jan 02, 2014 at 05:04:48PM +0100, Andrew Jones wrote:
> > > On Sat, Dec 28, 2013 at 10:30:54PM -0800, Christoffer Dall wrote:
> > > > > +struct iomap {
> > > > > +	const char *type;
> > > > > +	const char *compats[5];
> > > > 
> > > > I would name the field compatible to be more in-line with the
> > > > DT-representation, but OK.
> > > > 
> > > > it looks from the above like the array must be null terminated?
> > > > 
> > > > how about #define IOMAP_MAX_COMPATS 5
> > > 
> > > defines are good.
> > > 
> > > > and then turn your loop above into:
> > > > 
> > > > for (i = 0; i < IOMAP_MAX_COMPATS; i++, m++) {
> > > > 	if (!m->compats[i])
> > > > 		break;
> > > 
> > > Doesn't improve the loop conditions much, IMO.
> > > 
> > 
> > I think it's much simpler to read a for loop of the typical form of
> > until "i < CONSTANT";  what you had before was a data structure with an
> > assumption of null-termination that could only be realized by looking at
> > the code that deals with it.
> > 
> > > > 	if (strcmp(m->compats[i], compat) == 0)
> > > > 		return m;
> > > > }
> > > > 
> > > > > +	u32 nr;
> > > > > +	u32 addrs[64];
> > > > 
> > > > why are we limiting ourselves to a 32 bit physical address space?
> > > 
> > > I have had this mentally noted from the beginning as something I'll
> > > need to deal with when getting aarch64 going. Anyway, I think a lot
> > > of this is going to change as I teach kvm-unit-tests more and more
> > > about DT.
> > 
> > Shouldn't be a big change to just support u64 in your iomap instead.
> > 
> > > 
> > > <snip>
> > > > > +print "{\n\t.type = NULL,\n},\n";
> > > > > +print "};\n";
> > > > > +exit 0;
> > > > 
> > > > This script doesn't work on either of the Ubuntu distros I run.  The
> > > > reasons are that the dumpfdt tool is not processing the multi-compatible
> > > > strings output from the dtb correctly and the fdtget utility included
> > > > does not yet have the -l option to list subnodes.
> > > > 
> > > > I spent a fair amount of time trying to fix this, changing dumpfdt to
> > > > 'dtc -I dtb -O dts', and I tried it on the newest Ubuntu distro, tried
> > > > compiling fdtget from the kernel sources etc. and failed miserably.
> > > > 
> > > > I think at the very least we need to check the tools available on the
> > > > build machine as part of the configure script or test it a little
> > > > broader.
> > > >
> > > 
> > > Drat. I've preferred the idea of using the tools to parse the DT during
> > > the build - avoiding the need for [cross-compiled] libfdt as a dep, but
> > > I guess as we need more and more from the DT, or when particular tests
> > > want to look at the DT itself, and there are already dependency problems,
> > > then it's looking more and more like we should just use libfdt.
> > > 
> > Yes, after working with this for a while that's the same conclusion I
> > came to.  From the ARM perspective, anything running in a VM will be
> > device-tree driven (this is not the time for anybody to say anything
> > about ACPI), so we could just feed the VM the device tree directly if we
> > support libfdt in the guest and avoid another point of failure.  I can
> > try to find some time to help you hack that up if you want.
> 
> I'll start this work right away. Peter's import libfdt idea sounds like
> the perfect solution.
> 
Agreed.

-Christoffer

  reply	other threads:[~2014-01-02 21:04 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 16:42 [PATCH 0/9 v2] kvm-unit-tests/arm: initial drop Andrew Jones
2013-12-04 16:42 ` [PATCH 1/9] remove unused files Andrew Jones
2013-12-04 16:42 ` [PATCH 2/9] makefile and run_tests tweaks Andrew Jones
2013-12-29  6:30   ` Christoffer Dall
2014-01-02 14:30     ` Andrew Jones
2013-12-04 16:42 ` [PATCH 3/9] clean root dir of all x86-ness Andrew Jones
2013-12-29  6:30   ` Christoffer Dall
2014-01-02 15:00     ` Andrew Jones
2014-01-02 17:16       ` Christoffer Dall
2013-12-04 16:42 ` [PATCH 4/9] move x86's simple heap management to common code Andrew Jones
2013-12-29  6:30   ` Christoffer Dall
2014-01-02 15:17     ` Andrew Jones
2014-01-02 17:17       ` Christoffer Dall
2013-12-04 16:42 ` [PATCH 5/9] Introduce libio to common code for io read/write Andrew Jones
2013-12-29  6:30   ` Christoffer Dall
2014-01-02 15:47     ` Andrew Jones
2014-01-02 17:19       ` Christoffer Dall
2014-01-02 18:38         ` Andrew Jones
2013-12-04 16:42 ` [PATCH 6/9] Introduce a simple iomap structure Andrew Jones
2013-12-29  6:30   ` Christoffer Dall
2014-01-02 16:04     ` Andrew Jones
2014-01-02 17:23       ` Christoffer Dall
2014-01-02 18:40         ` Andrew Jones
2014-01-02 21:05           ` Christoffer Dall [this message]
2014-01-02 17:32       ` Peter Maydell
2013-12-04 16:42 ` [PATCH 7/9] Add halt() and some error codes Andrew Jones
2013-12-29  6:31   ` Christoffer Dall
2013-12-04 16:42 ` [PATCH 8/9] Introduce virtio-testdev Andrew Jones
2013-12-29  6:31   ` Christoffer Dall
2014-01-02 16:16     ` Andrew Jones
2014-01-02 17:27       ` Christoffer Dall
2014-01-02 18:41         ` Andrew Jones
2013-12-04 16:42 ` [PATCH 9/9] arm: initial drop Andrew Jones
2013-12-29  6:31   ` Christoffer Dall
2013-12-29  9:18     ` Peter Maydell
2014-01-02 16:54     ` Andrew Jones
2014-01-02 17:40       ` Peter Maydell
2014-01-02 18:09         ` Christoffer Dall
2014-01-02 18:44           ` Andrew Jones
2014-01-02 17:44       ` Christoffer Dall
2014-01-02 18:50         ` Andrew Jones
2014-01-02 19:17           ` Christoffer Dall
2014-01-03 17:52             ` Andrew Jones
2014-01-03 17:55               ` Christoffer Dall

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=20140102210505.GM27806@cbox \
    --to=christoffer.dall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    /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