Received: from eggs.gnu.org ([2001:4830:134:3::10]:51133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRTsu-00016D-Rc for qemu-devel@nongnu.org; Sun, 24 Jul 2016 20:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRTsq-0001ZF-Tg for qemu-devel@nongnu.org; Sun, 24 Jul 2016 20:36:39 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRTsq-0001ZA-MP for qemu-devel@nongnu.org; Sun, 24 Jul 2016 20:36:36 -0400 Received: by mail-pf0-x241.google.com with SMTP id g202so10897281pfb.1 for ; Sun, 24 Jul 2016 17:36:36 -0700 (PDT) Sender: Richard Henderson References: <1469364141.8568.251.camel@kernel.crashing.org> <1469364697.8568.253.camel@kernel.crashing.org> <1469364745.8568.254.camel@kernel.crashing.org> From: Richard Henderson Message-ID: <5eede4b0-cc3a-c24f-5de4-8473220385f9@twiddle.net> Date: Mon, 25 Jul 2016 06:06:30 +0530 MIME-Version: 1.0 In-Reply-To: <1469364745.8568.254.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TCG problem with cpu_{st,ld}x_data ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt , qemu-devel@nongnu.org Cc: Paolo Bonzini , Christian Borntraeger On 07/24/2016 06:22 PM, Benjamin Herrenschmidt wrote: > 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()); > } > These functions would have to be always_inline for this to work. Otherwise you could get the helper's PC, not the TCG caller's PC. But let's try to fix this the other way. r~