From: Paolo Bonzini <pbonzini@redhat.com>
To: Andrew Jones <drjones@redhat.com>,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Cc: christoffer.dall@linaro.org
Subject: Re: [PATCH v7 09/14] arm: initial drop
Date: Wed, 16 Jul 2014 11:22:18 +0200 [thread overview]
Message-ID: <53C6444A.3040107@redhat.com> (raw)
In-Reply-To: <1405500463-20713-10-git-send-email-drjones@redhat.com>
> 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 <params...> # 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 = <num>), and
> +# that the configured amount of memory (-m <MB>) 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 <drjones@redhat.com>
> + *
> + * 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
next prev parent reply other threads:[~2014-07-16 9:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 8:47 [PATCH v7 00/14] kvm-unit-tests/arm: initial drop Andrew Jones
2014-07-16 8:47 ` [PATCH v7 02/14] add support for Linux device trees Andrew Jones
2014-07-16 8:47 ` [PATCH v7 03/14] Introduce asm-generic/*.h files Andrew Jones
2014-07-16 8:47 ` [PATCH v7 04/14] Introduce lib/alloc Andrew Jones
2014-07-16 8:47 ` [PATCH v7 05/14] add minimal virtio support for devtree virtio-mmio Andrew Jones
2014-07-16 8:47 ` [PATCH v7 06/14] lib/asm-generic: add page.h and virt_to_phys/phys_to_virt Andrew Jones
2014-07-16 8:47 ` [PATCH v7 07/14] virtio: add minimal support for virtqueues Andrew Jones
2014-07-16 8:47 ` [PATCH v7 08/14] Introduce chr-testdev Andrew Jones
2014-07-16 9:31 ` Levente Kurusa
2014-07-16 9:33 ` Andrew Jones
2014-07-22 18:06 ` Radim Krčmář
2014-07-16 8:47 ` [PATCH v7 09/14] arm: initial drop Andrew Jones
2014-07-16 9:22 ` Paolo Bonzini [this message]
2014-07-16 9:39 ` Andrew Jones
2014-07-16 10:59 ` Paolo Bonzini
2014-07-16 8:47 ` [PATCH v7 10/14] arm: Add spinlock implementation Andrew Jones
2014-07-16 8:47 ` [PATCH v7 11/14] arm: Add IO accessors to avoid register-writeback Andrew Jones
2014-07-16 8:47 ` [PATCH v7 12/14] arm: Add arch-specific asm/page.h and __va/__pa Andrew Jones
2014-07-16 8:47 ` [PATCH v7 13/14] arm: add useful headers from the Linux kernel Andrew Jones
2014-07-16 8:47 ` [PATCH v7 14/14] arm: vectors support Andrew Jones
2014-08-22 18:51 ` [PATCH v7 00/14] kvm-unit-tests/arm: initial drop Paolo Bonzini
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=53C6444A.3040107@redhat.com \
--to=pbonzini@redhat.com \
--cc=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