coreboot-kgpe-d16/util/lint
Patrick Georgi 1d029b40c9 lib/jpeg: Replace decoder with Wuffs' implementation
To quote its repo[0]: Wuffs is a memory-safe programming language (and
a standard library written in that language) for Wrangling Untrusted
File Formats Safely. Wrangling includes parsing, decoding and encoding.

It compiles its library, written in its own language, to a C/C++ source
file that can then be used independently without needing support for
the language. That library is now imported to src/vendorcode/wuffs/.

This change modifies our linters to ignore that directory because
it's supposed to contain the wuffs compiler's result verbatim.

Nigel Tao provided an initial wrapper around wuffs' jpeg decoder
that implements our JPEG API. I further changed it a bit regarding
data placement, dropped stuff from our API that wasn't ever used,
or isn't used anymore, and generally made it fit coreboot a bit
better. Features are Nigel's, bugs are mine.

This commit also adapts our jpeg fuzz test to work with the modified
API. After limiting it to deal only with approximately screen sized
inputs, it fuzzed for 25 hours CPU time without a single hang or
crash. This is a notable improvement over running the test with our
old decoder which crashes within a minute.

Finally, I tried the new parser with a pretty-much-random JPEG file
I got from the internet, and it just showed it (once the resolution
matched), which is also a notable improvement over the old decoder
which is very particular about the subset of JPEG it supports.

In terms of code size, a QEmu build's ramstage increases
from 128060 bytes decompressed (64121 bytes after LZMA)
  to 172304 bytes decompressed (82734 bytes after LZMA).

[0] https://github.com/google/wuffs

Change-Id: If8fa7da69da1ad412f27c2c5e882393c7739bc82
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Based-on-work-by: Nigel Tao <nigeltao@golang.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78271
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-13 16:17:34 +00:00
..
Makefile
check-style
check_lint_tests
checkpatch.pl lint/checkpatch.pl: Check for 0-length and 1-element arrays 2023-08-09 20:42:08 +00:00
checkpatch_json.py util/lint/checkpatch_json.py: Make output message verbatim 2023-07-14 14:29:48 +00:00
const_structs.checkpatch
coreboot.dict
description.md
helper_functions.sh
kconfig_lint util/lint/kconfig_lint: Ignore C preprocessor macros in code 2023-11-13 14:13:24 +00:00
kconfig_lint_README
lint
lint-000-license-headers util/lint: Add SPDX checker for makefiles 2023-08-15 16:31:30 +00:00
lint-001-no-global-config-in-romstage
lint-007-checkpatch lib/jpeg: Replace decoder with Wuffs' implementation 2023-12-13 16:17:34 +00:00
lint-008-kconfig
lint-014-qualified-types
lint-extended-007-checkpatch
lint-extended-015-final-newlines
lint-extended-020-signed-off-by
lint-stable-000-license-headers
lint-stable-003-whitespace
lint-stable-004-style-labels lib/jpeg: Replace decoder with Wuffs' implementation 2023-12-13 16:17:34 +00:00
lint-stable-005-board-status
lint-stable-006-board-name
lint-stable-008-kconfig
lint-stable-009-old-licenses
lint-stable-010-asm-syntax
lint-stable-012-executable-bit
lint-stable-013-site-local
lint-stable-016-non-ascii
lint-stable-017-configs
lint-stable-018-symlinks
lint-stable-019-header-files
lint-stable-021-coreboot-lowercase
lint-stable-022-clang-format
lint-stable-023-filenames
lint-stable-024-kconfig-no-subsystem
lint-stable-026-line-endings
lint-stable-027-maintainers-syntax
lint-stable-028-touchpad-probed-warning
lint-stable-029-kconfig-name-selects util/lint: Add linter to keep selects out of Kconfig.name 2023-11-18 01:58:24 +00:00
remccoms3.sed
spelling.txt util/lint: Fix some mistakes in spelling.txt 2023-11-01 15:26:57 +00:00