From owner-freebsd-mips@freebsd.org Fri Dec 11 17:14:39 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 4B5D89D890D for ; Fri, 11 Dec 2015 17:14:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (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 03B881FC7 for ; Fri, 11 Dec 2015 17:14:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgcc31 with SMTP id c31so202271851qgc.3 for ; Fri, 11 Dec 2015 09:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=46DBVHLmjPodYB3KT8bpmjK7khIiO1uoSe94vJHif3s=; b=saBdKr5xE3UMsi7yqxx29sMU5t3uZj7l6V9SNGUOie0LROI4XRXtFUhlsZlCdLMBir qyW7cfZCpPj2j4KLzuzjCeTnwcsfiNqQbaDZGRKVwORewEV2fFxf5REoiw7nsvj7kbtq y3KJ0tlfoGrWxTiEZprqb2FxMRNdJrLbgoebbx+g46ffixjDQAL8VkwxW1jFyFQ64qnD OWuf239UnInKJ2/F2/h01/PyV6gzJnHcSsnZHbJJzVwPL39NtrXXo5ZqYRsbBaMVA2/G cFfyVkTs0hPyhChfyKAEwSNyx/+ltHSJCM3GcQ/ifHT+E4KCd5eJWt/uhJT+R7TRs57O Iucw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=46DBVHLmjPodYB3KT8bpmjK7khIiO1uoSe94vJHif3s=; b=hu/tE14GH7qsY6V2zxFJVRNnyQNEcv3/QuIzHaKPhYKyGrOCi5LAPG7wrwaIXx/1q6 09oQnNPnJ9qbqUUbkhLaP3/865/ilxuLT8qTbMR87zrd7G5hsd1KBlkZ55L5ti4Mip15 4STgumoCzHntyRJAYU1L6rTo/3DZzfgGZt1VokCnbSs+dtLhrV346J9DHjTNYhF95brN 8AKINnUyXzRtkkVw8KdGSjLMnUFKr9OWWrKRUSKwc1tevcxU8ZVA+2mb8uzAl+PJ6qN8 g4cfAaisb/REVJi/0kgxPCzbv8p4U3USskywa0U2PXq0uNboMF9Eh1e8zaCuXTUYcXnQ Br5g== X-Gm-Message-State: ALoCoQml3NiuA1ZEz5q8/2t2Fg32lQi8UId14GoLrKg4fnO+yC3LnVGI+rmSDqbxfZXppzdoiSSTQt9G5Ix33YwwUnsABsLkuw== MIME-Version: 1.0 X-Received: by 10.140.31.73 with SMTP id e67mr25694475qge.46.1449854077748; Fri, 11 Dec 2015 09:14:37 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Fri, 11 Dec 2015 09:14:37 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <5866093A-E70C-4417-BFF6-B41CC35B571B@gmail.com> References: <7514D462-9B7F-4728-8784-135614215992@gmail.com> <5866093A-E70C-4417-BFF6-B41CC35B571B@gmail.com> Date: Fri, 11 Dec 2015 10:14:37 -0700 X-Google-Sender-Auth: 3o0ckHCKZCYfZMSFyF0zWqIkgrg Message-ID: Subject: Re: MIPS_CONFIG0_VI defined wrong in sys/mips/include/cpuregs.h? From: Warner Losh To: Stanislav Galabov Cc: Adrian Chadd , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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 17:14:39 -0000 Comitted. On Fri, Dec 11, 2015 at 9:46 AM, Stanislav Galabov wrote: > 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: > > > > Hm, > > > > Would you file a freebsd pr about it? I'll go take a look at it and fix > it up. > > > > I'll go review the more recent mips core docs and see what's going on > too. > > > > Thanks! > > > > > > -a > > > > > > On 11 December 2015 at 08:02, Stanislav Galabov > wrote: > >> Hi all, > >> > >> It seems that MIPS_CONFIG0_VI is defined wrong in > sys/mips/include/cpuregs.h. > >> > >> 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 definiti= on > of MIPS_CONFIG0_VI (0x00000004) implies that it=E2=80=99s bit 2. > >> > >> 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 ma= inly 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 :-) > >> > >> This leads to improper detection of the I-Cache type (it=E2=80=99s det= ected 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. > >> > >> 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 co= mmit > privileges. > >> > >> 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= " > > _______________________________________________ > 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" >