qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ee4c11: vhost: Release memory references on c


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ee4c11: vhost: Release memory references on cleanup
Date: Fri, 08 Sep 2017 08:52:39 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ee4c112846a0f2ac4fe5601918b0a2642ac8e2ed
      
https://github.com/qemu/qemu/commit/ee4c112846a0f2ac4fe5601918b0a2642ac8e2ed
  Author: Alex Williamson <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/virtio/vhost.c

  Log Message:
  -----------
  vhost: Release memory references on cleanup

vhost registers a MemoryListener where it adds and removes references
to MemoryRegions as the MemoryRegionSections pass through.  The
region_add callback is invoked for each existing section when the
MemoryListener is registered, but unregistering the MemoryListener
performs no reciprocal region_del callback.  It's therefore the
owner of the MemoryListener's responsibility to cleanup any persistent
changes, such as these memory references, after unregistering.

The consequence of this bug is that if we have both a vhost device
and a vfio device, the vhost device will reference any mmap'd MMIO of
the vfio device via this MemoryListener.  If the vhost device is then
removed, those references remain outstanding.  If we then attempt to
remove the vfio device, it never gets finalized and the only way to
release the kernel file descriptors is to terminate the QEMU process.

Fixes: dfde4e6e1a86 ("memory: add ref/unref calls")
Cc: Michael S. Tsirkin <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: address@hidden # v1.6.0+
Signed-off-by: Alex Williamson <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: a6fd5b0e050abc892ae3a64547631d2332b893de
      
https://github.com/qemu/qemu/commit/a6fd5b0e050abc892ae3a64547631d2332b893de
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

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

  Log Message:
  -----------
  pc: add 2.11 machine types

Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f5855994fee2f8815dc86b8453e4a63e290aea05
      
https://github.com/qemu/qemu/commit/f5855994fee2f8815dc86b8453e4a63e290aea05
  Author: Anthony PERARD <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/acpi/pcihp.c

  Log Message:
  -----------
  hw/acpi: Limit hotplug to root bus on legacy mode

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ab938ae43f8a3a71a3525566edf586081b7a7452
      
https://github.com/qemu/qemu/commit/ab938ae43f8a3a71a3525566edf586081b7a7452
  Author: Anthony PERARD <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/acpi/pcihp.c
    M hw/i386/acpi-build.c
    M stubs/Makefile.objs
    A stubs/pci-host-piix.c

  Log Message:
  -----------
  hw/acpi: Move acpi_set_pci_info to pcihp

HW part of ACPI PCI hotplug in QEMU depends on ACPI_PCIHP_PROP_BSEL
being set on a PCI bus that supports ACPI hotplug. It should work
regardless of the source of ACPI tables (QEMU generator/legacy SeaBIOS/Xen).
So move ACPI_PCIHP_PROP_BSEL initialization into HW ACPI implementation
part from QEMU's ACPI table generator.

To do PCI passthrough with Xen, the property ACPI_PCIHP_PROP_BSEL needs
to be set, but this was done only when ACPI tables are built which is
not needed for a Xen guest. The need for the property starts with commit
"pc: pcihp: avoid adding ACPI_PCIHP_PROP_BSEL twice"
(f0c9d64a68b776374ec4732424a3e27753ce37b6).

Adding find_i440fx into stubs so that mips-softmmu target can be built.

Reported-by: Sander Eikelenboom <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 2bed1ba77fae50bc8b5e68ede2d80b652b30c3b8
      
https://github.com/qemu/qemu/commit/2bed1ba77fae50bc8b5e68ede2d80b652b30c3b8
  Author: Anthony PERARD <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/acpi/piix4.c

  Log Message:
  -----------
  Revert "ACPI: don't call acpi_pcihp_device_plug_cb on xen"

This reverts commit 153eba4726dfa1bdfc31d1fe973b2a61b9035492.

This patch prevents PCI passthrough hotplug on Xen. Even if the Xen tool
stack prepares its own ACPI tables, we still rely on QEMU for hotplug
ACPI notifications.

The original issue is fixed by the two previous patch:
  hw/acpi: Limit hotplug to root bus on legacy mode
  hw/acpi: Move acpi_set_pci_info to pcihp

Signed-off-by: Anthony PERARD <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: a35fe226558ac85436ea01af8977f1834927f53f
      
https://github.com/qemu/qemu/commit/a35fe226558ac85436ea01af8977f1834927f53f
  Author: Aleksandr Bezzubikov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/pci-bridge/Makefile.objs
    A hw/pci-bridge/pcie_pci_bridge.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  hw/pci: introduce pcie-pci-bridge device

Introduce a new PCIExpress-to-PCI Bridge device,
which is a hot-pluggable PCI Express device and
supports devices hot-plug with SHPC.

This device is intended to replace the DMI-to-PCI Bridge.

Signed-off-by: Aleksandr Bezzubikov <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 70e1ee59bb9490d9ac529e96820a03b346086ca1
      
https://github.com/qemu/qemu/commit/70e1ee59bb9490d9ac529e96820a03b346086ca1
  Author: Aleksandr Bezzubikov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/pci/pci_bridge.c
    M include/hw/pci/pci_bridge.h

  Log Message:
  -----------
  hw/pci: introduce bridge-only vendor-specific capability to provide some 
hints to firmware

On PCI init PCI bridges may need some extra info about bus number,
IO, memory and prefetchable memory to reserve. QEMU can provide this
with a special vendor-specific PCI capability.

Signed-off-by: Aleksandr Bezzubikov <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 226263fb5cdaa4a4a95f1680fabbc9dd2123fd67
      
https://github.com/qemu/qemu/commit/226263fb5cdaa4a4a95f1680fabbc9dd2123fd67
  Author: Aleksandr Bezzubikov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/pci-bridge/gen_pcie_root_port.c
    M include/hw/pci/pcie_port.h

  Log Message:
  -----------
  hw/pci: add QEMU-specific PCI capability to the Generic PCI Express Root Port

To enable hotplugging of a newly created pcie-pci-bridge,
we need to tell firmware (e.g. SeaBIOS) to reserve
additional buses or IO/MEM/PREF space for pcie-root-port.
Additional bus reservation allows us to hotplug pcie-pci-bridge into this root 
port.
The number of buses and IO/MEM/PREF space to reserve are provided to the device 
via
a corresponding property, and to the firmware via new PCI capability.
The properties' default values are -1 to keep default behavior unchanged.

Signed-off-by: Aleksandr Bezzubikov <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: c1800a16276582f65807f464a6ab0b7c88a1c16e
      
https://github.com/qemu/qemu/commit/c1800a16276582f65807f464a6ab0b7c88a1c16e
  Author: Aleksandr Bezzubikov <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M docs/pcie.txt
    A docs/pcie_pci_bridge.txt

  Log Message:
  -----------
  docs: update documentation considering PCIE-PCI bridge

Signed-off-by: Aleksandr Bezzubikov <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 66a4a0318e6b9539505491e4576fb93a708095d8
      
https://github.com/qemu/qemu/commit/66a4a0318e6b9539505491e4576fb93a708095d8
  Author: Peter Xu <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/i386/intel_iommu.c

  Log Message:
  -----------
  intel_iommu: fix missing BQL in pt fast path

In vtd_switch_address_space() we did the memory region switch, however
it's possible that the caller of it has not taken the BQL at all. Make
sure we have it.

CC: Paolo Bonzini <address@hidden>
CC: Jason Wang <address@hidden>
CC: Michael S. Tsirkin <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 0b4a775188cbe411d9ce7073ea1a24b72848327e
      
https://github.com/qemu/qemu/commit/0b4a775188cbe411d9ce7073ea1a24b72848327e
  Author: Yoni Bettan <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/acpi/vmgenid.c

  Log Message:
  -----------
  acpi/vmgenid: change device category to misc

Moved vmgenid from uncategorized to misc category in QEMU help menu

Signed-off-by: Yoni Bettan <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 35480cbfcb73143af66c8de4b444d686a46c2e88
      
https://github.com/qemu/qemu/commit/35480cbfcb73143af66c8de4b444d686a46c2e88
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M contrib/libvhost-user/libvhost-user.c
    M contrib/libvhost-user/libvhost-user.h

  Log Message:
  -----------
  libvhost-user: support resuming vq->last_avail_idx based on used_idx

This is the same workaround as commit 523b018dde3b765, which was lost
with libvhost-user transition in commit e10e798c85c2331.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 672339f7eff5e9226f302037290e84e783d2b5cd
      
https://github.com/qemu/qemu/commit/672339f7eff5e9226f302037290e84e783d2b5cd
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M tests/vhost-user-bridge.c

  Log Message:
  -----------
  vhost-user-bridge: fix resume regression (since 2.9)

Commit e10e798c85c2331 switched to libvhost-user which lacked support
for resuming the avail_idx based on used_idx.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1485867

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: c8389550dedc65892fba9c3df29423efd802f544
      
https://github.com/qemu/qemu/commit/c8389550dedc65892fba9c3df29423efd802f544
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/acpi/bios-linker-loader.c
    M hw/acpi/vmgenid.c
    M include/hw/acpi/bios-linker-loader.h
    M include/hw/acpi/vmgenid.h
    M include/hw/compat.h

  Log Message:
  -----------
  vmgenid: replace x-write-pointer-available hack

This compat property sole function is to prevent the device from being
instantiated. Instead of requiring an extra compat property, check if
fw_cfg has DMA enabled.

fw_cfg is a built-in device that is initialized very early by the
machine init code.  We have at least one other device that also
assumes fw_cfg_find() can be safely used on realize: pvpanic.

This has the additional benefit of handling other cases properly, like:

  $ qemu-system-x86_64 -device vmgenid -machine none
  qemu-system-x86_64: -device vmgenid: vmgenid requires DMA write support in 
fw_cfg, which this machine type does not provide
  $ qemu-system-x86_64 -device vmgenid -machine pc-i440fx-2.9 -global 
fw_cfg.dma_enabled=off
  qemu-system-x86_64: -device vmgenid: vmgenid requires DMA write support in 
fw_cfg, which this machine type does not provide
  $ qemu-system-x86_64 -device vmgenid -machine pc-i440fx-2.6 -global 
fw_cfg.dma_enabled=on
  [boots normally]

Suggested-by: Eduardo Habkost <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Ben Warren <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 9b717a3a1318455afce761301fec114982ccbf1f
      
https://github.com/qemu/qemu/commit/9b717a3a1318455afce761301fec114982ccbf1f
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/pci/pci.c

  Log Message:
  -----------
  pci: move check for existing devfn into new pci_bus_devfn_available() helper

Also touch up the logic in do_pci_register_device() accordingly.

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 8b8849844fd6a31956e934885f2a7ae9ac1a95d8
      
https://github.com/qemu/qemu/commit/8b8849844fd6a31956e934885f2a7ae9ac1a95d8
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/pci/pci.c
    M include/hw/pci/pci_bus.h

  Log Message:
  -----------
  pci: add reserved slot check to do_pci_register_device()

Add a new slot_reserved_mask bitmask to PCIBus indicating whether or not each
PCI slot on the bus is reserved. Ensure that it is initialised to zero to
maintain the existing behaviour that all slots are available by default, and
add the additional check with appropriate error reporting to
do_pci_register_device().

Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 6f6f4aec749ba9a4fb58c7c20536a61b0381ff35
      
https://github.com/qemu/qemu/commit/6f6f4aec749ba9a4fb58c7c20536a61b0381ff35
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M hw/core/loader.c
    M hw/nvram/fw_cfg.c
    M include/hw/loader.h
    M include/hw/nvram/fw_cfg.h

  Log Message:
  -----------
  fw_cfg: rename read callback

The callback is called on select.

Furthermore, the next patch introduced a new callback, so rename the
function type with a generic name.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: fcea73709b966a7ded9efa7b106ea50c7fe9025c
      
https://github.com/qemu/qemu/commit/fcea73709b966a7ded9efa7b106ea50c7fe9025c
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M contrib/libvhost-user/libvhost-user.c
    M contrib/libvhost-user/libvhost-user.h
    M docs/pcie.txt
    A docs/pcie_pci_bridge.txt
    M hw/acpi/bios-linker-loader.c
    M hw/acpi/pcihp.c
    M hw/acpi/piix4.c
    M hw/acpi/vmgenid.c
    M hw/core/loader.c
    M hw/i386/acpi-build.c
    M hw/i386/intel_iommu.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/nvram/fw_cfg.c
    M hw/pci-bridge/Makefile.objs
    M hw/pci-bridge/gen_pcie_root_port.c
    A hw/pci-bridge/pcie_pci_bridge.c
    M hw/pci/pci.c
    M hw/pci/pci_bridge.c
    M hw/virtio/vhost.c
    M include/hw/acpi/bios-linker-loader.h
    M include/hw/acpi/vmgenid.h
    M include/hw/compat.h
    M include/hw/i386/pc.h
    M include/hw/loader.h
    M include/hw/nvram/fw_cfg.h
    M include/hw/pci/pci.h
    M include/hw/pci/pci_bridge.h
    M include/hw/pci/pci_bus.h
    M include/hw/pci/pcie_port.h
    M stubs/Makefile.objs
    A stubs/pci-host-piix.c
    M tests/vhost-user-bridge.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, virtio: patches queued before 2.10

A bunch of stuff that was posted before the 2.10 timeframe,
mostly fixes/cleanups.  New PCI bridges.

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Fri 08 Sep 2017 14:15:34 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  fw_cfg: rename read callback
  pci: add reserved slot check to do_pci_register_device()
  pci: move check for existing devfn into new pci_bus_devfn_available() helper
  vmgenid: replace x-write-pointer-available hack
  vhost-user-bridge: fix resume regression (since 2.9)
  libvhost-user: support resuming vq->last_avail_idx based on used_idx
  acpi/vmgenid: change device category to misc
  intel_iommu: fix missing BQL in pt fast path
  docs: update documentation considering PCIE-PCI bridge
  hw/pci: add QEMU-specific PCI capability to the Generic PCI Express Root Port
  hw/pci: introduce bridge-only vendor-specific capability to provide some 
hints to firmware
  hw/pci: introduce pcie-pci-bridge device
  Revert "ACPI: don't call acpi_pcihp_device_plug_cb on xen"
  hw/acpi: Move acpi_set_pci_info to pcihp
  hw/acpi: Limit hotplug to root bus on legacy mode
  pc: add 2.11 machine types
  vhost: Release memory references on cleanup

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/a1ae46d1b4f2...fcea73709b96

reply via email to

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