From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4U4p-0000xU-Ip for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:05:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4U4k-00078h-CU for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:05:23 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:56659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4U4j-00076r-Or for qemu-devel@nongnu.org; Mon, 15 Jun 2015 09:05:18 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jun 2015 18:35:12 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id D94E3125804F for ; Mon, 15 Jun 2015 18:37:42 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5FD59dT20578526 for ; Mon, 15 Jun 2015 18:35:09 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5FC6vYG005542 for ; Mon, 15 Jun 2015 17:36:58 +0530 Date: Mon, 15 Jun 2015 18:34:56 +0530 From: Bharata B Rao Message-ID: <20150615130456.GC30238@in.ibm.com> References: <1434099628-18102-1-git-send-email-bharata@linux.vnet.ibm.com> <1434099628-18102-3-git-send-email-bharata@linux.vnet.ibm.com> <20150615111759.32b66fc6@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150615111759.32b66fc6@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info 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, david@gibson.dropbear.id.au, qemu-devel@nongnu.org, ehabkost@redhat.com On Mon, Jun 15, 2015 at 11:17:59AM +0200, Igor Mammedov wrote: > On Fri, 12 Jun 2015 14:30:26 +0530 > Bharata B Rao wrote: > > > Start storing the (start_addr, size, nodeid) of the pc-dimm memory > > in numa_info so that this information can be used to lookup > > node by address. > > > > Signed-off-by: Bharata B Rao > > --- > > hw/mem/pc-dimm.c | 4 ++++ > > include/sysemu/numa.h | 10 ++++++++++ > > numa.c | 26 ++++++++++++++++++++++++++ > > 3 files changed, 40 insertions(+) > > > > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c > > index 98971b7..bb04862 100644 > > --- a/hw/mem/pc-dimm.c > > +++ b/hw/mem/pc-dimm.c > > @@ -97,6 +97,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms, > > > > memory_region_add_subregion(&hpms->mr, addr - hpms->base, mr); > > vmstate_register_ram(mr, dev); > > + numa_set_mem_node_id(addr, memory_region_size(mr), dimm->node); > > > > out: > > error_propagate(errp, local_err); > > @@ -105,6 +106,9 @@ out: > > void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms, > > MemoryRegion *mr) > > { > > + PCDIMMDevice *dimm = PC_DIMM(dev); > > + > > + numa_unset_mem_node_id(dimm->addr, memory_region_size(mr), dimm->node); > Wouldn't that cause pc-dimm range appear in SRAT table? I don't think so. numa_set_mem_node_id() and numa_unset_mem_node_id() APIs store/remove address range and node id information of realized pc-dimm device in/from a linked list in numa_info structure so that we can lookup the node id for a given address from numa.c in a self-contained manner. So unless I am missing something, I don't see this affecting ACPI/SRAT table in any way. > Before this pc-dimm-s are only added as ACPI devices but don't > advertised in SRAT ACPI table. > > Perhaps make it up to target to decide if it want's to > report dimms with numa_unset_mem_node_id() and not in generic code. Regards, Bharata.