Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Remove the __HAVE_CPU_UAREA_ROUTINES code from x86.
details: https://anonhg.NetBSD.org/src/rev/2d07bb67fddc
branches: trunk
changeset: 360554:2d07bb67fddc
user: maxv <maxv%NetBSD.org@localhost>
date: Fri Mar 16 12:19:35 2018 +0000
description:
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.
diffstat:
sys/arch/amd64/include/types.h | 3 +-
sys/arch/x86/x86/vm_machdep.c | 59 +----------------------------------------
2 files changed, 3 insertions(+), 59 deletions(-)
diffs (94 lines):
diff -r 571627df7baf -r 2d07bb67fddc sys/arch/amd64/include/types.h
--- a/sys/arch/amd64/include/types.h Fri Mar 16 12:10:16 2018 +0000
+++ b/sys/arch/amd64/include/types.h Fri Mar 16 12:19:35 2018 +0000
@@ -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 @@
#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
diff -r 571627df7baf -r 2d07bb67fddc sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c Fri Mar 16 12:10:16 2018 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c Fri Mar 16 12:19:35 2018 +0000
@@ -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 @@
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 */
Home |
Main Index |
Thread Index |
Old Index