From da4cb165a04fbbbbf5fb4639e4de39d45c2efe3f Mon Sep 17 00:00:00 2001 From: kmacy Date: Sat, 16 Dec 2006 02:41:05 +0000 Subject: - make intent behind skip check clearer - protect pmap_ipi with spinlock_enter when resizing tte_hash --- sys/sun4v/sun4v/pmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/sun4v') diff --git a/sys/sun4v/sun4v/pmap.c b/sys/sun4v/sun4v/pmap.c index 0f6847b..d8b8f4d 100644 --- a/sys/sun4v/sun4v/pmap.c +++ b/sys/sun4v/sun4v/pmap.c @@ -658,7 +658,8 @@ pmap_bootstrap(vm_offset_t ekva) * Don't shuffle unless we have a full 256M page in the range * our kernel malloc appears to be horribly brittle */ - if ((phys_avail[j + 1] - phys_avail[j]) < PAGE_SIZE_4M*62) + if ((phys_avail[j + 1] - phys_avail[j]) < + (PAGE_SIZE_256M - nucleus_memory)) goto skipshuffle; for (i = j, k = 0; phys_avail[i] != 0; k++, i++) @@ -2163,13 +2164,14 @@ static void pmap_tte_hash_resize(pmap_t pmap) { tte_hash_t old_th = pmap->pm_hash; - + pmap->pm_hash = tte_hash_resize(pmap->pm_hash); - + spinlock_enter(); if (curthread->td_proc->p_numthreads != 1) pmap_ipi(pmap, tl_ttehashupdate, pmap->pm_context, pmap->pm_hashscratch); pmap->pm_hashscratch = tte_hash_set_scratchpad_user(pmap->pm_hash, pmap->pm_context); + spinlock_exit(); tte_hash_destroy(old_th); } -- cgit v1.1