qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized
@ 2005-05-14 17:20 Pierre d'Herbemont
  2005-05-14 18:15 ` J. Mayer
  0 siblings, 1 reply; 10+ messages in thread
From: Pierre d'Herbemont @ 2005-05-14 17:20 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

Hi,

I have been playing with ppc-darwin-user. And I have to say that qemu- 
ppc is too strict with ppc opcode validity:
On Mac OS X binary release called Tiger (or 10.4), the __bzero  
function [1] contains a mtcrf, which has been translated to  
0x7c901120, by Apple's as. Current qemu rejects it, saying it is  
invalid. According to the IBM Specification the mtcrf instruction  
[2], contains reserved flags, for which the values are unknown. qemu  
assumes that those are set to 1, which is obviously wrong. The  
attached patch provides a fix.

The mtcrf case might not be the only case in which such a situation  
occurs. That would need a special attention, though being strict is  
better than letting pass.

Pierre.

[1] http://fxr.watson.org/fxr/source/osfmk/ppc/commpage/bzero_32.s? 
v=DARWIN8#L98
[2] http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/ 
alangref/mtcrf.htm


[-- Attachment #2: qemu_mtcrf.diff.txt --]
[-- Type: text/plain, Size: 562 bytes --]

Index: target-ppc/translate.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v
retrieving revision 1.31
diff -u -r1.31 translate.c
--- target-ppc/translate.c	12 May 2005 18:46:11 -0000	1.31
+++ target-ppc/translate.c	14 May 2005 17:14:35 -0000
@@ -2123,7 +2123,7 @@
 }
 
 /* mtcrf */
-GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00100801, PPC_MISC)
+GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00000000, PPC_MISC)
 {
     gen_op_load_gpr_T0(rS(ctx->opcode));
     gen_op_store_cr(CRM(ctx->opcode));

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-05-18 10:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-14 17:20 [Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized Pierre d'Herbemont
2005-05-14 18:15 ` J. Mayer
2005-05-14 19:03   ` Pierre d'Herbemont
2005-05-15 12:00     ` J. Mayer
2005-05-16  7:54       ` Benjamin Herrenschmidt
2005-05-17 20:17         ` Pierre d'Herbemont
2005-05-17 21:10         ` J. Mayer
2005-05-18  9:06           ` Herbert Poetzl
2005-05-18 10:28             ` J. Mayer
     [not found]       ` <da63183705051610384e40c3de@mail.gmail.com>
     [not found]         ` <da631837050516110638c65163@mail.gmail.com>
2005-05-16 21:14           ` J. Mayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).