qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Paul Durrant <paul@xen.org>,
	Joao Martins <joao.m.martins@oracle.com>,
	Ankur Arora <ankur.a.arora@oracle.com>
Subject: [RFC PATCH 00/21] Xen HVM support under KVM
Date: Mon,  5 Dec 2022 17:31:16 +0000	[thread overview]
Message-ID: <20221205173137.607044-1-dwmw2@infradead.org> (raw)

In 2019, Joao Martins posted a set of Linux KVM patches¹ which added
support for hosting Xen HVM guests directly under KVM. Referenced from
that post was a qemu git tree² which made use of it.

Now that the core of the kernel support has been merged upstream, I'm
looking at updating the qemu support and potentially getting it merged
too. This is the first attempt at the first round of that, adding the
basics of KVM support with '-machine xenfv' and then just enough of
the hypercall support to register the shared_info and vcpu_info areas
before the guest kernel will panic when it can't use event channels
for IPIs.

Before I go much further, I think it needs all the runtime state (the
shared info page address, etc.) to be correctly live migratable. Some
pointers on how to do that would be welcomed. There's plenty more to
heckle too...

  qemu-system-x86_64 -serial mon:stdio -machine xenfv,xen-version=0x4000a \
         -cpu host,-kvm,+xen,+xen-vapic  -display none \
         -kernel /boot/vmlinuz-5.17.8-200.fc35.x86_64 \
         -append "console=ttyS0,115200 earlyprintk=ttyS0,115200" \
         --trace "kvm_xen*"

¹ https://lore.kernel.org/kvm/20190220201609.28290-1-joao.m.martins@oracle.com/
² https://github.com/jpemartins/qemu/commits/xen-shim-rfc

Ankur Arora (2):
      kvm/ioapic: mark gsi-2 used in ioapic routing init
      i386/xen: handle event channel upcall related hypercalls

David Woodhouse (1):
      i386/xen: Add xen-version machine property and init KVM Xen support

Joao Martins (18):
      include: import xen public headers
      i386/kvm: handle Xen HVM cpuid leaves
      xen-platform-pci: allow its creation with XEN_EMULATE mode
      hw/xen_backend: refactor xen_be_init()
      pc_piix: handle XEN_EMULATE backend init
      xen-platform-pci: register xen-mmio as RAM for XEN_EMULATE
      xen_platform: exclude vfio-pci from the PCI platform unplug
      pc_piix: allow xenfv machine with XEN_EMULATE
      i386/xen: handle guest hypercalls
      i386/xen: implement HYPERCALL_xen_version
      i386/xen: set shared_info page
      i386/xen: implement HYPERVISOR_hvm_op
      i386/xen: implement HYPERVISOR_vcpu_op
      i386/xen: handle register_vcpu_info
      i386/xen: handle register_vcpu_time_memory_area
      i386/xen: handle register_runstate_memory_area
      i386/xen: implement HYPERVISOR_event_channel_op
      i386/xen: implement HYPERVISOR_sched_op

 accel/kvm/kvm-all.c                                |   11 +
 backends/cryptodev-vhost.c                         |    4 +-
 backends/vhost-user.c                              |    4 +-
 hw/block/vhost-user-blk.c                          |   45 +-
 hw/display/next-fb.c                               |    2 +-
 hw/i386/kvm/ioapic.c                               |    1 +
 hw/i386/pc.c                                       |   32 +
 hw/i386/pc_piix.c                                  |   19 +-
 hw/i386/xen/xen_platform.c                         |   37 +-
 hw/loongarch/Kconfig                               |    1 -
 hw/loongarch/acpi-build.c                          |   18 -
 hw/loongarch/virt.c                                |   62 --
 hw/net/vhost_net.c                                 |    8 +-
 hw/nvme/ctrl.c                                     |  182 +++-
 hw/scsi/vhost-scsi-common.c                        |    4 +-
 hw/virtio/trace-events                             |    4 +-
 hw/virtio/vhost-user-fs.c                          |    4 +-
 hw/virtio/vhost-user-gpio.c                        |   26 +-
 hw/virtio/vhost-user-i2c.c                         |    4 +-
 hw/virtio/vhost-user-rng.c                         |    4 +-
 hw/virtio/vhost-user.c                             |   71 --
 hw/virtio/vhost-vsock-common.c                     |    4 +-
 hw/virtio/vhost.c                                  |   44 +-
 hw/xen/xen-legacy-backend.c                        |   62 +-
 include/hw/core/cpu.h                              |    2 +
 include/hw/i386/pc.h                               |    3 +
 include/hw/loongarch/virt.h                        |    5 -
 include/hw/virtio/vhost-user-gpio.h                |   10 -
 include/hw/virtio/vhost-user.h                     |   18 -
 include/hw/virtio/vhost.h                          |    6 +-
 include/hw/virtio/virtio.h                         |   23 +-
 include/hw/xen/xen-legacy-backend.h                |    5 +
 include/standard-headers/xen/arch-x86/cpuid.h      |  118 +++
 include/standard-headers/xen/arch-x86/xen-x86_32.h |  194 ++++
 include/standard-headers/xen/arch-x86/xen-x86_64.h |  241 +++++
 include/standard-headers/xen/arch-x86/xen.h        |  398 ++++++++
 include/standard-headers/xen/event_channel.h       |  388 ++++++++
 include/standard-headers/xen/features.h            |  143 +++
 include/standard-headers/xen/grant_table.h         |  686 +++++++++++++
 include/standard-headers/xen/hvm/hvm_op.h          |  395 ++++++++
 include/standard-headers/xen/hvm/params.h          |  318 ++++++
 include/standard-headers/xen/memory.h              |  754 ++++++++++++++
 include/standard-headers/xen/physdev.h             |  383 +++++++
 include/standard-headers/xen/sched.h               |  202 ++++
 include/standard-headers/xen/trace.h               |  341 +++++++
 include/standard-headers/xen/vcpu.h                |  248 +++++
 include/standard-headers/xen/version.h             |  113 +++
 include/standard-headers/xen/xen-compat.h          |   46 +
 include/standard-headers/xen/xen.h                 | 1049 ++++++++++++++++++++
 include/sysemu/kvm.h                               |    3 +
 include/sysemu/kvm_int.h                           |    3 +
 target/i386/cpu.c                                  |    2 +
 target/i386/cpu.h                                  |   12 +
 target/i386/kvm/kvm.c                              |   95 ++
 target/i386/meson.build                            |    1 +
 target/i386/tcg/decode-new.c.inc                   |    3 +-
 target/i386/tcg/sysemu/excp_helper.c               |   34 +-
 target/i386/trace-events                           |    6 +
 target/i386/xen-proto.h                            |   23 +
 target/i386/xen.c                                  |  578 +++++++++++
 target/i386/xen.h                                  |   28 +
 target/s390x/tcg/cc_helper.c                       |    7 -
 target/s390x/tcg/insn-data.h.inc                   |    2 +-
 tests/qtest/libqos/virtio-gpio.c                   |    3 +-
 tests/qtest/migration-test.c                       |   20 +-
 65 files changed, 7141 insertions(+), 421 deletions(-)









             reply	other threads:[~2022-12-05 17:34 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 17:31 David Woodhouse [this message]
2022-12-05 17:31 ` [RFC PATCH 01/21] include: import xen public headers David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 02/21] i386/xen: Add xen-version machine property and init KVM Xen support David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 03/21] i386/kvm: handle Xen HVM cpuid leaves David Woodhouse
2022-12-05 21:58   ` Philippe Mathieu-Daudé
2022-12-06  0:18     ` David Woodhouse
2022-12-06  7:58       ` Philippe Mathieu-Daudé
2022-12-06  8:05         ` David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 04/21] xen-platform-pci: allow its creation with XEN_EMULATE mode David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 05/21] hw/xen_backend: refactor xen_be_init() David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 06/21] pc_piix: handle XEN_EMULATE backend init David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 07/21] xen-platform-pci: register xen-mmio as RAM for XEN_EMULATE David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 08/21] xen_platform: exclude vfio-pci from the PCI platform unplug David Woodhouse
2022-12-05 22:03   ` Philippe Mathieu-Daudé
2022-12-05 17:31 ` [RFC PATCH 09/21] pc_piix: allow xenfv machine with XEN_EMULATE David Woodhouse
2022-12-05 22:06   ` Philippe Mathieu-Daudé
2022-12-06  0:59     ` David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 10/21] i386/xen: handle guest hypercalls David Woodhouse
2022-12-05 22:11   ` Philippe Mathieu-Daudé
2022-12-06  1:10     ` David Woodhouse
2022-12-06  8:16       ` Philippe Mathieu-Daudé
2022-12-06  9:40         ` David Woodhouse
2022-12-06 11:07           ` Philippe Mathieu-Daudé
2022-12-06 11:30             ` David Woodhouse
2022-12-06 10:41         ` Alex Bennée
2022-12-05 17:31 ` [RFC PATCH 11/21] i386/xen: implement HYPERCALL_xen_version David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 12/21] i386/xen: set shared_info page David Woodhouse
2022-12-05 22:17   ` Philippe Mathieu-Daudé
2022-12-06  2:20     ` David Woodhouse
2022-12-06  8:26       ` Philippe Mathieu-Daudé
2022-12-06 10:00         ` Dr. David Alan Gilbert
2022-12-07 11:15           ` David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op David Woodhouse
2022-12-05 22:13   ` Philippe Mathieu-Daudé
2022-12-06  1:18     ` David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 14/21] i386/xen: implement HYPERVISOR_vcpu_op David Woodhouse
2022-12-05 22:18   ` Philippe Mathieu-Daudé
2022-12-05 17:31 ` [RFC PATCH 15/21] i386/xen: handle register_vcpu_info David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 16/21] i386/xen: handle register_vcpu_time_memory_area David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 17/21] i386/xen: handle register_runstate_memory_area David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 18/21] kvm/ioapic: mark gsi-2 used in ioapic routing init David Woodhouse
2022-12-05 22:25   ` Philippe Mathieu-Daudé
2022-12-06  1:21     ` David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 19/21] i386/xen: handle event channel upcall related hypercalls David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 20/21] i386/xen: implement HYPERVISOR_event_channel_op David Woodhouse
2022-12-05 17:31 ` [RFC PATCH 21/21] i386/xen: implement HYPERVISOR_sched_op David Woodhouse

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=20221205173137.607044-1-dwmw2@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=ankur.a.arora@oracle.com \
    --cc=joao.m.martins@oracle.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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).