qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 50c884: include: import Xen public headers to


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 50c884: include: import Xen public headers to hw/xen/inter...
Date: Fri, 03 Mar 2023 03:03:59 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 50c88402ca599e577f025e78a4380431be2b3f6d
      
https://github.com/qemu/qemu/commit/50c88402ca599e577f025e78a4380431be2b3f6d
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    A include/hw/xen/interface/arch-arm.h
    A include/hw/xen/interface/arch-x86/cpuid.h
    A include/hw/xen/interface/arch-x86/xen-x86_32.h
    A include/hw/xen/interface/arch-x86/xen-x86_64.h
    A include/hw/xen/interface/arch-x86/xen.h
    A include/hw/xen/interface/event_channel.h
    A include/hw/xen/interface/features.h
    M include/hw/xen/interface/grant_table.h
    A include/hw/xen/interface/hvm/hvm_op.h
    A include/hw/xen/interface/hvm/params.h
    M include/hw/xen/interface/io/blkif.h
    M include/hw/xen/interface/io/console.h
    M include/hw/xen/interface/io/fbif.h
    M include/hw/xen/interface/io/kbdif.h
    M include/hw/xen/interface/io/netif.h
    M include/hw/xen/interface/io/ring.h
    M include/hw/xen/interface/io/usbif.h
    M include/hw/xen/interface/io/xenbus.h
    A include/hw/xen/interface/io/xs_wire.h
    A include/hw/xen/interface/memory.h
    A include/hw/xen/interface/physdev.h
    A include/hw/xen/interface/sched.h
    A include/hw/xen/interface/trace.h
    A include/hw/xen/interface/vcpu.h
    A include/hw/xen/interface/version.h
    A include/hw/xen/interface/xen-compat.h
    A include/hw/xen/interface/xen.h
    M include/hw/xen/xen.h

  Log Message:
  -----------
  include: import Xen public headers to hw/xen/interface

There's already a partial set here; update them and pull in a more
complete set.

To start with, define __XEN_TOOLS__ in hw/xen/xen.h to ensure that any
internal definitions needed by Xen toolstack libraries are present
regardless of the order in which the headers are included. A reckoning
will come later, once we make the PV backends work in emulation and
untangle the headers for Xen-native vs. generic parts.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Update to Xen public headers from 4.16.2 release, add some in io/,
        define __XEN_TOOLS__ in hw/xen/xen.h, move to hw/xen/interface/]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 820c1aba519bd072ac71c754733f6c86d8b4309f
      
https://github.com/qemu/qemu/commit/820c1aba519bd072ac71c754733f6c86d8b4309f
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/Kconfig
    M hw/i386/Kconfig
    A hw/xen/Kconfig
    M meson.build

  Log Message:
  -----------
  xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation

The XEN_EMU option will cover core Xen support in target/, which exists
only for x86 with KVM today but could theoretically also be implemented
on Arm/Aarch64 and with TCG or other accelerators (if anyone wants to
run the gauntlet of struct layout compatibility, errno mapping, and the
rest of that fui).

It will also cover the support for architecture-independent grant table
and event channel support which will be added in hw/i386/kvm/ (on the
basis that the non-KVM support is very theoretical and making it not use
KVM directly seems like gratuitous overengineering at this point).

The XEN_BUS option is for the xenfv platform support, which will now be
used both by XEN_EMU and by real Xen.

The XEN option remains dependent on the Xen runtime libraries, and covers
support for real Xen. Some code which currently resides under CONFIG_XEN
will be moving to CONFIG_XEN_BUS over time as the direct dependencies on
Xen runtime libraries are eliminated. The Xen PCI platform device will
also reside under CONFIG_XEN_BUS.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: faa4e80071f5114f8113263b5303ac18e7df0a9d
      
https://github.com/qemu/qemu/commit/faa4e80071f5114f8113263b5303ac18e7df0a9d
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M accel/xen/xen-all.c
    M include/hw/xen/xen.h
    M softmmu/globals.c

  Log Message:
  -----------
  xen: Add XEN_DISABLED mode and make it default

Also set XEN_ATTACH mode in xen_init() to reflect the truth; not that
anyone ever cared before. It was *only* ever checked in xen_init_pv()
before.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 61491cf4410423b2d3162143c43b9aeb4ccf7f26
      
https://github.com/qemu/qemu/commit/61491cf4410423b2d3162143c43b9aeb4ccf7f26
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M accel/kvm/kvm-all.c
    M include/sysemu/kvm_int.h
    A include/sysemu/kvm_xen.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/meson.build
    A target/i386/kvm/xen-emu.c
    A target/i386/kvm/xen-emu.h

  Log Message:
  -----------
  i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support

This just initializes the basic Xen support in KVM for now. Only permitted
on TYPE_PC_MACHINE because that's where the sysbus devices for Xen heap
overlay, event channel, grant tables and other stuff will exist. There's
no point having the basic hypercall support if nothing else works.

Provide sysemu/kvm_xen.h and a kvm_xen_get_caps() which will be used
later by support devices.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: f66b8a83c5723e5337d522ba2b87bf8c7e306445
      
https://github.com/qemu/qemu/commit/f66b8a83c5723e5337d522ba2b87bf8c7e306445
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/xen-emu.c
    M target/i386/kvm/xen-emu.h

  Log Message:
  -----------
  i386/kvm: handle Xen HVM cpuid leaves

Introduce support for emulating CPUID for Xen HVM guests. It doesn't make
sense to advertise the KVM leaves to a Xen guest, so do Xen unconditionally
when the xen-version machine property is set.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Obtain xen_version from KVM property, make it automatic]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 5e691a955a06dc9a45d9ab62769a12e6e8d18cee
      
https://github.com/qemu/qemu/commit/5e691a955a06dc9a45d9ab62769a12e6e8d18cee
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/kvm.c
    M target/i386/kvm/xen-emu.c
    M target/i386/kvm/xen-emu.h

  Log Message:
  -----------
  i386/kvm: Set Xen vCPU ID in KVM

There are (at least) three different vCPU ID number spaces. One is the
internal KVM vCPU index, based purely on which vCPU was chronologically
created in the kernel first. If userspace threads are all spawned and
create their KVM vCPUs in essentially random order, then the KVM indices
are basically random too.

The second number space is the APIC ID space, which is consistent and
useful for referencing vCPUs. MSIs will specify the target vCPU using
the APIC ID, for example, and the KVM Xen APIs also take an APIC ID
from userspace whenever a vCPU needs to be specified (as opposed to
just using the appropriate vCPU fd).

The third number space is not normally relevant to the kernel, and is
the ACPI/MADT/Xen CPU number which corresponds to cs->cpu_index. But
Xen timer hypercalls use it, and Xen timer hypercalls *really* want
to be accelerated in the kernel rather than handled in userspace, so
the kernel needs to be told.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 3bb1ebac6cc372d2eaa12a5e576b2d28f3a29269
      
https://github.com/qemu/qemu/commit/3bb1ebac6cc372d2eaa12a5e576b2d28f3a29269
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/xen/xen_platform.c

  Log Message:
  -----------
  xen-platform: exclude vfio-pci from the PCI platform unplug

Such that PCI passthrough devices work for Xen emulated guests.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: bb346fae3827b0d7d241e0304069e18cd8155d05
      
https://github.com/qemu/qemu/commit/bb346fae3827b0d7d241e0304069e18cd8155d05
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/xen/meson.build
    M hw/i386/xen/xen_platform.c

  Log Message:
  -----------
  xen-platform: allow its creation with XEN_EMULATE mode

The only thing we need to fix to make this build is the PIO hack which
sets the BIOS memory areas to R/W v.s. R/O. Theoretically we could hook
that up to the PAM registers on the emulated PIIX, but in practice
nobody cares, so just leave it doing nothing.

Now it builds without actual Xen, move it to CONFIG_XEN_BUS to include it
in the KVM-only builds.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 55a3f666b4ca06012e1fd2bc298c4658b28773ea
      
https://github.com/qemu/qemu/commit/55a3f666b4ca06012e1fd2bc298c4658b28773ea
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/kvm.c
    M target/i386/kvm/trace-events
    M target/i386/kvm/xen-emu.c
    M target/i386/kvm/xen-emu.h

  Log Message:
  -----------
  i386/xen: handle guest hypercalls

This means handling the new exit reason for Xen but still
crashing on purpose. As we implement each of the hypercalls
we will then return the right return code.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Add CPL to hypercall tracing, disallow hypercalls from CPL > 0]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: bedcc1392481e2528d9b470a9b21512a923a3b75
      
https://github.com/qemu/qemu/commit/bedcc1392481e2528d9b470a9b21512a923a3b75
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_xen_version

This is just meant to serve as an example on how we can implement
hypercalls. xen_version specifically since Qemu does all kind of
feature controllability. So handling that here seems appropriate.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Implement kvm_gva_rw() safely]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 79b7067dc6acec07d93407dd870268a5cd68924d
      
https://github.com/qemu/qemu/commit/79b7067dc6acec07d93407dd870268a5cd68924d
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M include/sysemu/kvm_xen.h
    M target/i386/kvm/trace-events
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

It allows to shutdown itself via hypercall with any of the 3 reasons:
  1) self-reboot
  2) shutdown
  3) crash

Implementing SCHEDOP_shutdown sub op let us handle crashes gracefully rather
than leading to triple faults if it remains unimplemented.

In addition, the SHUTDOWN_soft_reset reason is used for kexec, to reset
Xen shared pages and other enlightenments and leave a clean slate for the
new kernel without the hypervisor helpfully writing information at
unexpected addresses.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Ditch sched_op_compat which was never available for HVM guests,
        Add SCHEDOP_soft_reset]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c789b9ef5f80ac471a270bf65cd22024594671a5
      
https://github.com/qemu/qemu/commit/c789b9ef5f80ac471a270bf65cd22024594671a5
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield

They both do the same thing and just call sched_yield. This is enough to
stop the Linux guest panicking when running on a host kernel which doesn't
intercept SCHEDOP_poll and lets it reach userspace.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: d40ddd529004709350202114fc1c2fc99127647d
      
https://github.com/qemu/qemu/commit/d40ddd529004709350202114fc1c2fc99127647d
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/xen_overlay.c
    A hw/i386/kvm/xen_overlay.h
    M include/sysemu/kvm_xen.h

  Log Message:
  -----------
  hw/xen: Add xen_overlay device for emulating shared xenheap pages

For the shared info page and for grant tables, Xen shares its own pages
from the "Xen heap" to the guest. The guest requests that a given page
from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped
to a given GPA using the XENMEM_add_to_physmap hypercall.

To support that in qemu when *emulating* Xen, create a memory region
(migratable) and allow it to be mapped as an overlay when requested.

Xen theoretically allows the same page to be mapped multiple times
into the guest, but that's hard to track and reinstate over migration,
so we automatically *unmap* any previous mapping when creating a new
one. This approach has been used in production with.... a non-trivial
number of guests expecting true Xen, without any problems yet being
noticed.

This adds just the shared info page for now. The grant tables will be
a larger region, and will need to be overlaid one page at a time. I
think that means I need to create separate aliases for each page of
the overall grant_frames region, so that they can be mapped individually.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 7058fa02200e70bfecda10fd58c2555674d802ed
      
https://github.com/qemu/qemu/commit/7058fa02200e70bfecda10fd58c2555674d802ed
  Author: Paul Durrant <pdurrant@amazon.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  xen: Permit --xen-domid argument when accel is KVM

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Signed-off-by: David Wooodhouse <dwmw@amazon.co.uk>


  Commit: e21be724eaf5dfdf1ac3595e0c808b775ec262f2
      
https://github.com/qemu/qemu/commit/e21be724eaf5dfdf1ac3595e0c808b775ec262f2
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/pc.c
    M include/hw/i386/pc.h

  Log Message:
  -----------
  i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

The xen_overlay device (and later similar devices for event channels and
grant tables) need to be instantiated. Do this from a kvm_type method on
the PC machine derivatives, since KVM is only way to support Xen emulation
for now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 110a0ea59f263b6e382ee22c70c31c2364d11eb0
      
https://github.com/qemu/qemu/commit/110a0ea59f263b6e382ee22c70c31c2364d11eb0
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_overlay.c
    M hw/i386/kvm/xen_overlay.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: manage and save/restore Xen guest long_mode setting

Xen will "latch" the guest's 32-bit or 64-bit ("long mode") setting when
the guest writes the MSR to fill in the hypercall page, or when the guest
sets the event channel callback in HVM_PARAM_CALLBACK_IRQ.

KVM handles the former and sets the kernel's long_mode flag accordingly.
The latter will be handled in userspace. Keep them in sync by noticing
when a hypercall is made in a mode that doesn't match qemu's idea of
the guest mode, and resyncing from the kernel. Do that same sync right
before serialization too, in case the guest has set the hypercall page
but hasn't yet made a system call.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: fb0fd2ce38400e158f3eb483b0f1c553d3551445
      
https://github.com/qemu/qemu/commit/fb0fd2ce38400e158f3eb483b0f1c553d3551445
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/trace-events
    A target/i386/kvm/xen-compat.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_memory_op

Specifically XENMEM_add_to_physmap with space XENMAPSPACE_shared_info to
allow the guest to set its shared_info page.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Use the xen_overlay device, add compat support]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 782a79601e9d41e840727f9f8270e416dcd47243
      
https://github.com/qemu/qemu/commit/782a79601e9d41e840727f9f8270e416dcd47243
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-compat.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement XENMEM_add_to_physmap_batch

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 671bfdcd47739a103ce8633e48d07a74d0d3cbd9
      
https://github.com/qemu/qemu/commit/671bfdcd47739a103ce8633e48d07a74d0d3cbd9
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_hvm_op

This is when guest queries for support for HVMOP_pagetable_dying.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: d70bd6a485d54ff60a6dd708c51b5c0ba679056f
      
https://github.com/qemu/qemu/commit/d70bd6a485d54ff60a6dd708c51b5c0ba679056f
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_vcpu_op

This is simply when guest tries to register a vcpu_info
and since vcpu_info placement is optional in the minimum ABI
therefore we can just fail with -ENOSYS

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c345104cd1d17e1e801b99a216fa3654cdcbce35
      
https://github.com/qemu/qemu/commit/c345104cd1d17e1e801b99a216fa3654cdcbce35
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/trace-events
    M target/i386/kvm/xen-emu.c
    M target/i386/kvm/xen-emu.h
    M target/i386/machine.c

  Log Message:
  -----------
  i386/xen: handle VCPUOP_register_vcpu_info

Handle the hypercall to set a per vcpu info, and also wire up the default
vcpu_info in the shared_info page for the first 32 vCPUs.

To avoid deadlock within KVM a vCPU thread must set its *own* vcpu_info
rather than it being set from the context in which the hypercall is
invoked.

Add the vcpu_info (and default) GPA to the vmstate_x86_cpu for migration,
and restore it in kvm_arch_put_registers() appropriately.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: f068930277347667125a10e9d8612a585d84738d
      
https://github.com/qemu/qemu/commit/f068930277347667125a10e9d8612a585d84738d
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/kvm/xen-emu.c
    M target/i386/machine.c

  Log Message:
  -----------
  i386/xen: handle VCPUOP_register_vcpu_time_info

In order to support Linux vdso in Xen.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 5092db87e4dd97ba66b2afe3c69a82507244134d
      
https://github.com/qemu/qemu/commit/5092db87e4dd97ba66b2afe3c69a82507244134d
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/kvm/xen-emu.c
    M target/i386/machine.c

  Log Message:
  -----------
  i386/xen: handle VCPUOP_register_runstate_memory_area

Allow guest to setup the vcpu runstates which is used as
steal clock.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 3b06f29b2497da8362ee25b729a727cb8463fd62
      
https://github.com/qemu/qemu/commit/3b06f29b2497da8362ee25b729a727cb8463fd62
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HYPERVISOR_event_channel_op

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Ditch event_channel_op_compat which was never available to HVM guests]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 105b47fdf2d0ed18d73cebb055f4cbc1c88a8b30
      
https://github.com/qemu/qemu/commit/105b47fdf2d0ed18d73cebb055f4cbc1c88a8b30
  Author: Ankur Arora <ankur.a.arora@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/kvm/trace-events
    M target/i386/kvm/xen-emu.c
    M target/i386/machine.c

  Log Message:
  -----------
  i386/xen: implement HVMOP_set_evtchn_upcall_vector

The HVMOP_set_evtchn_upcall_vector hypercall sets the per-vCPU upcall
vector, to be delivered to the local APIC just like an MSI (with an EOI).

This takes precedence over the system-wide delivery method set by the
HVMOP_set_param hypercall with HVM_PARAM_CALLBACK_IRQ. It's used by
Windows and Xen (PV shim) guests but normally not by Linux.

Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Rework for upstream kernel changes and split from HVMOP_set_param]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 5dbcd01a8dfa4601dd3ce2cab2c4aa3654f1114d
      
https://github.com/qemu/qemu/commit/5dbcd01a8dfa4601dd3ce2cab2c4aa3654f1114d
  Author: Ankur Arora <ankur.a.arora@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: implement HVMOP_set_param

This is the hook for adding the HVM_PARAM_CALLBACK_IRQ parameter in a
subsequent commit.

Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Split out from another commit]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 91cce756179195f0725f551a5b2922ae2abbef9f
      
https://github.com/qemu/qemu/commit/91cce756179195f0725f551a5b2922ae2abbef9f
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/xen_evtchn.c
    A hw/i386/kvm/xen_evtchn.h
    M hw/i386/pc.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Add xen_evtchn device for event channel emulation

Include basic support for setting HVM_PARAM_CALLBACK_IRQ to the global
vector method HVM_PARAM_CALLBACK_TYPE_VECTOR, which is handled in-kernel
by raising the vector whenever the vCPU's vcpu_info->evtchn_upcall_pending
flag is set.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 27d4075dd88a3c558fdc2da13b95915c1b6c66c9
      
https://github.com/qemu/qemu/commit/27d4075dd88a3c558fdc2da13b95915c1b6c66c9
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M include/sysemu/kvm_xen.h
    M target/i386/cpu.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: Add support for Xen event channel delivery to vCPU

The kvm_xen_inject_vcpu_callback_vector() function will either deliver
the per-vCPU local APIC vector (as an MSI), or just kick the vCPU out
of the kernel to trigger KVM's automatic delivery of the global vector.
Support for asserting the GSI/PCI_INTX callbacks will come later.

Also add kvm_xen_get_vcpu_info_hva() which returns the vcpu_info of
a given vCPU.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 4858ba2065c8bddf7f1c056eda3a5357588bdd50
      
https://github.com/qemu/qemu/commit/4858ba2065c8bddf7f1c056eda3a5357588bdd50
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_status

This adds the basic structure for maintaining the port table and reporting
the status of ports therein.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 83eb5811342b4e48544ab79dd92a0bb1a2a2cbfb
      
https://github.com/qemu/qemu/commit/83eb5811342b4e48544ab79dd92a0bb1a2a2cbfb
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_close

It calls an internal close_port() helper which will also be used from
EVTCHNOP_reset and will actually do the work to disconnect/unbind a port
once any of that is actually implemented in the first place.

That in turn calls a free_port() internal function which will be in
error paths after allocation.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 190cc3c0edd60876150959ee9f242363e40d168e
      
https://github.com/qemu/qemu/commit/190cc3c0edd60876150959ee9f242363e40d168e
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_unmask

This finally comes with a mechanism for actually injecting events into
the guest vCPU, with all the atomic-test-and-set that's involved in
setting the bit in the shinfo, then the index in the vcpu_info, and
injecting either the lapic vector as MSI, or letting KVM inject the
bare vector.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c723d4c15e224e9d058384eecd30559580836c7a
      
https://github.com/qemu/qemu/commit/c723d4c15e224e9d058384eecd30559580836c7a
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M include/sysemu/kvm_xen.h
    M target/i386/cpu.h
    M target/i386/kvm/xen-emu.c
    M target/i386/machine.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_bind_virq

Add the array of virq ports to each vCPU so that we can deliver timers,
debug ports, etc. Global virqs are allocated against vCPU 0 initially,
but can be migrated to other vCPUs (when we implement that).

The kernel needs to know about VIRQ_TIMER in order to accelerate timers,
so tell it via KVM_XEN_VCPU_ATTR_TYPE_TIMER. Also save/restore the value
of the singleshot timer across migration, as the kernel will handle the
hypercalls automatically now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: f5417856d25f1cf4932ac77a687979af8427f313
      
https://github.com/qemu/qemu/commit/f5417856d25f1cf4932ac77a687979af8427f313
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_bind_ipi

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: cf7679abddd05712c5cfbe5516328586eded22c3
      
https://github.com/qemu/qemu/commit/cf7679abddd05712c5cfbe5516328586eded22c3
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_send

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: e1db61b87b0e479bcacdf0c17656c8ee563cc5ba
      
https://github.com/qemu/qemu/commit/e1db61b87b0e479bcacdf0c17656c8ee563cc5ba
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_alloc_unbound

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 8432788104b6b4843738edbc5cf084b2a3687ee9
      
https://github.com/qemu/qemu/commit/8432788104b6b4843738edbc5cf084b2a3687ee9
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_bind_interdomain

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 306670461bb19e7af42b3d68d007d7690efd2334
      
https://github.com/qemu/qemu/commit/306670461bb19e7af42b3d68d007d7690efd2334
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_bind_vcpu

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: a15b10978fe62411936e577288f28184a41754a9
      
https://github.com/qemu/qemu/commit/a15b10978fe62411936e577288f28184a41754a9
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement EVTCHNOP_reset

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 507cb64d6e66d672bfddb275fe746241e0ed8db2
      
https://github.com/qemu/qemu/commit/507cb64d6e66d672bfddb275fe746241e0ed8db2
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hmp-commands.hx
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/xen-stubs.c
    M hw/i386/kvm/xen_evtchn.c
    M include/monitor/hmp.h
    M qapi/misc-target.json
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  i386/xen: add monitor commands to test event injection

Specifically add listing, injection of event channels.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: ddf0fd9ae1fd1ff95489763b37a483adb3cd5907
      
https://github.com/qemu/qemu/commit/ddf0fd9ae1fd1ff95489763b37a483adb3cd5907
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M hw/i386/pc.c
    M include/sysemu/kvm_xen.h
    M target/i386/cpu.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/xen-emu.c
    M target/i386/kvm/xen-emu.h

  Log Message:
  -----------
  hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback

The GSI callback (and later PCI_INTX) is a level triggered interrupt. It
is asserted when an event channel is delivered to vCPU0, and is supposed
to be cleared when the vcpu_info->evtchn_upcall_pending field for vCPU0
is cleared again.

Thankfully, Xen does *not* assert the GSI if the guest sets its own
evtchn_upcall_pending field; we only need to assert the GSI when we
have delivered an event for ourselves. So that's the easy part, kind of.

There's a slight complexity in that we need to hold the BQL before we
can call qemu_set_irq(), and we definitely can't do that while holding
our own port_lock (because we'll need to take that from the qemu-side
functions that the PV backend drivers will call). So if we end up
wanting to set the IRQ in a context where we *don't* already hold the
BQL, defer to a BH.

However, we *do* need to poll for the evtchn_upcall_pending flag being
cleared. In an ideal world we would poll that when the EOI happens on
the PIC/IOAPIC. That's how it works in the kernel with the VFIO eventfd
pairs — one is used to trigger the interrupt, and the other works in the
other direction to 'resample' on EOI, and trigger the first eventfd
again if the line is still active.

However, QEMU doesn't seem to do that. Even VFIO level interrupts seem
to be supported by temporarily unmapping the device's BARs from the
guest when an interrupt happens, then trapping *all* MMIO to the device
and sending the 'resample' event on *every* MMIO access until the IRQ
is cleared! Maybe in future we'll plumb the 'resample' concept through
QEMU's irq framework but for now we'll do what Xen itself does: just
check the flag on every vmexit if the upcall GSI is known to be
asserted.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 2aff696b10d16ef09dc5a2c953ceccbf6d38f744
      
https://github.com/qemu/qemu/commit/2aff696b10d16ef09dc5a2c953ceccbf6d38f744
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback

The guest is permitted to specify an arbitrary domain/bus/device/function
and INTX pin from which the callback IRQ shall appear to have come.

In QEMU we can only easily do this for devices that actually exist, and
even that requires us "knowing" that it's a PCMachine in order to find
the PCI root bus — although that's OK really because it's always true.

We also don't get to get notified of INTX routing changes, because we
can't do that as a passive observer; if we try to register a notifier
it will overwrite any existing notifier callback on the device.

But in practice, guests using PCI_INTX will only ever use pin A on the
Xen platform device, and won't swizzle the INTX routing after they set
it up. So this is just fine.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 6f43f2ee49568f067b15c31372bb8116e1cb0182
      
https://github.com/qemu/qemu/commit/6f43f2ee49568f067b15c31372bb8116e1cb0182
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M accel/kvm/kvm-all.c
    M include/sysemu/kvm_int.h
    M include/sysemu/kvm_xen.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  kvm/i386: Add xen-gnttab-max-frames property

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: a28b0fc0345b1ddc12109de807e6d4ce566c1914
      
https://github.com/qemu/qemu/commit/a28b0fc0345b1ddc12109de807e6d4ce566c1914
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/xen_gnttab.c
    A hw/i386/kvm/xen_gnttab.h
    M hw/i386/pc.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Add xen_gnttab device for grant table emulation

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: e33cb789afd3aedbe181b78fd75d04a5c48f7cba
      
https://github.com/qemu/qemu/commit/e33cb789afd3aedbe181b78fd75d04a5c48f7cba
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_gnttab.c
    M hw/i386/kvm/xen_overlay.c
    M hw/i386/kvm/xen_overlay.h

  Log Message:
  -----------
  hw/xen: Support mapping grant frames

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 28b7ae94a21d37f38f7b68a9f40fa521144898a6
      
https://github.com/qemu/qemu/commit/28b7ae94a21d37f38f7b68a9f40fa521144898a6
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_gnttab.c
    M hw/i386/kvm/xen_gnttab.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: b46f9745b1b5c8dd6ea1bd1361531f966c404f8c
      
https://github.com/qemu/qemu/commit/b46f9745b1b5c8dd6ea1bd1361531f966c404f8c
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_gnttab.c
    M hw/i386/kvm/xen_gnttab.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement GNTTABOP_query_size

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: b746a77926f6e84bdb35a38a9ee956ac12693757
      
https://github.com/qemu/qemu/commit/b746a77926f6e84bdb35a38a9ee956ac12693757
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/cpu.h
    M target/i386/kvm/xen-emu.c
    M target/i386/machine.c

  Log Message:
  -----------
  i386/xen: handle PV timer hypercalls

Introduce support for one shot and periodic mode of Xen PV timers,
whereby timer interrupts come through a special virq event channel
with deadlines being set through:

1) set_timer_op hypercall (only oneshot)
2) vcpu_op hypercall for {set,stop}_{singleshot,periodic}_timer
hypercalls

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 8b57d5c523f8f1a650188ffa58939e1c5aaa6254
      
https://github.com/qemu/qemu/commit/8b57d5c523f8f1a650188ffa58939e1c5aaa6254
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M include/sysemu/kvm_xen.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: Reserve Xen special pages for console, xenstore rings

Xen has eight frames at 0xfeff8000 for this; we only really need two for
now and KVM puts the identity map at 0xfeffc000, so limit ourselves to
four.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c6623cc3e785b806c6175c3e85a0ee4d6db4f7d4
      
https://github.com/qemu/qemu/commit/c6623cc3e785b806c6175c3e85a0ee4d6db4f7d4
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: handle HVMOP_get_param

Which is used to fetch xenstore PFN and port to be used
by the guest. This is preallocated by the toolstack when
guest will just read those and use it straight away.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 794fba23a53ac714589f84f868202d0cfcb41cd2
      
https://github.com/qemu/qemu/commit/794fba23a53ac714589f84f868202d0cfcb41cd2
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h

  Log Message:
  -----------
  hw/xen: Add backend implementation of interdomain event channel support

The provides the QEMU side of interdomain event channels, allowing events
to be sent to/from the guest.

The API mirrors libxenevtchn, and in time both this and the real Xen one
will be available through ops structures so that the PV backend drivers
can use the correct one as appropriate.

For now, this implementation can be used directly by our XenStore which
will be for emulated mode only.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c08f5d0e53b00f101c6aab7b5c7eabe22bab1962
      
https://github.com/qemu/qemu/commit/c08f5d0e53b00f101c6aab7b5c7eabe22bab1962
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/meson.build
    M hw/i386/kvm/xen_evtchn.c
    A hw/i386/kvm/xen_xenstore.c
    A hw/i386/kvm/xen_xenstore.h
    M hw/i386/pc.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Add xen_xenstore device for xenstore emulation

Just the basic shell, with the event channel hookup. It only dumps the
buffer for now; a real ring implmentation will come in a subsequent patch.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: f3341e7b91548c38d484285307c23b8f9ce73307
      
https://github.com/qemu/qemu/commit/f3341e7b91548c38d484285307c23b8f9ce73307
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_xenstore.c

  Log Message:
  -----------
  hw/xen: Add basic ring handling to xenstore

Extract requests, return ENOSYS to all of them. This is enough to allow
older Linux guests to boot, as they need *something* back but it doesn't
matter much what.

A full implementation of a single-tentant internal XenStore copy-on-write
tree with transactions and watches is waiting in the wings to be sent in
a subsequent round of patches along with hooking up the actual PV disk
back end in qemu, but this is enough to get guests booting for now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: bdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216
      
https://github.com/qemu/qemu/commit/bdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  hw/xen: Automatically add xen-platform PCI device for emulated Xen guests

It isn't strictly mandatory but Linux guests at least will only map
their grant tables over the dummy BAR that it provides, and don't have
sufficient wit to map them in any other unused part of their guest
address space. So include it by default for minimal surprise factor.

As I come to document "how to run a Xen guest in QEMU", this means one
fewer thing to tell the user about, according to the mantra of "if it
needs documenting, fix it first, then document what remains".

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 799c23548f0d1a7a49b8c5bbc6b9b86e736296c0
      
https://github.com/qemu/qemu/commit/799c23548f0d1a7a49b8c5bbc6b9b86e736296c0
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M target/i386/kvm/xen-compat.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  i386/xen: Implement HYPERVISOR_physdev_op

Just hook up the basic hypercalls to stubs in xen_evtchn.c for now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: aa98ee38a5e77d1e40987c694abd0c5bc5d6c811
      
https://github.com/qemu/qemu/commit/aa98ee38a5e77d1e40987c694abd0c5bc5d6c811
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    A hw/i386/kvm/trace-events
    A hw/i386/kvm/trace.h
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M meson.build
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Implement emulated PIRQ hypercall support

This wires up the basic infrastructure but the actual interrupts aren't
there yet, so don't advertise it to the guest.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 4f81baa33ed645fc17a9908236630b8154502ae5
      
https://github.com/qemu/qemu/commit/4f81baa33ed645fc17a9908236630b8154502ae5
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M hw/i386/x86.c

  Log Message:
  -----------
  hw/xen: Support GSI mapping to PIRQ

If I advertise XENFEAT_hvm_pirqs then a guest now boots successfully as
long as I tell it 'pci=nomsi'.

[root@localhost ~]# cat /proc/interrupts
           CPU0
  0:         52   IO-APIC   2-edge      timer
  1:         16  xen-pirq   1-ioapic-edge  i8042
  4:       1534  xen-pirq   4-ioapic-edge  ttyS0
  8:          1  xen-pirq   8-ioapic-edge  rtc0
  9:          0  xen-pirq   9-ioapic-level  acpi
 11:       5648  xen-pirq  11-ioapic-level  ahci[0000:00:04.0]
 12:        257  xen-pirq  12-ioapic-edge  i8042
...

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 6096cf7877bc6ee84e6b3b44dfe144bc8b549724
      
https://github.com/qemu/qemu/commit/6096cf7877bc6ee84e6b3b44dfe144bc8b549724
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/kvm/trace-events
    M hw/i386/kvm/xen-stubs.c
    M hw/i386/kvm/xen_evtchn.c
    M hw/i386/kvm/xen_evtchn.h
    M hw/pci/msi.c
    M hw/pci/msix.c
    M hw/pci/pci.c
    M include/hw/pci/msi.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/kvm_i386.h
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  hw/xen: Support MSI mapping to PIRQ

The way that Xen handles MSI PIRQs is kind of awful.

There is a special MSI message which targets a PIRQ. The vector in the
low bits of data must be zero. The low 8 bits of the PIRQ# are in the
destination ID field, the extended destination ID field is unused, and
instead the high bits of the PIRQ# are in the high 32 bits of the address.

Using the high bits of the address means that we can't intercept and
translate these messages in kvm_send_msi(), because they won't be caught
by the APIC — addresses like 0x1000fee46000 aren't in the APIC's range.

So we catch them in pci_msi_trigger() instead, and deliver the event
channel directly.

That isn't even the worst part. The worst part is that Xen snoops on
writes to devices' MSI vectors while they are *masked*. When a MSI
message is written which looks like it targets a PIRQ, it remembers
the device and vector for later.

When the guest makes a hypercall to bind that PIRQ# (snooped from a
marked MSI vector) to an event channel port, Xen *unmasks* that MSI
vector on the device. Xen guests using PIRQ delivery of MSI don't
ever actually unmask the MSI for themselves.

Now that this is working we can finally enable XENFEAT_hvm_pirqs and
let the guest use it all.

Tested with passthrough igb and emulated e1000e + AHCI.

           CPU0       CPU1
  0:         65          0   IO-APIC   2-edge      timer
  1:          0         14  xen-pirq   1-ioapic-edge  i8042
  4:          0        846  xen-pirq   4-ioapic-edge  ttyS0
  8:          1          0  xen-pirq   8-ioapic-edge  rtc0
  9:          0          0  xen-pirq   9-ioapic-level  acpi
 12:        257          0  xen-pirq  12-ioapic-edge  i8042
 24:       9600          0  xen-percpu    -virq      timer0
 25:       2758          0  xen-percpu    -ipi       resched0
 26:          0          0  xen-percpu    -ipi       callfunc0
 27:          0          0  xen-percpu    -virq      debug0
 28:       1526          0  xen-percpu    -ipi       callfuncsingle0
 29:          0          0  xen-percpu    -ipi       spinlock0
 30:          0       8608  xen-percpu    -virq      timer1
 31:          0        874  xen-percpu    -ipi       resched1
 32:          0          0  xen-percpu    -ipi       callfunc1
 33:          0          0  xen-percpu    -virq      debug1
 34:          0       1617  xen-percpu    -ipi       callfuncsingle1
 35:          0          0  xen-percpu    -ipi       spinlock1
 36:          8          0   xen-dyn    -event     xenbus
 37:          0       6046  xen-pirq    -msi       ahci[0000:00:03.0]
 38:          1          0  xen-pirq    -msi-x     ens4
 39:          0         73  xen-pirq    -msi-x     ens4-rx-0
 40:         14          0  xen-pirq    -msi-x     ens4-rx-1
 41:          0         32  xen-pirq    -msi-x     ens4-tx-0
 42:         47          0  xen-pirq    -msi-x     ens4-tx-1

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: e16aff4cc2ef285d1346abcff1a1752614fa9c60
      
https://github.com/qemu/qemu/commit/e16aff4cc2ef285d1346abcff1a1752614fa9c60
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M accel/kvm/kvm-all.c
    M hw/i386/kvm/xen_evtchn.c
    M include/sysemu/kvm_int.h
    M include/sysemu/kvm_xen.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/xen-emu.c

  Log Message:
  -----------
  kvm/i386: Add xen-evtchn-max-pirq property

The default number of PIRQs is set to 256 to avoid issues with 32-bit MSI
devices. Allow it to be increased if the user desires.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: c1eaa6d0df6ed9e021f751d0be6eb321551a9bea
      
https://github.com/qemu/qemu/commit/c1eaa6d0df6ed9e021f751d0be6eb321551a9bea
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    A docs/system/i386/xen.rst
    M docs/system/target-i386.rst

  Log Message:
  -----------
  i386/xen: Document Xen HVM emulation

Signed-off-by: David Woodhouse <dwmw2@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: 79807f3e6bf1186c684312d4e7fb426b2643bade
      
https://github.com/qemu/qemu/commit/79807f3e6bf1186c684312d4e7fb426b2643bade
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/i386/xen/xen-hvm.c
    M hw/xen/xen-legacy-backend.c
    M hw/xenpv/xen_machine_pv.c
    M include/hw/xen/xen-legacy-backend.h

  Log Message:
  -----------
  hw/xen: Subsume xen_be_register_common() into xen_be_init()

Every caller of xen_be_init() checks and exits on error, then calls
xen_be_register_common(). Just make xen_be_init() abort for itself and
return void, and register the common devices too.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>


  Commit: b97f3147b0a3992ea079d5ce29b755984f30ba4f
      
https://github.com/qemu/qemu/commit/b97f3147b0a3992ea079d5ce29b755984f30ba4f
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M hw/core/machine-qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qapi: Add 'acpi' field to 'query-machines' output

Report which machine types support ACPI so that management applications
can properly use the 'acpi' property even on platforms such as ARM where
support for ACPI depends on the machine type and thus checking presence
of '-machine acpi=' in 'query-command-line-options' is insufficient.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: 
<537625d3e25d345052322c42ca19812b98b4f49a.1677571792.git.pkrempa@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d31d2404795e254517e513503d14a7991d61dbe6
      
https://github.com/qemu/qemu/commit/d31d2404795e254517e513503d14a7991d61dbe6
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M Makefile

  Log Message:
  -----------
  Makefile: qemu-bundle is a directory

So make distclean should remove it with -rf, not -f alone.

It has been that way since it was included.

ommit cf60ccc3306ca4726cbd286a156863863b00ff4f
Author: Akihiko Odaki <akihiko.odaki@gmail.com>
Date:   Fri Jun 24 23:50:37 2022 +0900

    cutils: Introduce bundle mechanism

Fixes: cf60ccc3306ca4726cbd286a156863863b00ff4f

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230301111910.1660-1-quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 526947e496e4447d74b8d42415e2847481c5043d
      
https://github.com/qemu/qemu/commit/526947e496e4447d74b8d42415e2847481c5043d
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M MAINTAINERS
    M accel/kvm/kvm-all.c
    M accel/kvm/kvm-cpus.h
    M accel/tcg/cpu-exec.c
    R accel/tcg/hmp.c
    M accel/tcg/internal.h
    M accel/tcg/meson.build
    A accel/tcg/monitor.c
    M accel/tcg/tcg-accel-ops.c
    M accel/tcg/tcg-all.c
    M accel/tcg/translate-all.c
    M accel/tcg/translator.c
    M accel/tcg/user-exec-stub.c
    M accel/xen/xen-all.c
    M block/vvfat.c
    M cpu.c
    M cpus-common.c
    A docs/system/i386/xen.rst
    M docs/system/target-i386.rst
    M dump/dump-hmp-cmds.c
    M dump/dump.c
    M dump/meson.build
    M dump/win_dump.c
    M dump/win_dump.h
    M gdbstub/gdbstub.c
    M gdbstub/internals.h
    M gdbstub/softmmu.c
    M gdbstub/user.c
    M hmp-commands.hx
    M hw/Kconfig
    M hw/acpi/ich9.c
    M hw/acpi/ich9_tco.c
    M hw/arm/sbsa-ref.c
    M hw/audio/ac97.c
    A hw/audio/ac97.h
    M hw/audio/cs4231a.c
    M hw/audio/es1370.c
    M hw/audio/gus.c
    M hw/audio/hda-codec.c
    M hw/audio/sb16.c
    M hw/block/fdc-isa.c
    M hw/core/ptimer.c
    M hw/core/qdev.c
    M hw/display/sm501.c
    M hw/dma/i82374.c
    M hw/hppa/machine.c
    M hw/i2c/smbus_ich9.c
    M hw/i386/Kconfig
    M hw/i386/acpi-build.c
    M hw/i386/kvm/ioapic.c
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/trace-events
    A hw/i386/kvm/trace.h
    A hw/i386/kvm/xen-stubs.c
    A hw/i386/kvm/xen_evtchn.c
    A hw/i386/kvm/xen_evtchn.h
    A hw/i386/kvm/xen_gnttab.c
    A hw/i386/kvm/xen_gnttab.h
    A hw/i386/kvm/xen_overlay.c
    A hw/i386/kvm/xen_overlay.h
    A hw/i386/kvm/xen_xenstore.c
    A hw/i386/kvm/xen_xenstore.h
    M hw/i386/microvm.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/i386/x86.c
    M hw/i386/xen/meson.build
    M hw/i386/xen/xen-hvm.c
    M hw/i386/xen/xen_platform.c
    M hw/ide/ahci.c
    M hw/ide/atapi.c
    M hw/ide/cmd646.c
    M hw/ide/core.c
    M hw/ide/ich.c
    M hw/ide/ioport.c
    M hw/ide/isa.c
    M hw/ide/macio.c
    M hw/ide/microdrive.c
    M hw/ide/mmio.c
    M hw/ide/pci.c
    M hw/ide/piix.c
    M hw/ide/qdev.c
    M hw/ide/sii3112.c
    M hw/ide/trace-events
    M hw/ide/via.c
    M hw/intc/apic.c
    M hw/intc/i8259.c
    M hw/intc/ioapic.c
    M hw/intc/ioapic_common.c
    A hw/intc/ioapic_internal.h
    M hw/isa/i82378.c
    M hw/isa/isa-bus.c
    M hw/isa/lpc_ich9.c
    M hw/isa/piix4.c
    M hw/isa/vt82c686.c
    M hw/mips/jazz.c
    M hw/misc/macio/gpio.c
    M hw/nubus/nubus-device.c
    M hw/pci-bridge/i82801b11.c
    M hw/pci/msi.c
    M hw/pci/msix.c
    M hw/pci/pci.c
    M hw/ppc/pnv_lpc.c
    M hw/ppc/prep.c
    M hw/ppc/sam460ex.c
    M hw/rtc/m48t59-isa.c
    M hw/rtc/mc146818rtc.c
    M hw/sh4/r2d.c
    M hw/sparc64/sun4u.c
    M hw/timer/hpet.c
    M hw/usb/dev-smartcard-reader.c
    M hw/usb/hcd-ohci.c
    M hw/usb/hcd-ohci.h
    M hw/usb/hcd-uhci.c
    M hw/usb/hcd-uhci.h
    M hw/usb/hcd-xhci-nec.c
    M hw/usb/trace-events
    M hw/usb/u2f.h
    A hw/xen/Kconfig
    M hw/xen/xen-legacy-backend.c
    M hw/xenpv/xen_machine_pv.c
    M include/exec/gen-icount.h
    A include/exec/replay-core.h
    M include/hw/acpi/ich9.h
    M include/hw/core/cpu.h
    R include/hw/i386/ich9.h
    R include/hw/i386/ioapic.h
    R include/hw/i386/ioapic_internal.h
    M include/hw/i386/pc.h
    M include/hw/i386/x86.h
    M include/hw/ide.h
    M include/hw/ide/internal.h
    A include/hw/ide/isa.h
    A include/hw/ide/mmio.h
    M include/hw/ide/pci.h
    M include/hw/intc/i8259.h
    A include/hw/intc/ioapic.h
    M include/hw/isa/i8259_internal.h
    M include/hw/isa/isa.h
    M include/hw/isa/superio.h
    M include/hw/pci/msi.h
    M include/hw/qdev-core.h
    M include/hw/rtc/mc146818rtc.h
    A include/hw/southbridge/ich9.h
    M include/hw/timer/i8254.h
    M include/hw/timer/i8254_internal.h
    A include/hw/xen/interface/arch-arm.h
    A include/hw/xen/interface/arch-x86/cpuid.h
    A include/hw/xen/interface/arch-x86/xen-x86_32.h
    A include/hw/xen/interface/arch-x86/xen-x86_64.h
    A include/hw/xen/interface/arch-x86/xen.h
    A include/hw/xen/interface/event_channel.h
    A include/hw/xen/interface/features.h
    M include/hw/xen/interface/grant_table.h
    A include/hw/xen/interface/hvm/hvm_op.h
    A include/hw/xen/interface/hvm/params.h
    M include/hw/xen/interface/io/blkif.h
    M include/hw/xen/interface/io/console.h
    M include/hw/xen/interface/io/fbif.h
    M include/hw/xen/interface/io/kbdif.h
    M include/hw/xen/interface/io/netif.h
    M include/hw/xen/interface/io/ring.h
    M include/hw/xen/interface/io/usbif.h
    M include/hw/xen/interface/io/xenbus.h
    A include/hw/xen/interface/io/xs_wire.h
    A include/hw/xen/interface/memory.h
    A include/hw/xen/interface/physdev.h
    A include/hw/xen/interface/sched.h
    A include/hw/xen/interface/trace.h
    A include/hw/xen/interface/vcpu.h
    A include/hw/xen/interface/version.h
    A include/hw/xen/interface/xen-compat.h
    A include/hw/xen/interface/xen.h
    M include/hw/xen/xen-legacy-backend.h
    M include/hw/xen/xen.h
    M include/monitor/hmp.h
    M include/qemu/typedefs.h
    M include/sysemu/accel-ops.h
    M include/sysemu/cpus.h
    M include/sysemu/kvm.h
    M include/sysemu/kvm_int.h
    A include/sysemu/kvm_xen.h
    M include/sysemu/replay.h
    M meson.build
    M qapi/misc-target.json
    M qom/object_interfaces.c
    M scripts/checkpatch.pl
    M softmmu/globals.c
    M softmmu/meson.build
    M softmmu/physmem.c
    M softmmu/vl.c
    A softmmu/watchpoint.c
    M stubs/replay.c
    R target/alpha/STATUS
    M target/alpha/cpu.h
    M target/arm/cpu.h
    M target/arm/internals.h
    M target/cris/cpu.h
    M target/hppa/cpu.h
    A target/hppa/fpu_helper.c
    M target/hppa/meson.build
    M target/hppa/op_helper.c
    A target/hppa/sys_helper.c
    M target/i386/cpu-dump.c
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/hax/hax-i386.h
    M target/i386/hvf/hvf-i386.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/kvm_i386.h
    M target/i386/kvm/meson.build
    M target/i386/kvm/trace-events
    A target/i386/kvm/xen-compat.h
    A target/i386/kvm/xen-emu.c
    A target/i386/kvm/xen-emu.h
    M target/i386/machine.c
    M target/i386/whpx/whpx-all.c
    M target/loongarch/cpu.h
    M target/m68k/cpu.h
    M target/microblaze/cpu.h
    M target/nios2/cpu.h
    M target/openrisc/cpu.h
    M target/ppc/cpu.h
    M target/ppc/dfp_helper.c
    M target/ppc/internal.h
    M target/ppc/kvm.c
    M target/riscv/cpu.h
    M target/rx/cpu.h
    M target/rx/helper.c
    M target/sh4/cpu.h
    M target/sparc/cpu.h
    M target/sparc/mmu_helper.c
    M target/tricore/cpu.h
    M target/xtensa/cpu.c
    M target/xtensa/cpu.h
    M tcg/tcg-common.c
    M tcg/tcg-op-gvec.c
    M tcg/tcg.c
    M tests/qtest/qmp-cmd-test.c
    M tests/qtest/tco-test.c
    M tests/unit/meson.build
    M tests/unit/ptimer-test-stubs.c
    M trace/meson.build
    M ui/cocoa.m
    M util/guest-random.c

  Log Message:
  -----------
  Merge branch 'xenfv-kvm-15' of git://git.infradead.org/users/dwmw2/qemu into 
HEAD

This adds support for emulating Xen under Linux/KVM, based on kernel
patches which have been present since Linux v5.12. As with the kernel
support, it's derived from work started by João Martins of Oracle in
2018.

This series just adds the basic platform support — CPUID, hypercalls,
event channels, a stub of XenStore.

A full single-tenant internal implementation of XenStore, and patches
to make QEMU's Xen PV drivers work with this Xen emulation, are waiting
in the wings to be submitted in a follow-on patch series.

As noted in the documentation, it's enabled by setting the xen-version
property on the KVM accelerator, e.g.:

 qemu-system-x86_64 -serial mon:stdio -M q35 -display none -m 1G -smp 2 \
    -accel kvm,xen-version=0x4000e,kernel-irqchip=split \
    -kernel vmlinuz-6.0.7-301.fc37.x86_64 \
    -append "console=ttyS0 root=/dev/sda1" \
    -drive file=/var/lib/libvirt/images/fedora28.qcow2,if=none,id=disk \
    -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0

Even before this was merged, we've already been using it to find and fix
bugs in the Linux kernel Xen guest support:

https://lore.kernel.org/all/4bffa69a949bfdc92c4a18e5a1c3cbb3b94a0d32.camel@infradead.org/
https://lore.kernel.org/all/871qnunycr.ffs@tglx/

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: c61d1a066cb6cf90662c82d0e35660fc0ccacbaf
      
https://github.com/qemu/qemu/commit/c61d1a066cb6cf90662c82d0e35660fc0ccacbaf
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-03-02 (Thu, 02 Mar 2023)

  Changed paths:
    M Makefile
    M accel/kvm/kvm-all.c
    M accel/xen/xen-all.c
    A docs/system/i386/xen.rst
    M docs/system/target-i386.rst
    M hmp-commands.hx
    M hw/Kconfig
    M hw/core/machine-qmp-cmds.c
    M hw/i386/Kconfig
    M hw/i386/kvm/meson.build
    A hw/i386/kvm/trace-events
    A hw/i386/kvm/trace.h
    A hw/i386/kvm/xen-stubs.c
    A hw/i386/kvm/xen_evtchn.c
    A hw/i386/kvm/xen_evtchn.h
    A hw/i386/kvm/xen_gnttab.c
    A hw/i386/kvm/xen_gnttab.h
    A hw/i386/kvm/xen_overlay.c
    A hw/i386/kvm/xen_overlay.h
    A hw/i386/kvm/xen_xenstore.c
    A hw/i386/kvm/xen_xenstore.h
    M hw/i386/pc.c
    M hw/i386/x86.c
    M hw/i386/xen/meson.build
    M hw/i386/xen/xen-hvm.c
    M hw/i386/xen/xen_platform.c
    M hw/pci/msi.c
    M hw/pci/msix.c
    M hw/pci/pci.c
    A hw/xen/Kconfig
    M hw/xen/xen-legacy-backend.c
    M hw/xenpv/xen_machine_pv.c
    M include/hw/i386/pc.h
    M include/hw/pci/msi.h
    A include/hw/xen/interface/arch-arm.h
    A include/hw/xen/interface/arch-x86/cpuid.h
    A include/hw/xen/interface/arch-x86/xen-x86_32.h
    A include/hw/xen/interface/arch-x86/xen-x86_64.h
    A include/hw/xen/interface/arch-x86/xen.h
    A include/hw/xen/interface/event_channel.h
    A include/hw/xen/interface/features.h
    M include/hw/xen/interface/grant_table.h
    A include/hw/xen/interface/hvm/hvm_op.h
    A include/hw/xen/interface/hvm/params.h
    M include/hw/xen/interface/io/blkif.h
    M include/hw/xen/interface/io/console.h
    M include/hw/xen/interface/io/fbif.h
    M include/hw/xen/interface/io/kbdif.h
    M include/hw/xen/interface/io/netif.h
    M include/hw/xen/interface/io/ring.h
    M include/hw/xen/interface/io/usbif.h
    M include/hw/xen/interface/io/xenbus.h
    A include/hw/xen/interface/io/xs_wire.h
    A include/hw/xen/interface/memory.h
    A include/hw/xen/interface/physdev.h
    A include/hw/xen/interface/sched.h
    A include/hw/xen/interface/trace.h
    A include/hw/xen/interface/vcpu.h
    A include/hw/xen/interface/version.h
    A include/hw/xen/interface/xen-compat.h
    A include/hw/xen/interface/xen.h
    M include/hw/xen/xen-legacy-backend.h
    M include/hw/xen/xen.h
    M include/monitor/hmp.h
    M include/sysemu/kvm_int.h
    A include/sysemu/kvm_xen.h
    M meson.build
    M qapi/machine.json
    M qapi/misc-target.json
    M softmmu/globals.c
    M softmmu/vl.c
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/kvm/kvm.c
    M target/i386/kvm/kvm_i386.h
    M target/i386/kvm/meson.build
    M target/i386/kvm/trace-events
    A target/i386/kvm/xen-compat.h
    A target/i386/kvm/xen-emu.c
    A target/i386/kvm/xen-emu.h
    M target/i386/machine.c
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* bugfixes
* show machine ACPI support in QAPI
* Core Xen emulation support for KVM/x86

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmQAlrYUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroONWwf/fxDUMcZUvvatNxiVMhNfqEt/cL0F
# Durv1PmbbeVh9PP0W7XFkEXO3LCIRDyR4rtmCs7gHGdmzDOWQ+QIWgQijQ/y7ElQ
# bTVsvs0+s/6H3csP3dJTJaXSHshbQvrAZTsyk5KcAB6xdL1KqulfLUoGvXJhAmRs
# NKZN8un+nuAhFhL0VBWA9eQaP+BVHQI5ItAj8PaoBby4+Q9fNnat6j1/G4iLly8J
# dxIwCnuRHLiB3melWtadwbv6ddLJFeZNa50HUIsynqoItTzmRVr+oXz1yfq087dB
# 9uksmoqb+icGEdwqs0iYbQ/dhVnIrMDpn/n2Us28S5VdIMVvxr1JEbEkSQ==
# =0jY8
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 02 Mar 2023 12:29:42 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (62 commits)
  Makefile: qemu-bundle is a directory
  qapi: Add 'acpi' field to 'query-machines' output
  hw/xen: Subsume xen_be_register_common() into xen_be_init()
  i386/xen: Document Xen HVM emulation
  kvm/i386: Add xen-evtchn-max-pirq property
  hw/xen: Support MSI mapping to PIRQ
  hw/xen: Support GSI mapping to PIRQ
  hw/xen: Implement emulated PIRQ hypercall support
  i386/xen: Implement HYPERVISOR_physdev_op
  hw/xen: Automatically add xen-platform PCI device for emulated Xen guests
  hw/xen: Add basic ring handling to xenstore
  hw/xen: Add xen_xenstore device for xenstore emulation
  hw/xen: Add backend implementation of interdomain event channel support
  i386/xen: handle HVMOP_get_param
  i386/xen: Reserve Xen special pages for console, xenstore rings
  i386/xen: handle PV timer hypercalls
  hw/xen: Implement GNTTABOP_query_size
  i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson
  hw/xen: Support mapping grant frames
  hw/xen: Add xen_gnttab device for grant table emulation
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/262312d7ba6e...c61d1a066cb6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]