From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH 8/9] arm: initial drop Date: Thu, 17 Oct 2013 15:28:15 +0200 Message-ID: <20131017132814.GA5144@hawk.usersys.redhat.com> 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> 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: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29314 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957Ab3JQN2d (ORCPT ); Thu, 17 Oct 2013 09:28:33 -0400 Content-Disposition: inline In-Reply-To: <20131017101617.GD2172@hawk.usersys.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. The above 'G's are of course 'M's. Who remapped my keyboard? drew