From owner-svn-src-head@FreeBSD.ORG Thu Sep 2 12:51:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from alona.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id DA1AE10656A8; Thu, 2 Sep 2010 12:51:55 +0000 (UTC) (envelope-from davidxu@freebsd.org) Message-ID: <4C7F9DE6.6010900@freebsd.org> Date: Thu, 02 Sep 2010 20:51:50 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.21 (X11/20090522) MIME-Version: 1.0 To: John Baldwin References: <201009010218.o812IX5G048257@svn.freebsd.org> <201009020639.47198.jhb@freebsd.org> <4C7F8C28.50309@freebsd.org> <201009020816.59745.jhb@freebsd.org> In-Reply-To: <201009020816.59745.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212076 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 12:51:58 -0000 John Baldwin wrote: > On Thursday, September 02, 2010 7:36:08 am David Xu wrote: > >> John Baldwin wrote: >> >>> On Thursday, September 02, 2010 6:22:18 am Kostik Belousov wrote: >>> >>> >>>> On Thu, Sep 02, 2010 at 05:35:39PM +0000, David Xu wrote: >>>> >>>> >>>>> Kostik Belousov wrote: >>>>> >>>>> >>>>> >>>>>>> the tf_err may not be equal to ksi_addr! This may need to be fixed. >>>>>>> >>>>>>> >>>>>>> >>>>>> The change was introduced by >>>>>> r151316 | davidxu | 2005-10-14 >>>>>> /* Old FreeBSD-style arguments. */ >>>>>> - sf.sf_siginfo = code; >>>>>> - sf.sf_addr = regs->tf_err; >>>>>> + sf.sf_siginfo = ksi->ksi_code; >>>>>> + sf.sf_addr = (register_t)ksi->ksi_addr; >>>>>> sf.sf_ahu.sf_handler = catcher; >>>>>> >>>>>> >>>>>> >>>>> :( >>>>> >>>>> >>>> The rollback looks straightforward. I explicitely decided to not change >>>> any architecture that is not i386. >>>> >>>> >>> It may not be this simple. At one point we had a "feature" where we >>> > trashed > >>> tf_err in the trapframe to store the address so it could be passed to >>> > sendsig > >>> for this purpose. I think once we started using ksi_addr here we removed >>> > the > >>> trashing of tf_err as it was no longer necessary. >>> >>> >>> >> I saw RELENG_5 saved it at td_md.md_fault_address, but I really can not >> remember >> which version has such "feature". ;-) >> By the way, I still can not find a modern program uses this old style >> and wants to >> know the exact fault address. >> Kostik Belousov fixed the error I had made when I was implementing >> signal queue. >> > > See revision 170688 for example: > > r170688 | jhb | 2007-06-13 18:37:48 -0400 (Wed, 13 Jun 2007) | 6 lines > > Don't clobber tf_err with the eva from a page fault as the page fault > address is saved in ksi_addr already. > > PR: i386/101379 > Submitted by: Tijl Coosemans : tijl ulyssis org > > Index: trap.c > =================================================================== > --- trap.c (revision 170687) > +++ trap.c (revision 170688) > @@ -785,9 +785,6 @@ > return (-1); > } > > - /* kludge to pass faulting virtual address to sendsig */ > - frame->tf_err = eva; > - > return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); > } > > Given that, I think the existing code is correct and that there is no bug to > be fixed. > > Thanks for clarifying, I am really confused when Kostik Belousov mailed me, I wish I had not made the mistake, after all it was 4 years 10 months ago, so I can not remember exactly what had happened at that time.