Received: from eggs.gnu.org ([208.118.235.92]:59895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxFZ2-0000AP-Ld for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:29:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxFZ1-0006eq-GR for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:29:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxFZ1-0006eg-7t for qemu-devel@nongnu.org; Mon, 21 Jan 2013 06:29:19 -0500 Date: Mon, 21 Jan 2013 09:31:02 -0200 From: Eduardo Habkost Message-ID: <20130121113102.GC5914@otherpad.lan.raisama.net> References: <1358456378-29248-1-git-send-email-ehabkost@redhat.com> <1358456378-29248-8-git-send-email-ehabkost@redhat.com> <50FD241F.4050701@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50FD241F.4050701@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.4 07/12] target-i386/cpu: Introduce apic_id_for_cpu() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Igor Mammedov , qemu-devel@nongnu.org, Anthony Liguori On Mon, Jan 21, 2013 at 12:18:55PM +0100, Andreas F=E4rber wrote: > Am 17.01.2013 21:59, schrieb Eduardo Habkost: > > This function will be used by both the CPU initialization code and th= e > > fw_cfg table initialization code. > >=20 > > Later this function will be updated to generate APIC IDs according to > > the CPU topology. > >=20 > > Signed-off-by: Eduardo Habkost > > --- > > target-i386/cpu.c | 17 ++++++++++++++++- > > target-i386/cpu.h | 2 ++ > > 2 files changed, 18 insertions(+), 1 deletion(-) > >=20 > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > > index d1a14d5..d90789d 100644 > > --- a/target-i386/cpu.c > > +++ b/target-i386/cpu.c > > @@ -2194,6 +2194,21 @@ void x86_cpu_realize(Object *obj, Error **errp= ) > > cpu_reset(CPU(cpu)); > > } > > =20 > > +/* Calculates initial APIC ID for a specific CPU index > > + * > > + * Currently we need to be able to calculate the APIC ID from the CP= U index > > + * alone (without requiring a CPU object), as the QEMU<->Seabios int= erfaces have > > + * no concept of "CPU index", and the NUMA tables on fw_cfg need the= APIC ID of > > + * all CPUs up to max_cpus. > > + */ > > +uint32_t apic_id_for_cpu(unsigned int cpu_index) >=20 > Can we rather make this x86_cpu_apic_id(X86CPU *cpu) to account for > future changes to topology modelling? We can't make it get a X86CPU as parameter, because the ACPI tables have to be built up to max_cpus, before the CPUs get actually created. But it can be renamed, yes. --=20 Eduardo