[OpenBIOS] SOLVED: the mystery of Solaris on SPARC32 and the missing Forth arguments

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Sun Oct 31 14:07:02 CET 2010


Mark Cave-Ayland wrote:

> I'm not sure exactly what's happening, although it seems like some kind 
> of I/O memory access is triggering the error before the neverland 
> mapping is removed?

Even simpler than that: the reason the neverland code is being invoked 
is because env->psret == 0 (i.e. traps are disabled), not because the 
MMU is in no fault mode:


Breakpoint 1, cpu_sparc_handle_mmu_fault (env=0x10579f0, 
address=4028890828, rw=1, mmu_idx=1, is_softmmu=1)
     at /home/build/src/qemu/git/qemu/target-sparc/helper.c:261
261             vaddr = address & TARGET_PAGE_MASK;
(gdb) p/x env->mmuregs[0] & MMU_NF
No symbol "MMU_NF" in current context.
(gdb) p/x env->mmuregs[0] & 2
$5 = 0x0
(gdb) p/x env->psret
$6 = 0x0
(gdb) quit


Based upon this, it would seem that we shouldn't be invoking the data 
access exception if traps have been globally disabled. Blue, what do you 
make of the following patch?


diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index be3c1e0..d3a9f28 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -4258,7 +4258,7 @@ void do_unassigned_access(target_phys_addr_t addr, 
int is_write, int is_exec,
          env->mmuregs[3] |= 1;
      }

-    if ((env->mmuregs[0] & MMU_E) && !(env->mmuregs[0] & MMU_NF)) {
+    if ((env->mmuregs[0] & MMU_E) && !(env->mmuregs[0] & MMU_NF) && 
(env->psret)) {
          if (is_exec)
              raise_exception(TT_CODE_ACCESS);
          else


This allows the Solaris 8 boot to proceed a couple of seconds longer, 
however it still falls over with a similar error but for trap 0x6 
(window underflow) this time:


Configuration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Oct 30 2010 16:27
   Type 'help' for detailed information

0 > boot cdrom:d -vb Not a bootable ELF image
Loading a.out image...
Loaded 7680 bytes
entry point is 0x4000
bootpath: /iommu/sbus/espdma/esp/sd at 2,0:d

Jumping to entry point 00004000 for type 00000005...
switching to new context:
Size: 259040+54154+47486 Bytes
device auxio size -1
SunOS Release 5.8 Version Generic_108528-09 32-bit
Copyright 1983-2001 Sun Microsystems, Inc.  All rights reserved.
Ethernet address = 52:54:0:12:34:56
Using default device instance data
qemu: fatal: Trap 0x06 while interrupts disabled, Error state
pc: f00414a4  npc: f00413e0
General Registers:
%g0-7: 00000000 00000003 00000000 f0041b74 000000ab f0243b88 00000000 
f0244020

Current Register Window:
%o0-7: f0000000 f0158f08 f0158f08 000000b7 f0243b88 00000000 f00423c8 
f005bf58
%l0-7: 04400cc0 f005bf90 f005bf94 00000001 00000000 f0041b74 00000000 
00000101
%i0-7: 00000009 f00424cc f1ff0514 000000b7 00000002 00000004 f0042470 
f0041b74

Floating Point Registers:
%f00: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f04: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f08: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f12: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f16: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f20: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f24: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
%f28: 000000000.000000 000000000.000000 000000000.000000 000000000.000000
psr: 04400cc0 (icc: -Z-- SPE: SP-) wim: 00000003
fsr: 00080000 y: 00000000
Aborted


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the OpenBIOS mailing list