On 8/22/19 2:59 PM, Daniel Henrique Barboza wrote: > There is nothing wrong with how sPAPR handles multifunction PCI > hot unplugs. The problem is that x86 does it simpler. Instead of > removing each non-zero function and then removing function zero, > x86 can remove any function of the slot to trigger the hot unplug. >
> +++ b/hw/ppc/spapr_pci.c > @@ -1700,11 +1700,13 @@ static void spapr_pci_unplug_request(HotplugHandler > *plug_handler, > state = func_drck->dr_entity_sense(func_drc); > if (state == SPAPR_DR_ENTITY_SENSE_PRESENT > && !spapr_drc_unplug_requested(func_drc)) { > - error_setg(errp, > - "PCI: slot %d, function %d still present. " > - "Must unplug all non-0 functions first.", > - slotnr, i); > - return; > + /* > + * Attempting to remove function 0 of a multifunction > + * device will will cascade into removing all child > + * functions, even if their unplug weren't requested s/weren't/wasn't/ > + * beforehand. > + */ > + spapr_drc_detach(func_drc); > } > } > } > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature