From owner-freebsd-mips@FreeBSD.ORG Thu Jul 1 18:47:20 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890281065670; Thu, 1 Jul 2010 18:47:20 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 054818FC0A; Thu, 1 Jul 2010 18:47:19 +0000 (UTC) Received: by vws6 with SMTP id 6so1951655vws.13 for ; Thu, 01 Jul 2010 11:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3u7hm7wGkVigVkvjb6q57EWD6M6izmLpeJ2JVMDiD70=; b=jds4FS2sQGyrYsYvUV9srlfdmQj0Upve1ITTRQ8Gf/QlXv7hmSafC+9t9v151gyvF0 /GF7KbO39GOpVkcp2H5Ap3Uxuz2H03M4L2CHtRnjfdX64DSFJ7mWmh3DkIWYFvDMeb5c KjDk/RfKvqZku447TQeOOFjLNIWKF+Aa9/CVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=x3PmVfqqC4go3FII474p9DH6FFieDH/7la5U9Kh8WKYXWwtDhmXm65UiiJQRH/Y16b rqCUGjkQEBryyfa/rLvpDt0kgJqcksC7JC5+WSnwKrFLKLBv141HAZSD4X8ABP1QbcnI XQfv5KKncuXWiyrRXNs2yUP73+9hn4gj4kHWs= MIME-Version: 1.0 Received: by 10.220.168.7 with SMTP id s7mr3555737vcy.193.1278010027295; Thu, 01 Jul 2010 11:47:07 -0700 (PDT) Received: by 10.220.194.4 with HTTP; Thu, 1 Jul 2010 11:47:07 -0700 (PDT) In-Reply-To: <7886D15B-79BF-4BC6-8467-26A8D0FE3D00@gmail.com> References: <897604F6-95C4-49A8-B11F-277A74C8DBAE@gmail.com> <3C0AEF9B-AE0C-4459-A4E1-2C8C30C10FD6@gmail.com> <25B9A19D-0A6B-4731-8FB1-A2C6722F0E9C@gmail.com> <7886D15B-79BF-4BC6-8467-26A8D0FE3D00@gmail.com> Date: Fri, 2 Jul 2010 00:17:07 +0530 Message-ID: From: "Jayachandran C." To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: Merging 64 bit changes to -HEAD X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2010 18:47:20 -0000 On Thu, Jul 1, 2010 at 10:25 PM, Luiz Otavio O Souza w= rote: > On Jun 30, 2010, at 7:40 PM, Jayachandran C. wrote: >> On Wed, Jun 30, 2010 at 10:38 PM, Luiz Otavio O Souza >> wrote: >>> On Jun 30, 2010, at 9:57 AM, Jayachandran C. wrote: >>> >>>> On Tue, Jun 29, 2010 at 10:32 PM, Luiz Otavio O Souza >>>> wrote: >>>>> >>>>> On Jun 29, 2010, at 8:02 AM, Jayachandran C. wrote: >>>>> >>>>>> On Tue, Jun 29, 2010 at 2:28 AM, Luiz Otavio O Souza wrote: >>>>>>>> Thanks for the the update. Looks like pmap_map for kernel is faili= ng, >>>>>>>> may be the new tlb_update code causes this. =A0Can you apply the >>>>>>>> attached patch and see if the problem still persists, it replaces = the >>>>>>>> new tlb_update code with the older version. >>>>>>>> >>>>>>>> Obviously not a fix, but if we can narrow it down to this function= , >>>>>>>> fixing will be easier. >>>>>>>> >>>>>>>> JC. >>>>>>>> >>>>>>> >>>>>>> JC, >>>>>>> >>>>>>> This fix the problem ! Thanks ! Now, at least, you know where to lo= ok :) >>>>>> >>>>>> The new tlb_update does not seem to update the tlb entry if the tlbp >>>>>> fails. =A0Here's a patch that should make the new function behave li= ke >>>>>> the older one. =A0The patch is in attached file 'tlb-update.diff'. >>>>>> >>>>>> If that does not work, I'm not sure what the issue is. =A0You could = also >>>>>> try try the nop-change.diff attached. It tries to switch the ssnop >>>>>> used for delay in the new code with 'nop' which was used by the old >>>>>> code. >>>>>> >>>>>> Thanks, >>>>>> JC. >>>>>> >>>>> >>>>> JC, >>>>> >>>>> The nop-change seems to have no effect at all and with the tlb-update= patch the kernel apparently crash at bzero(), here is the dmesg with TRAP_= DEBUG enabled: >>>>> >>>>> http://mips.pastebin.com/jydPvJ20 >>>>> >>>>> So hopefully you are on the right track and this may be something obv= ious to you. >>>> >>>> Not yet :) I really hoped the earlier change would fix it. =A0The numb= er >>>> of nop does not seem to be the issue as it is higher in the C code >>>> than the assembly. >>>> >>>> Can you try the attached patch (try.diff) - this re-implements the >>>> assembly code functionality almost in the same way in C. =A0This reall= y >>>> should work, given that the patch which made it assembly worked... >>>> >>>> If that works can you see if the second attached patch works, this >>>> fixes a potential problem (ie, we should be masking 13bits for TLBHI). >>>> >>>> Both patches should apply directly to SVN (not dependent on each >>>> other, or on previous patches) >>>> >>>> Thanks again, >>>> JC. >>>> >>> >>> >>> JC, >>> >>> The try.diff works with or without the pte.h change (at least for a sim= ple boot) and the pte.h change does nothing without the try.diff. >> >> I've attached the final(final.diff) version I want to check-in, can >> you please quickly test it? >> >> If that does not work, can you tell me if the attached alt1.diff or >> alt2.diff works? The try.diff had three changes: handle case of >> index>0, remove pagemask operation, restore full entryhi instead of >> asid. So if the first does not work, this will help narrow down the >> rest of the cases. >> >> Hopefully this is the last iteration :) >> >> JC. >> > > > JC, > > The final.diff and alt1.diff crash (into debugger) like the first try.dif= f (here is the dmesg: http://pastebin.com/r2uunZPZ). > > The alt2.diff works, i'll try it a little more (buildworld). > > Feel free to send more tests if needed. Looks like I was on the wrong track, it now looks like the pagemask maybe the cause. My suspicion is that the bootloader setups a pagemask and we never clear it because all the operations save and restore the mask. As far as I can see the TLB exception handler will not update pagemask. Juli - any comments on this? Do you need to save/restore pagemask for some reason, otherwise I will take out the part from tlb.c. Will send out a patch a bit later. JC.