From owner-freebsd-current@FreeBSD.ORG Wed Jun 24 13:17:07 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C2F61065740; Wed, 24 Jun 2009 13:17:07 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F20D08FC08; Wed, 24 Jun 2009 13:17:05 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA28611; Wed, 24 Jun 2009 16:17:03 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A42274E.2020207@freebsd.org> Date: Wed, 24 Jun 2009 16:17:02 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Wesley Shields References: <60173AF0-7E54-4BDD-8927-0DADA9DAD1B4@exscape.org> <20090522200306.GE2630@atarininja.org> <20090617225849.GB28509@atarininja.org> <4A3A1D27.4010802@icyb.net.ua> <4A3BBF5A.6060702@icyb.net.ua> <4A3BC481.1010600@cs.rice.edu> <20090624003531.GA63536@atarininja.org> In-Reply-To: <20090624003531.GA63536@atarininja.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alan Cox , John Birrell , Thomas Backman , FreeBSD current Subject: Re: DTrace panic while probing syscall::open (and possibly many others) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2009 13:17:08 -0000 on 24/06/2009 03:35 Wesley Shields said the following: > This patch makes it work for me and uses INKERNEL. I have no idea if > it's correct or not... > > Index: sys/cddl/dev/dtrace/amd64/dtrace_isa.c > =================================================================== > --- sys/cddl/dev/dtrace/amd64/dtrace_isa.c (revision 194740) > +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c (working copy) > @@ -524,9 +524,9 @@ > static int > dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) > { > - ASSERT(kaddr >= kernelbase && kaddr + size >= kaddr); > + ASSERT(INKERNEL(kaddr) && kaddr + size >= kaddr); > > - if (uaddr + size >= kernelbase || uaddr + size < uaddr) { > + if (INKERNEL(uaddr + size) || uaddr + size < uaddr) { > DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); > cpu_core[curcpu].cpuc_dtrace_illval = uaddr; > return (0); > > > I've put a copy up at http://people.freebsd.org/~wxs/dtrace.diff too. Wesley, thank you! I like this patch and I am sure that it does the right thing. I think that we should retire kernelbase from amd64 altogether and replace all other uses of it in dtrace_isa.c (uaddr checks) similarly to the above, and remove unused extern declaration in dtrace_subr.c too. -- Andriy Gapon