From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkBWo-00088n-1V for qemu-devel@nongnu.org; Thu, 08 Oct 2015 09:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkBWj-0001ur-Si for qemu-devel@nongnu.org; Thu, 08 Oct 2015 09:46:37 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:46033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkBWj-0001uZ-4V for qemu-devel@nongnu.org; Thu, 08 Oct 2015 09:46:33 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Oct 2015 19:16:29 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 93A8EE005E for ; Thu, 8 Oct 2015 19:16:16 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t98DkCkN52756562 for ; Thu, 8 Oct 2015 19:16:14 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t98DkCqj004194 for ; Thu, 8 Oct 2015 19:16:12 +0530 Date: Thu, 8 Oct 2015 19:16:10 +0530 From: Bharata B Rao Message-ID: <20151008134610.GA30384@in.ibm.com> References: <1443538409-145558-1-git-send-email-imammedo@redhat.com> <1443538409-145558-2-git-send-email-imammedo@redhat.com> <20151008133109.GA29460@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151008133109.GA29460@in.ibm.com> Subject: Re: [Qemu-devel] [PATCH v3 1/2] memhp: extend address auto assignment to support gaps Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: pbonzini@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, david@gibson.dropbear.id.au, ehabkost@redhat.com On Thu, Oct 08, 2015 at 07:01:09PM +0530, Bharata B Rao wrote: > > @@ -333,13 +334,15 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, > > goto out; > > } > > > > - if (ranges_overlap(dimm->addr, dimm_size, new_addr, size)) { > > + if (ranges_overlap(dimm->addr, dimm_size, new_addr, > > + size + (gap ? 1 : 0))) { > > if (hint) { > > DeviceState *d = DEVICE(dimm); > > error_setg(errp, "address range conflicts with '%s'", d->id); > > goto out; > > } > > - new_addr = QEMU_ALIGN_UP(dimm->addr + dimm_size, align); > > + new_addr = QEMU_ALIGN_UP(dimm->addr + dimm_size + (gap ? 1 : 0), > > + align); > > This change of adding 1 byte gap will break PowerPC memory hotplug in > its current form. Sorry should have been explicit in saying that this will break PowerPC memory hotplug only if gap is enabled like I attempted here: https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg00749.html > > Currently we divide hotpluggable memory region into chuncks of 256M > and there is a DR connector object for each such chunk. The DR connector > object maintains/controls the state transitions of that memory chunk > as per PAPR specifications. > > Now after this 1 byte gap, we end up having a 64K alignment (default > page size) for the DIMM address and end up having an address for which > there is no DR connector object. I will have to revisit the parts of > the code in PowerPC that creates DR connector objects and looks them up > by address. > > Regards, > Bharata.