Booting error on AIX 6.1 "Illegal Trap Instruction Interrupt in Kernel"" # ls -ltr total 8750584 -rw-rw-r-- 1 linux linux 4274997248 Oct 4 18:33 AIX.vol1.iso -rw-rw-r-- 1 linux linux 4293888000 Oct 4 18:45 AIX.vol2.iso -rw-rw-r-- 1 linux linux 391485440 Oct 4 18:50 AIX.vol3.iso -rw-r--r-- 1 root root 204608 Oct 4 19:00 AIX61.img # qemu-system-ppc64 -cpu POWER8,compat=power7 -machine pseries -m 8192 -serial mon:stdio \ > -drive file=/qemu/BST/AIX61.img,if=none,id=drive-virtio-disk0 \ > -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \ > -cdrom /qemu/BST/AIX.vol1.iso \ > -prom-env boot-command='boot cdrom: -s verbose' VNC server running on ::1:5900 qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround SLOF ********************************************************************** QEMU Starting Build Date = Jul 3 2019 12:26:14 FW Version = git-ba1ab360eebe6338 Press "s" to enter Open Firmware. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /vdevice/l-lan@71000002 Populating /vdevice/v-scsi@71000003 SCSI: Looking for devices 8200000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+" Populating /pci@800000020000000 00 0000 (D) : 1234 1111 qemu vga 00 0800 (D) : 1033 0194 serial bus [ usb-xhci ] 00 1000 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@2 SCSI: Looking for devices 100000000000000 DISK : "QEMU QEMU HARDDISK 2.5+" Installing QEMU fb Scanning USB XHCI: Initializing USB Keyboard USB mouse No console specified using screen & keyboard Welcome to Open Firmware Copyright (c) 2004, 2017 IBM Corporation All rights reserved. This program and the accompanying materials are made available under the terms of the BSD License available at http://www.opensource.org/licenses/bsd-license.php Trying to load: -s verbose from: /vdevice/v-scsi@71000003/disk@8200000000000000: ... Successfully loaded qemu-system-ppc64: Couldn't negotiate a suitable PVR during CAS AIX StarLED{814} AIX Version 6.1 exec(/etc/init){1,0} INIT: EXECUTING /sbin/rc.boot 1 exec(/usr/bin/sh,-c,/sbin/rc.boot 1){1114146,1} exec(/sbin/rc.boot,/sbin/rc.boot,1){1114146,1} + PHASE=1 + + bootinfo -p exec(/usr/sbin/bootinfo,-p){1179684,1114146} PLATFORM=chrp + [ ! -x /usr/lib/boot/bin/bootinfo_chrp ] + [ 1 -eq 1 ] + 1> /usr/lib/libc.a + init -c unlink /usr/lib/boot/bin/!(*_chrp) exec(/etc/init,-c,unlink /usr/lib/boot/bin/!(*_chrp)){1179686,1114146} + chramfs -t exec(/usr/sbin/chramfs,-t){1179688,1114146} + init -c unlink /usr/sbin/chramfs + 1> /dev/null exec(/etc/init,-c,unlink /usr/sbin/chramfs){1179690,1114146} + + bootinfo -t exec(/usr/sbin/bootinfo,-t){1179692,1114146} BOOTYPE=3 + [ 0 -ne 0 ] + [ -z 3 ] + unset pdev_to_ldev undolt native_netboot_cfg + unset disknet_odm_init config_ATM + /usr/lib/methods/showled 0x510 DEV CFG 1 START exec(/usr/lib/methods/showled,0x510,DEV CFG 1 START){1179694,1114146} + cfgmgr -f -v exec(/usr/sbin/cfgmgr,-f,-v){1179696,1114146} cfgmgr is running in phase 1 ---------------- Time: 0 LEDS: 0x538 Invoking top level program -- "/etc/methods/defsys" exec(/bin/sh,-c,/etc/methods/defsys ){1245222,1179696} exec(/etc/methods/defsys){1245222,1179696} exec(/bin/sh,-c,/usr/lib/methods/define_rspc -n -c sys -s node -t chrp){1310760,1245222} exec(/usr/lib/methods/define_rspc,-n,-c,sys,-s,node,-t,chrp){1310760,1245222} Time: 0 LEDS: 0x539 Return code = 0 ***** stdout ***** sys0 *** no stderr **** ---------------- Attempting to configure device 'sys0' Time: 0 LEDS: 0x811 Invoking /usr/lib/methods/cfgsys_chrp -1 -l sys0 exec(/bin/sh,-c,/usr/lib/methods/cfgsys_chrp -1 -l sys0){1245224,1179696} Number of running methods: 1 exec(/usr/lib/methods/cfgsys_chrp,-1,-l,sys0){1245224,1179696} LED{A20} Illegal Trap Instruction Interrupt in Kernel 04151A74 tweqi r0,0 r0=0 KDB(0)> Did this used to work for you in older versions of QEMU, or is it a new bug (i.e. a regression)? AFAIK running AIX in QEMU has never worked so far... I only tried this with the last version of QEMU using an AIX image generated from a running AIX server using mksysb. There are some limitations but an AIX guest can run in QEMU: https://www.ibm.com/support/knowledgecenter/ssw_aix_72/aixnutanix/nutanix_concepts.html The command line in the bug description uses an old syntax: # qemu-system-ppc64 -cpu POWER8,compat=power7 -machine pseries ... This should be: # qemu-system-ppc64 -cpu POWER8 -machine pseries,max-cpu-compat=power7 The following error message seems to indicate that this AIX instance doesn't support POWER7 architected mode (which I don't think is actively tested and supported by the way). qemu-system-ppc64: Couldn't negotiate a suitable PVR during CAS Maybe try again with max-cpu-compat=power8 instead ? If you want to debug this, it'd be helpful to know few instructions/registers before the TRAP: Illegal Trap Instruction Interrupt in Kernel 04151A74 tweqi r0,0 r0=0 KDB(0)> A quicker way might be running QEMU with '-d unimp' to display missing devices/SPAPR hcalls. # qemu-system-ppc64 -cpu POWER8 -machine pseries,max-cpu-compat=power7 -m 8G -d unimp -serial stdio \ -prom-env boot-command='boot cdrom: -s verbose'> -drive file=/qemu/AIX61.img,if=none,id=drive-virtio-disk0 \ > -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 \ > -cdrom /qemu/AIX.vol1.iso \ > -prom-env boot-command='boot cdrom: -s verbose' VNC server running on ::1:5900 qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround SLOF ********************************************************************** QEMU Starting Build Date = Jul 3 2019 12:26:14 FW Version = git-ba1ab360eebe6338 Press "s" to enter Open Firmware. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /vdevice/l-lan@71000002 Populating /vdevice/v-scsi@71000003 SCSI: Looking for devices 8200000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+" Populating /pci@800000020000000 00 0000 (D) : 1234 1111 qemu vga 00 0800 (D) : 1033 0194 serial bus [ usb-xhci ] 00 1000 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@2 SCSI: Looking for devices 100000000000000 DISK : "QEMU QEMU HARDDISK 2.5+" Installing QEMU fb Scanning USB XHCI: Initializing USB Keyboard USB mouse No console specified using screen & keyboard Welcome to Open Firmware Copyright (c) 2004, 2017 IBM Corporation All rights reserved. This program and the accompanying materials are made available under the terms of the BSD License available at http://www.opensource.org/licenses/bsd-license.php Trying to load: -s verbose from: /vdevice/v-scsi@71000003/disk@8200000000000000: ... Successfully loaded qemu-system-ppc64: Couldn't negotiate a suitable PVR during CAS AIX Unimplemented SPAPR hcall 0x00000000000000ec StarUnimplemented SPAPR hcall 0x00000000000000ec LED{814} AIX Version 6.1 exec(/etc/init){1,0} INIT: EXECUTING /sbin/rc.boot 1 exec(/usr/bin/sh,-c,/sbin/rc.boot 1){1114146,1} Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 exec(/sbin/rc.boot,/sbin/rc.boot,1){1114146,1} Unimplemented SPAPR hcall 0x00000000000002b8 + PHASE=1 + + bootinfo -p exec(/usr/sbin/bootinfo,-p){1179684,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 PLATFORM=chrp + [ ! -x /usr/lib/boot/bin/bootinfo_chrp ] + [ 1 -eq 1 ] + 1> /usr/lib/libc.a + init -c unlink /usr/lib/boot/bin/!(*_chrp) Unimplemented SPAPR hcall 0x00000000000002b8 exec(/etc/init,-c,unlink /usr/lib/boot/bin/!(*_chrp)){1179686,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 + chramfs -t exec(/usr/sbin/chramfs,-t){1179688,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 + init -c unlink /usr/sbin/chramfs + 1> /dev/null exec(/etc/init,-c,unlink /usr/sbin/chramfs){1179690,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 + + bootinfo -t exec(/usr/sbin/bootinfo,-t){1179692,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 BOOTYPE=3 + [ 0 -ne 0 ] + [ -z 3 ] + unset pdev_to_ldev undolt native_netboot_cfg + unset disknet_odm_init config_ATM + /usr/lib/methods/showled 0x510 DEV CFG 1 START Unimplemented SPAPR hcall 0x00000000000002b8 exec(/usr/lib/methods/showled,0x510,DEV CFG 1 START){1179694,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 + cfgmgr -f -v exec(/usr/sbin/cfgmgr,-f,-v){1179696,1114146} Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 cfgmgr is running in phase 1 ---------------- Time: 0 LEDS: 0x538 Invoking top level program -- "/etc/methods/defsys" exec(/bin/sh,-c,/etc/methods/defsys ){1245222,1179696} Unimplemented SPAPR hcall 0x00000000000002b8 exec(/etc/methods/defsys){1245222,1179696} Unimplemented SPAPR hcall 0x00000000000002b8 exec(/bin/sh,-c,/usr/lib/methods/define_rspc -n -c sys -s node -t chrp){1310760,1245222} Unimplemented SPAPR hcall 0x00000000000002b8 exec(/usr/lib/methods/define_rspc,-n,-c,sys,-s,node,-t,chrp){1310760,1245222} Unimplemented SPAPR hcall 0x00000000000002b8 Time: 0 LEDS: 0x539 Return code = 0 ***** stdout ***** sys0 *** no stderr **** Unimplemented SPAPR hcall 0x00000000000002b8 ---------------- Attempting to configure device 'sys0' Time: 0 LEDS: 0x811 Invoking /usr/lib/methods/cfgsys_chrp -1 -l sys0 exec(/bin/sh,-c,/usr/lib/methods/cfgsys_chrp -1 -l sys0){1245224,1179696} Number of running methods: 1 Unimplemented SPAPR hcall 0x00000000000002b8 exec(/usr/lib/methods/cfgsys_chrp,-1,-l,sys0){1245224,1179696} Unimplemented SPAPR hcall 0x00000000000002b8 LED{A20} Illegal Trap Instruction Interrupt in Kernel 04151A74 tweqi r0,0 r0=0 KDB(0)> KDB(0)> stack pvthread+002100 STACK: [04151A74]init_extint_chrp+0001B4 (0000000000000000 [??]) [0415030C]config_pal+00004C (??) [04152D9C]config_chrp_pal@AF31_1+00009C (??, ??) [00665BBC]config_kmod+0000DC (??, ??, ??) [00666650]sysconfig+0001F0 (??, ??, ??) [00003850]ovlya_addr_sc_flih_main+000130 () [10004D48]cfgpal_chrp+0004A8 (??) [100045AC]configure_device+00004C () [100011B4]make_dvc_available+000034 () [10000568]main+000248 (??, ??, ??) [10000168]__start+000068 () KDB(0)> The "tweqi r0,0 r0=0" is likely an assert() in the AIX code IIRC. Not sure it helps to see previous instructions. About "Unimplemented SPAPR hcall 0x00000000000002b8": arch/powerpc/include/asm/hvcall.h:#define H_GET_EM_PARMS 0x2B8 and indeed QEMU doesn't implement this hcall. I've just realized this is AIX 6.1, which is so old that I'm pretty sure it doesn't run under QEMU. And anyway, you need AIX 7.2 to have support for virtio devices. I saw comments about support for virtio devices on AIX 7.2, was it not available on AIX 7.1? With AIX 7.1 also, I am getting similar issue as faced by other users with AIX 6.1. qemu-system-ppc64 -cpu POWER8 -machine pseries -m 2048 -d unimp -serial stdio -drive file=disk.img,if=none,id=drive-virtio-disk0 -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 -cdrom AIX_7.1.iso -prom-env "boot-command=boot cdrom:" qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-cfpc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-sbbc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ccf-assist=on VNC server running on 127.0.0.1:5900 SLOF ********************************************************************** QEMU Starting Build Date = Jul 17 2020 11:15:24 FW Version = git-e18ddad8516ff2cf Press "s" to enter Open Firmware. Populating /vdevice methods Populating /vdevice/vty@71000000 Populating /vdevice/nvram@71000001 Populating /vdevice/l-lan@71000002 Populating /vdevice/v-scsi@71000003 SCSI: Looking for devices 8200000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+" Populating /pci@800000020000000 00 0000 (D) : 1234 1111 qemu vga 00 0800 (D) : 1033 0194 serial bus [ usb-xhci ] 00 1000 (D) : 1af4 1004 virtio [ scsi ] Populating /pci@800000020000000/scsi@2 SCSI: Looking for devices 100000000000000 DISK : "QEMU QEMU HARDDISK 2.5+" Installing QEMU fb Scanning USB XHCI: Initializing USB Keyboard USB mouse No console specified using screen & keyboard Welcome to Open Firmware Copyright (c) 2004, 2017 IBM Corporation All rights reserved. This program and the accompanying materials are made available under the terms of the BSD License available at http://www.opensource.org/licenses/bsd-license.php Trying to load: from: /vdevice/v-scsi@71000003/disk@8200000000000000: ... Successfully loaded AIX StarUnimplemented SPAPR hcall 0x00000000000000ec AIX Version 7.1 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Unimplemented SPAPR hcall 0x00000000000002b8 Illegal Trap Instruction Interrupt in Kernel 05861AAC tweqi r0,0 r0=0 KDB(0)> I no longer work for IBM so I can't be sure, but I'm not aware of virtio support in AIX 7.1. As said in another comment, the "Unimplemented SPAPR hcall 0x00000000000002b8" trace reflects that QEMU doesn't implement PEM (Partition Energy Management) as described in section 14.14 of LoPAPR. I can't tell if this causing the crash of the AIX kernel, but I'd suggest you try with AIX 7.2. The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now. If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or please mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience. Hello, I just wanted to confirm that this bug also affects me and that it also appears in qemu 6.0.0. When I try to boot up AIX 7.1 (and 6.1 as well), it prints the following line multiple times during boot: Unimplemented SPAPR hcall 0x00000000000002b8 followed by crash: Illegal Trap Instruction Interrupt in Kernel 05861AAC tweqi r0,0 r0=0 I executed the following command to start qemu: qemu-system-ppc64 -cpu POWER8 -machine pseries,max-cpu-compat=power7 -m 4096 -d unimp -serial stdio -drive file=hdisk0.qcow2,if=none,id=drive-virtio-disk0 -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=drive-virtio-disk0 -cdrom /mnt/hgfs/Images/AIX7.1/install-1.iso -prom-env "boot-command=boot cdrom:" -prom-env "input-device=/vdevice/vty@71000000" -prom-env "output-device=/vdevice/vty@71000000" Since I am not the original author of this issue, I am not able to change its state to New again Sincerely David The only AIX version that _might_ run with QEMU is 7.2. Older ones don't have virtio AFAIK. Ok, so closing this ticket since AIX older than 7.2 cannot work. For AIX >= 7.2, we already have a different ticket opened instead: https://gitlab.com/qemu-project/qemu/-/issues/269 qemu-system-ppc64 should support AIX 5.3/6.1/7.1. If those OSes don't have virtio, then provide another way which simulates the machine's way to support the disk accessing.