From: Andrew Jones <drjones@redhat.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] arm: add useful headers from the linux kernel
Date: Thu, 2 Jan 2014 18:24:10 +0100 [thread overview]
Message-ID: <20140102172410.GI9725@hawk.usersys.redhat.com> (raw)
In-Reply-To: <20131229063158.GJ13601@cbox>
On Sat, Dec 28, 2013 at 10:31:58PM -0800, Christoffer Dall wrote:
> On Fri, Dec 13, 2013 at 11:58:05AM +0100, Andrew Jones wrote:
> > We're going to need PSR bit defines and pt_regs. We'll also need
> > pt_regs offsets in assembly code. This patch adapts the linux
> > kernel's ptrace.h and asm-offsets to this framework. Even though
> > lib/arm/asm-offsets.h is a generated file, we still commit it,
> > as it's unlikely to change. Also adapt cp15.h from the kernel,
> > since we'll need bit defines from there too.
>
> Why commit the autogenerated header? That will just create noise in the
> git log... It seems like it's auto-building it every time anyway, so it
> would only be to avoid that step...
Hmm, it doesn't for me. For me you need to do 'make asm-offsets' to
regenerate it, which will likely only be necessary when we add more
structs. Possibly we'll be adding structs frequently at first, but
eventually we'll have what we need, and then the churn will be low.
Anyway, whatever, it just didn't seem necessary to me, and also nice
to be able to git-diff the asm-offsets.h file, rather than just the
generator.
> > diff --git a/config/config-arm.mak b/config/config-arm.mak
> > index d0814186b279c..173e606fbe64c 100644
> > --- a/config/config-arm.mak
> > +++ b/config/config-arm.mak
> > @@ -1,3 +1,4 @@
> > +PROCESSOR = cortex-a15
> > mach = mach-virt
> > iodevs = pl011 virtio_mmio
> > phys_base = 0x40000000
> > @@ -30,8 +31,7 @@ $(libcflat) $(libeabi): CFLAGS += -ffreestanding -I lib
> >
> > CFLAGS += -Wextra
> > CFLAGS += -marm
> > -#CFLAGS += -mcpu=$(PROCESSOR)
> > -CFLAGS += -mcpu=cortex-a15
> > +CFLAGS += -mcpu=$(PROCESSOR)
> > CFLAGS += -O2
>
> unrelated changes?
yeah...
>
> >
> > libgcc := $(shell $(CC) -m$(ARCH) --print-libgcc-file-name)
> > @@ -55,7 +55,7 @@ tests_and_config = $(TEST_DIR)/*.flat $(TEST_DIR)/unittests.cfg
> >
> > test_cases: $(tests-common) $(tests)
> >
> > -$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib
> > +$(TEST_DIR)/%.o scripts/arm/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib
> >
> > $(TEST_DIR)/boot.elf: $(cstart.o) $(TEST_DIR)/boot.o
> >
> > @@ -67,7 +67,16 @@ lib/$(TEST_DIR)/mach-virt.dts:
> > $(QEMU_BIN) -kernel /dev/null -M virt -machine dumpdtb=$(dtb)
> > fdtdump $(dtb) > $@
> >
> > +.PHONY: asm-offsets
> > +
> > +asm-offsets: scripts/arm/asm-offsets.flat
> > + $(QEMU_BIN) -device virtio-testdev -display none -serial stdio \
> > + -M virt -cpu $(PROCESSOR) \
> > + -kernel $^ > lib/arm/asm-offsets.h || true
>
> this is a shame, you're depending on a full working setup with a correct
> QEMU to just build this thing. Did you consider replicating the
> kernel's Kbuild approach?
Actually, I'm not, because we commit the asm-offsets.h file :-) So unless
you're changing it, you don't need the above target. I'm not sure what
part of Kbuild you're referring to. I certainly don't want to over-engineer
the build process of these unit tests though.
>
> In fact, when I started playing around with this, it was quite the
> hassle, because I run with a cross-compiled QEMU for my ARM devices
> which doesn't compile on my build-machine, so now I need a different
> x86-compiled QEMU with mach-virt support compiled somewhere, and I can
> only build unit-tests when I remember to set the QEMU variable in my
> shell. So if we really stick with this approach, why not make it part
> of the ./configure options? That being said, I really want the build
> here only to depend on having an ARM compiler :((
Ahh, maybe we should commit the dts that mach-virt generates too then.
drew
next prev parent reply other threads:[~2014-01-02 17:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 10:58 [PATCH v2 0/3] kvm-unit-tests/arm: add vectors support Andrew Jones
2013-12-13 10:58 ` [PATCH 1/3] printf: support field padding Andrew Jones
2013-12-29 6:31 ` Christoffer Dall
2014-01-02 17:09 ` Andrew Jones
2014-01-02 17:25 ` Christoffer Dall
2013-12-13 10:58 ` [PATCH 2/3] arm: add useful headers from the linux kernel Andrew Jones
2013-12-29 6:31 ` Christoffer Dall
2014-01-02 17:24 ` Andrew Jones [this message]
2014-01-02 18:08 ` Christoffer Dall
2013-12-13 10:58 ` [PATCH 3/3] arm: vectors support Andrew Jones
2013-12-29 6:32 ` Christoffer Dall
2013-12-29 10:21 ` Peter Maydell
2014-01-02 18:36 ` Andrew Jones
2014-01-02 21:04 ` 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=20140102172410.GI9725@hawk.usersys.redhat.com \
--to=drjones@redhat.com \
--cc=christoffer.dall@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.