Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Disallow MAP_FIXED mmap's in the sparc64 VA...
details: https://anonhg.NetBSD.org/src/rev/ec3e6e255cb4
branches: trunk
changeset: 789868:ec3e6e255cb4
user: martin <martin%NetBSD.org@localhost>
date: Wed Sep 11 18:27:44 2013 +0000
description:
Disallow MAP_FIXED mmap's in the sparc64 VA hole (XXX - need to deal with
different variants of the hole for different CPU types)
diffstat:
sys/arch/sparc64/include/pmap.h | 7 ++++++-
sys/arch/sparc64/sparc64/pmap.c | 25 +++++++++++++++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diffs (71 lines):
diff -r 85fb508c1647 -r ec3e6e255cb4 sys/arch/sparc64/include/pmap.h
--- a/sys/arch/sparc64/include/pmap.h Wed Sep 11 18:26:14 2013 +0000
+++ b/sys/arch/sparc64/include/pmap.h Wed Sep 11 18:27:44 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.55 2011/10/06 06:55:34 mrg Exp $ */
+/* $NetBSD: pmap.h,v 1.56 2013/09/11 18:27:44 martin Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -90,6 +90,11 @@
#ifndef _LOCORE
+#ifdef _LP64
+int sparc64_mmap_range_test(vaddr_t, vaddr_t);
+#define MD_MMAP_RANGE_TEST(MINVA, MAXVA) sparc64_mmap_range_test(MINVA, MAXVA)
+#endif
+
/*
* Support for big page sizes. This maps the page size to the
* page bits.
diff -r 85fb508c1647 -r ec3e6e255cb4 sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c Wed Sep 11 18:26:14 2013 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c Wed Sep 11 18:27:44 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.280 2013/01/25 17:12:33 hannken Exp $ */
+/* $NetBSD: pmap.c,v 1.281 2013/09/11 18:27:44 martin Exp $ */
/*
*
* Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.280 2013/01/25 17:12:33 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.281 2013/09/11 18:27:44 martin Exp $");
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
#define HWREF
@@ -1839,6 +1839,11 @@
retry:
i = pseg_set(pm, va, tte.data, ptp);
+ if (i == -2) {
+ if (flags & PMAP_CANFAIL)
+ return (ENOMEM);
+ panic("pmap_enter: invalid VA (inside hole)");
+ }
if (i & 4) {
/* ptp used as L3 */
KASSERT(ptp != 0);
@@ -3735,3 +3740,19 @@
dcache_flush_page_all(pa);
pmap_zero_page_phys(pa);
}
+
+#ifdef _LP64
+int
+sparc64_mmap_range_test(vaddr_t addr, vaddr_t eaddr)
+{
+ const vaddr_t hole_start = 0x000007ffffffffff;
+ const vaddr_t hole_end = 0xfffff80000000000;
+
+ if (addr >= hole_end)
+ return 0;
+ if (eaddr <= hole_start)
+ return 0;
+
+ return EINVAL;
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index