Received: from eggs.gnu.org ([2001:4830:134:3::10]:41416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcB3-0001Kg-FV for qemu-devel@nongnu.org; Wed, 26 Aug 2015 10:59:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUcAy-0007Is-Ge for qemu-devel@nongnu.org; Wed, 26 Aug 2015 10:59:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcAy-0007Im-CP for qemu-devel@nongnu.org; Wed, 26 Aug 2015 10:59:44 -0400 Date: Wed, 26 Aug 2015 11:59:40 -0300 From: Eduardo Habkost Message-ID: <20150826145940.GA4230@thinpad.lan.raisama.net> References: <27af0665bdcccc032cf477190cad35dd754fc4fb.1439877857.git.zhugh.fnst@cn.fujitsu.com> <20150821225459.GB5816@thinpad.lan.raisama.net> <55DA6B7B.2090408@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RESEND PATCH v9 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: Peter Maydell Cc: Zhu Guihua , Igor Mammedov , QEMU Developers , izumi.taku@jp.fujitsu.com, ChenFan , Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= On Mon, Aug 24, 2015 at 03:56:56PM +0100, Peter Maydell wrote: > On 24 August 2015 at 01:55, Paolo Bonzini wrote: > > > > > > On 21/08/2015 15:54, Eduardo Habkost wrote: > >> > + if (tcg_enabled()) { > >> > + memory_region_add_subregion_overlap(cpu->cpu_as_root, > >> > + apic->apicbase & > >> > + MSR_IA32_APICBASE_BASE, > >> > + &apic->io_memory, > >> > + 0x1000); > >> > >> Why exactly is this necessary? If this is necessary, why don't we need > >> to do this for non-TCG accelerators? > > > > At least KVM and qtest do not support per-CPU address spaces. > > Right, but given this restriction why can't we also do whatever > we need to work without the per-CPU address spaces with TCG? Yeah, that was my question. I know why we can't use cpu->cpu_as_root in KVM, but I don't understand why we need to use cpu->cpu_as_root with TCG. If that's really an actual per-accelerator requirement we can't avoid, I would prefer to implement it as an AccelClass method instead of a tcg_enabled() check. -- Eduardo