Received: from eggs.gnu.org ([2001:4830:134:3::10]:53832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNnbY-00055S-4t for qemu-devel@nongnu.org; Thu, 14 Jul 2016 16:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNnbW-0007WP-Sw for qemu-devel@nongnu.org; Thu, 14 Jul 2016 16:51:31 -0400 Date: Thu, 14 Jul 2016 17:51:19 -0300 From: Eduardo Habkost Message-ID: <20160714205119.GH31865@thinpad.lan.raisama.net> References: <1465580427-13596-1-git-send-email-drjones@redhat.com> <1465580427-13596-16-git-send-email-drjones@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465580427-13596-16-git-send-email-drjones@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC 15/16] smbios: don't use smp_cores, smp_threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Jones Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, peter.maydell@linaro.org, agraf@suse.de, pbonzini@redhat.com, dgibson@redhat.com, imammedo@redhat.com, david@gibson.dropbear.id.au On Fri, Jun 10, 2016 at 07:40:26PM +0200, Andrew Jones wrote: > SMBIOS needs cpu topology for Type4 tables, so we need to pass > it in. There are several parameters so we use a structure. There > are two callers (of non-legacy, which generates Type4 tables), > x86 and arm, so we also update both to pass the topology > parameters from their MachineState properties (directly in the > case of x86, indirectly through VirtGuestInfo in the case of arm). > > Signed-off-by: Andrew Jones [...] > @@ -701,12 +701,19 @@ static uint32_t x86_cpu_apic_id_from_index(MachineState *ms, > } > } > > -static void pc_build_smbios(FWCfgState *fw_cfg) > +static void pc_build_smbios(MachineState *ms, FWCfgState *fw_cfg) > { > uint8_t *smbios_tables, *smbios_anchor; > size_t smbios_tables_len, smbios_anchor_len; > struct smbios_phys_mem_area *mem_array; > unsigned i, array_count; > + struct smbios_cpu_topology topo = { > + .sockets = ms->sockets, > + .cores = ms->cores, > + .threads = ms->threads, > + .maxcpus = ms->maxcpus, > + .cpus = ms->cpus, > + }; > Do we really need to manually copy data around this way when smbios.c could just use qdev_get_machine() directly? -- Eduardo