From owner-freebsd-ppc@FreeBSD.ORG Mon Jul 2 11:07:18 2012 Return-Path: Delivered-To: freebsd-ppc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8711106566B for ; Mon, 2 Jul 2012 11:07:18 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D3B558FC25 for ; Mon, 2 Jul 2012 11:07:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q62B7I6F012708 for ; Mon, 2 Jul 2012 11:07:18 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q62B7Itv012706 for freebsd-ppc@FreeBSD.org; Mon, 2 Jul 2012 11:07:18 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 2 Jul 2012 11:07:18 GMT Message-Id: <201207021107.q62B7Itv012706@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-ppc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-ppc@FreeBSD.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 11:07:19 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o power/169021 ppc FreeBSD-9.0-powerpc-all.iso crashes host when mounted o power/167764 ppc Burning iso for ppc o power/164225 ppc Boot fails on IBM 7028-6E1 (heap memory claim failed) o power/161947 ppc multimedia/libdvdnav builds broken binaries on big end o power/161045 ppc X doesn't detect ADB mouse up event until another even o power/149009 ppc sysinstall(8) on powerpc fails to install manpages, so o power/140241 ppc [kernel] [patch] Linker set problems on PowerPC EABI o power/135576 ppc gdb cannot debug threaded programs on ppc o power/133503 ppc [sound] Sound stutter after switching ttys o power/133382 ppc [install] Installer gets signal 11 o power/131548 ppc ofw_syscons no longer supports 32-bit framebuffer 11 problems total. From owner-freebsd-ppc@FreeBSD.ORG Mon Jul 2 16:52:54 2012 Return-Path: Delivered-To: powerpc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E81AC106566B; Mon, 2 Jul 2012 16:52:54 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB848FC16; Mon, 2 Jul 2012 16:52:54 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.5/8.14.5) with ESMTP id q62GqsLV090815; Mon, 2 Jul 2012 12:52:54 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.5/8.14.5/Submit) id q62GqrHl090814; Mon, 2 Jul 2012 16:52:53 GMT (envelope-from tinderbox@freebsd.org) Date: Mon, 2 Jul 2012 16:52:53 GMT Message-Id: <201207021652.q62GqrHl090814@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on powerpc/powerpc X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 16:52:55 -0000 TB --- 2012-07-02 16:46:30 - tinderbox 2.9 running on freebsd-current.sentex.ca TB --- 2012-07-02 16:46:30 - FreeBSD freebsd-current.sentex.ca 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #0: Mon Mar 26 13:54:12 EDT 2012 des@freebsd-current.sentex.ca:/usr/obj/usr/src/sys/GENERIC amd64 TB --- 2012-07-02 16:46:30 - starting HEAD tinderbox run for powerpc/powerpc TB --- 2012-07-02 16:46:30 - cleaning the object tree TB --- 2012-07-02 16:46:30 - cvsupping the source tree TB --- 2012-07-02 16:46:30 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/powerpc/powerpc/supfile TB --- 2012-07-02 16:47:24 - building world TB --- 2012-07-02 16:47:24 - CROSS_BUILD_TESTING=YES TB --- 2012-07-02 16:47:24 - MAKEOBJDIRPREFIX=/obj TB --- 2012-07-02 16:47:24 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2012-07-02 16:47:24 - SRCCONF=/dev/null TB --- 2012-07-02 16:47:24 - TARGET=powerpc TB --- 2012-07-02 16:47:24 - TARGET_ARCH=powerpc TB --- 2012-07-02 16:47:24 - TZ=UTC TB --- 2012-07-02 16:47:24 - __MAKE_CONF=/dev/null TB --- 2012-07-02 16:47:24 - cd /src TB --- 2012-07-02 16:47:24 - /usr/bin/make -B buildworld >>> World build started on Mon Jul 2 16:47:25 UTC 2012 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree [...] rm -f .depend GPATH GRTAGS GSYMS GTAGS ===> usr.bin/ypwhich (cleandir) rm -f ypwhich ypwhich.o ypwhich.1.gz ypwhich.1.cat.gz rm -f .depend GPATH GRTAGS GSYMS GTAGS ===> usr.sbin (cleandir) "Makefile", line 262: Malformed conditional (${PK_PKGBOOTSTRAP} != "no") "Makefile", line 264: if-less endif make: fatal errors encountered -- cannot continue *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2012-07-02 16:52:53 - WARNING: /usr/bin/make returned exit code 1 TB --- 2012-07-02 16:52:53 - ERROR: failed to build world TB --- 2012-07-02 16:52:53 - 238.14 user 32.23 system 383.77 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-powerpc-powerpc.full From owner-freebsd-ppc@FreeBSD.ORG Tue Jul 3 12:57:44 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C21D8106567A for ; Tue, 3 Jul 2012 12:57:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-ups.ru (ns.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 700378FC19 for ; Tue, 3 Jul 2012 12:57:44 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-ups.ru [127.0.0.1]) by mail.kirov.so-ups.ru (Postfix) with SMTP id 4EF2CB8026 for ; Tue, 3 Jul 2012 16:57:37 +0400 (MSK) Received: from kirov.so-ups.ru (unknown [172.21.81.1]) by mail.kirov.so-ups.ru (Postfix) with ESMTP id 49C43B8024 for ; Tue, 3 Jul 2012 16:57:37 +0400 (MSK) Received: by ns.kirov.so-ups.ru (Postfix, from userid 1010) id 34073BA06E; Tue, 3 Jul 2012 16:57:37 +0400 (MSK) Received: from [127.0.0.1] (unknown [10.118.3.52]) by ns.kirov.so-ups.ru (Postfix) with ESMTP id F1BAEBA041 for ; Tue, 3 Jul 2012 16:57:36 +0400 (MSK) Message-ID: <4FF2EC39.7050002@FreeBSD.org> Date: Tue, 03 Jul 2012 16:57:29 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: freebsd-ppc@freebsd.org X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9DFA63D9D76CF1C58B248DE7" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Subject: [CFT] Loader changes X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2012 12:57:44 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9DFA63D9D76CF1C58B248DE7 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi All, can somebody, who have an ability, test changes to the ubldr on a powerpc= ? I prepared the patch: http://people.freebsd.org/~ae/powerpc_boot.diff the main goal is unification of the code to work with partition tables. The same code is used for the uboot, i386, userboot loaders. Also this implementation is much closer to full GPT support, it can check CRC and backup GPT header and table. Some initial support fo= r different sector sizes added. --=20 WBR, Andrey V. Elsukov --------------enig9DFA63D9D76CF1C58B248DE7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJP8uxBAAoJEAHF6gQQyKF6MdQH/0yMvqh/FET0uhWVPctvaLQM WVCR5eeqa37deCsjjCoxbaDMP7sIyPnatw/e0r6Dd1ET1cfK9UCnAA6SPMJpgvxh c9ZWHRSoiIByW36ShBt9KmeqFd0OeWxK+htpE2ytlGkffZgD5YZ9rCOuWv4wQW4l a7QLYUFrv3cFZb/16aRKeYFSQh6clo6M52bI+36p4pIIdP4clGS0wKXPRRcEOyT+ m1/M82dTjd0FeVlGgIx56aGhNisLFxtX7xM3jYExhdi3GMhVSTbuuWNYlz35Eht8 SJ33CtVNbKMsC3c0jMjvY9uVMFEh5ZRFChWdaBwCscYLG9qCyQWtV7hsQuyBDjA= =pRfN -----END PGP SIGNATURE----- --------------enig9DFA63D9D76CF1C58B248DE7-- From owner-freebsd-ppc@FreeBSD.ORG Thu Jul 5 00:12:46 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE76F106567C; Thu, 5 Jul 2012 00:12:46 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id AF7FD8FC15; Thu, 5 Jul 2012 00:12:46 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 5DE9C606E1; Wed, 4 Jul 2012 19:12:44 -0500 (CDT) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 5995B606DE; Wed, 4 Jul 2012 19:12:44 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id cCbs8PV2hBAZ; Wed, 4 Jul 2012 19:12:44 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh10.mail.rice.edu (Postfix) with ESMTPSA id CB276603E1; Wed, 4 Jul 2012 19:12:43 -0500 (CDT) Message-ID: <4FF4DBFA.4040404@rice.edu> Date: Wed, 04 Jul 2012 19:12:42 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: freebsd-ppc@freebsd.org Content-Type: multipart/mixed; boundary="------------030506090302050607050201" Cc: Alan Cox Subject: pmap patch for 32-bit AIM X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 00:12:47 -0000 This is a multi-part message in MIME format. --------------030506090302050607050201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Can someone please verify that a 32-bit AIM system still boots up and runs after the attached patch is applied? Thanks, Alan --------------030506090302050607050201 Content-Type: text/plain; name="powerpc_aim_pmap.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="powerpc_aim_pmap.patch" Index: powerpc/aim/mmu_oea.c =================================================================== --- powerpc/aim/mmu_oea.c (revision 237346) +++ powerpc/aim/mmu_oea.c (working copy) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -204,6 +205,17 @@ struct pvo_head *moea_pvo_table; /* pvo entries b struct pvo_head moea_pvo_kunmanaged = LIST_HEAD_INITIALIZER(moea_pvo_kunmanaged); /* list of unmanaged pages */ +/* + * Isolate the global pv list lock from data and other locks to prevent false + * sharing within the cache. + */ +static struct { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +} pvh_global __aligned(CACHE_LINE_SIZE); + +#define pvh_global_lock pvh_global.lock + uma_zone_t moea_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea_mpvo_zone; /* zone for pvo entries for managed pages */ @@ -455,7 +467,7 @@ static __inline void moea_attr_clear(vm_page_t m, int ptebit) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); m->md.mdpg_attrs &= ~ptebit; } @@ -470,7 +482,7 @@ static __inline void moea_attr_save(vm_page_t m, int ptebit) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); m->md.mdpg_attrs |= ptebit; } @@ -859,6 +871,11 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart CPU_FILL(&kernel_pmap->pm_active); RB_INIT(&kernel_pmap->pmap_pvo); + /* + * Initialize the global pv list lock. + */ + rw_init(&pvh_global_lock, "pmap pv global"); + /* * Set up the Open Firmware mappings */ @@ -1066,10 +1083,10 @@ moea_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); moea_enter_locked(pmap, va, m, prot, wired); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1102,7 +1119,7 @@ moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_ pvo_flags = PVO_MANAGED; } if (pmap_bootstrapped) - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || VM_OBJECT_LOCKED(m->object), @@ -1166,14 +1183,14 @@ moea_enter_object(mmu_t mmu, pmap_t pm, vm_offset_ psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { moea_enter_locked(pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1182,11 +1199,11 @@ moea_enter_quick(mmu_t mmu, pmap_t pm, vm_offset_t vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); moea_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1342,7 +1359,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); lo = moea_attr_fetch(m); powerpc_sync(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { @@ -1368,7 +1385,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1409,7 +1426,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_m return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pvo_head = vm_page_to_pvoh(m); lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), ma); @@ -1429,7 +1446,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_m PMAP_UNLOCK(pmap); } m->md.mdpg_cache_attrs = ma; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1543,7 +1560,7 @@ moea_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_ ("moea_page_exists_quick: page %p is not managed", m)); loops = 0; rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { if (pvo->pvo_pmap == pmap) { rv = TRUE; @@ -1552,7 +1569,7 @@ moea_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_ if (++loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -1569,11 +1586,11 @@ moea_page_wired_mappings(mmu_t mmu, vm_page_t m) count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) if ((pvo->pvo_vaddr & PVO_WIRED) != 0) count++; - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -1672,7 +1689,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva return; } - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); key.pvo_vaddr = sva; for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); @@ -1700,7 +1717,7 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_offset_t sva mtx_unlock(&moea_table_mutex); } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pm); } @@ -1766,7 +1783,7 @@ moea_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, { struct pvo_entry *pvo, *tpvo, key; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); key.pvo_vaddr = sva; for (pvo = RB_NFIND(pvo_tree, &pm->pmap_pvo, &key); @@ -1775,7 +1792,7 @@ moea_remove(mmu_t mmu, pmap_t pm, vm_offset_t sva, moea_pvo_remove(pvo, -1); } PMAP_UNLOCK(pm); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1789,7 +1806,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) struct pvo_entry *pvo, *next_pvo; pmap_t pmap; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pvo_head = vm_page_to_pvoh(m); for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) { next_pvo = LIST_NEXT(pvo, pvo_vlink); @@ -1804,7 +1821,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) vm_page_dirty(m); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -2279,7 +2296,7 @@ moea_query_bit(vm_page_t m, int ptebit) if (moea_attr_fetch(m) & ptebit) return (TRUE); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { /* @@ -2288,7 +2305,7 @@ moea_query_bit(vm_page_t m, int ptebit) */ if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (TRUE); } } @@ -2312,13 +2329,13 @@ moea_query_bit(vm_page_t m, int ptebit) mtx_unlock(&moea_table_mutex); if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (TRUE); } } } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (FALSE); } @@ -2329,7 +2346,7 @@ moea_clear_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); /* * Clear the cached value. @@ -2363,7 +2380,7 @@ moea_clear_bit(vm_page_t m, int ptebit) pvo->pvo_pte.pte.pte_lo &= ~ptebit; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } --------------030506090302050607050201-- From owner-freebsd-ppc@FreeBSD.ORG Thu Jul 5 19:49:36 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E911065675 for ; Thu, 5 Jul 2012 19:49:36 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2B78FC12 for ; Thu, 5 Jul 2012 19:49:35 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q65JnWTB051922; Thu, 5 Jul 2012 21:49:33 +0200 (CEST) (envelope-from andreast-list@fgznet.ch) Message-ID: <4FF5EFCC.1030906@fgznet.ch> Date: Thu, 05 Jul 2012 21:49:32 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Alan Cox References: <4FF4DBFA.4040404@rice.edu> In-Reply-To: <4FF4DBFA.4040404@rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: freebsd-ppc@freebsd.org Subject: Re: pmap patch for 32-bit AIM X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 19:49:36 -0000 On 05.07.12 02:12, Alan Cox wrote: > Can someone please verify that a 32-bit AIM system still boots up and > runs after the attached patch is applied? Boots fine on G4/G5 (32-bit). Andreas From owner-freebsd-ppc@FreeBSD.ORG Thu Jul 5 21:09:26 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16716106564A for ; Thu, 5 Jul 2012 21:09:26 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id BCE5E8FC15 for ; Thu, 5 Jul 2012 21:09:25 +0000 (UTC) Received: by qcsg15 with SMTP id g15so5851330qcs.13 for ; Thu, 05 Jul 2012 14:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=uO4cG3L1l7cNT94uuQ2Hr0ROuvF1A/sOeH6d2Wjl2vA=; b=Ms7t8cm5eYnFI9+x9bOJ7+j6M5BhkV8TGqdG50HINccbOQqiz4YtBTdtpCCVxJtWPA w1/cECdVBt9KS5EmdInZbnhRni6XgJD04xqQQzKehowgkcXs9yLVQTmc7THz+eT+bv+R nOyBwJMV1ygBEggo1oMNms5/jiuRx5+P71iejOA044LRR9eCvW+JvIWp++nPTg+/Ux49 N/fPSsI3r16U+3MIYT/OfyJkuX5m9YEVEnBHoLPrvV/Eq/7XSb0VOTWjXlXIIXTCJcjm 40golQYWIPcY1n0KwrrCbGfQnP6HEhvz/5zl9m8ct7UaNYjN5D7MmBjrt/UU1pNj9+5r IgZg== Received: by 10.229.69.87 with SMTP id y23mr13050574qci.114.1341522565059; Thu, 05 Jul 2012 14:09:25 -0700 (PDT) Received: from narn.knownspace (pool-71-163-84-156.washdc.fios.verizon.net. [71.163.84.156]) by mx.google.com with ESMTPS id gb7sm47453530qab.12.2012.07.05.14.09.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 14:09:24 -0700 (PDT) Date: Thu, 5 Jul 2012 17:09:21 -0400 From: Justin Hibbits To: Andreas Tobler Message-ID: <20120705170921.4bf13dae@narn.knownspace> In-Reply-To: <4FF5EFCC.1030906@fgznet.ch> References: <4FF4DBFA.4040404@rice.edu> <4FF5EFCC.1030906@fgznet.ch> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-ppc@freebsd.org, Alan Cox Subject: Re: pmap patch for 32-bit AIM X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 21:09:26 -0000 On Thu, 05 Jul 2012 21:49:32 +0200 Andreas Tobler wrote: > On 05.07.12 02:12, Alan Cox wrote: > > Can someone please verify that a 32-bit AIM system still boots up > > and runs after the attached patch is applied? > > Boots fine on G4/G5 (32-bit). > > Andreas > Works fine on my dual G4 as well. - Justin From owner-freebsd-ppc@FreeBSD.ORG Fri Jul 6 02:20:15 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BF01106564A for ; Fri, 6 Jul 2012 02:20:15 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id D186C8FC1D for ; Fri, 6 Jul 2012 02:20:14 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 9646F606E3; Thu, 5 Jul 2012 21:20:10 -0500 (CDT) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 94B9D606DC; Thu, 5 Jul 2012 21:20:10 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id LXTlSE20tg-r; Thu, 5 Jul 2012 21:20:10 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh10.mail.rice.edu (Postfix) with ESMTPSA id 193BC606DB; Thu, 5 Jul 2012 21:20:09 -0500 (CDT) Message-ID: <4FF64B58.7010708@rice.edu> Date: Thu, 05 Jul 2012 21:20:08 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Justin Hibbits References: <4FF4DBFA.4040404@rice.edu> <4FF5EFCC.1030906@fgznet.ch> <20120705170921.4bf13dae@narn.knownspace> In-Reply-To: <20120705170921.4bf13dae@narn.knownspace> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ppc@freebsd.org Subject: Re: pmap patch for 32-bit AIM X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2012 02:20:15 -0000 On 07/05/2012 16:09, Justin Hibbits wrote: > On Thu, 05 Jul 2012 21:49:32 +0200 > Andreas Tobler wrote: > >> On 05.07.12 02:12, Alan Cox wrote: >>> Can someone please verify that a 32-bit AIM system still boots up >>> and runs after the attached patch is applied? >> Boots fine on G4/G5 (32-bit). >> >> Andreas >> > Works fine on my dual G4 as well. > Thanks! Alan From owner-freebsd-ppc@FreeBSD.ORG Sat Jul 7 14:20:13 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60FB10657A3; Sat, 7 Jul 2012 14:20:13 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 63F668FC16; Sat, 7 Jul 2012 14:20:13 +0000 (UTC) Received: by qabg1 with SMTP id g1so900854qab.13 for ; Sat, 07 Jul 2012 07:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type; bh=VcJGeqLllEyUlkggXQOmw2RNN3FIsZJRRtN8aVFBppI=; b=YCErr+KRKE0/6HUhSigNmDiECIErizJNrld16vgp7KLPS5MnMLQT+1X9bWNWFImuBW 9y7ZpQsGsIhw8YZMp4tVVuQnjk1stRRLwjQCth7DwU6KU8wxsTygNRUE41OsukIE9qPl eeaE16Txv2R7A2Dfg2e6YLC+qaCWTo6n+McAHp3u06hcxVQTscnEDMOl7zeQ0M7ZWEJM YbNoW8frHoA2OX+nwGwdQryxGeJv8sUkEW7TLILCKj5siSXCljUMR0ndxenf3hflimHB Hhy/wfRd1dcmswKjf377fgqNcSJNF6rVeUnpmwlnTk6QMdDQHgB5pWYkwpcvmPn2+EGa GxWA== Received: by 10.229.135.134 with SMTP id n6mr12322993qct.140.1341670807048; Sat, 07 Jul 2012 07:20:07 -0700 (PDT) Received: from narn.knownspace (pool-71-163-84-156.washdc.fios.verizon.net. [71.163.84.156]) by mx.google.com with ESMTPS id cz12sm54276037qab.5.2012.07.07.07.20.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Jul 2012 07:20:06 -0700 (PDT) Date: Sat, 7 Jul 2012 10:20:04 -0400 From: Justin Hibbits To: freebsd-ppc@freebsd.org Message-ID: <20120707102004.3e874201@narn.knownspace> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/=yp8b+xTANc5VsOBTVQLI=Y" Cc: alc@freebsd.org Subject: Panic with latest pmap lock changes. X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2012 14:20:13 -0000 --MP_/=yp8b+xTANc5VsOBTVQLI=Y Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Looks like I spoke too soon about the pmap lock changes working on my G4. After about 24 hours of uptime, it panicked with the following: _rw_wlock_hard: recursing but non-recursive rw pmap pv global @ /home/chmeee/freebsd/src/sys/powerpc/aim/mmu_oea.c:2301 I think the attached patch should fix it (Untested, except for compiling). - Justin --MP_/=yp8b+xTANc5VsOBTVQLI=Y Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mmu_oea.diff Index: sys/powerpc/aim/mmu_oea.c =================================================================== --- sys/powerpc/aim/mmu_oea.c (revision 238165) +++ sys/powerpc/aim/mmu_oea.c (working copy) @@ -874,7 +874,7 @@ /* * Initialize the global pv list lock. */ - rw_init(&pvh_global_lock, "pmap pv global"); + rw_init_flags(&pvh_global_lock, "pmap pv global", RW_RECURSE); /* * Set up the Open Firmware mappings --MP_/=yp8b+xTANc5VsOBTVQLI=Y-- From owner-freebsd-ppc@FreeBSD.ORG Sat Jul 7 17:39:24 2012 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD6DB106564A; Sat, 7 Jul 2012 17:39:24 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 897C68FC0A; Sat, 7 Jul 2012 17:39:24 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 4B8434C01D1; Sat, 7 Jul 2012 12:39:20 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 49EFF4C01D0; Sat, 7 Jul 2012 12:39:20 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 1C-PB2L6GB2n; Sat, 7 Jul 2012 12:39:20 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 8F1AB4C01CA; Sat, 7 Jul 2012 12:39:19 -0500 (CDT) Message-ID: <4FF87446.2090903@rice.edu> Date: Sat, 07 Jul 2012 12:39:18 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Justin Hibbits References: <20120707102004.3e874201@narn.knownspace> In-Reply-To: <20120707102004.3e874201@narn.knownspace> Content-Type: multipart/mixed; boundary="------------070807020805030306060404" Cc: alc@freebsd.org, freebsd-ppc@freebsd.org Subject: Re: Panic with latest pmap lock changes. X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2012 17:39:24 -0000 This is a multi-part message in MIME format. --------------070807020805030306060404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/07/2012 09:20, Justin Hibbits wrote: > Looks like I spoke too soon about the pmap lock changes working on my > G4. After about 24 hours of uptime, it panicked with the following: > > _rw_wlock_hard: recursing but non-recursive rw pmap pv global > @ /home/chmeee/freebsd/src/sys/powerpc/aim/mmu_oea.c:2301 > > I think the attached patch should fix it (Untested, except for > compiling). > Ugh. Sorry. The attached patch eliminates the lock recursion. While I was doing that, I noticed that the pmap_ts_referenced() implementations on powerpc have the wrong return type. Oddly, the comments in mmu_if.h have the return type correct, but the code two or three lines later has it wrong. Alan --------------070807020805030306060404 Content-Type: text/plain; name="powerpc_pmap.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="powerpc_pmap.patch" Index: powerpc/powerpc/mmu_if.m =================================================================== --- powerpc/powerpc/mmu_if.m (revision 237346) +++ powerpc/powerpc/mmu_if.m (working copy) @@ -387,7 +387,7 @@ METHOD boolean_t is_referenced { * * @retval int count of referenced bits */ -METHOD boolean_t ts_referenced { +METHOD int ts_referenced { mmu_t _mmu; vm_page_t _pg; }; Index: powerpc/booke/pmap.c =================================================================== --- powerpc/booke/pmap.c (revision 237346) +++ powerpc/booke/pmap.c (working copy) @@ -286,7 +286,7 @@ static void mmu_booke_init(mmu_t); static boolean_t mmu_booke_is_modified(mmu_t, vm_page_t); static boolean_t mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t); static boolean_t mmu_booke_is_referenced(mmu_t, vm_page_t); -static boolean_t mmu_booke_ts_referenced(mmu_t, vm_page_t); +static int mmu_booke_ts_referenced(mmu_t, vm_page_t); static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t, Index: powerpc/aim/mmu_oea.c =================================================================== --- powerpc/aim/mmu_oea.c (revision 238159) +++ powerpc/aim/mmu_oea.c (working copy) @@ -300,7 +300,7 @@ void moea_init(mmu_t); boolean_t moea_is_modified(mmu_t, vm_page_t); boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); -boolean_t moea_ts_referenced(mmu_t, vm_page_t); +int moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); @@ -1269,15 +1269,20 @@ moea_init(mmu_t mmu) boolean_t moea_is_referenced(mmu_t mmu, vm_page_t m) { + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_referenced: page %p is not managed", m)); - return (moea_query_bit(m, PTE_REF)); + rw_wlock(&pvh_global_lock); + rv = moea_query_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); + return (rv); } boolean_t moea_is_modified(mmu_t mmu, vm_page_t m) { + boolean_t rv; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_modified: page %p is not managed", m)); @@ -1291,7 +1296,10 @@ moea_is_modified(mmu_t mmu, vm_page_t m) if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); - return (moea_query_bit(m, PTE_CHG)); + rw_wlock(&pvh_global_lock); + rv = moea_query_bit(m, PTE_CHG); + rw_wunlock(&pvh_global_lock); + return (rv); } boolean_t @@ -1313,7 +1321,9 @@ moea_clear_reference(mmu_t mmu, vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_clear_reference: page %p is not managed", m)); + rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); } void @@ -1333,7 +1343,9 @@ moea_clear_modify(mmu_t mmu, vm_page_t m) */ if ((m->aflags & PGA_WRITEABLE) == 0) return; + rw_wlock(&pvh_global_lock); moea_clear_bit(m, PTE_CHG); + rw_wunlock(&pvh_global_lock); } /* @@ -1400,13 +1412,17 @@ moea_remove_write(mmu_t mmu, vm_page_t m) * should be tested and standardized at some point in the future for * optimal aging of shared pages. */ -boolean_t +int moea_ts_referenced(mmu_t mmu, vm_page_t m) { + int count; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_ts_referenced: page %p is not managed", m)); - return (moea_clear_bit(m, PTE_REF)); + rw_wlock(&pvh_global_lock); + count = moea_clear_bit(m, PTE_REF); + rw_wunlock(&pvh_global_lock); + return (count); } /* @@ -1816,7 +1832,7 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } - if ((m->aflags & PGA_WRITEABLE) && moea_is_modified(mmu, m)) { + if ((m->aflags & PGA_WRITEABLE) && moea_query_bit(m, PTE_CHG)) { moea_attr_clear(m, PTE_CHG); vm_page_dirty(m); } @@ -2293,10 +2309,10 @@ moea_query_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; + rw_assert(&pvh_global_lock, RA_WLOCKED); if (moea_attr_fetch(m) & ptebit) return (TRUE); - rw_wlock(&pvh_global_lock); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { /* @@ -2305,7 +2321,6 @@ moea_query_bit(vm_page_t m, int ptebit) */ if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - rw_wunlock(&pvh_global_lock); return (TRUE); } } @@ -2329,13 +2344,11 @@ moea_query_bit(vm_page_t m, int ptebit) mtx_unlock(&moea_table_mutex); if (pvo->pvo_pte.pte.pte_lo & ptebit) { moea_attr_save(m, ptebit); - rw_wunlock(&pvh_global_lock); return (TRUE); } } } - rw_wunlock(&pvh_global_lock); return (FALSE); } @@ -2346,7 +2359,7 @@ moea_clear_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; - rw_wlock(&pvh_global_lock); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* * Clear the cached value. @@ -2380,7 +2393,6 @@ moea_clear_bit(vm_page_t m, int ptebit) pvo->pvo_pte.pte.pte_lo &= ~ptebit; } - rw_wunlock(&pvh_global_lock); return (count); } Index: powerpc/aim/mmu_oea64.c =================================================================== --- powerpc/aim/mmu_oea64.c (revision 237346) +++ powerpc/aim/mmu_oea64.c (working copy) @@ -305,7 +305,7 @@ void moea64_init(mmu_t); boolean_t moea64_is_modified(mmu_t, vm_page_t); boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); -boolean_t moea64_ts_referenced(mmu_t, vm_page_t); +int moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); @@ -1570,7 +1570,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t m) * should be tested and standardized at some point in the future for * optimal aging of shared pages. */ -boolean_t +int moea64_ts_referenced(mmu_t mmu, vm_page_t m) { --------------070807020805030306060404--