diff options
author | Laurent Vivier <lvivier@redhat.com> | 2017-06-08 19:27:43 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-06-09 12:35:46 +1000 |
commit | 593080936a06a04eacc589350e3a7ebc02f2ed8e (patch) | |
tree | 3df21d93af35f33f5a6c41cad49cc093ad65c71d /hw/ppc | |
parent | b1fd36c363d73969841468146ebfb9fd84a5ee52 (diff) |
Revert "spapr: fix memory hot-unplugging"
This reverts commit fe6824d12642b005c69123ecf8631f9b13553f8b.
Conflicts hw/ppc/spapr_drc.c, because get_index() has been renamed
spapr_get_index().
This didn't fix the problem. Once the hotplug has been started
some memory is allocated and some structures are allocated.
We don't free it when we ignore the unplug, and we can't because
they can be in use by the kernel.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Tested-by: Daniel Barboza <danielhb@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr_drc.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 15ef67d398..5cb75bbf34 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -128,17 +128,6 @@ static uint32_t set_allocation_state(sPAPRDRConnector *drc, if (!drc->dev) { return RTAS_OUT_NO_SUCH_INDICATOR; } - if (drc->awaiting_release && drc->awaiting_allocation) { - /* kernel is acknowledging a previous hotplug event - * while we are already removing it. - * it's safe to ignore awaiting_allocation here since we know the - * situation is predicated on the guest either already having done - * so (boot-time hotplug), or never being able to acquire in the - * first place (hotplug followed by immediate unplug). - */ - drc->awaiting_allocation_skippable = true; - return RTAS_OUT_NO_SUCH_INDICATOR; - } } if (spapr_drc_type(drc) != SPAPR_DR_CONNECTOR_TYPE_PCI) { @@ -391,11 +380,9 @@ void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp) } if (drc->awaiting_allocation) { - if (!drc->awaiting_allocation_skippable) { - drc->awaiting_release = true; - trace_spapr_drc_awaiting_allocation(spapr_drc_index(drc)); - return; - } + drc->awaiting_release = true; + trace_spapr_drc_awaiting_allocation(spapr_drc_index(drc)); + return; } drc->dr_indicator = SPAPR_DR_INDICATOR_INACTIVE; @@ -418,7 +405,6 @@ void spapr_drc_detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp) } drc->awaiting_release = false; - drc->awaiting_allocation_skippable = false; g_free(drc->fdt); drc->fdt = NULL; drc->fdt_start_offset = 0; |