From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v7 09/14] arm: initial drop Date: Wed, 16 Jul 2014 11:22:18 +0200 Message-ID: <53C6444A.3040107@redhat.com> References: <1405500463-20713-1-git-send-email-drjones@redhat.com> <1405500463-20713-10-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: christoffer.dall@linaro.org To: Andrew Jones , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbaGPJWY (ORCPT ); Wed, 16 Jul 2014 05:22:24 -0400 In-Reply-To: <1405500463-20713-10-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: > diff --git a/arm/unittests.cfg b/arm/unittests.cfg > new file mode 100644 > index 0000000000000..da9dfd7b1f118 > --- /dev/null > +++ b/arm/unittests.cfg > @@ -0,0 +1,18 @@ > +# Define your new unittest following the convention: > +# [unittest_name] > +# file = foo.flat # Name of the flat file to be used > +# smp = 2 # Number of processors the VM will use during this test > +# extra_params = -append # Additional parameters used > +# arch = arm/arm64 # Only if test case is specific to one > +# groups = group1 group2 # Used to identify test cases with run_tests -g ... > + > +# > +# Test that the configured number of processors (smp = ), and > +# that the configured amount of memory (-m ) are correctly setup > +# by the framework. > +# > +[selftest::setup] > +file = selftest.flat > +smp = 1 > +extra_params = -m 256 -append 'setup smp=1 mem=256' > +groups = selftest Nice. :) > diff --git a/lib/arm/asm/page.h b/lib/arm/asm/page.h > new file mode 100644 > index 0000000000000..91a4bc3b7f86e > --- /dev/null > +++ b/lib/arm/asm/page.h > @@ -0,0 +1 @@ > +#include "asm-generic/page.h" > diff --git a/lib/arm/asm/setup.h b/lib/arm/asm/setup.h > new file mode 100644 > index 0000000000000..21445ef2085fc > --- /dev/null > +++ b/lib/arm/asm/setup.h > @@ -0,0 +1,27 @@ > +#ifndef _ASMARM_SETUP_H_ > +#define _ASMARM_SETUP_H_ > +/* > + * Copyright (C) 2014, Red Hat Inc, Andrew Jones > + * > + * This work is licensed under the terms of the GNU LGPL, version 2. > + */ > +#include "libcflat.h" > +#include "alloc.h" > + > +#define NR_CPUS 8 > +extern u32 cpus[NR_CPUS]; > +extern int nr_cpus; > + > +extern phys_addr_t __phys_offset, __phys_end; > + > +#define PHYS_OFFSET (__phys_offset) > +#define PHYS_END (__phys_end) > +#define PHYS_SHIFT 40 > +#define PHYS_SIZE (1ULL << PHYS_SHIFT) > +#define PHYS_MASK (PHYS_SIZE - 1ULL) Can you explain these? I'm not sure I understand this: > + mem_start = regs[0].addr; > + mem_end = mem_start + regs[0].size; > + > + assert(!(mem_start & ~PHYS_MASK) && !((mem_end-1) & ~PHYS_MASK)); > + assert(freemem_start >= mem_start && freemem_start < mem_end); > + > + __phys_offset = mem_start; /* PHYS_OFFSET */ > + __phys_end = mem_end; /* PHYS_END */ and I think the macro indirection (__phys_offset vs. PHYS_OFFSET, __phys_end vs. PHYS_END) is unnecessary: just call the variables phys_offset and phys_end. Paolo