Bug 504273

Summary: qemu-system-ppc on ppc host fails with "no opcode defined"
Product: [Fedora] Fedora Reporter: Roman Rakus <rrakus>
Component: qemuAssignee: Glauber Costa <gcosta>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: dwmw2, gcosta, itamar, markmc, proski, rjones, tsmetana, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: ppc   
OS: Linux   
Fixed In Version: 0.10.5-3.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-06-19 09:43:29 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 480594    
Description Flags
patch, extracted from qemu git none

Description Roman Rakus 2009-06-05 07:27:00 EDT
Description of problem:

Version-Release number of selected component (if applicable):
[rrakus@localhost ~]$ rpm -q openbios-ppc

How reproducible:

Steps to Reproduce:
1. qemu-system-ppc -boot d -m 256 -hda rhel-5 -cdrom RHEL5.3-Server-20090106.0-ppc-DVD.iso -M prep
Actual results:
*** WARNING: no opcode defined !
invalid/unsupported opcode: 12 - 02 - 18 (4bfffe05) fffffffc 0
invalid/unsupported opcode: 00 - 00 - 00 (00000000) 00000700 0

Showing black screen.
qemu-system-ppc eating 95+% of CPU

Expected results:

Additional info:
Should be similar to bug #494075, but on ppc machine
Comment 1 Mark McLoughlin 2009-06-05 10:23:22 EDT
Thanks Roman

I assume this is qemu-system-ppc-0.10.5-2.fc11.ppc ?

Quoting what Pavel said in bug #494075:

  Note that the "WARNING" is absent on x86_64.  I believe it means that no
  opcodes are known to the emulator.  The invalid opcode is found at the
  position 0xfffffffc, which is the start address for PowerPC.  It comes from
  the .romentry section.

  Disassembling openbios-ppc with objdump gives:

  fffffffc <.romentry>:
  fffffffc:       4b f0 23 7d     bl      0xfff02378

  Thus, 4b f0 23 7d is a valid instruction, but qemu-system-ppc fails to
  interpret it.

Could you try debugging target-ppc/translate_init.c:create_ppc_opcodes() ? it should be filling the opcode table. Note opc_start and opc_end come from these macros:

Comment 2 Pavel Roskin 2009-06-07 21:27:54 EDT
I can reproduce the problem on qemu 0.10.5 without any Fedora patches.  However, the problem (the "WARNING" line) goes away if I compile ppc-softmmu/translate.c without optimization.  Still, qemu reports invalid opcodes:

$ ppc-softmmu/qemu-system-ppc -cdrom /dev/null                          
invalid/unsupported opcode: 00 - 18 - 01 (00004070) 00000004 1
invalid/unsupported opcode: 00 - 04 - 17 (000095c8) 000095ec 0

The same happens with real ISO images as well.  The same happens if the whole source is compiled without optimization.
Comment 3 Pavel Roskin 2009-06-07 21:55:07 EDT
Created attachment 346798 [details]
patch, extracted from qemu git

This patch helps with the "WARNING".  The invalid opcodes remain.
Comment 4 Pavel Roskin 2009-06-07 22:25:21 EDT
The current git version of qemu is booting to the openbios prompt.  So there might be another ppc fix to be backported.
Comment 5 Mark McLoughlin 2009-06-08 13:26:38 EDT
Thanks Pavel - we'll pull that patch into the next F-11 update

(In reply to comment #2)
> $ ppc-softmmu/qemu-system-ppc -cdrom /dev/null                          
> invalid/unsupported opcode: 00 - 18 - 01 (00004070) 00000004 1
> invalid/unsupported opcode: 00 - 04 - 17 (000095c8) 000095ec 0

Hmm, is this using the openbios-ppc from qemu.git ? Maybe try with -L /usr/share/qemu ?
Comment 6 Pavel Roskin 2009-06-08 18:09:31 EDT
No, it's qemu 0.10.5 compiled without optimization.  I copied the openbios files to the directory where qemu was looking for them, so it shouldn't be an issue.
Comment 7 Mark McLoughlin 2009-06-09 03:38:48 EDT
Okay, very strange - they're the exact same errors you resolved in bug #494075
Comment 8 Roman Rakus 2009-06-10 11:55:17 EDT
No I have updated to qemu-system-ppc-0.10.50-5.kvm86.fc12.ppc and problem is away...
Comment 9 Fedora Update System 2009-06-17 09:34:54 EDT
qemu-0.10.5-3.fc11 has been submitted as an update for Fedora 11.
Comment 10 Fedora Update System 2009-06-19 09:43:19 EDT
qemu-0.10.5-3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.