From 4d6daa0f618a477af83c815b48813aa673bfce7f Mon Sep 17 00:00:00 2001 From: cperciva Date: Thu, 6 Jan 2011 22:53:55 +0000 Subject: [PATCH] MFS r217052: Fix a panic when gstat exits or when 'mdconfig -l' is run, on i386/XEN. PR: kern/141328 Approved by: re (rwatson) git-svn-id: svn://svn.freebsd.org/base/releng/8.2@217081 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/i386/xen/pmap.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index a567446e..0d2450e2 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -2293,19 +2293,8 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, vm_page_t *free) if (oldpte & PG_G) pmap_invalidate_page(kernel_pmap, va); pmap->pm_stats.resident_count -= 1; - /* - * XXX This is not strictly correctly, but somewhere along the line - * we are losing the managed bit on some pages. It is unclear to me - * why, but I think the most likely explanation is that xen's writable - * page table implementation doesn't respect the unused bits. - */ - if ((oldpte & PG_MANAGED) || ((oldpte & PG_V) && (va < VM_MAXUSER_ADDRESS)) - ) { + if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(xpmap_mtop(oldpte) & PG_FRAME); - - if (!(oldpte & PG_MANAGED)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - if (oldpte & PG_M) { KASSERT((oldpte & PG_RW), ("pmap_remove_pte: modified page not writable: va: %#x, pte: %#jx", @@ -2315,9 +2304,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va, vm_page_t *free) if (oldpte & PG_A) vm_page_flag_set(m, PG_REFERENCED); pmap_remove_entry(pmap, m, va); - } else if ((va < VM_MAXUSER_ADDRESS) && (oldpte & PG_V)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - + } return (pmap_unuse_pt(pmap, va, free)); } -- 2.44.0