[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] spapr: fix default DRC state for coldplugged LMBs



commit 5c0139a8c2f01e068c96d456ecf12b0eeb707660
Author:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Nov 30 17:05:34 2016 -0600
Commit:     David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
CommitDate: Thu Dec 1 13:41:00 2016 +1100

    spapr: fix default DRC state for coldplugged LMBs
    
    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@xxxxxxxxxx
    Cc: David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
    Cc: Bharata B Rao <bharata@xxxxxxxxxxxxxxxxxx>
    Cc: Greg Kurz <gkurz@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
---
 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
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.