<div dir="ltr">Hi Antonello,<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 3:02 AM, WordPress <span dir="ltr"><<a href="mailto:wordpress@blogs.coreboot.org" target="_blank">wordpress@blogs.coreboot.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Since my last post I mainly kept focusing on the region_device API, I attempted to go through with my week #3 plan to continue the phasing out of rdev_mmap_full() from the selfload code (described in previous post).</p>
<p>I think I overestimated what I could accomplish regarding that project, I tried to modify the current lzma API used inside to coreboot to make it possible to easily load each chunk of data from memory/chip and decompress it gradually.<br>
Theoretically it shouldn’t be too difficult, in practice the decompression code is particularly nasty and it seems it is a customised version of the LZMA SDK code.<br>
I, not so quickly, realised that I didn’t have the time to delve into that, so I momentarily dropped the idea. (It could be a nice project to do after the GSOC ends.)</p>
<p></p></blockquote></div></div><div class="gmail_extra">Just wanted to point out that we recently added LZ4 compression as an alternative to LZMA which has the nice property that it can decompress in-place (meaning you read it into the end of the buffer reserved for the decompressed binary, and then just run the decompression function with overlapping input and output buffers). This would allow you to solve your problem by just doing a single big rdev_readat(), but without needing additional memory anywhere.</div><div class="gmail_extra"><br></div><div class="gmail_extra">On the systems I looked at, LZ4 and LZMA are almost equally effective anyway. What little LZ4 lacks in compression ratio is roughly made up with faster decompression speed when you look at total boot time. Maybe it's time we just get rid of LZMA completely and then we can rewrite all the decompression things with the assumption that they support in-place.</div></div>