From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWry3-0002R6-J0 for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWry1-0006rd-8B for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:34:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWry1-0006rH-0O for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:34:21 -0400 Date: Mon, 29 Apr 2013 19:34:17 +0200 From: Igor Mammedov Message-ID: <20130429193417.51d25c12@thinkpad> In-Reply-To: <517EAACC.8040709@suse.de> References: <1367247776-7695-4-git-send-email-imammedo@redhat.com> <1367254981-29385-1-git-send-email-imammedo@redhat.com> <517EAACC.8040709@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/7 v8] target-i386: Move APIC to ICC bus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, ehabkost@redhat.com On Mon, 29 Apr 2013 19:15:56 +0200 Andreas F=E4rber wrote: > Am 29.04.2013 19:03, schrieb Igor Mammedov: > > It allows APIC to be hotplugged. > >=20 > > * map APIC's mmio at board level if it is present > > * do not register mmio region for each APIC, since > > only one is used/mapped > >=20 > > Signed-off-by: Igor Mammedov > > Signed-off-by: Andreas F=E4rber > > --- > > v3: > > - fix compile error caused by mismerged hunk > > v2: > > - use icc-bridge from args instead of resolving it >=20 > Thanks, applied to qom-cpu: > https://github.com/afaerber/qemu-cpu/commits/qom-cpu >=20 > One question though... >=20 > [...] > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > > index 658ff6c..6b3faac 100644 > > --- a/hw/i386/pc.c > > +++ b/hw/i386/pc.c > [...] > > @@ -929,14 +931,21 @@ void pc_cpus_init(const char *cpu_model, DeviceSt= ate *icc_bridge) > > } > > =20 > > for (i =3D 0; i < smp_cpus; i++) { > > - pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i), > > - icc_bridge, &error); > > + cpu =3D pc_new_cpu(cpu_model, x86_cpu_apic_id_from_index(i), > > + icc_bridge, &error); > > if (error) { > > fprintf(stderr, "%s\n", error_get_pretty(error)); > > error_free(error); > > exit(1); > > } > > } > > + > > + /* map APIC MMIO area if CPU has APIC */ > > + if (cpu && cpu->env.apic_state) { >=20 > Might sysbus_mmio_get_region(SYS_BUS_DEVICE(icc_bridge), 0) !=3D NULL be a > more straightforward guard? We're not accessing apic_state at all. :) it won't be NULL, it's icc_bridge's region that always exists. >=20 > Andreas >=20 > > + /* XXX: what if the base changes? */ > > + sysbus_mmio_map_overlap(SYS_BUS_DEVICE(icc_bridge), 0, > > + APIC_DEFAULT_ADDRESS, 0x1000); > > + } > > } > > =20 > > void pc_acpi_init(const char *default_dsdt) > [snip] >=20 >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg --=20 Regards, Igor