10.0 BETA 3 with redports kernel panic
Sean Bruno
sean_bruno at yahoo.com
Fri Dec 27 19:05:39 UTC 2013
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) ||
More information about the freebsd-stable
mailing list