bf27391da5
This patch adds support for the LZ4 decompression algorithm to libpayload. It's what all the cool kids are using for decompression these days and has many interesting advantages over LZMA (and everything else I know of): blazing fast decompression (20(!) times faster than LZMA, twice as fast as LZO on my Cortex-A72), no memory requirements on decompression, and possibly in-place decompression support. It pays for that with a lower compression ratio (about 50% larger compressed size than LZMA, 10% larger than LZO for an ARM64 Linux kernel binary), but the boot time math still works in its favor for our IO speeds. This patch only adds the raw decompression functions for use by external payloads, we can later try integrating them in CBFS. It copies the decompression code itself unmodified from the upstream LZ4 library at github.com/Cyan4973/lz4 which will hopefully make it easy to update. The frame format parsing is reimplemented since the upstream version looks unnecessarily complex and unreadable for our needs. BRANCH=smaug BUG=chrome-os-partner:32184 TEST=With other patches, booted ARM64 kernel that got compressed from 15M to 5.1M and decompresses in 44ms. Change-Id: I65bdc4b2b19bd51c7b7e17a4e4b79da301a2a014 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: f8a1fc996d5b0234d07f567fa8163d0f802d5144 Original-Change-Id: I15c0620da05561ade2552b15ffdf6bb3afd7eb26 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/282743 Original-Reviewed-by: Stefan Reinauer <reinauer@google.com> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10845 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
137 lines
6.2 KiB
Text
137 lines
6.2 KiB
Text
-------------------------------------------------------------------------------
|
|
Copyright and Licenses
|
|
-------------------------------------------------------------------------------
|
|
|
|
The copyright on libpayload is owned by various individual developers
|
|
and/or companies. Please check the individual source files for details.
|
|
|
|
The libpayload code is mostly licensed under the terms of the three-clause
|
|
BSD license:
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions
|
|
are met:
|
|
|
|
1. Redistributions of source code must retain the above copyright
|
|
notice, this list of conditions and the following disclaimer.
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
notice, this list of conditions and the following disclaimer in the
|
|
documentation and/or other materials provided with the distribution.
|
|
3. The name of the author may not be used to endorse or promote products
|
|
derived from this software without specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
SUCH DAMAGE.
|
|
|
|
For some parts, which were taken from external projects, other (compatible)
|
|
licenses may apply. Please check the individual source files for details,
|
|
or see the section at the bottom of this file for an overview of third-party
|
|
code in libpayload.
|
|
|
|
Some parts of libpayload are licensed under the GNU General Public License
|
|
(version 2). These parts are clearly separated by the CONFIG_GPL Kconfig
|
|
option (default off), and will not be linked into the output payload unless
|
|
that option has been chosen. The full text of that license is provided in the
|
|
LICENSE_GPL file.
|
|
|
|
(Please note that the coreboot project makes a best effort to keep licensing
|
|
information up to date and accurate, but provides no legal guarantees to that
|
|
regard. If you redistribute libpayload code in source or binary form, it is
|
|
your liability to ensure that you conform to all legal requirements that this
|
|
might entail.)
|
|
|
|
Third-party Code and License Overview
|
|
-------------------------------------
|
|
|
|
This is an overview of (modified or unmodified) third-party code in
|
|
libpayload, and where it was originally taken from.
|
|
|
|
Please check the individual source code files for the list of copyright
|
|
holders, and the exact license terms that apply.
|
|
|
|
* util/kconfig/*: GPLv2
|
|
Source: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
|
|
Current version we use: 587c90616a5b44e6ccfac38e64d4fecee51d588c (03/2008)
|
|
|
|
* include/curses.priv.h: BSD-like license
|
|
Source: ncurses, http://www.gnu.org/software/ncurses/
|
|
Original files: ncurses/curses.priv.h
|
|
Current version we use: 5.6
|
|
|
|
* include/curses.h: BSD-like license
|
|
Source: ncurses, http://www.gnu.org/software/ncurses/
|
|
Original files: include/curses.h.in
|
|
Current version we use: 5.6
|
|
|
|
* include/lar.h: GPLv2 or revised BSD license
|
|
Source: coreboot v3, svn://coreboot.org/repository/coreboot-v3
|
|
Original file: util/lar/lar.h
|
|
Current version we use: r647
|
|
|
|
* libc/ipchecksum.c: 2-clause BSD license
|
|
Source: FreeBSD's base system libraries, http://www.freebsd.org
|
|
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libalias/Attic/alias_util.c?rev=1.15;content-type=text%2Fplain
|
|
Original files: lib/libalias/alias_util.c, function LibAliasInternetChecksum()
|
|
Current version we use: CVS revision 1.15 2004/07/06 12:13:28
|
|
|
|
* libc/rand.c: 3-clause BSD license
|
|
Source: OpenBSD
|
|
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/rand.c
|
|
Original files: src/lib/libc/stdlib/rand.c
|
|
Current version we use: CVS revision 1.9 2005/8/8 08:05:37
|
|
|
|
* libc/memory.c: 3-clause BSD license
|
|
Source: HelenOS, http://www.helenos.eu
|
|
svn checkout svn://svn.helenos.eu/HelenOS/trunk HelenOS
|
|
http://svn.helenos.eu/chora/browse.php?f=%2Ftrunk%2F
|
|
Original files: uspace/libc/generic/string.c
|
|
Current version we use: r2754
|
|
|
|
* libc/printf.c: 3-clause BSD license
|
|
Source: HelenOS, http://www.helenos.eu
|
|
svn checkout svn://svn.helenos.eu/HelenOS/trunk HelenOS
|
|
http://svn.helenos.eu/chora/browse.php?f=%2Ftrunk%2F
|
|
Original files: kernel/generic/src/printf/printf_core.c
|
|
kernel/generic/src/printf/snprintf.c
|
|
kernel/generic/src/printf/sprintf.c
|
|
kernel/generic/src/printf/vsnprintf.c
|
|
kernel/generic/src/printf/vsprintf.c
|
|
kernel/generic/src/printf/printf.c
|
|
kernel/generic/src/printf/vprintf.c
|
|
Current version we use: r2745
|
|
|
|
* drivers/video/font8x16.c: 3-clause BSD license
|
|
Source: HelenOS, http://www.helenos.eu
|
|
svn checkout svn://svn.helenos.eu/HelenOS/trunk HelenOS
|
|
http://svn.helenos.eu/chora/browse.php?f=%2Ftrunk%2F
|
|
Original file: kernel/genarch/src/fb/font-8x16.c
|
|
Current version we use: r3293
|
|
|
|
* crypto/sha1.c: Public domain
|
|
Source: OpenBSD
|
|
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/hash/sha1.c
|
|
Original files: src/lib/libc/hash/sha1.c
|
|
Current version we use: CVS revision 1.20 2005/08/08
|
|
|
|
* arch/arm/mem*.S: GPLv2
|
|
Source: Linux, http://www.kernel.org
|
|
Original files: arch/arm/lib/mem*.S
|
|
Current version we use: 3.9 (418df63adac56841ef6b0f1fcf435bc64d4ed177)
|
|
|
|
* arch/x86/string.c: LGPLv2.1, modified to GPLv2 under the terms of section 3
|
|
Source: GNU C Library (glibc), http://www.gnu.org/software/libc/libc.html
|
|
Original files: sysdeps/i386/memset.c
|
|
Current version we use: 2.14
|
|
|
|
* liblz4/lz4.c: 2-clause BSD
|
|
Source: LZ4 library, https://github.com/Cyan4973/lz4
|
|
Current version we use: r130 (baf78e7e4dcbdf824a76f990ffeb573d113bbbdb)
|