All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Evans <matt@ozlabs.org>
To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Cc: penberg@kernel.org, asias.hejun@gmail.com,
	levinsasha928@gmail.com, gorcunov@gmail.com
Subject: [PATCH V2 00/23] kvm tools: Prepare kvmtool for another architecture
Date: Fri, 09 Dec 2011 06:52:20 +0000	[thread overview]
Message-ID: <4EE1B024.3010804@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.

Building on the separation of x86-specific code into tools/kvm/x86, this series
change some of the mechanics of kvm tool, 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.

Changes since V1:
- Merged up, V1 patches now upstream are obv. not included here
- No longer uses PRIx64 etc., defining __SANE_USERSPACE_TYPES__ for LL64 on PPC
- Returns kvm__recommended_cpus (and max cpus) to generic code, but fixes them
  so that they cope gracefully with KVM supporting neither CAP.  (A separate
  patch submitted for PPC KVM returns a useful number of CPUs.)
- Made hugetlbfs guest RAM mapping code generic, allow x86 to use it
- Drop unnecessary ifdef around symbol__init()
- Un-broke ioport PCI config access :o)
- Rolled in other review comments (e.g. removal of "& 0xff" in term.c, fixing
  pci_config_address union, create both kvm_cpu__emulate_mmio and _io)

Applies on top of Pekka's linux-kvm.git as of today.


Cheers,


Matt


Matt Evans (23):
  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: Get correct 64-bit types on PPC64 and link appropriately
  kvm tools: Add arch-specific KVM_RUN exit handling via
    kvm_cpu__handle_exit()
  kvm tools: Don't die if KVM_CAP_NR_VCPUS isn't available
  kvm tools: Fix KVM_RUN exit code check
  kvm tools: Add kvm__arch_periodic_poll()
  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: 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 ability to map guest RAM from hugetlbfs
  kvm tools: Move PCI_MAX_DEVICES to pci.h
  kvm tools: Endian-sanitise pci.h and PCI device setup
  kvm tools: Correctly set virtio-pci bar_size and remove hardwired
    address
  kvm tools: Add pci__config_{rd,wr}(), pci__find_dev()
  kvm tools: Arch-specific define for PCI MMIO allocation area
  kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

 tools/kvm/Makefile                       |   99 ++++++++++++++++--------------
 tools/kvm/builtin-run.c                  |   61 +++++++++++--------
 tools/kvm/hw/pci-shmem.c                 |   23 ++++---
 tools/kvm/hw/vesa.c                      |   15 +++--
 tools/kvm/include/kvm/ioport.h           |   11 ++--
 tools/kvm/include/kvm/kvm-cpu.h          |    2 +
 tools/kvm/include/kvm/kvm.h              |    8 ++-
 tools/kvm/include/kvm/pci.h              |   46 ++++++++++----
 tools/kvm/include/kvm/term.h             |    1 +
 tools/kvm/include/kvm/util.h             |    4 +
 tools/kvm/include/linux/types.h          |    1 +
 tools/kvm/kvm-cpu.c                      |   46 ++++++++------
 tools/kvm/kvm.c                          |   28 ++++++---
 tools/kvm/pci.c                          |   76 ++++++++++++++---------
 tools/kvm/term.c                         |    7 +--
 tools/kvm/util.c                         |   45 ++++++++++++++
 tools/kvm/virtio/pci.c                   |   48 ++++++++------
 tools/kvm/x86/include/kvm/kvm-arch.h     |    5 ++
 tools/kvm/x86/include/kvm/kvm-cpu-arch.h |   17 +++++-
 tools/kvm/x86/kvm-cpu.c                  |    5 ++
 tools/kvm/x86/kvm.c                      |   52 ++++++++++++++--
 21 files changed, 396 insertions(+), 204 deletions(-)


WARNING: multiple messages have this Message-ID (diff)
From: Matt Evans <matt@ozlabs.org>
To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Cc: penberg@kernel.org, asias.hejun@gmail.com,
	levinsasha928@gmail.com, gorcunov@gmail.com
Subject: [PATCH V2 00/23] kvm tools: Prepare kvmtool for another architecture
Date: Fri, 09 Dec 2011 17:52:20 +1100	[thread overview]
Message-ID: <4EE1B024.3010804@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.

Building on the separation of x86-specific code into tools/kvm/x86, this series
change some of the mechanics of kvm tool, 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.

Changes since V1:
- Merged up, V1 patches now upstream are obv. not included here
- No longer uses PRIx64 etc., defining __SANE_USERSPACE_TYPES__ for LL64 on PPC
- Returns kvm__recommended_cpus (and max cpus) to generic code, but fixes them
  so that they cope gracefully with KVM supporting neither CAP.  (A separate
  patch submitted for PPC KVM returns a useful number of CPUs.)
- Made hugetlbfs guest RAM mapping code generic, allow x86 to use it
- Drop unnecessary ifdef around symbol__init()
- Un-broke ioport PCI config access :o)
- Rolled in other review comments (e.g. removal of "& 0xff" in term.c, fixing
  pci_config_address union, create both kvm_cpu__emulate_mmio and _io)

Applies on top of Pekka's linux-kvm.git as of today.


Cheers,


Matt


Matt Evans (23):
  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: Get correct 64-bit types on PPC64 and link appropriately
  kvm tools: Add arch-specific KVM_RUN exit handling via
    kvm_cpu__handle_exit()
  kvm tools: Don't die if KVM_CAP_NR_VCPUS isn't available
  kvm tools: Fix KVM_RUN exit code check
  kvm tools: Add kvm__arch_periodic_poll()
  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: 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 ability to map guest RAM from hugetlbfs
  kvm tools: Move PCI_MAX_DEVICES to pci.h
  kvm tools: Endian-sanitise pci.h and PCI device setup
  kvm tools: Correctly set virtio-pci bar_size and remove hardwired
    address
  kvm tools: Add pci__config_{rd,wr}(), pci__find_dev()
  kvm tools: Arch-specific define for PCI MMIO allocation area
  kvm tools: Create arch-specific kvm_cpu__emulate_{mm}io()

 tools/kvm/Makefile                       |   99 ++++++++++++++++--------------
 tools/kvm/builtin-run.c                  |   61 +++++++++++--------
 tools/kvm/hw/pci-shmem.c                 |   23 ++++---
 tools/kvm/hw/vesa.c                      |   15 +++--
 tools/kvm/include/kvm/ioport.h           |   11 ++--
 tools/kvm/include/kvm/kvm-cpu.h          |    2 +
 tools/kvm/include/kvm/kvm.h              |    8 ++-
 tools/kvm/include/kvm/pci.h              |   46 ++++++++++----
 tools/kvm/include/kvm/term.h             |    1 +
 tools/kvm/include/kvm/util.h             |    4 +
 tools/kvm/include/linux/types.h          |    1 +
 tools/kvm/kvm-cpu.c                      |   46 ++++++++------
 tools/kvm/kvm.c                          |   28 ++++++---
 tools/kvm/pci.c                          |   76 ++++++++++++++---------
 tools/kvm/term.c                         |    7 +--
 tools/kvm/util.c                         |   45 ++++++++++++++
 tools/kvm/virtio/pci.c                   |   48 ++++++++------
 tools/kvm/x86/include/kvm/kvm-arch.h     |    5 ++
 tools/kvm/x86/include/kvm/kvm-cpu-arch.h |   17 +++++-
 tools/kvm/x86/kvm-cpu.c                  |    5 ++
 tools/kvm/x86/kvm.c                      |   52 ++++++++++++++--
 21 files changed, 396 insertions(+), 204 deletions(-)

             reply	other threads:[~2011-12-09  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  6:52 Matt Evans [this message]
2011-12-09  6:52 ` [PATCH V2 00/23] kvm tools: Prepare kvmtool for another architecture Matt Evans
2011-12-09 11:59 ` [PATCH V2 00/23] kvm tools: Prepare kvmtool for another Pekka Enberg
2011-12-09 11:59   ` [PATCH V2 00/23] kvm tools: Prepare kvmtool for another architecture Pekka Enberg

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=4EE1B024.3010804@ozlabs.org \
    --to=matt@ozlabs.org \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=penberg@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 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.