From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8PW5-0004or-JD for qemu-devel@nongnu.org; Fri, 26 Jun 2015 05:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8PW0-00043C-Jy for qemu-devel@nongnu.org; Fri, 26 Jun 2015 05:01:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8PW0-000435-ET for qemu-devel@nongnu.org; Fri, 26 Jun 2015 05:01:40 -0400 Date: Fri, 26 Jun 2015 11:01:36 +0200 From: Igor Mammedov Message-ID: <20150626110136.4982ec7f@nial.brq.redhat.com> In-Reply-To: <558C3A13.2050702@redhat.com> 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> <558C3A13.2050702@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Paolo Bonzini Cc: Zhu Guihua , ehabkost@redhat.com, qemu-devel@nongnu.org, chen.fan.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com, Andreas =?UTF-8?B?RsOkcmJlcg==?= On Thu, 25 Jun 2015 19:27:47 +0200 Paolo Bonzini wrote: >=20 >=20 > On 25/06/2015 19:08, Andreas F=C3=A4rber 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? >=20 > It's used if the userspace LAPIC is. It's not used together with the > kernel LAPIC (accesses really are trapped by the kernel). Isn't this memory region still handle MSI MMIO in case of kernel LAPIC? kvm_apic_mem_write() -> kvm_irqchip_send_msi() >=20 > > 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 due > > to kernel limitations, or is this just a few lines of QEMU code that Zhu > > or someone would need to write? :) >=20 > 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. >=20 > TCG is okay because the #cpus is not really going to be more than 4-ish. >=20 > Paolo