summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2008-12-18 14:18:30 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2008-12-18 14:18:30 +0000
commit80958c80f41e8e034f1f8e5781e0d8e3456ee627 (patch)
tree9ff11407f29d58598d42981d9da36cb2f7128c3c /sys/arch/amd64
parentfde7dee97f3bbfea0d41129c4f5af8aa860bd32d (diff)
Don't set the global bit PG_G for kernel pmap low memory mappings.
ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/pmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 19249b74f24..34e25c702d5 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.34 2008/12/18 13:43:24 kurt Exp $ */
+/* $OpenBSD: pmap.c,v 1.35 2008/12/18 14:18:29 kurt Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -447,8 +447,12 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot)
pte = kvtopte(va);
- npte = pa | ((prot & VM_PROT_WRITE) ? PG_RW : PG_RO) |
- PG_V | pmap_pg_g;
+ npte = pa | ((prot & VM_PROT_WRITE) ? PG_RW : PG_RO) | PG_V;
+
+ /* special 1:1 mappings in the first 2MB must not be global */
+ if (va >= (vaddr_t)NBPD_L2)
+ npte |= pmap_pg_g;
+
if ((cpu_feature & CPUID_NXE) && !(prot & VM_PROT_EXECUTE))
npte |= PG_NX;
opte = pmap_pte_set(pte, npte);