]> git.dujemihanovic.xyz Git - u-boot.git/commit
zlib: Fix big performance regression
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 16 Jul 2024 14:35:46 +0000 (08:35 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 19 Jul 2024 22:48:07 +0000 (16:48 -0600)
commit4cf1275f2b85b4bf5c5b037369178e9fedacd0a9
tree86af1631c22acba8cdc406405322187446bc6c35
parent4f658510074bf85ee4ddc0fb3d2cb5dd45a1c561
zlib: Fix big performance regression

Commit 340fdf1303dc ("zlib: Port fix for CVE-2016-9841 to U-Boot")
brings a big performance regression in inflate_fast(), which leads
to watchdog timer reset on powerpc 8xx.

It looks like that commit does more than what it describe, it
especially removed an important optimisation that was doing copies
using halfwords instead of bytes. That unexpected change multiplied
by almost 4 the time spent in inflate_fast() and increased by 40%
the overall time needed to uncompress linux kernel image.

So partially revert that commit but keep post incrementation as it
is the initial purpose of said commit.

[trini: Combine assorted patches in to this one, just restoring the
        performance commit]

Fixes: 340fdf1303dc ("zlib: Port fix for CVE-2016-9841 to U-Boot")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
lib/zlib/inffast.c
lib/zlib/zlib.h