1. 19 5月, 2016 1 次提交
  2. 23 4月, 2016 1 次提交
    • T
      hw/ppc/spapr: Fix crash when specifying bad parameters to spapr-pci-host-bridge · da34fed7
      Thomas Huth 提交于
      QEMU currently crashes when using bad parameters for the
      spapr-pci-host-bridge device:
      
      $ qemu-system-ppc64 -device spapr-pci-host-bridge,buid=0x123,liobn=0x321,mem_win_addr=0x1,io_win_addr=0x10
      Segmentation fault
      
      The problem is that spapr_tce_find_by_liobn() might return NULL, but
      the code in spapr_populate_pci_dt() does not check for this condition
      and then tries to dereference this NULL pointer.
      Apart from that, the return value of spapr_populate_pci_dt() also
      has to be checked for all PCI buses, not only for the last one, to
      make sure we catch all errors.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      da34fed7
  3. 23 3月, 2016 2 次提交
    • P
      hw: explicitly include qemu-common.h and cpu.h · 4771d756
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4771d756
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  4. 16 3月, 2016 4 次提交
    • D
      spapr_pci: Remove finish_realize hook · a36304fd
      David Gibson 提交于
      Now that spapr-pci-vfio-host-bridge is reduced to just a stub, there is
      only one implementation of the finish_realize hook in sPAPRPHBClass.  So,
      we can fold that implementation into its (single) caller, and remove the
      hook.  That's the last thing left in sPAPRPHBClass, so that can go away as
      well.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      a36304fd
    • D
      spapr_pci: Allow EEH on spapr-pci-host-bridge · c1fa017c
      David Gibson 提交于
      Now that the EEH code is independent of the special
      spapr-vfio-pci-host-bridge device, we can allow it on all spapr PCI
      host bridges instead.  We do this by changing spapr_phb_eeh_available()
      to be based on the vfio_eeh_as_ok() call instead of the host bridge class.
      
      Because the value of vfio_eeh_as_ok() can change with devices being
      hotplugged or unplugged, this can potentially lead to some strange edge
      cases where the guest starts using EEH, then it starts failing because
      of a change in status.
      
      However, it's not really any worse than the current situation.  Cases that
      would have worked previously will still work (i.e. VFIO devices from at
      most one VFIO IOMMU group per vPHB), it's just that it's no longer
      necessary to use spapr-vfio-pci-host-bridge with the groupid pre-specified.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      c1fa017c
    • D
      spapr_pci: Eliminate class callbacks · fbb4e983
      David Gibson 提交于
      The EEH operations in the spapr-vfio-pci-host-bridge no longer rely on the
      special groupid field in sPAPRPHBVFIOState.  So we can simplify, removing
      the class specific callbacks with direct calls based on a simple
      spapr_phb_eeh_enabled() helper.  For now we implement that in terms of
      a boolean in the class, but we'll continue to clean that up later.
      
      On its own this is a rather strange way of doing things, but it's a useful
      intermediate step to further cleanups.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      fbb4e983
    • M
      spapr_pci: fix multifunction hotplug · 788d2599
      Michael Roth 提交于
      Since 3f1e1478, QEMU has adopted a convention of supporting function
      hotplug by deferring hotplug events until func 0 is hotplugged.
      This is likely how management tools like libvirt would expose
      such support going forward.
      
      Since sPAPR guests rely on per-func events rather than
      slot-based, our protocol has been to hotplug func 0 *first* to
      avoid cases where devices appear within guests without func 0
      present to avoid undefined behavior.
      
      To remain compatible with new convention, defer hotplug in a
      similar manner, but then generate events in 0-first order as we
      did in the past. Once func 0 present, fail any attempts to plug
      additional functions (as we do with PCIe).
      
      For unplug, defer unplug operations in a similar manner, but
      generate unplug events such that function 0 is removed last in guest.
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      788d2599
  5. 11 3月, 2016 1 次提交
  6. 28 2月, 2016 3 次提交
    • G
      xics: report errors with the QEMU Error API · a005b3ef
      Greg Kurz 提交于
      Using the return value to report errors is error prone:
      - xics_alloc() returns -1 on error but spapr_vio_busdev_realize() errors
        on 0
      - xics_alloc_block() returns the unclear value of ics->offset - 1 on error
        but both rtas_ibm_change_msi() and spapr_phb_realize() error on 0
      
      This patch adds an errp argument to xics_alloc() and xics_alloc_block() to
      report errors. The return value of these functions is a valid IRQ number
      if errp is NULL. It is undefined otherwise.
      
      The corresponding error traces get promotted to error messages. Note that
      the "can't allocate IRQ" error message in spapr_vio_busdev_realize() also
      moves to xics_alloc(). Similar error message consolidation isn't really
      applicable to xics_alloc_block() because callers have extra context (device
      config address, MSI or MSIX).
      
      This fixes the issues mentioned above.
      
      Based on previous work from Brian W. Hart.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      a005b3ef
    • G
      spapr_pci: fix irq leak in RTAS ibm,change-msi · ce266b75
      Greg Kurz 提交于
      This RTAS call is used to request new interrupts or to free all interrupts.
      
      If the driver has already allocated interrupts and asks again for a non-null
      number of irqs, then the rtas_ibm_change_msi() function will silently leak
      the previous interrupts.
      
      It happens because xics_free() is only called when the driver releases all
      interrupts (!req_num case). Note that the previously allocated spapr_pci_msi
      is not leaked because the GHashTable is created with destroy functions and
      g_hash_table_insert() hence frees the old value.
      
      This patch makes sure any previously allocated MSIs are released when a
      new allocation succeeds.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      ce266b75
    • G
      spapr_pci: kill useless variable in rtas_ibm_change_msi() · d4a63ac8
      Greg Kurz 提交于
      The num local variable is initialized to zero and has no writer.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d4a63ac8
  7. 29 1月, 2016 1 次提交
    • P
      ppc: Clean up includes · 0d75590d
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-6-git-send-email-peter.maydell@linaro.org
      0d75590d
  8. 23 10月, 2015 2 次提交
  9. 23 9月, 2015 5 次提交
  10. 11 9月, 2015 1 次提交
  11. 07 7月, 2015 9 次提交
  12. 23 6月, 2015 1 次提交
  13. 04 6月, 2015 9 次提交