10.0 BETA 3 with redports kernel panic
Sean Bruno
sean_bruno at yahoo.com
Mon Dec 23 17:14:32 UTC 2013
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)
More information about the freebsd-stable
mailing list