From patchwork Sun Jul 24 12:52:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 652091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ry4916xDYz9sR9 for ; Sun, 24 Jul 2016 22:54:45 +1000 (AEST) Received: from localhost ([::1]:55985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRIvb-0005hq-Mq for incoming@patchwork.ozlabs.org; Sun, 24 Jul 2016 08:54:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRIta-000490-Lg for qemu-devel@nongnu.org; Sun, 24 Jul 2016 08:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRItW-0001QN-Hv for qemu-devel@nongnu.org; Sun, 24 Jul 2016 08:52:37 -0400 Received: from gate.crashing.org ([63.228.1.57]:47575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRItW-0001QI-8X for qemu-devel@nongnu.org; Sun, 24 Jul 2016 08:52:34 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u6OCqQwW011919; Sun, 24 Jul 2016 07:52:28 -0500 Message-ID: <1469364745.8568.254.camel@kernel.crashing.org> From: Benjamin Herrenschmidt To: qemu-devel@nongnu.org Date: Sun, 24 Jul 2016 22:52:25 +1000 In-Reply-To: <1469364697.8568.253.camel@kernel.crashing.org> References: <1469364141.8568.251.camel@kernel.crashing.org> <1469364697.8568.253.camel@kernel.crashing.org> X-Mailer: Evolution 3.20.4 (3.20.4-1.fc24) Mime-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by gate.crashing.org id u6OCqQwW011919 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 63.228.1.57 Subject: Re: [Qemu-devel] TCG problem with cpu_{st,ld}x_data ? X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Christian Borntraeger , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On Sun, 2016-07-24 at 22:51 +1000, Benjamin Herrenschmidt wrote: >  > FYI: This probably completely wrong patch (but it was easier than > hacking all the helpers) fixed the problem for me. With this (and the > video driver I wrote that I will publish asap), I can now reliably > boot > various versions of MacOS X in qemu ppc using a 7400 CPU. And here's the patch: diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index eaf69a1..13e8881 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -111,7 +111,7 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, static inline RES_TYPE glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) { - return glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(env, ptr, 0); + return glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(env, ptr, GETPC()); } #if DATA_SIZE <= 2 @@ -149,7 +149,7 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, static inline int glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) { - return glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(env, ptr, 0); + return glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(env, ptr, GETPC()); } #endif @@ -191,7 +191,7 @@ static inline void glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr, RES_TYPE v) { - glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(env, ptr, v, 0); + glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(env, ptr, v, GETPC()); } #endif /* !SOFTMMU_CODE_ACCESS */