qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/10] ppc: Fix rfi/rfid/hrfi/... emu


From: Cédric Le Goater
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/10] ppc: Fix rfi/rfid/hrfi/... emulation
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

On 06/19/2016 03:00 PM, Alexander Graf wrote:
> 
> 
>> Am 19.06.2016 um 14:49 schrieb Cédric Le Goater <address@hidden>:
>>
>>> 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 <address@hidden>
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 <address@hidden>
---
 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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]