Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: c102e2977218
Choose a base ref
...
head repository: qemu/qemu
compare: 4f65e89f8cf0
Choose a head ref
  • 16 commits
  • 18 files changed
  • 5 contributors

Commits on Jun 7, 2023

  1. hw/xen: Simplify emulated Xen platform init

    I initially put the basic platform init (overlay pages, grant tables,
    event channels) into mc->kvm_type because that was the earliest place
    that could sensibly test for xen_mode==XEN_EMULATE.
    
    The intent was to do this early enough that we could then initialise the
    XenBus and other parts which would have depended on them, from a generic
    location for both Xen and KVM/Xen in the PC-specific code, as seen in
    https://lore.kernel.org/qemu-devel/20230116221919.1124201-16-dwmw2@infradead.org/
    
    However, then the Xen on Arm patches came along, and *they* wanted to
    do the XenBus init from a 'generic' Xen-specific location instead:
    https://lore.kernel.org/qemu-devel/20230210222729.957168-4-sstabellini@kernel.org/
    
    Since there's no generic location that covers all three, I conceded to
    do it for XEN_EMULATE mode in pc_basic_devices_init().
    
    And now there's absolutely no point in having some of the platform init
    done from pc_machine_kvm_type(); we can move it all up to live in a
    single place in pc_basic_devices_init(). This has the added benefit that
    we can drop the separate xen_evtchn_connect_gsis() function completely,
    and pass just the system GSIs in directly to xen_evtchn_create().
    
    While I'm at it, it does no harm to explicitly pass in the *number* of
    said GSIs, because it does make me twitch a bit to pass an array of
    impicit size. During the lifetime of the KVM/Xen patchset, that had
    already changed (albeit just cosmetically) from GSI_NUM_PINS to
    IOAPIC_NUM_PINS.
    
    And document a bit better that this is for the *output* GSI for raising
    CPU0's events when the per-CPU vector isn't available. The fact that
    we create a whole set of them and then only waggle the one we're told
    to, instead of having a single output and only *connecting* it to the
    GSI that it should be connected to, is still non-intuitive for me.
    
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Message-Id: <20230412185102.441523-2-dwmw2@infradead.org>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    dwmw2 authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    eeedfe6 View commit details
    Browse the repository at this point in the history
  2. hw/xen: Fix memory leak in libxenstore_open() for Xen

    There was a superfluous allocation of the XS handle, leading to it
    being leaked on both the error path and the success path (where it gets
    allocated again).
    
    Spotted by Coverity (CID 1508098).
    
    Fixes: ba2a92d ("hw/xen: Add xenstore operations to allow redirection to internal emulation")
    Suggested-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Message-Id: <20230412185102.441523-3-dwmw2@infradead.org>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    dwmw2 authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    8442232 View commit details
    Browse the repository at this point in the history
  3. xen: Drop support for Xen versions below 4.7.1

    In restructuring to allow for internal emulation of Xen functionality,
    I broke compatibility for Xen 4.6 and earlier. Fix this by explicitly
    removing support for anything older than 4.7.1, which is also ancient
    but it does still build, and the compatibility support for it is fairly
    unintrusive.
    
    Fixes: 15e283c ("hw/xen: Add foreignmem operations to allow redirection to internal emulation")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Message-Id: <20230412185102.441523-4-dwmw2@infradead.org>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    dwmw2 authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    2f20b17 View commit details
    Browse the repository at this point in the history
  4. hw/xen: Fix broken check for invalid state in xs_be_open()

    Coverity points out that if (!s && !s->impl) isn't really what we intended
    to do here. CID 1508131.
    
    Fixes: 0324751 ("hw/xen: Add emulated implementation of XenStore operations")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    Reviewed-by: Paul Durrant <paul@xen.org>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Message-Id: <20230412185102.441523-6-dwmw2@infradead.org>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    dwmw2 authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    c9bdfe8 View commit details
    Browse the repository at this point in the history
  5. include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()

    xen_piix3_set_irq() isn't PIIX specific: PIIX is a single PCI device
    while xen_piix3_set_irq() maps multiple PCI devices to their respective
    IRQs, which is board-specific. Rename xen_piix3_set_irq() to communicate
    this.
    
    Also rename XEN_PIIX_NUM_PIRQS to XEN_IOAPIC_NUM_PIRQS since the Xen's
    IOAPIC rather than PIIX has this many interrupt routes.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-2-shentey@gmail.com>
    Message-Id: <20230403074124.3925-2-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    27047bd View commit details
    Browse the repository at this point in the history
  6. hw/pci/pci.c: Don't leak PCIBus::irq_count[] in pci_bus_irqs()

    When calling pci_bus_irqs() multiple times on the same object without calling
    pci_bus_irqs_cleanup() in between PCIBus::irq_count[] is currently leaked.
    Let's fix this because Xen will do just that in a few commits, and because
    calling pci_bus_irqs_cleanup() in between seems fragile and cumbersome.
    
    Note that pci_bus_irqs_cleanup() now has to NULL irq_count such that
    pci_bus_irqs() doesn't do a double free.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230403074124.3925-3-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    c0b5941 View commit details
    Browse the repository at this point in the history
  7. hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

    This is a preparational patch for the next one to make the following
    more obvious:
    
    First, pci_bus_irqs() is now called twice in case of Xen where the
    second call overrides the pci_set_irq_fn with the Xen variant.
    
    Second, pci_bus_set_route_irq_fn() is now also called in Xen mode.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-3-shentey@gmail.com>
    Message-Id: <20230403074124.3925-4-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    a58a31a View commit details
    Browse the repository at this point in the history
  8. hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3

    xen_intx_set_irq() doesn't depend on PIIX3State. In order to resolve
    TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the
    precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3
    in the board.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-4-shentey@gmail.com>
    Message-Id: <20230403074124.3925-5-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    60a9eb5 View commit details
    Browse the repository at this point in the history
  9. hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config()

    Subscribe to pci_bus_fire_intx_routing_notifier() instead which allows for
    having a common piix3_write_config() for the PIIX3 device models.
    
    While at it, move the subscription into machine code to facilitate resolving
    TYPE_PIIX3_XEN_DEVICE.
    
    In a possible future followup, pci_bus_fire_intx_routing_notifier() could
    be adjusted in such a way that subscribing to it doesn't require
    knowledge of the device firing it.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-5-shentey@gmail.com>
    Message-Id: <20230403074124.3925-6-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    89965db View commit details
    Browse the repository at this point in the history
  10. hw/isa/piix3: Resolve redundant k->config_write assignments

    The previous patch unified handling of piix3_write_config() accross the
    PIIX3 device models which allows for assigning k->config_write once in the
    base class.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-6-shentey@gmail.com>
    Message-Id: <20230403074124.3925-7-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    0f3e02a View commit details
    Browse the repository at this point in the history
  11. hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE

    During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of
    TYPE_PIIX3_DEVICE. Remove this redundancy.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
    Tested-by: Chuck Zmudzinski <brchuckz@aol.com>
    Message-Id: <20230312120221.99183-7-shentey@gmail.com>
    Message-Id: <20230403074124.3925-8-shentey@gmail.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    shentok authored and anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    f8790f8 View commit details
    Browse the repository at this point in the history
  12. xen-block: fix segv on unrealize

    Backtrace:
      qemu_lockcnt_lock (lockcnt=0xb4) at ../util/lockcnt.c:238
      aio_set_fd_handler (ctx=0x0, fd=51, is_external=true, io_read=0x0, io_write=0x0, io_poll=0x0, io_poll_ready=0x0, opaque=0x0) at ../util/aio-posix.c:119
      xen_device_unbind_event_channel (xendev=0x55c6da5b5000, channel=0x55c6da6c4c80, errp=0x7fff641ac608) at ../hw/xen/xen-bus.c:926
      xen_block_dataplane_stop (dataplane=0x55c6da6ddbe0) at ../hw/block/dataplane/xen-block.c:719
      xen_block_disconnect (xendev=0x55c6da5b5000, errp=0x0) at ../hw/block/xen-block.c:48
      xen_block_unrealize (xendev=0x55c6da5b5000) at ../hw/block/xen-block.c:154
      xen_device_unrealize (dev=0x55c6da5b5000) at ../hw/xen/xen-bus.c:956
      xen_device_exit (n=0x55c6da5b50d0, data=0x0) at ../hw/xen/xen-bus.c:985
      notifier_list_notify (list=0x55c6d91f9820 <exit_notifiers>, data=0x0) at ../util/notify.c:39
      qemu_run_exit_notifiers () at ../softmmu/runstate.c:760
    
    Fixes: f6eac90 ("xen-block: implement BlockDevOps->drained_begin()")
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20230606131605.55596-1-anthony.perard@citrix.com>
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    anthonyper-ctx committed Jun 7, 2023
    Copy the full SHA
    9000666 View commit details
    Browse the repository at this point in the history
  13. vfio-user: update comments

    Clarify the behavior of TYPE_VFU_OBJECT when TYPE_REMOTE_MACHINE enables
    the auto-shutdown property. Also, add notes to VFU_OBJECT_ERROR.
    
    Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    jraman567 committed Jun 7, 2023
    Copy the full SHA
    c145475 View commit details
    Browse the repository at this point in the history
  14. docs: fix multi-process QEMU documentation

    Fix a typo in the system documentation for multi-process QEMU.
    
    Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    jraman567 committed Jun 7, 2023
    Copy the full SHA
    7771e8b View commit details
    Browse the repository at this point in the history
  15. Merge tag 'pull-vfio-user-20230607' of https://gitlab.com/jraman/qemu

    …into staging
    
    vfio-user: Fix the documentation for vfio-user and multi-process QEMU
    
    Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
    
    # -----BEGIN PGP SIGNATURE-----
    # Version: GnuPG v2.0.22 (GNU/Linux)
    #
    # iQIcBAABAgAGBQJkgJP9AAoJEI00T2TOPz3HSoYQAJsyb9ve1MOAaTgL6DzrOe0F
    # rS9A/F+isAXNr8XENhBBPeHpmMyZLmw35G+xUuxAerZAIo+kRWrB7ab1F7VrCi16
    # sGWNIZ9byjt5dTqQTX63/txmXhKnM5puJxgJ/VlEGyZwGNCLhkS8yTmlKC1n8D92
    # KzP1doqvqGV8AdEOudj7sFQsN5e//qrEsXm0vkZrUlr3L44QbJxrU+525r191dpP
    # qFC8+lqh6CfnGgZyUSxrnFUUEP7yNGuLsCkeoFVywWQKgR/aA0UtUS8+lQHcloAG
    # 4fSDMp6dMXZDWed48ZUpd+DptdiID64WDy+v6knin24awXY91dA7gFwXMvt2+IIl
    # LDr99FJ8wdZpEwwXQrUwMis4RE3E3bQw7W11hb2GEPG+K90aRKeljZZQVl3Rhs3e
    # cAxY5qwTrxhwpo1erPMfv8PLqSDk5+VWS0r+whEbnpHULOppDL8fgSz77NEt0CU1
    # EdMRWBs7cTf2cdGLqKusekPwDMyKgQauvvQfTBBOAvHxM7+NpJPog9APiXx4BBG9
    # On+eyV23VHRDdeuXvpLJyL9OswuRc8HmXZVR/Nk0vXWGP0ZCWoTSIeZfJfgKRjdR
    # 6au8m/RI88tfJHMTT1Q/MJzdX+FlFRddt3JcPOiX9rMqj9eXKIjQBzpTW6R/hKNi
    # SOKYdZF06D1hs/r8De1O
    # =nA+U
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Wed 07 Jun 2023 07:28:13 AM PDT
    # gpg:                using RSA key 8D344F64CE3F3DC7
    # gpg: Good signature from "Jagannathan Raman <jag.raman@oracle.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: B36D 9579 7F7B 3D4F 87A6  D8CF 8D34 4F64 CE3F 3DC7
    
    * tag 'pull-vfio-user-20230607' of https://gitlab.com/jraman/qemu:
      docs: fix multi-process QEMU documentation
      vfio-user: update comments
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed Jun 7, 2023
    Copy the full SHA
    e3bd519 View commit details
    Browse the repository at this point in the history
  16. Merge tag 'pull-xen-20230607' of https://xenbits.xen.org/git-http/peo…

    …ple/aperard/qemu-dm into staging
    
    Xen queue
    
    - fix for xen-block segv
    - Resolve TYPE_PIIX3_XEN_DEVICE
    - Xen emulation build/Coverity fixes
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmSAkU0ACgkQDPVXL9f7
    # Va/mMQf9Hs8pFGz7qRMc8RbuBvwVNGcdqOKZN+sbBKPb2pp9X8gkP5EV5SMLF/eu
    # CjaoZU+SsZcVLZ0HZ/TevAEuMrflZeeRfneJzEcl58cwOxo5l18puRwy9iDxfh6m
    # goqGGxQA2OmUa5eVZ7WX2JXo0wG/RQqqc/pChKbPAsTT9/QE23irOQBdUDf7sbGP
    # WFI/LoLR0c6NNbQyZNWSP0e/+es8ztq+Is7Bl6d1fdG/6YeXK2yVaro1gyMmxKAm
    # EKuvI9qva2ilV5RJEc/gB/x4PuIVCPizkrbB8XClQ81Szo49x55ChPdnpT5i7Sqd
    # qjFWO2plgV/gXri1/RTCzyBujeuCOA==
    # =E1Qb
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Wed 07 Jun 2023 07:16:45 AM PDT
    # gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
    # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [unknown]
    # gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
    #      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF
    
    * tag 'pull-xen-20230607' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm:
      xen-block: fix segv on unrealize
      hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE
      hw/isa/piix3: Resolve redundant k->config_write assignments
      hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config()
      hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3
      hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()
      hw/pci/pci.c: Don't leak PCIBus::irq_count[] in pci_bus_irqs()
      include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()
      hw/xen: Fix broken check for invalid state in xs_be_open()
      xen: Drop support for Xen versions below 4.7.1
      hw/xen: Fix memory leak in libxenstore_open() for Xen
      hw/xen: Simplify emulated Xen platform init
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed Jun 7, 2023
    Copy the full SHA
    4f65e89 View commit details
    Browse the repository at this point in the history