From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXaHK-00047F-1C for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXaHH-0002ft-VA for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:44:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34284 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXaHH-0002fF-Bg for qemu-devel@nongnu.org; Fri, 17 Jun 2011 10:44:07 -0400 From: Alexander Graf Date: Fri, 17 Jun 2011 16:43:57 +0200 Message-Id: <1308321844-11699-3-git-send-email-agraf@suse.de> In-Reply-To: <1308321844-11699-1-git-send-email-agraf@suse.de> References: <1308321844-11699-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/9] target-ppc: Handle memory-forced I/O controller access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org Developers" Cc: =?utf-8?q?Andreas=20F=C3=A4rber?= , =?utf-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno From: Herv=C3=A9 Poussineau On at least the PowerPC 601, a direct-store (T=3D1) with bus unit ID 0x07= F is special-cased as memory-forced I/O controller access. It is supposed to be checked immediately if T=3D1, bypassing all protection mechanisms and acting cache-inhibited and global. Signed-off-by: Herv=C3=A9 Poussineau Simplified by avoiding reindentation. Added explanatory comments. Cc: Alexander Graf Signed-off-by: Andreas F=C3=A4rber Signed-off-by: Alexander Graf --- target-ppc/helper.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index cf2a368..2944b06 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -949,8 +949,24 @@ static inline int get_segment(CPUState *env, mmu_ctx= _t *ctx, ret =3D -3; } } else { + target_ulong sr; LOG_MMU("direct store...\n"); /* Direct-store segment : absolutely *BUGGY* for now */ + + /* Direct-store implies a 32-bit MMU. + * Check the Segment Register's bus unit ID (BUID). + */ + sr =3D env->sr[eaddr >> 28]; + if ((sr & 0x1FF00000) >> 20 =3D=3D 0x07f) { + /* Memory-forced I/O controller interface access */ + /* If T=3D1 and BUID=3Dx'07F', the 601 performs a memory acc= ess + * to SR[28-31] LA[4-31], bypassing all protection mechanism= s. + */ + ctx->raddr =3D ((sr & 0xF) << 28) | (eaddr & 0x0FFFFFFF); + ctx->prot =3D PAGE_READ | PAGE_WRITE | PAGE_EXEC; + return 0; + } + switch (type) { case ACCESS_INT: /* Integer load/store : only access allowed */ --=20 1.6.0.2