<div dir="ltr"><div>I don't know much about MMUs, but you might want to chat with the M-Labs guys. They adding a MMU to the lm32, see <a href="https://github.com/m-labs/lm32/blob/master/doc/mmu.rst">https://github.com/m-labs/lm32/blob/master/doc/mmu.rst</a> -- their implementation is *super simple* but seems to be good enough to get OSes running.</div><div><br></div><div>The lm32+MMU+Basic SoC (DDR, UART, Timer) easily fits inside a LX9 using only about 50% of the resources.<br></div><div><br></div><div>Tim 'mithro' Ansell</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 March 2017 at 00:20, Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Part of the reason we've been so quiet recently is that J2 development<br>
is now in feature freeze preparing for first silicon. We're happy enough<br>
with what we've got that we want to do a small initial proving run of<br>
actual ASICs. There's still some development on peripherals and bus size<br>
tweaks going on, but the SOC core you'd run on Numato or Turtle hasn't<br>
changed in a while and isn't expected to start changing again for a few<br>
months.<br>
<br>
That said, Jeff recently looked at the mmu design Hitachi did for the<br>
sh3, and it's very heavyweight. We'd rather do a simpler implementation<br>
for our first pass, and need to study what Linux actually wants out of<br>
an MMU first. And if we're doing a new mmu design, we'd rather not open<br>
that can of worms until after the ASIC tapes out. (Which is mostly<br>
testing work, not development work.)<br>
<br>
The problem with the existing sh3 MMU is there's no WAY you can fit it<br>
in an lx9, and probably not in an lx25. The problem is their MMU walks<br>
the page tables in software, which completely flushes a simple L1 cache<br>
like j-core has. To work around that they added L2 cache and made the L1<br>
4-way associative, and which drives the FPGA routing nuts. A simple<br>
implementation of what they did would be several times larger than the<br>
existing j2 SOC implementation _combined_. (We talked about making our<br>
L1 2-way associative someday, but what the hitachi mmu needs is not a<br>
"sweet spot".)<br>
<br>
What we really want, to go along with our tiny processor implementation,<br>
is an mmu that walks the page tables in _hardware_, at least for simple<br>
faults where the TLB refill is just looking up the translation of an<br>
existing physical page address. This would avoid the need to run page<br>
fault handling code through the cache for "soft faults" (or run the same<br>
code uncached, which would suck about as badly).<br>
<br>
But what we really want is an mmu that's a good fit for Linux. Note that<br>
Linus has strong opinions about this sort of thing:<br>
<br>
<a href="http://yarchive.net/comp/powerpc_page_tables.html" rel="noreferrer" target="_blank">http://yarchive.net/comp/<wbr>powerpc_page_tables.html</a><br>
<a href="http://yarchive.net/comp/linux/page_tables.html" rel="noreferrer" target="_blank">http://yarchive.net/comp/<wbr>linux/page_tables.html</a><br>
<br>
And apparently wrote his master's thesis on it:<br>
<br>
<a href="ftp://ftp.polsl.pl/pub/linux/kernel/people/torvalds/thesis/torvalds97.pdf" rel="noreferrer" target="_blank">ftp://ftp.polsl.pl/pub/linux/<wbr>kernel/people/torvalds/thesis/<wbr>torvalds97.pdf</a><br>
<br>
And so did Mel Gorman a few years later:<br>
<br>
<a href="https://www.kernel.org/doc/gorman/" rel="noreferrer" target="_blank">https://www.kernel.org/doc/<wbr>gorman/</a><br>
<br>
That said stuff's changed a lot since then (we're up to what, 5 levels<br>
now?) so we'd like to take the time and get the design right.<br>
<br>
We'd also want to have a patch ready to push into qemu to support the<br>
new design if it's not the existing one...<br>
<br>
So that's the current state of that work.<br>
<br>
Rob<br>
______________________________<wbr>_________________<br>
J-core mailing list<br>
<a href="mailto:J-core@lists.j-core.org">J-core@lists.j-core.org</a><br>
<a href="http://lists.j-core.org/mailman/listinfo/j-core" rel="noreferrer" target="_blank">http://lists.j-core.org/<wbr>mailman/listinfo/j-core</a><br>
</blockquote></div><br></div>