From owner-freebsd-stable@FreeBSD.ORG Thu Jan 9 18:52:53 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 780CBB99 for ; Thu, 9 Jan 2014 18:52:53 +0000 (UTC) Received: from nm9-vm3.bullet.mail.ne1.yahoo.com (nm9-vm3.bullet.mail.ne1.yahoo.com [98.138.91.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A1FC12EC for ; Thu, 9 Jan 2014 18:52:53 +0000 (UTC) Received: from [98.138.100.115] by nm9.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2014 18:47:09 -0000 Received: from [98.138.226.57] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2014 18:47:09 -0000 Received: from [127.0.0.1] by smtp208.mail.ne1.yahoo.com with NNFMP; 09 Jan 2014 18:47:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1389293229; bh=F0R+a7oHIwpHshDqzdi4h5QERE2qeJZdfevhDkvo0Kg=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Subject:From:Reply-To:To:Cc:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=cq+K53w5sfWOAfFnQ0SwJ+FWTMhC5JVsr+75mXYT3xqsiwkDLJhef681etgY2B4gRXN6WbQ+Dbygbx7qKunA1C81HpObfFlWFW44UI2giirxzTz17BUOHLAW5DGGjYQX+pnTs7DyzNxqs/BtGhyFaAt97j1SjSDR0Mo0/uyntQ8= X-Yahoo-Newman-Id: 485163.53564.bm@smtp208.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FRyIuCIVM1lXCjtLGYtaw5jOE5yDYervcuvnEx1YkzFljxR ft0p_YNNKSGePTevLeAAR0pMsWWzfoGbFSDUBY9ib0c8ee9WsFKxG7kvzvJl 9bxy5q7KgXcIB9lQoBxmM_UFcmSsh8YFdmtgzWkzHcB6koZlEkMgIpivHNUL i3AHdK.Scg9MUQzk0l6xG1gHY1mcVRINj87nGRp9Ws0QDXdKMKHDTWTS2K5V nab6Uz9iALUOjCja5Mn26.7iwJxDnio1yZd75UnTil86SjHuw.0knft9Vwiv aHUEaTRt66UsKztFdEmHCISGdViNs.4AFOgfL3xFXgQ7m8iDcU8o1aQ8kUTk KJmQLk7HljFEviwaBx5XeVCpQ17EoOwtKB9w.HTGiV44MyVimqytHnQNgnDg 7xFOtEIsCn64Drf36eCXkmoSnFcB9R6aLi_Jx.mni8b_oWTw6IFR0Jv4jF9J GliJjaRcxIW07U6BoqwpfvA9yRX1Kx5k2xUXtc6rduKxek5waRmZfcX12Wn1 F4X1ga_BMg9o6T9KSKEmo8EUgLf2cHk2IC2wSc9kFCl5sRoXOynm36F8lmmr 1I2brZBBG2pnEk31wKAIP6pArmUoU61K0gR0ssbeVk2cCD2WXiHH0zjrCWgo pqouyBrMThXtTjoc0SQlgJ1lyAeXxWyGEmKB5PxWZ7oNZQOGFT3VX X-Yahoo-SMTP: u5BKR6OswBC_iZJVfGRoMkTIpc8pEA4- X-Rocket-Received: from [10.73.160.242] (sean_bruno@209.131.62.116 with plain [63.250.193.228]) by smtp208.mail.ne1.yahoo.com with SMTP; 09 Jan 2014 10:47:09 -0800 PST Subject: Re: 10.0 BETA 3 with redports kernel panic From: Sean Bruno To: sbruno@freebsd.org In-Reply-To: <1389230030.6589.1.camel@powernoodle.corp.yahoo.com> References: <1387492541.27693.5.camel@powernoodle.corp.yahoo.com> <20131220094835.GR59496@kib.kiev.ua> <1387554355.1491.4.camel@powernoodle.corp.yahoo.com> <20131220162254.GT59496@kib.kiev.ua> <20131221145534.GY59496@kib.kiev.ua> <1387818681.2431.0.camel@powernoodle.corp.yahoo.com> <1388170732.1530.2.camel@powernoodle.corp.yahoo.com> <20131228140843.GT59496@kib.kiev.ua> <1389230030.6589.1.camel@powernoodle.corp.yahoo.com> Content-Type: text/plain; charset="us-ascii" Date: Thu, 09 Jan 2014 10:47:06 -0800 Message-ID: <1389293226.48122.7.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , "freebsd-stable@freebsd.org" , decke , Peter Wemm X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2014 18:52:53 -0000 On Wed, 2014-01-08 at 17:13 -0800, Sean Bruno wrote: > On Sat, 2013-12-28 at 16:08 +0200, Konstantin Belousov wrote: > > diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c > > index abbbb21..fd9c5df 100644 > > --- a/sys/amd64/amd64/mem.c > > +++ b/sys/amd64/amd64/mem.c > > @@ -98,7 +98,13 @@ memrw(struct cdev *dev, struct uio *uio, int flags) > > kmemphys: > > o = v & PAGE_MASK; > > c = min(uio->uio_resid, (u_int)(PAGE_SIZE - > > o)); > > - error = uiomove((void *)PHYS_TO_DMAP(v), > > (int)c, uio); > > + v = PHYS_TO_DMAP(v); > > + if (v < DMAP_MIN_ADDRESS || > > + (v > DMAP_MIN_ADDRESS + dmaplimit && > > + v <= DMAP_MAX_ADDRESS) || > > + pmap_kextract(v) == 0) > > + return (EFAULT); > > + error = uiomove((void *)v, (int)c, uio); > > continue; > > } > > else if (dev2unit(dev) == CDEV_MINOR_KMEM) { > > diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c > > index 014020b..85be1f2 100644 > > --- a/sys/amd64/amd64/pmap.c > > +++ b/sys/amd64/amd64/pmap.c > > @@ -321,7 +321,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, > > &nkpt, 0, > > "Number of kernel page table pages allocated on bootup"); > > > > static int ndmpdp; > > -static vm_paddr_t dmaplimit; > > +vm_paddr_t dmaplimit; > > vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; > > pt_entry_t pg_nx; > > > > diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h > > index 3918282..e83e07e 100644 > > --- a/sys/amd64/include/pmap.h > > +++ b/sys/amd64/include/pmap.h > > @@ -369,6 +369,7 @@ extern vm_paddr_t phys_avail[]; > > extern vm_paddr_t dump_avail[]; > > extern vm_offset_t virtual_avail; > > extern vm_offset_t virtual_end; > > +extern vm_paddr_t dmaplimit; > > > > #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) > > #define pmap_page_is_write_mapped(m) (((m)->aflags & > > PGA_WRITEABLE) != 0) > > > > I've updated 2/4 redbuild machines to stable/10 and applied this patch. > I will monitor them for the rest of the week for stability. > > sean > > p.s. redbuild 03/04 > > __________ rebuild03 deadlocked or something odd today. I dropped to debugger and got a crashdump. This should be fun. core.txt --> http://people.freebsd.org/~sbruno/redbuild_10_lockup.txt confirming diff here: root@redbuild03:/usr/src # svn diff Index: sys/amd64/amd64/mem.c =================================================================== --- sys/amd64/amd64/mem.c (revision 260456) +++ sys/amd64/amd64/mem.c (working copy) @@ -98,7 +98,12 @@ kmemphys: o = v & PAGE_MASK; c = min(uio->uio_resid, (u_int)(PAGE_SIZE - o)); - error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio); + v = PHYS_TO_DMAP(v); + if (v < DMAP_MIN_ADDRESS || + (v > DMAP_MIN_ADDRESS + dmaplimit && + v <= DMAP_MAX_ADDRESS) || + pmap_kextract(v) == 0) + return (EFAULT); continue; } else if (dev2unit(dev) == CDEV_MINOR_KMEM) { Index: sys/amd64/amd64/pmap.c =================================================================== --- sys/amd64/amd64/pmap.c (revision 260456) +++ sys/amd64/amd64/pmap.c (working copy) @@ -321,7 +321,7 @@ "Number of kernel page table pages allocated on bootup"); static int ndmpdp; -static vm_paddr_t dmaplimit; +vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; Index: sys/amd64/include/pmap.h =================================================================== --- sys/amd64/include/pmap.h (revision 260456) +++ sys/amd64/include/pmap.h (working copy) @@ -368,6 +368,7 @@ extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern vm_paddr_t dmaplimit; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0)