From: Matt Evans <matt@ozlabs.org>
To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Subject: [PATCH 00/28] kvm tools: Prepare kvmtool for another architecture
Date: Tue, 06 Dec 2011 14:35:15 +1100 [thread overview]
Message-ID: <4EDD8D73.2020304@ozlabs.org> (raw)
Hi,
This patch series rearranges and tidies various parts of kvmtool to pave the way
for the addition of support for another architecture -- SPAPR PPC64. A second
patch series will follow to present the PPC64 support.
kvmtool is extremely x86-specific, so a fair chunk of refactoring into "common
code" vs "architecture-specific code" is performed in this set. It also has a
(refreshingly small) set of endian bugs that are fixed, plus assumptions about
the hardware presented to the guest.
I've started the series with the main meat-- moving/renaming things like bios,
CPU setup, guest address space layout, interrupts, ioports etc., into a new x86/
directory. The Makefile determines an architecture and builds the appropriate
dir, devices, etc.
Follow-on patches change some of the mechanics, for example modifying the loop
around ioctl(KVM_RUN) so that whilst it stays generic, it calls into
arch-specific code to handle specific exit reasons, MMIO etc. The builtin-run
initialisation path is rationalised so that PCI & IRQs are initialised before
devices, and all of this happens before arch-specific code is given the chance
to initialise any firmware and generate any device trees.
Most of this series is fairly trivial, in moving code, making definitions
arch-local or available via a header, endian sanitisation. The PCI code changes
are probably most 'interesting', in that I have made the config space accesses
available to those not using the PC ioport access method, plus wrapped
initialisations of config space with cpu_to_leXX accesses.
If there's anything in this series that'll cause the world to end, or stain, do
let me know. :)
Cheers,
Matt
Matt Evans (28):
kvm tools: Split x86 arch-specific bits into x86/
kvm tools: Only build/init i8042 on x86
kvm tools: Add Makefile parameter for kernel include path
kvm tools: Re-arrange Makefile to heed CFLAGS before checking for
optional libs
kvm tools: 64-bit tidy; use PRIx64 when printf'ing u64s and link
appropriately
kvm tools: Add arch-specific KVM_RUN exit handling via
kvm_cpu__handle_exit()
kvm tools: Move 'kvm__recommended_cpus' to arch-specific code
kvm tools: Fix KVM_RUN exit code check
kvm tools: Add kvm__arch_periodic_poll()
kvm tools: term.h needs to include stdbool.h
kvm tools: kvm.c needs to include sys/stat.h for mkdir
kvm tools: Move arch-specific cmdline init into
kvm__arch_set_cmdline()
kvm tools: Add CONSOLE_HV term type and allow it to be selected
kvm tools: Fix term_getc(), term_getc_iov() endian bugs
kvm tools: Allow initrd_check() to match a cpio
kvm tools: Allow load_flat_binary() to load an initrd alongside
kvm tools: Only call symbol__init() if we have BFD
kvm tools: Initialise PCI before devices start getting registered
with PCI
kvm tools: Perform CPU and firmware setup after devices are added
kvm tools: Init IRQs after determining nrcpus
kvm tools: Add --hugetlbfs option to specify memory path
kvm tools: Move PCI_MAX_DEVICES to pci.h
kvm tools: Endian-sanitise pci.h and PCI device setup
kvm tools: Fix virtio-pci endian bug when reading
VIRTIO_PCI_QUEUE_NUM
kvm tools: Correctly set virtio-pci bar_size and remove hardwired
address
kvm tools: Add pci__config_{rd,wr}(), pci__find_dev() and fix PCI
config register addressing
kvm tools: Arch-specific define for PCI MMIO allocation area
kvm tools: Create arch-specific kvm_cpu__emulate_io()
tools/kvm/Makefile | 139 +++++---
tools/kvm/builtin-run.c | 82 +++--
tools/kvm/builtin-stat.c | 4 +-
tools/kvm/disk/core.c | 4 +-
tools/kvm/hw/pci-shmem.c | 23 +-
tools/kvm/hw/vesa.c | 15 +-
tools/kvm/include/kvm/ioport.h | 13 +-
tools/kvm/include/kvm/kvm-cpu.h | 30 +--
tools/kvm/include/kvm/kvm.h | 62 +---
tools/kvm/include/kvm/pci.h | 30 ++-
tools/kvm/include/kvm/term.h | 2 +
tools/kvm/ioport.c | 54 ---
tools/kvm/kvm-cpu.c | 407 +---------------------
tools/kvm/kvm.c | 374 +-------------------
tools/kvm/mmio.c | 4 +-
tools/kvm/pci.c | 76 +++--
tools/kvm/term.c | 5 +-
tools/kvm/virtio/pci.c | 51 ++--
tools/kvm/{ => x86}/bios.c | 0
tools/kvm/{ => x86}/bios/.gitignore | 0
tools/kvm/{ => x86}/bios/bios-rom.S | 2 +-
tools/kvm/{ => x86}/bios/e820.c | 0
tools/kvm/{ => x86}/bios/entry.S | 0
tools/kvm/{ => x86}/bios/gen-offsets.sh | 0
tools/kvm/{ => x86}/bios/int10.c | 0
tools/kvm/{ => x86}/bios/int15.c | 0
tools/kvm/{ => x86}/bios/local.S | 0
tools/kvm/{ => x86}/bios/macro.S | 0
tools/kvm/{ => x86}/bios/memcpy.c | 0
tools/kvm/{ => x86}/bios/rom.ld.S | 0
tools/kvm/{ => x86}/cpuid.c | 0
tools/kvm/{ => x86}/include/kvm/assembly.h | 0
tools/kvm/{ => x86}/include/kvm/barrier.h | 0
tools/kvm/{ => x86}/include/kvm/bios-export.h | 0
tools/kvm/{ => x86}/include/kvm/bios.h | 0
tools/kvm/{ => x86}/include/kvm/boot-protocol.h | 0
tools/kvm/{ => x86}/include/kvm/cpufeature.h | 0
tools/kvm/{ => x86}/include/kvm/interrupt.h | 0
tools/kvm/x86/include/kvm/kvm-arch.h | 64 ++++
tools/kvm/x86/include/kvm/kvm-cpu-arch.h | 33 ++
tools/kvm/{ => x86}/include/kvm/mptable.h | 0
tools/kvm/{ => x86}/interrupt.c | 0
tools/kvm/x86/ioport.c | 59 ++++
tools/kvm/{ => x86}/irq.c | 0
tools/kvm/x86/kvm-cpu.c | 425 +++++++++++++++++++++++
tools/kvm/x86/kvm.c | 385 ++++++++++++++++++++
tools/kvm/{ => x86}/mptable.c | 0
47 files changed, 1287 insertions(+), 1056 deletions(-)
rename tools/kvm/{ => x86}/bios.c (100%)
rename tools/kvm/{ => x86}/bios/.gitignore (100%)
rename tools/kvm/{ => x86}/bios/bios-rom.S (80%)
rename tools/kvm/{ => x86}/bios/e820.c (100%)
rename tools/kvm/{ => x86}/bios/entry.S (100%)
rename tools/kvm/{ => x86}/bios/gen-offsets.sh (100%)
rename tools/kvm/{ => x86}/bios/int10.c (100%)
rename tools/kvm/{ => x86}/bios/int15.c (100%)
rename tools/kvm/{ => x86}/bios/local.S (100%)
rename tools/kvm/{ => x86}/bios/macro.S (100%)
rename tools/kvm/{ => x86}/bios/memcpy.c (100%)
rename tools/kvm/{ => x86}/bios/rom.ld.S (100%)
rename tools/kvm/{ => x86}/cpuid.c (100%)
rename tools/kvm/{ => x86}/include/kvm/assembly.h (100%)
rename tools/kvm/{ => x86}/include/kvm/barrier.h (100%)
rename tools/kvm/{ => x86}/include/kvm/bios-export.h (100%)
rename tools/kvm/{ => x86}/include/kvm/bios.h (100%)
rename tools/kvm/{ => x86}/include/kvm/boot-protocol.h (100%)
rename tools/kvm/{ => x86}/include/kvm/cpufeature.h (100%)
rename tools/kvm/{ => x86}/include/kvm/interrupt.h (100%)
create mode 100644 tools/kvm/x86/include/kvm/kvm-arch.h
create mode 100644 tools/kvm/x86/include/kvm/kvm-cpu-arch.h
rename tools/kvm/{ => x86}/include/kvm/mptable.h (100%)
rename tools/kvm/{ => x86}/interrupt.c (100%)
create mode 100644 tools/kvm/x86/ioport.c
rename tools/kvm/{ => x86}/irq.c (100%)
create mode 100644 tools/kvm/x86/kvm-cpu.c
create mode 100644 tools/kvm/x86/kvm.c
rename tools/kvm/{ => x86}/mptable.c (100%)
next reply other threads:[~2011-12-06 3:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 3:35 Matt Evans [this message]
2011-12-06 6:06 ` [PATCH 00/28] kvm tools: Prepare kvmtool for another architecture Matt Evans
2011-12-06 8:56 ` Sasha Levin
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=4EDD8D73.2020304@ozlabs.org \
--to=matt@ozlabs.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).