Skip to content
Snippets Groups Projects
  1. Dec 15, 2022
    • Matthew Rosato's avatar
      s390x/pci: reset ISM passthrough devices on shutdown and system reset · 03451953
      Matthew Rosato authored
      
      ISM device firmware stores unique state information that can
      can cause a wholesale unmap of the associated IOMMU (e.g. when
      we get a termination signal for QEMU) to trigger firmware errors
      because firmware believes we are attempting to invalidate entries
      that are still in-use by the guest OS (when in fact that guest is
      in the process of being terminated or rebooted).
      To alleviate this, register both a shutdown notifier (for unexpected
      termination cases e.g. virsh destroy) as well as a reset callback
      (for cases like guest OS reboot).  For each of these scenarios, trigger
      PCI device reset; this is enough to indicate to firmware that the IOMMU
      is no longer in-use by the guest OS, making it safe to invalidate any
      associated IOMMU entries.
      
      Fixes: 15d0e794 ("s390x/pci: don't fence interpreted devices without MSI-X")
      Signed-off-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Message-Id: <20221209195700.263824-1-mjrosato@linux.ibm.com>
      Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
      [thuth: Adjusted the hunk in s390-pci-vfio.c due to different context]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      03451953
    • Matthew Rosato's avatar
      s390x/pci: shrink DMA aperture to be bound by vfio DMA limit · df202e3f
      Matthew Rosato authored
      
      Currently, s390x-pci performs accounting against the vfio DMA
      limit and triggers the guest to clean up mappings when the limit
      is reached. Let's go a step further and also limit the size of
      the supported DMA aperture reported to the guest based upon the
      initial vfio DMA limit reported for the container (if less than
      than the size reported by the firmware/host zPCI layer).  This
      avoids processing sections of the guest DMA table during global
      refresh that, for common use cases, will never be used anway, and
      makes exhausting the vfio DMA limit due to mismatch between guest
      aperture size and host limit far less likely and more indicitive
      of an error.
      
      Signed-off-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Message-Id: <20221028194758.204007-4-mjrosato@linux.ibm.com>
      Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      df202e3f
    • Matthew Rosato's avatar
      s390x/pci: coalesce unmap operations · ef536007
      Matthew Rosato authored
      
      Currently, each unmapped page is handled as an individual iommu
      region notification.  Attempt to group contiguous unmap operations
      into fewer notifications to reduce overhead.
      
      Signed-off-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Message-Id: <20221028194758.204007-3-mjrosato@linux.ibm.com>
      Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      ef536007
    • Peter Maydell's avatar
      Merge tag 'pull-misc-2022-12-14' of https://repo.or.cz/qemu/armbru into staging · 48804eeb
      Peter Maydell authored
      Miscellaneous patches for 2022-12-14
      
      # gpg: Signature made Wed 14 Dec 2022 15:23:02 GMT
      # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
      # gpg:                issuer "armbru@redhat.com"
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * tag 'pull-misc-2022-12-14' of https://repo.or.cz/qemu/armbru
      
      :
        ppc4xx_sdram: Simplify sdram_ddr_size() to return
        block/vmdk: Simplify vmdk_co_create() to return directly
        cleanup: Tweak and re-run return_directly.cocci
        io: Tidy up fat-fingered parameter name
        qapi: Use returned bool to check for failure (again)
        sockets: Use ERRP_GUARD() where obviously appropriate
        qemu-config: Use ERRP_GUARD() where obviously appropriate
        qemu-config: Make config_parse_qdict() return bool
        monitor: Use ERRP_GUARD() in monitor_init()
        monitor: Simplify monitor_fd_param()'s error handling
        error: Move ERRP_GUARD() to the beginning of the function
        error: Drop a few superfluous ERRP_GUARD()
        error: Drop some obviously superfluous error_propagate()
        Drop more useless casts from void * to pointer
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      48804eeb
  2. Dec 14, 2022
Loading