From owner-freebsd-mips@FreeBSD.ORG Wed Jun 30 12:57:31 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 2B7C1106566C; Wed, 30 Jun 2010 12:57:31 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 71B608FC1A; Wed, 30 Jun 2010 12:57:30 +0000 (UTC) Received: by fxm13 with SMTP id 13so437327fxm.13 for ; Wed, 30 Jun 2010 05:57:25 -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; bh=dEGuD5uGrcxhWmn5UrDDYq2dm6CZ5E54XEHOaEsMYI0=; b=W5PTeCPjnz90pv6Int3qqW23hp3cP3EC09mkQxj58xBpsx97YSEhAgyndzQaMouvM3 hilpWq9RYTHz3mZk7yuPSNDPuF4w1q33Hiy8bYzF39d6mrSFkT+sUxKrAG9Nmw3PzzK/ scRG2Az8wwuL2OQvzeAxBW1f7rW+yooMmlwi4= 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; b=W79B/cHS6XhBWxfT3iXNc8MaGDCFG6FIQjnjUIWv/mdNQWOSRNQNNQF9GvlTPLKRhJ D7Fyz04pAm7bHL9Kn46dwdwZQALcefb3p91l1wDiJstL6MTvBSAD7RXQASKXTIyVBvBK Q5Baeh8AHdu81dUFuItxpShqmcH9WqwFoy6r0= MIME-Version: 1.0 Received: by 10.103.205.23 with SMTP id h23mr2880969muq.88.1277902644635; Wed, 30 Jun 2010 05:57:24 -0700 (PDT) Received: by 10.220.199.2 with HTTP; Wed, 30 Jun 2010 05:57:24 -0700 (PDT) In-Reply-To: <25B9A19D-0A6B-4731-8FB1-A2C6722F0E9C@gmail.com> References: <897604F6-95C4-49A8-B11F-277A74C8DBAE@gmail.com> <3C0AEF9B-AE0C-4459-A4E1-2C8C30C10FD6@gmail.com> <25B9A19D-0A6B-4731-8FB1-A2C6722F0E9C@gmail.com> Date: Wed, 30 Jun 2010 18:27:24 +0530 Message-ID: From: "Jayachandran C." To: Luiz Otavio O Souza Content-Type: multipart/mixed; boundary=00235418615830e8db048a3ee587 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: Wed, 30 Jun 2010 12:57:31 -0000 --00235418615830e8db048a3ee587 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 failing, >>>> 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 look := ) >> >> 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 like >> 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 pat= ch the kernel apparently crash at bzero(), here is the dmesg with TRAP_DEBU= G enabled: > > http://mips.pastebin.com/jydPvJ20 > > So hopefully you are on the right track and this may be something obvious= to you. Not yet :) I really hoped the earlier change would fix it. The number 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. This really 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. --00235418615830e8db048a3ee587 Content-Type: text/plain; charset=US-ASCII; name="try.diff" Content-Disposition: attachment; filename="try.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gb25y7ke0 SW5kZXg6IHN5cy9taXBzL21pcHMvdGxiLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL21pcHMvbWlwcy90 bGIuYwkocmV2aXNpb24gMjA5NTIxKQorKysgc3lzL21pcHMvbWlwcy90bGIuYwkod29ya2luZyBj b3B5KQpAQCAtMjE3LDM0ICsyMTcsNDMgQEAKIHZvaWQKIHRsYl91cGRhdGUoc3RydWN0IHBtYXAg KnBtYXAsIHZtX29mZnNldF90IHZhLCBwdF9lbnRyeV90IHB0ZSkKIHsKLQlyZWdpc3Rlcl90IG1h c2ssIGFzaWQ7Ci0JcmVnaXN0ZXJfdCBzOwotCWludCBpOworCXB0X2VudHJ5X3Qgb3RoZXI7CisJ cmVnaXN0ZXJfdCBvbGRoaSwgaGksIHM7CisJaW50IGksIGV2ZW47CiAKLQl2YSAmPSB+UEFHRV9N QVNLOworCWV2ZW4gPSAodmEgJiBQQUdFX1NJWkUpID09IDA7CisJb3RoZXIgPSBwdGUgJiBQVEVf RzsKIAlwdGUgJj0gflRMQkxPX1NXQklUU19NQVNLOworCWhpID0gKHZhICYgMHhmZmZmZTAwMCkg fCAocG1hcF9hc2lkKHBtYXApICYgMHhmZik7CiAKIAlzID0gaW50cl9kaXNhYmxlKCk7Ci0JbWFz ayA9IG1pcHNfcmRfcGFnZW1hc2soKTsKLQlhc2lkID0gbWlwc19yZF9lbnRyeWhpKCkgJiBUTEJI SV9BU0lEX01BU0s7Ci0KLQltaXBzX3dyX3BhZ2VtYXNrKDApOwotCW1pcHNfd3JfZW50cnloaShU TEJISV9FTlRSWSh2YSwgcG1hcF9hc2lkKHBtYXApKSk7CisJb2xkaGkgPSBtaXBzX3JkX2VudHJ5 aGkoKTsKKwltaXBzX3dyX2VudHJ5aGkoaGkpOwogCXRsYl9wcm9iZSgpOwogCWkgPSBtaXBzX3Jk X2luZGV4KCk7CiAJaWYgKGkgPj0gMCkgewogCQl0bGJfcmVhZCgpOwogCi0JCWlmICgodmEgJiBQ QUdFX1NJWkUpID09IDApIHsKKwkJaWYgKGV2ZW4pIHsKIAkJCW1pcHNfd3JfZW50cnlsbzAocHRl KTsKIAkJfSBlbHNlIHsKIAkJCW1pcHNfd3JfZW50cnlsbzEocHRlKTsKIAkJfQogCQl0bGJfd3Jp dGVfaW5kZXhlZCgpOworCX0gZWxzZSB7CisJCW1pcHNfd3JfcGFnZW1hc2soMCk7CisJCW1pcHNf d3JfZW50cnloaShoaSk7CisJCWlmIChldmVuKSB7CisJCQltaXBzX3dyX2VudHJ5bG8wKHB0ZSk7 CisJCQltaXBzX3dyX2VudHJ5bG8xKG90aGVyKTsKKwkJfSBlbHNlIHsKKwkJCW1pcHNfd3JfZW50 cnlsbzAob3RoZXIpOworCQkJbWlwc193cl9lbnRyeWxvMShwdGUpOworCQl9CisJCXRsYl93cml0 ZV9yYW5kb20oKTsKIAl9CiAKLQltaXBzX3dyX2VudHJ5aGkoYXNpZCk7Ci0JbWlwc193cl9wYWdl bWFzayhtYXNrKTsKKwltaXBzX3dyX2VudHJ5aGkob2xkaGkpOwogCWludHJfcmVzdG9yZShzKTsK IH0KIAo= --00235418615830e8db048a3ee587 Content-Type: text/plain; charset=US-ASCII; name="pte.h-fix.diff" Content-Disposition: attachment; filename="pte.h-fix.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gb25yl9o1 SW5kZXg6IHN5cy9taXBzL2luY2x1ZGUvcHRlLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL21pcHMvaW5j bHVkZS9wdGUuaAkocmV2aXNpb24gMjA5NTIxKQorKysgc3lzL21pcHMvaW5jbHVkZS9wdGUuaAko d29ya2luZyBjb3B5KQpAQCAtNzMsNyArNzMsOCBAQAogICogTm90ZSB0aGF0IGluIEZyZWVCU0Qs IHdlIG1hcCAyIFRMQiBwYWdlcyBpcyBlcXVhbCB0byAxIFZNIHBhZ2UuCiAgKi8KICNkZWZpbmUJ VExCSElfQVNJRF9NQVNLCQkoMHhmZikKLSNkZWZpbmUJVExCSElfRU5UUlkodmEsIGFzaWQpCSgo KHZhKSAmIH5QQUdFX01BU0spIHwgKChhc2lkKSAmIFRMQkhJX0FTSURfTUFTSykpCisjZGVmaW5l CVRMQkhJX1BBR0VfTUFTSwkJKH4oMiAqIFBBR0VfU0laRSAtIDEpKQorI2RlZmluZQlUTEJISV9F TlRSWSh2YSwgYXNpZCkJKCgodmEpICYgVExCSElfUEFHRV9NQVNLKSB8ICgoYXNpZCkgJiBUTEJI SV9BU0lEX01BU0spKQogCiAjaWZuZGVmIF9MT0NPUkUKIHR5cGVkZWYJdWludDMyX3QgcHRfZW50 cnlfdDsK --00235418615830e8db048a3ee587--