summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_sparc.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-03-18 20:56:38 +0000
committermiod <miod@openbsd.org>2015-03-18 20:56:38 +0000
commit3218a55d2e961abf77beef4ad3b27f1f149deda0 (patch)
tree13f9db9cbef349e08dc618ea943b974481a709f6 /lib/libkvm/kvm_sparc.c
parentAllow for VM_MIN_KERNEL_ADDRESS to not be a constant. (diff)
downloadwireguard-openbsd-3218a55d2e961abf77beef4ad3b27f1f149deda0.tar.xz
wireguard-openbsd-3218a55d2e961abf77beef4ad3b27f1f149deda0.zip
Rework the virtual memory layout on SRMMU systems (sun4d/sun4m) to use a much
lower VM_MIN_KERNEL_ADDRESS, since these systems are not crippled by the Sun-4 MMU hole and have the real 4GB of address space. Kernels running on Sun-4 MMU are not affected and will still be restricted to the existing 128MB of kernel space, with 1GB - 128MB of user space. Kernels running on SRMMU will now provide the low 3GB of address space to userland, and use the top 1GB for the kernel, except when compiled with option SMALL_KERNEL, in which case they will keep Sun-4 style the layout (this is temporary to allow for people to boot bsd.rd to upgrade even when not running 2.10 boot blocks, and will be removed eventually) A consequence of this is that the top of the userland stack is no longer at 0xf0000000. But since nothing in userland uses USRSTACK anymore, this should not be an issue. Tested on sun4c and various sun4m, with physical memory sizes ranging from 32 to 448MB.
Diffstat (limited to 'lib/libkvm/kvm_sparc.c')
-rw-r--r--lib/libkvm/kvm_sparc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libkvm/kvm_sparc.c b/lib/libkvm/kvm_sparc.c
index b1d75719183..931d5194d72 100644
--- a/lib/libkvm/kvm_sparc.c
+++ b/lib/libkvm/kvm_sparc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_sparc.c,v 1.13 2013/11/01 15:57:56 deraadt Exp $ */
+/* $OpenBSD: kvm_sparc.c,v 1.14 2015/03/18 20:56:38 miod Exp $ */
/* $NetBSD: kvm_sparc.c,v 1.9 1996/04/01 19:23:03 cgd Exp $ */
/*-
@@ -136,7 +136,7 @@ _kvm_kvatop44c(kvm_t *kd, u_long va, u_long *pa)
struct regmap *rp;
struct segmap *sp;
- if (va < KERNBASE)
+ if (va < VM_MIN_KERNEL_ADDRESS_OLD)
goto err;
/*
@@ -151,7 +151,7 @@ _kvm_kvatop44c(kvm_t *kd, u_long va, u_long *pa)
vr = VA_VREG(va);
vs = VA_VSEG(va);
- sp = &cpup->segmap_store[(vr-NUREG)*NSEGRG + vs];
+ sp = &cpup->segmap_store[(vr-NUREG_4C)*NSEGRG + vs];
if (sp->sg_npte == 0)
goto err;
if (sp->sg_pmeg == cpup->npmeg - 1) /* =seginval */
@@ -178,7 +178,7 @@ _kvm_kvatop4m(kvm_t *kd, u_long va, u_long *pa)
int vr, vs, pte;
off_t foff;
- if (va < KERNBASE)
+ if (va < VM_MIN_KERNEL_ADDRESS_SRMMU)
goto err;
/*
@@ -190,7 +190,7 @@ _kvm_kvatop4m(kvm_t *kd, u_long va, u_long *pa)
vr = VA_VREG(va);
vs = VA_VSEG(va);
- sp = &cpup->segmap_store[(vr-NUREG)*NSEGRG + vs];
+ sp = &cpup->segmap_store[(vr-NUREG_4M)*NSEGRG + vs];
if (sp->sg_npte == 0)
goto err;