From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vpK-0000bL-QJ for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:48:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9vpA-0000jc-Ft for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:48:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39079 helo=mx0b-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vpA-0000jI-6m for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:48:16 -0400 Received: from pps.filterd (m0048827.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u56EeNBK036991 for ; Mon, 6 Jun 2016 10:48:13 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0a-001b2d01.pphosted.com with ESMTP id 23d4rcf8uj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 06 Jun 2016 10:48:12 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Jun 2016 00:48:10 +1000 Date: Mon, 6 Jun 2016 20:17:29 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <1465213069-16578-1-git-send-email-bharata@linux.vnet.ibm.com> <57558558.8090401@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57558558.8090401@linux.vnet.ibm.com> Message-Id: <20160606144729.GC5343@in.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v2] spapr: Ensure all LMBs are represented in ibm, dynamic-memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nathan Fontenot Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au, mdroth@linux.vnet.ibm.com, aik@au1.ibm.com, qemu-ppc@nongnu.org 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 memory@0 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 reserved: - 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 LMBs. However, I am seeing that when I mark RMA LMBs as reserved in ibm,dynamic-memory and create separate memory@0 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 ? Regards, Bharata.