NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-i386/48196: PAE non xen crashes immeadiately on boot up



>Number:         48196
>Category:       port-i386
>Synopsis:       PAE non xen crashes immeadiately on boot up
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 09 05:05:00 +0000 2013
>Originator:     Nat Sloss
>Release:        NetBSD Current 6.99.23
>Organization:
>Environment:
NetBSD beast 6.99.23 NetBSD 6.99.23 (LOCKDEBUG) #4: Wed Jul 17 22:24:41 EST 
2013  build@beast:/usr/src/sys/arch/i386/compile/obj/LOCKDEBUG i386
>Description:
A PAE enabled kernel non xen crashes immediately 

I obtain the following from ddb:

fatal double fault in supervisor mode

trap type 13 code c027ff44 eip 8 cs 246 eflags 20 cr2 0 ilevel 0 esp cf

curlwp 0xc0e6ccc0 pid 0 lid 1 lowest kstack 0xc102c000

kernel: user trap double fault, code=0

Stopped in pid 0.1 (system) at  8:      invalid address

db{0}> bt

panic: lockdebug_lookup: uninitialized lock (lock=0xc0eb0804, from=c0921dce)

fatal breakpoint trap in supervisor mode

trap type 1 code 0 eip c02810a4 cs 8 eflags 246 cr2 8 ilevel 8 esp c102e154

curlwp 0xc0e6ccc0 pid 0 lid 1 lowest kstack 0xc102c000

Stopped in pid 0.1 (system) at  netbsd:breakpoint+0x4:  popl    %ebp

>How-To-Repeat:
Build a i386 kernel with options PAE andd try to boot it.
>Fix:
The problem is due to the fact that interrupts are enabled before they should 
be.

So to fix it I applied this patch:

--- ./cpu.c     2013-09-06 12:30:20.000000000 +1000
+++ .#cpu.c.1.102       2012-12-20 15:02:28.000000000 +1100
@@ -1276,6 +1276,7 @@
        struct cpu_info *ci = curcpu();
        pd_entry_t *l3_pd = ci->ci_pae_l3_pdir;
        int i;
+       static int intrEnOK = 0;

        /*
         * disable interrupts to block TLB shootdowns, which can reload cr3.
@@ -1286,7 +1287,11 @@
        for (i = 0 ; i < PDP_SIZE; i++) {
                l3_pd[i] = pmap->pm_pdirpa[i] | PG_V;
        }
-       x86_enable_intr();
+       if (intrEnOK > 1)
+               x86_enable_intr();
+       else
+               intrEnOK++;
+
        tlbflush();
 #else /* PAE */
        lcr3(pmap_pdirpa(pmap, 0));

I would like too request that NetBSD-6 be pulled up and that i386/44995 be 
reopened as it works in NetBSD current and it is critical to NetBSD-6.

Regards,

Nat.



Home | Main Index | Thread Index | Old Index