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
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));
_______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel