From patchwork Mon Jun 13 10:13:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 100152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F2BE8B6FD3 for ; Mon, 13 Jun 2011 20:15:53 +1000 (EST) Received: from localhost ([::1]:50502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW4BQ-0008Kz-LW for incoming@patchwork.ozlabs.org; Mon, 13 Jun 2011 06:15:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW49P-0008Kq-3G for qemu-devel@nongnu.org; Mon, 13 Jun 2011 06:13:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW49N-0007Yu-IU for qemu-devel@nongnu.org; Mon, 13 Jun 2011 06:13:43 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:54897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW49N-0007Yc-CQ for qemu-devel@nongnu.org; Mon, 13 Jun 2011 06:13:41 -0400 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate02.web.de (Postfix) with ESMTP id 024D91A305BE6; Mon, 13 Jun 2011 12:13:40 +0200 (CEST) Received: from [87.173.123.177] (helo=af.local) by smtp06.web.de with asmtp (WEB.DE 4.110 #2) id 1QW49L-0008D3-00; Mon, 13 Jun 2011 12:13:39 +0200 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Mon, 13 Jun 2011 12:13:38 +0200 Message-Id: <1307960018-38235-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.5.3 MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1+08OMLxrYQ7UTAUVAnWZgdEn2SOSXurChsK5Zf h+NVwDOxTnURcZcnNUd784gSqMPuFgkwTXIac0Ug+9nj/rMesG 9VScKTXaCHHSXwgZpDFg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Alexander Graf Subject: [Qemu-devel] [PATCH RFC] target-ppc: Correctly handle translation address when bus unit ID = 0x07F X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Hervé Poussineau In that case, we want to access memory space instead of I/O controller interface address space. Signed-off-by: Hervé Poussineau Simplify by avoiding reindentation of existing code. Cc: Alexander Graf Signed-off-by: Andreas Färber --- Hello Alex, This patch fixes a hang when booting 40p, please review. The only vaguely related section in Power ISA 2.06B I could find was the Programming Note on p. 764 (5.7.1). 6xx_pem.pdf identifies the masked SR bits as Bus unit ID, says nothing about the 0x07f value though - might that be machine-specific? Andreas target-ppc/helper.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index cf2a368..cdf8d15 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -949,8 +949,18 @@ static inline int get_segment(CPUState *env, mmu_ctx_t *ctx, ret = -3; } } else { + target_ulong sr; LOG_MMU("direct store...\n"); /* Direct-store segment : absolutely *BUGGY* for now */ + + sr = env->sr[eaddr >> 28]; + if ((sr & 0x1FF00000) >> 20 == 0x07f) { + /* Memory forced */ + ctx->raddr = ((sr & 0xF) << 28) | (eaddr & 0x0FFFFFFF); + ctx->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; + return 0; + } + switch (type) { case ACCESS_INT: /* Integer load/store : only access allowed */