Module Name: src
Committed By: maxv
Date: Fri Mar 16 12:19:35 UTC 2018
Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/x86/x86: vm_machdep.c
Log Message:
Remove the __HAVE_CPU_UAREA_ROUTINES code from x86.
It was available only in amd64, and I disabled it a few months ago in
order to support SVS. Regardless of SVS this option was questionable,
since it made stack overflows more difficult to detect.
To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/vm_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.54 src/sys/arch/amd64/include/types.h:1.55
--- src/sys/arch/amd64/include/types.h:1.54 Thu Jan 11 09:00:04 2018
+++ src/sys/arch/amd64/include/types.h Fri Mar 16 12:19:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.54 2018/01/11 09:00:04 maxv Exp $ */
+/* $NetBSD: types.h,v 1.55 2018/03/16 12:19:35 maxv Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -106,7 +106,6 @@ typedef unsigned char __cpu_simple_lock
#define __HAVE_DIRECT_MAP 1
#define __HAVE_MM_MD_DIRECT_MAPPED_IO
#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
-/* #define __HAVE_CPU_UAREA_ROUTINES */
#if !defined(NO_PCI_MSI_MSIX)
#define __HAVE_PCI_MSI_MSIX
#endif
Index: src/sys/arch/x86/x86/vm_machdep.c
diff -u src/sys/arch/x86/x86/vm_machdep.c:1.32 src/sys/arch/x86/x86/vm_machdep.c:1.33
--- src/sys/arch/x86/x86/vm_machdep.c:1.32 Thu Jan 18 07:25:34 2018
+++ src/sys/arch/x86/x86/vm_machdep.c Fri Mar 16 12:19:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.32 2018/01/18 07:25:34 maxv Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.33 2018/03/16 12:19:35 maxv Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.32 2018/01/18 07:25:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.33 2018/03/16 12:19:35 maxv Exp $");
#include "opt_mtrr.h"
@@ -367,58 +367,3 @@ vunmapbuf(struct buf *bp, vsize_t len)
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = 0;
}
-
-#ifdef __HAVE_CPU_UAREA_ROUTINES
-void *
-cpu_uarea_alloc(bool system)
-{
- struct pglist pglist;
- int error;
-
- /*
- * Allocate a new physically contiguous uarea which can be
- * direct-mapped.
- */
- error = uvm_pglistalloc(USPACE, 0, ptoa(physmem), 0, 0, &pglist, 1, 1);
- if (error) {
- return NULL;
- }
-
- /*
- * Get the physical address from the first page.
- */
- const struct vm_page * const pg = TAILQ_FIRST(&pglist);
- KASSERT(pg != NULL);
- const paddr_t pa = VM_PAGE_TO_PHYS(pg);
-
- /*
- * We need to return a direct-mapped VA for the pa.
- */
-
- return (void *)PMAP_MAP_POOLPAGE(pa);
-}
-
-/*
- * Return true if we freed it, false if we didn't.
- */
-bool
-cpu_uarea_free(void *vva)
-{
- vaddr_t va = (vaddr_t) vva;
-
- if (va < PMAP_DIRECT_BASE || va >= PMAP_DIRECT_END) {
- return false;
- }
-
- /*
- * Since the pages are physically contiguous, the vm_page structures
- * will be as well.
- */
- struct vm_page *pg = PHYS_TO_VM_PAGE(PMAP_UNMAP_POOLPAGE(va));
- KASSERT(pg != NULL);
- for (size_t i = 0; i < UPAGES; i++, pg++) {
- uvm_pagefree(pg);
- }
- return true;
-}
-#endif /* __HAVE_CPU_UAREA_ROUTINES */