diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-06-09 02:56:39 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-06-09 02:56:39 +0000 |
commit | 9ffe1b9cc7ba80664a74a387551f385f8a718448 (patch) | |
tree | 2cf57ae9e64dfeeb61ee4abc2969412572425e2b | |
parent | be28b152f861ce750af1b79bbcdcd5f970803fd1 (diff) |
revert guenther@'s un-revert of art's curpmap.
My
bios0: ASUSTeK Computer INC. P5K-E
cpu0: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2405.74 MHz
cpu1: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2405.46 MHz
cpu2: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2405.46 MHz
cpu3: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2405.46 MHz
can't boot with this in. It always hangs somewhere in fsck'ing if
any, or between netstart and local daemons if no fsck'ing. Also
fubars theo's real amd machine.
Much more testing needed for this.
-rw-r--r-- | sys/arch/amd64/amd64/cpu.c | 3 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/genassym.cf | 9 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/lapic.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 75 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 138 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/vector.S | 38 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 4 | ||||
-rw-r--r-- | sys/arch/amd64/include/i82489var.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/pmap.h | 7 |
10 files changed, 119 insertions, 172 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index ec639dc3b1f..aa84155b939 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.27 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: cpu.c,v 1.28 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -294,7 +294,6 @@ cpu_attach(struct device *parent, struct device *self, void *aux) pcb->pcb_cr0 = rcr0(); pcb->pcb_cr3 = pcb->pcb_pmap->pm_pdirpa; #endif - ci->ci_curpmap = pmap_kernel(); /* further PCB init done later. */ diff --git a/sys/arch/amd64/amd64/genassym.cf b/sys/arch/amd64/amd64/genassym.cf index fe917ce096d..381b7d0438c 100644 --- a/sys/arch/amd64/amd64/genassym.cf +++ b/sys/arch/amd64/amd64/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.20 2009/06/06 23:45:35 guenther Exp $ +# $OpenBSD: genassym.cf,v 1.21 2009/06/09 02:56:38 krw Exp $ # Written by Artur Grabowski art@openbsd.org, Public Domain include <sys/param.h> @@ -90,10 +90,9 @@ member pcb_cr0 member pcb_ldt_sel member pcb_onfault member pcb_fpcpu -member pcb_pmap struct cpu_info -member CPU_INFO_SCRATCH ci_scratch +member CPU_INFO_SCRATCH ci_scratch member CPU_INFO_SELF ci_self member CPU_INFO_RESCHED ci_want_resched member CPU_INFO_CURPROC ci_curproc @@ -106,10 +105,6 @@ member CPU_INFO_ISOURCES ci_isources member CPU_INFO_IPENDING ci_ipending member CPU_INFO_IUNMASK ci_iunmask member CPU_INFO_GDT ci_gdt -member CPU_INFO_CURPMAP ci_curpmap - -struct pmap -member pm_pdirpa struct intrsource member is_recurse diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 8fae39d53a5..ba7eaea02d9 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.20 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: lapic.c,v 1.21 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */ /*- @@ -234,8 +234,6 @@ lapic_boot_init(paddr_t lapic_base) idt_vec_set(LAPIC_IPI_INVLPG, Xipi_invlpg); idt_allocmap[LAPIC_IPI_INVLRANGE] = 1; idt_vec_set(LAPIC_IPI_INVLRANGE, Xipi_invlrange); - idt_allocmap[LAPIC_IPI_RELOADCR3] = 1; - idt_vec_set(LAPIC_IPI_RELOADCR3, Xipi_reloadcr3); #endif idt_allocmap[LAPIC_SPURIOUS_VECTOR] = 1; idt_vec_set(LAPIC_SPURIOUS_VECTOR, Xintrspurious); diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 5470969912e..db5ae42f520 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.38 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: locore.S,v 1.39 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -132,10 +132,20 @@ #include <machine/asm.h> +#define SET_CURPROC(proc,cpu) \ + movq CPUVAR(SELF),cpu ; \ + movq proc,CPUVAR(CURPROC) ; \ + movq cpu,P_CPU(proc) + +#define GET_CURPCB(reg) movq CPUVAR(CURPCB),reg +#define SET_CURPCB(reg) movq reg,CPUVAR(CURPCB) + + /* XXX temporary kluge; these should not be here */ /* Get definitions for IOM_BEGIN, IOM_END, and IOM_SIZE */ #include <dev/isa/isareg.h> + /* * Initialization */ @@ -716,29 +726,43 @@ ENTRY(cpu_switchto) pushq %r14 pushq %r15 + movq %rdi, %r13 + movq %rsi, %r12 + #ifdef DIAGNOSTIC xorq %rax,%rax - cmpq %rax,P_WCHAN(%rsi) + cmpq %rax,P_WCHAN(%r12) jne _C_LABEL(switch_error2) - cmpb $SRUN,P_STAT(%rsi) + cmpb $SRUN,P_STAT(%r12) jne _C_LABEL(switch_error3) #endif - /* No interrupts while loading new state. */ - cli - /* Record new proc. */ - movb $SONPROC,P_STAT(%rsi) # p->p_stat = SONPROC - movq %rsi, CPUVAR(CURPROC) + movb $SONPROC,P_STAT(%r12) # p->p_stat = SONPROC + SET_CURPROC(%r12,%rcx) - /* If old proc exited, don't bother saving state. */ - testq %rdi,%rdi + /* If old proc exited, don't bother. */ + testq %r13,%r13 jz switch_exited + /* + * Save old context. + * + * Registers: + * %rax, %rcx - scratch + * %r13 - old proc, then old pcb + * %r12 - new proc + */ + + movq %r13,%rdi + call pmap_deactivate + + movq P_ADDR(%r13),%r13 + /* Save stack pointers. */ - movq P_ADDR(%rdi),%r13 movq %rsp,PCB_RSP(%r13) movq %rbp,PCB_RBP(%r13) + switch_exited: /* * Restore saved context. @@ -746,26 +770,41 @@ switch_exited: * Registers: * %rax, %rcx, %rdx - scratch * %r13 - new pcb + * %r12 - new process */ + /* No interrupts while loading new state. */ + cli + movq P_ADDR(%r12),%r13 + /* Restore stack pointers. */ - movq P_ADDR(%rsi),%r13 movq PCB_RSP(%r13),%rsp movq PCB_RBP(%r13),%rbp - movq %r13, CPUVAR(CURPCB) +#if 0 + /* Don't bother with the rest if switching to a system process. */ + testl $P_SYSTEM,P_FLAG(%r12) + jnz switch_restored +#endif /* Load TSS info. */ +#ifdef MULTIPROCESSOR movq CPUVAR(GDT),%rax - movl P_MD_TSS_SEL(%rsi),%edx +#else + movq _C_LABEL(gdtstore)(%rip),%rax +#endif + movl P_MD_TSS_SEL(%r12),%edx /* Switch TSS. Reset "task busy" flag before */ andl $~0x0200,4(%rax,%rdx, 1) ltr %dx - call _C_LABEL(pmap_switch) - /* %rsi and %rdi no longer valid */ + movq %r12,%rdi + call _C_LABEL(pmap_activate) +#if 0 +switch_restored: +#endif /* Restore cr0 (including FPU state). */ movl PCB_CR0(%r13),%ecx #ifdef MULTIPROCESSOR @@ -777,9 +816,13 @@ switch_exited: #endif movq %rcx,%cr0 + SET_CURPCB(%r13) + /* Interrupts are okay again. */ sti +switch_return: + popq %r15 popq %r14 popq %r13 diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index 2c8609e228d..78e72c6bd53 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.46 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: pmap.c,v 1.47 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -313,7 +313,7 @@ struct vm_page *pmap_find_ptp(struct pmap *, vaddr_t, paddr_t, int); void pmap_free_ptp(struct pmap *, struct vm_page *, vaddr_t, pt_entry_t *, pd_entry_t **, struct pg_to_free *); void pmap_freepage(struct pmap *, struct vm_page *, int, struct pg_to_free *); -static boolean_t pmap_is_active(struct pmap *, struct cpu_info *); +static boolean_t pmap_is_active(struct pmap *, int); void pmap_map_ptes(struct pmap *, pt_entry_t **, pd_entry_t ***); struct pv_entry *pmap_remove_pv(struct vm_page *, struct pmap *, vaddr_t); void pmap_do_remove(struct pmap *, vaddr_t, vaddr_t, int); @@ -328,7 +328,7 @@ void pmap_unmap_ptes(struct pmap *); boolean_t pmap_get_physpage(vaddr_t, int, paddr_t *); boolean_t pmap_pdes_valid(vaddr_t, pd_entry_t **, pd_entry_t *); void pmap_alloc_level(pd_entry_t **, vaddr_t, int, long *); -void pmap_apte_flush(void); +void pmap_apte_flush(struct pmap *pmap); void pmap_sync_flags_pte(struct vm_page *, u_long); @@ -337,27 +337,28 @@ void pmap_sync_flags_pte(struct vm_page *, u_long); */ /* - * pmap_is_active: is this pmap loaded into the specified processor's %cr3? + * pmap_is_curpmap: is this pmap the one currently loaded [in %cr3]? + * of course the kernel is always loaded */ static __inline boolean_t -pmap_is_active(struct pmap *pmap, struct cpu_info *ci) +pmap_is_curpmap(struct pmap *pmap) { - return (pmap == pmap_kernel() || ci->ci_curpmap == pmap); + return((pmap == pmap_kernel()) || + (pmap->pm_pdirpa == (paddr_t) rcr3())); } /* - * pmap_is_curpmap: is this pmap the one currently loaded [in %cr3]? - * of course the kernel is always loaded + * pmap_is_active: is this pmap loaded into the specified processor's %cr3? */ static __inline boolean_t -pmap_is_curpmap(struct pmap *pmap) +pmap_is_active(struct pmap *pmap, int cpu_id) { - return (pmap_is_active(pmap, curcpu())); + return (pmap == pmap_kernel() || + (pmap->pm_cpus & (1U << cpu_id)) != 0); } - static __inline u_int pmap_pte2flags(u_long pte) { @@ -374,7 +375,7 @@ pmap_sync_flags_pte(struct vm_page *pg, u_long pte) } void -pmap_apte_flush(void) +pmap_apte_flush(struct pmap *pmap) { pmap_tlb_shoottlb(); pmap_tlb_shootwait(); @@ -405,7 +406,7 @@ pmap_map_ptes(struct pmap *pmap, pt_entry_t **ptepp, pd_entry_t ***pdeppp) npde = (pd_entry_t) (pmap->pm_pdirpa | PG_RW | PG_V); *APDP_PDE = npde; if (pmap_valid_entry(opde)) - pmap_apte_flush(); + pmap_apte_flush(curpcb->pcb_pmap); } *ptepp = APTE_BASE; *pdeppp = alternate_pdes; @@ -419,7 +420,7 @@ pmap_unmap_ptes(struct pmap *pmap) #if defined(MULTIPROCESSOR) *APDP_PDE = 0; - pmap_apte_flush(); + pmap_apte_flush(curpcb->pcb_pmap); #endif COUNT(apdp_pde_unmap); } @@ -853,7 +854,7 @@ pmap_free_ptp(struct pmap *pmap, struct vm_page *ptp, vaddr_t va, opde = pmap_pte_set(&pdes[level - 1][index], 0); invaladdr = level == 1 ? (vaddr_t)ptes : (vaddr_t)pdes[level - 2]; - pmap_tlb_shootpage(curcpu()->ci_curpmap, + pmap_tlb_shootpage(curpcb->pcb_pmap, invaladdr + index * PAGE_SIZE); #if defined(MULTIPROCESSOR) invaladdr = level == 1 ? (vaddr_t)PTE_BASE : @@ -1080,9 +1081,6 @@ pmap_destroy(struct pmap *pmap) * reference count is zero, free pmap resources and then free pmap. */ - /* Make sure it's not used by some other cpu. */ - pmap_tlb_droppmap(pmap); - /* * remove it from global list of pmaps */ @@ -1101,7 +1099,13 @@ pmap_destroy(struct pmap *pmap) } } + /* + * MULTIPROCESSOR -- no need to flush out of other processors' + * APTE space because we do that in pmap_unmap_ptes(). + */ + /* XXX: need to flush it out of other processor's APTE space? */ pool_put(&pmap_pdp_pool, pmap->pm_pdir); + pool_put(&pmap_pmap_pool, pmap); } @@ -1117,14 +1121,29 @@ pmap_reference(struct pmap *pmap) /* * pmap_activate: activate a process' pmap (fill in %cr3 and LDT info) + * + * => called from cpu_switch() + * => if p is the curproc, then load it into the MMU */ + void pmap_activate(struct proc *p) { - KASSERT(p == curproc); - KASSERT(&p->p_addr->u_pcb == curpcb); + struct pcb *pcb = &p->p_addr->u_pcb; + struct pmap *pmap = p->p_vmspace->vm_map.pmap; - pmap_switch(NULL, p); + pcb->pcb_pmap = pmap; + pcb->pcb_ldt_sel = pmap->pm_ldt_sel; + pcb->pcb_cr3 = pmap->pm_pdirpa; + if (p == curproc) + lcr3(pcb->pcb_cr3); + if (pcb == curpcb) + lldt(pcb->pcb_ldt_sel); + + /* + * mark the pmap in use by this processor. + */ + x86_atomic_setbits_ul(&pmap->pm_cpus, (1U << cpu_number())); } /* @@ -1134,41 +1153,13 @@ pmap_activate(struct proc *p) void pmap_deactivate(struct proc *p) { -} - -u_int64_t nlazy_cr3; -u_int64_t nlazy_cr3_hit; - -void -pmap_switch(struct proc *o, struct proc *n) -{ - struct pmap *npmap, *opmap; - struct pcb *npcb; - - npmap = n->p_vmspace->vm_map.pmap; - - npcb = &n->p_addr->u_pcb; - npcb->pcb_pmap = npmap; - npcb->pcb_ldt_sel = npmap->pm_ldt_sel; - npcb->pcb_cr3 = npmap->pm_pdirpa; - - opmap = curcpu()->ci_curpmap; + struct pmap *pmap = p->p_vmspace->vm_map.pmap; /* - * Don't reload cr3 if we're switching to the same pmap or - * when we're not exiting and switching to kernel pmap. + * mark the pmap no longer in use by this processor. */ - if (opmap == npmap) { - if (npmap != pmap_kernel()) - nlazy_cr3_hit++; - } else if (o != NULL && npmap == pmap_kernel()) { - nlazy_cr3++; - } else { - curcpu()->ci_curpmap = npmap; - lcr3(npmap->pm_pdirpa); - } + x86_atomic_clearbits_ul(&pmap->pm_cpus, (1U << cpu_number())); - lldt(npcb->pcb_ldt_sel); } /* @@ -2466,7 +2457,7 @@ pmap_tlb_shootpage(struct pmap *pm, vaddr_t va) int mask = 0; CPU_INFO_FOREACH(cii, ci) { - if (ci == self || !pmap_is_active(pm, ci) || + if (ci == self || !pmap_is_active(pm, ci->ci_cpuid) || !(ci->ci_flags & CPUF_RUNNING)) continue; mask |= 1 << ci->ci_cpuid; @@ -2504,7 +2495,7 @@ pmap_tlb_shootrange(struct pmap *pm, vaddr_t sva, vaddr_t eva) vaddr_t va; CPU_INFO_FOREACH(cii, ci) { - if (ci == self || !pmap_is_active(pm, ci) || + if (ci == self || !pmap_is_active(pm, ci->ci_cpuid) || !(ci->ci_flags & CPUF_RUNNING)) continue; mask |= 1 << ci->ci_cpuid; @@ -2570,45 +2561,6 @@ pmap_tlb_shoottlb(void) } void -pmap_tlb_droppmap(struct pmap *pm) -{ - struct cpu_info *ci, *self = curcpu(); - CPU_INFO_ITERATOR cii; - long wait = 0; - int mask = 0; - - CPU_INFO_FOREACH(cii, ci) { - if (ci == self || !(ci->ci_flags & CPUF_RUNNING) || - ci->ci_curpmap != pm) - continue; - mask |= 1 << ci->ci_cpuid; - wait++; - } - - if (wait) { - int s = splvm(); - - while (x86_atomic_cas_ul(&tlb_shoot_wait, 0, wait) != 0) { - while (tlb_shoot_wait != 0) - SPINLOCK_SPIN_HOOK; - } - - CPU_INFO_FOREACH(cii, ci) { - if ((mask & 1 << ci->ci_cpuid) == 0) - continue; - if (x86_fast_ipi(ci, LAPIC_IPI_RELOADCR3) != 0) - panic("pmap_tlb_shoottlb: ipi failed"); - } - splx(s); - } - - if (self->ci_curpmap == pm) - pmap_activate(curproc); - if (wait) - pmap_tlb_shootwait(); -} - -void pmap_tlb_shootwait(void) { while (tlb_shoot_wait != 0) diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S index 1dd89b628c5..475aa42372b 100644 --- a/sys/arch/amd64/amd64/vector.S +++ b/sys/arch/amd64/amd64/vector.S @@ -1,4 +1,4 @@ -/* $OpenBSD: vector.S,v 1.21 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: vector.S,v 1.22 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */ /* @@ -74,7 +74,6 @@ #include <machine/asm.h> #include <machine/frameasm.h> #include <machine/segments.h> -#include <machine/specialreg.h> #include <machine/trap.h> #include <machine/intr.h> #include <machine/psl.h> @@ -348,41 +347,6 @@ IDTVEC(ipi_invlrange) popq %rax iretq -IDTVEC(ipi_reloadcr3) - pushq %rax - pushq %rcx - pushq %rdx - pushq %r9 - - ioapic_asm_ack() - - movl $MSR_GSBASE, %ecx - rdmsr - movq $VM_MAXUSER_ADDRESS, %rcx - shlq $32, %rdx - leaq (%rax,%rdx), %r9 - cmpq %rcx, %r9 - jb 1f - swapgs -1: - movq CPUVAR(CURPCB), %rax - movq PCB_PMAP(%rax), %rax - movq %rax, CPUVAR(CURPMAP) - movq PM_PDIRPA(%rax), %rax - movq %rax, %cr3 - - lock - decq tlb_shoot_wait - - cmpq %rcx, %r9 - jb 1f - swapgs -1: popq %r9 - popq %rdx - popq %rcx - popq %rax - iretq - #endif /* MULTIPROCESSOR */ /* diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c index c6418575648..d00d1126a82 100644 --- a/sys/arch/amd64/amd64/vm_machdep.c +++ b/sys/arch/amd64/amd64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.21 2009/06/06 23:45:35 guenther Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.22 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */ /*- @@ -106,9 +106,10 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize, #endif *pcb = p1->p_addr->u_pcb; - pcb->pcb_pmap = p2->p_vmspace->vm_map.pmap; - pcb->pcb_ldt_sel = p2->p_vmspace->vm_map.pmap->pm_ldt_sel; - pcb->pcb_cr3 = p2->p_vmspace->vm_map.pmap->pm_pdirpa; + /* + * Activate the address space. Note this will refresh pcb_ldt_sel. + */ + pmap_activate(p2); /* Fix up the TSS. */ pcb->pcb_tss.tss_rsp0 = (u_int64_t)p2->p_addr + USPACE - 16; @@ -158,6 +159,7 @@ cpu_exit(struct proc *p) if (p->p_md.md_flags & MDP_USEDMTRR) mtrr_clean(p); + pmap_deactivate(p); tss_free(p->p_md.md_tss_sel); sched_exit(p); } diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index ea0f25751dd..33094933870 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.47 2009/06/06 23:45:36 guenther Exp $ */ +/* $OpenBSD: cpu.h,v 1.48 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -80,8 +80,6 @@ struct cpu_info { struct pcb *ci_idle_pcb; int ci_idle_tss_sel; - struct pmap *ci_curpmap; - struct intrsource *ci_isources[MAX_INTR_SOURCES]; u_int32_t ci_ipending; int ci_ilevel; diff --git a/sys/arch/amd64/include/i82489var.h b/sys/arch/amd64/include/i82489var.h index 67f61beff9e..c3ceda14a91 100644 --- a/sys/arch/amd64/include/i82489var.h +++ b/sys/arch/amd64/include/i82489var.h @@ -1,3 +1,4 @@ +/* $OpenBSD: i82489var.h,v 1.10 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: i82489var.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ /*- @@ -86,12 +87,10 @@ extern void Xresume_lapic_ipi(void); #define LAPIC_IPI_INVLTLB (LAPIC_IPI_OFFSET + 0) #define LAPIC_IPI_INVLPG (LAPIC_IPI_OFFSET + 1) #define LAPIC_IPI_INVLRANGE (LAPIC_IPI_OFFSET + 2) -#define LAPIC_IPI_RELOADCR3 (LAPIC_IPI_OFFSET + 3) extern void Xipi_invltlb(void); extern void Xipi_invlpg(void); extern void Xipi_invlrange(void); -extern void Xipi_reloadcr3(void); /* * Vector used for local apic timer interrupts. diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 750f342a0a0..8c9ffcd1047 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.26 2009/06/06 23:45:36 guenther Exp $ */ +/* $OpenBSD: pmap.h,v 1.27 2009/06/09 02:56:38 krw Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -325,6 +325,7 @@ struct pmap { union descriptor *pm_ldt; /* user-set LDT */ int pm_ldt_len; /* number of LDT entries */ int pm_ldt_sel; /* LDT selector */ + u_int32_t pm_cpus; /* mask of CPUs using pmap */ }; /* @@ -415,8 +416,6 @@ static void pmap_update_pg(vaddr_t); static void pmap_update_2pg(vaddr_t,vaddr_t); void pmap_write_protect(struct pmap *, vaddr_t, vaddr_t, vm_prot_t); -void pmap_switch(struct proc *, struct proc *); - vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */ @@ -424,10 +423,8 @@ void pmap_tlb_shootpage(struct pmap *, vaddr_t); void pmap_tlb_shootrange(struct pmap *, vaddr_t, vaddr_t); void pmap_tlb_shoottlb(void); #ifdef MULTIPROCESSOR -void pmap_tlb_droppmap(struct pmap *); void pmap_tlb_shootwait(void); #else -#define pmap_tlb_droppmap(pm) #define pmap_tlb_shootwait() #endif |