From owner-freebsd-mips@freebsd.org Mon Nov 7 11:15:03 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D43C343EE for ; Mon, 7 Nov 2016 11:15:03 +0000 (UTC) (envelope-from yamori813@yahoo.co.jp) Received: from nh602-vm10.bullet.mail.ssk.yahoo.co.jp (nh602-vm10.bullet.mail.ssk.yahoo.co.jp [182.22.90.35]) by mx1.freebsd.org (Postfix) with SMTP id B4242130 for ; Mon, 7 Nov 2016 11:15:01 +0000 (UTC) (envelope-from yamori813@yahoo.co.jp) Received: from [182.22.66.103] by nh602.bullet.mail.ssk.yahoo.co.jp with NNFMP; 07 Nov 2016 11:14:55 -0000 Received: from [182.22.91.128] by t601.bullet.mail.ssk.yahoo.co.jp with NNFMP; 07 Nov 2016 11:14:55 -0000 Received: from [127.0.0.1] by omp601.mail.ssk.yahoo.co.jp with NNFMP; 07 Nov 2016 11:14:55 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 528064.70660.bm@omp601.mail.ssk.yahoo.co.jp Received: (qmail 73858 invoked by uid 60001); 7 Nov 2016 11:14:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.jp; s=yj20110701; t=1478517295; bh=ZubK6mUyOhA+OFyr84tlo4oK+6LYK0t2OPUI1hFECuM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:X-YMail-JAS:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=VSVErEY8JdBAeu411aGm1G7pb3Hs6W0w+ARrrKJ25/W8RpugXnJyQhDfak+dC6O8poCvxbwS94JPJFhImSakFOOp4lYbys9E6LzjmfueZ6h6gpujCSwLm9RRifjT7v2GEzpYHeQb67dQz2VaAO+/bpH2dg/RVcxU3SKEv6WRISE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Message-ID:X-YMail-OSG:Received:X-Mailer:X-YMail-JAS:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=PANwWBDBjSdQ+puL1wJ0/N5xPP1B0N8jqV8ZHVOtWOZ5HKhpK+06eGb9pHmKllBJWcrn+Xwa6VSF54fTUPJprl4q7CW19vdLAV51WFIUYSfZ2zZCZelxc4zYaODEw+mNXTyOrpLcngOxSLbvuNLSuNcRefF32ryQjEwq4yK8i9g=; Message-ID: <472260.68795.qm@web101710.mail.ssk.yahoo.co.jp> X-YMail-OSG: C1OABb0VM1nmijU3JhIPx4S2wcXxxaN28N5CIqTk68FnalBr7tY.cknhHyOIX8zDJlZei5.Ht9jetLdHUZ7WOnyOUkmjjMXiy7beu_OdwGwnRRgcm3w_toLEnn1ZrjShBl_6iVFjTiG5hsjpaOHc5pD245_gZAdVIUVzNG7WihOluviDcrZNOWZyD7prZMa8ZLin.bE5LcQzjS8RTZdmAnzrjY5LA2xcb.umBTe6J4I69DLBfvyqRzaC9Mj.TSaaihC9wWyQHf_2iIjap5bv9atG_sa0FjYOhjgV3fvE4zYWzFYA4Ixn7Vyn0qDJqZjeuVSxWCJq6IDiY8tu6fK0DvsIwz_twfbUTHScYjhafGw1Se8Xb6k.3_S589zN.ZfPluFPCeL_Xpflmm5aCmey_xQ4r3N4WKPGO62YvNK6qvP9GH2bEviCyonLHjIEDa39VT5FxeaE1w0kwePcfkCd8nov41GCm.tlMv1E_kQmCJUAXynPuXRho3lLE81SFYHHbTiimfKYhw7Ihu5D3.pqYBCMzd87ai74QDABSjqc2HRphJtiSu5xMQ-- Received: from [110.134.192.208] by web101710.mail.ssk.yahoo.co.jp via HTTP; Mon, 07 Nov 2016 20:14:55 JST X-Mailer: YahooMailWebService/0.8.111_70 X-YMail-JAS: FZBr_7oVM1ldYkNccsg17MkDLfSoDGDOV8qj_GsBfM42L7mqrhWTnP9kQKaWP.hGqEJmDZLdf20thbzAZ_yfOQqJ0Drlhwk4XlvjMNGPTH3fJbGU.HjCWuGn1QoPqUd3.jZg Date: Mon, 7 Nov 2016 20:14:55 +0900 (JST) From: Mori Hiroki Reply-To: Mori Hiroki Subject: ukswitch non 0 start phy patch To: "freebsd-mips@freebsd.org" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1898903077-958321493-1478517295=:68795" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2016 11:15:03 -0000 ---1898903077-958321493-1478517295=:68795 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi.=0A=0AThis is ukswitch patch for non 0 start phy register.=0AI check thi= s patch at KENDIN KS8995XA. This switch chip=0Aphy=A0register address is st= art at 1.=0A=0Ahint.ukswitch.0.at=3D"mdio0"=0Ahint.ukswitch.0.numports=3D5= =0Ahint.ukswitch.0.phymask=3D0x1f=0Ahint.ukswitch.0.phyoffset=3D1=0A=0AMy t= arget is only MDIO connection for SOC. Not connect SPI=0Ainterface. I have = other module at KS8995MA. I will try to=A0=0Amanage this module on etherswi= tch framework by SPI.=0A=0ARegards=0A=0AHiroki Mori=0A ---1898903077-958321493-1478517295=:68795 Content-Type: application/octet-stream; name="ukswitch.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ukswitch.patch" ZGlmZiAtLWdpdCBhL3N5cy9kZXYvZXRoZXJzd2l0Y2gvdWtzd2l0Y2gvdWtz d2l0Y2guYyBiL3N5cy9kZXYvZXRoZXJzd2l0Y2gvdWtzd2l0Y2gvdWtzd2l0 Y2guYwppbmRleCA4NzZhYTlkLi41ZDhjOTVlIDEwMDY0NAotLS0gYS9zeXMv ZGV2L2V0aGVyc3dpdGNoL3Vrc3dpdGNoL3Vrc3dpdGNoLmMKKysrIGIvc3lz L2Rldi9ldGhlcnN3aXRjaC91a3N3aXRjaC91a3N3aXRjaC5jCkBAIC02Nyw2 ICs2Nyw3IEBAIHN0cnVjdCB1a3N3aXRjaF9zb2Z0YyB7CiAJaW50CQltZWRp YTsJCS8qIGNwdSBwb3J0IG1lZGlhICovCiAJaW50CQljcHVwb3J0OwkvKiB3 aGljaCBQSFkgaXMgY29ubmVjdGVkIHRvIHRoZSBDUFUgKi8KIAlpbnQJCXBo eW1hc2s7CS8qIFBIWXMgd2UgbWFuYWdlICovCisJaW50CQlwaHlvZmZzZXQ7 CS8qIFBIWXMgcmVnaXN0ZXIgb2Zmc2V0ICovCiAJaW50CQludW1wb3J0czsJ LyogbnVtYmVyIG9mIHBvcnRzICovCiAJaW50CQlpZnBwb3J0W01JSV9OUEhZ XTsKIAlpbnQJCSpwb3J0cGh5OwpAQCAtMTMzLDcgKzEzNCw3IEBAIHVrc3dp dGNoX2F0dGFjaF9waHlzKHN0cnVjdCB1a3N3aXRjaF9zb2Z0YyAqc2MpCiAJ CSAgICBNX1dBSVRPSyB8IE1fWkVSTyk7CiAJCWVyciA9IG1paV9hdHRhY2go c2MtPnNjX2Rldiwgc2MtPm1paWJ1c1twb3J0XSwgc2MtPmlmcFtwb3J0XSwK IAkJICAgIHVrc3dpdGNoX2lmbWVkaWFfdXBkLCB1a3N3aXRjaF9pZm1lZGlh X3N0cywgXAotCQkgICAgQk1TUl9ERUZDQVBNQVNLLCBwaHksIE1JSV9PRkZT RVRfQU5ZLCAwKTsKKwkJICAgIEJNU1JfREVGQ0FQTUFTSywgcGh5ICsgc2Mt PnBoeW9mZnNldCwgTUlJX09GRlNFVF9BTlksIDApOwogCQlEUFJJTlRGKHNj LT5zY19kZXYsICIlcyBhdHRhY2hlZCB0byBwc2V1ZG8gaW50ZXJmYWNlICVz XG4iLAogCQkgICAgZGV2aWNlX2dldF9uYW1ldW5pdCgqc2MtPm1paWJ1c1tw b3J0XSksCiAJCSAgICBzYy0+aWZwW3BvcnRdLT5pZl94bmFtZSk7CkBAIC0x NjYsNiArMTY3LDcgQEAgdWtzd2l0Y2hfYXR0YWNoKGRldmljZV90IGRldikK IAkvKiBYWFggRGVmYXVsdHMgKi8KIAlzYy0+bnVtcG9ydHMgPSA2OwogCXNj LT5waHltYXNrID0gMHgwZjsKKwlzYy0+cGh5b2Zmc2V0ID0gMDsKIAlzYy0+ Y3B1cG9ydCA9IC0xOwogCXNjLT5tZWRpYSA9IDEwMDsKIApAQCAtMTc0LDYg KzE3Niw4IEBAIHVrc3dpdGNoX2F0dGFjaChkZXZpY2VfdCBkZXYpCiAJKHZv aWQpIHJlc291cmNlX2ludF92YWx1ZShkZXZpY2VfZ2V0X25hbWUoZGV2KSwg ZGV2aWNlX2dldF91bml0KGRldiksCiAJICAgICJwaHltYXNrIiwgJnNjLT5w aHltYXNrKTsKIAkodm9pZCkgcmVzb3VyY2VfaW50X3ZhbHVlKGRldmljZV9n ZXRfbmFtZShkZXYpLCBkZXZpY2VfZ2V0X3VuaXQoZGV2KSwKKwkgICAgInBo eW9mZnNldCIsICZzYy0+cGh5b2Zmc2V0KTsKKwkodm9pZCkgcmVzb3VyY2Vf aW50X3ZhbHVlKGRldmljZV9nZXRfbmFtZShkZXYpLCBkZXZpY2VfZ2V0X3Vu aXQoZGV2KSwKIAkgICAgImNwdXBvcnQiLCAmc2MtPmNwdXBvcnQpOwogCSh2 b2lkKSByZXNvdXJjZV9pbnRfdmFsdWUoZGV2aWNlX2dldF9uYW1lKGRldiks IGRldmljZV9nZXRfdW5pdChkZXYpLAogCSAgICAibWVkaWEiLCAmc2MtPm1l ZGlhKTsK ---1898903077-958321493-1478517295=:68795-- From owner-freebsd-mips@freebsd.org Tue Nov 8 10:49:17 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D44CC36D45 for ; Tue, 8 Nov 2016 10:49:17 +0000 (UTC) (envelope-from admin@vip235.save80off.com) Received: from vip235.save80off.com (vip235.save80off.com [23.226.51.235]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1B7625 for ; Tue, 8 Nov 2016 10:49:15 +0000 (UTC) (envelope-from admin@vip235.save80off.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=save80off; d=vip235.save80off.com; h=MIME-Version:From:To:Date:Subject:Content-Type:Content-Transfer-Encoding; i=admin@vip235.save80off.com; bh=1Ht6IY3Ez6AhdzEpCEBm5Cqh3sA=; b=aXq9ZLDN/6X9rt5U7S0AMYkN76rvV/eaMiOhC5dFR+e3ofhn4DYdLn9lmQv4owywxc2topcccUTf JA3+MXN2lSfMS/joxaSXOYAo5qVXgq84kiQc73JcYbHBXMZkbEZDN+BxpZjVQFd4155DSpGT3paB DQLFa4N1R1uNKuVYSRA= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=save80off; d=vip235.save80off.com; b=UeGBESpbeiuBWp0yKQHTHWnMl7bffSt0mEiKan8q1raubYY/jODqTC28mhpMnCsciLTxUwj+eSNz +YFnK5YfQHu3MXzNs6V2XGjb6MHcxAs1wEKP58s3XZL1qxPzzpOA4ucJk5naMQ1JluPT0e2xFQwN f3wuRgvdhAMl5WSAK0w=; From: "Gift From Pandora[85% OFF]" To: freebsd-mips@freebsd.org Date: 8 Nov 2016 18:39:19 +0800 Subject: Alert:From 90% off everything + Free Shipping win 49$ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 10:49:17 -0000 From owner-freebsd-mips@freebsd.org Thu Nov 10 21:09:22 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C455C3A735; Thu, 10 Nov 2016 21:09:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 224D66C8; Thu, 10 Nov 2016 21:09:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x233.google.com with SMTP id q124so263606267itd.1; Thu, 10 Nov 2016 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=A7aAYWs4jtvsOwJKRQUC6uDZyl/TVMDUnFTmCWDrcDU=; b=NeuDRlDqZ1umwjmoGZJqqgj27J/2ZYyy+f0mrIutI3/xr84kuVjbuhA4k9ImXXtfMm 5QVP3+RTmss+bwk6OPR/tgawjOesiIc98G2IK9azEjk2heTsCh6awjgP3veMbESnMmTz 9c+gtZgXPcDEH9o8d7amx7qC9oJQE59SV/7ND4g+MA9qZYADANvCEVPUwT2Zf3c2R4Qc lf37qvxxN3hle52ULkAxr7Fo4TNA8kX8bSzSO+aHY+ZW9CcuVeCfEv3RrkvEtwkhn2wk KWIXTTTdJnIo+DW+3z7ZTi+mSALaRl3BfFPtJHLhRkpBvH0NbVQEJfDa/qwwG642WSKM fGOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A7aAYWs4jtvsOwJKRQUC6uDZyl/TVMDUnFTmCWDrcDU=; b=Nxnea5l4b1z3/0OLIEK8MWD1FJYOK1u1BMa6jNi/mo8S0L9iuPuz8YAb5t/w6hRt2R m94H/f4ZwVLKJPsDVk3EYdjs0re8I2owcOj6YVjECxomcPEvLLoEFEqESrxYDg3e/Xle yh8xAHnLfiBpIWtBybVUvDCorv1XAXdI+8P1oIKr72lR2PQCZjQ0H5KqLqw6imZSVHES k+jjl90P//4DQ0IzbN02L6Bh29ajsfD7yn8P+qoD2HfscZ/FSQT+RVEz7jgZVRnPX5nq JgzdRfJo7gvMDM3QiVqFrAASVdu8MhFf8ahqXd1+ujtCaMkMZfCOlBeosjZXr951krU+ 3OwA== X-Gm-Message-State: ABUngve90SHNbReM+MoGsY69NnitTRLad7WfWN9M4LGHFFsmv6GZCqKCWU9/X5vGWjDMgNCjXD3Hah4ewuqqlw== X-Received: by 10.107.192.194 with SMTP id q185mr8237460iof.129.1478812161422; Thu, 10 Nov 2016 13:09:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 13:09:20 -0800 (PST) In-Reply-To: References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> From: Adrian Chadd Date: Thu, 10 Nov 2016 13:09:20 -0800 Message-ID: Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... To: Ruslan Bukin , "freebsd-mips@freebsd.org" Cc: Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:09:22 -0000 ok, so there are two problems with mips now. * COP1_UNUSABLE - which is now being logged, and we were likely triggering it before. The problem: we always turned it on. If I comment out flipping on the COP1 bits in the .S files, those exceptions go away. * Page faults, but that may be me with an older userland: BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a read fault (type 0x2) at 0x8 Trapframe Register Dump: zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: 0xffffffffffffffff a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 t0: 0 t1: 0 t2: 0 t3: 0x70000011 t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 cause: 0x8 pc: 0x404237c0 Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a Dumping 4 words starting at pc address 0x404237c0: 8e100008 1600fff1 8f828070 100000a3 -adrian On 10 November 2016 at 12:49, Adrian Chadd wrote: > hi, > > This fails to boot on actual mips24k hardware, no hardfloat: > > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 > Trapframe Register Dump: > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > 0xffffffffffffffff > > .. lots of that the moment we boot userland. > > > > -adrian > > > On 3 November 2016 at 13:10, Ruslan Bukin wrote: >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: >>> > Modified: head/share/mk/bsd.cpu.mk >>> > ============================================================================== >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 >>> > >>> > .if ${MACHINE_CPUARCH} == "mips" >>> > CFLAGS += -G0 >>> > +.if ${TARGET_ARCH:Mmips*hf} >>> >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in >>> r308262. >>> >> >> Thank you! >> >> Ruslan >> From owner-freebsd-mips@freebsd.org Thu Nov 10 21:18:06 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AC97C3AACD for ; Thu, 10 Nov 2016 21:18:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D8A3D8B; Thu, 10 Nov 2016 21:18:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x236.google.com with SMTP id u205so70600064itc.0; Thu, 10 Nov 2016 13:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=CXB5Firs9t51/fo+1jXTaqdUTbKdnA4sqema5Ktl8FM=; b=sje1aH4hb7uMoe/Rr+SEZoiQGQMXYz0OV5uA3EnWkK+soV8Zk1uymexfdD/Ze6aUup 5kYMA2h3D+JQ6hEyc9Gnrs+Q/7A9VV/+zvgnFXt6XVRq2AZ9hF9GgonuB81omoEB5KJF IONbZtLSLFtQYwYUgoCF8t2Bt5aI2MCt9dz5SlAzQ/HtUThyAQo0Vmdc3ei0zy9CoD0k h55K4gEsZeFsIfl5McuMP1kfa25K2cO1WwIwjSiZ5BdXxNfsNmQ27/UmQIBt/hjT1x0R m405H4O4jt3RaTTd/9WmPx4ucSWLyI/miso8f2mgb+Jl7oQxxIuY8KDd6zDKEJd6jwrC U9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CXB5Firs9t51/fo+1jXTaqdUTbKdnA4sqema5Ktl8FM=; b=lGVnM9RvKecfK5CuH2g8PMDVCK7B95s7IQqiO6Dt30H2GtRQeeX7Mu86NtJs//g/18 +84Kbn1G2nyaPR6bqbq52rcydmKW3Xnto6BnUYmNNIDQC8W99XpAwjDAgq3tGj1E77BY eQXy5c8G4vcuzmQMD+By03rztwV76GiR9eDj5hzc/QzBk+Zjn6zj77KaV8Uscj/O3H/M seF7YcJaZBVpD5S7+zu8AFTCKBdOVAVt3RBYyIOhF5RZrm+Cq+6dfArUES/eDUdr5cBG i13gSb4IXOBvi5CSMwn7JxfR8C0nJap1Jj/AzlthpPO6YkM1GUOUBb4XLuv8DfBeT1ni OC7g== X-Gm-Message-State: ABUngvezoL8HarT3kTDgI8Zzh9R8HzIWpV2EVz6o9clmMhkwHLYWgA/oYTWHNq0RgWrxZ23XvCcgReUY/JTz5w== X-Received: by 10.107.192.194 with SMTP id q185mr8280911iof.129.1478812685511; Thu, 10 Nov 2016 13:18:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 13:18:04 -0800 (PST) From: Adrian Chadd Date: Thu, 10 Nov 2016 13:18:04 -0800 Message-ID: Subject: mips24k (and others?) no longer works To: "freebsd-mips@freebsd.org" , Brooks Davis , Ruslan Bukin Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:18:06 -0000 hiya, freebsd-head no longer boots on mips24k. * COP1_UNUSABLE - turns out ruslan enabled COP1_UNUSABLE; but we are always enabling it. We should conditionally enable it. I've disabled setting the COP1 flag and now I don't get that error. * ADDRESS_SPACE_ERR - not sure why yet; maybe this is (more) TLS change related: ADDRESS_SPACE_ERR: pid 1 tid 100001 (init), uid 0: pc 0x41dd28 got a read fault (type 0x4) at 0xffffffffffff8279 Trapframe Register Dump: zero: 0 at: 0 v0: 0 v1: 0x1 a0: 0x50 a1: 0x1 a2: 0 a3: 0x1 t0: 0x1 t1: 0x4cf000 t2: 0x40 t3: 0x1 t4: 0 t5: 0 t6: 0 t7: 0 t8: 0 t9: 0x41dd08 s0: 0x50 s1: 0x2 s2: 0 s3: 0x1 s4: 0 s5: 0 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x1 sp: 0x7ffeedc8 s8: 0 ra: 0x41ea4c sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0xffffffffffff8279 cause: 0x10 pc: 0x41dd28 Page table info for pc address 0x41dd28: pde = 0x809a8000, pte = 0xa001b91a Dumping 4 words starting at pc address 0x41dd28: 8f828278 a04362c8 8f998410 2739c730 -adrian From owner-freebsd-mips@freebsd.org Thu Nov 10 21:34:57 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E38AC3AFD7; Thu, 10 Nov 2016 21:34:57 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-30.csi.cam.ac.uk (ppsw-30.csi.cam.ac.uk [131.111.8.130]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF499F4; Thu, 10 Nov 2016 21:34:56 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from sc1.bsdpad.com ([163.172.212.18]:37801) by ppsw-30.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1c4wzo-000bhA-d4 (Exim 4.86_36-e07b163) (return-path ); Thu, 10 Nov 2016 21:34:56 +0000 Date: Thu, 10 Nov 2016 21:34:12 +0000 From: Ruslan Bukin To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" , Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... Message-ID: <20161110213412.GA21672@bsdpad.com> References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 21:34:57 -0000 Hi, Adrian, thanks, but I have lack of ideas yet. I just tested this on Ingenic X1000 (mips.mipsel) and it works fine, as well as mips.mipselhf (this hardware has FPU). I have no hardware without FPU. What exactly COP_1 bits you have commented to get rid of COP1_UNUSABLE? Ruslan On Thu, Nov 10, 2016 at 01:09:20PM -0800, Adrian Chadd wrote: > ok, so there are two problems with mips now. > > * COP1_UNUSABLE - which is now being logged, and we were likely > triggering it before. The problem: we always turned it on. If I > comment out flipping on the COP1 bits in the .S files, those > exceptions go away. > > * Page faults, but that may be me with an older userland: > > BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a > read fault (type 0x2) at 0x8 > Trapframe Register Dump: > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > 0xffffffffffffffff > a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 > t0: 0 t1: 0 t2: 0 t3: 0x70000011 > t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 > t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 > s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 > s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 > gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 > sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 > cause: 0x8 pc: 0x404237c0 > Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a > Dumping 4 words starting at pc address 0x404237c0: > 8e100008 1600fff1 8f828070 100000a3 > > > > -adrian > > > On 10 November 2016 at 12:49, Adrian Chadd wrote: > > hi, > > > > This fails to boot on actual mips24k hardware, no hardfloat: > > > > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 > > Trapframe Register Dump: > > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: > > 0xffffffffffffffff > > > > .. lots of that the moment we boot userland. > > > > > > > > -adrian > > > > > > On 3 November 2016 at 13:10, Ruslan Bukin wrote: > >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: > >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: > >>> > Modified: head/share/mk/bsd.cpu.mk > >>> > ============================================================================== > >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) > >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) > >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 > >>> > > >>> > .if ${MACHINE_CPUARCH} == "mips" > >>> > CFLAGS += -G0 > >>> > +.if ${TARGET_ARCH:Mmips*hf} > >>> > >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in > >>> r308262. > >>> > >> > >> Thank you! > >> > >> Ruslan > >> From owner-freebsd-mips@freebsd.org Thu Nov 10 23:34:19 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AB8C3B604; Thu, 10 Nov 2016 23:34:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FA50E95; Thu, 10 Nov 2016 23:34:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id u205so78644057itc.0; Thu, 10 Nov 2016 15:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=llu0SOLQTY1p70BXCr5xyPOBM+eASbcuYpxlMfcO0/U=; b=SD15OgDWkC4MeUzHqM7NdEaLMSRC+nQ7i/flTeS4d/NLPsCtp7V+t1FkUsUQFveQxz 6ePQ8Cp5LR752KaZU0ziDu7I5Fqxn+lh5yPggUguOre+baHaA763fL9LQ1ZRBaGxI69G XJWiOLbUjbvzFrquS8NeeNauAfrTsxhPgCvSFjFBEJUWTX2uWFBjlVfNHu/suP+4HzNy I4+NYNlbooa2aRPzW3PLbYZkJzyXhZasRhbyGGCIiGEE1Teai7N+4rq8DXFYGWov+jlI 2DmgX1tNrdojLytdamYSsZMwpVAHOghQhSratxNlyqr5K3xnEw/J9hGVdeh6tCqi9qzv a9mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=llu0SOLQTY1p70BXCr5xyPOBM+eASbcuYpxlMfcO0/U=; b=hSOhhrDpaSrTj6HnUu+GqaLG5dzDwb7OudXdh3jlyZX0UchPceNPXxV1ojzyMa0uYZ BYt6K4OZHuLkB0gytByNT0A9VgrtvzWHY3/nLJ174N7xcHtgBM3ZL/w6mXjDg2JqBdhW ai/XNyv96TyvjQh6nA/I/19fj4AZjnSq/e3llQlt9xrbJ5SROGaqmHAd39BdlELEWa1I bZNlypICdYHJSXSKQNJgk5vHzoBsg5hQ0B2on+nRLnmPgCfqlYCj+38wUP4uOqRCtzHs +OH7ypwnsoGHaKE93g/Wy4lz+4wufw1ijev7AY8W6fHWbETjkOt2xNlaHi3NhbJ0atmP rnSg== X-Gm-Message-State: ABUngvdyh2fGRbjoWABWpa1YAvUHv7H4fiTbFj33lvmAlxLTdSJsQnwvLoYZox8eu2lPcRz0O5wGAjFBP4nx3Q== X-Received: by 10.36.65.216 with SMTP id b85mr19270485itd.39.1478820857055; Thu, 10 Nov 2016 15:34:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 15:34:16 -0800 (PST) In-Reply-To: <201609151725.u8FHPqFH081568@repo.freebsd.org> References: <201609151725.u8FHPqFH081568@repo.freebsd.org> From: Adrian Chadd Date: Thu, 10 Nov 2016 15:34:16 -0800 Message-ID: Subject: Re: svn commit: r305843 - in head/sys/mips: include mips To: Brooks Davis , "freebsd-mips@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 23:34:19 -0000 hi, This patch breaks stuff on my mips24k SoCs (ie, all the atheros chips.) BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4002a4 got a read fault (type 0x2) at 0 Trapframe Register Dump: zero: 0 at: 0 v0: 0 v1: 0 a0: 0x7fffeecc a1: 0 a2: 0 a3: 0 t0: 0 t1: 0 t2: 0 t3: 0 t4: 0 t5: 0 t6: 0 t7: 0 t8: 0 t9: 0x400260 s0: 0x10 s1: 0x2 s2: 0x7fffeed0 s3: 0 s4: 0 s5: 0 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x4d55d0 sp: 0x7ffeee90 s8: 0 ra: 0 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0 cause: 0x8 pc: 0x4002a4 Page table info for pc address 0x4002a4: pde = 0x809a8000, pte = 0xa001b35a Dumping 4 words starting at pc address 0x4002a4: 8c420000 14400003 00908021 8f828024 Page table info for bad address 0: pde = 0, pte = 0 -adrian On 15 September 2016 at 10:25, Brooks Davis wrote: > Author: brooks > Date: Thu Sep 15 17:25:52 2016 > New Revision: 305843 > URL: https://svnweb.freebsd.org/changeset/base/305843 > > Log: > The TLS offset is a property of the process ABI. > > Move to a per-proc TLS offset rather than incorrectly keying off the > presense of freebsd32 compability in the kernel. > > Reviewed by: adrian, sbruno > Obtained from: CheriBSD > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D7843 > > Modified: > head/sys/mips/include/proc.h > head/sys/mips/mips/cpu.c > head/sys/mips/mips/freebsd32_machdep.c > head/sys/mips/mips/genassym.c > head/sys/mips/mips/pm_machdep.c > head/sys/mips/mips/swtch.S > head/sys/mips/mips/sys_machdep.c > head/sys/mips/mips/trap.c > head/sys/mips/mips/vm_machdep.c > > Modified: head/sys/mips/include/proc.h > ============================================================================== > --- head/sys/mips/include/proc.h Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/include/proc.h Thu Sep 15 17:25:52 2016 (r305843) > @@ -62,6 +62,7 @@ struct mdthread { > int md_pc_count; /* performance counter */ > int md_pc_spill; /* performance counter spill */ > void *md_tls; > + size_t md_tls_tcb_offset; /* TCB offset */ > #ifdef CPU_CNMIPS > struct octeon_cop2_state *md_cop2; /* kernel context */ > struct octeon_cop2_state *md_ucop2; /* userland context */ > > Modified: head/sys/mips/mips/cpu.c > ============================================================================== > --- head/sys/mips/mips/cpu.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/cpu.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -71,13 +71,12 @@ struct mips_cpuinfo cpuinfo; > # define _LOAD_T0_MDTLS_A1 \ > _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) > > -# if defined(COMPAT_FREEBSD32) > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE32)) > -# else > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_DADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) > -# endif /* ! COMPAT_FREEBSD32 */ > +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ > + _ENCODE_INSN(OP_LD, A1, T1, 0, \ > + offsetof(struct thread, td_md.md_tls_tcb_offset)) > + > +# define _ADDU_V0_T0_T1 \ > + _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) > > # define _MTC0_V0_USERLOCAL \ > _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) > @@ -86,8 +85,14 @@ struct mips_cpuinfo cpuinfo; > > # define _LOAD_T0_MDTLS_A1 \ > _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) > -# define _ADDIU_V0_T0_TLS_OFFSET \ > - _ENCODE_INSN(OP_ADDIU, T0, V0, 0, (TLS_TP_OFFSET + TLS_TCB_SIZE)) > + > +# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ > + _ENCODE_INSN(OP_LW, A1, T1, 0, \ > + offsetof(struct thread, td_md.md_tls_tcb_offset)) > + > +# define _ADDU_V0_T0_T1 \ > + _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) > + > # define _MTC0_V0_USERLOCAL \ > _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) > > @@ -111,8 +116,9 @@ remove_userlocal_code(uint32_t *cpu_swit > if (instructp[0] == _JR_RA) > panic("%s: Unable to patch cpu_switch().", __func__); > if (instructp[0] == _LOAD_T0_MDTLS_A1 && > - instructp[1] == _ADDIU_V0_T0_TLS_OFFSET && > - instructp[2] == _MTC0_V0_USERLOCAL) { > + instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && > + instructp[2] == _ADDU_V0_T0_T1 && > + instructp[3] == _MTC0_V0_USERLOCAL) { > instructp[0] = _JR_RA; > instructp[1] = _NOP; > break; > > Modified: head/sys/mips/mips/freebsd32_machdep.c > ============================================================================== > --- head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/freebsd32_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -61,6 +61,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -138,6 +139,8 @@ freebsd32_exec_setregs(struct thread *td > * Clear extended address space bit for userland. > */ > td->td_frame->sr &= ~MIPS_SR_UX; > + > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; > } > > int > > Modified: head/sys/mips/mips/genassym.c > ============================================================================== > --- head/sys/mips/mips/genassym.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/genassym.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -74,12 +74,7 @@ ASSYM(TD_FLAGS, offsetof(struct thread, > ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); > ASSYM(TD_MDFLAGS, offsetof(struct thread, td_md.md_flags)); > ASSYM(TD_MDTLS, offsetof(struct thread, td_md.md_tls)); > - > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE32)); > -#else > -ASSYM(TLS_TCB_OFFSET, (TLS_TP_OFFSET + TLS_TCB_SIZE)); > -#endif > +ASSYM(TD_MDTLS_TCB_OFFSET, offsetof(struct thread, td_md.md_tls_tcb_offset)); > > ASSYM(U_PCB_REGS, offsetof(struct pcb, pcb_regs.zero)); > ASSYM(U_PCB_CONTEXT, offsetof(struct pcb, pcb_context)); > > Modified: head/sys/mips/mips/pm_machdep.c > ============================================================================== > --- head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/pm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -466,6 +467,8 @@ exec_setregs(struct thread *td, struct i > if (PCPU_GET(fpcurthread) == td) > PCPU_SET(fpcurthread, (struct thread *)0); > td->td_md.md_ss_addr = 0; > + > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; > } > > int > > Modified: head/sys/mips/mips/swtch.S > ============================================================================== > --- head/sys/mips/mips/swtch.S Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/swtch.S Thu Sep 15 17:25:52 2016 (r305843) > @@ -385,7 +385,8 @@ sw2: > * remove_userlocal_code() in cpu.c. > */ > PTR_L t0, TD_MDTLS(a1) # Get TLS pointer > - PTR_ADDIU v0, t0, TLS_TCB_OFFSET # Add TLS/TCB offset > + PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset > + PTR_ADDU v0, t0, t1 > MTC0 v0, MIPS_COP_0_USERLOCAL, 2 # write it to ULR for rdhwr > > j ra > > Modified: head/sys/mips/mips/sys_machdep.c > ============================================================================== > --- head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/sys_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -69,13 +69,8 @@ sysarch(struct thread *td, struct sysarc > * rdhwr trap() instruction handler. > */ > if (cpuinfo.userlocal_reg == true) { > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > mips_wr_userlocal((unsigned long)(uap->parms + > - TLS_TP_OFFSET + TLS_TCB_SIZE32)); > -#else > - mips_wr_userlocal((unsigned long)(uap->parms + > - TLS_TP_OFFSET + TLS_TCB_SIZE)); > -#endif > + td->td_md.md_tls_tcb_offset)); > } > return (0); > case MIPS_GET_TLS: > > Modified: head/sys/mips/mips/trap.c > ============================================================================== > --- head/sys/mips/mips/trap.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/trap.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -909,12 +909,7 @@ dofault: > if (inst.RType.rd == 29) { > frame_regs = &(trapframe->zero); > frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; > -#if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) > - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE32; > - else > -#endif > - frame_regs[inst.RType.rt] += TLS_TP_OFFSET + TLS_TCB_SIZE; > + frame_regs[inst.RType.rt] += td->td_md.md_tls_tcb_offset; > trapframe->pc += sizeof(int); > goto out; > } > > Modified: head/sys/mips/mips/vm_machdep.c > ============================================================================== > --- head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:11 2016 (r305842) > +++ head/sys/mips/mips/vm_machdep.c Thu Sep 15 17:25:52 2016 (r305843) > @@ -154,6 +154,7 @@ cpu_fork(register struct thread *td1,reg > */ > > td2->td_md.md_tls = td1->td_md.md_tls; > + td2->td_md.md_tls_tcb_offset = td1->td_md.md_tls_tcb_offset; > td2->td_md.md_saved_intr = MIPS_SR_INT_IE; > td2->td_md.md_spinlock_count = 1; > #ifdef CPU_CNMIPS > @@ -494,15 +495,16 @@ int > cpu_set_user_tls(struct thread *td, void *tls_base) > { > > - td->td_md.md_tls = (char*)tls_base; > - if (td == curthread && cpuinfo.userlocal_reg == true) { > #if defined(__mips_n64) && defined(COMPAT_FREEBSD32) > - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + > - TLS_TCB_SIZE32); > -#else > - mips_wr_userlocal((unsigned long)tls_base + TLS_TP_OFFSET + > - TLS_TCB_SIZE); > + if (td->td_proc && SV_PROC_FLAG(td->td_proc, SV_ILP32)) > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; > + else > #endif > + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; > + td->td_md.md_tls = (char*)tls_base; > + if (td == curthread && cpuinfo.userlocal_reg == true) { > + mips_wr_userlocal((unsigned long)tls_base + > + td->td_md.md_tls_tcb_offset); > } > > return (0); > From owner-freebsd-mips@freebsd.org Thu Nov 10 23:37:40 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C80C3B6C6; Thu, 10 Nov 2016 23:37:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C36571078; Thu, 10 Nov 2016 23:37:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22e.google.com with SMTP id u205so78848387itc.0; Thu, 10 Nov 2016 15:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=It19lkmJQkHUNsyuVqjVdSf7s5dql/gCrE1ek1VZGSo=; b=zve/JmXYG3yTnnetHgdzV7QB31ZLbEU3UKjoGLnTPRpz6xoxBIyVZY6meSPo8QtRfu FEU5uRtb1B33DkQoaEDFf9fv/HEIZ75wPVBPM28GZxjyG5PrhtBECdhgUBxOaUclFfTJ lX6sR2Q5uv8jQ/4awRVHcBEj41CQ9XKNG9Bn/kFXqFfjRBak3QyOItxZv/W3x+DvOTPi sXMQ24N+A01WLusAYb4hP3aKTiLjVzOJ3/NQb01kXksXH4v9cadSWNclqziDeRzb6oOu gI2p/RfoFjORrLfUPaVD4P4hs6EluccV0WiwibRzXxwax23P8zZPb49OJ2hatKGVSeF9 7+nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=It19lkmJQkHUNsyuVqjVdSf7s5dql/gCrE1ek1VZGSo=; b=kDHNUbFBuLNYKfz8gjrAu262pcN2VMLT6BZ11xWeEZDXQLp/f1E/lhFOdNwdKNaM2i B7rG2+jrNvkWlcvsUMyz2Y/zjNT7Z3Z63R5eobmx6Ur6QeODkQChcpSr/1AJhhKYDhO2 z/xuf9AeuOSUvkwHkUPf6d0WErnArWfS+VAJtIOE+2X4xEMo1Jr3MsUA836R/9pciI0F jqx7CAf5+LnUkeRnzn9lmzgZXck9xMVdt+jnz0ncgHVDpnN/b0h4j2JCw61CyWaMqOcf 7+QIW4Le1nD2UyYlS3xG8bmpCw0STZYSaZNAOYzmBgAnodfAhznTpSbHN3MtqcRuYvYE ZRAw== X-Gm-Message-State: ABUngvfJlFHvg8cCnb56n5wrDl+sRowoZmf/jJQylbX9g69ImGtbxOcIEsaB019e4VV7F6Jn7E9JwYdkDqruvw== X-Received: by 10.107.174.157 with SMTP id n29mr4753135ioo.177.1478821059234; Thu, 10 Nov 2016 15:37:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Thu, 10 Nov 2016 15:37:38 -0800 (PST) In-Reply-To: <20161110213412.GA21672@bsdpad.com> References: <201610311533.u9VFXw2x053156@repo.freebsd.org> <128f2edc-eced-dc8b-72b4-267e1d26bd48@FreeBSD.org> <20161103201059.GA2104@bsdpad.com> <20161110213412.GA21672@bsdpad.com> From: Adrian Chadd Date: Thu, 10 Nov 2016 15:37:38 -0800 Message-ID: Subject: Re: svn commit: r308130 - in head: . gnu/lib/libgcc gnu/usr.bin/binutils gnu/usr.bin/binutils/ld gnu/usr.bin/binutils/libbfd gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/libc lib/libc/mips... To: Ruslan Bukin Cc: "freebsd-mips@freebsd.org" , Bryan Drewery , Ruslan Bukin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 23:37:40 -0000 The places where we set MIPS_SR_COP_1_BIT in locore.S, exception.S. -adrian On 10 November 2016 at 13:34, Ruslan Bukin wrote: > Hi, Adrian, > > thanks, but I have lack of ideas yet. > > I just tested this on Ingenic X1000 (mips.mipsel) and it works fine, > as well as mips.mipselhf (this hardware has FPU). > > I have no hardware without FPU. > > What exactly COP_1 bits you have commented to get rid of COP1_UNUSABLE? > > Ruslan > > On Thu, Nov 10, 2016 at 01:09:20PM -0800, Adrian Chadd wrote: >> ok, so there are two problems with mips now. >> >> * COP1_UNUSABLE - which is now being logged, and we were likely >> triggering it before. The problem: we always turned it on. If I >> comment out flipping on the COP1 bits in the .S files, those >> exceptions go away. >> >> * Page faults, but that may be me with an older userland: >> >> BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 got a >> read fault (type 0x2) at 0x8 >> Trapframe Register Dump: >> zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: >> 0xffffffffffffffff >> a0: 0x404471b8 a1: 0x7ffeea50 a2: 0x16c a3: 0 >> t0: 0 t1: 0 t2: 0 t3: 0x70000011 >> t4: 0x11 t5: 0x70000013 t6: 0x3 t7: 0 >> t8: 0 t9: 0x4041c940 s0: 0 s1: 0x40417000 >> s2: 0x7fffeee0 s3: 0xffffffffffffffff s4: 0xc s5: 0x40427000 >> s6: 0x7fffeecc s7: 0x7ffeea50 k0: 0 k1: 0 >> gp: 0x4044e630 sp: 0x7ffee838 s8: 0x2 ra: 0x404224d4 >> sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0x8 >> cause: 0x8 pc: 0x404237c0 >> Page table info for pc address 0x404237c0: pde = 0x809aa000, pte = 0xa001ba9a >> Dumping 4 words starting at pc address 0x404237c0: >> 8e100008 1600fff1 8f828070 100000a3 >> >> >> >> -adrian >> >> >> On 10 November 2016 at 12:49, Adrian Chadd wrote: >> > hi, >> > >> > This fails to boot on actual mips24k hardware, no hardfloat: >> > >> > COP1_UNUSABLE: pid 1 tid 100001 (init), uid 0: pc 0x404237c0 ra 0x404224d4 >> > Trapframe Register Dump: >> > zero: 0 at: 0xffffffffffffffe0 v0: 0x404471b8 v1: >> > 0xffffffffffffffff >> > >> > .. lots of that the moment we boot userland. >> > >> > >> > >> > -adrian >> > >> > >> > On 3 November 2016 at 13:10, Ruslan Bukin wrote: >> >> On Thu, Nov 03, 2016 at 12:39:48PM -0700, Bryan Drewery wrote: >> >>> On 10/31/16 8:33 AM, Ruslan Bukin wrote: >> >>> > Modified: head/share/mk/bsd.cpu.mk >> >>> > ============================================================================== >> >>> > --- head/share/mk/bsd.cpu.mk Mon Oct 31 15:11:55 2016 (r308129) >> >>> > +++ head/share/mk/bsd.cpu.mk Mon Oct 31 15:33:58 2016 (r308130) >> >>> > @@ -303,6 +303,9 @@ MACHINE_CPU = v9 ultrasparc ultrasparc3 >> >>> > >> >>> > .if ${MACHINE_CPUARCH} == "mips" >> >>> > CFLAGS += -G0 >> >>> > +.if ${TARGET_ARCH:Mmips*hf} >> >>> >> >>> TARGET_ARCH is not valid here. This broke building ports. Fixed in >> >>> r308262. >> >>> >> >> >> >> Thank you! >> >> >> >> Ruslan >> >> From owner-freebsd-mips@freebsd.org Fri Nov 11 08:07:52 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBC13C3B75B for ; Fri, 11 Nov 2016 08:07:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2C618EC; Fri, 11 Nov 2016 08:07:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x236.google.com with SMTP id e187so314901451itc.0; Fri, 11 Nov 2016 00:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YOX7DhdO4w59FgyP8M8jQPPPAjwLlCky07uWN2nYE3M=; b=lSCyIB7mRoF6q/Bp+yHzvG+SRQOZ/EMSpR5fVlEkfnVtR+P96JPKezP5hTEXfj1Kc7 d2uZwBaQKu+Z+7oV848JX5E3e6QuGY7j3xhonssua8T1RdJB+e1sYJBiOk+N037Rqn+g ml/ZaYU9XPdN4QHXoeYYuBR7r9Cip8sJn7VEJnV/87KoCt3CTFV5B0VXBZ6c2rE4V0VD 4clUB8RwU2n8hvcpCllsxjRVOkR2PhPsGF/sEodlk9zIWXZmPh/B+6J7xrRp2OSf7cJb 0RO/INhWsc+AXPqaaku2uqNEwvmS2pqxw/fmfHG2reLvjbjWa0bsAdutK78CBLwy9FY0 +RIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YOX7DhdO4w59FgyP8M8jQPPPAjwLlCky07uWN2nYE3M=; b=nKwmrxSfH+0kHCiy5p9rDRisP5XxAkik6aMWOErW+JJLIFtmDCqsxWsUE1sFCoWdsr k4dQk0jqW7HLRozfCZrieV1nNfss1Wv5cdDXwXbdNmiU4Akjko6OrJx8rlYKpMSlpM1R h9b0LkUxHv35m0MuUNU3RqKoXMMmmAj1/JjE7NTzqlg8xZ3867qHLUOflqEXmY69jObS Ni3tqb3a77txY6hmKrjEXhAF8LiAj8DNgGoNdq0q4a20Fqh/PadJ4tZGu2JuWmOJgSiw TXL3T8HG26QGOnQSPqf5VaHxqJQwPXOxH/7G5v+8CK0gbj5uiFyKSurgqfI6ESgYxP+a lWtQ== X-Gm-Message-State: ABUngvcOuCF2yPjZLAG2C4zMqqRBPxgldOT+ljoxCPBBDjt1lqeMD6Tsm3PiJXUF5vs00BsXlrzDy4PV00UGXQ== X-Received: by 10.107.174.157 with SMTP id n29mr6343316ioo.177.1478851671583; Fri, 11 Nov 2016 00:07:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Fri, 11 Nov 2016 00:07:50 -0800 (PST) In-Reply-To: References: From: Adrian Chadd Date: Fri, 11 Nov 2016 00:07:50 -0800 Message-ID: Subject: Re: mips24k (and others?) no longer works To: "freebsd-mips@freebsd.org" , Brooks Davis , Ruslan Bukin Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 08:07:52 -0000 Hiya, So mips on the atheros 24kc and 74kc parts is just completely borked. It varies between "this doesn't even boot" to "all I get are spams of failure exceptions", and if i back out a variety of hilarity, i end up with a userland that just plainly hangs after userland runs for a little while. No CTRL-T, nothing obvious in ddb. But hey, 'cont' in ddb now works. The working release for me is 304552, which is when I finished updating the atheros config files to use std.XXXX instead of ARXXXX_BASE. It's going to take some time to find the first point where things broke. It's likely going to be a combination of everyone's recent mips platform changes (most of the exceptions, the not-booting-at-all) and other unrelated kernel changes to other areas (likely the hang.) I ask that people hold off on the MIPS side of work until I figure out what's going on here. Also - I really do suggest you invest $40 in a carambola 2 so you have the AR9331 as a reference platform to do MIPS testing on. These mips24kc, FPU-less cut down SoCs are in a lot of things and having now heavily broken support for them is kinda sad. :( It's also putting a cramp on my ability to finish my net80211 and 11ac changes as a whole lot of it depends upon working AP hardware to test against. Thanks, -adrian From owner-freebsd-mips@freebsd.org Fri Nov 11 14:49:50 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF241C3BE85 for ; Fri, 11 Nov 2016 14:49:50 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FAC61C6A; Fri, 11 Nov 2016 14:49:50 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id g23so102604497wme.1; Fri, 11 Nov 2016 06:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0hb5gn8idf+4tdpMrHlu7FN32ah/ItUfpeVswGB5k/E=; b=NYgQx/Nhu+utr5ZOBKZEuE5D/iOCs/mftb5SwMClCY3CWgRgrU+c4B4Cb11l2Yw6Zy CAKuW+/GWkG+r+ROiNgu54HkULk+uUpD+NOezdUAJ2CTXrHReTM3WeRQERPtV5mvLKL0 +8EFKYSlh41G/xKlw2hJ9s8YSyZeIgbUrg+QqA0L2/OVdQduZaGnCyK+mWDVyx8wuBMc tA4fOe0YRvhKbVirtSiRpskOwpB7oInxU6d7xEHrsgDLSdajljAqr3uz83+lgEAMvCyY 05Q2rUYk3XesJx2uKTl/hSGFbmxOEo77k+QRYeIy2sBU4JBVC96DQU2l0YyYxwT4Ul3n 88cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0hb5gn8idf+4tdpMrHlu7FN32ah/ItUfpeVswGB5k/E=; b=HV2mQY3fe9CjTsnB0N8s6AD4TOiMm6T86egABhXuJmpozyO8ONgZQMx4oaJRJdj++L Jc/Y0EGDdgh8aJXZ1MbKvHOczbV4gDfFCgG/lVL1AmVgWzNxzmkw/plohQ2rd6HjY24I G6+AKUlhZaAHGWxaNKO/2BuV6Byxa6ECvvsts+sFZ+MOtCZ6BBlUOh9DLzk+AEcE0RVs IkQ95Vvww0rv2bprgWa1bFgyPT1sJtauUrnijWlVHYxKR6kCySiyv7B+y9Yv1IZZQZvo Ngy7s5f+bdK73n/dr3LcfMlai48lGelP3jeAD48rq9gey2nRyJsCyVOhRGfXuVoQtfIY /7KA== X-Gm-Message-State: ABUngvcGBzR+p7nFQYWkLCk2MQ4FQMbYiOneyfE6+GFpoaWckn30X7Ib2ZRMkmo+bq8LQ8hlJLnfUnayL1xn6w== X-Received: by 10.194.44.41 with SMTP id b9mr2583899wjm.56.1478875787846; Fri, 11 Nov 2016 06:49:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.152.131 with HTTP; Fri, 11 Nov 2016 06:49:47 -0800 (PST) In-Reply-To: References: From: Michael Zhilin Date: Fri, 11 Nov 2016 17:49:47 +0300 Message-ID: Subject: Re: mips24k (and others?) no longer works To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" , Brooks Davis , Ruslan Bukin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 14:49:50 -0000 Hi Adrian, I see bad fault a bit earlier: just after dozens of cycles of "init": at pc = 0x4001e4, but it cou What found by me: after page fault on file objects the page content is filled with small delay, i.e. it results in race. If you add small piece of work (black-hole-cpu) after fault (or context switch?), then the page is filled with data (magic). I want to find some time this weekend (tomorrow) to trace geom layer (ktrace?). Thanks! On Fri, Nov 11, 2016 at 11:07 AM, Adrian Chadd wrote: > Hiya, > > So mips on the atheros 24kc and 74kc parts is just completely borked. > It varies between "this doesn't even boot" to "all I get are spams of > failure exceptions", and if i back out a variety of hilarity, i end up > with a userland that just plainly hangs after userland runs for a > little while. No CTRL-T, nothing obvious in ddb. But hey, 'cont' in > ddb now works. > > The working release for me is 304552, which is when I finished > updating the atheros config files to use std.XXXX instead of > ARXXXX_BASE. > > It's going to take some time to find the first point where things > broke. It's likely going to be a combination of everyone's recent mips > platform changes (most of the exceptions, the not-booting-at-all) and > other unrelated kernel changes to other areas (likely the hang.) > > I ask that people hold off on the MIPS side of work until I figure out > what's going on here. > > Also - I really do suggest you invest $40 in a carambola 2 so you have > the AR9331 as a reference platform to do MIPS testing on. These > mips24kc, FPU-less cut down SoCs are in a lot of things and having now > heavily broken support for them is kinda sad. :( It's also putting a > cramp on my ability to finish my net80211 and 11ac changes as a whole > lot of it depends upon working AP hardware to test against. > > Thanks, > > > -adrian > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > From owner-freebsd-mips@freebsd.org Fri Nov 11 15:21:02 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA6EDC3BB84 for ; Fri, 11 Nov 2016 15:21:02 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1971751; Fri, 11 Nov 2016 15:21:02 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id f82so97722693wmf.1; Fri, 11 Nov 2016 07:21:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=n5edTGd80Vj6si/TZHzP0B8Ej+nU1R0EXWfGjju8egg=; b=aDcu5lHKP6rttsqFJib6wamoR+N+1YYsP0aT501Xldfw/+bzfnVFN51j7V22dmInNW sgR1a+V66S5OTKXNWW1kSa9Y/6R02uve549AkyQpFUUk0MCuyvvZxaOfRRTF6V9XohF2 aqePLc3AZ0e0hTKDB6DAoeY3fBdeSBFGQ13curxjdnR6ka11a+FSeABdOEwoQxErNjFm sH732gt3F95Ub+IBqNhFDpHjZ97k2Y3oKUDLSnV1JEQZDTpYkyyg9jiXh5ZiGXrdEspy HF2aKvzz+yJ1RZf8RpQ/MHpGAJ+i5TXC3v3D4rpKictrUnOVGd74vMJh3mo57o5VpA8L pIfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n5edTGd80Vj6si/TZHzP0B8Ej+nU1R0EXWfGjju8egg=; b=Q7kbnCilJPBSop0FOsagGmlBhMRthMN+ke8a47NTSsrPUH1H++yGcBnCLXXrBgrem3 VdQq/xftbo0M7oeq21VwmrShfqveVQB/r8GTj0hHyeou5kov4F02DP2C1Ah4evvIAwqx wOJJf+CQ3+75Lj7LdOQQG/c7a9pxRs5yIXbkfDeeHXUSZqpcjOY9QkOeoZ2xaKSt13y3 KIyQqkIYtDoMMvVgaR9fRuQy2Yw7vyQV/R2+NNQMlny6jFCq3Z6/cDtNnik11vIfKHTO ArCukcXOwYnkWbEmGCBFHAoxgwbFVK7xJVQ/xdSLInEcpHSpUKtgYyGa1Rfih/7d/F+R e2lA== X-Gm-Message-State: ABUngvfHEHih76v4sp3Hj4nUW1Q6y+4Vwj7/Hr5SlzZ33f7VgUvMpg3HoTcel9xlN7SJr4dqDAG55NCYLyJD+g== X-Received: by 10.28.221.11 with SMTP id u11mr2036876wmg.91.1478877660792; Fri, 11 Nov 2016 07:21:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.152.131 with HTTP; Fri, 11 Nov 2016 07:20:59 -0800 (PST) In-Reply-To: References: From: Michael Zhilin Date: Fri, 11 Nov 2016 18:20:59 +0300 Message-ID: Subject: Re: mips24k (and others?) no longer works To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" , Brooks Davis , Ruslan Bukin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 15:21:02 -0000 Hi, geom is fine. badaddr = 0x533f44, pc = 0x4001e4, ra = 0, sp = 0x7ffeee90, sr = b413, pid = 1, ASID = 3 bio_request(0x809bd240) from 0x80956b00(ffs.ufs/FBSD) to 0x80894900(ufs/FBSD) cmd 1 bio_request(0x809bd120) from 0x80956dc0(flash/spi0s.rootfs.uzip) to 0x80894d80(flash/spi0s.rootfs.uzip) cmd 1 g_io_deliver(0x809bd120) from 0x80956dc0(flash/spi0s.rootfs.uzip) to 0x80894d80(flash/spi0s.rootfs.uzip) cmd 1 error 0 off 19902464 len 4096 g_io_deliver(0x809bd240) from 0x80956b00(ffs.ufs/FBSD) to 0x80894900(ufs/FBSD) cmd 1 error 0 off 19902464 len 4096 vm_fault(0x80852a50 (pmap 0x80852b0c), 0x533000 (0x533f44), 1, 0) -> 0 at pc 0x4001e4 0x533f44: 0 <----- to be 0x00557ee0 trap type 22 (TLB miss (load or instr. fetch) - user mode) badaddr = 0, pc = 0x4001e8, ra = 0, sp = 0x7ffeee90, sr = b413, pid = 1, ASID = 3 ... db> x/wx 0x533f44 0x533f44: 557ee0 My next check will be CPU cache (KSEG0 vs KSEG1). I'll check it tomorrow ;) Thanks! On Fri, Nov 11, 2016 at 5:49 PM, Michael Zhilin wrote: > Hi Adrian, > > I see bad fault a bit earlier: just after dozens of cycles of "init": at > pc = 0x4001e4, but it cou > > What found by me: after page fault on file objects the page content is > filled with small delay, i.e. it results in race. If you add small piece of > work (black-hole-cpu) after fault (or context switch?), then the page is > filled with data (magic). > > I want to find some time this weekend (tomorrow) to trace geom layer > (ktrace?). > > Thanks! > > On Fri, Nov 11, 2016 at 11:07 AM, Adrian Chadd > wrote: > >> Hiya, >> >> So mips on the atheros 24kc and 74kc parts is just completely borked. >> It varies between "this doesn't even boot" to "all I get are spams of >> failure exceptions", and if i back out a variety of hilarity, i end up >> with a userland that just plainly hangs after userland runs for a >> little while. No CTRL-T, nothing obvious in ddb. But hey, 'cont' in >> ddb now works. >> >> The working release for me is 304552, which is when I finished >> updating the atheros config files to use std.XXXX instead of >> ARXXXX_BASE. >> >> It's going to take some time to find the first point where things >> broke. It's likely going to be a combination of everyone's recent mips >> platform changes (most of the exceptions, the not-booting-at-all) and >> other unrelated kernel changes to other areas (likely the hang.) >> >> I ask that people hold off on the MIPS side of work until I figure out >> what's going on here. >> >> Also - I really do suggest you invest $40 in a carambola 2 so you have >> the AR9331 as a reference platform to do MIPS testing on. These >> mips24kc, FPU-less cut down SoCs are in a lot of things and having now >> heavily broken support for them is kinda sad. :( It's also putting a >> cramp on my ability to finish my net80211 and 11ac changes as a whole >> lot of it depends upon working AP hardware to test against. >> >> Thanks, >> >> >> -adrian >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-mips >> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >> > > From owner-freebsd-mips@freebsd.org Sat Nov 12 17:39:13 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C22C3DC85 for ; Sat, 12 Nov 2016 17:39:13 +0000 (UTC) (envelope-from admin@vip201.save90off.com) Received: from vip201.save90off.com (vip201.save90off.com [23.226.63.201]) by mx1.freebsd.org (Postfix) with ESMTP id D493F1886 for ; Sat, 12 Nov 2016 17:39:12 +0000 (UTC) (envelope-from admin@vip201.save90off.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=save90off; d=vip201.save90off.com; h=MIME-Version:From:To:Date:Subject:Content-Type:Content-Transfer-Encoding; i=admin@vip201.save90off.com; bh=ubY85y9Vp+R3mOA+2fZXOTa6e30=; b=DFSSDE75dyvTFRuTKWeTsK9oXI6Y5KqoJru7KWbj9WH8RgM6HAR1FxNJue+Mnaf4ca5AAw7zXz54 rVniB/3R+tFgAFB1kjL/gmZuczByrruWO0E2LnjT/p9a5vlR0vn85cFICCgmO+s4TqND4Aiy/deK CeHe+r6gcOZxNyE99FE= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=save90off; d=vip201.save90off.com; b=c2bqrDt+uBCyMAaNkXGTtIzSKPEX64Bd3A+WkGqslWlOXKbEUlpp/LrFj4XD3ri0DJJngdrYhHoO jRx+/JeCLpsdaYY3rJ5RFladPLkythqR7arRHBPsFsqeZ5Rn75KXNkGtvHFGajYb2mEG8tbOTJeE OctVwkLBKfavnHFetH8=; From: "MichaelKors Sale" To: freebsd-mips@freebsd.org Date: 13 Nov 2016 01:29:07 +0800 Subject: Breaking:Get 90% OFF and Free shipping on all products win 23$ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 17:39:13 -0000 From owner-freebsd-mips@freebsd.org Sat Nov 12 23:19:15 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E5AC3D20D; Sat, 12 Nov 2016 23:19:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D577137A; Sat, 12 Nov 2016 23:19:15 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x242.google.com with SMTP id q124so4647112itd.1; Sat, 12 Nov 2016 15:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=togl0GepTOhWHt9ilkIHEOCvaE9N0xy0dgRHCW9586o=; b=Ne7aQQLV4kAIkQHCWn5KYtMKVHgZs9F0xuYQtfTmthESeffa4lpMkr/AADx8qIKct2 kKxqmEnr8hupkcenx6XQuetE/PZLkVmf95TAVUYk+5IiVsVKQeYxpW36Sd5FPcL2GRKa ER+29HJyNfxPJYYIbpZnEPG7clXVOrmCZi6YO+3Z0vlFgG2kpWY8UbUYNpdg9KVzybHs iCRMKIn2YotAO2DmIvlI8cgD3TTrtqOibjnhFhhph/D/XjJM5ve2ec2BeLbn2KcZud6w e+mq8sZQzbu7v41WzrgpE9i2Qcnf5B7bcjZwwLRl2ktoURoqoDGxyb7rwr79BQYdafmT sXTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=togl0GepTOhWHt9ilkIHEOCvaE9N0xy0dgRHCW9586o=; b=gR1DO+3r1qPDma4Ii84LlZ12yMbUcb+gu9gVk/Eyh+OA0XGjqhsAgnbbr4LOJ2aNS3 n8ZBAu8v0GhtZ7eaLMy1uIolGBbWN3c2uMNL+T9GP9kVCWKHsuWzISKgb3hSzoWPXsp+ RkghxQzfac1YVH587qjbJ6zMSVoCTrX9zLkrQF/kWVcsZLW0hfGePi2hQrUKRvOXVViu tnJMAWrJdCtcD3LFysepJRVbfUxIQiWr81yN2s5fGQMIxYTWUTTF1kBriQvpcBQw0n/4 sGHocGm/emXQun8gToJxNmt85POUBSUx8Q7rTCXyVyp+i7dRFph9JjbQ0Vul6SbJWVFm 1QlA== X-Gm-Message-State: ABUngveT8Enh2t0Kp2vFcoQgrl0+Chap0P19KqCZM4CWT30ZPfY0Or+x8EyHoXlsUUzKntkdPT99ByLO4tEryg== X-Received: by 10.107.174.157 with SMTP id n29mr14027616ioo.177.1478992753897; Sat, 12 Nov 2016 15:19:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.39.134 with HTTP; Sat, 12 Nov 2016 15:19:13 -0800 (PST) In-Reply-To: <201610191109.u9JB9TTC002727@repo.freebsd.org> References: <201610191109.u9JB9TTC002727@repo.freebsd.org> From: Adrian Chadd Date: Sat, 12 Nov 2016 15:19:13 -0800 Message-ID: Subject: Re: svn commit: r307626 - head/sys/ufs/ffs To: Konstantin Belousov , "freebsd-mips@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 23:19:15 -0000 hi! This broke freebsd on mips24k. BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4002a4 got a read fault (type 0x2) at 0 Trapframe Register Dump: zero: 0 at: 0 v0: 0 v1: 0 a0: 0x7fffeecc a1: 0 a2: 0 a3: 0 t0: 0 t1: 0 t2: 0 t3: 0 t4: 0 t5: 0 t6: 0 t7: 0 t8: 0 t9: 0x400260 s0: 0x10 s1: 0x2 s2: 0x7fffeed0 s3: 0 s4: 0 s5: 0 s6: 0 s7: 0 k0: 0 k1: 0 gp: 0x4d55d0 sp: 0x7ffeee90 s8: 0 ra: 0 sr: 0xfc13 mullo: 0 mulhi: 0 badvaddr: 0 cause: 0x8 pc: 0x4002a4 Page table info for pc address 0x4002a4: pde = 0x809be000, pte = 0xa001acda Dumping 4 words starting at pc address 0x4002a4: 8c420000 14400003 00908021 8f828024 Page table info for bad address 0: pde = 0, pte = 0 .. and yes, I've spent three days bisecting everything to get to this particular commit. -adrian On 19 October 2016 at 04:09, Konstantin Belousov wrote: > Author: kib > Date: Wed Oct 19 11:09:29 2016 > New Revision: 307626 > URL: https://svnweb.freebsd.org/changeset/base/307626 > > Log: > Add FFS pager, which uses buffer cache read operation to validate pages. > See the comments for more detailed description of the algorithm. > > The pager is used unconditionally when the block size of the > underlying device is larger than the machine page size, since local > vnode pager cannot handle the configuration [1]. Otherwise, the > vfs.ffs.use_buf_pager sysctl allows to switch to the local pager. > > Measurements demonstrated no regression in the ever-important > buildworld benchmark, and small (~5%) throughput improvements in the > special microbenchmark configuration for dbench over swap-backed > md(4). > > Code can be generalized and reused for other filesystems which use > buffer cache. > > Reported by: Anton Yuzhaninov [1] > Tested by: pho > Benchmarked by: mjg, pho > Reviewed by: alc, markj, mckusick (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D8198 > > Modified: > head/sys/ufs/ffs/ffs_vnops.c > > Modified: head/sys/ufs/ffs/ffs_vnops.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 10:01:04 2016 (r307625) > +++ head/sys/ufs/ffs/ffs_vnops.c Wed Oct 19 11:09:29 2016 (r307626) > @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -86,6 +87,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > @@ -102,8 +104,9 @@ __FBSDID("$FreeBSD$"); > #ifdef DIRECTIO > extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); > #endif > -static vop_fsync_t ffs_fsync; > static vop_fdatasync_t ffs_fdatasync; > +static vop_fsync_t ffs_fsync; > +static vop_getpages_t ffs_getpages; > static vop_lock1_t ffs_lock; > static vop_read_t ffs_read; > static vop_write_t ffs_write; > @@ -119,13 +122,12 @@ static vop_openextattr_t ffs_openextattr > static vop_setextattr_t ffs_setextattr; > static vop_vptofh_t ffs_vptofh; > > - > /* Global vfs data structures for ufs. */ > struct vop_vector ffs_vnodeops1 = { > .vop_default = &ufs_vnodeops, > .vop_fsync = ffs_fsync, > .vop_fdatasync = ffs_fdatasync, > - .vop_getpages = vnode_pager_local_getpages, > + .vop_getpages = ffs_getpages, > .vop_getpages_async = vnode_pager_local_getpages_async, > .vop_lock1 = ffs_lock, > .vop_read = ffs_read, > @@ -147,7 +149,7 @@ struct vop_vector ffs_vnodeops2 = { > .vop_default = &ufs_vnodeops, > .vop_fsync = ffs_fsync, > .vop_fdatasync = ffs_fdatasync, > - .vop_getpages = vnode_pager_local_getpages, > + .vop_getpages = ffs_getpages, > .vop_getpages_async = vnode_pager_local_getpages_async, > .vop_lock1 = ffs_lock, > .vop_read = ffs_read, > @@ -1784,3 +1786,165 @@ vop_vptofh { > ufhp->ufid_gen = ip->i_gen; > return (0); > } > + > +SYSCTL_DECL(_vfs_ffs); > +static int use_buf_pager = 1; > +SYSCTL_INT(_vfs_ffs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, &use_buf_pager, 0, > + "Always use buffer pager instead of bmap"); > +static int buf_pager_relbuf; > +SYSCTL_INT(_vfs_ffs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, > + &buf_pager_relbuf, 0, > + "Make buffer pager release buffers after reading"); > + > +/* > + * The FFS pager. It uses buffer reads to validate pages. > + * > + * In contrast to the generic local pager from vm/vnode_pager.c, this > + * pager correctly and easily handles volumes where the underlying > + * device block size is greater than the machine page size. The > + * buffer cache transparently extends the requested page run to be > + * aligned at the block boundary, and does the necessary bogus page > + * replacements in the addends to avoid obliterating already valid > + * pages. > + * > + * The only non-trivial issue is that the exclusive busy state for > + * pages, which is assumed by the vm_pager_getpages() interface, is > + * incompatible with the VMIO buffer cache's desire to share-busy the > + * pages. This function performs a trivial downgrade of the pages' > + * state before reading buffers, and a less trivial upgrade from the > + * shared-busy to excl-busy state after the read. > + */ > +static int > +ffs_getpages(struct vop_getpages_args *ap) > +{ > + struct vnode *vp; > + vm_page_t *ma, m; > + vm_object_t object; > + struct buf *bp; > + struct ufsmount *um; > + ufs_lbn_t lbn, lbnp; > + vm_ooffset_t la, lb; > + long bsize; > + int bo_bs, count, error, i; > + bool redo, lpart; > + > + vp = ap->a_vp; > + ma = ap->a_m; > + count = ap->a_count; > + > + um = VFSTOUFS(ap->a_vp->v_mount); > + bo_bs = um->um_devvp->v_bufobj.bo_bsize; > + if (!use_buf_pager && bo_bs <= PAGE_SIZE) > + return (vnode_pager_generic_getpages(vp, ma, count, > + ap->a_rbehind, ap->a_rahead, NULL, NULL)); > + > + object = vp->v_object; > + la = IDX_TO_OFF(ma[count - 1]->pindex); > + if (la >= object->un_pager.vnp.vnp_size) > + return (VM_PAGER_BAD); > + lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; > + if (ap->a_rbehind != NULL) { > + lb = IDX_TO_OFF(ma[0]->pindex); > + *ap->a_rbehind = OFF_TO_IDX(lb - rounddown2(lb, bo_bs)); > + } > + if (ap->a_rahead != NULL) { > + *ap->a_rahead = OFF_TO_IDX(roundup2(la, bo_bs) - la); > + if (la + IDX_TO_OFF(*ap->a_rahead) >= > + object->un_pager.vnp.vnp_size) { > + *ap->a_rahead = OFF_TO_IDX(roundup2(object->un_pager. > + vnp.vnp_size, PAGE_SIZE) - la); > + } > + } > + VM_OBJECT_WLOCK(object); > +again: > + for (i = 0; i < count; i++) > + vm_page_busy_downgrade(ma[i]); > + VM_OBJECT_WUNLOCK(object); > + > + lbnp = -1; > + for (i = 0; i < count; i++) { > + m = ma[i]; > + > + /* > + * Pages are shared busy and the object lock is not > + * owned, which together allow for the pages' > + * invalidation. The racy test for validity avoids > + * useless creation of the buffer for the most typical > + * case when invalidation is not used in redo or for > + * parallel read. The shared->excl upgrade loop at > + * the end of the function catches the race in a > + * reliable way (protected by the object lock). > + */ > + if (m->valid == VM_PAGE_BITS_ALL) > + continue; > + > + lbn = lblkno(um->um_fs, IDX_TO_OFF(m->pindex)); > + if (lbn != lbnp) { > + bsize = blksize(um->um_fs, VTOI(vp), lbn); > + error = bread_gb(vp, lbn, bsize, NOCRED, GB_UNMAPPED, > + &bp); > + if (error != 0) > + break; > + KASSERT(1 /* racy, enable for debugging */ || > + m->valid == VM_PAGE_BITS_ALL || i == count - 1, > + ("buf %d %p invalid", i, m)); > + if (i == count - 1 && lpart) { > + VM_OBJECT_WLOCK(object); > + if (m->valid != 0 && > + m->valid != VM_PAGE_BITS_ALL) > + vm_page_zero_invalid(m, TRUE); > + VM_OBJECT_WUNLOCK(object); > + } > + if (LIST_EMPTY(&bp->b_dep)) { > + /* > + * Invalidation clears m->valid, but > + * may leave B_CACHE flag if the > + * buffer existed at the invalidation > + * time. In this case, recycle the > + * buffer to do real read on next > + * bread() after redo. > + * > + * Otherwise B_RELBUF is not strictly > + * necessary, enable to reduce buf > + * cache pressure. > + */ > + if (buf_pager_relbuf || > + m->valid != VM_PAGE_BITS_ALL) > + bp->b_flags |= B_RELBUF; > + > + bp->b_flags &= ~B_NOCACHE; > + brelse(bp); > + } else { > + bqrelse(bp); > + } > + lbnp = lbn; > + } > + } > + > + VM_OBJECT_WLOCK(object); > + redo = false; > + for (i = 0; i < count; i++) { > + vm_page_sunbusy(ma[i]); > + ma[i] = vm_page_grab(object, ma[i]->pindex, VM_ALLOC_NORMAL); > + > + /* > + * Since the pages were only sbusy while neither the > + * buffer nor the object lock was held by us, or > + * reallocated while vm_page_grab() slept for busy > + * relinguish, they could have been invalidated. > + * Recheck the valid bits and re-read as needed. > + * > + * Note that the last page is made fully valid in the > + * read loop, and partial validity for the page at > + * index count - 1 could mean that the page was > + * invalidated or removed, so we must restart for > + * safety as well. > + */ > + if (ma[i]->valid != VM_PAGE_BITS_ALL) > + redo = true; > + } > + if (redo && error == 0) > + goto again; > + VM_OBJECT_WUNLOCK(object); > + return (error != 0 ? VM_PAGER_ERROR : VM_PAGER_OK); > +} >