From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8AwQ-0003kK-2W for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:28:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8AwM-0007DI-0w for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:27:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8AwL-0007Cn-Rv for qemu-devel@nongnu.org; Thu, 25 Jun 2015 13:27:53 -0400 Message-ID: <558C3A13.2050702@redhat.com> Date: Thu, 25 Jun 2015 19:27:47 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4b8fc4d985de6c4f44509b9c47a6152add36d832.1435195913.git.zhugh.fnst@cn.fujitsu.com> <558C2583.1040501@suse.de> <558C2605.2070806@redhat.com> <558C27DF.5090800@suse.de> <558C343F.1090703@redhat.com> <558C357C.4030908@suse.de> In-Reply-To: <558C357C.4030908@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?= , qemu-devel@nongnu.org Cc: chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com, Zhu Guihua , ehabkost@redhat.com, izumi.taku@jp.fujitsu.com On 25/06/2015 19:08, Andreas F=E4rber wrote: > > I said "I think this patch is incorrect, because you do not install a > > separate address space for each CPU. Also, the CPU address space is > > only used with TCG so it should be guarded by "if (tcg_enabled())"." > >=20 > > By the way, now TCG _is_ installing a separate address space per CPU > > already, so the patch can simply guard the code with "if (tcg_enabled= ())". >=20 > Is the APIC MemoryRegion not used by KVM? It's used if the userspace LAPIC is. It's not used together with the kernel LAPIC (accesses really are trapped by the kernel). > Otherwise if we still need the > ugly code path for KVM, that's not much of an improvement here. >=20 > And is installing a separate address space per CPU for KVM difficult du= e > to kernel limitations, or is this just a few lines of QEMU code that Zh= u > or someone would need to write? :) It's basically impossible. Even though support for multiple address spaces is going to be in Linux 4.2, there are going to be just two: SMM and not SMM. You don't really want to do O(#cpus) stuff in KVM, where the number of CPUs can be 200 or more. TCG is okay because the #cpus is not really going to be more than 4-ish. Paolo