From owner-freebsd-arm@FreeBSD.ORG Wed Jun 11 06:00:46 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68503807; Wed, 11 Jun 2014 06:00:46 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E982BF9; Wed, 11 Jun 2014 06:00:45 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s5B60G4F030701; Wed, 11 Jun 2014 01:00:43 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1megh0806r-1; Wed, 11 Jun 2014 01:00:42 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 39DED460110; Wed, 11 Jun 2014 01:00:42 -0500 (CDT) Message-ID: <5397F089.90403@rice.edu> Date: Wed, 11 Jun 2014 01:00:41 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Warner Losh , alc@freebsd.org, "freebsd-arm@freebsd.org" Subject: Re: svn commit: r266850 - in head/sys/arm/xscale: i80321 i8134x ixp425 pxa References: <53950BB9.3090808@rice.edu> <20140609042206.GQ31367@funkthat.com> <5395D312.5000302@rice.edu> <20140609163302.GS31367@funkthat.com> <5395E725.7020807@rice.edu> <20140609174431.GT31367@funkthat.com> <9100CDFA-0C40-4BC8-AA9C-1DE37EEA6208@rice.edu> <6DA17B5C-1824-49BF-8192-432135D42C6E@bsdimp.com> <20140609221742.GV31367@funkthat.com> <539730B1.2040900@rice.edu> <20140610170052.GF31367@funkthat.com> In-Reply-To: <20140610170052.GF31367@funkthat.com> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------040803000403060807040002" X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=8.27792390190041e-10 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.248919945447816 urlsuspect_oldscore=0.248919945447816 suspectscore=11 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.248919945447816 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406110081 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 06:00:46 -0000 This is a multi-part message in MIME format. --------------040803000403060807040002 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 06/10/2014 12:00, John-Mark Gurney wrote: > Alan Cox wrote this message on Tue, Jun 10, 2014 at 11:22 -0500: >> On 06/09/2014 17:17, John-Mark Gurney wrote: >>> Warner Losh wrote this message on Mon, Jun 09, 2014 at 14:08 -0600: >>>> On Jun 9, 2014, at 1:23 PM, Alan Cox wrote: >>>> >>>>> On Jun 9, 2014, at 12:44 PM, John-Mark Gurney wrote: >>>>> >>>>>> Alan Cox wrote this message on Mon, Jun 09, 2014 at 11:56 -0500: >>>>>>> I made a mistake with the new KASSERT()s in vm_reserv_break(). Try this. >>>>>> No worried, the new patch panics: >>>>>> panic: vm_reserv_break: 2 saved_object=0xc06e6378 x=253 m_tmp->object=0xc06e6378 (1) >>>>>> >>>>> Is your arm processor running in big-endian or little-endian mode? >>>> Big Endian. >>> Specificly, TARGET_ARCH=armeb... So, ARMv4 in big-endian mode... >>> >> Please try the attached patch. > This patch now boots to multiuser mode and I can log in! > > I can now more easily debug newsyslog segfaulting and stuff... I'll > let you know if I have any more issues... > > Thanks again for tracking this down! > Here is a commit-able patch. Please tell me if it works. Alan --------------040803000403060807040002 Content-Type: text/plain; charset=ISO-8859-15; name="arm_final2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="arm_final2.patch" Index: vm/vm_reserv.c =================================================================== --- vm/vm_reserv.c (revision 267282) +++ vm/vm_reserv.c (working copy) @@ -108,6 +108,46 @@ typedef u_long popmap_t; #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) /* + * Clear a bit in the population map. + */ +static __inline void +popmap_clear(popmap_t popmap[], int i) +{ + + popmap[i / NBPOPMAP] &= ~(1UL << (i % NBPOPMAP)); +} + +/* + * Set a bit in the population map. + */ +static __inline void +popmap_set(popmap_t popmap[], int i) +{ + + popmap[i / NBPOPMAP] |= 1UL << (i % NBPOPMAP); +} + +/* + * Is a bit in the population map clear? + */ +static __inline boolean_t +popmap_is_clear(popmap_t popmap[], int i) +{ + + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) == 0); +} + +/* + * Is a bit in the population map set? + */ +static __inline boolean_t +popmap_is_set(popmap_t popmap[], int i) +{ + + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) != 0); +} + +/* * The reservation structure * * A reservation structure is constructed whenever a large physical page is @@ -241,7 +281,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int index) mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->object != NULL, ("vm_reserv_depopulate: reserv %p is free", rv)); - KASSERT(isset(rv->popmap, index), + KASSERT(popmap_is_set(rv->popmap, index), ("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv, index)); KASSERT(rv->popcnt > 0, @@ -255,7 +295,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int index) rv)); rv->pages->psind = 0; } - clrbit(rv->popmap, index); + popmap_clear(rv->popmap, index); rv->popcnt--; if (rv->popcnt == 0) { LIST_REMOVE(rv, objq); @@ -302,7 +342,7 @@ vm_reserv_populate(vm_reserv_t rv, int index) mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->object != NULL, ("vm_reserv_populate: reserv %p is free", rv)); - KASSERT(isclr(rv->popmap, index), + KASSERT(popmap_is_clear(rv->popmap, index), ("vm_reserv_populate: reserv %p's popmap[%d] is set", rv, index)); KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES, @@ -313,7 +353,7 @@ vm_reserv_populate(vm_reserv_t rv, int index) TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; } - setbit(rv->popmap, index); + popmap_set(rv->popmap, index); rv->popcnt++; if (rv->popcnt < VM_LEVEL_0_NPAGES) { rv->inpartpopq = TRUE; @@ -503,7 +543,7 @@ found: return (NULL); /* Handle vm_page_rename(m, new_object, ...). */ for (i = 0; i < npages; i++) - if (isset(rv->popmap, index + i)) + if (popmap_is_set(rv->popmap, index + i)) return (NULL); for (i = 0; i < npages; i++) vm_reserv_populate(rv, index + i); @@ -628,7 +668,7 @@ found: index = VM_RESERV_INDEX(object, pindex); m = &rv->pages[index]; /* Handle vm_page_rename(m, new_object, ...). */ - if (isset(rv->popmap, index)) + if (popmap_is_set(rv->popmap, index)) return (NULL); vm_reserv_populate(rv, index); return (m); @@ -662,9 +702,9 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m) * to the physical memory allocator. */ i = m - rv->pages; - KASSERT(isclr(rv->popmap, i), + KASSERT(popmap_is_clear(rv->popmap, i), ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); - setbit(rv->popmap, i); + popmap_set(rv->popmap, i); rv->popcnt++; } i = hi = 0; --------------040803000403060807040002--