• M
    spapr_drc: fix aborts during DRC-count based hotplug · df18b2db
    Michael Roth 提交于
    CPU/memory resources can be signalled en-masse via
    spapr_hotplug_req_add_by_count(), and when doing so, actually change
    the meaning of the 'drc' parameter passed to
    spapr_hotplug_req_event() to be a count rather than an index.
    
    f40eb921 added a hook in spapr_hotplug_req_event() to record when a
    device had been 'signalled' to the guest, but that code assumes that
    drc is always an index. In cases where it's a count, such as memory
    hotplug, the DRC lookup will fail, leading to an assert.
    
    Fix this by only explicitly setting the signalled state for cases where
    we are doing PCI hotplug.
    
    For other resources types, since we cannot selectively track whether a
    resource has been signalled in cases where we signal attach as a count,
    set the 'signalled' state to true immediately upon making the
    resource available via drck->attach().
    Reported-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
    Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
    Cc: david@gibson.dropbear.id.au
    Cc: qemu-ppc@nongnu.org
    Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    df18b2db
spapr_events.c 21.8 KB