* [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 @ 2016-04-26 2:58 David Gibson 2016-04-26 2:58 ` [Qemu-devel] [PULL 1/1] spapr_drc: fix aborts during DRC-count based hotplug David Gibson 2016-04-28 10:05 ` [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 Peter Maydell 0 siblings, 2 replies; 3+ messages in thread From: David Gibson @ 2016-04-26 2:58 UTC (permalink / raw) To: peter.maydell; +Cc: agraf, qemu-devel, qemu-ppc, David Gibson The following changes since commit f419a626c76bcb26697883af702862e8623056f9: usb/uhci: move pid check (2016-04-25 12:05:05 +0100) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.6-20160426 for you to fetch changes up to df18b2db69fd1696e1f2eb1d8652340b4c57793a: spapr_drc: fix aborts during DRC-count based hotplug (2016-04-26 11:16:08 +1000) ---------------------------------------------------------------- ppc patch queue for 2016-04-26 (last minute qemu-2.6 fix) This just has one, last-minute, fix for a serious regression of memory hotplug. Patch author's comment: Really sorry for the way last-minute fix, but without this memory hotplug is totally broken :( Hoping to get this in for Wednesday's RC4, which I think will be the final before release. ---------------------------------------------------------------- Michael Roth (1): spapr_drc: fix aborts during DRC-count based hotplug hw/ppc/spapr_drc.c | 12 +++++++++++- hw/ppc/spapr_events.c | 7 +++---- 2 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 1/1] spapr_drc: fix aborts during DRC-count based hotplug 2016-04-26 2:58 [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 David Gibson @ 2016-04-26 2:58 ` David Gibson 2016-04-28 10:05 ` [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 Peter Maydell 1 sibling, 0 replies; 3+ messages in thread From: David Gibson @ 2016-04-26 2:58 UTC (permalink / raw) To: peter.maydell Cc: agraf, qemu-devel, qemu-ppc, Michael Roth, Bharata B Rao, david From: Michael Roth <mdroth@linux.vnet.ibm.com> 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. f40eb92 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: Bharata 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: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> --- hw/ppc/spapr_drc.c | 12 +++++++++++- hw/ppc/spapr_events.c | 7 +++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 3173940..1f5f1d7 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -364,7 +364,17 @@ static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, drc->fdt = fdt; drc->fdt_start_offset = fdt_start_offset; drc->configured = coldplug; - drc->signalled = coldplug; + /* 'logical' DR resources such as memory/cpus are in some cases treated + * as a pool of resources from which the guest is free to choose from + * based on only a count. for resources that can be assigned in this + * fashion, we must assume the resource is signalled immediately + * since a single hotplug request might make an arbitrary number of + * such attached resources available to the guest, as opposed to + * 'physical' DR resources such as PCI where each device/resource is + * signalled individually. + */ + drc->signalled = (drc->type != SPAPR_DR_CONNECTOR_TYPE_PCI) + ? true : coldplug; object_property_add_link(OBJECT(drc), "device", object_get_typename(OBJECT(drc->dev)), diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index 269ab7e..049fb1b 100644 --- a/hw/ppc/spapr_events.c +++ b/hw/ppc/spapr_events.c @@ -442,6 +442,9 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action, switch (drc_type) { case SPAPR_DR_CONNECTOR_TYPE_PCI: hp->hotplug_type = RTAS_LOG_V6_HP_TYPE_PCI; + if (hp->hotplug_action == RTAS_LOG_V6_HP_ACTION_ADD) { + spapr_hotplug_set_signalled(drc); + } break; case SPAPR_DR_CONNECTOR_TYPE_LMB: hp->hotplug_type = RTAS_LOG_V6_HP_TYPE_MEMORY; @@ -462,10 +465,6 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action, rtas_event_log_queue(RTAS_LOG_TYPE_HOTPLUG, new_hp, true); - if (hp->hotplug_action == RTAS_LOG_V6_HP_ACTION_ADD) { - spapr_hotplug_set_signalled(drc); - } - qemu_irq_pulse(xics_get_qirq(spapr->icp, spapr->check_exception_irq)); } -- 2.5.5 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 2016-04-26 2:58 [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 David Gibson 2016-04-26 2:58 ` [Qemu-devel] [PULL 1/1] spapr_drc: fix aborts during DRC-count based hotplug David Gibson @ 2016-04-28 10:05 ` Peter Maydell 1 sibling, 0 replies; 3+ messages in thread From: Peter Maydell @ 2016-04-28 10:05 UTC (permalink / raw) To: David Gibson; +Cc: Alexander Graf, QEMU Developers, qemu-ppc@nongnu.org On 26 April 2016 at 03:58, David Gibson <david@gibson.dropbear.id.au> wrote: > The following changes since commit f419a626c76bcb26697883af702862e8623056f9: > > usb/uhci: move pid check (2016-04-25 12:05:05 +0100) > > are available in the git repository at: > > git://github.com/dgibson/qemu.git tags/ppc-for-2.6-20160426 > > for you to fetch changes up to df18b2db69fd1696e1f2eb1d8652340b4c57793a: > > spapr_drc: fix aborts during DRC-count based hotplug (2016-04-26 11:16:08 +1000) > > ---------------------------------------------------------------- > ppc patch queue for 2016-04-26 (last minute qemu-2.6 fix) > > This just has one, last-minute, fix for a serious regression of memory > hotplug. > > Patch author's comment: > Really sorry for the way last-minute fix, but without this memory > hotplug is totally broken :( Hoping to get this in for Wednesday's > RC4, which I think will be the final before release. > > ---------------------------------------------------------------- Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-28 10:05 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-04-26 2:58 [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 David Gibson 2016-04-26 2:58 ` [Qemu-devel] [PULL 1/1] spapr_drc: fix aborts during DRC-count based hotplug David Gibson 2016-04-28 10:05 ` [Qemu-devel] [PULL 0/1] ppc-for-2.6 queue 20160426 Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).