From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw2t4-00073H-3O for qemu-devel@nongnu.org; Tue, 10 Nov 2015 01:58:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zw2t0-0001HQ-Rf for qemu-devel@nongnu.org; Tue, 10 Nov 2015 01:58:38 -0500 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:35672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw2t0-0001HF-FW for qemu-devel@nongnu.org; Tue, 10 Nov 2015 01:58:34 -0500 Received: by pasz6 with SMTP id z6so232324093pas.2 for ; Mon, 09 Nov 2015 22:58:33 -0800 (PST) References: <1446678366-15082-1-git-send-email-sukadev@linux.vnet.ibm.com> <563FFD9C.7070407@ozlabs.ru> <20151110035757.GA20030@us.ibm.com> <564171C2.8040700@ozlabs.ru> <20151110044640.GA32368@us.ibm.com> From: Alexey Kardashevskiy Message-ID: <56419593.7010500@ozlabs.ru> Date: Tue, 10 Nov 2015 17:58:27 +1100 MIME-Version: 1.0 In-Reply-To: <20151110044640.GA32368@us.ibm.com> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sukadev Bhattiprolu Cc: stewart@linux.vnet.ibm.com, benh@au1.ibm.com, nacc@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, paulus@au1.ibm.com, david@gibson.dropbear.id.au On 11/10/2015 03:46 PM, Sukadev Bhattiprolu wrote: > Alexey Kardashevskiy [aik@ozlabs.ru] wrote: > > > | >| When exactly does a socket become a module? The SPAPR spec uses "sockets" here. > | > > | >I am trying to get the terminology too :-) Is socket a slot where a > | >module is attached? > | > | Sorry, no idea. > > Ok. > > | > | > | > > | >I will change the variable name 'modules' to 'sockets'. > | >| > | >| > | >| >+ modinfo->si[0].chips = chips; > | >| >+ modinfo->si[0].cores_per_chip = cores / chips; > | >| > | >| > | >| What if no "ibm,chip-id" was found and chips == 0? > | > > | >If we fail to readdir(xscom) or fail to read the 'ibm,chip-id', > | >we return an error which we check above. > | > | > | You assume that if there is /proc/device-tree, then there is always > | "xscom@" but this might not be always the case, like PR KVM on > | embedded PPC64. > > For ibm,chip-id, we do try to read the file (and eliminate duplicates No, you do not try reading "ibm,chip-id" if there is no "xscom@" under /proc/device-tree, there is "continue": + if (strncmp(xscom_prefix, ent->d_name, strlen(xscom_prefix))) { + continue; + } > chip ids) If we can't read the file (hash_table_add_contents()) we > return an error, but will check again. -- Alexey