diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-02 18:13:11 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-02 18:13:11 +0000 |
commit | c3e37ac3749d7898c3631b92739eec375ff62794 (patch) | |
tree | 46e97382daab8b9aee216326c59fb73a040e9190 /sys/arch | |
parent | 0224e60cd07513ae58583f5a62064c8f112866b6 (diff) |
delete all the simplelocks. ok deraadt
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/cpu.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/intr.c | 22 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/arch/amd64/include/pmap.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/pmap.c | 53 | ||||
-rw-r--r-- | sys/arch/i386/i386/pmapae.c | 47 | ||||
-rw-r--r-- | sys/arch/i386/i386/sys_machdep.c | 11 | ||||
-rw-r--r-- | sys/arch/i386/i386/trap.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/include/pmap.h | 4 |
11 files changed, 16 insertions, 149 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index e27de4ba448..2d7619fc2e3 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.70 2014/11/23 00:25:05 guenther Exp $ */ +/* $OpenBSD: cpu.c,v 1.71 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -444,8 +444,6 @@ cpu_attach(struct device *parent, struct device *self, void *aux) #endif ci->ci_func = caa->cpu_func; - simple_lock_init(&ci->ci_slock); - #if defined(MULTIPROCESSOR) /* * Allocate UPAGES contiguous pages for the idle PCB and stack. diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c index 10ee22b1ee0..8f4d4dddcdf 100644 --- a/sys/arch/amd64/amd64/intr.c +++ b/sys/arch/amd64/amd64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.38 2014/09/14 14:17:23 jsg Exp $ */ +/* $OpenBSD: intr.c,v 1.39 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */ /* @@ -180,7 +180,6 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, start = CPU_IS_PRIMARY(ci) ? NUM_LEGACY_IRQS : 0; slot = -1; - simple_lock(&ci->ci_slock); for (i = 0; i < start; i++) { isp = ci->ci_isources[i]; if (isp != NULL && isp->is_pic == pic && isp->is_pin == pin) { @@ -201,7 +200,6 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, } } if (slot == -1) { - simple_unlock(&ci->ci_slock); return EBUSY; } @@ -210,14 +208,12 @@ intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin, isp = malloc(sizeof (struct intrsource), M_DEVBUF, M_NOWAIT|M_ZERO); if (isp == NULL) { - simple_unlock(&ci->ci_slock); return ENOMEM; } snprintf(isp->is_evname, sizeof (isp->is_evname), "pin %d", pin); ci->ci_isources[slot] = isp; } - simple_unlock(&ci->ci_slock); *index = slot; return 0; @@ -263,9 +259,7 @@ intr_allocate_slot(struct pic *pic, int legacy_irq, int pin, int level, snprintf(isp->is_evname, sizeof (isp->is_evname), "pin %d", pin); - simple_lock(&ci->ci_slock); ci->ci_isources[slot] = isp; - simple_unlock(&ci->ci_slock); } else { if (isp->is_pic != pic || isp->is_pin != pin) { if (pic == &i8259_pic) @@ -314,10 +308,8 @@ other: found: idtvec = idt_vec_alloc(APIC_LEVEL(level), IDT_INTR_HIGH); if (idtvec == 0) { - simple_lock(&ci->ci_slock); free(ci->ci_isources[slot], M_DEVBUF, 0); ci->ci_isources[slot] = NULL; - simple_unlock(&ci->ci_slock); return EBUSY; } } @@ -383,8 +375,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, return NULL; } - simple_lock(&ci->ci_slock); - source->is_pin = pin; source->is_pic = pic; @@ -400,7 +390,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, break; case IST_PULSE: if (type != IST_NONE) { - simple_unlock(&ci->ci_slock); printf("intr_establish: pic %s pin %d: can't share " "type %d with %d\n", pic->pic_name, pin, source->is_type, type); @@ -409,7 +398,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, } break; default: - simple_unlock(&ci->ci_slock); panic("intr_establish: bad intr type %d for pic %s pin %d", source->is_type, pic->pic_dev.dv_xname, pin); } @@ -441,8 +429,6 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, intr_calculatemasks(ci); - simple_unlock(&ci->ci_slock); - if (ci->ci_isources[slot]->is_resume == NULL || source->is_idtvec != idt_vec) { if (source->is_idtvec != 0 && source->is_idtvec != idt_vec) @@ -487,7 +473,6 @@ intr_disestablish(struct intrhand *ih) source = ci->ci_isources[ih->ih_slot]; idtvec = source->is_idtvec; - simple_lock(&ci->ci_slock); pic->pic_hwmask(pic, ih->ih_pin); x86_atomic_clearbits_u64(&ci->ci_ipending, (1UL << ih->ih_slot)); @@ -498,7 +483,6 @@ intr_disestablish(struct intrhand *ih) p = &q->ih_next) ; if (q == NULL) { - simple_unlock(&ci->ci_slock); panic("intr_disestablish: handler not registered"); } @@ -525,8 +509,6 @@ intr_disestablish(struct intrhand *ih) evcount_detach(&ih->ih_count); free(ih, M_DEVBUF, 0); - - simple_unlock(&ci->ci_slock); } int @@ -664,7 +646,6 @@ intr_printconfig(void) for (i = 0; i < NIPL; i++) printf("IPL %d mask %lx unmask %lx\n", i, (u_long)ci->ci_imask[i], (u_long)ci->ci_iunmask[i]); - simple_lock(&ci->ci_slock); for (i = 0; i < MAX_INTR_SOURCES; i++) { isp = ci->ci_isources[i]; if (isp == NULL) @@ -678,7 +659,6 @@ intr_printconfig(void) ih->ih_fun, ih->ih_level); } - simple_unlock(&ci->ci_slock); } #endif } diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index f50d2e92ab8..3853c0f554d 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.198 2014/11/22 18:55:20 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.199 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1067,7 +1067,6 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack, struct gate_descriptor *idt; char idt_allocmap[NIDT]; -struct simplelock idt_lock; char *gdtstore; extern struct user *proc0paddr; @@ -1720,15 +1719,12 @@ idt_vec_alloc(int low, int high) { int vec; - simple_lock(&idt_lock); for (vec = low; vec <= high; vec++) { if (idt_allocmap[vec] == 0) { idt_allocmap[vec] = 1; - simple_unlock(&idt_lock); return vec; } } - simple_unlock(&idt_lock); return 0; } @@ -1746,10 +1742,8 @@ idt_vec_set(int vec, void (*function)(void)) void idt_vec_free(int vec) { - simple_lock(&idt_lock); unsetgate(&idt[vec]); idt_allocmap[vec] = 0; - simple_unlock(&idt_lock); } #ifdef DIAGNOSTIC diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index 06983dcbc75..bd654f17dce 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.86 2014/09/12 09:52:45 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.87 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -69,7 +69,6 @@ struct cpu_info { struct cpu_info *ci_next; struct proc *ci_curproc; - struct simplelock ci_slock; u_int ci_cpuid; u_int ci_apicid; u_int32_t ci_randseed; diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 5c3a22b832a..ef9ccceb1ce 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.48 2014/11/16 12:30:56 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.49 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -282,7 +282,7 @@ LIST_HEAD(pmap_head, pmap); /* struct pmap_head: head of a pmap list */ /* * the pmap structure * - * note that the pm_obj contains the simple_lock, the reference count, + * note that the pm_obj contains the reference count, * page list, and number of PTPs within the pmap. * * pm_lock is the same as the spinlock for vm object 0. Changes to diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c index 89a510e0c54..5d3326f5a1e 100644 --- a/sys/arch/i386/i386/pmap.c +++ b/sys/arch/i386/i386/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.162 2014/11/19 20:09:01 mlarkin Exp $ */ +/* $OpenBSD: pmap.c,v 1.163 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */ /* @@ -196,9 +196,6 @@ * locking data structures */ -struct simplelock pvalloc_lock; -struct simplelock pmaps_lock; - #define PMAP_MAP_TO_HEAD_LOCK() /* null */ #define PMAP_MAP_TO_HEAD_UNLOCK() /* null */ @@ -469,19 +466,9 @@ pmap_map_ptes(struct pmap *pmap) /* if curpmap then we are always mapped */ if (pmap_is_curpmap(pmap)) { - simple_lock(&pmap->pm_obj.vmobjlock); return(PTE_BASE); } - /* need to lock both curpmap and pmap: use ordered locking */ - if ((unsigned) pmap < (unsigned) curpcb->pcb_pmap) { - simple_lock(&pmap->pm_obj.vmobjlock); - simple_lock(&curpcb->pcb_pmap->pm_obj.vmobjlock); - } else { - simple_lock(&curpcb->pcb_pmap->pm_obj.vmobjlock); - simple_lock(&pmap->pm_obj.vmobjlock); - } - /* need to load a new alternate pt space into curpmap? */ opde = *APDP_PDE; #if defined(MULTIPROCESSOR) && defined(DIAGNOSTIC) @@ -507,15 +494,11 @@ pmap_unmap_ptes(struct pmap *pmap) if (pmap == pmap_kernel()) return; - if (pmap_is_curpmap(pmap)) { - simple_unlock(&pmap->pm_obj.vmobjlock); - } else { + if (!pmap_is_curpmap(pmap)) { #if defined(MULTIPROCESSOR) *APDP_PDE = 0; pmap_apte_flush(); #endif - simple_unlock(&pmap->pm_obj.vmobjlock); - simple_unlock(&curpcb->pcb_pmap->pm_obj.vmobjlock); } } @@ -873,8 +856,6 @@ pmap_bootstrap(vaddr_t kva_start) * init the static-global locks and global lists. */ - simple_lock_init(&pvalloc_lock); - simple_lock_init(&pmaps_lock); LIST_INIT(&pmaps); TAILQ_INIT(&pv_freepages); TAILQ_INIT(&pv_unusedpgs); @@ -977,8 +958,6 @@ pmap_alloc_pv(struct pmap *pmap, int mode) struct pv_page *pvpage; struct pv_entry *pv; - simple_lock(&pvalloc_lock); - if (!TAILQ_EMPTY(&pv_freepages)) { pvpage = TAILQ_FIRST(&pv_freepages); pvpage->pvinfo.pvpi_nfree--; @@ -1010,7 +989,6 @@ pmap_alloc_pv(struct pmap *pmap, int mode) (void) pmap_alloc_pvpage(pmap, ALLOCPV_NONEED); } - simple_unlock(&pvalloc_lock); return(pv); } @@ -1165,7 +1143,6 @@ pmap_free_pv_doit(struct pv_entry *pv) void pmap_free_pv(struct pmap *pmap, struct pv_entry *pv) { - simple_lock(&pvalloc_lock); pmap_free_pv_doit(pv); /* @@ -1175,8 +1152,6 @@ pmap_free_pv(struct pmap *pmap, struct pv_entry *pv) if (pv_nfpvents > PVE_HIWAT && TAILQ_FIRST(&pv_unusedpgs) != NULL && pmap != pmap_kernel()) pmap_free_pvpage(); - - simple_unlock(&pvalloc_lock); } /* @@ -1190,8 +1165,6 @@ pmap_free_pvs(struct pmap *pmap, struct pv_entry *pvs) { struct pv_entry *nextpv; - simple_lock(&pvalloc_lock); - for ( /* null */ ; pvs != NULL ; pvs = nextpv) { nextpv = pvs->pv_next; pmap_free_pv_doit(pvs); @@ -1204,8 +1177,6 @@ pmap_free_pvs(struct pmap *pmap, struct pv_entry *pvs) if (pv_nfpvents > PVE_HIWAT && TAILQ_FIRST(&pv_unusedpgs) != NULL && pmap != pmap_kernel()) pmap_free_pvpage(); - - simple_unlock(&pvalloc_lock); } @@ -1469,7 +1440,6 @@ pmap_pinit(struct pmap *pmap) * malloc since malloc allocates out of a submap and we should have * already allocated kernel PTPs to cover the range... */ - simple_lock(&pmaps_lock); /* put in kernel VM PDEs */ bcopy(&PDP_BASE[PDSLOT_KERN], &pmap->pm_pdir[PDSLOT_KERN], nkpde * sizeof(pd_entry_t)); @@ -1477,7 +1447,6 @@ pmap_pinit(struct pmap *pmap) bzero(&pmap->pm_pdir[PDSLOT_KERN + nkpde], NBPG - ((PDSLOT_KERN + nkpde) * sizeof(pd_entry_t))); LIST_INSERT_HEAD(&pmaps, pmap, pm_list); - simple_unlock(&pmaps_lock); } /* @@ -1499,9 +1468,7 @@ pmap_destroy(struct pmap *pmap) pmap_tlb_droppmap(pmap); #endif - simple_lock(&pmaps_lock); LIST_REMOVE(pmap, pm_list); - simple_unlock(&pmaps_lock); /* Free any remaining PTPs. */ while ((pg = RB_ROOT(&pmap->pm_obj.memt)) != NULL) { @@ -1537,9 +1504,7 @@ pmap_destroy(struct pmap *pmap) void pmap_reference(struct pmap *pmap) { - simple_lock(&pmap->pm_obj.vmobjlock); pmap->pm_obj.uo_refs++; - simple_unlock(&pmap->pm_obj.vmobjlock); } #if defined(PMAP_FORK) @@ -1551,9 +1516,6 @@ pmap_reference(struct pmap *pmap) void pmap_fork(struct pmap *pmap1, struct pmap *pmap2) { - simple_lock(&pmap1->pm_obj.vmobjlock); - simple_lock(&pmap2->pm_obj.vmobjlock); - #ifdef USER_LDT /* Copy the LDT, if necessary. */ if (pmap1->pm_flags & PMF_USER_LDT) { @@ -1573,9 +1535,6 @@ pmap_fork(struct pmap *pmap1, struct pmap *pmap2) ldt_alloc(pmap2, new_ldt, len); } #endif /* USER_LDT */ - - simple_unlock(&pmap2->pm_obj.vmobjlock); - simple_unlock(&pmap1->pm_obj.vmobjlock); } #endif /* PMAP_FORK */ @@ -1593,8 +1552,6 @@ pmap_ldt_cleanup(struct proc *p) union descriptor *old_ldt = NULL; size_t len = 0; - simple_lock(&pmap->pm_obj.vmobjlock); - if (pmap->pm_flags & PMF_USER_LDT) { ldt_free(pmap); pmap->pm_ldt_sel = GSEL(GLDT_SEL, SEL_KPL); @@ -1614,8 +1571,6 @@ pmap_ldt_cleanup(struct proc *p) pmap->pm_flags &= ~PMF_USER_LDT; } - simple_unlock(&pmap->pm_obj.vmobjlock); - if (old_ldt != NULL) uvm_km_free(kernel_map, (vaddr_t)old_ldt, len); } @@ -2620,7 +2575,6 @@ pmap_growkernel(vaddr_t maxkvaddr) */ s = splhigh(); /* to be safe */ - simple_lock(&kpm->pm_obj.vmobjlock); for (/*null*/ ; nkpde < needed_kpde ; nkpde++) { @@ -2654,15 +2608,12 @@ pmap_growkernel(vaddr_t maxkvaddr) uvm_wait("pmap_growkernel"); /* distribute new kernel PTP to all active pmaps */ - simple_lock(&pmaps_lock); LIST_FOREACH(pm, &pmaps, pm_list) { pm->pm_pdir[PDSLOT_KERN + nkpde] = kpm->pm_pdir[PDSLOT_KERN + nkpde]; } - simple_unlock(&pmaps_lock); } - simple_unlock(&kpm->pm_obj.vmobjlock); splx(s); out: diff --git a/sys/arch/i386/i386/pmapae.c b/sys/arch/i386/i386/pmapae.c index 816f502211c..34f6ad1228d 100644 --- a/sys/arch/i386/i386/pmapae.c +++ b/sys/arch/i386/i386/pmapae.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmapae.c,v 1.25 2014/11/19 20:09:01 mlarkin Exp $ */ +/* $OpenBSD: pmapae.c,v 1.26 2014/12/02 18:13:10 tedu Exp $ */ /* * Copyright (c) 2006 Michael Shalayeff @@ -627,19 +627,9 @@ pmap_map_ptes_pae(struct pmap *pmap) /* if curpmap then we are always mapped */ if (pmap_is_curpmap(pmap)) { - simple_lock(&pmap->pm_obj.vmobjlock); return(PTE_BASE); } - /* need to lock both curpmap and pmap: use ordered locking */ - if ((unsigned) pmap < (unsigned) curpcb->pcb_pmap) { - simple_lock(&pmap->pm_obj.vmobjlock); - simple_lock(&curpcb->pcb_pmap->pm_obj.vmobjlock); - } else { - simple_lock(&curpcb->pcb_pmap->pm_obj.vmobjlock); - simple_lock(&pmap->pm_obj.vmobjlock); - } - /* need to load a new alternate pt space into curpmap? */ opde = *APDP_PDE; if (!pmap_valid_entry(opde) || (opde & PG_FRAME) != pmap->pm_pdidx[0]) { @@ -663,9 +653,7 @@ pmap_unmap_ptes_pae(struct pmap *pmap) if (pmap == pmap_kernel()) return; - if (pmap_is_curpmap(pmap)) { - simple_unlock(&pmap->pm_obj.vmobjlock); - } else { + if (!pmap_is_curpmap(pmap)) { #if defined(MULTIPROCESSOR) APDP_PDE[0] = 0; APDP_PDE[1] = 0; @@ -673,8 +661,6 @@ pmap_unmap_ptes_pae(struct pmap *pmap) APDP_PDE[3] = 0; pmap_apte_flush(curpcb->pcb_pmap); #endif - simple_unlock(&pmap->pm_obj.vmobjlock); - simple_unlock(&curpcb->pcb_pmap->pm_obj.vmobjlock); } } @@ -851,8 +837,7 @@ pmap_try_steal_pv_pae(struct pv_head *pvh, struct pv_entry *cpv, * we never steal kernel mappings or mappings from pmaps we can't lock */ - if (cpv->pv_pmap == pmap_kernel() || - !simple_lock_try(&cpv->pv_pmap->pm_obj.vmobjlock)) + if (cpv->pv_pmap == pmap_kernel()) return(FALSE); /* @@ -876,7 +861,6 @@ pmap_try_steal_pv_pae(struct pv_head *pvh, struct pv_entry *cpv, pmap_tmpunmap_pvepte_pae(cpv); } if (ptep == NULL) { - simple_unlock(&cpv->pv_pmap->pm_obj.vmobjlock); return(FALSE); /* wired page, abort! */ } cpv->pv_pmap->pm_stats.resident_count--; @@ -1015,7 +999,6 @@ pmap_pinit_pd_pae(struct pmap *pmap) * malloc since malloc allocates out of a submap and we should have * already allocated kernel PTPs to cover the range... */ - simple_lock(&pmaps_lock); /* put in kernel VM PDEs */ bcopy(&PDP_BASE[PDSLOT_KERN], &PDE(pmap, PDSLOT_KERN), nkpde * sizeof(pd_entry_t)); @@ -1023,7 +1006,6 @@ pmap_pinit_pd_pae(struct pmap *pmap) bzero(&PDE(pmap, PDSLOT_KERN + nkpde), pmap->pm_pdirsize - ((PDSLOT_KERN + nkpde) * sizeof(pd_entry_t))); LIST_INSERT_HEAD(&pmaps, pmap, pm_list); - simple_unlock(&pmaps_lock); } /* @@ -1214,11 +1196,9 @@ pmap_remove_ptes_pae(struct pmap *pmap, struct vm_page *ptp, vaddr_t ptpva, #endif /* sync R/M bits */ - simple_lock(&vm_physmem[bank].pmseg.pvhead[off].pvh_lock); vm_physmem[bank].pmseg.attrs[off] |= (opte & (PG_U|PG_M)); pve = pmap_remove_pv(&vm_physmem[bank].pmseg.pvhead[off], pmap, startva); - simple_unlock(&vm_physmem[bank].pmseg.pvhead[off].pvh_lock); if (pve) { pve->pv_next = pv_tofree; @@ -1295,10 +1275,8 @@ pmap_remove_pte_pae(struct pmap *pmap, struct vm_page *ptp, pt_entry_t *pte, #endif /* sync R/M bits */ - simple_lock(&vm_physmem[bank].pmseg.pvhead[off].pvh_lock); vm_physmem[bank].pmseg.attrs[off] |= (opte & (PG_U|PG_M)); pve = pmap_remove_pv(&vm_physmem[bank].pmseg.pvhead[off], pmap, va); - simple_unlock(&vm_physmem[bank].pmseg.pvhead[off].pvh_lock); if (pve) pmap_free_pv(pmap, pve); @@ -1542,9 +1520,6 @@ pmap_page_remove_pae(struct vm_page *pg) /* set pv_head => pmap locking */ PMAP_HEAD_TO_MAP_LOCK(); - /* XXX: needed if we hold head->map lock? */ - simple_lock(&pvh->pvh_lock); - for (pve = pvh->pvh_list ; pve != NULL ; pve = pve->pv_next) { ptes = pmap_map_ptes_pae(pve->pv_pmap); /* locks pmap */ @@ -1620,7 +1595,6 @@ pmap_page_remove_pae(struct vm_page *pg) } pmap_free_pvs(NULL, pvh->pvh_list); pvh->pvh_list = NULL; - simple_unlock(&pvh->pvh_lock); PMAP_HEAD_TO_MAP_UNLOCK(); pmap_tlb_shootnow(cpumask); while ((ptp = TAILQ_FIRST(&empty_ptps)) != NULL) { @@ -1675,8 +1649,6 @@ pmap_test_attrs_pae(struct vm_page *pg, int testbits) /* nope, gonna have to do it the hard way */ PMAP_HEAD_TO_MAP_LOCK(); - /* XXX: needed if we hold head->map lock? */ - simple_lock(&pvh->pvh_lock); for (pve = pvh->pvh_list; pve != NULL && (*myattrs & testbits) == 0; pve = pve->pv_next) { @@ -1690,8 +1662,6 @@ pmap_test_attrs_pae(struct vm_page *pg, int testbits) * note that we will exit the for loop with a non-null pve if * we have found the bits we are testing for. */ - - simple_unlock(&pvh->pvh_lock); PMAP_HEAD_TO_MAP_UNLOCK(); return((*myattrs & testbits) != 0); } @@ -1723,8 +1693,6 @@ pmap_change_attrs_pae(struct vm_page *pg, int setbits, int clearbits) PMAP_HEAD_TO_MAP_LOCK(); pvh = &vm_physmem[bank].pmseg.pvhead[off]; - /* XXX: needed if we hold head->map lock? */ - simple_lock(&pvh->pvh_lock); myattrs = &vm_physmem[bank].pmseg.attrs[off]; result = *myattrs & clearbits; @@ -1750,7 +1718,6 @@ pmap_change_attrs_pae(struct vm_page *pg, int setbits, int clearbits) pmap_unmap_ptes_pae(pve->pv_pmap); /* unlocks pmap */ } - simple_unlock(&pvh->pvh_lock); PMAP_HEAD_TO_MAP_UNLOCK(); pmap_tlb_shootnow(cpumask); @@ -1990,9 +1957,7 @@ pmap_enter_pae(struct pmap *pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, atop(pa)); #endif pvh = &vm_physmem[bank].pmseg.pvhead[off]; - simple_lock(&pvh->pvh_lock); vm_physmem[bank].pmseg.attrs[off] |= opte; - simple_unlock(&pvh->pvh_lock); } else { pvh = NULL; /* ensure !PG_PVLIST */ } @@ -2017,10 +1982,8 @@ pmap_enter_pae(struct pmap *pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, "pa = 0x%lx (0x%lx)", pa, atop(pa)); #endif pvh = &vm_physmem[bank].pmseg.pvhead[off]; - simple_lock(&pvh->pvh_lock); pve = pmap_remove_pv(pvh, pmap, va); vm_physmem[bank].pmseg.attrs[off] |= opte; - simple_unlock(&pvh->pvh_lock); } else { pve = NULL; } @@ -2131,7 +2094,6 @@ pmap_growkernel_pae(vaddr_t maxkvaddr) */ s = splhigh(); /* to be safe */ - simple_lock(&kpm->pm_obj.vmobjlock); for (/*null*/ ; nkpde < needed_kpde ; nkpde++) { @@ -2167,15 +2129,12 @@ pmap_growkernel_pae(vaddr_t maxkvaddr) PDE(kpm, PDSLOT_KERN + nkpde) &= ~PG_u; /* distribute new kernel PTP to all active pmaps */ - simple_lock(&pmaps_lock); LIST_FOREACH(pm, &pmaps, pm_list) { PDE(pm, PDSLOT_KERN + nkpde) = PDE(kpm, PDSLOT_KERN + nkpde); } - simple_unlock(&pmaps_lock); } - simple_unlock(&kpm->pm_obj.vmobjlock); splx(s); out: diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c index ef4f33dd64e..40c22249d9f 100644 --- a/sys/arch/i386/i386/sys_machdep.c +++ b/sys/arch/i386/i386/sys_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_machdep.c,v 1.32 2014/07/12 18:44:41 tedu Exp $ */ +/* $OpenBSD: sys_machdep.c,v 1.33 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */ /*- @@ -114,8 +114,6 @@ i386_get_ldt(struct proc *p, void *args, register_t *retval) cp = malloc(ua.num * sizeof(union descriptor), M_TEMP, M_WAITOK); - simple_lock(&pmap->pm_lock); - if (pmap->pm_flags & PMF_USER_LDT) { nldt = pmap->pm_ldt_len; lp = pmap->pm_ldt; @@ -125,7 +123,6 @@ i386_get_ldt(struct proc *p, void *args, register_t *retval) } if (ua.start > nldt) { - simple_unlock(&pmap->pm_lock); free(cp, M_TEMP, 0); return (EINVAL); } @@ -141,7 +138,6 @@ i386_get_ldt(struct proc *p, void *args, register_t *retval) #endif memcpy(cp, lp, num * sizeof(union descriptor)); - simple_unlock(&pmap->pm_lock); error = copyout(cp, ua.desc, num * sizeof(union descriptor)); if (error == 0) @@ -249,7 +245,6 @@ i386_set_ldt(struct proc *p, void *args, register_t *retval) } /* allocate user ldt */ - simple_lock(&pmap->pm_lock); if (pmap->pm_ldt == 0 || (ua.start + ua.num) > pmap->pm_ldt_len) { if (pmap->pm_flags & PMF_USER_LDT) ldt_len = pmap->pm_ldt_len; @@ -259,14 +254,12 @@ i386_set_ldt(struct proc *p, void *args, register_t *retval) ldt_len *= 2; new_len = ldt_len * sizeof(union descriptor); - simple_unlock(&pmap->pm_lock); new_ldt = (union descriptor *)uvm_km_alloc(kernel_map, new_len); if (new_ldt == NULL) { error = ENOMEM; goto out; } - simple_lock(&pmap->pm_lock); if (pmap->pm_ldt != NULL && ldt_len <= pmap->pm_ldt_len) { /* @@ -314,8 +307,6 @@ copy: for (i = 0, n = ua.start; i < ua.num; i++, n++) pmap->pm_ldt[n] = descv[i]; - simple_unlock(&pmap->pm_lock); - *retval = ua.start; out: diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index c3ac81d1343..d39c2061198 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.118 2014/11/16 12:30:57 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.119 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -383,11 +383,7 @@ trap(struct trapframe *frame) goto we_re_toast; #ifdef LOCKDEBUG /* If we page-fault while in scheduler, we're doomed. */ -#ifdef notyet - if (simple_lock_held(&sched_lock)) -#else if (__mp_lock_held(&sched_lock)) -#endif goto we_re_toast; #endif diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 791ebe2c954..196b348b9cd 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.135 2014/09/12 09:52:45 kettenis Exp $ */ +/* $OpenBSD: cpu.h,v 1.136 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -82,7 +82,6 @@ struct cpu_info { * Public members. */ struct proc *ci_curproc; /* current owner of the processor */ - struct simplelock ci_slock; /* lock on this data structure */ cpuid_t ci_cpuid; /* our CPU ID */ u_int ci_apicid; /* our APIC ID */ u_int32_t ci_randseed; diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h index 3ae1e9299e2..0285b7def44 100644 --- a/sys/arch/i386/include/pmap.h +++ b/sys/arch/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.66 2014/11/16 12:30:57 deraadt Exp $ */ +/* $OpenBSD: pmap.h,v 1.67 2014/12/02 18:13:10 tedu Exp $ */ /* $NetBSD: pmap.h,v 1.44 2000/04/24 17:18:18 thorpej Exp $ */ /* @@ -241,7 +241,7 @@ LIST_HEAD(pmap_head, pmap); /* struct pmap_head: head of a pmap list */ /* * The pmap structure * - * Note that the pm_obj contains the simple_lock, the reference count, + * Note that the pm_obj contains the reference count, * page list, and number of PTPs within the pmap. */ |