public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: will.deacon@arm.com,
	Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
Cc: kvm@vger.kernel.org
Subject: [RFC PATCH 0/2] kvmtool: Rework guest/init integration
Date: Tue, 23 Jun 2015 16:06:25 +0100	[thread overview]
Message-ID: <1435071987-7543-1-git-send-email-andre.przywara@arm.com> (raw)

Hi,

this mini series aims at solving long standing issues with compiling
and linking the guest/init binary for MIPS.
It seems that many MIPS toolchains use different default ELF targets
for the compiler and the linker, rendering the approach of linking
the guest/init executable into the lkvm binary moot.
One could work around this by specifying some magic ELF target
options to the linker so it matches the compiler ones, but I couldn't
find a way of automatically determining those, so this approach is
only valid on a particular toolchain.
Another approach would be to fixup the ELF header, but that sounds
dodgy and fragile to me.

Instead of using "ld" this series transforms the generated guest
binary into a C file, which gets compiled (with CC) and thus
automatically links fine with the other object files.
Patch 2/2 implements this, patch 1/2 cleans up the rules for the
guest binary generation in the Makefile.

This uses the "xxd" tool, which has a special command line option
to generate a C array out of a binary blob. On the distributions
I checked, this comes with the vim package, not sure if that is a
restriction.

I compile tested this on on PowerPC64, MIPS64, ARM, ARM64, i386 and
x86_64.

Please test whether this works with your toolchain / system!

Cheers,
Andre.

Andre Przywara (2):
  Makefile: cleanup guest/init generation
  Makefile: use xxd for converting guest/init

 Makefile        | 21 ++++++++++++---------
 builtin-run.c   |  8 ++++----
 builtin-setup.c |  8 ++++----
 3 files changed, 20 insertions(+), 17 deletions(-)

-- 
2.3.5


             reply	other threads:[~2015-06-23 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 15:06 Andre Przywara [this message]
2015-06-23 15:06 ` [RFC PATCH 1/2] Makefile: cleanup guest/init generation Andre Przywara
2015-06-23 15:06 ` [RFC PATCH 2/2] Makefile: use xxd for converting guest/init Andre Przywara
2015-06-24  8:53   ` Andreas Herrmann

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=1435071987-7543-1-git-send-email-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=andreas.herrmann@caviumnetworks.com \
    --cc=kvm@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /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