Skip to contentSkip to conversation

sparc mmu bug(and fix) seen with NetBSD

Qemu-devel Cliff Wright 2 participants 2 messages Jun 24, 2008

lore
Share & tools
lore
#0 lore raw

When using QEMU 0.9.1 for sparc emulation on i386 booting NetBSD 4.0 miniroot.fs a bug with the MMU is seen. A fault type is mis-aligned with the fault status register. This is seen by NetBSD with a copy on write
that causes a write fault, with no fault type in the register, NetBSD just
returns to the faulting instruction, causing an infinite loop.
Below is a patch to the 0.9.1 source, however I see the same problem
in the subversion source.

Signature · 1 line
Cliff Wright <[email protected]>
helper.c renamed from helper.c.orig +1 -1
@@ -197,7 +197,7 @@
     }
     /* check access */
     access_perms = (pde & PTE_ACCESS_MASK) >> PTE_ACCESS_SHIFT;
-    error_code = access_table[*access_index][access_perms];
+    error_code = access_table[*access_index][access_perms] << 2;
     if (error_code && !((env->mmuregs[0] & MMU_NF) && is_user))
         return error_code;
 
#1 lore raw
Quoted 6 lines · Cliff Wright

When using QEMU 0.9.1 for sparc emulation on i386 booting NetBSD 4.0 miniroot.fs a bug with the MMU is seen. A fault type is mis-aligned with
the fault status register. This is seen by NetBSD with a copy on write
that causes a write fault, with no fault type in the register, NetBSD just
returns to the faulting instruction, causing an infinite loop.
Below is a patch to the 0.9.1 source, however I see the same problem
in the subversion source.

Thank you very much! I'll commit a similar patch ASAP.

It looks like next problem is the keyboard, I can't write to the installer prompt.