ppc-for-2.8 queue 20161201
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(+)
[Qemu-devel] [PULL 1/1] spapr: fix default DRC state for coldplugged LMBs
From: Michael Roth <[email protected]>
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().
--- hw/ppc/spapr.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/ppc/spapr.c +5 -0
@@ -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
Signature · 1 line
2.9.3
Stefan Hajnoczi
AppliedQuoted 18 lines · 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.gittags/ppc-for-2.8-20161201for 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-01Just 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.
Quoted 6 lines
----------------------------------------------------------------
Michael Roth (1):
spapr: fix default DRC state for coldplugged LMBshw/ppc/spapr.c | 5 +++++ 1 file changed, 5 insertions(+)
Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging
Stefan