Commit Graph

814641 Commits

Author SHA1 Message Date
huangyu4
01a85fed09 techpack: audio: Synchronize codes for OnePlus 8T Oxygen OS 11.0.13.13.KB05AA and OnePlus8 Oxygen OS 11.0.11.11.IN21AA and OnePlus 8 Pro Oxygen OS 11.0.11.11.IN11AA
Change-Id: I0ac8210d8a2ba2a003d4b6f6669419fa4bdb250a
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-06-13 17:43:21 +03:00
huangyu4
9be6e4eb49 Synchronize codes for OnePlus 8T Oxygen OS 11.0.13.13.KB05AA and OnePlus8 Oxygen OS 11.0.11.11.IN21AA and OnePlus 8 Pro Oxygen OS 11.0.11.11.IN11AA
1.Update security patches.

Change-Id: Id398be08de4f351049eb30210a2585b3959a5d3d
2022-06-13 17:40:05 +03:00
6f178c57f3 release.sh: Fix absolute paths to match new environment 2022-02-18 15:43:02 +02:00
6f57727285 build: Added support for AnyKernel3 2022-02-13 22:16:43 +02:00
708ec6bb7d defconfig: Version bump 2022-01-31 13:43:41 +02:00
Aner Torre
a56ccb5315 boeffla_wl_blocker: Increase blacklist max length
The previous 255 limit seemed to be not enough to hold all the Samsung stock defined wakelocks that look safe to block

Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:53 +02:00
Denis Efremov
f6e12fa723 power: wl_blocker: use strcpy() in init
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:49 +02:00
Denis Efremov
235498199e power: wl_blocker: remove excessive len variable
It's not used. Type conversion size_t > int is not
needed.

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:44 +02:00
Denis Efremov
970bd2e7d0 power: wl_blocker: use simple_strtoul() in debug_show()
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:39 +02:00
Denis Efremov
32b97cd8fd power: wl_blocker: use signed type for ret in debug_store()
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:34 +02:00
Denis Efremov
7af67d1ac9 power: wl_blocker: fix permissions for version_show
Use only read permissions for version_show.

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:28 +02:00
Denis Efremov
d9ab9a94b0 power: wl_blocker: use scnprintf PAGE_SIZE
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:23 +02:00
Denis Efremov
ff13902830 power: wl_blocker: add generic size
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: acuicultor <ramoncuenca4@gmail.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-31 13:02:12 +02:00
57b8dfccde Defconfig: version bump 2021-12-23 10:20:13 +02:00
291bc4616b Wireguard: crypto: curve25519-x86_64: use in/out register constraints more precisely 2021-12-23 10:04:46 +02:00
yu.huang
77e716db1e Synchronize codes for OnePlus 8T Oxygen OS 11.0.12.12.KB05AA and OnePlus 8 Oxygen OS 11.0.9.9.IN21AA and OnePlus 8 Pro Oxygen OS 11.0.9.9.IN11AA
1.Optimize charge experience.
2.Optimize performance experience.

Change-Id: I62544fb6dc2bf3ee39cacf727c8291ace3463091
2021-12-23 10:00:30 +02:00
24d73a8940 Build environment: Fixed AIK filename change. 2021-12-13 13:18:21 +02:00
e754bee5e0 Defconfig: version bump 2021-12-13 13:15:44 +02:00
Dimitri John Ledkov
25ba3bdb15 lib/decompress_unlz4.c: correctly handle zero-padding around initrds.
[ Upstream commit 2c484419efc09e7234c667aa72698cb79ba8d8ed ]

lz4 compatible decompressor is simple.  The format is underspecified and
relies on EOF notification to determine when to stop.  Initramfs buffer
format[1] explicitly states that it can have arbitrary number of zero
padding.  Thus when operating without a fill function, be extra careful to
ensure that sizes less than 4, or apperantly empty chunksizes are treated
as EOF.

To test this I have created two cpio initrds, first a normal one,
main.cpio.  And second one with just a single /test-file with content
"second" second.cpio.  Then i compressed both of them with gzip, and with
lz4 -l.  Then I created a padding of 4 bytes (dd if=/dev/zero of=pad4 bs=1
count=4).  To create four testcase initrds:

 1) main.cpio.gzip + extra.cpio.gzip = pad0.gzip
 2) main.cpio.lz4  + extra.cpio.lz4 = pad0.lz4
 3) main.cpio.gzip + pad4 + extra.cpio.gzip = pad4.gzip
 4) main.cpio.lz4  + pad4 + extra.cpio.lz4 = pad4.lz4

The pad4 test-cases replicate the initrd load by grub, as it pads and
aligns every initrd it loads.

All of the above boot, however /test-file was not accessible in the initrd
for the testcase #4, as decoding in lz4 decompressor failed.  Also an
error message printed which usually is harmless.

Whith a patched kernel, all of the above testcases now pass, and
/test-file is accessible.

This fixes lz4 initrd decompress warning on every boot with grub.  And
more importantly this fixes inability to load multiple lz4 compressed
initrds with grub.  This patch has been shipping in Ubuntu kernels since
January 2021.

[1] ./Documentation/driver-api/early-userspace/buffer-format.rst

BugLink: https://bugs.launchpad.net/bugs/1835660
Link: https://lore.kernel.org/lkml/20210114200256.196589-1-xnox@ubuntu.com/ # v0
Link: https://lkml.kernel.org/r/20210513104831.432975-1-dimitri.ledkov@canonical.com
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Bongkyu Kim <bongkyu.kim@lge.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Sven Schmidt <4sschmid@informatik.uni-hamburg.de>
Cc: Rajat Asthana <thisisrast7@gmail.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Gao Xiang <hsiangkao@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:35:05 +02:00
Joe Perches
af4faf1e75 lib/lz4/lz4_decompress.c: document deliberate use of `&'
This operation was intentional, but tools such as smatch will warn that it
might not have been.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Yann Collet <cyan@fb.com>
Cc: Vasily Averin <vvs@virtuozzo.com>
Cc: Gao Xiang <hsiangkao@aol.com>
Link: http://lkml.kernel.org/r/3bf931c6ea0cae3e23f3485801986859851b4f04.camel@perches.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:35:02 +02:00
Gao Xiang
90387881fc lib/lz4: explicitly support in-place decompression
LZ4 final literal copy could be overlapped when doing
in-place decompression, so it's unsafe to just use memcpy()
on an optimized memcpy approach but memmove() instead.

Upstream LZ4 has updated this years ago [1] (and the impact
is non-sensible [2] plus only a few bytes remain), this commit
just synchronizes LZ4 upstream code to the kernel side as well.

It can be observed as EROFS in-place decompression failure
on specific files when X86_FEATURE_ERMS is unsupported,
memcpy() optimization of commit 59daa706fb ("x86, mem:
Optimize memcpy by avoiding memory false dependece") will
be enabled then.

Currently most modern x86-CPUs support ERMS, these CPUs just
use "rep movsb" approach so no problem at all. However, it can
still be verified with forcely disabling ERMS feature...

arch/x86/lib/memcpy_64.S:
        ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
-                     "jmp memcpy_erms", X86_FEATURE_ERMS
+                     "jmp memcpy_orig", X86_FEATURE_ERMS

We didn't observe any strange on arm64/arm/x86 platform before
since most memcpy() would behave in an increasing address order
("copy upwards" [3]) and it's the correct order of in-place
decompression but it really needs an update to memmove() for sure
considering it's an undefined behavior according to the standard
and some unique optimization already exists in the kernel.

[1] 33cb8518ac
[2] https://github.com/lz4/lz4/pull/717#issuecomment-497818921
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=12518

Link: https://lkml.kernel.org/r/20201122030749.2698994-1-hsiangkao@redhat.com
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Nick Terrell <terrelln@fb.com>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Miao Xie <miaoxie@huawei.com>
Cc: Chao Yu <yuchao0@huawei.com>
Cc: Li Guifu <bluce.liguifu@huawei.com>
Cc: Guo Xuenan <guoxuenan@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:58 +02:00
Andy Shevchenko
358e5d15b7 zcomp: Use ARRAY_SIZE() for backends list
Instead of keeping NULL terminated array switch to use ARRAY_SIZE()
which helps to further clean up.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: http://lkml.kernel.org/r/20200508100758.51644-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:55 +02:00
Sebastian Andrzej Siewior
69f290db24 zram: Allocate struct zcomp_strm as per-CPU memory
zcomp::stream is a per-CPU pointer, pointing to struct zcomp_strm
which contains two pointers. Having struct zcomp_strm allocated
directly as per-CPU memory would avoid one additional memory
allocation and a pointer dereference. This also simplifies the
addition of a local_lock to struct zcomp_strm.

Allocate zcomp::stream directly as per-CPU memory.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20200527201119.1692513-7-bigeasy@linutronix.de
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:52 +02:00
Taejoon Song
4439814441 zram: try to avoid worst-case scenario on same element pages
The worst-case scenario on finding same element pages is that almost all
elements are same at the first glance but only last few elements are
different.

Since the same element tends to be grouped from the beginning of the
pages, if we check the first element with the last element before
looping through all elements, we might have some chances to quickly
detect non-same element pages.

 1. Test is done under LG webOS TV (64-bit arch)
 2. Dump the swap-out pages (~819200 pages)
 3. Analyze the pages with simple test script which counts the iteration
    number and measures the speed at off-line

Under 64-bit arch, the worst iteration count is PAGE_SIZE / 8 bytes =
512.  The speed is based on the time to consume page_same_filled()
function only.  The result, on average, is listed as below:

                                     Num of Iter    Speed(MB/s)
  Looping-Forward (Orig)                 38            99265
  Looping-Backward                       36           102725
  Last-element-check (This Patch)        33           125072

The result shows that the average iteration count decreases by 13% and
the speed increases by 25% with this patch.  This patch does not
increase the overall time complexity, though.

I also ran simpler version which uses backward loop.  Just looping
backward also makes some improvement, but less than this patch.

[taejoon.song@lge.com: fix off-by-one]
  Link: http://lkml.kernel.org/r/1578642001-11765-1-git-send-email-taejoon.song@lge.com
Link: http://lkml.kernel.org/r/1575424418-16119-1-git-send-email-taejoon.song@lge.com
Signed-off-by: Taejoon Song <taejoon.song@lge.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:49 +02:00
Douglas Anderson
5d7f02fc00 zram: failing to decompress is WARN_ON worthy
If we fail to decompress in zram it's a pretty serious problem.  We were
entrusted to be able to decompress the old data but we failed.  Either
we've got some crazy bug in the compression code or we've got memory
corruption.

At the moment, when this happens the log looks like this:

  ERR kernel: [ 1833.099861] zram: Decompression failed! err=-22, page=336112
  ERR kernel: [ 1833.099881] zram: Decompression failed! err=-22, page=336112
  ALERT kernel: [ 1833.099886] Read-error on swap-device (253:0:2688896)

It is true that we have an "ALERT" level log in there, but (at least to
me) it feels like even this isn't enough to impart the seriousness of this
error.  Let's convert to a WARN_ON.  Note that WARN_ON is automatically
"unlikely" so we can simply replace the old annotation with the new one.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@chromium.org>
Cc: Jens Axboe <axboe@kernel.dk>
Link: https://lkml.kernel.org/r/20200917174059.1.If09c882545dbe432268f7a67a4d4cfcb6caace4f@changeid
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:46 +02:00
Dave Rodgman
a178cd6763 lib/lzo: fix ambiguous encoding bug in lzo-rle
In some rare cases, for input data over 32 KB, lzo-rle could encode two
different inputs to the same compressed representation, so that
decompression is then ambiguous (i.e.  data may be corrupted - although
zram is not affected because it operates over 4 KB pages).

This modifies the compressor without changing the decompressor or the
bitstream format, such that:

 - there is no change to how data produced by the old compressor is
   decompressed

 - an old decompressor will correctly decode data from the updated
   compressor

 - performance and compression ratio are not affected

 - we avoid introducing a new bitstream format

In testing over 12.8M real-world files totalling 903 GB, three files
were affected by this bug.  I also constructed 37M semi-random 64 KB
files totalling 2.27 TB, and saw no affected files.  Finally I tested
over files constructed to contain each of the ~1024 possible bad input
sequences; for all of these cases, updated lzo-rle worked correctly.

There is no significant impact to performance or compression ratio.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Dave Rodgman <dave.rodgman@arm.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Chao Yu <yuchao0@huawei.com>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20200507100203.29785-1-dave.rodgman@arm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:42 +02:00
Dave Rodgman
f6e5338269 lib/lzo/lzo1x_compress.c: fix alignment bug in lzo-rle
Fix an unaligned access which breaks on platforms where this is not
permitted (e.g., Sparc).

Link: http://lkml.kernel.org/r/20190912145502.35229-1-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: Dave Rodgman <dave.rodgman@arm.com>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-10 10:34:38 +02:00
3f86a5f0fd Wireguard: Updated to v1.0.20211208 2021-12-10 10:33:00 +02:00
8943f5c71f net/wireguard: wireguard updated to v1.0.20210606 2021-06-13 00:46:28 +03:00
19ab75cedb defconfig: bump version 2021-06-13 00:27:08 +03:00
yu.huang
373013ee0d techpack: audio: Synchronize codes for OnePlus 8T Oxygen OS 11.0.8.12.KB05AA and OnePlus 8 Oxygen OS 11.0.6.6.IN21AA and OnePlus 8 Pro Oxygen OS 11.0.6.6.IN11AA
Change-Id: Ifa3ccc96df36add0f915b815948c3f6a34678af4
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-06-12 22:42:04 +03:00
yu.huang
01464e1133 Synchronize codes for OnePlus 8T Oxygen OS 11.0.8.12.KB05AA and OnePlus 8 Oxygen OS 11.0.6.6.IN21AA and OnePlus 8 Pro Oxygen OS 11.0.6.6.IN11AA
1. Optimize charger experience.

Change-Id: I261cfc70b7f5f6c19f548035ff2a766cb1683f01
2021-06-12 22:38:03 +03:00
65c6ea8df2 defconfig: Disable serial console logging.
* Google tells OEMs explicitly to not enable this
   for production, but OnePlus is gonna OnePlus.
2021-05-20 13:06:20 +03:00
ef9adfea18 Removed rebasing and committed on top of oneplus tree. defconfig updated 2021-05-20 12:52:51 +03:00
Tom Rix
db71648e23 selinux: fix double free
commit 65de50969a77509452ae590e9449b70a22b923bb upstream.

Clang's static analysis tool reports these double free memory errors.

security/selinux/ss/services.c:2987:4: warning: Attempt to free released memory [unix.Malloc]
                        kfree(bnames[i]);
                        ^~~~~~~~~~~~~~~~
security/selinux/ss/services.c:2990:2: warning: Attempt to free released memory [unix.Malloc]
        kfree(bvalues);
        ^~~~~~~~~~~~~~

So improve the security_get_bools error handling by freeing these variables
and setting their return pointers to NULL and the return len to 0

Cc: stable@vger.kernel.org
Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-20 12:26:09 +03:00
Sultan Alsawaf
4f49d735da binder: Stub out debug prints by default
Binder code is very hot, so checking frequently to see if a debug
message should be printed is a waste of cycles. We're not debugging
binder, so just stub out the debug prints to compile them out entirely.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-05-20 12:26:09 +03:00
LibXZR
82a426fe29 drivers: gpu: msm: Only build adreno 6xx part
* Inspired by 5898ed5670
2021-05-20 12:26:08 +03:00
4fe6ab8215 defconfig: disable IPC_LOGGING 2021-05-20 12:26:08 +03:00
Srinivasarao P
ec119a343d arm64: fix bootloader_memory_limit
set bootloader_memory_limit to end of dram, if the memory limit set
in kernel parameters is more than ram size.

Change-Id: I7d23ca84f08dfb4bf7660253db722a1f6456bf85
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:08 +03:00
Kristof Petho
4572b0cb88 drivers/oneplus: demote verbose logging to debug
Also remove logging decisions made in real time
2021-05-20 12:26:08 +03:00
f45789e378 techpack/display/msm/dsi: fixed compile errors 2021-05-20 12:26:08 +03:00
0953843b3a defconfig: version bump and dot between 2021-05-20 12:26:08 +03:00
Diab Neiroukh
e88477ea8e mm: oom_kill: Reduce some verbose logging
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
Yaroslav Furman
244eb4ec79 sched: core: silence no longer affine to cpu logspam
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
4e7cf40fa3 defconfig: disable IKHEADERS 2021-05-20 12:26:07 +03:00
zhaochen
a65c05c026 soc: qcom: watchdog: Modify some debug level
Modify the irq_count print debug level from info to debug.

Change-Id: I1c5677414b2a97fc2697b003620a80d8843589a7
Signed-off-by: zhaochen <zhaochen@codeaurora.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
Tyler Nijmeh
a6c7d84c49 usb_bam: Disable logging
Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
Nick Terrell
aabccead38 BACKPORT: lz4: fix kernel decompression speed
This patch replaces all memcpy() calls with LZ4_memcpy() which calls
__builtin_memcpy() so the compiler can inline it.

LZ4 relies heavily on memcpy() with a constant size being inlined.  In x86
and i386 pre-boot environments memcpy() cannot be inlined because memcpy()
doesn't get defined as __builtin_memcpy().

An equivalent patch has been applied upstream so that the next import
won't lose this change [1].

I've measured the kernel decompression speed using QEMU before and after
this patch for the x86_64 and i386 architectures.  The speed-up is about
10x as shown below.

Code	Arch	Kernel Size	Time	Speed
v5.8	x86_64	11504832 B	148 ms	 79 MB/s
patch	x86_64	11503872 B	 13 ms	885 MB/s
v5.8	i386	 9621216 B	 91 ms	106 MB/s
patch	i386	 9620224 B	 10 ms	962 MB/s

I also measured the time to decompress the initramfs on x86_64, i386, and
arm.  All three show the same decompression speed before and after, as
expected.

[1] https://github.com/lz4/lz4/pull/890

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Gao Xiang <gaoxiang25@huawei.com>
Cc: Sven Schmidt <4sschmid@informatik.uni-hamburg.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Link: http://lkml.kernel.org/r/20200803194022.2966806-1-nickrterrell@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

eng.stk: backport to 4.14 (sunfish)

Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
Dave Rodgman
92515eeb0c lib/lzo: fix bugs for very short or empty input
For very short input data (0 - 1 bytes), lzo-rle was not behaving
correctly.  Fix this behaviour and update documentation accordingly.

For zero-length input, lzo v0 outputs an end-of-stream marker only,
which was misinterpreted by lzo-rle as a bitstream version number.
Ensure bitstream versions > 0 require a minimum stream length of 5.

Also fixes a bug in handling the tail for very short inputs when a
bitstream version is present.

Link: http://lkml.kernel.org/r/20190326165857.34613-1-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:07 +03:00
Matt Sealey
a9e491f956 lib/lzo: fast 8-byte copy on arm64
Enable faster 8-byte copies on arm64.

Link: http://lkml.kernel.org/r/20181127161913.23863-6-dave.rodgman@arm.com
Link: http://lkml.kernel.org/r/20190205141950.9058-4-dave.rodgman@arm.com
Signed-off-by: Matt Sealey <matt.sealey@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-05-20 12:26:06 +03:00