From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWrgG-00014m-0i for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWrgE-0000nM-F6 for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:15:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56654 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWrgD-0000n3-VM for qemu-devel@nongnu.org; Mon, 29 Apr 2013 13:15:58 -0400 Message-ID: <517EAACC.8040709@suse.de> Date: Mon, 29 Apr 2013 19:15:56 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1367247776-7695-4-git-send-email-imammedo@redhat.com> <1367254981-29385-1-git-send-email-imammedo@redhat.com> In-Reply-To: <1367254981-29385-1-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=UTF-8 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: Igor Mammedov Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, ehabkost@redhat.com 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=C3=A4rber > --- > v3: > - fix compile error caused by mismerged hunk > v2: > - use icc-bridge from args instead of resolving it Thanks, applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu One question though... [...] > 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) { 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. :) Andreas > + /* 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 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg