From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z89bc-00058T-BB for qemu-devel@nongnu.org; Thu, 25 Jun 2015 12:02:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z89bW-0004LB-Tz for qemu-devel@nongnu.org; Thu, 25 Jun 2015 12:02:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z89bW-0004L1-Kt for qemu-devel@nongnu.org; Thu, 25 Jun 2015 12:02:18 -0400 Message-ID: <558C2605.2070806@redhat.com> Date: Thu, 25 Jun 2015 18:02:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4b8fc4d985de6c4f44509b9c47a6152add36d832.1435195913.git.zhugh.fnst@cn.fujitsu.com> <558C2583.1040501@suse.de> In-Reply-To: <558C2583.1040501@suse.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RESEND PATCH v8 1/4] apic: map APIC's MMIO region at each CPU's address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= , Zhu Guihua , qemu-devel@nongnu.org, ehabkost@redhat.com Cc: chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com, izumi.taku@jp.fujitsu.com On 25/06/2015 18:00, Andreas F=E4rber wrote: >> - if (!mmio_registered) { >> - ICCBus *b =3D ICC_BUS(qdev_get_parent_bus(dev)); >> - memory_region_add_subregion(b->apic_address_space, 0, &s->io_= memory); >> - mmio_registered =3D true; >> - } >> + >> + root =3D address_space_root_memory_region(cpu->as); >> + memory_region_add_subregion_overlap(root, >> + s->apicbase & MSR_IA32_APICBA= SE_BASE, >> + &s->io_memory, >> + 0x1000); >> =20 I had already remarked that this patch is wrong. cpu->as is completely unused on KVM, for example. Paolo