Received: from eggs.gnu.org ([140.186.70.92]:33818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3mRj-0005Fg-5h for qemu-devel@nongnu.org; Wed, 14 Sep 2011 06:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3mRh-0002JK-Md for qemu-devel@nongnu.org; Wed, 14 Sep 2011 06:11:59 -0400 References: <1315989802-18753-1-git-send-email-agraf@suse.de> <1315989802-18753-6-git-send-email-agraf@suse.de> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8G4) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: From: Alexander Graf Date: Wed, 14 Sep 2011 12:11:48 +0200 Subject: Re: [Qemu-devel] [PATCH 05/58] PPC: Add CPU local MMIO regions to MPIC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Blue Swirl , "qemu-ppc@nongnu.org" , qemu-devel Developers , Aurelien Jarno Am 14.09.2011 um 12:07 schrieb Peter Maydell : > On 14 September 2011 09:42, Alexander Graf wrote: >> The MPIC exports a register set for each CPU connected to it. They can al= l >> be accessed through specific registers or using a shadow page that is map= ped >> differently depending on which CPU accesses it. >>=20 >> This patch implements the shadow map, making it possible for guests to ac= cess >> the CPU local registers using the same address on each CPU. >=20 >> +static int get_current_cpu(void) >> +{ >> + return cpu_single_env->cpu_index; >> +} >=20 > This is the standard way of doing this (we use it on ARM as well), but > it's pretty clearly a hack. "which master sent this memory transaction" > is an attribute that ought to be passed down to the MMIO read/write > functions, really (along with other interesting things like "priv or > not?" and probably architecture specific attributes like ARM's > "secure/non-secure"); this matches how hardware does it where the > attributes are passed along as extra signals in the bus fabric. > (Sometimes hardware also does this by having buses from the different > cores be totally separate paths at the point where this kind of device > is connected, before merging together later; we don't really support > modelling that either :-)) >=20 > Not a nak, just an observation while I'm thinking about it. Yeah, I tend to agree in general. I'm not 100% sure in this case, as it's al= most an in-cpu device. But it would be nice to pass this information on the m= mio callbacks. However, right now this is the only way to do it, as we don't have the prett= y flexible one implemented yet ;). Alex >=20