diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2020-03-26 16:27:37 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2020-05-07 11:10:50 +1000 |
commit | 05af7c77f5f24ef2bec25f2cab22170c29edaf37 (patch) | |
tree | 41c6006f5019076b08b76dcd12271447c2dacc33 /hw | |
parent | beae5e9dc6eedc7d7fda333a3b71aa9f7e6b4a3f (diff) |
spapr: Don't allow unplug of NVLink2 devices
Currently, we can't properly handle unplug of NVLink2 devices, because we
don't have code to tear down their special memory resources. There's not
a lot of impetus to implement that: since hardware NVLink2 devices can't
be hot unplugged, the guest side drivers don't usually support unplug
anyway.
Therefore, simply prevent unplug of NVLink2 devices.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/spapr_pci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 55ca9dee1e..61b84a392d 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1665,6 +1665,10 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler, error_setg(errp, "PCI: Hot unplug of PCI bridges not supported"); return; } + if (object_property_get_uint(OBJECT(pdev), "nvlink2-tgt", NULL)) { + error_setg(errp, "PCI: Cannot unplug NVLink2 devices"); + return; + } /* ensure any other present functions are pending unplug */ if (PCI_FUNC(pdev->devfn) == 0) { |