From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 8/9] arm: initial drop Date: Thu, 17 Oct 2013 11:39:00 -0700 Message-ID: <20131017183900.GP24837@cbox> References: <1381767815-12510-1-git-send-email-drjones@redhat.com> <1381767815-12510-9-git-send-email-drjones@redhat.com> <20131017010635.GK24837@cbox> <20131017101617.GD2172@hawk.usersys.redhat.com> <20131017132814.GA5144@hawk.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, gleb@redhat.com To: Andrew Jones Return-path: Received: from mail-pb0-f42.google.com ([209.85.160.42]:57701 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758121Ab3JQSiR (ORCPT ); Thu, 17 Oct 2013 14:38:17 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so2683988pbc.15 for ; Thu, 17 Oct 2013 11:38:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131017132814.GA5144@hawk.usersys.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 17, 2013 at 03:28:15PM +0200, Andrew Jones wrote: > On Thu, Oct 17, 2013 at 12:16:18PM +0200, Andrew Jones wrote: > > On Wed, Oct 16, 2013 at 06:06:35PM -0700, Christoffer Dall wrote: > > > > diff --git a/arm/boot.c b/arm/boot.c > > > > new file mode 100644 > > > > index 0000000000000..375e8708a7c54 > > > > > > this file's indentation is also funny, you should really check your > > > editor configuration :) > > > > Actually the editor prefers kernel style, I had to keep trying to > > force the other style on it, and now see below that I wasn't always > > successful. '++expected' should have had just a tab, not a > > tab+4spaces... > > > > > > --- /dev/null > > > > +++ b/arm/boot.c > > > > @@ -0,0 +1,27 @@ > > > > +#include "libcflat.h" > > > > +#include "arm/bootinfo.h" > > > > + > > > > +static bool info_check(u32 var, char *expected) > > > > +{ > > > > + char var_str[9]; > > > > + snprintf(var_str, 9, "%x", var); > > > > + while (*expected == '0' || *expected == 'x') > > > > + ++expected; > > > > + return !strcmp(var_str, expected); > > > > +} > > > > + > > > > +int main(int argc, char **argv) > > > > +{ > > > > + int ret = 0; > > > > + > > > > + if (argc < 3) { > > > > + printf("Not enough arguments. Can't test\n"); > > > > + return 1; > > > > + } > > > > + > > > > + if (!strcmp(argv[0], "info")) > > > > + ret = !info_check(mem32.size, argv[1]) > > > > + || !info_check(core.pagesize, argv[2]); > > > > + > > > > + return ret; > > > > +} > > > > > > I'm actually a little confused, when does this main get invoked and by > > > whom and what are we testing for here? > > > > See cstart.S:start 'bl main' below for the who invokes. And > > arm/unittests.cfg, also below, for the (poorly documented) test case > > definition. You'll see we config the test to have 256G memory, and then > > here we confirm that we read the bootinfo correctly, i.e. it says 256G. Thanks. > > The above 'G's are of course 'M's. Who remapped my keyboard? > That would be one swanky ARM board. -Chrsitoffer