David Gibson 454b580ae9 spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state()
With some combinations of migration and hotplug we can lost temporary state
indicating how many DRCs (guest side hotplug handles) are still connected
to a DIMM object in the process of removal.  When we hit that situation
spapr_recover_pending_dimm_state() is used to scan more extensively and
work out the right number.

It does this using drc->indicator state to determine what state of
disconnection the DRC is in.  However, this is not safe, because the
indicator state is guest settable - in fact it's more-or-less a purely
guest->host notification mechanism which should have no bearing on the
internals of hotplug state management.

So, replace the test for this with a test on drc->dev, which is a purely
qemu side managed variable, and updated the same BQL critical section as
the indicator state.

This does introduce an off-by-one change, because the indicator state was
updated before the call to spapr_lmb_release() on the current DRC, whereas
drc->dev is updated afterwards.  That's corrected by always decrementing
the nr_lmbs value instead of only doing so in the case where we didn't
have to recover information.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2017-06-08 14:38:26 +10:00
..
2017-06-02 11:33:53 +04:00
2017-06-05 10:09:14 +01:00
2017-06-06 10:00:34 +01:00
2017-06-02 05:54:43 +01:00
2017-06-02 14:07:53 +01:00
2017-06-05 10:09:14 +01:00
2017-06-07 11:16:22 +01:00
2017-05-18 10:01:08 +01:00
2017-05-30 14:15:04 +01:00
2017-06-06 08:53:24 +10:00
2017-06-05 10:09:14 +01:00
2017-06-04 18:42:55 +03:00
2017-06-04 18:42:55 +03:00
2017-05-30 14:15:04 +01:00
2017-06-05 10:09:14 +01:00