qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7c4228: vfio: Destroy memory regions


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7c4228: vfio: Destroy memory regions
Date: Sat, 01 Feb 2014 14:00:05 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7c4228b4771acddcb8815079bc116007cec8a1ff
      
https://github.com/qemu/qemu/commit/7c4228b4771acddcb8815079bc116007cec8a1ff
  Author: Alex Williamson <address@hidden>
  Date:   2014-01-15 (Wed, 15 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: Destroy memory regions

Somehow this has been lurking for a while; we remove our subregions
from the base BAR and VGA region mappings, but we don't destroy them,
creating a leak and more serious problems when we try to migrate after
removing these devices.  Add the trivial bit of final cleanup to
remove these entirely.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: d20b43dfea1587b561aae17e4fa0f7407779d253
      
https://github.com/qemu/qemu/commit/d20b43dfea1587b561aae17e4fa0f7407779d253
  Author: Bandan Das <address@hidden>
  Date:   2014-01-15 (Wed, 15 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: warn if host device rom can't be read

If the device rom can't be read, report an error to the
user. This alerts the user that the device has a bad
state that is causing rom read failure or option rom
loading has been disabled from the device boot menu
(among other reasons).

Signed-off-by: Bandan Das <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: e638073c569e801ce9def2016a84f955cbbca779
      
https://github.com/qemu/qemu/commit/e638073c569e801ce9def2016a84f955cbbca779
  Author: Bandan Das <address@hidden>
  Date:   2014-01-15 (Wed, 15 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: Do not reattempt a failed rom read

During lazy rom loading, if rom read fails, and the
guest attempts a read again, vfio will again attempt it.
Add a boolean to prevent this. There could be a case where
a failed rom read might succeed the next time because of
a device reset or such, but it's best to exclude unpredictable
behavior

Signed-off-by: Bandan Das <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: d3a2fd9b29e43e202315d5e99399b99622469c4a
      
https://github.com/qemu/qemu/commit/d3a2fd9b29e43e202315d5e99399b99622469c4a
  Author: Alex Williamson <address@hidden>
  Date:   2014-01-16 (Thu, 16 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: Filter out bogus mappings

Since 57271d63 we now see spurious mappings with the upper bits set
if 64bit PCI BARs are sized while enabled.  The guest writes a mask
of 0xffffffff to the lower BAR to size it, then restores it, then
writes the same mask to the upper BAR resulting in a spurious BAR
mapping into the last 4G of the 64bit address space.  Most
architectures do not support or make use of the full 64bits address
space for PCI BARs, so we filter out mappings with the high bit set.
Long term, we probably need to think about vfio telling us the
address width limitations of the IOMMU.

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


  Commit: 87ca1f77b1c406137fe36ab73b2dc91fb75f8d0a
      
https://github.com/qemu/qemu/commit/87ca1f77b1c406137fe36ab73b2dc91fb75f8d0a
  Author: Alex Williamson <address@hidden>
  Date:   2014-01-16 (Thu, 16 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio-pci: Fail initfn on DMA mapping errors

The vfio-pci initfn will currently succeed even if DMA mappings fail.
A typical reason for failure is if the user does not have sufficient
privilege to lock all the memory for the guest.  In this case, the
device gets attached, but can only access a portion of guest memory
and is extremely unlikely to work.

DMA mappings are done via a MemoryListener, which provides no direct
error return path.  We therefore stuff the errno into our container
structure and check for error after registration completes.  We can
also test for mapping errors during runtime, but our only option for
resolution at that point is to kill the guest with a hw_error.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: 47c16ed56aa6bc4037bdb7b61f049097993cd244
      
https://github.com/qemu/qemu/commit/47c16ed56aa6bc4037bdb7b61f049097993cd244
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2014-01-17 (Fri, 17 Jan 2014)

  Changed paths:
    M include/exec/exec-all.h
    M kvm-all.c
    M translate-all.c

  Log Message:
  -----------
  kvm: initialize qemu_host_page_size

There is a HOST_PAGE_ALIGN macro which makes sense for KVM accelerator
but it uses qemu_host_page_size/qemu_host_page_mask which initialized
for TCG only.

This moves qemu_host_page_size/qemu_host_page_mask initialization from
TCG's page_init() and adds a call for it from kvm_init().

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 8d7b5a1da0e06aa7addd7f084d9ec9d433c4bafb
      
https://github.com/qemu/qemu/commit/8d7b5a1da0e06aa7addd7f084d9ec9d433c4bafb
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2014-01-17 (Fri, 17 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: fix mapping of MSIX bar

VFIO virtualizes MSIX table for the guest but not mapping the part of
a BAR which contains an MSIX table. Since vfio_mmap_bar() mmaps chunks
before and after the MSIX table, they have to be aligned to the host
page size which may be TARGET_PAGE_MASK (4K) or 64K in case of PPC64.

This fixes boundaries calculations to use the real host page size.

Without the patch, the chunk before MSIX table may overlap with the MSIX
table and mmap will fail in the host kernel. The result will be serious
slowdown as the whole BAR will be emulated by QEMU.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 8b6d14087d487203f4d1a67aeaddc3be6c73f49f
      
https://github.com/qemu/qemu/commit/8b6d14087d487203f4d1a67aeaddc3be6c73f49f
  Author: Bandan Das <address@hidden>
  Date:   2014-01-28 (Tue, 28 Jan 2014)

  Changed paths:
    M hw/misc/vfio.c

  Log Message:
  -----------
  vfio: correct debug macro typo

Change to DEBUG_VFIO in vfio_msi_interrupt() for debug
messages to get printed

Signed-off-by: Bandan Das <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 850bbe1b94445cb84a2f648bc2e8c35ef6188eb4
      
https://github.com/qemu/qemu/commit/850bbe1b94445cb84a2f648bc2e8c35ef6188eb4
  Author: Peter Maydell <address@hidden>
  Date:   2014-02-01 (Sat, 01 Feb 2014)

  Changed paths:
    M hw/misc/vfio.c
    M include/exec/exec-all.h
    M kvm-all.c
    M translate-all.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0' into staging

vfio-pci updates include:
 - Destroy MemoryRegions on device teardown
 - Print warnings around PCI option ROM failures
 - Skip bogus mappings from 64bit BAR sizing
 - Act on DMA mapping failures
 - Fix alignment to avoid MSI-X table mapping
 - Fix debug macro typo

# gpg: Signature made Tue 28 Jan 2014 15:27:47 GMT using RSA key ID 3BB08B22
# gpg: Can't check signature: public key not found

* remotes/awilliam/tags/vfio-pci-for-qemu-20140128.0:
  vfio: correct debug macro typo
  vfio: fix mapping of MSIX bar
  kvm: initialize qemu_host_page_size
  vfio-pci: Fail initfn on DMA mapping errors
  vfio: Filter out bogus mappings
  vfio: Do not reattempt a failed rom read
  vfio: warn if host device rom can't be read
  vfio: Destroy memory regions

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


Compare: https://github.com/qemu/qemu/compare/bd88091cfbc3...850bbe1b9444

reply via email to

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