[Top][All Lists]

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

Re: [Qemu-devel] [RFC PATCH v2] spapr: Ensure all LMBs are represented i

From: Bharata B Rao
Subject: Re: [Qemu-devel] [RFC PATCH v2] spapr: Ensure all LMBs are represented in ibm, dynamic-memory
Date: Mon, 6 Jun 2016 20:17:29 +0530
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 06, 2016 at 09:14:48AM -0500, Nathan Fontenot wrote:
> On 06/06/2016 06:37 AM, Bharata B Rao wrote:
> > Memory hotplug can fail for some combinations of RAM and maxmem when
> > DDW is enabled in the presence of devices like nec-usb-xhci. DDW depends
> > on maximum addressable memory returned by guest and this value is currently
> > being calculated wrongly by the guest kernel routine memory_hotplug_max().
> > While there is an attempt to fix the guest kernel, this patch works
> > around the problem within QEMU itself.
> > 
> > memory_hotplug_max() routine in the guest kernel arrives at max
> > addressable memory by multiplying lmb-size with the lmb-count obtained
> > from ibm,dynamic-memory property. There are two assumptions here:
> > 
> > - All LMBs are part of ibm,dynamic memory: This is not true for PowerKVM
> >   where only hot-pluggable LMBs are present in this property.
> > - The memory area comprising of RAM and hotplug region is contiguous: This
> >   needn't be true always for PowerKVM as there can be gap between
> >   boot time RAM and hotplug region.
> > 
> > To work around this guest kernel bug, ensure that ibm,dynamic-memory
> > has information about all the LMBs (RMA, boot-time LMBs, future
> > hotpluggable LMBs, and dummy LMBs to cover the gap between RAM and
> > hotpluggable region).
> > 
> > RMA is represented separately by address@hidden node. Hence mark RMA LMBs
> > and also the LMBs for the gap b/n RAM and hotpluggable region as
> > reserved so that these LMBs are not recounted/counted by guest.
> What does qemu do if a guest tries to add or remove a reserved LMB?

Currently in this approach, LMBs belonging two regions are marked as

- RMA region
- Gap b/n end of RAM and beginning of hotplug region

Any hotplug attempts to above regions will be refused by QEMU as they
don't fall under the hotplug memory region.

> Asking because the current guest code (drmgr and kernel) does not
> take the reserved flag into consideration when searching for lmbs to
> add/remove. This seems like something I should be fixed on the guest
> side.

Oh ok, but as I said earlier QEMU won't send hotplug request for such

However, I am seeing that when I mark RMA LMBs as reserved in
ibm,dynamic-memory and create separate address@hidden to represent RMA, guest is
just ignoring those LMBs and not doing double detection of RMA memory.

Same is true for the reserved LMBs that I put in ibm,dyanamic-memory
to cover the gap b/n RAM and hotplug region. Guest isn't not
considering this.

Do you still see any problems ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]