PMON2000 compilation and kernel question
Quoted 1 line
This could be some missing or buggy emulation. Maybe if you can get some debug logs from kernel that could tell what it's doing. Usually at least -d unimp,guest_errors options are recommended for debugging but if nothing is printed then it's harder to find out what's causing the hang.
This was kernel dying in ata subsystem:
[ 1.340000] io scheduler noop registered [ 1.340000] io scheduler deadline registered [ 1.340000] io scheduler cfq registered (default) [ 1.352000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 1.388000] console [ttyS0] disabled [ 1.424000] serial8250.0: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 1.432000] console [ttyS0] enabled [ 1.432000] console [ttyS0] enabled [ 1.432000] bootconsole [early0] disabled [ 1.432000] bootconsole [early0] disabled [ 1.472000] scsi0 : pata_via [ 1.476000] scsi1 : pata_via [ 1.480000] ata1: PATA max UDMA/100 cmd 0x4450 ctl 0x4460 bmdma 0x4440 [ 1.484000] ata2: PATA max UDMA/100 cmd 0x4458 ctl 0x4464 bmdma 0x4448 [ 1.524000] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 1.524000] serio: i8042 AUX port at 0x60,0x64 irq 12 [ 1.532000] mousedev: PS/2 mouse device common for all mice [ 1.552000] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0 [ 1.552000] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram [ 1.556000] ledtrig-cpu: registered to indicate activity on CPUs [ 1.556000] TCP: cubic registered [ 1.560000] NET: Registered protocol family 10 [ 1.588000] mip6: Mobile IPv6 [ 1.588000] NET: Registered protocol family 17 [ 1.588000] mpls_gso: MPLS GSO support [ 1.596000] registered taskstats version 1 [ 1.612000] rtc_cmos rtc_cmos: setting system clock to 2019-03-06 15:48:12 UTC (1551887292) [ 1.684000] input: AT Raw Set 2 keyboard as /devices/platform/i8042/serio0/input/input0 [ 1.724000] ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100 [ 1.724000] ata1.00: 204800 sectors, multi 16: LBA48 [ 1.728000] ata1.00: limited to UDMA/33 due to 40-wire cable [ 1.736000] ata1.00: configured for UDMA/33 [ 1.796000] scsi 0:0:0:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5 [ 1.820000] sd 0:0:0:0: [sda] 204800 512-byte logical blocks: (104 MB/100 MiB) [ 1.832000] sd 0:0:0:0: [sda] Write Protect is off [ 1.836000] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 1.864000] Data bus error, epc == ffffffff804157d8, ra == ffffffff804f7ddc [ 1.864000] Oops[#1]:
for
mips64el-softmmu/qemu-system-mips64el -M fulong2e -kernel /dev/shm/boot/vmlinux-3.16.0-4-loongson-2e -hda /dev/shm/LONGSOON_disk -cdrom /dev/shm/debian-8.0.0-mipsel-xfce-CD-1.iso -nographic -d unimp,guest_errors -append "console=ttyS0" > VMLINUX_3.16.log 2>&1
and without ata disk but with just CD it moved into 'normal' panic (no root device)
[ 1.480000] console [ttyS0] enabled [ 1.480000] console [ttyS0] enabled [ 1.484000] bootconsole [early0] disabled [ 1.484000] bootconsole [early0] disabled [ 1.524000] scsi0 : pata_via [ 1.528000] scsi1 : pata_via [ 1.532000] ata1: PATA max UDMA/100 cmd 0x4450 ctl 0x4460 bmdma 0x4440 [ 1.536000] ata2: PATA max UDMA/100 cmd 0x4458 ctl 0x4464 bmdma 0x4448 [ 1.580000] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 1.584000] serio: i8042 AUX port at 0x60,0x64 irq 12 [ 1.596000] mousedev: PS/2 mouse device common for all mice [ 1.616000] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0 [ 1.616000] rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram [ 1.620000] ledtrig-cpu: registered to indicate activity on CPUs [ 1.624000] TCP: cubic registered [ 1.624000] NET: Registered protocol family 10 [ 1.648000] mip6: Mobile IPv6 [ 1.652000] NET: Registered protocol family 17 [ 1.652000] mpls_gso: MPLS GSO support [ 1.656000] registered taskstats version 1 [ 1.688000] rtc_cmos rtc_cmos: setting system clock to 2019-03-06 15:50:38 UTC (1551887438) [ 1.752000] input: AT Raw Set 2 keyboard as /devices/platform/i8042/serio0/input/input0 [ 1.912000] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100 [ 1.916000] ata2.00: limited to UDMA/33 due to 40-wire cable [ 1.924000] ata2.00: configured for UDMA/33 [ 2.604000] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2 [ 6.928000] ata2.00: qc timeout (cmd 0xa0) [ 6.928000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4) [ 7.088000] ata2.00: configured for UDMA/33 [ 12.092000] ata2.00: qc timeout (cmd 0xa0) [ 12.096000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4) [ 12.096000] ata2.00: limiting speed to UDMA/33:PIO3 [ 12.252000] ata2.00: configured for UDMA/33 [ 17.252000] ata2.00: qc timeout (cmd 0xa0) [ 17.252000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4) [ 17.256000] ata2.00: disabled [ 17.260000] ata2: soft resetting link [ 17.420000] ata2: EH complete [ 17.428000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 [ 17.428000] Please append a correct "root=" boot option; here are the available partitions: [ 17.432000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 17.432000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
vmlinux-2e also boots (if I redirect output to serial console), but not very verbose :/
Scaning....
=========================================================
=========================================================
not find usb drivers...
mips64el-softmmu/qemu-system-mips64el -M fulong2e -kernel /dev/shm/vmlinux-2e -cdrom /dev/shm/debian-8.0.0-mipsel-xfce-CD-1.iso -nographic -d unimp,guest_errors -append "console=ttyS0"
Hm. Note I skipped adding ati-vga device in those tests, because Debian 3.16 kernel was panicing in radeon code too.
Quoted 12 lines · Andrew Randrianasulu
This was kernel dying in ata subsystem:
[ 1.724000] ata1.00: ATA-7: QEMU HARDDISK, 2.5+, max UDMA/100 [ 1.724000] ata1.00: 204800 sectors, multi 16: LBA48 [ 1.728000] ata1.00: limited to UDMA/33 due to 40-wire cable [ 1.736000] ata1.00: configured for UDMA/33 [ 1.796000] scsi 0:0:0:0: Direct-Access ATA QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5 [ 1.820000] sd 0:0:0:0: [sda] 204800 512-byte logical blocks: (104 MB/100 MiB) [ 1.832000] sd 0:0:0:0: [sda] Write Protect is off [ 1.836000] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 1.864000] Data bus error, epc == ffffffff804157d8, ra == ffffffff804f7ddc [ 1.864000] Oops[#1]:
Not sure what is this.
Quoted 13 lines
mips64el-softmmu/qemu-system-mips64el -M fulong2e -kernel
/dev/shm/boot/vmlinux-3.16.0-4-loongson-2e-hda/dev/shm/LONGSOON_disk-cdrom/dev/shm/debian-8.0.0-mipsel-xfce-CD-1.iso-nographic -d unimp,guest_errors -append "console=ttyS0" > VMLINUX_3.16.log 2>&1and without ata disk but with just CD it moved into 'normal' panic (no root device)
[ 1.912000] ata2.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100 [ 1.916000] ata2.00: limited to UDMA/33 due to 40-wire cable [ 1.924000] ata2.00: configured for UDMA/33 [ 2.604000] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input2 [ 6.928000] ata2.00: qc timeout (cmd 0xa0) [ 6.928000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4) [ 7.088000] ata2.00: configured for UDMA/33 [ 12.092000] ata2.00: qc timeout (cmd 0xa0) [ 12.096000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4)
Quoted 8 lines
[ 12.096000] ata2.00: limiting speed to UDMA/33:PIO3 [ 12.252000] ata2.00: configured for UDMA/33 [ 17.252000] ata2.00: qc timeout (cmd 0xa0) [ 17.252000] ata2.00: TEST_UNIT_READY failed (err_mask=0x4) [ 17.256000] ata2.00: disabled [ 17.260000] ata2: soft resetting link [ 17.420000] ata2: EH complete [ 17.428000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
As I've said I've also seen problems with DMA with via-ide and this also looks like a problem with DMA so it could be a problem with the device model. Previously this only modelled the legacy ide mode which did not work well with PMON, Linux nor what I'm trying to use it for so I've changed it to emulate native mode but could be it's not complete and still missing something for DMA to work. Unfortunately I don't know QEMU that much to tell what may be needed and had no time to try to debug it yet.
My guess (which could be all wrong) is that maybe a PCI window is needed for DMA to work otherwise PCI device won't be able to write data to memory which would need mapping some memory region somewhere but I'm not sure how to do that. Maybe you could try enabling ide and bmdma related traces (or debug defines in these devices if any) to get more detailed output on what's happening. Then it's a matter of looking up docs and knowing how it should work and find what's different but that may not be easy for someone who don't know much about this like me.
Quoted 3 lines
mips64el-softmmu/qemu-system-mips64el -M fulong2e -kernel
/dev/shm/vmlinux-2e-cdrom/dev/shm/debian-8.0.0-mipsel-xfce-CD-1.iso-nographic -d unimp,guest_errors -append "console=ttyS0"Hm. Note I skipped adding ati-vga device in those tests, because Debian 3.16 kernel was panicing in radeon code too.
The RV100 emulation in ati-vga is even less tested than the default rage128p so it's possible that the Linux radeon driver does not like it yet. I think Gerd Hoffmann has found and debugged a problem with it trying to get values from vgabios which we don't have that can cause a panic. He had some patches to fix that but it's in his own tree only yet. Hopefully the ati-vga can be merged soon and then we can include a better vgabios that works better with the Linux driver. Maybe you should wait for that before trying it more to avoid chasing already known problems.
Regards,
BALATON Zoltan