* [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201
@ 2016-12-01 4:44 David Gibson
2016-12-01 4:44 ` [Qemu-devel] [PULL 1/1] spapr: fix default DRC state for coldplugged LMBs David Gibson
2016-12-01 13:39 ` [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: David Gibson @ 2016-12-01 4:44 UTC (permalink / raw)
To: stefanha, peter.maydell; +Cc: agraf, mdroth, qemu-devel, qemu-ppc, David Gibson
The following changes since commit 1cd56fd2e14f67ead2f0458b4ae052f19865c41c:
Update version for v2.8.0-rc2 release (2016-11-29 22:26:25 +0000)
are available in the git repository at:
git://github.com/dgibson/qemu.git tags/ppc-for-2.8-20161201
for you to fetch changes up to 5c0139a8c2f01e068c96d456ecf12b0eeb707660:
spapr: fix default DRC state for coldplugged LMBs (2016-12-01 13:41:00 +1100)
----------------------------------------------------------------
ppc patch queue 2016-12-01
Just a single migration / hotplug fix in this set. I believe it's
important enough to go in this late in the 2.8 release process.
----------------------------------------------------------------
Michael Roth (1):
spapr: fix default DRC state for coldplugged LMBs
hw/ppc/spapr.c | 5 +++++
1 file changed, 5 insertions(+)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 1/1] spapr: fix default DRC state for coldplugged LMBs
2016-12-01 4:44 [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 David Gibson
@ 2016-12-01 4:44 ` David Gibson
2016-12-01 13:39 ` [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2016-12-01 4:44 UTC (permalink / raw)
To: stefanha, peter.maydell
Cc: agraf, mdroth, qemu-devel, qemu-ppc, David Gibson, Bharata B Rao,
Greg Kurz
From: Michael Roth <mdroth@linux.vnet.ibm.com>
Currently we set the initial isolation/allocation state for DRCs
associated with coldplugged LMBs to ISOLATED/UNUSABLE,
respectively, under the assumption that the guest will move this
state to UNISOLATED/USABLE.
In fact, this is only the case for LMBs added via hotplug. For
coldplugged LMBs, the guest actually assumes the initial state to
be UNISOLATED/USABLE.
In practice, this only becomes an issue when we attempt to unplug
one of these LMBs, where the guest kernel will issue an
rtas-get-sensor-state call to check that the corresponding DRC is
in an USABLE state before it will release the LMB back to
QEMU. If the returned state is otherwise, the guest will assume no
further action is needed, which bypasses the QEMU-side cleanup that
occurs during the USABLE->UNUSABLE transition. This results in
LMBs and their corresponding pc-dimm devices to stick around
indefinitely.
This patch fixes the issue by manually setting DRCs associated with
cold-plugged LMBs to UNISOLATED/ALLOCATED, but leaving the hotplug
state untouched. As it turns out, this is analogous to the handling
for cold-plugged CPUs in spapr_core_plug().
Cc: qemu-ppc@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c3269c7..208ef7b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2290,6 +2290,11 @@ static void spapr_add_lmbs(DeviceState *dev, uint64_t addr_start, uint64_t size,
drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
drck->attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);
addr += SPAPR_MEMORY_BLOCK_SIZE;
+ if (!dev->hotplugged) {
+ /* guests expect coldplugged LMBs to be pre-allocated */
+ drck->set_allocation_state(drc, SPAPR_DR_ALLOCATION_STATE_USABLE);
+ drck->set_isolation_state(drc, SPAPR_DR_ISOLATION_STATE_UNISOLATED);
+ }
}
/* send hotplug notification to the
* guest only in case of hotplugged memory
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201
2016-12-01 4:44 [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 David Gibson
2016-12-01 4:44 ` [Qemu-devel] [PULL 1/1] spapr: fix default DRC state for coldplugged LMBs David Gibson
@ 2016-12-01 13:39 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2016-12-01 13:39 UTC (permalink / raw)
To: David Gibson; +Cc: peter.maydell, agraf, mdroth, qemu-devel, qemu-ppc
[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]
On Thu, Dec 01, 2016 at 03:44:40PM +1100, David Gibson wrote:
> The following changes since commit 1cd56fd2e14f67ead2f0458b4ae052f19865c41c:
>
> Update version for v2.8.0-rc2 release (2016-11-29 22:26:25 +0000)
>
> are available in the git repository at:
>
> git://github.com/dgibson/qemu.git tags/ppc-for-2.8-20161201
>
> for you to fetch changes up to 5c0139a8c2f01e068c96d456ecf12b0eeb707660:
>
> spapr: fix default DRC state for coldplugged LMBs (2016-12-01 13:41:00 +1100)
>
> ----------------------------------------------------------------
> ppc patch queue 2016-12-01
>
> Just a single migration / hotplug fix in this set. I believe it's
> important enough to go in this late in the 2.8 release process.
>
> ----------------------------------------------------------------
> Michael Roth (1):
> spapr: fix default DRC state for coldplugged LMBs
>
> hw/ppc/spapr.c | 5 +++++
> 1 file changed, 5 insertions(+)
Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-01 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01 4:44 [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 David Gibson
2016-12-01 4:44 ` [Qemu-devel] [PULL 1/1] spapr: fix default DRC state for coldplugged LMBs David Gibson
2016-12-01 13:39 ` [Qemu-devel] [PULL 0/1] ppc-for-2.8 queue 20161201 Stefan Hajnoczi
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).