Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Dec 2013 10:58:52 -0800
From:      Sean Bruno <sean_bruno@yahoo.com>
To:        Konstantin Belousov <kostikbel@gmail.com>, Peter Wemm <peter@wemm.org>, "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Cc:        decke <decke@FreeBSD.org>
Subject:   Re: 10.0 BETA 3 with redports kernel panic
Message-ID:  <1388170732.1530.2.camel@powernoodle.corp.yahoo.com>
In-Reply-To: <1387818681.2431.0.camel@powernoodle.corp.yahoo.com>
References:  <1387473915.2494.0.camel@powernoodle.corp.yahoo.com> <20131219180833.GN59496@kib.kiev.ua> <1387479064.2494.5.camel@powernoodle.corp.yahoo.com> <CAGE5yCqhmRSM6oyw=FRZq59LniLsYaN%2BEog=GEPn3-ruuQk9EQ@mail.gmail.com> <CAGE5yCp9msPAy4HZ4TGRXws%2BxjLQ8iChbPQGj539qHJKhq2UJQ@mail.gmail.com> <1387492541.27693.5.camel@powernoodle.corp.yahoo.com> <20131220094835.GR59496@kib.kiev.ua> <1387554355.1491.4.camel@powernoodle.corp.yahoo.com> <20131220162254.GT59496@kib.kiev.ua> <CAGE5yCos5xGu7w24A6QSRDEPbfRNsjmHSvnpUE2Dvr1PUW2T8w@mail.gmail.com> <20131221145534.GY59496@kib.kiev.ua> <1387818681.2431.0.camel@powernoodle.corp.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2013-12-23 at 09:11 -0800, Sean Bruno wrote:
> On Sat, 2013-12-21 at 16:55 +0200, Konstantin Belousov wrote:
> > > The reason why the dmaplimit change originally exploded was becase
> > > dmaplimit is set to zero for the duration of while we're running on
> > > the page tables given to us by the loader.  I believe initializing
> > > dmaplimit to DMAP_MAX_ADDRESS rather than zero would have solved the
> > > original explosions.
> > The dmaplimit is initialized in
> > hammer_time->pmap_bootstrap->getmemsize->
> > create_pagetable().  The backtrace above should be much later in the
> > boot sequence, note that mi_startup() was already running.
> > 
> > I believe that my previous change just broke vsetslab()/vtoslab(). 
> 
> Currently running 2/4 machines with the following patch.  No data for
> stability yet.  Still waiting.
> 
> 
> > Index: amd64/amd64/mem.c
> > ===================================================================
> > --- amd64/amd64/mem.c   (revision 258554)
> > +++ amd64/amd64/mem.c   (working copy)
> > @@ -98,6 +98,10 @@
> >  kmemphys:
> >                         o = v & PAGE_MASK;
> >                         c = min(uio->uio_resid, (u_int)(PAGE_SIZE - o));
> > +                       v = PHYS_TO_DMAP(v);
> > +                       if (v < DMAP_MIN_ADDRESS || v >= dmaplimit ||
> > +                           pmap_kextract(v) == 0)
> > +                               return (EFAULT);
> >                         error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio);
> >                         continue;
> >                 }
> > Index: amd64/amd64/pmap.c
> > ===================================================================
> > --- amd64/amd64/pmap.c  (revision 258554)
> > +++ amd64/amd64/pmap.c  (working copy)
> > @@ -321,7 +321,7 @@
> >      "Number of kernel page table pages allocated on bootup");
> >  
> >  static int ndmpdp;
> > -static vm_paddr_t dmaplimit;
> > +vm_paddr_t dmaplimit;
> >  vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
> >  pt_entry_t pg_nx;
> >  
> > Index: amd64/include/pmap.h
> > ===================================================================
> > --- amd64/include/pmap.h        (revision 258554)
> > +++ amd64/include/pmap.h        (working copy)
> > @@ -368,6 +368,7 @@
> >  extern vm_paddr_t dump_avail[];
> >  extern vm_offset_t virtual_avail;
> >  extern vm_offset_t virtual_end;
> > +extern vm_paddr_t dmaplimit;
> >  
> >  #define        pmap_page_get_memattr(m)        ((vm_memattr_t)(m)->md.pat_mode)
> >  #define        pmap_page_is_write_mapped(m)    (((m)->aflags & PGA_WRITEABLE) != 0)


Update from redports land.

I've added the patches for "keep java from crashing the box" to these
machines as they have manifested the problem once.  I have not seen the
original panic str of:

panic: vm_fault: fault on nofault entry, addr: fffffe0327240000

So, the current diff looks like this:

Index: sys/amd64/amd64/mem.c
===================================================================
--- sys/amd64/amd64/mem.c       (revision 258556)
+++ sys/amd64/amd64/mem.c       (working copy)
@@ -97,7 +97,15 @@
                        v = uio->uio_offset;
 kmemphys:
                        o = v & PAGE_MASK;
+                       v = PHYS_TO_DMAP(v);
+                       if (v < DMAP_MIN_ADDRESS || v >=
DMAP_MAX_ADDRESS ||
+                           pmap_kextract(v) == 0)
+                               return (EFAULT);
                        c = min(uio->uio_resid, (u_int)(PAGE_SIZE - o));
+                       v = PHYS_TO_DMAP(v);
+                       if (v < DMAP_MIN_ADDRESS || v >= dmaplimit ||
+                           pmap_kextract(v) == 0)
+                               return (EFAULT);
                        error = uiomove((void *)PHYS_TO_DMAP(v), (int)c,
uio);
                        continue;
                }
Index: sys/amd64/amd64/pmap.c
===================================================================
--- sys/amd64/amd64/pmap.c      (revision 258556)
+++ sys/amd64/amd64/pmap.c      (working copy)
@@ -321,7 +321,7 @@
     "Number of kernel page table pages allocated on bootup");
 
 static int ndmpdp;
-static vm_paddr_t dmaplimit;
+vm_paddr_t dmaplimit;
 vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
 pt_entry_t pg_nx;
 
Index: sys/amd64/include/pmap.h
===================================================================
--- sys/amd64/include/pmap.h    (revision 258556)
+++ sys/amd64/include/pmap.h    (working copy)
@@ -368,6 +368,7 @@
 extern vm_paddr_t dump_avail[];
 extern vm_offset_t virtual_avail;
 extern vm_offset_t virtual_end;
+extern vm_paddr_t dmaplimit;
 
 #define        pmap_page_get_memattr(m)
((vm_memattr_t)(m)->md.pat_mode)
 #define        pmap_page_is_write_mapped(m)    (((m)->aflags &
PGA_WRITEABLE) != 0)
Index: sys/vm/vm_map.c
===================================================================
--- sys/vm/vm_map.c     (revision 258556)
+++ sys/vm/vm_map.c     (working copy)
@@ -1207,6 +1207,7 @@
        }
        else if ((prev_entry != &map->header) &&
                 (prev_entry->eflags == protoeflags) &&
+                (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) ==
0 &&
                 (prev_entry->end == start) &&
                 (prev_entry->wired_count == 0) &&
                 (prev_entry->cred == cred ||
@@ -3316,7 +3317,6 @@
         * NOTE: We explicitly allow bi-directional stacks.
         */
        orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP);
-       cow &= ~orient;
        KASSERT(orient != 0, ("No stack grow direction"));
 
        if (addrbos < vm_map_min(map) ||





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1388170732.1530.2.camel>