From patchwork Sun Jun 19 17:21:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 9186209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17D8A6075E for ; Sun, 19 Jun 2016 17:22:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 056D326538 for ; Sun, 19 Jun 2016 17:22:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDF5F27DD0; Sun, 19 Jun 2016 17:22:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0437F27DC2 for ; Sun, 19 Jun 2016 17:21:58 +0000 (UTC) Received: from localhost ([::1]:39516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEgQ0-0002ZG-I1 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 19 Jun 2016 13:21:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEgPb-0002XW-8r for qemu-devel@nongnu.org; Sun, 19 Jun 2016 13:21:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEgPU-0004p4-1r for qemu-devel@nongnu.org; Sun, 19 Jun 2016 13:21:31 -0400 Received: from 11.mo6.mail-out.ovh.net ([188.165.38.119]:51829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEgPT-0004o1-Oa for qemu-devel@nongnu.org; Sun, 19 Jun 2016 13:21:23 -0400 Received: from player786.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 9F7E9FF9733 for ; Sun, 19 Jun 2016 19:21:21 +0200 (CEST) Received: from [192.168.124.3] (LFbn-1-2234-107.w90-76.abo.wanadoo.fr [90.76.55.107]) (Authenticated sender: clg@kaod.org) by player786.ha.ovh.net (Postfix) with ESMTPSA id E3F798007A; Sun, 19 Jun 2016 19:21:14 +0200 (CEST) To: Alexander Graf References: <1465795496-15071-1-git-send-email-clg@kaod.org> <1465795496-15071-2-git-send-email-clg@kaod.org> <20160616010702.GI28087@voom.fritz.box> <20160617022731.GA19581@voom.fritz.box> <57639095.5010305@kaod.org> <576392B1.6030204@kaod.org> <5763A258.2010408@redhat.com> <5763D3EF.6060305@kaod.org> <5763D8D1.70701@redhat.com> <3258f4f3-6f5d-bb1f-9cac-2d19cac7ab53@kaod.org> <1466292910.24271.95.camel@kernel.crashing.org> <1ecfdda6-49a9-a737-80fd-a229c5a1fcf1@kaod.org> <3B48DA40-D79B-416A-84E7-4743F60C2657@suse.de> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Sun, 19 Jun 2016 19:21:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <3B48DA40-D79B-416A-84E7-4743F60C2657@suse.de> X-Ovh-Tracer-Id: 15317023810951088960 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekledrleefgdduudefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 188.165.38.119 Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/10] ppc: Fix rfi/rfid/hrfi/... emulation 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: Thomas Huth , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 06/19/2016 03:00 PM, Alexander Graf wrote: > > >> Am 19.06.2016 um 14:49 schrieb Cédric Le Goater : >> >>> On 06/19/2016 01:35 AM, Benjamin Herrenschmidt wrote: >>>> On Fri, 2016-06-17 at 16:32 +0200, Cédric Le Goater wrote: >>>> The instruction set PPC_POWER_BR contains nearly all the deleted >>>> instructions from isa2. rfi is not part of it and should. Also, only >>>> the cpus "PowerPC 601*" make a use of it in their insns_flags. >>> >>> Are you sure those arent the old POWER instructions as in pre-powerPC >>> architecture that 601 (and only 601) supports ? >> >> OK. I get it now. >> >> All the deleted instructions from POWER are/should be under the set >> PPC_POWER. >> >> All the deleted instructions from POWER2 are under the set PPC_POWER2. >> >> None of these sets are in use. >> >> >> For the "PowerPC 601*" cpus, we moved a couple from set PPC_POWER to >> subset PPC_POWER_BR. >> >> rfi is special. it is under PPC_FLOW and all CPUs can use it >> >>>> So, we would want this set to be in all the "PowerPC {6,7}*" cpus. >>>> Are there more ? >>> >>> All 32-bit hash based CPUs are arch 1.x and support rfi >>> >>> All 64-bit hash based CPUs we support (ie, POWER4 and later) are >>> architecture 2.x and later. >>> >>> So my test is correct in the context of what we emulate today. >> >> OK. so this is an openbios issue when run under a ppc64. shouldn't we >> be using an openbios-ppc64 in that case ? > > No, openbios can run on both. Just add a runtime check in openbios for rfi/rfid. OK. How's that for a start ? Seems to work. But, I could not boot ./darwinppc-602.cdr with on a 970. That might be another issue. Thanks, C. From: Cédric Le Goater Subject: [PATCH] ppc: use rfid when running under a CPU from the 970 family. Date: Sun, 19 Jun 2016 15:48:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Le Goater --- arch/ppc/qemu/start.S | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) Index: openbios.git/arch/ppc/qemu/start.S =================================================================== --- openbios.git.orig/arch/ppc/qemu/start.S +++ openbios.git/arch/ppc/qemu/start.S @@ -148,7 +148,20 @@ ll r31,(35 * ULONG_SIZE)(r1) ; \ .endif ; \ ll r1,(1 * ULONG_SIZE)(r1) ; /* restore stack at last */ \ - rfi + mtsprg1 r3 ; \ + mfpvr r3 ; \ + rlwinm r3,r3,16,16,31 ; \ + cmplwi cr1,r3,0x0039 ; /* 970 CPUs */ \ + beq- cr1,0f ; \ + cmplwi cr1,r3,0x003C ; /* 970fx CPUs */ \ + beq- cr1,0f ; \ + cmplwi cr1,r3,0x0044 ; /* 970mp CPUs */ \ + beq- cr1,0f ; \ + mfsprg1 r3 ; \ + rfi ; \ +0: ; \ + mfsprg1 r3 ; \ + rfid // PPC32