summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/include/pmap.h2
-rw-r--r--sys/mips/mips/pmap.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h
index 80772d9..f4df6ca 100644
--- a/sys/mips/include/pmap.h
+++ b/sys/mips/include/pmap.h
@@ -88,6 +88,8 @@ struct pmap {
pd_entry_t *pm_segtab; /* KVA of segment table */
TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in
* pmap */
+ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */
+ u_int pm_retries;
int pm_active; /* active on cpus */
struct {
u_int32_t asid:ASID_BITS; /* TLB address space tag */
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c
index e7c3239..826177f 100644
--- a/sys/mips/mips/pmap.c
+++ b/sys/mips/mips/pmap.c
@@ -147,7 +147,6 @@ unsigned pmap_max_asid; /* max ASID supported by the system */
#define PMAP_ASID_RESERVED 0
-
vm_offset_t kernel_vm_end;
static struct tlb tlbstash[MAXCPU][MIPS_MAX_TLB_ENTRIES];
@@ -710,18 +709,22 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot)
{
pt_entry_t pte;
vm_page_t m;
+ vm_paddr_t pa;
m = NULL;
- vm_page_lock_queues();
+ pa = 0;
PMAP_LOCK(pmap);
-
+retry:
pte = *pmap_pte(pmap, va);
if (pte != 0 && pmap_pte_v(&pte) &&
((pte & PTE_RW) || (prot & VM_PROT_WRITE) == 0)) {
+ if (vm_page_pa_tryrelock(pmap, mips_tlbpfn_to_paddr(pte), &pa))
+ goto retry;
+
m = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(pte));
vm_page_hold(m);
}
- vm_page_unlock_queues();
+ PA_UNLOCK_COND(pa);
PMAP_UNLOCK(pmap);
return (m);
}
OpenPOWER on IntegriCloud