<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in std.loongson</title>
    <link>http://nxr.netbsd.org/rss/src/sys/arch/evbmips/conf/std.loongson</link>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2005</copyright>
    <generator>Java</generator>
    
<item>
    <title>Build the loongson kernels with all the binutils loongson2f errata workarounds<br/><br/>From Zhang Fuxin via https://sourceware.org/ml/binutils/2009-11/msg00387.html<br/><br/>  - The NOP issue<br/><br/>"The nature of the erratum is deeply related to the microarchitecture of<br/>Loongson-2. It uses roughly a 4-way superscalar dynamically scheduled core,<br/>instructions are excuted as much as possible in parallel with technics like<br/>branch prediction etc. We use a 8-entry internal branch prediction queue to<br/>keep track of each predicted branches, if some branches are proved to be<br/>wrongly predicted, all the instructions following it will be cancelled,together<br/>with the resources used by them, including the registers used for renaming, and<br/>the queue entry will be freeed. There is a bug that might cause a hang when the<br/>queue is full(some resources might been leaked due to conflict branch entries),<br/>the workaround is to reduce the possiblity of branch queue full by using<br/>renaming registers(they are also limited, can prevent too many simutaneos<br/>branches). In theory this is still not enough to fully eliminate possible<br/>hangs, but the possiblity is extremely low now and hard to be hit in real<br/>code."<br/><br/>  - The JUMP instructions issue<br/><br/>"The Loongson-2 series processors have quite complex micro-architecture, it will<br/>try to execute instructions from the predicated branch of coming instruction<br/>stream before they are confirmed to be run, if the predication of branch<br/>direction is proved wrong later, the instructions will be cancelled, but if the<br/>instructions is a read from memory, the read action might not be cancelled(but<br/>the changes to register will) to enable some prefetch. This will lead to some<br/>problems when compining with some chipsets. E.g. the AMD CS5536 used in<br/>Yeeloong/Fuloong will hang if it gets an address in the physical address range<br/>of 0x100000-0x200000(might be more other ranges). Speculative reads can perform<br/>read at any address in theory(due to wrong prediction of branch directions and<br/>the use of branch target buffer), thus in very few occasions they might cause a<br/>hard lock of the machine.<br/><br/>To prevent this, we need to prevent some addresses from entering branch<br/>target buffers. A way to do this is that to modify all jump targets, e.g.,<br/>     calulations of t9<br/>     ...<br/>     jalr t9  =&gt;<br/>     calculations of t9<br/>     or t9, t9, 0x80000000;  // to make sure t9 is in kseg0<br/>     jalr t9<br/>Of course, we have to consider 64/32bit, and modules addresses etc.<br/><br/>This only need to be performed on kernel code, because only there we can have<br/>accesses not translated/limited by TLB. For user code, it is impossible to<br/>generate accesses to unwanted physical address. So it is safe.<br/><br/>Also, to prevent addresses generated by user mode code to be used by the<br/>kernel, we add a few empty jumps to flush the BTB upon entrance to kernel."</title>
    <description>/src/sys/arch/evbmips/conf/std.loongson - 1.2</description>
    <pubDate>Tue Aug 08 00:22:21 UTC 2017</pubDate>
    <dc:creator>maya</dc:creator>
</item>

<item>
    <title>branches:  1.1.12;  1.1.30;  1.1.46;<br/>Add loongson support to evbmips, based on the OpenBSD loongson port<br/>and the existing evbmips/gdium support.<br/>This has been tested on a lemote fuloong device (boots multiuser),<br/>should also support other lemote devices (maybe with minor adjustments,<br/>or adding missing drivers). There is some gdium support here too, but it<br/>may not be yet complete (someone with a gdium would need to have a look,<br/>hi macallan@ :)<br/>loongson kernels are 64bits only: the loongson2f has ressources located<br/>above the 2Gb physical address, and it's much easier to access it<br/>using XKPHYS than trying to make it fit in the limited 32bit kernel<br/>virtual space.</title>
    <description>/src/sys/arch/evbmips/conf/std.loongson - 1.1</description>
    <pubDate>Sat Aug 27 13:42:44 UTC 2011</pubDate>
    <dc:creator>bouyer</dc:creator>
</item>

<item>
    <title>Pull up following revision(s) (requested by maya in ticket #246):<br/>	sys/arch/evbmips/conf/std.loongson: revision 1.2<br/>	usr.sbin/sysinst/arch/evbmips/md.h: revision 1.2<br/>	sys/arch/mips/mips/mipsX_subr.S: revision 1.101<br/>	sys/arch/mips/mips/mipsX_subr.S: revision 1.102<br/>	sys/arch/mips/mips/mipsX_subr.S: revision 1.103<br/>	sys/arch/mips/mips/mipsX_subr.S: revision 1.104<br/>In working around loongson errata clear BTB and RAS, same as<br/>other operating systems.<br/>15 Errata: Issue of Out-of-order in loongson (translated)<br/>In loongson 2F, because of the branch prediction, sometimes the CPU<br/>may fetch the instructions from some unexpected area (for example I/O<br/>space). It is an invalid operation. There are two ways for the CPU to<br/>choose the branch target. The first one is predicting the branch<br/>target according to the branch target history. The second one is<br/>calculating the branch target by the ALU. There are most 8<br/>instructions in the instruction window at the same time in loongson2f<br/>(Remember the loongson 2f is superscalar, right?). Hence, the<br/>branch target of an indirect branch(such as jr) could be got(may be<br/>predicted by the branch target history) earlier and the instrctions of<br/>the branch target could be prefetched even if there are branch<br/>instructions before it. As a result, it is possible to fetch the<br/>instructions from I/O region( say out-of the physical address range of<br/>[0- 0x100000]) in kernel model because of the instruction prefetch of<br/>the branch target.<br/>There are some suggestions to prevent prefetching instructions from<br/>the I/O region in kernel mode.<br/>(1) When switching from user model to kernel model, you should flush<br/>the branch target history such as BTB and RAS.<br/>(2) Doing some tricks to the indirect branch target to make sure that<br/>the indirect branch target can not be in the I/O region.<br/>Remove whitespace I just introduced<br/>Build the loongson kernels with all the binutils loongson2f errata workarounds<br/>From Zhang Fuxin via &lt;a  rel="nofollow" href="https://sourceware.org/ml/binutils/2009-11/msg00387.html"&gt;https://sourceware.org/ml/binutils/2009-11/msg00387.html&lt;/a&gt;<br/>  - The NOP issue<br/>"The nature of the erratum is deeply related to the microarchitecture of<br/>Loongson-2. It uses roughly a 4-way superscalar dynamically scheduled core,<br/>instructions are excuted as much as possible in parallel with technics like<br/>branch prediction etc. We use a 8-entry internal branch prediction queue to<br/>keep track of each predicted branches, if some branches are proved to be<br/>wrongly predicted, all the instructions following it will be cancelled,together<br/>with the resources used by them, including the registers used for renaming, and<br/>the queue entry will be freeed. There is a bug that might cause a hang when the<br/>queue is full(some resources might been leaked due to conflict branch entries),<br/>the workaround is to reduce the possiblity of branch queue full by using<br/>renaming registers(they are also limited, can prevent too many simutaneos<br/>branches). In theory this is still not enough to fully eliminate possible<br/>hangs, but the possiblity is extremely low now and hard to be hit in real<br/>code."<br/>  - The JUMP instructions issue<br/>"The Loongson-2 series processors have quite complex micro-architecture, it will<br/>try to execute instructions from the predicated branch of coming instruction<br/>stream before they are confirmed to be run, if the predication of branch<br/>direction is proved wrong later, the instructions will be cancelled, but if the<br/>instructions is a read from memory, the read action might not be cancelled(but<br/>the changes to register will) to enable some prefetch. This will lead to some<br/>problems when compining with some chipsets. E.g. the AMD CS5536 used in<br/>Yeeloong/Fuloong will hang if it gets an address in the physical address range<br/>of 0x100000-0x200000(might be more other ranges). Speculative reads can perform<br/>read at any address in theory(due to wrong prediction of branch directions and<br/>the use of branch target buffer), thus in very few occasions they might cause a<br/>hard lock of the machine.<br/>To prevent this, we need to prevent some addresses from entering branch<br/>target buffers. A way to do this is that to modify all jump targets, e.g.,<br/>     calulations of t9<br/>     ...<br/>     jalr t9  =&gt;<br/>     calculations of t9<br/>     or t9, t9, 0x80000000;  // to make sure t9 is in kseg0<br/>     jalr t9<br/>Of course, we have to consider 64/32bit, and modules addresses etc.<br/>This only need to be performed on kernel code, because only there we can have<br/>accesses not translated/limited by TLB. For user code, it is impossible to<br/>generate accesses to unwanted physical address. So it is safe.<br/>Also, to prevent addresses generated by user mode code to be used by the<br/>kernel, we add a few empty jumps to flush the BTB upon entrance to kernel."<br/>evbmips can "boot root FFSv2"<br/>It typically uses a non-NetBSD bootloader (PMON, u-boot...) and those<br/>don't differentiate from v1 from v2 - both are unsupported and it requires<br/>a separate boot partition.<br/>Don't need the errata workaround on user return<br/>It's reported that the MMU will block such invalid reads in userland,<br/>and it's only needed on entry.<br/>use meaningful name for errata hack, dedup</title>
    <description>/src/sys/arch/evbmips/conf/std.loongson - 1.1.46.1</description>
    <pubDate>Tue Aug 29 00:47:29 UTC 2017</pubDate>
    <dc:creator>martin</dc:creator>
</item>

<item>
    <title>Sync with HEAD</title>
    <description>/src/sys/arch/evbmips/conf/std.loongson - 1.1.30.1</description>
    <pubDate>Mon Aug 28 17:51:36 UTC 2017</pubDate>
    <dc:creator>skrll</dc:creator>
</item>

<item>
    <title>update from HEAD</title>
    <description>/src/sys/arch/evbmips/conf/std.loongson - 1.1.12.1</description>
    <pubDate>Sun Dec 03 11:36:09 UTC 2017</pubDate>
    <dc:creator>jdolecek</dc:creator>
</item>
</channel></rss>

