mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
spapr_pci: Allow EEH on spapr-pci-host-bridge
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: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
parent
fbb4e98341
commit
c1fa017c7e
3 changed files with 12 additions and 10 deletions
|
@ -42,6 +42,8 @@
|
|||
#include "hw/ppc/spapr_drc.h"
|
||||
#include "sysemu/device_tree.h"
|
||||
|
||||
#include "hw/vfio/vfio.h"
|
||||
|
||||
/* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */
|
||||
#define RTAS_QUERY_FN 0
|
||||
#define RTAS_CHANGE_FN 1
|
||||
|
@ -92,13 +94,6 @@ PCIDevice *spapr_pci_find_dev(sPAPRMachineState *spapr, uint64_t buid,
|
|||
return pci_find_device(phb->bus, bus_num, devfn);
|
||||
}
|
||||
|
||||
static bool spapr_phb_eeh_available(sPAPRPHBState *sphb)
|
||||
{
|
||||
sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb);
|
||||
|
||||
return spc->eeh_available;
|
||||
}
|
||||
|
||||
static uint32_t rtas_pci_cfgaddr(uint32_t arg)
|
||||
{
|
||||
/* This handles the encoding of extended config space addresses */
|
||||
|
@ -1642,7 +1637,6 @@ static void spapr_phb_class_init(ObjectClass *klass, void *data)
|
|||
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
|
||||
dc->cannot_instantiate_with_device_add_yet = false;
|
||||
spc->finish_realize = spapr_phb_finish_realize;
|
||||
spc->eeh_available = false;
|
||||
hp->plug = spapr_phb_hot_plug_child;
|
||||
hp->unplug = spapr_phb_hot_unplug_child;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue