From owner-freebsd-mips@freebsd.org Fri Dec 11 16:46:53 2015 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 90E5D9D7345 for ; Fri, 11 Dec 2015 16:46:53 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 351071CD0 for ; Fri, 11 Dec 2015 16:46:53 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by wmnn186 with SMTP id n186so39593148wmn.0 for ; Fri, 11 Dec 2015 08:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Wa/vBVy3RM4WM2ltwSr5aSsh4ZeqkVK2kE9kYWFx0H8=; b=eUVIEi7K1n4HC40dFUdzc1m0sIy+PYALv2mKHeDnCFFCxb4GarWS8TDyXjtitdG2oU MX9/t5qk9MgQWcSWqLIZX3qlC30k4VCiJQtqectJ1d9kUgevtyTFh74H3Wi0FBGiEsk3 drVkVB/8Ba2zCnQ2yda7FJBm9ELM3iMIX/DOiyZ5DFijJNEk/OpFow3OBa7tRBAdyPM8 w2b8g7Z7ReU3bkstvHe7emBCr52dJaVvDGYxJjsZppRYz7GPxqT4/w0FWiNAr0Fls8XX +bMEZSTH4FntVsphURbGCfMdt6uPCC6+L06DmcqIq80OHMjq5yPVV4P/J8qXOCqTI2gC b5Ug== X-Received: by 10.28.52.213 with SMTP id b204mr7530368wma.32.1449852411731; Fri, 11 Dec 2015 08:46:51 -0800 (PST) Received: from ?IPv6:2001:67c:2154:ffff:d198:2b0c:9743:90ee? ([2001:67c:2154:ffff:d198:2b0c:9743:90ee]) by smtp.gmail.com with ESMTPSA id w4sm17707873wje.49.2015.12.11.08.46.50 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Dec 2015 08:46:51 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Subject: Re: MIPS_CONFIG0_VI defined wrong in sys/mips/include/cpuregs.h? From: Stanislav Galabov In-Reply-To: Date: Fri, 11 Dec 2015 18:46:50 +0200 Cc: Stanislav Galabov , "freebsd-mips@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5866093A-E70C-4417-BFF6-B41CC35B571B@gmail.com> References: <7514D462-9B7F-4728-8784-135614215992@gmail.com> To: Adrian Chadd X-Mailer: Apple Mail (2.3094) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 16:46:53 -0000 Hi Adrian, Done: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205249 Best wishes, Stanislav > On Dec 11, 2015, at 18:38, Adrian Chadd = wrote: >=20 > Hm, >=20 > Would you file a freebsd pr about it? I'll go take a look at it and = fix it up. >=20 > I'll go review the more recent mips core docs and see what's going on = too. >=20 > Thanks! >=20 >=20 > -a >=20 >=20 > On 11 December 2015 at 08:02, Stanislav Galabov = wrote: >> Hi all, >>=20 >> It seems that MIPS_CONFIG0_VI is defined wrong in = sys/mips/include/cpuregs.h. >>=20 >> According to MIPS=C2=AE Architecture For Programmers Volume III, page = 149, Figure 9-29 (Config Register Format), accessed via = http://www.t-es-t.hu/download/mips/md00090c.pdf, bit 3 of config0 is = supposed to be VI (Virtual Instruction Cache), while the current = definition of MIPS_CONFIG0_VI (0x00000004) implies that it=E2=80=99s bit = 2. >>=20 >> This leads to a lot of headaches when trying to bring up a new CPU = (1004KC in my case) and trying to use Cachable-Coherent CCA (0x5 or = 0b101) for Kseg0 :-) >> I guess we=E2=80=99ve been able to get away with this so far due to = mainly 2 things: >> 1. CPUs that use CCA 0x4 - 0x7 for Kseg0 usually are cache-coherent = anyway, so their cache ops are most likely no-op. >> 2. CPUs that use CCA 0x0 - 0x3 for Kseg0 work just fine, as bit 2 is = not set :-) >>=20 >> This leads to improper detection of the I-Cache type (it=E2=80=99s = detected as virtual when it actually isn=E2=80=99t) on kernels that use = CCA >=3D 0x4 for Kseg0, which, in turn, leads to a lot of fun trying to = figure out what=E2=80=99s wrong and why things work with CCA 0x3 and not = with 0x5 on a single core... >> After changing the definition of MIPS_CONFIG0_VI from 0x00000004 to = 0x00000008 everything goes back to normal even with CCA 0x5. >>=20 >> I would appreciate it if someone would commit this change (if you = guys think it=E2=80=99s necessary). I would do it myself if I but I have = no commit privileges. >>=20 >> Best wishes, >> Stanislav >> _______________________________________________ >> 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"