From 80958c80f41e8e034f1f8e5781e0d8e3456ee627 Mon Sep 17 00:00:00 2001 From: Kurt Miller Date: Thu, 18 Dec 2008 14:18:30 +0000 Subject: Don't set the global bit PG_G for kernel pmap low memory mappings. ok deraadt@ --- sys/arch/amd64/amd64/pmap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/arch/amd64') 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); -- cgit v1.2.3