svn commit: r343567 - in head: lib/libkvm sys/conf sys/dev/dcons sys/dev/fb sys/dev/syscons sys/i386/acpica sys/i386/i386 sys/i386/include sys/i386/pci sys/x86/acpica sys/x86/include sys/x86/x86

Konstantin Belousov kib at FreeBSD.org
Wed Jan 30 02:07:19 UTC 2019


Author: kib
Date: Wed Jan 30 02:07:13 2019
New Revision: 343567
URL: https://svnweb.freebsd.org/changeset/base/343567

Log:
  i386: Merge PAE and non-PAE pmaps into same kernel.
  
  Effectively all i386 kernels now have two pmaps compiled in: one
  managing PAE pagetables, and another non-PAE. The implementation is
  selected at cold time depending on the CPU features. The vm_paddr_t is
  always 64bit now. As result, nx bit can be used on all capable CPUs.
  
  Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE
  configs, for drivers compatibility. Kernel layout, esp. max kernel
  address, low memory PDEs and max user address (same as trampoline
  start) are now same for PAE and for non-PAE regardless of the type of
  page tables used.
  
  Non-PAE kernel (when using PAE pagetables) can handle physical memory
  up to 24G now, larger memory requires re-tuning the KVA consumers and
  instead the code caps the maximum at 24G. Unfortunately, a lot of
  drivers do not use busdma(9) properly so by default even 4G barrier is
  not easy. There are two tunables added: hw.above4g_allow and
  hw.above24g_allow, the first one is kept enabled for now to evaluate
  the status on HEAD, second is only for dev use.
  
  i386 now creates three freelists if there is any memory above 4G, to
  allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed
  from 3 to 1.
  
  The PAE_TABLES kernel config option is retired.
  
  In collaboarion with: pho
  Discussed with:	emaste
  Reviewed by:	markj
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation
  Differential revision:	https://reviews.freebsd.org/D18894

Added:
  head/sys/i386/i386/minidump_machdep_base.c
     - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/i386/minidump_machdep_nopae.c
     - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/i386/minidump_machdep_pae.c
     - copied, changed from r343566, head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/i386/pmap_base.c   (contents, props changed)
  head/sys/i386/i386/pmap_nopae.c   (contents, props changed)
  head/sys/i386/i386/pmap_pae.c   (contents, props changed)
  head/sys/i386/include/pmap_base.h   (contents, props changed)
  head/sys/i386/include/pmap_nopae.h   (contents, props changed)
  head/sys/i386/include/pmap_pae.h   (contents, props changed)
Modified:
  head/lib/libkvm/kvm_i386.h
  head/sys/conf/files.i386
  head/sys/conf/options.i386
  head/sys/dev/dcons/dcons_os.c
  head/sys/dev/fb/fb.c
  head/sys/dev/fb/fbreg.h
  head/sys/dev/fb/vga.c
  head/sys/dev/fb/vgareg.h
  head/sys/dev/syscons/syscons.c
  head/sys/i386/acpica/acpi_machdep.c
  head/sys/i386/i386/bios.c
  head/sys/i386/i386/copyout.c
  head/sys/i386/i386/genassym.c
  head/sys/i386/i386/initcpu.c
  head/sys/i386/i386/locore.s
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mem.c
  head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/i386/mpboot.s
  head/sys/i386/i386/pmap.c
  head/sys/i386/i386/trap.c
  head/sys/i386/i386/vm86.c
  head/sys/i386/i386/vm86bios.s
  head/sys/i386/i386/vm_machdep.c
  head/sys/i386/include/md_var.h
  head/sys/i386/include/param.h
  head/sys/i386/include/pmap.h
  head/sys/i386/include/vm86.h
  head/sys/i386/include/vmparam.h
  head/sys/i386/pci/pci_cfgreg.c
  head/sys/x86/acpica/acpi_wakeup.c
  head/sys/x86/include/_types.h
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/identcpu.c

Modified: head/lib/libkvm/kvm_i386.h
==============================================================================
--- head/lib/libkvm/kvm_i386.h	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/lib/libkvm/kvm_i386.h	Wed Jan 30 02:07:13 2019	(r343567)
@@ -67,14 +67,16 @@ typedef	uint64_t	i386_pde_pae_t;
 _Static_assert(PAGE_SHIFT == I386_PAGE_SHIFT, "PAGE_SHIFT mismatch");
 _Static_assert(PAGE_SIZE == I386_PAGE_SIZE, "PAGE_SIZE mismatch");
 _Static_assert(PAGE_MASK == I386_PAGE_MASK, "PAGE_MASK mismatch");
+#if 0
 _Static_assert(NPTEPG == I386_NPTEPG, "NPTEPG mismatch");
-_Static_assert(PDRSHIFT == I386_PDRSHIFT, "PDRSHIFT mismatch");
 _Static_assert(NBPDR == I386_NBPDR, "NBPDR mismatch");
+#endif
+_Static_assert(PDRSHIFT_NOPAE == I386_PDRSHIFT, "PDRSHIFT mismatch");
 
 _Static_assert(PG_V == I386_PG_V, "PG_V mismatch");
 _Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch");
-_Static_assert((u_int)PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch");
-_Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch");
+_Static_assert((u_int)PG_FRAME_NOPAE == I386_PG_FRAME, "PG_FRAME mismatch");
+_Static_assert(PG_PS_FRAME_NOPAE == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch");
 #endif
 
 int	_i386_native(kvm_t *);

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/conf/files.i386	Wed Jan 30 02:07:13 2019	(r343567)
@@ -492,12 +492,16 @@ i386/i386/longrun.c		optional cpu_enable_longrun
 i386/i386/machdep.c		standard
 i386/i386/mem.c			optional mem
 i386/i386/minidump_machdep.c	standard
+i386/i386/minidump_machdep_pae.c	standard
+i386/i386/minidump_machdep_nopae.c	standard
 i386/i386/mp_clock.c		optional smp
 i386/i386/mp_machdep.c		optional smp
 i386/i386/mpboot.s		optional smp
 i386/i386/npx.c			standard
 i386/i386/perfmon.c		optional perfmon
-i386/i386/pmap.c		standard
+i386/i386/pmap_base.c		standard
+i386/i386/pmap_nopae.c		standard
+i386/i386/pmap_pae.c		standard
 i386/i386/prof_machdep.c	optional profiling-routine
 i386/i386/ptrace_machdep.c	standard
 i386/i386/sigtramp.s		standard

Modified: head/sys/conf/options.i386
==============================================================================
--- head/sys/conf/options.i386	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/conf/options.i386	Wed Jan 30 02:07:13 2019	(r343567)
@@ -33,11 +33,6 @@ KVA_PAGES		opt_global.h
 # Physical address extensions and support for >4G ram.  As above.
 PAE			opt_global.h
 
-# Use PAE page tables, but limit memory support to 4GB.
-# This keeps the i386 non-PAE KBI, in particular, drivers see
-# 32bit vm_paddr_t.
-PAE_TABLES		opt_global.h
-
 TIMER_FREQ			opt_clock.h
 
 CPU_ATHLON_SSE_HACK		opt_cpu.h

Modified: head/sys/dev/dcons/dcons_os.c
==============================================================================
--- head/sys/dev/dcons/dcons_os.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/dcons/dcons_os.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -309,7 +309,7 @@ dcons_drv_init(int stage)
 		 * Allow read/write access to dcons buffer.
 		 */
 		for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE)
-			*vtopte(PMAP_MAP_LOW + pa) |= PG_RW;
+			pmap_ksetrw(PMAP_MAP_LOW + pa);
 		invltlb();
 #endif
 		/* XXX P to V */

Modified: head/sys/dev/fb/fb.c
==============================================================================
--- head/sys/dev/fb/fb.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/fb/fb.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -513,7 +513,7 @@ int genfbioctl(genfb_softc_t *sc, video_adapter_t *adp
 }
 
 int genfbmmap(genfb_softc_t *sc, video_adapter_t *adp, vm_ooffset_t offset,
-	      vm_offset_t *paddr, int prot, vm_memattr_t *memattr)
+	      vm_paddr_t *paddr, int prot, vm_memattr_t *memattr)
 {
 	return vidd_mmap(adp, offset, paddr, prot, memattr);
 }

Modified: head/sys/dev/fb/fbreg.h
==============================================================================
--- head/sys/dev/fb/fbreg.h	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/fb/fbreg.h	Wed Jan 30 02:07:13 2019	(r343567)
@@ -327,7 +327,7 @@ int		genfbwrite(genfb_softc_t *sc, video_adapter_t *ad
 int		genfbioctl(genfb_softc_t *sc, video_adapter_t *adp,
 			   u_long cmd, caddr_t arg, int flag, struct thread *td);
 int		genfbmmap(genfb_softc_t *sc, video_adapter_t *adp,
-			  vm_ooffset_t offset, vm_offset_t *paddr,
+			  vm_ooffset_t offset, vm_paddr_t *paddr,
 			  int prot, vm_memattr_t *memattr);
 
 #endif /* FB_INSTALL_CDEV */

Modified: head/sys/dev/fb/vga.c
==============================================================================
--- head/sys/dev/fb/vga.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/fb/vga.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -147,7 +147,7 @@ vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cm
 
 int
 vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset,
-    vm_offset_t *paddr, int prot, vm_memattr_t *memattr)
+    vm_paddr_t *paddr, int prot, vm_memattr_t *memattr)
 {
 	return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot, memattr);
 }

Modified: head/sys/dev/fb/vgareg.h
==============================================================================
--- head/sys/dev/fb/vgareg.h	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/fb/vgareg.h	Wed Jan 30 02:07:13 2019	(r343567)
@@ -91,7 +91,7 @@ int		vga_write(struct cdev *dev, vga_softc_t *sc, stru
 int		vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
 			  int flag, struct thread *td);
 int		vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_ooffset_t offset,
-			 vm_offset_t *paddr, int prot, vm_memattr_t *memattr);
+			 vm_paddr_t *paddr, int prot, vm_memattr_t *memattr);
 #endif
 
 extern int	(*vga_sub_configure)(int flags);

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/dev/syscons/syscons.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -291,7 +291,7 @@ ec_putc(int c)
 #ifdef __amd64__
 		fb = KERNBASE + 0xb8000;
 #else /* __i386__ */
-		fb = PMAP_MAP_LOW + 0xb8000;
+		fb = pmap_get_map_low() + 0xb8000;
 #endif
 		xsize = 80;
 		ysize = 25;

Modified: head/sys/i386/acpica/acpi_machdep.c
==============================================================================
--- head/sys/i386/acpica/acpi_machdep.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/acpica/acpi_machdep.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -134,7 +134,7 @@ table_map(vm_paddr_t pa, int offset, vm_offset_t lengt
 
 	off = pa & PAGE_MASK;
 	length = round_page(length + off);
-	pa = pa & PG_FRAME;
+	pa = pmap_pg_frame(pa);
 	va = (vm_offset_t)pmap_kenter_temporary(pa, offset) +
 	    (offset * PAGE_SIZE);
 	data = (void *)(va + off);

Modified: head/sys/i386/i386/bios.c
==============================================================================
--- head/sys/i386/i386/bios.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/bios.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -329,9 +329,7 @@ bios16(struct bios_args *args, char *fmt, ...)
     va_list 	ap;
     int 	flags = BIOSCODE_FLAG | BIOSDATA_FLAG;
     u_int 	i, arg_start, arg_end;
-    pt_entry_t	*pte;
-    pd_entry_t	*ptd, orig_ptd;
-
+    void	*bios16_pmap_handle;
     arg_start = 0xffffffff;
     arg_end = 0;
 
@@ -388,18 +386,10 @@ bios16(struct bios_args *args, char *fmt, ...)
 	args->seg.args.limit = 0xffff;
     }
 
-    args->seg.code32.base = (u_int)&bios16_jmp & PG_FRAME;
+    args->seg.code32.base = pmap_pg_frame((u_int)&bios16_jmp);
     args->seg.code32.limit = 0xffff;	
 
-    /*
-     * no page table, so create one and install it.
-     */
-    pte = (pt_entry_t *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
-    ptd = IdlePTD;
-    *pte = vm86phystk | PG_RW | PG_V;
-    orig_ptd = *ptd;
-    *ptd = vtophys(pte) | PG_RW | PG_V;
-    pmap_invalidate_all(kernel_pmap);	/* XXX insurance for now */
+    bios16_pmap_handle = pmap_bios16_enter();
 
     stack_top = stack;
     va_start(ap, fmt);
@@ -451,13 +441,7 @@ bios16(struct bios_args *args, char *fmt, ...)
     bioscall_vector.vec16.segment = GSEL(GBIOSCODE16_SEL, SEL_KPL);
 
     i = bios16_call(&args->r, stack_top);
-
-    *ptd = orig_ptd;		/* remove page table */
-    /*
-     * XXX only needs to be invlpg(0) but that doesn't work on the 386
-     */
-    pmap_invalidate_all(kernel_pmap);
-    free(pte, M_TEMP);		/* ... and free it */
+    pmap_bios16_leave(bios16_pmap_handle);
     return (i);
 }
 

Modified: head/sys/i386/i386/copyout.c
==============================================================================
--- head/sys/i386/i386/copyout.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/copyout.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -47,12 +47,6 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_map.h>
 #include <vm/vm_page.h>
 
-#if defined(PAE) || defined(PAE_TABLES)
-#define	KCR3	((u_int)IdlePDPT)
-#else
-#define	KCR3	((u_int)IdlePTD)
-#endif
-
 int copyin_fast(const void *udaddr, void *kaddr, size_t len, u_int);
 static int (*copyin_fast_tramp)(const void *, void *, size_t, u_int);
 int copyout_fast(const void *kaddr, void *udaddr, size_t len, u_int);
@@ -103,7 +97,6 @@ cp_slow0(vm_offset_t uva, size_t len, bool write,
 {
 	struct pcpu *pc;
 	vm_page_t m[2];
-	pt_entry_t *pte;
 	vm_offset_t kaddr;
 	int error, i, plen;
 	bool sleepable;
@@ -128,12 +121,7 @@ cp_slow0(vm_offset_t uva, size_t len, bool write,
 		sx_xlock(&pc->pc_copyout_slock);
 		kaddr = pc->pc_copyout_saddr;
 	}
-	for (i = 0, pte = vtopte(kaddr); i < plen; i++, pte++) {
-		*pte = PG_V | PG_RW | PG_A | PG_M | VM_PAGE_TO_PHYS(m[i]) |
-		    pmap_cache_bits(kernel_pmap, pmap_page_get_memattr(m[i]),
-		    FALSE);
-		invlpg(kaddr + ptoa(i));
-	}
+	pmap_cp_slow0_map(kaddr, plen, m);
 	kaddr += uva - trunc_page(uva);
 	f(kaddr, arg);
 	sched_unpin();
@@ -225,7 +213,7 @@ copyin(const void *udaddr, void *kaddr, size_t len)
 	    (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS)
 		return (EFAULT);
 	if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ &&
-	    copyin_fast_tramp(udaddr, kaddr, len, KCR3) == 0))
+	    copyin_fast_tramp(udaddr, kaddr, len, pmap_get_kcr3()) == 0))
 		return (0);
 	for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr;
 	    plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) {
@@ -260,7 +248,7 @@ copyout(const void *kaddr, void *udaddr, size_t len)
 	    (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS)
 		return (EFAULT);
 	if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ &&
-	    copyout_fast_tramp(kaddr, udaddr, len, KCR3) == 0))
+	    copyout_fast_tramp(kaddr, udaddr, len, pmap_get_kcr3()) == 0))
 		return (0);
 	for (plen = 0, uc = (vm_offset_t)udaddr, ca.kc = (vm_offset_t)kaddr;
 	    plen < len; uc += ca.len, ca.kc += ca.len, plen += ca.len) {
@@ -296,7 +284,7 @@ fubyte(volatile const void *base)
 	    (uintptr_t)base + sizeof(uint8_t) > VM_MAXUSER_ADDRESS)
 		return (-1);
 	if (fast_copyout) {
-		res = fubyte_fast_tramp(base, KCR3);
+		res = fubyte_fast_tramp(base, pmap_get_kcr3());
 		if (res != -1)
 			return (res);
 	}
@@ -322,7 +310,7 @@ fuword16(volatile const void *base)
 	    (uintptr_t)base + sizeof(uint16_t) > VM_MAXUSER_ADDRESS)
 		return (-1);
 	if (fast_copyout) {
-		res = fuword16_fast_tramp(base, KCR3);
+		res = fuword16_fast_tramp(base, pmap_get_kcr3());
 		if (res != -1)
 			return (res);
 	}
@@ -348,7 +336,7 @@ fueword(volatile const void *base, long *val)
 	    (uintptr_t)base + sizeof(*val) > VM_MAXUSER_ADDRESS)
 		return (-1);
 	if (fast_copyout) {
-		if (fueword_fast_tramp(base, val, KCR3) == 0)
+		if (fueword_fast_tramp(base, val, pmap_get_kcr3()) == 0)
 			return (0);
 	}
 	if (cp_slow0((vm_offset_t)base, sizeof(long), false, fueword_slow0,
@@ -383,7 +371,7 @@ subyte(volatile void *base, int byte)
 	if ((uintptr_t)base + sizeof(uint8_t) < (uintptr_t)base ||
 	    (uintptr_t)base + sizeof(uint8_t) > VM_MAXUSER_ADDRESS)
 		return (-1);
-	if (fast_copyout && subyte_fast_tramp(base, byte, KCR3) == 0)
+	if (fast_copyout && subyte_fast_tramp(base, byte, pmap_get_kcr3()) == 0)
 		return (0);
 	return (cp_slow0((vm_offset_t)base, sizeof(u_char), true, subyte_slow0,
 	    &byte) != 0 ? -1 : 0);
@@ -403,7 +391,8 @@ suword16(volatile void *base, int word)
 	if ((uintptr_t)base + sizeof(uint16_t) < (uintptr_t)base ||
 	    (uintptr_t)base + sizeof(uint16_t) > VM_MAXUSER_ADDRESS)
 		return (-1);
-	if (fast_copyout && suword16_fast_tramp(base, word, KCR3) == 0)
+	if (fast_copyout && suword16_fast_tramp(base, word, pmap_get_kcr3())
+	    == 0)
 		return (0);
 	return (cp_slow0((vm_offset_t)base, sizeof(int16_t), true,
 	    suword16_slow0, &word) != 0 ? -1 : 0);
@@ -423,7 +412,7 @@ suword(volatile void *base, long word)
 	if ((uintptr_t)base + sizeof(word) < (uintptr_t)base ||
 	    (uintptr_t)base + sizeof(word) > VM_MAXUSER_ADDRESS)
 		return (-1);
-	if (fast_copyout && suword_fast_tramp(base, word, KCR3) == 0)
+	if (fast_copyout && suword_fast_tramp(base, word, pmap_get_kcr3()) == 0)
 		return (0);
 	return (cp_slow0((vm_offset_t)base, sizeof(long), true,
 	    suword_slow0, &word) != 0 ? -1 : 0);

Modified: head/sys/i386/i386/genassym.c
==============================================================================
--- head/sys/i386/i386/genassym.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/genassym.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -101,21 +101,8 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
 
 ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES);
 ASSYM(PAGE_SIZE, PAGE_SIZE);
-ASSYM(NPTEPG, NPTEPG);
-ASSYM(NPDEPG, NPDEPG);
-ASSYM(NPDEPTD, NPDEPTD);
-ASSYM(NPGPTD, NPGPTD);
-ASSYM(PDESIZE, sizeof(pd_entry_t));
-ASSYM(PTESIZE, sizeof(pt_entry_t));
-ASSYM(PDESHIFT, PDESHIFT);
-ASSYM(PTESHIFT, PTESHIFT);
 ASSYM(PAGE_SHIFT, PAGE_SHIFT);
 ASSYM(PAGE_MASK, PAGE_MASK);
-ASSYM(PDRSHIFT, PDRSHIFT);
-ASSYM(PDRMASK, PDRMASK);
-ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS);
-ASSYM(KERNBASE, KERNBASE);
-ASSYM(KERNLOAD, KERNLOAD);
 ASSYM(PCB_CR0, offsetof(struct pcb, pcb_cr0));
 ASSYM(PCB_CR2, offsetof(struct pcb, pcb_cr2));
 ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3));
@@ -222,6 +209,9 @@ ASSYM(PC_KESP0, offsetof(struct pcpu, pc_kesp0));
 ASSYM(PC_TRAMPSTK, offsetof(struct pcpu, pc_trampstk));
 ASSYM(PC_COPYOUT_BUF, offsetof(struct pcpu, pc_copyout_buf));
 ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set));
+ASSYM(PMAP_TRM_MIN_ADDRESS, PMAP_TRM_MIN_ADDRESS);
+ASSYM(KERNLOAD, KERNLOAD);
+ASSYM(KERNBASE, KERNBASE);
 
 #ifdef DEV_APIC
 ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL);
@@ -237,7 +227,6 @@ ASSYM(GPROC0_SEL, GPROC0_SEL);
 ASSYM(VM86_FRAMESIZE, sizeof(struct vm86frame));
 ASSYM(VM86_STACK_SPACE, VM86_STACK_SPACE);
 
-ASSYM(PMAP_TRM_MIN_ADDRESS, PMAP_TRM_MIN_ADDRESS);
 ASSYM(TRAMP_COPYOUT_SZ, TRAMP_COPYOUT_SZ);
 
 #ifdef	HWPMC_HOOKS

Modified: head/sys/i386/i386/initcpu.c
==============================================================================
--- head/sys/i386/i386/initcpu.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/initcpu.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -632,6 +632,7 @@ extern int elf32_nxstack;
 void
 initializecpu(void)
 {
+	uint64_t msr;
 
 	switch (cpu) {
 #ifdef I486_CPU
@@ -744,16 +745,10 @@ initializecpu(void)
 		load_cr4(rcr4() | CR4_FXSR | CR4_XMM);
 		cpu_fxsr = hw_instruction_sse = 1;
 	}
-#if defined(PAE) || defined(PAE_TABLES)
-	if ((amd_feature & AMDID_NX) != 0) {
-		uint64_t msr;
-
+	if (elf32_nxstack) {
 		msr = rdmsr(MSR_EFER) | EFER_NXE;
 		wrmsr(MSR_EFER, msr);
-		pg_nx = PG_NX;
-		elf32_nxstack = 1;
 	}
-#endif
 }
 
 void

Modified: head/sys/i386/i386/locore.s
==============================================================================
--- head/sys/i386/i386/locore.s	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/locore.s	Wed Jan 30 02:07:13 2019	(r343567)
@@ -54,15 +54,6 @@
 #include "assym.inc"
 
 /*
- * PTmap is recursive pagemap at top of virtual address space.
- * Within PTmap, the page directory can be found (third indirection).
- */
-	.globl	PTmap,PTD,PTDpde
-	.set	PTmap,(PTDPTDI << PDRSHIFT)
-	.set	PTD,PTmap + (PTDPTDI * PAGE_SIZE)
-	.set	PTDpde,PTD + (PTDPTDI * PDESIZE)
-
-/*
  * Compiled KERNBASE location and the kernel load address, now identical.
  */
 	.globl	kernbase

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/machdep.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -175,6 +175,8 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, 
 
 int	_udatasel, _ucodesel;
 u_int	basemem;
+static int above4g_allow = 1;
+static int above24g_allow = 0;
 
 int cold = 1;
 
@@ -1675,6 +1677,7 @@ static int
 add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap,
     int *physmap_idxp)
 {
+	uint64_t lim, ign;
 	int i, insert_idx, physmap_idx;
 
 	physmap_idx = *physmap_idxp;
@@ -1682,13 +1685,24 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_p
 	if (length == 0)
 		return (1);
 
-#ifndef PAE
-	if (base > 0xffffffff) {
-		printf("%uK of memory above 4GB ignored\n",
-		    (u_int)(length / 1024));
+	lim = 0x100000000;					/*  4G */
+	if (pae_mode && above4g_allow)
+		lim = above24g_allow ? -1ULL : 0x600000000;	/* 24G */
+	if (base >= lim) {
+		printf("%uK of memory above %uGB ignored, pae %d "
+		    "above4g_allow %d above24g_allow %d\n",
+		    (u_int)(length / 1024), (u_int)(lim >> 30), pae_mode,
+		    above4g_allow, above24g_allow);
 		return (1);
 	}
-#endif
+	if (base + length >= lim) {
+		ign = base + length - lim;
+		length -= ign;
+		printf("%uK of memory above %uGB ignored, pae %d "
+		    "above4g_allow %d above24g_allow %d\n",
+		    (u_int)(ign / 1024), (u_int)(lim >> 30), pae_mode,
+		    above4g_allow, above24g_allow);
+	}
 
 	/*
 	 * Find insertion point while checking for overlap.  Start off by
@@ -1781,8 +1795,6 @@ add_smap_entries(struct bios_smap *smapbase, vm_paddr_
 static void
 basemem_setup(void)
 {
-	pt_entry_t *pte;
-	int i;
 
 	if (basemem > 640) {
 		printf("Preposterous BIOS basemem of %uK, truncating to 640K\n",
@@ -1790,15 +1802,7 @@ basemem_setup(void)
 		basemem = 640;
 	}
 
-	/*
-	 * Map pages between basemem and ISA_HOLE_START, if any, r/w into
-	 * the vm86 page table so that vm86 can scribble on them using
-	 * the vm86 map too.  XXX: why 2 ways for this and only 1 way for
-	 * page 0, at least as initialized here?
-	 */
-	pte = (pt_entry_t *)vm86paddr;
-	for (i = basemem / 4; i < 160; i++)
-		pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U;
+	pmap_basemem_setup(basemem);
 }
 
 /*
@@ -1820,7 +1824,6 @@ getmemsize(int first)
 	int has_smap, off, physmap_idx, pa_indx, da_indx;
 	u_long memtest;
 	vm_paddr_t physmap[PHYSMAP_SIZE];
-	pt_entry_t *pte;
 	quad_t dcons_addr, dcons_size, physmem_tunable;
 	int hasbrokenint12, i, res;
 	u_int extmem;
@@ -1841,6 +1844,9 @@ getmemsize(int first)
 	 */
 	vm_phys_add_seg((vm_paddr_t)KERNLOAD, trunc_page(first));
 
+	TUNABLE_INT_FETCH("hw.above4g_allow", &above4g_allow);
+	TUNABLE_INT_FETCH("hw.above24g_allow", &above24g_allow);
+
 	/*
 	 * Check if the loader supplied an SMAP memory map.  If so,
 	 * use that and do not make any VM86 calls.
@@ -2031,7 +2037,6 @@ physmap_done:
 	phys_avail[pa_indx++] = physmap[0];
 	phys_avail[pa_indx] = physmap[0];
 	dump_avail[da_indx] = physmap[0];
-	pte = CMAP3;
 
 	/*
 	 * Get dcons buffer address
@@ -2052,7 +2057,7 @@ physmap_done:
 			end = trunc_page(physmap[i + 1]);
 		for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) {
 			int tmp, page_bad, full;
-			int *ptr = (int *)CADDR3;
+			int *ptr;
 
 			full = FALSE;
 			/*
@@ -2076,8 +2081,7 @@ physmap_done:
 			/*
 			 * map page into kernel: valid, read/write,non-cacheable
 			 */
-			*pte = pa | PG_V | PG_RW | PG_N;
-			invltlb();
+			ptr = (int *)pmap_cmap3(pa, PG_V | PG_RW | PG_N);
 
 			tmp = *(int *)ptr;
 			/*
@@ -2158,8 +2162,7 @@ do_next:
 				break;
 		}
 	}
-	*pte = 0;
-	invltlb();
+	pmap_cmap3(0, 0);
 	
 	/*
 	 * XXX
@@ -2414,6 +2417,7 @@ init386(int first)
 
 	finishidentcpu();	/* Final stage of CPU initialization */
 	i386_setidt2();
+	pmap_set_nx();
 	initializecpu();	/* Initialize CPU registers */
 	initializecpucache();
 
@@ -2508,11 +2512,7 @@ init386(int first)
 
 	/* setup proc 0's pcb */
 	thread0.td_pcb->pcb_flags = 0;
-#if defined(PAE) || defined(PAE_TABLES)
-	thread0.td_pcb->pcb_cr3 = (int)IdlePDPT;
-#else
-	thread0.td_pcb->pcb_cr3 = (int)IdlePTD;
-#endif
+	thread0.td_pcb->pcb_cr3 = pmap_get_kcr3();
 	thread0.td_pcb->pcb_ext = 0;
 	thread0.td_frame = &proc0_tf;
 
@@ -2581,11 +2581,7 @@ machdep_init_trampoline(void)
 	    (int)dblfault_stack + PAGE_SIZE;
 	dblfault_tss->tss_ss = dblfault_tss->tss_ss0 = dblfault_tss->tss_ss1 =
 	    dblfault_tss->tss_ss2 = GSEL(GDATA_SEL, SEL_KPL);
-#if defined(PAE) || defined(PAE_TABLES)
-	dblfault_tss->tss_cr3 = (int)IdlePDPT;
-#else
-	dblfault_tss->tss_cr3 = (int)IdlePTD;
-#endif
+	dblfault_tss->tss_cr3 = pmap_get_kcr3();
 	dblfault_tss->tss_eip = (int)dblfault_handler;
 	dblfault_tss->tss_eflags = PSL_KERNEL;
 	dblfault_tss->tss_ds = dblfault_tss->tss_es =

Modified: head/sys/i386/i386/mem.c
==============================================================================
--- head/sys/i386/i386/mem.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/mem.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -148,7 +148,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
 		error = uiomove((caddr_t)&ptvmmap[o], (int)c, uio);
 		pmap_qremove((vm_offset_t)ptvmmap, 1);
 		sx_xunlock(&memsxlock);
-		
 	}
 
 	return (error);

Modified: head/sys/i386/i386/minidump_machdep.c
==============================================================================
--- head/sys/i386/i386/minidump_machdep.c	Tue Jan 29 22:46:44 2019	(r343566)
+++ head/sys/i386/i386/minidump_machdep.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -49,310 +49,11 @@ __FBSDID("$FreeBSD$");
 
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
-#define	MD_ALIGN(x)	(((off_t)(x) + PAGE_MASK) & ~PAGE_MASK)
-#define	DEV_ALIGN(x)	roundup2((off_t)(x), DEV_BSIZE)
-
 uint32_t *vm_page_dump;
 int vm_page_dump_size;
 
-static struct kerneldumpheader kdh;
-
-/* Handle chunked writes. */
-static size_t fragsz;
-static void *dump_va;
-static uint64_t counter, progress;
-
 CTASSERT(sizeof(*vm_page_dump) == 4);
 
-
-static int
-is_dumpable(vm_paddr_t pa)
-{
-	int i;
-
-	for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) {
-		if (pa >= dump_avail[i] && pa < dump_avail[i + 1])
-			return (1);
-	}
-	return (0);
-}
-
-#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8)
-
-static int
-blk_flush(struct dumperinfo *di)
-{
-	int error;
-
-	if (fragsz == 0)
-		return (0);
-
-	error = dump_append(di, dump_va, 0, fragsz);
-	fragsz = 0;
-	return (error);
-}
-
-static int
-blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
-{
-	size_t len;
-	int error, i, c;
-	u_int maxdumpsz;
-
-	maxdumpsz = min(di->maxiosize, MAXDUMPPGS * PAGE_SIZE);
-	if (maxdumpsz == 0)	/* seatbelt */
-		maxdumpsz = PAGE_SIZE;
-	error = 0;
-	if ((sz % PAGE_SIZE) != 0) {
-		printf("size not page aligned\n");
-		return (EINVAL);
-	}
-	if (ptr != NULL && pa != 0) {
-		printf("cant have both va and pa!\n");
-		return (EINVAL);
-	}
-	if (pa != 0 && (((uintptr_t)ptr) % PAGE_SIZE) != 0) {
-		printf("address not page aligned\n");
-		return (EINVAL);
-	}
-	if (ptr != NULL) {
-		/* If we're doing a virtual dump, flush any pre-existing pa pages */
-		error = blk_flush(di);
-		if (error)
-			return (error);
-	}
-	while (sz) {
-		len = maxdumpsz - fragsz;
-		if (len > sz)
-			len = sz;
-		counter += len;
-		progress -= len;
-		if (counter >> 24) {
-			printf(" %lld", PG2MB(progress >> PAGE_SHIFT));
-			counter &= (1<<24) - 1;
-		}
-
-		wdog_kern_pat(WD_LASTVAL);
-
-		if (ptr) {
-			error = dump_append(di, ptr, 0, len);
-			if (error)
-				return (error);
-			ptr += len;
-			sz -= len;
-		} else {
-			for (i = 0; i < len; i += PAGE_SIZE)
-				dump_va = pmap_kenter_temporary(pa + i, (i + fragsz) >> PAGE_SHIFT);
-			fragsz += len;
-			pa += len;
-			sz -= len;
-			if (fragsz == maxdumpsz) {
-				error = blk_flush(di);
-				if (error)
-					return (error);
-			}
-		}
-
-		/* Check for user abort. */
-		c = cncheckc();
-		if (c == 0x03)
-			return (ECANCELED);
-		if (c != -1)
-			printf(" (CTRL-C to abort) ");
-	}
-
-	return (0);
-}
-
-/* A fake page table page, to avoid having to handle both 4K and 2M pages */
-static pt_entry_t fakept[NPTEPG];
-
-int
-minidumpsys(struct dumperinfo *di)
-{
-	uint64_t dumpsize;
-	uint32_t ptesize;
-	vm_offset_t va;
-	int error;
-	uint32_t bits;
-	uint64_t pa;
-	pd_entry_t *pd;
-	pt_entry_t *pt;
-	int i, j, k, bit;
-	struct minidumphdr mdhdr;
-
-	counter = 0;
-	/* Walk page table pages, set bits in vm_page_dump */
-	ptesize = 0;
-	for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) {
-		/*
-		 * We always write a page, even if it is zero. Each
-		 * page written corresponds to 2MB of space
-		 */
-		ptesize += PAGE_SIZE;
-		pd = IdlePTD;	/* always mapped! */
-		j = va >> PDRSHIFT;
-		if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V))  {
-			/* This is an entire 2M page. */
-			pa = pd[j] & PG_PS_FRAME;
-			for (k = 0; k < NPTEPG; k++) {
-				if (is_dumpable(pa))
-					dump_add_page(pa);
-				pa += PAGE_SIZE;
-			}
-			continue;
-		}
-		if ((pd[j] & PG_V) == PG_V) {
-			/* set bit for each valid page in this 2MB block */
-			pt = pmap_kenter_temporary(pd[j] & PG_FRAME, 0);
-			for (k = 0; k < NPTEPG; k++) {
-				if ((pt[k] & PG_V) == PG_V) {
-					pa = pt[k] & PG_FRAME;
-					if (is_dumpable(pa))
-						dump_add_page(pa);
-				}
-			}
-		} else {
-			/* nothing, we're going to dump a null page */
-		}
-	}
-
-	/* Calculate dump size. */
-	dumpsize = ptesize;
-	dumpsize += round_page(msgbufp->msg_size);
-	dumpsize += round_page(vm_page_dump_size);
-	for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) {
-		bits = vm_page_dump[i];
-		while (bits) {
-			bit = bsfl(bits);
-			pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + bit) * PAGE_SIZE;
-			/* Clear out undumpable pages now if needed */
-			if (is_dumpable(pa)) {
-				dumpsize += PAGE_SIZE;
-			} else {
-				dump_drop_page(pa);
-			}
-			bits &= ~(1ul << bit);
-		}
-	}
-	dumpsize += PAGE_SIZE;
-
-	progress = dumpsize;
-
-	/* Initialize mdhdr */
-	bzero(&mdhdr, sizeof(mdhdr));
-	strcpy(mdhdr.magic, MINIDUMP_MAGIC);
-	mdhdr.version = MINIDUMP_VERSION;
-	mdhdr.msgbufsize = msgbufp->msg_size;
-	mdhdr.bitmapsize = vm_page_dump_size;
-	mdhdr.ptesize = ptesize;
-	mdhdr.kernbase = KERNBASE;
-#if defined(PAE) || defined(PAE_TABLES)
-	mdhdr.paemode = 1;
-#endif
-
-	dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION,
-	    dumpsize);
-
-	error = dump_start(di, &kdh);
-	if (error != 0)
-		goto fail;
-
-	printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576);
-	printf("Dumping %llu MB:", (long long)dumpsize >> 20);
-
-	/* Dump my header */
-	bzero(&fakept, sizeof(fakept));
-	bcopy(&mdhdr, &fakept, sizeof(mdhdr));
-	error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
-	if (error)
-		goto fail;
-
-	/* Dump msgbuf up front */
-	error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size));
-	if (error)
-		goto fail;
-
-	/* Dump bitmap */
-	error = blk_write(di, (char *)vm_page_dump, 0, round_page(vm_page_dump_size));
-	if (error)
-		goto fail;
-
-	/* Dump kernel page table pages */
-	for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) {
-		/* We always write a page, even if it is zero */
-		pd = IdlePTD;	/* always mapped! */
-		j = va >> PDRSHIFT;
-		if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V))  {
-			/* This is a single 2M block. Generate a fake PTP */
-			pa = pd[j] & PG_PS_FRAME;
-			for (k = 0; k < NPTEPG; k++) {
-				fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M;
-			}
-			error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
-			if (error)
-				goto fail;
-			/* flush, in case we reuse fakept in the same block */
-			error = blk_flush(di);
-			if (error)
-				goto fail;
-			continue;
-		}
-		if ((pd[j] & PG_V) == PG_V) {
-			pa = pd[j] & PG_FRAME;
-			error = blk_write(di, 0, pa, PAGE_SIZE);
-			if (error)
-				goto fail;
-		} else {
-			bzero(fakept, sizeof(fakept));
-			error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE);
-			if (error)
-				goto fail;
-			/* flush, in case we reuse fakept in the same block */
-			error = blk_flush(di);
-			if (error)
-				goto fail;
-		}
-	}
-
-	/* Dump memory chunks */
-	/* XXX cluster it up and use blk_dump() */
-	for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) {
-		bits = vm_page_dump[i];
-		while (bits) {
-			bit = bsfl(bits);
-			pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + bit) * PAGE_SIZE;
-			error = blk_write(di, 0, pa, PAGE_SIZE);
-			if (error)
-				goto fail;
-			bits &= ~(1ul << bit);
-		}
-	}
-
-	error = blk_flush(di);
-	if (error)
-		goto fail;
-
-	error = dump_finish(di, &kdh);
-	if (error != 0)
-		goto fail;
-
-	printf("\nDump complete\n");
-	return (0);
-
- fail:
-	if (error < 0)
-		error = -error;
-
-	if (error == ECANCELED)
-		printf("\nDump aborted\n");
-	else if (error == E2BIG || error == ENOSPC)
-		printf("\nDump failed. Partition too small.\n");
-	else
-		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
-	return (error);
-}
-
 void
 dump_add_page(vm_paddr_t pa)
 {
@@ -373,5 +74,12 @@ dump_drop_page(vm_paddr_t pa)
 	idx = pa >> 5;		/* 2^5 = 32 */
 	bit = pa & 31;
 	atomic_clear_int(&vm_page_dump[idx], 1ul << bit);
+}
+
+int
+minidumpsys(struct dumperinfo *di)
+{
+
+	return (pae_mode ? minidumpsys_pae(di) : minidumpsys_nopae(di));
 }
 

Copied and modified: head/sys/i386/i386/minidump_machdep_base.c (from r343566, head/sys/i386/i386/minidump_machdep.c)
==============================================================================
--- head/sys/i386/i386/minidump_machdep.c	Tue Jan 29 22:46:44 2019	(r343566, copy source)
+++ head/sys/i386/i386/minidump_machdep_base.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -52,8 +52,8 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512);
 #define	MD_ALIGN(x)	(((off_t)(x) + PAGE_MASK) & ~PAGE_MASK)
 #define	DEV_ALIGN(x)	roundup2((off_t)(x), DEV_BSIZE)
 
-uint32_t *vm_page_dump;
-int vm_page_dump_size;
+extern uint32_t *vm_page_dump;
+extern int vm_page_dump_size;
 
 static struct kerneldumpheader kdh;
 
@@ -167,6 +167,14 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t
 /* A fake page table page, to avoid having to handle both 4K and 2M pages */
 static pt_entry_t fakept[NPTEPG];
 
+#ifdef PMAP_PAE_COMP
+#define	minidumpsys	minidumpsys_pae
+#define	IdlePTD		IdlePTD_pae
+#else
+#define	minidumpsys	minidumpsys_nopae
+#define	IdlePTD		IdlePTD_nopae
+#endif
+
 int
 minidumpsys(struct dumperinfo *di)
 {
@@ -247,9 +255,7 @@ minidumpsys(struct dumperinfo *di)
 	mdhdr.bitmapsize = vm_page_dump_size;
 	mdhdr.ptesize = ptesize;
 	mdhdr.kernbase = KERNBASE;
-#if defined(PAE) || defined(PAE_TABLES)
-	mdhdr.paemode = 1;
-#endif
+	mdhdr.paemode = pae_mode;
 
 	dump_init_header(di, &kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION,
 	    dumpsize);
@@ -352,26 +358,3 @@ minidumpsys(struct dumperinfo *di)
 		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
 	return (error);
 }
-
-void
-dump_add_page(vm_paddr_t pa)
-{
-	int idx, bit;
-
-	pa >>= PAGE_SHIFT;
-	idx = pa >> 5;		/* 2^5 = 32 */
-	bit = pa & 31;
-	atomic_set_int(&vm_page_dump[idx], 1ul << bit);
-}
-
-void
-dump_drop_page(vm_paddr_t pa)
-{
-	int idx, bit;
-
-	pa >>= PAGE_SHIFT;
-	idx = pa >> 5;		/* 2^5 = 32 */
-	bit = pa & 31;
-	atomic_clear_int(&vm_page_dump[idx], 1ul << bit);
-}
-

Copied and modified: head/sys/i386/i386/minidump_machdep_nopae.c (from r343566, head/sys/i386/i386/minidump_machdep.c)
==============================================================================
--- head/sys/i386/i386/minidump_machdep.c	Tue Jan 29 22:46:44 2019	(r343566, copy source)
+++ head/sys/i386/i386/minidump_machdep_nopae.c	Wed Jan 30 02:07:13 2019	(r343567)
@@ -1,377 +1,40 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  *
- * Copyright (c) 2006 Peter Wemm
+ * Copyright (c) 2018 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by Konstantin Belousov <kib at FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
- *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include "opt_watchdog.h"
-
 #include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list