From 163529c2b33d50e706aebc5baeb16471732f4c2b Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Thu, 3 Apr 2003 23:44:35 +0000 Subject: [PATCH] - Removed APTD and associated macros, it is no longer used. BANG BANG BANG etc. Sponsored by: DARPA, Network Associates Laboratories --- sys/amd64/amd64/locore.S | 16 ---------------- sys/amd64/amd64/locore.s | 16 ---------------- sys/amd64/amd64/mem.c | 2 -- sys/amd64/amd64/pmap.c | 7 ++----- sys/amd64/include/pmap.h | 16 +++++++--------- sys/i386/i386/locore.s | 16 ---------------- sys/i386/i386/mem.c | 2 -- sys/i386/i386/pmap.c | 7 ++----- sys/i386/include/pmap.h | 16 +++++++--------- 9 files changed, 18 insertions(+), 80 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index 12e2e19a257f..8115e2399749 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -69,28 +69,12 @@ /* * PTmap is recursive pagemap at top of virtual address space. * Within PTmap, the page directory can be found (third indirection). - * - * NOTE: PTDpde, PTmap, and PTD are being defined as address symbols. - * In C you access them directly, and not with a '*'. Storage is not being - * allocated. They will magically address the correct locations in KVM - * which C will treat as normal variables of the type they are defined in - * machine/pmap.h, i.e. PTDpde = XX ; to set a PDE entry, NOT *PTDpde = XX; */ .globl PTmap,PTD,PTDpde .set PTmap,(PTDPTDI << PDRSHIFT) .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) .set PTDpde,PTD + (PTDPTDI * PDESIZE) -/* - * APTmap, APTD is the alternate recursive pagemap. - * It's used when modifying another process's page tables. - * See the note above. It is true here as well. - */ - .globl APTmap,APTD,APTDpde - .set APTmap,APTDPTDI << PDRSHIFT - .set APTD,APTmap + (APTDPTDI * PAGE_SIZE) - .set APTDpde,PTD + (APTDPTDI * PDESIZE) - #ifdef SMP /* * Define layout of per-cpu address space. diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index 12e2e19a257f..8115e2399749 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -69,28 +69,12 @@ /* * PTmap is recursive pagemap at top of virtual address space. * Within PTmap, the page directory can be found (third indirection). - * - * NOTE: PTDpde, PTmap, and PTD are being defined as address symbols. - * In C you access them directly, and not with a '*'. Storage is not being - * allocated. They will magically address the correct locations in KVM - * which C will treat as normal variables of the type they are defined in - * machine/pmap.h, i.e. PTDpde = XX ; to set a PDE entry, NOT *PTDpde = XX; */ .globl PTmap,PTD,PTDpde .set PTmap,(PTDPTDI << PDRSHIFT) .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) .set PTDpde,PTD + (PTDPTDI * PDESIZE) -/* - * APTmap, APTD is the alternate recursive pagemap. - * It's used when modifying another process's page tables. - * See the note above. It is true here as well. - */ - .globl APTmap,APTD,APTDpde - .set APTmap,APTDPTDI << PDRSHIFT - .set APTD,APTmap + (APTDPTDI * PAGE_SIZE) - .set APTDpde,PTD + (APTDPTDI * PDESIZE) - #ifdef SMP /* * Define layout of per-cpu address space. diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index 37a9cec0be59..8ec934f0f40e 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -179,8 +179,6 @@ mmrw(dev_t dev, struct uio *uio, int flags) if (addr < (vm_offset_t)VADDR(PTDPTDI, 0)) return (EFAULT); - if (eaddr >= (vm_offset_t)VADDR(APTDPTDI, 0)) - return (EFAULT); for (; addr < eaddr; addr += PAGE_SIZE) if (pmap_extract(kernel_pmap, addr) == 0) return (EFAULT); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 77c53e0904ec..9335a31fe002 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1636,11 +1636,8 @@ pmap_release(pmap_t pmap) LIST_REMOVE(pmap, pm_list); mtx_unlock_spin(&allpmaps_lock); - bzero(pmap->pm_pdir + KPTDI, nkpt * sizeof(*pmap->pm_pdir)); - for (i = 0; i < NPGPTD; i++) { - pmap->pm_pdir[PTDPTDI + i] = 0; - pmap->pm_pdir[APTDPTDI + i] = 0; - } + bzero(pmap->pm_pdir + PTDPTDI, (nkpt + NPGPTD) * + sizeof(*pmap->pm_pdir)); #ifdef SMP pmap->pm_pdir[MPPTDI] = 0; #endif diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index f044d453abd9..d1e29753e788 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -109,9 +109,9 @@ #endif #ifndef NKPDE #ifdef SMP -#define NKPDE (KVA_PAGES - (NPGPTD + 1)) /* number of page tables/pde's */ +#define NKPDE (KVA_PAGES - 1) /* number of page tables/pde's */ #else -#define NKPDE (KVA_PAGES - NPGPTD) /* number of page tables/pde's */ +#define NKPDE (KVA_PAGES) /* number of page tables/pde's */ #endif #endif @@ -123,12 +123,11 @@ * * SMP_PRIVPAGES: The per-cpu address space is 0xff80000 -> 0xffbfffff */ -#define APTDPTDI (NPDEPTD-NPGPTD) /* alt ptd entry that points to APTD */ #ifdef SMP -#define MPPTDI (APTDPTDI-1) /* per cpu ptd entry */ +#define MPPTDI (NPDEPTD-1) /* per cpu ptd entry */ #define KPTDI (MPPTDI-NKPDE) /* start of kernel virtual pde's */ #else -#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ +#define KPTDI (NPDEPTD-NKPDE)/* start of kernel virtual pde's */ #endif /* SMP */ #define PTDPTDI (KPTDI-NPGPTD) /* ptd entry that points to ptd! */ @@ -166,9 +165,9 @@ typedef uint32_t pt_entry_t; * and directories. */ #ifdef _KERNEL -extern pt_entry_t PTmap[], APTmap[]; -extern pd_entry_t PTD[], APTD[]; -extern pd_entry_t PTDpde[], APTDpde[]; +extern pt_entry_t PTmap[]; +extern pd_entry_t PTD[]; +extern pd_entry_t PTDpde[]; #ifdef PAE extern pdpt_entry_t *IdlePDPT; @@ -184,7 +183,6 @@ extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ * the corresponding pde that in turn maps it. */ #define vtopte(va) (PTmap + i386_btop(va)) -#define avtopte(va) (APTmap + i386_btop(va)) /* * Routine: pmap_kextract diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index 12e2e19a257f..8115e2399749 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -69,28 +69,12 @@ /* * PTmap is recursive pagemap at top of virtual address space. * Within PTmap, the page directory can be found (third indirection). - * - * NOTE: PTDpde, PTmap, and PTD are being defined as address symbols. - * In C you access them directly, and not with a '*'. Storage is not being - * allocated. They will magically address the correct locations in KVM - * which C will treat as normal variables of the type they are defined in - * machine/pmap.h, i.e. PTDpde = XX ; to set a PDE entry, NOT *PTDpde = XX; */ .globl PTmap,PTD,PTDpde .set PTmap,(PTDPTDI << PDRSHIFT) .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) .set PTDpde,PTD + (PTDPTDI * PDESIZE) -/* - * APTmap, APTD is the alternate recursive pagemap. - * It's used when modifying another process's page tables. - * See the note above. It is true here as well. - */ - .globl APTmap,APTD,APTDpde - .set APTmap,APTDPTDI << PDRSHIFT - .set APTD,APTmap + (APTDPTDI * PAGE_SIZE) - .set APTDpde,PTD + (APTDPTDI * PDESIZE) - #ifdef SMP /* * Define layout of per-cpu address space. diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index 37a9cec0be59..8ec934f0f40e 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -179,8 +179,6 @@ mmrw(dev_t dev, struct uio *uio, int flags) if (addr < (vm_offset_t)VADDR(PTDPTDI, 0)) return (EFAULT); - if (eaddr >= (vm_offset_t)VADDR(APTDPTDI, 0)) - return (EFAULT); for (; addr < eaddr; addr += PAGE_SIZE) if (pmap_extract(kernel_pmap, addr) == 0) return (EFAULT); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 77c53e0904ec..9335a31fe002 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1636,11 +1636,8 @@ pmap_release(pmap_t pmap) LIST_REMOVE(pmap, pm_list); mtx_unlock_spin(&allpmaps_lock); - bzero(pmap->pm_pdir + KPTDI, nkpt * sizeof(*pmap->pm_pdir)); - for (i = 0; i < NPGPTD; i++) { - pmap->pm_pdir[PTDPTDI + i] = 0; - pmap->pm_pdir[APTDPTDI + i] = 0; - } + bzero(pmap->pm_pdir + PTDPTDI, (nkpt + NPGPTD) * + sizeof(*pmap->pm_pdir)); #ifdef SMP pmap->pm_pdir[MPPTDI] = 0; #endif diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index f044d453abd9..d1e29753e788 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -109,9 +109,9 @@ #endif #ifndef NKPDE #ifdef SMP -#define NKPDE (KVA_PAGES - (NPGPTD + 1)) /* number of page tables/pde's */ +#define NKPDE (KVA_PAGES - 1) /* number of page tables/pde's */ #else -#define NKPDE (KVA_PAGES - NPGPTD) /* number of page tables/pde's */ +#define NKPDE (KVA_PAGES) /* number of page tables/pde's */ #endif #endif @@ -123,12 +123,11 @@ * * SMP_PRIVPAGES: The per-cpu address space is 0xff80000 -> 0xffbfffff */ -#define APTDPTDI (NPDEPTD-NPGPTD) /* alt ptd entry that points to APTD */ #ifdef SMP -#define MPPTDI (APTDPTDI-1) /* per cpu ptd entry */ +#define MPPTDI (NPDEPTD-1) /* per cpu ptd entry */ #define KPTDI (MPPTDI-NKPDE) /* start of kernel virtual pde's */ #else -#define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ +#define KPTDI (NPDEPTD-NKPDE)/* start of kernel virtual pde's */ #endif /* SMP */ #define PTDPTDI (KPTDI-NPGPTD) /* ptd entry that points to ptd! */ @@ -166,9 +165,9 @@ typedef uint32_t pt_entry_t; * and directories. */ #ifdef _KERNEL -extern pt_entry_t PTmap[], APTmap[]; -extern pd_entry_t PTD[], APTD[]; -extern pd_entry_t PTDpde[], APTDpde[]; +extern pt_entry_t PTmap[]; +extern pd_entry_t PTD[]; +extern pd_entry_t PTDpde[]; #ifdef PAE extern pdpt_entry_t *IdlePDPT; @@ -184,7 +183,6 @@ extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */ * the corresponding pde that in turn maps it. */ #define vtopte(va) (PTmap + i386_btop(va)) -#define avtopte(va) (APTmap + i386_btop(va)) /* * Routine: pmap_kextract