commit d078bc6f0f70ef5671eb202f225145f789f3d7ff Author: Alexandre Frade Date: Mon Jun 1 18:27:41 2020 -0300 Linux 5.7.0-xanmod1 Signed-off-by: Alexandre Frade commit 56edec9498f407d2532c91808778e9b279e7bca3 Author: Alexandre Frade Date: Mon Jun 1 18:23:51 2020 -0300 block, bfq: change BLK_DEV_ZONED depends to IOSCHED_BFQ Signed-off-by: Alexandre Frade commit 87fa8f89a626b46ff2c5c392f53b087428d007cb Author: Adam Borowski Date: Tue Mar 31 22:39:13 2020 -0700 .gitignore: add ZSTD-compressed files For now, that's arch/x86/boot/compressed/vmlinux.bin.zst but probably more will come, thus let's be consistent with all other compressors. Tested-by: Sedat Dilek Reviewed-by: Kees Cook Signed-off-by: Nick Terrell Signed-off-by: Adam Borowski commit 2e1f1c22c05b33554a40e71bdb88280c53603387 Author: Nick Terrell Date: Tue Mar 31 22:39:12 2020 -0700 x86: Add support for ZSTD compressed kernel * Add support for zstd compressed kernel * Bump the heap size for zstd. * Update the documentation. Integrates the ZSTD decompression code to the x86 pre-boot code. Zstandard requires slightly more memory during the kernel decompression on x86 (192 KB vs 64 KB), and the memory usage is independent of the window size. This patch has been boot tested with both a zstd and gzip compressed kernel on i386 and x86_64 using buildroot and QEMU. Additionally, this has been tested in production on x86_64 devices. We saw a 2 second boot time reduction by switching kernel compression from xz to zstd. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 739ece8a5b12426854b9737deaa7f9ab88a8c1de Author: Nick Terrell Date: Tue Mar 31 22:39:11 2020 -0700 x86: bump ZO_z_extra_bytes margin for zstd Bump the ZO_z_extra_bytes margin for zstd. Zstd needs 3 bytes per 128 KB, and has a 22 byte fixed overhead. Zstd needs to maintain 128 KB of space at all times, since that is the maximum block size. See the comments regarding in-place decompression added in lib/decompress_unzstd.c for details. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 70b4efc0631d2804c295cbb0acaf47aac6f35f2d Author: Nick Terrell Date: Tue Mar 31 22:39:10 2020 -0700 usr: add support for zstd compressed initramfs * Add support for a zstd compressed initramfs. * Add compression for compressing built-in initramfs with zstd. I have tested this patch by boot testing with buildroot and QEMU. Specifically, I booted the kernel with both a zstd and gzip compressed initramfs, both built into the kernel and separate. I ensured that the correct compression algorithm was used. I tested on arm, aarch64, i386, and x86_64. This patch has been tested in production on aarch64 and x86_64 devices. Additionally, I have performance measurements from internal use in production. On an aarch64 device we saw 19 second boot time improvement from switching from lzma to zstd (27 seconds to 8 seconds). On an x86_64 device we saw a 9 second boot time reduction from switching from xz to zstd. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 130de74c08a0052b63d05ac1ea01e407a307dd4a Author: NihilisticPandemoniun <152417+nihilisticpandemonium@users.noreply.github.com> Date: Thu Dec 19 00:08:37 2019 -0800 init: add support for zstd compressed modules Signed-off-by: Alexandre Frade commit a1767f86d5452013d184f77652982623fa5e5322 Author: Nick Terrell Date: Tue Mar 31 22:39:09 2020 -0700 init: add support for zstd compressed kernel * Adds the zstd cmd to scripts/Makefile.lib * Adds the HAVE_KERNEL_ZSTD and KERNEL_ZSTD options Architecture specific support is still needed for decompression. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 475a57bb14f9f538d039f2751f5868f78545810f Author: Nick Terrell Date: Tue Mar 31 22:39:08 2020 -0700 lib: add zstd support to decompress * Add unzstd() and the zstd decompress interface. * Add zstd support to decompress_method(). The decompress_method() and unzstd() functions are used to decompress the initramfs and the initrd. The __decompress() function is used in the preboot environment to decompress a zstd compressed kernel. The zstd decompression function allows the input and output buffers to overlap because that is used by x86 kernel decompression. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 35da348cfbf96180ea52fb07322f1caa3c3147c3 Author: Nick Terrell Date: Tue Mar 31 22:39:07 2020 -0700 lib: prepare xxhash for preboot environment Don't export symbols if XXH_PREBOOT is defined. This change is necessary to get xxhash to work in a preboot environment, which is needed to support zstd-compressed kernels. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 743fcabb6356c5c9eb6ed51ec0fb8d8e0374784b Author: Nick Terrell Date: Tue Mar 31 22:39:06 2020 -0700 lib: prepare zstd for preboot environment * Don't export symbols if ZSTD_PREBOOT is defined. * Remove a double definition of the CHECK_F macro when the zstd library is amalgamated. * Switch ZSTD_copy8() to __builtin_memcpy(), because in the preboot environment on x86 gcc can't inline `memcpy()` otherwise. * Limit the gcc hack in ZSTD_wildcopy() to the broken gcc version. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388. These changes are necessary to get the build to work in the preboot environment, and to get reasonable performance. ZSTD_copy8() and ZSTD_wildcopy() are in the core of the zstd hot loop. So outlining these calls to memcpy(), and having an extra branch are very detrimental to performance. Reviewed-by: Kees Cook Tested-by: Sedat Dilek Signed-off-by: Nick Terrell commit 69ca91364e16b36025559f16d79760a280291f91 Author: graysky Date: Mon Jun 1 17:53:04 2020 -0300 x86/kconfig: Enable additional cpu optimizations for gcc v9.1+ kernel v5.7+ WARNING This patch works with gcc versions 9.1+ and with kernel version 5.7+ and should NOT be applied when compiling on older versions of gcc due to key name changes of the march flags introduced with the version 4.9 release of gcc.[1] Use the older version of this patch hosted on the same github for older versions of gcc. FEATURES This patch adds additional CPU options to the Linux kernel accessible under: Processor type and features ---> Processor family ---> The expanded microarchitectures include: * AMD Improved K8-family * AMD K10-family * AMD Family 10h (Barcelona) * AMD Family 14h (Bobcat) * AMD Family 16h (Jaguar) * AMD Family 15h (Bulldozer) * AMD Family 15h (Piledriver) * AMD Family 15h (Steamroller) * AMD Family 15h (Excavator) * AMD Family 17h (Zen) * AMD Family 17h (Zen 2) * Intel Silvermont low-power processors * Intel Goldmont low-power processors (Apollo Lake and Denverton) * Intel Goldmont Plus low-power processors (Gemini Lake) * Intel 1st Gen Core i3/i5/i7 (Nehalem) * Intel 1.5 Gen Core i3/i5/i7 (Westmere) * Intel 2nd Gen Core i3/i5/i7 (Sandybridge) * Intel 3rd Gen Core i3/i5/i7 (Ivybridge) * Intel 4th Gen Core i3/i5/i7 (Haswell) * Intel 5th Gen Core i3/i5/i7 (Broadwell) * Intel 6th Gen Core i3/i5/i7 (Skylake) * Intel 6th Gen Core i7/i9 (Skylake X) * Intel 8th Gen Core i3/i5/i7 (Cannon Lake) * Intel 10th Gen Core i7/i9 (Ice Lake) * Intel Xeon (Cascade Lake) It also offers to compile passing the 'native' option which, "selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine and will produce code optimized for the local machine under the constraints of the selected instruction set."[3] MINOR NOTES This patch also changes 'atom' to 'bonnell' in accordance with the gcc v4.9 changes. Note that upstream is using the deprecated 'match=atom' flags when I believe it should use the newer 'march=bonnell' flag for atom processors.[2] It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The recommendation is to use the 'atom' option instead. BENEFITS Small but real speed increases are measurable using a make endpoint comparing a generic kernel to one built with one of the respective microarchs. See the following experimental evidence supporting this statement: https://github.com/graysky2/kernel_gcc_patch REQUIREMENTS linux version >=5.7 gcc version >=9.1 ACKNOWLEDGMENTS This patch builds on the seminal work by Jeroen.[5] REFERENCES 1. https://gcc.gnu.org/gcc-4.9/changes.html 2. https://bugzilla.kernel.org/show_bug.cgi?id=77461 3. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html 4. https://github.com/graysky2/kernel_gcc_patch/issues/15 5. http://www.linuxforge.net/docs/linux/linux-gcc.php Signed-off-by: Alexandre Frade commit b7aa5796ffbf07f2a731cdc3a2ff239b0bef2cbc Author: Gabriel Krisman Bertazi Date: Thu Feb 13 18:45:25 2020 -0300 selftests: futex: Add FUTEX_WAIT_MULTIPLE wake up test Add test for wait at multiple futexes mechanism. Skip the test if it's a x32 application and the kernel returned the approtiaded error, since this ABI is not supported for this operation. Signed-off-by: Gabriel Krisman Bertazi Co-developed-by: André Almeida Signed-off-by: André Almeida Signed-off-by: Alexandre Frade commit a1d3aba61accad77191641599c2f60a3f80da319 Author: Gabriel Krisman Bertazi Date: Thu Feb 13 18:45:24 2020 -0300 selftests: futex: Add FUTEX_WAIT_MULTIPLE wouldblock test Add test for wouldblock return when waiting for multiple futexes. Skip the test if it's a x32 application and the kernel returned the approtiaded error, since this ABI is not supported for this operation. Signed-off-by: Gabriel Krisman Bertazi Co-developed-by: André Almeida Signed-off-by: André Almeida Signed-off-by: Alexandre Frade commit 82b95f9703f8c86d7ba20fbf5b163f7ee9f1ce5b Author: Gabriel Krisman Bertazi Date: Thu Feb 13 18:45:23 2020 -0300 selftests: futex: Add FUTEX_WAIT_MULTIPLE timeout test Add test for timeout when waiting for multiple futexes. Skip the test if it's a x32 application and the kernel returned the approtiaded error, since this ABI is not supported for this operation. Signed-off-by: Gabriel Krisman Bertazi Co-developed-by: André Almeida Signed-off-by: André Almeida Signed-off-by: Alexandre Frade commit 7b532408190492e52c8c5e5899652475b61d1d96 Author: Gabriel Krisman Bertazi Date: Thu Feb 13 18:45:22 2020 -0300 futex: Implement mechanism to wait on any of several futexes This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on several futexes at the same time, and be awoken by any of them. In a sense, it implements one of the features that was supported by pooling on the old FUTEX_FD interface. The use case lies in the Wine implementation of the Windows NT interface WaitMultipleObjects. This Windows API function allows a thread to sleep waiting on the first of a set of event sources (mutexes, timers, signal, console input, etc) to signal. Considering this is a primitive synchronization operation for Windows applications, being able to quickly signal events on the producer side, and quickly go to sleep on the consumer side is essential for good performance of those running over Wine. Wine developers have an implementation that uses eventfd, but it suffers from FD exhaustion (there is applications that go to the order of multi-milion FDs), and higher CPU utilization than this new operation. The futex list is passed as an array of `struct futex_wait_block` (pointer, value, bitset) to the kernel, which will enqueue all of them and sleep if none was already triggered. It returns a hint of which futex caused the wake up event to userspace, but the hint doesn't guarantee that is the only futex triggered. Before calling the syscall again, userspace should traverse the list, trying to re-acquire any of the other futexes, to prevent an immediate -EWOULDBLOCK return code from the kernel. This was tested using three mechanisms: 1) By reimplementing FUTEX_WAIT in terms of FUTEX_WAIT_MULTIPLE and running the unmodified tools/testing/selftests/futex and a full linux distro on top of this kernel. 2) By an example code that exercises the FUTEX_WAIT_MULTIPLE path on a multi-threaded, event-handling setup. 3) By running the Wine fsync with Valve's Proton compatibility code implementation and executing multi-threaded applications, in particular modern games, on top of this implementation. Changes were tested for the following ABIs: x86_64, i386 and x32. Support for x32 applications is not implemented since it would take a major rework adding a new entry point and splitting the current futex 64 entry point in two and we can't change the current x32 syscall number without breaking user space compatibility. CC: Steven Rostedt Cc: Richard Yao Cc: Thomas Gleixner Cc: Peter Zijlstra Co-developed-by: Zebediah Figura Signed-off-by: Zebediah Figura Co-developed-by: Steven Noonan Signed-off-by: Steven Noonan Co-developed-by: Pierre-Loup A. Griffais Signed-off-by: Pierre-Loup A. Griffais Signed-off-by: Gabriel Krisman Bertazi [Added compatibility code] Co-developed-by: André Almeida Signed-off-by: André Almeida Signed-off-by: Alexandre Frade commit a338e0267fd3c0b342073d11dd8e2c471baef0f1 Author: Arjan van de Ven Date: Sun Feb 18 23:35:41 2018 +0000 locking: rwsem: spin faster tweak rwsem owner spinning a bit commit 0a586b7b81c1181a8511e672bf63a001381c4838 Author: William Douglas Date: Wed Jun 20 17:23:21 2018 +0000 firmware: Enable stateless firmware loading Prefer the order of specific version before generic and /etc before /lib to enable the user to give specific overrides for generic firmware and distribution firmware. commit a51dd0a1ad2348a6da692632fa5d728aac64a09c Author: Arjan van de Ven Date: Thu Jun 2 23:36:32 2016 -0500 drivers: Initialize ata before graphics ATA init is the long pole in the boot process, and its asynchronous. move the graphics init after it so that ata and graphics initialize in parallel commit d4a7896c4e57872d0b45affda45fa14ddecd256a Author: Arjan van de Ven Date: Sun Sep 22 11:12:35 2019 -0300 intel_rapl: Silence rapl trace debug commit f9bf0a911ee632fc8d4326b3e7cacc3065e92cf0 Author: Ben Hutchings Date: Tue Jun 26 16:59:01 2018 +0100 android: Export symbols needed by Android drivers We want to enable use of the Android ashmem and binder drivers to support Anbox, but they should not be built-in as that would waste resources and increase security attack surface on systems that don't need them. Export the currently un-exported symbols they depend on. commit a01591c0dad5decd177f569b40931b1e8159ade4 Author: Ben Hutchings Date: Fri Jun 22 17:27:00 2018 +0100 android: Enable building ashmem and binder as modules We want to enable use of the Android ashmem and binder drivers to support Anbox, but they should not be built-in as that would waste resources and increase security attack surface on systems that don't need them. - Add a MODULE_LICENSE declaration to ashmem - Change the Makefiles to build each driver as an object with the "_linux" suffix (which is what Anbox expects) - Change config symbol types to tristate commit ca41312aa12bf9387737a7938c6b8209e3c48578 Author: Ben Hutchings Date: Wed Mar 16 03:17:06 2011 +0000 sched: Do not enable autogrouping by default We want to provide the option of autogrouping but without enabling it by default yet. commit e6c9eab975aafc1559310c7a1ad48565313bc259 Author: Scott James Remnant Date: Tue Oct 27 10:05:32 2009 +0000 UBUNTU: SAUCE: (no-up) trace: add trace events for open(), exec() and uselib() (for v3.7+) BugLink: http://bugs.launchpad.net/bugs/462111 This patch uses TRACE_EVENT to add tracepoints for the open(), exec() and uselib() syscalls so that ureadahead can cheaply trace the boot sequence to determine what to read to speed up the next. It's not upstream because it will need to be rebased onto the syscall trace events whenever that gets merged, and is a stop-gap. [apw@canonical.com: updated for v3.7 and later.] [apw@canonical.com: updated for v3.19 and later.] BugLink: http://bugs.launchpad.net/bugs/1085766 Signed-off-by: Scott James Remnant Acked-by: Stefan Bader Acked-by: Andy Whitcroft Signed-off-by: Stefan Bader Conflicts: fs/open.c Signed-off-by: Tim Gardner commit f96ebf3201d57fbeba9a3c8ff6ce1f0eeae4f8ff Author: Alexandre Frade Date: Mon Jan 29 18:29:13 2018 +0000 sched/core: nr_migrate = 256 increases number of tasks to iterate in a single balance run. Signed-off-by: Alexandre Frade commit b903138dfd8d26ed75342c76ff52150ce486cb32 Author: Alexandre Frade Date: Wed Oct 24 16:58:52 2018 -0300 net/sched: allow configuring cake qdisc as default Signed-off-by: Alexandre Frade commit 5d4adf29ce28d93516dfa475b12562c00527bca7 Author: Alexandre Frade Date: Tue Jul 18 01:34:22 2017 +0000 cpufreq: intel_pstate: Set default cpufreq_driver to intel_cpufreq for intel p-state Signed-off-by: Alexandre Frade commit 2c1c416ed87477be5c07249a94c0fb15eb056355 Author: Alexandre Frade Date: Tue Mar 31 13:32:08 2020 -0300 cpufreq: tunes ondemand and conservative governor for performance Signed-off-by: Alexandre Frade commit e63fb0aa0b892c2358b1cf9b7d132b7c0f0cd2fb Author: Alexandre Frade Date: Mon Jan 29 17:41:29 2018 +0000 scripts: disable the localversion "+" tag of a git repo Signed-off-by: Alexandre Frade commit 0c77b0ae26067214f4cdc9bb782833880591e176 Author: Mark Weiman Date: Sun Aug 12 11:36:21 2018 -0400 pci: Enable overrides for missing ACS capabilities This an updated version of Alex Williamson's patch from: https://lkml.org/lkml/2013/5/30/513 Original commit message follows: PCIe ACS (Access Control Services) is the PCIe 2.0+ feature that allows us to control whether transactions are allowed to be redirected in various subnodes of a PCIe topology. For instance, if two endpoints are below a root port or downsteam switch port, the downstream port may optionally redirect transactions between the devices, bypassing upstream devices. The same can happen internally on multifunction devices. The transaction may never be visible to the upstream devices. One upstream device that we particularly care about is the IOMMU. If a redirection occurs in the topology below the IOMMU, then the IOMMU cannot provide isolation between devices. This is why the PCIe spec encourages topologies to include ACS support. Without it, we have to assume peer-to-peer DMA within a hierarchy can bypass IOMMU isolation. Unfortunately, far too many topologies do not support ACS to make this a steadfast requirement. Even the latest chipsets from Intel are only sporadically supporting ACS. We have trouble getting interconnect vendors to include the PCIe spec required PCIe capability, let alone suggested features. Therefore, we need to add some flexibility. The pcie_acs_override= boot option lets users opt-in specific devices or sets of devices to assume ACS support. The "downstream" option assumes full ACS support on root ports and downstream switch ports. The "multifunction" option assumes the subset of ACS features available on multifunction endpoints and upstream switch ports are supported. The "id:nnnn:nnnn" option enables ACS support on devices matching the provided vendor and device IDs, allowing more strategic ACS overrides. These options may be combined in any order. A maximum of 16 id specific overrides are available. It's suggested to use the most limited set of options necessary to avoid completely disabling ACS across the topology. Note to hardware vendors, we have facilities to permanently quirk specific devices which enforce isolation but not provide an ACS capability. Please contact me to have your devices added and save your customers the hassle of this boot option. Signed-off-by: Mark Weiman Signed-off-by: Alexandre Frade commit f5b836ef789db0c07dfc10244a7b4a3dd85cc387 Author: Alexandre Frade Date: Mon Jan 29 17:31:25 2018 +0000 mm/vmscan: vm_swappiness = 30 decreases the amount of swapping Signed-off-by: Alexandre Frade commit 654b7b2b0b3fbe70d9fe02763c7d1d75a08aad35 Author: Alexandre Frade Date: Mon Jan 29 16:59:22 2018 +0000 dcache: cache_pressure = 50 decreases the rate at which VFS caches are reclaimed Signed-off-by: Alexandre Frade commit a4278baeb5495d952c59e6d79c62870df26ce516 Author: Alexandre Frade Date: Sun Oct 13 03:10:39 2019 -0300 kconfig: set PREEMPT and RCU_BOOST without delay by default Signed-off-by: Alexandre Frade commit 540c89003321c23329317f54a5b931813989006e Author: Alexandre Frade Date: Mon Jan 29 17:26:15 2018 +0000 kconfig: add 500Hz timer interrupt kernel config option Signed-off-by: Alexandre Frade commit 67442e853c17cce98efd475f3a88c290d14cb957 Author: Alexandre Frade Date: Fri May 10 14:32:50 2019 -0300 mm: set 2 megabytes for address_space-level file read-ahead pages size Signed-off-by: Alexandre Frade commit d6732f2453e1993daa571c52d4721705239820d0 Author: Alexandre Frade Date: Fri May 10 16:45:59 2019 -0300 block: set rq_affinity = 2 for full multithreading I/O requests Signed-off-by: Alexandre Frade commit 81b0a15cf90b81c768f59ef7b52f68624d6bc20b Author: Alexandre Frade Date: Mon Nov 25 15:13:06 2019 -0300 elevator: set default scheduler to bfq for blk-mq Signed-off-by: Alexandre Frade commit d79f7a7aa42819c7a57aaed9df1caddd23afc760 Author: J. R. Okajima Date: Mon Jun 1 17:15:16 2020 -0300 fs: Introduce the Advanced Multi Layered Unification Filesystem v5.x-rcN 20200518 commit 3d77e6a8804abcc0504c904bd6e5cdf3a5cf8162 Author: Linus Torvalds Date: Sun May 31 16:49:15 2020 -0700 Linux 5.7