other: 0.912 device: 0.893 semantic: 0.890 debug: 0.882 permissions: 0.880 boot: 0.874 performance: 0.863 vnc: 0.859 KVM: 0.845 PID: 0.844 socket: 0.844 graphic: 0.836 files: 0.825 network: 0.805 qemu can no longer boot NetBSD/sparc Booting NetBSD/sparc in qemu no longer works. It broke between qemu version 5.0.0 and 5.1.0, and a bisection identified the following as the offending commit: [5d971f9e672507210e77d020d89e0e89165c8fc9] memory: Revert "memory: accept mismatching sizes in memory_region_access_valid" It's still broken as of 7fd51e68c34fcefdb4d6fd646ed3346f780f89f4. To reproduce, run wget http://ftp.netbsd.org/pub/NetBSD/NetBSD-9.0/images/NetBSD-9.0-sparc.iso qemu-system-sparc -nographic -cdrom NetBSD-9.0-sparc.iso -boot d The expected behavior is that the guest boots to the prompt Installation medium to load the additional utilities from: The observed behavior is a panic: [ 1.0000050] system[0]: trap 0x29: pc=0xf0046b14 sfsr=0xb6 sfva=0x54000000 [ 1.0000050] cpu0: data fault: pc=0xf0046b14 addr=0x54000000 sfsr=0xb6 [ 1.0000050] panic: kernel fault [ 1.0000050] halted This happens because openbios accesses unassigned memory during the SBus scan: Probing SBus slot 0 offset 0 invalid accepts: (null) addr 20000000 size: 1 Probing SBus slot 1 offset 0 invalid accepts: (null) addr 30000000 size: 1 Probing SBus slot 2 offset 0 invalid accepts: (null) addr 40000000 size: 1 Probing SBus slot 3 offset 0 Probing SBus slot 4 offset 0 invalid accepts: (null) addr 60000000 size: 1 Probing SBus slot 5 offset 0 Thread 4 "qemu-system-spa" hit Breakpoint 1, memory_region_access_valid (mr=0x555555df20c0 , addr=536870912, size=1, is_write=, attrs=...) at .../softmmu/memory.c:1358 1358 return false; (gdb) list 1355 if (mr->ops->valid.accepts 1356 && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) { 1357 fprintf(stderr, "invalid accepts: %s addr %"PRIx64 " size: %d\n", mr->name, addr, size); 1358 return false; 1359 } (gdb) p mr->ops->valid.accepts $1 = (_Bool (*)(void *, hwaddr, unsigned int, _Bool, MemTxAttrs)) 0x555555736f10 (gdb) list unassigned_mem_accepts 1271 1272 static bool unassigned_mem_accepts(void *opaque, hwaddr addr, 1273 unsigned size, bool is_write, 1274 MemTxAttrs attrs) 1275 { 1276 return false; 1277 } The S24/TCX datasheet is listed as "Unable to locate" on [1]. However the NetBSD revision 1.32 of the driver introduced 64-bit accesses to the stippler and blitter [2]. It is safe to assume these memory regions are 64-bit accessible. QEMU implementation is 32-bit, so fill the 'impl' fields. [1] http://web.archive.org/web/20111209011516/http://wikis.sun.com/display/FOSSdocs/Home [2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/sbus/tcx.c.diff?r1=1.31&r2=1.32 Reported-by: Andreas Gustafsson