From 3e899e106379f76b6bbe972de9fd7d71a01d8b3a Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Sun, 21 Jan 2001 06:50:03 +0000 Subject: [PATCH] Remove the per-cpu pages used for copy and zero-ing pages of memory for SMP; just use the same ones as UP. These weren't used without holding Giant anyway, and the routines that use them would have to be protected from pre-emption to avoid migrating cpus. --- sys/amd64/amd64/genassym.c | 8 ---- sys/amd64/amd64/mp_machdep.c | 8 ---- sys/amd64/amd64/mptable.c | 8 ---- sys/amd64/amd64/pmap.c | 83 +++-------------------------------- sys/amd64/include/mptable.h | 8 ---- sys/amd64/include/pcpu.h | 11 ----- sys/i386/i386/genassym.c | 8 ---- sys/i386/i386/mp_machdep.c | 8 ---- sys/i386/i386/mptable.c | 8 ---- sys/i386/i386/pmap.c | 83 +++-------------------------------- sys/i386/include/globaldata.h | 11 ----- sys/i386/include/mptable.h | 8 ---- sys/i386/include/pcpu.h | 11 ----- sys/kern/subr_smp.c | 8 ---- sys/sys/proc.h | 2 +- 15 files changed, 11 insertions(+), 262 deletions(-) diff --git a/sys/amd64/amd64/genassym.c b/sys/amd64/amd64/genassym.c index 00fd68d5253..8b9ca330d0a 100644 --- a/sys/amd64/amd64/genassym.c +++ b/sys/amd64/amd64/genassym.c @@ -201,14 +201,6 @@ ASSYM(GD_KTR_BUF_DATA, offsetof(struct globaldata, gd_ktr_buf_data)); ASSYM(GD_CPUID, offsetof(struct globaldata, gd_cpuid)); ASSYM(GD_CPU_LOCKID, offsetof(struct globaldata, gd_cpu_lockid)); ASSYM(GD_OTHER_CPUS, offsetof(struct globaldata, gd_other_cpus)); -ASSYM(GD_PRV_CMAP1, offsetof(struct globaldata, gd_prv_CMAP1)); -ASSYM(GD_PRV_CMAP2, offsetof(struct globaldata, gd_prv_CMAP2)); -ASSYM(GD_PRV_CMAP3, offsetof(struct globaldata, gd_prv_CMAP3)); -ASSYM(GD_PRV_PMAP1, offsetof(struct globaldata, gd_prv_PMAP1)); -ASSYM(GD_PRV_CADDR1, offsetof(struct globaldata, gd_prv_CADDR1)); -ASSYM(GD_PRV_CADDR2, offsetof(struct globaldata, gd_prv_CADDR2)); -ASSYM(GD_PRV_CADDR3, offsetof(struct globaldata, gd_prv_CADDR3)); -ASSYM(GD_PRV_PADDR1, offsetof(struct globaldata, gd_prv_PADDR1)); ASSYM(PS_IDLESTACK, offsetof(struct privatespace, idlestack)); ASSYM(PS_IDLESTACK_TOP, sizeof(struct privatespace)); diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f7d9dfaf92e..e60b5fb7505 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -190,10 +190,9 @@ static caddr_t crashdumpmap; #ifdef SMP extern pt_entry_t *SMPpt; -#else +#endif static pt_entry_t *PMAP1 = 0; static unsigned *PADDR1 = 0; -#endif static PMAP_INLINE void free_pv_entry __P((pv_entry_t pv)); static unsigned * get_ptbase __P((pmap_t pmap)); @@ -284,9 +283,6 @@ pmap_bootstrap(firstaddr, loadaddr) { vm_offset_t va; pt_entry_t *pte; -#ifdef SMP - struct globaldata *gd; -#endif avail_start = firstaddr; @@ -357,12 +353,10 @@ pmap_bootstrap(firstaddr, loadaddr) SYSMAP(struct msgbuf *, msgbufmap, msgbufp, atop(round_page(MSGBUF_SIZE))) -#if !defined(SMP) /* * ptemap is used for pmap_pte_quick */ SYSMAP(unsigned *, PMAP1, PADDR1, 1); -#endif virtual_avail = va; @@ -428,17 +422,6 @@ pmap_bootstrap(firstaddr, loadaddr) /* local apic is mapped on last page */ SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | pgeflag | (cpu_apic_address & PG_FRAME)); - - /* BSP does this itself, AP's get it pre-set */ - gd = &SMP_prvspace[0].globaldata; - gd->gd_prv_CMAP1 = &SMPpt[1]; - gd->gd_prv_CMAP2 = &SMPpt[2]; - gd->gd_prv_CMAP3 = &SMPpt[3]; - gd->gd_prv_PMAP1 = &SMPpt[4]; - gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1; #endif invltlb(); @@ -648,19 +631,11 @@ pmap_pte_quick(pmap, va) return (unsigned *) PTmap + index; } newpf = pde & PG_FRAME; -#ifdef SMP - if ( ((* (unsigned *) PCPU_GET(prv_PMAP1)) & PG_FRAME) != newpf) { - * (unsigned *) PCPU_GET(prv_PMAP1) = newpf | PG_RW | PG_V; - cpu_invlpg(PCPU_GET(prv_PADDR1)); - } - return (unsigned *)(PCPU_GET(prv_PADDR1) + (index & (NPTEPG - 1))); -#else if ( ((* (unsigned *) PMAP1) & PG_FRAME) != newpf) { * (unsigned *) PMAP1 = newpf | PG_RW | PG_V; invltlb_1pg((vm_offset_t) PADDR1); } return PADDR1 + ((unsigned) index & (NPTEPG - 1)); -#endif } return (0); } @@ -2669,22 +2644,7 @@ void pmap_zero_page(phys) vm_offset_t phys; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP3)) - panic("pmap_zero_page: prv_CMAP3 busy"); - *(int *) PCPU_GET(prv_CMAP3) = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - cpu_invlpg(PCPU_GET(prv_CADDR3)); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) - i686_pagezero(PCPU_GET(prv_CADDR3)); - else -#endif - bzero(PCPU_GET(prv_CADDR3), PAGE_SIZE); - - *(int *) PCPU_GET(prv_CMAP3) = 0; -#else if (*(int *) CMAP2) panic("pmap_zero_page: CMAP2 busy"); @@ -2698,7 +2658,6 @@ pmap_zero_page(phys) #endif bzero(CADDR2, PAGE_SIZE); *(int *) CMAP2 = 0; -#endif } /* @@ -2713,22 +2672,7 @@ pmap_zero_page_area(phys, off, size) int off; int size; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP3)) - panic("pmap_zero_page: prv_CMAP3 busy"); - *(int *) PCPU_GET(prv_CMAP3) = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - cpu_invlpg(PCPU_GET(prv_CADDR3)); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE) - i686_pagezero(PCPU_GET(prv_CADDR3)); - else -#endif - bzero((char *)PCPU_GET(prv_CADDR3) + off, size); - - *(int *) PCPU_GET(prv_CMAP3) = 0; -#else if (*(int *) CMAP2) panic("pmap_zero_page: CMAP2 busy"); @@ -2742,7 +2686,6 @@ pmap_zero_page_area(phys, off, size) #endif bzero((char *)CADDR2 + off, size); *(int *) CMAP2 = 0; -#endif } /* @@ -2756,26 +2699,11 @@ pmap_copy_page(src, dst) vm_offset_t src; vm_offset_t dst; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP1)) - panic("pmap_copy_page: prv_CMAP1 busy"); - if (*(int *) PCPU_GET(prv_CMAP2)) - panic("pmap_copy_page: prv_CMAP2 busy"); - *(int *) PCPU_GET(prv_CMAP1) = PG_V | (src & PG_FRAME) | PG_A; - *(int *) PCPU_GET(prv_CMAP2) = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; - - cpu_invlpg(PCPU_GET(prv_CADDR1)); - cpu_invlpg(PCPU_GET(prv_CADDR2)); - - bcopy(PCPU_GET(prv_CADDR1), PCPU_GET(prv_CADDR2), PAGE_SIZE); - - *(int *) PCPU_GET(prv_CMAP1) = 0; - *(int *) PCPU_GET(prv_CMAP2) = 0; - -#else - if (*(int *) CMAP1 || *(int *) CMAP2) - panic("pmap_copy_page: CMAP busy"); + if (*(int *) CMAP1) + panic("pmap_copy_page: CMAP1 busy"); + if (*(int *) CMAP2) + panic("pmap_copy_page: CMAP2 busy"); *(int *) CMAP1 = PG_V | (src & PG_FRAME) | PG_A; *(int *) CMAP2 = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; @@ -2790,7 +2718,6 @@ pmap_copy_page(src, dst) *(int *) CMAP1 = 0; *(int *) CMAP2 = 0; -#endif } diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index 4474353d305..149026e450c 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -29,9 +29,6 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ -#include -#include -#include #include #include @@ -69,14 +66,6 @@ struct globaldata { u_int gd_cpuid; u_int gd_cpu_lockid; u_int gd_other_cpus; - pt_entry_t *gd_prv_CMAP1; - pt_entry_t *gd_prv_CMAP2; - pt_entry_t *gd_prv_CMAP3; - pt_entry_t *gd_prv_PMAP1; - caddr_t gd_prv_CADDR1; - caddr_t gd_prv_CADDR2; - caddr_t gd_prv_CADDR3; - unsigned *gd_prv_PADDR1; u_int gd_astpending; SLIST_ENTRY(globaldata) gd_allcpu; int gd_witness_spin_check; diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c index 00fd68d5253..8b9ca330d0a 100644 --- a/sys/i386/i386/genassym.c +++ b/sys/i386/i386/genassym.c @@ -201,14 +201,6 @@ ASSYM(GD_KTR_BUF_DATA, offsetof(struct globaldata, gd_ktr_buf_data)); ASSYM(GD_CPUID, offsetof(struct globaldata, gd_cpuid)); ASSYM(GD_CPU_LOCKID, offsetof(struct globaldata, gd_cpu_lockid)); ASSYM(GD_OTHER_CPUS, offsetof(struct globaldata, gd_other_cpus)); -ASSYM(GD_PRV_CMAP1, offsetof(struct globaldata, gd_prv_CMAP1)); -ASSYM(GD_PRV_CMAP2, offsetof(struct globaldata, gd_prv_CMAP2)); -ASSYM(GD_PRV_CMAP3, offsetof(struct globaldata, gd_prv_CMAP3)); -ASSYM(GD_PRV_PMAP1, offsetof(struct globaldata, gd_prv_PMAP1)); -ASSYM(GD_PRV_CADDR1, offsetof(struct globaldata, gd_prv_CADDR1)); -ASSYM(GD_PRV_CADDR2, offsetof(struct globaldata, gd_prv_CADDR2)); -ASSYM(GD_PRV_CADDR3, offsetof(struct globaldata, gd_prv_CADDR3)); -ASSYM(GD_PRV_PADDR1, offsetof(struct globaldata, gd_prv_PADDR1)); ASSYM(PS_IDLESTACK, offsetof(struct privatespace, idlestack)); ASSYM(PS_IDLESTACK_TOP, sizeof(struct privatespace)); diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index f7d9dfaf92e..e60b5fb7505 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -190,10 +190,9 @@ static caddr_t crashdumpmap; #ifdef SMP extern pt_entry_t *SMPpt; -#else +#endif static pt_entry_t *PMAP1 = 0; static unsigned *PADDR1 = 0; -#endif static PMAP_INLINE void free_pv_entry __P((pv_entry_t pv)); static unsigned * get_ptbase __P((pmap_t pmap)); @@ -284,9 +283,6 @@ pmap_bootstrap(firstaddr, loadaddr) { vm_offset_t va; pt_entry_t *pte; -#ifdef SMP - struct globaldata *gd; -#endif avail_start = firstaddr; @@ -357,12 +353,10 @@ pmap_bootstrap(firstaddr, loadaddr) SYSMAP(struct msgbuf *, msgbufmap, msgbufp, atop(round_page(MSGBUF_SIZE))) -#if !defined(SMP) /* * ptemap is used for pmap_pte_quick */ SYSMAP(unsigned *, PMAP1, PADDR1, 1); -#endif virtual_avail = va; @@ -428,17 +422,6 @@ pmap_bootstrap(firstaddr, loadaddr) /* local apic is mapped on last page */ SMPpt[NPTEPG - 1] = (pt_entry_t)(PG_V | PG_RW | PG_N | pgeflag | (cpu_apic_address & PG_FRAME)); - - /* BSP does this itself, AP's get it pre-set */ - gd = &SMP_prvspace[0].globaldata; - gd->gd_prv_CMAP1 = &SMPpt[1]; - gd->gd_prv_CMAP2 = &SMPpt[2]; - gd->gd_prv_CMAP3 = &SMPpt[3]; - gd->gd_prv_PMAP1 = &SMPpt[4]; - gd->gd_prv_CADDR1 = SMP_prvspace[0].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[0].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[0].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[0].PPAGE1; #endif invltlb(); @@ -648,19 +631,11 @@ pmap_pte_quick(pmap, va) return (unsigned *) PTmap + index; } newpf = pde & PG_FRAME; -#ifdef SMP - if ( ((* (unsigned *) PCPU_GET(prv_PMAP1)) & PG_FRAME) != newpf) { - * (unsigned *) PCPU_GET(prv_PMAP1) = newpf | PG_RW | PG_V; - cpu_invlpg(PCPU_GET(prv_PADDR1)); - } - return (unsigned *)(PCPU_GET(prv_PADDR1) + (index & (NPTEPG - 1))); -#else if ( ((* (unsigned *) PMAP1) & PG_FRAME) != newpf) { * (unsigned *) PMAP1 = newpf | PG_RW | PG_V; invltlb_1pg((vm_offset_t) PADDR1); } return PADDR1 + ((unsigned) index & (NPTEPG - 1)); -#endif } return (0); } @@ -2669,22 +2644,7 @@ void pmap_zero_page(phys) vm_offset_t phys; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP3)) - panic("pmap_zero_page: prv_CMAP3 busy"); - *(int *) PCPU_GET(prv_CMAP3) = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - cpu_invlpg(PCPU_GET(prv_CADDR3)); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) - i686_pagezero(PCPU_GET(prv_CADDR3)); - else -#endif - bzero(PCPU_GET(prv_CADDR3), PAGE_SIZE); - - *(int *) PCPU_GET(prv_CMAP3) = 0; -#else if (*(int *) CMAP2) panic("pmap_zero_page: CMAP2 busy"); @@ -2698,7 +2658,6 @@ pmap_zero_page(phys) #endif bzero(CADDR2, PAGE_SIZE); *(int *) CMAP2 = 0; -#endif } /* @@ -2713,22 +2672,7 @@ pmap_zero_page_area(phys, off, size) int off; int size; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP3)) - panic("pmap_zero_page: prv_CMAP3 busy"); - *(int *) PCPU_GET(prv_CMAP3) = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - cpu_invlpg(PCPU_GET(prv_CADDR3)); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE) - i686_pagezero(PCPU_GET(prv_CADDR3)); - else -#endif - bzero((char *)PCPU_GET(prv_CADDR3) + off, size); - - *(int *) PCPU_GET(prv_CMAP3) = 0; -#else if (*(int *) CMAP2) panic("pmap_zero_page: CMAP2 busy"); @@ -2742,7 +2686,6 @@ pmap_zero_page_area(phys, off, size) #endif bzero((char *)CADDR2 + off, size); *(int *) CMAP2 = 0; -#endif } /* @@ -2756,26 +2699,11 @@ pmap_copy_page(src, dst) vm_offset_t src; vm_offset_t dst; { -#ifdef SMP - if (*(int *) PCPU_GET(prv_CMAP1)) - panic("pmap_copy_page: prv_CMAP1 busy"); - if (*(int *) PCPU_GET(prv_CMAP2)) - panic("pmap_copy_page: prv_CMAP2 busy"); - *(int *) PCPU_GET(prv_CMAP1) = PG_V | (src & PG_FRAME) | PG_A; - *(int *) PCPU_GET(prv_CMAP2) = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; - - cpu_invlpg(PCPU_GET(prv_CADDR1)); - cpu_invlpg(PCPU_GET(prv_CADDR2)); - - bcopy(PCPU_GET(prv_CADDR1), PCPU_GET(prv_CADDR2), PAGE_SIZE); - - *(int *) PCPU_GET(prv_CMAP1) = 0; - *(int *) PCPU_GET(prv_CMAP2) = 0; - -#else - if (*(int *) CMAP1 || *(int *) CMAP2) - panic("pmap_copy_page: CMAP busy"); + if (*(int *) CMAP1) + panic("pmap_copy_page: CMAP1 busy"); + if (*(int *) CMAP2) + panic("pmap_copy_page: CMAP2 busy"); *(int *) CMAP1 = PG_V | (src & PG_FRAME) | PG_A; *(int *) CMAP2 = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; @@ -2790,7 +2718,6 @@ pmap_copy_page(src, dst) *(int *) CMAP1 = 0; *(int *) CMAP2 = 0; -#endif } diff --git a/sys/i386/include/globaldata.h b/sys/i386/include/globaldata.h index 4474353d305..149026e450c 100644 --- a/sys/i386/include/globaldata.h +++ b/sys/i386/include/globaldata.h @@ -29,9 +29,6 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ -#include -#include -#include #include #include @@ -69,14 +66,6 @@ struct globaldata { u_int gd_cpuid; u_int gd_cpu_lockid; u_int gd_other_cpus; - pt_entry_t *gd_prv_CMAP1; - pt_entry_t *gd_prv_CMAP2; - pt_entry_t *gd_prv_CMAP3; - pt_entry_t *gd_prv_PMAP1; - caddr_t gd_prv_CADDR1; - caddr_t gd_prv_CADDR2; - caddr_t gd_prv_CADDR3; - unsigned *gd_prv_PADDR1; u_int gd_astpending; SLIST_ENTRY(globaldata) gd_allcpu; int gd_witness_spin_check; diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index 4474353d305..149026e450c 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -29,9 +29,6 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ -#include -#include -#include #include #include @@ -69,14 +66,6 @@ struct globaldata { u_int gd_cpuid; u_int gd_cpu_lockid; u_int gd_other_cpus; - pt_entry_t *gd_prv_CMAP1; - pt_entry_t *gd_prv_CMAP2; - pt_entry_t *gd_prv_CMAP3; - pt_entry_t *gd_prv_PMAP1; - caddr_t gd_prv_CADDR1; - caddr_t gd_prv_CADDR2; - caddr_t gd_prv_CADDR3; - unsigned *gd_prv_PADDR1; u_int gd_astpending; SLIST_ENTRY(globaldata) gd_allcpu; int gd_witness_spin_check; diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 4b5ad139ee5..03b02d61c3d 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -2005,14 +2005,6 @@ start_all_aps(u_int boot_addr) SLIST_INSERT_HEAD(&cpuhead, gd, gd_allcpu); gd->gd_cpuid = x; gd->gd_cpu_lockid = x << 24; - gd->gd_prv_CMAP1 = &SMPpt[pg + 1]; - gd->gd_prv_CMAP2 = &SMPpt[pg + 2]; - gd->gd_prv_CMAP3 = &SMPpt[pg + 3]; - gd->gd_prv_PMAP1 = &SMPpt[pg + 4]; - gd->gd_prv_CADDR1 = SMP_prvspace[x].CPAGE1; - gd->gd_prv_CADDR2 = SMP_prvspace[x].CPAGE2; - gd->gd_prv_CADDR3 = SMP_prvspace[x].CPAGE3; - gd->gd_prv_PADDR1 = (unsigned *)SMP_prvspace[x].PPAGE1; /* setup a vector to our boot code */ *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index c3cc2f70d92..41f8f6a07c6 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -42,7 +42,6 @@ #ifndef _SYS_PROC_H_ #define _SYS_PROC_H_ -#include /* Machine-dependent proc substruct. */ #include /* For struct callout. */ #include /* For struct klist. */ #include @@ -53,6 +52,7 @@ #include /* For structs itimerval, timeval. */ #endif #include +#include /* Machine-dependent proc substruct. */ /* * One structure allocated per session.