$ git diff --patch-with-stat --summary 22e2c1b117e4c16ee6dfe272b65b61fe9cf90763..81c9b6d14a8f7d547f4b9a935c39f8d18a2c34dd
.abf.yml | 6 +-
0001-Fix-for-compilation-with-clang.patch | 42 -
...ld-LLVMLinux-Set-compiler-flags-for-clang.patch | 59 -
...inux-Remove-warning-from-COMPATIBLE_IOCTL.patch | 37 -
...Linux-Add-support-for-generating-LLVM-bit.patch | 94 -
...Linux-Make-asm-offset-generation-work-wit.patch | 121 -
...VMLinux-Remove-nested-function-from-bcach.patch | 65 -
0006-apparmor-LLVMLinux-Remove-VLAIS.patch | 108 -
...inux-Remove-VLAIS-from-exofs-FIXME-Check-.patch | 91 -
...LLVMLinux-Remove-VLAIS-from-raid10-driver.patch | 60 -
0009-fs-nfs-LLVMLinux-Remove-VLAIS-from-nfs.patch | 52 -
...2400-LLVMLinux-Remove-VLAIS-from-wimax-i2.patch | 40 -
...Linux-Use-Oz-instead-of-Os-when-using-cla.patch | 35 -
...x86-boot-LLVMLinux-Work-around-clang-PR39.patch | 71 -
...REAM-xen-LLVMLinux-Remove-VLAIS-from-xen-.patch | 76 -
...REAM-arm-LLVMLinux-Provide-__aeabi_-symbo.patch | 72 -
...REAM-arm-firmware-LLVMLinux-replace-naked.patch | 47 -
...ux-Remove-unreachable-from-naked-function.patch | 28 -
...nux-Fix-a-cast-to-type-not-present-in-uni.patch | 36 -
...nux-Fix-an-inline-asm-input-output-type-m.patch | 41 -
...nux-Silence-variable-self-assignment-warn.patch | 123 -
...nux-Silence-unicode-warnings-when-preproc.patch | 44 -
...ware-LLVMLinux-fix-EFI-libstub-with-clang.patch | 46 -
...pto-LLVMLinux-Fix-inline-assembly-for-cla.patch | 46 -
...MLinux-Make-spin_lock_prefetch-asm-code-c.patch | 34 -
...on-t-use-attribute-externally_visible-whe.patch | 33 -
...LLVMLinux-Fix-building-x86_64-AES-extensi.patch | 32 -
...ux-Qualify-mul-as-mulq-to-make-clang-happ.patch | 33 -
...Linux-Add-Werror-to-cc-option-in-order-to.patch | 55 -
...LLVMLinux-Check-for-compiler-support-of-f.patch | 37 -
0107-intel_idle-tweak-cpuidle-cstates.patch | 78 +-
4.14-C11.patch | 102 -
...itial-implementation-showing-black-screen.patch | 731 -----
...sh-Add-file-reading-and-picture-rendering.patch | 669 ----
...ootsplash-Flush-framebuffer-after-drawing.patch | 66 -
...3-04-13-bootsplash-Add-corner-positioning.patch | 215 --
...v3-05-13-bootsplash-Add-animation-support.patch | 327 --
...edraw-bootsplash-fully-on-console_unblank.patch | 79 -
...t-Add-keyboard-hook-to-disable-bootsplash.patch | 42 -
RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch | 21 -
...v3-09-13-fbcon-Disable-bootsplash-on-oops.patch | 21 -
...ntation-Add-bootsplash-main-documentation.patch | 321 --
...sh-sysfs-entries-to-load-and-unload-files.patch | 129 -
...ash-Add-a-basic-splash-file-creation-tool.patch | 511 ---
...Add-script-and-data-to-create-sample-file.patch | 162 -
...ble-building-ashmem-and-binder-as-modules.patch | 22 +-
common-desktop.config | 6 +-
common-server.config | 4 +
common.config | 18 +-
cpupower-gcc10.patch | 48 -
...rf-Reverse-a-ternary-to-make-sparse-happy.patch | 33 -
extra-wifi-drivers-port-to-5.6.patch | 412 +++
kernel-release-clang.spec | 189 +-
linux-5.6-fix-disassembler-4args-detection.patch | 13 +
uksm-5.5.patch => uksm-5.6.patch | 60 +-
...tualBox-guest-shared-folder-vboxsf-support.diff | 3370 --------------------
...ib-Add-support-for-ZSTD-compressed-kernel.patch | 710 -----
...86-Add-support-for-ZSTD-compressed-kernel.patch | 102 -
...-lib-prepare-zstd-for-preboot-environment.patch | 113 +
...ib-prepare-xxhash-for-preboot-environment.patch | 115 +
v3-3-8-lib-add-zstd-support-to-decompress.patch | 450 +++
...it-add-support-for-zstd-compressed-kernel.patch | 87 +
...add-support-for-zstd-compressed-initramfs.patch | 79 +
...x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch | 43 +
...86-Add-support-for-ZSTD-compressed-kernel.patch | 129 +
vbox-kernel-5.6.patch | 154 +
x86_64-common.config | 1 -
67 files changed, 1717 insertions(+), 9579 deletions(-)
delete mode 100644 0001-Fix-for-compilation-with-clang.patch
delete mode 100644 0001-kbuild-LLVMLinux-Set-compiler-flags-for-clang.patch
delete mode 100644 0002-fs-LLVMLinux-Remove-warning-from-COMPATIBLE_IOCTL.patch
delete mode 100644 0003-kbuild-LLVMLinux-Add-support-for-generating-LLVM-bit.patch
delete mode 100644 0004-kbuild-LLVMLinux-Make-asm-offset-generation-work-wit.patch
delete mode 100644 0005-md-sysfs-LLVMLinux-Remove-nested-function-from-bcach.patch
delete mode 100644 0006-apparmor-LLVMLinux-Remove-VLAIS.patch
delete mode 100644 0007-exofs-LLVMLinux-Remove-VLAIS-from-exofs-FIXME-Check-.patch
delete mode 100644 0008-md-raid10-LLVMLinux-Remove-VLAIS-from-raid10-driver.patch
delete mode 100644 0009-fs-nfs-LLVMLinux-Remove-VLAIS-from-nfs.patch
delete mode 100644 0010-net-wimax-i2400-LLVMLinux-Remove-VLAIS-from-wimax-i2.patch
delete mode 100644 0011-Kbuild-LLVMLinux-Use-Oz-instead-of-Os-when-using-cla.patch
delete mode 100644 0012-WORKAROUND-x86-boot-LLVMLinux-Work-around-clang-PR39.patch
delete mode 100644 0013-DO-NOT-UPSTREAM-xen-LLVMLinux-Remove-VLAIS-from-xen-.patch
delete mode 100644 0014-DO-NOT-UPSTREAM-arm-LLVMLinux-Provide-__aeabi_-symbo.patch
delete mode 100644 0015-DO-NOT-UPSTREAM-arm-firmware-LLVMLinux-replace-naked.patch
delete mode 100644 0016-arm-LLVMLinux-Remove-unreachable-from-naked-function.patch
delete mode 100644 0017-MIPS-LLVMLinux-Fix-a-cast-to-type-not-present-in-uni.patch
delete mode 100644 0018-MIPS-LLVMLinux-Fix-an-inline-asm-input-output-type-m.patch
delete mode 100644 0019-MIPS-LLVMLinux-Silence-variable-self-assignment-warn.patch
delete mode 100644 0020-MIPS-LLVMLinux-Silence-unicode-warnings-when-preproc.patch
delete mode 100644 0023-HACK-firmware-LLVMLinux-fix-EFI-libstub-with-clang.patch
delete mode 100644 0024-aarch64-crypto-LLVMLinux-Fix-inline-assembly-for-cla.patch
delete mode 100644 0025-aarch64-LLVMLinux-Make-spin_lock_prefetch-asm-code-c.patch
delete mode 100644 0026-LLVMLinux-Don-t-use-attribute-externally_visible-whe.patch
delete mode 100644 0027-x86-crypto-LLVMLinux-Fix-building-x86_64-AES-extensi.patch
delete mode 100644 0028-x86-LLVMLinux-Qualify-mul-as-mulq-to-make-clang-happ.patch
delete mode 100644 0029-kbuild-LLVMLinux-Add-Werror-to-cc-option-in-order-to.patch
delete mode 100644 0030-x86-kbuild-LLVMLinux-Check-for-compiler-support-of-f.patch
delete mode 100644 4.14-C11.patch
delete mode 100644 RFC-v3-01-13-bootsplash-Initial-implementation-showing-black-screen.patch
delete mode 100644 RFC-v3-02-13-bootsplash-Add-file-reading-and-picture-rendering.patch
delete mode 100644 RFC-v3-03-13-bootsplash-Flush-framebuffer-after-drawing.patch
delete mode 100644 RFC-v3-04-13-bootsplash-Add-corner-positioning.patch
delete mode 100644 RFC-v3-05-13-bootsplash-Add-animation-support.patch
delete mode 100644 RFC-v3-06-13-vt-Redraw-bootsplash-fully-on-console_unblank.patch
delete mode 100644 RFC-v3-07-13-vt-Add-keyboard-hook-to-disable-bootsplash.patch
delete mode 100644 RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch
delete mode 100644 RFC-v3-09-13-fbcon-Disable-bootsplash-on-oops.patch
delete mode 100644 RFC-v3-10-13-Documentation-Add-bootsplash-main-documentation.patch
delete mode 100644 RFC-v3-11-13-bootsplash-sysfs-entries-to-load-and-unload-files.patch
delete mode 100644 RFC-v3-12-13-tools-bootsplash-Add-a-basic-splash-file-creation-tool.patch
delete mode 100644 RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-file.patch
delete mode 100644 cpupower-gcc10.patch
delete mode 100644 drm-i915-perf-Reverse-a-ternary-to-make-sparse-happy.patch
create mode 100644 extra-wifi-drivers-port-to-5.6.patch
create mode 100644 linux-5.6-fix-disassembler-4args-detection.patch
rename uksm-5.5.patch => uksm-5.6.patch (99%)
delete mode 100644 v19-fs-Add-VirtualBox-guest-shared-folder-vboxsf-support.diff
delete mode 100644 v2-1-2-lib-Add-support-for-ZSTD-compressed-kernel.patch
delete mode 100644 v2-2-2-x86-Add-support-for-ZSTD-compressed-kernel.patch
create mode 100644 v3-1-8-lib-prepare-zstd-for-preboot-environment.patch
create mode 100644 v3-2-8-lib-prepare-xxhash-for-preboot-environment.patch
create mode 100644 v3-3-8-lib-add-zstd-support-to-decompress.patch
create mode 100644 v3-4-8-init-add-support-for-zstd-compressed-kernel.patch
create mode 100644 v3-5-8-usr-add-support-for-zstd-compressed-initramfs.patch
create mode 100644 v3-6-8-x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch
create mode 100644 v3-7-8-x86-Add-support-for-ZSTD-compressed-kernel.patch
create mode 100644 vbox-kernel-5.6.patch
diff --git a/.abf.yml b/.abf.yml
index 9f605e4..91496e4 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,6 +1,6 @@
sources:
- linux-5.5.tar.sign: f35b5fc2dc4291744968b2725229dbe2444ed493
- linux-5.5.tar.xz: 527d2b01ecb9223ee041ba4b5d703cfe739783b2
+ linux-5.6.tar.sign: b92ad28adf09ef8f72bc45ab48a3031e1a27495a
+ linux-5.6.tar.xz: 3957d9d71454c26048ce4c71774d21386ac72be6
saa716x-driver.tar.xz: f9b6ef1cd6f1f71f53d9a8aadfba2cf6b5c3d7b6
extra-wifi-drivers-20200301.tar.zst: 3390c738c7d91250714ce0f88d26371e93bc40b8
- patch-5.5.13.xz: eff7d6be2dfd49ab996069f85db2b374739ce1c6
+ patch-5.6.2.xz: 6349c06bc7591f60b9ad4294e7512d7eae5a61f4
diff --git a/0001-Fix-for-compilation-with-clang.patch b/0001-Fix-for-compilation-with-clang.patch
deleted file mode 100644
index b5da460..0000000
--- a/0001-Fix-for-compilation-with-clang.patch
+++ /dev/null
@@ -1,42 +0,0 @@
->From 14e1f86ad297cc3c2b575135699b8c08849d1c6a Mon Sep 17 00:00:00 2001
-From: Hans Petter Selasky <hps@selasky.org>
-Date: Tue, 25 Apr 2017 09:30:47 +0200
-Subject: [PATCH] Fix for compilation with clang
-
-The clang compiler treats the memory address of a structure field as
-tautologically true when compared to non-NULL. This breaks the macros
-in llist.h when compiled using clang. Fix this by not comparing the
-address of a structure field to NULL when determining the end of the
-llist. Refer to -Wtautological-pointer-compare in clang for more
-information.
-
-Signed-off-by: Hans Petter Selasky <hps@selasky.org>
----
- include/linux/llist.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/include/linux/llist.h b/include/linux/llist.h
-index 171baa90f6f6..76a6d618de75 100644
---- a/include/linux/llist.h
-+++ b/include/linux/llist.h
-@@ -126,7 +126,7 @@ static inline void init_llist_head(struct llist_head *list)
- */
- #define llist_for_each_entry(pos, node, member) \
- for ((pos) = llist_entry((node), typeof(*(pos)), member); \
-- &(pos)->member != NULL; \
-+ (pos) != llist_entry(NULL, typeof(*(pos)), member); \
- (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
-
- /**
-@@ -148,7 +148,7 @@ static inline void init_llist_head(struct llist_head *list)
- */
- #define llist_for_each_entry_safe(pos, n, node, member) \
- for (pos = llist_entry((node), typeof(*pos), member); \
-- &pos->member != NULL && \
-+ (pos) != llist_entry(NULL, typeof(*(pos)), member) && \
- (n = llist_entry(pos->member.next, typeof(*n), member), true); \
- pos = n)
-
---
-2.11.1
-
diff --git a/0001-kbuild-LLVMLinux-Set-compiler-flags-for-clang.patch b/0001-kbuild-LLVMLinux-Set-compiler-flags-for-clang.patch
deleted file mode 100644
index e906bf9..0000000
--- a/0001-kbuild-LLVMLinux-Set-compiler-flags-for-clang.patch
+++ /dev/null
@@ -1,59 +0,0 @@
---- linux-4.10/Makefile.1000~ 2017-04-25 20:31:43.347811443 +0200
-+++ linux-4.10/Makefile 2017-04-25 20:32:20.593089243 +0200
-@@ -375,6 +375,19 @@ LDFLAGS_vmlinux =
- CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
- CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
-
-+ifeq ($(cc-name),clang)
-+ifneq ($(CROSS_COMPILE),)
-+CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%))
-+GCC_TOOLCHAIN := $(dir $(CROSS_COMPILE))
-+endif
-+ifneq ($(GCC_TOOLCHAIN),)
-+CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)
-+endif
-+ifneq ($(IA),1)
-+CLANG_IA_FLAG := -fno-integrated-as
-+endif
-+CLANG_FLAGS := $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_IA_FLAG) -meabi gnu
-+endif
-
- # Use USERINCLUDE when you must reference the UAPI directories only.
- USERINCLUDE := \
-@@ -400,13 +413,13 @@ KBUILD_CPPFLAGS := -D__KERNEL__
- KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
- -fno-strict-aliasing -fno-common \
- -Werror-implicit-function-declaration \
-- -Wno-format-security \
-+ -Wno-format-security $(CLANG_FLAGS) \
- -std=gnu89 $(call cc-option,-fno-PIE)
-
-
- KBUILD_AFLAGS_KERNEL :=
- KBUILD_CFLAGS_KERNEL :=
--KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE)
-+KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) $(CLANG_FLAGS)
- KBUILD_AFLAGS_MODULE := -DMODULE
- KBUILD_CFLAGS_MODULE := -DMODULE
- KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
-@@ -700,9 +713,12 @@ KBUILD_CFLAGS += $(stackp-flag)
- ifeq ($(cc-name),clang)
- KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
- KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
-+KBUILD_CPPFLAGS += $(call cc-option,-fno-integrated-as,)
- KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
- KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
- KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
-+KBUILD_CFLAGS += $(call cc-disable-warning, asm-operand-widths)
-+KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
- # Quiet clang warning: comparison of unsigned expression < 0 is always false
- KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
- # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
-@@ -710,6 +726,7 @@ KBUILD_CFLAGS += $(call cc-disable-warni
- # See modpost pattern 2
- KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
- KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
-+KBUILD_CFLAGS += $(call cc-option, -fno-builtin)
- else
-
- # These warnings generated too much noise in a regular build.
diff --git a/0002-fs-LLVMLinux-Remove-warning-from-COMPATIBLE_IOCTL.patch b/0002-fs-LLVMLinux-Remove-warning-from-COMPATIBLE_IOCTL.patch
deleted file mode 100644
index dc11701..0000000
--- a/0002-fs-LLVMLinux-Remove-warning-from-COMPATIBLE_IOCTL.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 73207dae13dbf5219a244376e6d3d6bc59b0a56b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:06:22 +0100
-Subject: [PATCH 02/30] fs, LLVMLinux: Remove warning from COMPATIBLE_IOCTL
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-cmd in COMPATIBLE_IOCTL is always a u32, so cast it so there isn't a warning
-about an overflow in XFORM.
-
-Author: Mark Charlebois <charlebm@gmail.com>
-Signed-off-by: Mark Charlebois <charlebm@gmail.com>
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Acked-by: Arnd Bergmann <arnd@arndb.de>
----
- fs/compat_ioctl.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
-index 11d087b2b28e..6116d5275a3e 100644
---- a/fs/compat_ioctl.c
-+++ b/fs/compat_ioctl.c
-@@ -833,7 +833,7 @@ static int compat_ioctl_preallocate(struct file *file,
- */
- #define XFORM(i) (((i) ^ ((i) << 27) ^ ((i) << 17)) & 0xffffffff)
-
--#define COMPATIBLE_IOCTL(cmd) XFORM(cmd),
-+#define COMPATIBLE_IOCTL(cmd) XFORM((u32)cmd),
- /* ioctl should not be warned about even if it's not implemented.
- Valid reasons to use this:
- - It is implemented with ->compat_ioctl on some device, but programs
---
-2.11.0
-
diff --git a/0003-kbuild-LLVMLinux-Add-support-for-generating-LLVM-bit.patch b/0003-kbuild-LLVMLinux-Add-support-for-generating-LLVM-bit.patch
deleted file mode 100644
index f84f1f2..0000000
--- a/0003-kbuild-LLVMLinux-Add-support-for-generating-LLVM-bit.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 282c44dbde5c83338bd94bffe8a17390cc22b6fa Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:08:21 +0100
-Subject: [PATCH 03/30] kbuild, LLVMLinux: Add support for generating LLVM
- bitcode files
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add rules to kbuild in order to generate LLVM bitcode files with the .ll
-extension when using clang.
-
- # from c code
- CC=clang make kernel/pid.ll
-
- # from asm code
- CC=clang make arch/x86/kernel/preempt.ll
-
-Author: Vinicius Tinti <viniciustinti@gmail.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Behan Webster <behanw@converseincode.com>
----
- .gitignore | 1 +
- Makefile | 8 +++++++-
- scripts/Makefile.build | 14 ++++++++++++++
- 3 files changed, 22 insertions(+), 1 deletion(-)
-
-diff --git a/.gitignore b/.gitignore
-index c2ed4ecb0acd..0c39aa20b6ba 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -33,6 +33,7 @@
- *.lzo
- *.patch
- *.gcno
-+*.ll
- modules.builtin
- Module.symvers
- *.dwo
-diff --git a/Makefile b/Makefile
-index e3e8522f0322..0e76a1ea9cae 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1377,7 +1377,9 @@ help:
- @echo ' firmware_install- Install all firmware to INSTALL_FW_PATH'
- @echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
- @echo ' dir/ - Build all files in dir and below'
-- @echo ' dir/file.[ois] - Build specified target only'
-+ @echo ' dir/file.[oisS] - Build specified target only'
-+ @echo ' dir/file.ll - Build the LLVM bitcode file'
-+ @echo ' (requires compiler support for LLVM bitcode generation)'
- @echo ' dir/file.lst - Build specified mixed source/assembly target only'
- @echo ' (requires a recent binutils and recent build (System.map))'
- @echo ' dir/file.ko - Build module including final link'
-@@ -1665,6 +1667,10 @@ endif
- $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.symtypes: %.c prepare scripts FORCE
- $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-+%.ll: %.c prepare scripts FORCE
-+ $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-+%.ll: %.S prepare scripts FORCE
-+ $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-
- # Modules
- /: prepare scripts FORCE
-diff --git a/scripts/Makefile.build b/scripts/Makefile.build
-index d883116ebaa4..e5a28da2e6fa 100644
---- a/scripts/Makefile.build
-+++ b/scripts/Makefile.build
-@@ -177,6 +177,20 @@ cmd_cc_symtypes_c = \
- $(obj)/%.symtypes : $(src)/%.c FORCE
- $(call cmd,cc_symtypes_c)
-
-+# LLVM bitcode
-+# Generate .ll files from .s and .c
-+quiet_cmd_cc_ll_c = CC $(quiet_modtag) $@
-+ cmd_cc_ll_c = $(CC) $(c_flags) -emit-llvm -S -o $@ $<
-+
-+$(obj)/%.ll: $(src)/%.c FORCE
-+ $(call if_changed_dep,cc_ll_c)
-+
-+quiet_cmd_as_ll_S = CPP $(quiet_modtag) $@
-+ cmd_as_ll_S = $(CPP) $(a_flags) -o $@ $<
-+
-+$(obj)/%.ll: $(src)/%.S FORCE
-+ $(call if_changed_dep,as_ll_S)
-+
- # C (.c) files
- # The C file is compiled and updated dependency information is generated.
- # (See cmd_cc_o_c + relevant part of rule_cc_o_c)
---
-2.11.0
-
diff --git a/0004-kbuild-LLVMLinux-Make-asm-offset-generation-work-wit.patch b/0004-kbuild-LLVMLinux-Make-asm-offset-generation-work-wit.patch
deleted file mode 100644
index ac4b7b1..0000000
--- a/0004-kbuild-LLVMLinux-Make-asm-offset-generation-work-wit.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From d2699a2c0021c7837bc871a34b82419a0e178fa2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:18:44 +0100
-Subject: [PATCH 04/30] kbuild, LLVMLinux: Make asm-offset generation work with
- clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When using clang with -fno-integerated-as, clang will use the gnu assembler
-instead of the integrated assembler. However clang will still perform asm
-error checking before sending the inline assembly language to gas.
-
-The generation of asm-offsets from within C code is dependent on gcc's blind
-passing of whatever is in asm() through to gas. Arbirary text is
-passed through which is then modified by a sed script into the appropriate .h
-and .S code. Since the arbitrary text is not valid assembly language, clang fails.
-
-This can be fixed by making the arbitrary text into an ASM comment and then
-updating the sed scripts accordingly to work as expected.
-
-This solution works for both gcc and clang.
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
-Reviewed-by: Mark Charlebois <charlebm@gmail.com>
-Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
-Cc: Jan Moskyto Matejka <mq@suse.cz>
-Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-Cc: "H. Peter Anvin" <hpa@linux.intel.com>
-Cc: Tom Gundersen <teg@jklm.no>
-Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
-Cc: Arnd Bergmann <arnd@arndb.de>
----
- Kbuild | 25 +++++++++++++++++++++++++
- include/linux/kbuild.h | 6 +++---
- scripts/mod/Makefile | 8 ++++----
- 3 files changed, 32 insertions(+), 7 deletions(-)
-
-diff --git a/Kbuild b/Kbuild
-index 3d0ae152af7c..0a4022da6b6e 100644
---- a/Kbuild
-+++ b/Kbuild
-@@ -75,6 +75,31 @@ offsets-file := include/generated/asm-offsets.h
- always += $(offsets-file)
- targets += arch/$(SRCARCH)/kernel/asm-offsets.s
-
-+# Default sed regexp - multiline due to syntax constraints
-+define sed-y
-+ "/^@->/{s:@->#\(.*\):/* \1 */:; \
-+ s:^@->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-+ s:^@->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-+ s:@->::; p;}"
-+endef
-+
-+quiet_cmd_offsets = GEN $@
-+define cmd_offsets
-+ (set -e; \
-+ echo "#ifndef __ASM_OFFSETS_H__"; \
-+ echo "#define __ASM_OFFSETS_H__"; \
-+ echo "/*"; \
-+ echo " * DO NOT MODIFY."; \
-+ echo " *"; \
-+ echo " * This file was generated by Kbuild"; \
-+ echo " *"; \
-+ echo " */"; \
-+ echo ""; \
-+ sed -ne $(sed-y) $<; \
-+ echo ""; \
-+ echo "#endif" ) > $@
-+endef
-+
- # We use internal kbuild rules to avoid the "is up to date" message from make
- arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
- $(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
-diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h
-index 22a72198c14b..75fa2c3e0e1d 100644
---- a/include/linux/kbuild.h
-+++ b/include/linux/kbuild.h
-@@ -2,14 +2,14 @@
- #define __LINUX_KBUILD_H
-
- #define DEFINE(sym, val) \
-- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
-+ asm volatile("\n@->" #sym " %0 " #val : : "i" (val))
-
--#define BLANK() asm volatile("\n->" : : )
-+#define BLANK() asm volatile("\n@->" : : )
-
- #define OFFSET(sym, str, mem) \
- DEFINE(sym, offsetof(struct str, mem))
-
- #define COMMENT(x) \
-- asm volatile("\n->#" x)
-+ asm volatile("\n@->#" x)
-
- #endif
-diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
-index 19d9bcadc0cc..c3db2fa31052 100644
---- a/scripts/mod/Makefile
-+++ b/scripts/mod/Makefile
-@@ -8,10 +8,10 @@ modpost-objs := modpost.o file2alias.o sumversion.o
- devicetable-offsets-file := devicetable-offsets.h
-
- define sed-y
-- "/^->/{s:->#\(.*\):/* \1 */:; \
-- s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-- s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-- s:->::; p;}"
-+ "/^@->/{s:@->#\(.*\):/* \1 */:; \
-+ s:^@->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
-+ s:^@->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
-+ s:@->::; p;}"
- endef
-
- quiet_cmd_offsets = GEN $@
---
-2.11.0
-
diff --git a/0005-md-sysfs-LLVMLinux-Remove-nested-function-from-bcach.patch b/0005-md-sysfs-LLVMLinux-Remove-nested-function-from-bcach.patch
deleted file mode 100644
index a9b3e20..0000000
--- a/0005-md-sysfs-LLVMLinux-Remove-nested-function-from-bcach.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 36def6a1b04411fb3b0ae97871c4308a59d6350a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:20:49 +0100
-Subject: [PATCH 05/30] md, sysfs, LLVMLinux: Remove nested function from
- bcache sysfs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Replace the use of nested functions where a normal function will suffice.
-
-Nested functions are not liked by upstream kernel developers in general. Their
-use breaks the use of clang as a compiler, and doesn't make the code any
-better.
-
-This code now works for both gcc and clang.
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Reviewed-by: Mark Charlebois <charlebm@gmail.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- drivers/md/bcache/sysfs.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
-index b3ff57d61dde..53d8baa741fb 100644
---- a/drivers/md/bcache/sysfs.c
-+++ b/drivers/md/bcache/sysfs.c
-@@ -731,6 +731,11 @@ static struct attribute *bch_cache_set_internal_files[] = {
- };
- KTYPE(bch_cache_set_internal);
-
-+static int __bch_cache_cmp(const void *l, const void *r)
-+{
-+ return *((uint16_t *) r) - *((uint16_t *) l);
-+}
-+
- SHOW(__bch_cache)
- {
- struct cache *ca = container_of(kobj, struct cache, kobj);
-@@ -755,9 +760,6 @@ SHOW(__bch_cache)
- CACHE_REPLACEMENT(&ca->sb));
-
- if (attr == &sysfs_priority_stats) {
-- int cmp(const void *l, const void *r)
-- { return *((uint16_t *) r) - *((uint16_t *) l); }
--
- struct bucket *b;
- size_t n = ca->sb.nbuckets, i;
- size_t unused = 0, available = 0, dirty = 0, meta = 0;
-@@ -786,7 +788,7 @@ SHOW(__bch_cache)
- p[i] = ca->buckets[i].prio;
- mutex_unlock(&ca->set->bucket_lock);
-
-- sort(p, n, sizeof(uint16_t), cmp, NULL);
-+ sort(p, n, sizeof(uint16_t), __bch_cache_cmp, NULL);
-
- while (n &&
- !cached[n - 1])
---
-2.11.0
-
diff --git a/0006-apparmor-LLVMLinux-Remove-VLAIS.patch b/0006-apparmor-LLVMLinux-Remove-VLAIS.patch
deleted file mode 100644
index 9fde18d..0000000
--- a/0006-apparmor-LLVMLinux-Remove-VLAIS.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From de33aa01ff91fb63a9a22f362135b9aeb56b5ccc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:22:50 +0100
-Subject: [PATCH 06/30] apparmor, LLVMLinux: Remove VLAIS
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
-compliant equivalent. This patch instead allocates the appropriate amount of
-memory using a char array using the SHASH_DESC_ON_STACK macro.
-
-The new code can be compiled with both gcc and clang.
-
-Based on an older version by Vinicius Tinti <viniciustinti@gmail.com>
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
-Cc: Vinícius Tinti <viniciustinti@gmail.com>
-Cc: Jan-Simon Möller <dl9pf@gmx.de>
-Cc: Mark Charlebois <charlebm@gmail.com>
-Cc: Behan Webster <behanw@converseincode.com>
----
- security/apparmor/crypto.c | 36 +++++++++++++++++-------------------
- 1 file changed, 17 insertions(+), 19 deletions(-)
-
-diff --git a/security/apparmor/crypto.c b/security/apparmor/crypto.c
-index de8dc78b6144..198c10b2f46c 100644
---- a/security/apparmor/crypto.c
-+++ b/security/apparmor/crypto.c
-@@ -31,10 +31,6 @@ unsigned int aa_hash_size(void)
-
- char *aa_calc_hash(void *data, size_t len)
- {
-- struct {
-- struct shash_desc shash;
-- char ctx[crypto_shash_descsize(apparmor_tfm)];
-- } desc;
- char *hash = NULL;
- int error = -ENOMEM;
-
-@@ -45,16 +41,19 @@ char *aa_calc_hash(void *data, size_t len)
- if (!hash)
- goto fail;
-
-- desc.shash.tfm = apparmor_tfm;
-- desc.shash.flags = 0;
-+ SHASH_DESC_ON_STACK(shash, apparmor_tfm);
-+ if (!shash)
-+ goto fail;
-+ shash->tfm = apparmor_tfm;
-+ shash->flags = 0;
-
-- error = crypto_shash_init(&desc.shash);
-+ error = crypto_shash_init(shash);
- if (error)
- goto fail;
-- error = crypto_shash_update(&desc.shash, (u8 *) data, len);
-+ error = crypto_shash_update(shash, (u8 *) data, len);
- if (error)
- goto fail;
-- error = crypto_shash_final(&desc.shash, hash);
-+ error = crypto_shash_final(shash, hash);
- if (error)
- goto fail;
-
-@@ -69,10 +68,6 @@ char *aa_calc_hash(void *data, size_t len)
- int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start,
- size_t len)
- {
-- struct {
-- struct shash_desc shash;
-- char ctx[crypto_shash_descsize(apparmor_tfm)];
-- } desc;
- int error = -ENOMEM;
- __le32 le32_version = cpu_to_le32(version);
-
-@@ -86,19 +81,22 @@ int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start,
- if (!profile->hash)
- goto fail;
-
-- desc.shash.tfm = apparmor_tfm;
-- desc.shash.flags = 0;
-+ SHASH_DESC_ON_STACK(shash, apparmor_tfm);
-+ if (!shash)
-+ goto fail;
-+ shash->tfm = apparmor_tfm;
-+ shash->flags = 0;
-
-- error = crypto_shash_init(&desc.shash);
-+ error = crypto_shash_init(shash);
- if (error)
- goto fail;
-- error = crypto_shash_update(&desc.shash, (u8 *) &le32_version, 4);
-+ error = crypto_shash_update(shash, (u8 *) &le32_version, 4);
- if (error)
- goto fail;
-- error = crypto_shash_update(&desc.shash, (u8 *) start, len);
-+ error = crypto_shash_update(shash, (u8 *) start, len);
- if (error)
- goto fail;
-- error = crypto_shash_final(&desc.shash, profile->hash);
-+ error = crypto_shash_final(shash, profile->hash);
- if (error)
- goto fail;
-
---
-2.11.0
-
diff --git a/0007-exofs-LLVMLinux-Remove-VLAIS-from-exofs-FIXME-Check-.patch b/0007-exofs-LLVMLinux-Remove-VLAIS-from-exofs-FIXME-Check-.patch
deleted file mode 100644
index 9f8fffd..0000000
--- a/0007-exofs-LLVMLinux-Remove-VLAIS-from-exofs-FIXME-Check-.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 1cbc1d31554f7e80ab76442c8e5d72007ba4d16b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:23:43 +0100
-Subject: [PATCH 07/30] exofs, LLVMLinux: Remove VLAIS from exofs FIXME Check
- __weak and BROKEN fragment
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This makes it possible to build exofs with clang.
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- fs/exofs/Kconfig | 2 +-
- fs/exofs/common.h | 2 +-
- fs/exofs/super.c | 21 +++++++++------------
- 3 files changed, 11 insertions(+), 14 deletions(-)
-
-diff --git a/fs/exofs/Kconfig b/fs/exofs/Kconfig
-index 86194b2f799d..492746f9e61b 100644
---- a/fs/exofs/Kconfig
-+++ b/fs/exofs/Kconfig
-@@ -1,6 +1,6 @@
- config EXOFS_FS
- tristate "exofs: OSD based file system support"
-- depends on SCSI_OSD_ULD
-+ depends on SCSI_OSD_ULD && BROKEN
- help
- EXOFS is a file system that uses an OSD storage device,
- as its backing storage.
-diff --git a/fs/exofs/common.h b/fs/exofs/common.h
-index 7d88ef566213..9fdf02333c20 100644
---- a/fs/exofs/common.h
-+++ b/fs/exofs/common.h
-@@ -183,7 +183,7 @@ struct exofs_fcb {
- #define EXOFS_INO_ATTR_SIZE sizeof(struct exofs_fcb)
-
- /* This is the Attribute the fcb is stored in */
--static const struct __weak osd_attr g_attr_inode_data = ATTR_DEF(
-+static const struct osd_attr g_attr_inode_data __maybe_unused = ATTR_DEF(
- EXOFS_APAGE_FS_DATA,
- EXOFS_ATTR_INODE_DATA,
- EXOFS_INO_ATTR_SIZE);
-diff --git a/fs/exofs/super.c b/fs/exofs/super.c
-index 1076a4233b39..410572994dad 100644
---- a/fs/exofs/super.c
-+++ b/fs/exofs/super.c
-@@ -546,27 +546,24 @@ static int exofs_devs_2_odi(struct exofs_dt_device_info *dt_dev,
- static int __alloc_dev_table(struct exofs_sb_info *sbi, unsigned numdevs,
- struct exofs_dev **peds)
- {
-- struct __alloc_ore_devs_and_exofs_devs {
-- /* Twice bigger table: See exofs_init_comps() and comment at
-- * exofs_read_lookup_dev_table()
-- */
-- struct ore_dev *oreds[numdevs * 2 - 1];
-- struct exofs_dev eds[numdevs];
-- } *aoded;
- struct exofs_dev *eds;
- unsigned i;
-
-- aoded = kzalloc(sizeof(*aoded), GFP_KERNEL);
-- if (unlikely(!aoded)) {
-+ /* Twice bigger table: See exofs_init_comps() and comment at
-+ * exofs_read_lookup_dev_table()
-+ * XXX: why -1?
-+ */
-+ sbi->oc.ods = kzalloc(sizeof(struct ore_dev) * (numdevs * 2 - 1) +
-+ sizeof(struct exofs_dev) * numdevs, GFP_KERNEL);
-+ if (unlikely(!sbi->oc.ods)) {
- EXOFS_ERR("ERROR: failed allocating Device array[%d]\n",
- numdevs);
- return -ENOMEM;
- }
-
-- sbi->oc.ods = aoded->oreds;
-- *peds = eds = aoded->eds;
-+ *peds = eds = (void *)sbi->oc.ods[numdevs * 2 - 1];
- for (i = 0; i < numdevs; ++i)
-- aoded->oreds[i] = &eds[i].ored;
-+ sbi->oc.ods[i] = &eds[i].ored;
- return 0;
- }
-
---
-2.11.0
-
diff --git a/0008-md-raid10-LLVMLinux-Remove-VLAIS-from-raid10-driver.patch b/0008-md-raid10-LLVMLinux-Remove-VLAIS-from-raid10-driver.patch
deleted file mode 100644
index f6d04c5..0000000
--- a/0008-md-raid10-LLVMLinux-Remove-VLAIS-from-raid10-driver.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 3e8d39cf8c7295e00c45d071f5aa02ca30bcd12b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:26:19 +0100
-Subject: [PATCH 08/30] md, raid10, LLVMLinux: Remove VLAIS from raid10 driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- drivers/md/raid10.c | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
-index 6bc5c2a85160..5d3bda466795 100644
---- a/drivers/md/raid10.c
-+++ b/drivers/md/raid10.c
-@@ -4655,15 +4655,16 @@ static int handle_reshape_read_error(struct mddev *mddev,
- /* Use sync reads to get the blocks from somewhere else */
- int sectors = r10_bio->sectors;
- struct r10conf *conf = mddev->private;
-- struct {
-- struct r10bio r10_bio;
-- struct r10dev devs[conf->copies];
-- } on_stack;
-- struct r10bio *r10b = &on_stack.r10_bio;
-+ struct r10bio *r10b;
-+
- int slot = 0;
- int idx = 0;
- struct bio_vec *bvec = r10_bio->master_bio->bi_io_vec;
-
-+ r10b = kmalloc(sizeof *r10b + conf->copies * sizeof(struct r10dev),
-+ GFP_NOIO);
-+ if (!r10b)
-+ return -ENOMEM;
- r10b->sector = r10_bio->sector;
- __raid10_find_phys(&conf->prev, r10b);
-
-@@ -4709,11 +4710,13 @@ static int handle_reshape_read_error(struct mddev *mddev,
- /* couldn't read this block, must give up */
- set_bit(MD_RECOVERY_INTR,
- &mddev->recovery);
-+ kfree(r10b);
- return -EIO;
- }
- sectors -= s;
- idx++;
- }
-+ kfree(r10b);
- return 0;
- }
-
---
-2.11.0
-
diff --git a/0009-fs-nfs-LLVMLinux-Remove-VLAIS-from-nfs.patch b/0009-fs-nfs-LLVMLinux-Remove-VLAIS-from-nfs.patch
deleted file mode 100644
index 9c0bd71..0000000
--- a/0009-fs-nfs-LLVMLinux-Remove-VLAIS-from-nfs.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 153e6af02a2e67b7c6eb6022d24aba65c8089fbd Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:29:09 +0100
-Subject: [PATCH 09/30] fs, nfs, LLVMLinux: Remove VLAIS from nfs
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- fs/nfs/Kconfig | 2 +-
- fs/nfs/objlayout/objio_osd.c | 5 +++--
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
-index f31fd0dd92c6..e6ef7b3725db 100644
---- a/fs/nfs/Kconfig
-+++ b/fs/nfs/Kconfig
-@@ -125,7 +125,7 @@ config PNFS_BLOCK
-
- config PNFS_OBJLAYOUT
- tristate
-- depends on NFS_V4_1 && SCSI_OSD_ULD
-+ depends on NFS_V4_1 && SCSI_OSD_ULD && BROKEN
- default NFS_V4
-
- config PNFS_FLEXFILE_LAYOUT
-diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
-index 049c1b1f2932..5963c1c83c8c 100644
---- a/fs/nfs/objlayout/objio_osd.c
-+++ b/fs/nfs/objlayout/objio_osd.c
-@@ -301,10 +301,11 @@ objio_alloc_io_state(struct pnfs_layout_hdr *pnfs_layout_type, bool is_reading,
- int ret;
- struct __alloc_objio_state {
- struct objio_state objios;
-- struct pnfs_osd_ioerr ioerrs[objio_seg->oc.numdevs];
-+ struct pnfs_osd_ioerr ioerrs[];
- } *aos;
-
-- aos = kzalloc(sizeof(*aos), gfp_flags);
-+ aos = kzalloc(sizeof(*aos) + objio_seg->oc.numdevs *
-+ sizeof(struct pnfs_osd_ioerr), gfp_flags);
- if (unlikely(!aos))
- return -ENOMEM;
-
---
-2.11.0
-
diff --git a/0010-net-wimax-i2400-LLVMLinux-Remove-VLAIS-from-wimax-i2.patch b/0010-net-wimax-i2400-LLVMLinux-Remove-VLAIS-from-wimax-i2.patch
deleted file mode 100644
index a47e049..0000000
--- a/0010-net-wimax-i2400-LLVMLinux-Remove-VLAIS-from-wimax-i2.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From cd38685e0a463234cc4a25ffe1cce639563779f8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:30:32 +0100
-Subject: [PATCH 10/30] net, wimax, i2400, LLVMLinux: Remove VLAIS from wimax
- i2400m driver
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert Variable Length Array in Struct (VLAIS) to valid C by converting
-local struct definition to use a flexible array. The structure is only
-used to define a cast of a buffer so the size of the struct is not used
-to allocate storage.
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Signed-off-by: Mark Charebois <charlebm@gmail.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- drivers/net/wimax/i2400m/fw.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
-index c9c711dcd0e6..a89b5685e68b 100644
---- a/drivers/net/wimax/i2400m/fw.c
-+++ b/drivers/net/wimax/i2400m/fw.c
-@@ -652,7 +652,7 @@ static int i2400m_download_chunk(struct i2400m *i2400m, const void *chunk,
- struct device *dev = i2400m_dev(i2400m);
- struct {
- struct i2400m_bootrom_header cmd;
-- u8 cmd_payload[chunk_len];
-+ u8 cmd_payload[];
- } __packed *buf;
- struct i2400m_bootrom_header ack;
-
---
-2.11.0
-
diff --git a/0011-Kbuild-LLVMLinux-Use-Oz-instead-of-Os-when-using-cla.patch b/0011-Kbuild-LLVMLinux-Use-Oz-instead-of-Os-when-using-cla.patch
deleted file mode 100644
index 62b4b90..0000000
--- a/0011-Kbuild-LLVMLinux-Use-Oz-instead-of-Os-when-using-cla.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 638df6b609af6cfacc3134137c7b513113a1676a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:32:12 +0100
-Subject: [PATCH 11/30] Kbuild, LLVMLinux: Use -Oz instead of -Os when using
- clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This generates smaller resulting object code when compiled with clang.
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 0e76a1ea9cae..a15d91aebe52 100644
---- a/Makefile
-+++ b/Makefile
-@@ -651,7 +651,8 @@ KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
- endif
-
- ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
--KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
-+KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
-+KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
- else
- ifdef CONFIG_PROFILE_ALL_BRANCHES
- KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
---
-2.11.0
-
diff --git a/0012-WORKAROUND-x86-boot-LLVMLinux-Work-around-clang-PR39.patch b/0012-WORKAROUND-x86-boot-LLVMLinux-Work-around-clang-PR39.patch
deleted file mode 100644
index 769ff06..0000000
--- a/0012-WORKAROUND-x86-boot-LLVMLinux-Work-around-clang-PR39.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 0b2388ba1b93f5fed9746a6f24a83e02c5548a62 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:33:18 +0100
-Subject: [PATCH 12/30] WORKAROUND x86, boot, LLVMLinux: Work around clang
- PR3997
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Clang's intrinsics ignore -mregparm=3 when they fall back to calling the
-out-of-line implementations. Putting the args on the stack when memcpy()
-expects them in registers is not a recipe for a happy kernel.
-
-This bites with -m32 too, so clang is presumably catastrophically
-broken for the i386 kernel until this is fixed, unless I'm missing
-something.
-
-For information/testing only; do not apply. With this, I can use
-'clang -m16' to build all the kernel's 16-bit code and get a successful
-boot.
-
-Not-signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-Forward-ported-by: Jan-Simon Möller <dl9pf@gmx.de>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/x86/boot/memory.c | 7 ++++++-
- arch/x86/boot/string.h | 2 ++
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
-index db75d07c3645..0a61ad084927 100644
---- a/arch/x86/boot/memory.c
-+++ b/arch/x86/boot/memory.c
-@@ -63,8 +63,13 @@ static int detect_memory_e820(void)
- count = 0;
- break;
- }
--
-+#ifdef __clang__
-+ /* PR18415, PR3997 */
-+ memcpy(desc, &buf, sizeof(*desc));
-+ desc++;
-+#else
- *desc++ = buf;
-+#endif
- count++;
- } while (ireg.ebx && count < ARRAY_SIZE(boot_params.e820_map));
-
-diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
-index 113588ddb43f..d03f4e21a7f3 100644
---- a/arch/x86/boot/string.h
-+++ b/arch/x86/boot/string.h
-@@ -10,6 +10,7 @@ void *memcpy(void *dst, const void *src, size_t len);
- void *memset(void *dst, int c, size_t len);
- int memcmp(const void *s1, const void *s2, size_t len);
-
-+#ifndef __clang__ /* PR3997, PR18415 */
- /*
- * Access builtin version by default. If one needs to use optimized version,
- * do "undef memcpy" in .c file and link against right string.c
-@@ -17,6 +18,7 @@ int memcmp(const void *s1, const void *s2, size_t len);
- #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
- #define memset(d,c,l) __builtin_memset(d,c,l)
- #define memcmp __builtin_memcmp
-+#endif
-
- extern int strcmp(const char *str1, const char *str2);
- extern int strncmp(const char *cs, const char *ct, size_t count);
---
-2.11.0
-
diff --git a/0013-DO-NOT-UPSTREAM-xen-LLVMLinux-Remove-VLAIS-from-xen-.patch b/0013-DO-NOT-UPSTREAM-xen-LLVMLinux-Remove-VLAIS-from-xen-.patch
deleted file mode 100644
index c78c351..0000000
--- a/0013-DO-NOT-UPSTREAM-xen-LLVMLinux-Remove-VLAIS-from-xen-.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From e1be0e294634148b3b538d303bc6291b2d6cf801 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Vin=C3=ADcius=20Tinti?= <viniciustinti@gmail.com>
-Date: Sun, 14 Dec 2014 00:19:00 -0200
-Subject: [PATCH 13/30] DO-NOT-UPSTREAM xen, LLVMLinux: Remove VLAIS from xen
- mmu
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Vinícius Tinti <viniciustinti@gmail.com>
----
- arch/x86/xen/mmu.c | 35 ++++++++++++++++++-----------------
- 1 file changed, 18 insertions(+), 17 deletions(-)
-
-diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
-index f6740b5b1738..5adf2b65f1fb 100644
---- a/arch/x86/xen/mmu.c
-+++ b/arch/x86/xen/mmu.c
-@@ -1375,36 +1375,37 @@ static void xen_flush_tlb_others(const struct cpumask *cpus,
- struct mm_struct *mm, unsigned long start,
- unsigned long end)
- {
-- struct {
-- struct mmuext_op op;
--#ifdef CONFIG_SMP
-- DECLARE_BITMAP(mask, num_processors);
--#else
-- DECLARE_BITMAP(mask, NR_CPUS);
--#endif
-- } *args;
- struct multicall_space mcs;
-+ struct mmuext_op *op;
-+ struct cpumask *mask;
-
- trace_xen_mmu_flush_tlb_others(cpus, mm, start, end);
-
- if (cpumask_empty(cpus))
- return; /* nothing to do */
-
-- mcs = xen_mc_entry(sizeof(*args));
-- args = mcs.args;
-- args->op.arg2.vcpumask = to_cpumask(args->mask);
-+#ifdef CONFIG_SMP
-+ mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(num_processors)*sizeof(unsigned long));
-+#else
-+ mcs = xen_mc_entry(sizeof(struct mmuext_op) + BITS_TO_LONGS(NR_CPUS)*sizeof(unsigned long));
-+#endif
-+ /* Extract fields */
-+ op = mcs.args;
-+ mask = to_cpumask(mcs.args + sizeof(struct mmuext_op));
-+
-+ op->arg2.vcpumask = mask;
-
- /* Remove us, and any offline CPUS. */
-- cpumask_and(to_cpumask(args->mask), cpus, cpu_online_mask);
-- cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask));
-+ cpumask_and(mask, cpus, cpu_online_mask);
-+ cpumask_clear_cpu(smp_processor_id(), mask);
-
-- args->op.cmd = MMUEXT_TLB_FLUSH_MULTI;
-+ op->cmd = MMUEXT_TLB_FLUSH_MULTI;
- if (end != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) {
-- args->op.cmd = MMUEXT_INVLPG_MULTI;
-- args->op.arg1.linear_addr = start;
-+ op->cmd = MMUEXT_INVLPG_MULTI;
-+ op->arg1.linear_addr = start;
- }
-
-- MULTI_mmuext_op(mcs.mc, &args->op, 1, NULL, DOMID_SELF);
-+ MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
-
- xen_mc_issue(PARAVIRT_LAZY_MMU);
- }
---
-2.11.0
-
diff --git a/0014-DO-NOT-UPSTREAM-arm-LLVMLinux-Provide-__aeabi_-symbo.patch b/0014-DO-NOT-UPSTREAM-arm-LLVMLinux-Provide-__aeabi_-symbo.patch
deleted file mode 100644
index 912d448..0000000
--- a/0014-DO-NOT-UPSTREAM-arm-LLVMLinux-Provide-__aeabi_-symbo.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From a4e5575ace4bd519270b1ff89a3e0ac069798966 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
- <Bernhard.Rosenkranzer@linaro.org>
-Date: Wed, 30 Mar 2016 00:57:50 +0200
-Subject: [PATCH 14/30] DO-NOT-UPSTREAM arm: LLVMLinux: Provide __aeabi_*
- symbols which are needed for clang
-
-These symbols are required when compiling the Linux kernel for arch ARM with
-clang.
-
-KernelVersion:
-Author: Mark Charlebois <charlebm@gmail.com>
-Signed-off-by: Mark Charlebois <charlebm@gmail.com>
-Not-signed-off-by: Behan Webster <behanw@converseincode.com>
----
- arch/arm/lib/Makefile | 4 ++++
- arch/arm/lib/eabi.c | 28 ++++++++++++++++++++++++++++
- 2 files changed, 32 insertions(+)
- create mode 100644 arch/arm/lib/eabi.c
-
-diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
-index 27f4d96258a2..53f1c85178a8 100644
---- a/arch/arm/lib/Makefile
-+++ b/arch/arm/lib/Makefile
-@@ -18,6 +18,10 @@ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
- mmu-y := clear_user.o copy_page.o getuser.o putuser.o \
- copy_from_user.o copy_to_user.o
-
-+ifeq ($(COMPILER),clang)
-+lib-y += eabi.o
-+endif
-+
- # using lib_ here won't override already available weak symbols
- obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
-
-diff --git a/arch/arm/lib/eabi.c b/arch/arm/lib/eabi.c
-new file mode 100644
-index 000000000000..636a403c9579
---- /dev/null
-+++ b/arch/arm/lib/eabi.c
-@@ -0,0 +1,28 @@
-+/*
-+ * EABI routines
-+ *
-+ * Copyright (C) 2012 Mark Charlebois
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/string.h>
-+#include <linux/ctype.h>
-+#include <linux/export.h>
-+
-+void __aeabi_memcpy(void *dest, const void *src, size_t n)
-+{
-+ (void)memcpy(dest, src, n);
-+}
-+EXPORT_SYMBOL(__aeabi_memcpy);
-+
-+void __aeabi_memmove(void *dest, const void *src, size_t n)
-+{
-+ (void)memmove(dest, src, n);
-+}
-+EXPORT_SYMBOL(__aeabi_memmove);
-+
-+void __aeabi_memset(void *s, size_t n, int c)
-+{
-+ (void)memset(s, c, n);
-+}
-+EXPORT_SYMBOL(__aeabi_memset);
---
-2.11.0
-
diff --git a/0015-DO-NOT-UPSTREAM-arm-firmware-LLVMLinux-replace-naked.patch b/0015-DO-NOT-UPSTREAM-arm-firmware-LLVMLinux-replace-naked.patch
deleted file mode 100644
index ab71d53..0000000
--- a/0015-DO-NOT-UPSTREAM-arm-firmware-LLVMLinux-replace-naked.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 5068a19bab6aff3cc63d2cde3e3ffff26e0fe9c5 Mon Sep 17 00:00:00 2001
-From: Behan Webster <behanw@converseincode.com>
-Date: Fri, 30 May 2014 11:35:50 -0700
-Subject: [PATCH 15/30] DO-NOT-UPSTREAM arm, firmware, LLVMLinux: replace naked
- function with hard coded parameters
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-As documented in GCC naked functions should only use Basic asm syntax. The
-Extended asm or mixture of Basic asm and "C" code is not guarantee. Currently
-this works because it was hard coded to follow and check GCC behavior for
-arguments and register placement.
-
-By replacing the naked function with an inline one it is possible to have the
-same result in a more portable and reliable way. Register placement checks
-are not needed since there is no hard code.
-
-Not-signed-off-by: Behan Webster <behanw@converseincode.com>
-Not-signed-off-by: Vinícius Tinti <viniciustinti@gmail.com>
----
- arch/arm/firmware/trusted_foundations.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c
-index 3fb1b5a1dce9..f319c3fa0fe5 100644
---- a/arch/arm/firmware/trusted_foundations.c
-+++ b/arch/arm/firmware/trusted_foundations.c
-@@ -31,14 +31,11 @@
-
- static unsigned long cpu_boot_addr;
-
--static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
-+static inline void tf_generic_smc(u32 type, u32 arg1, u32 arg2)
- {
- asm volatile(
- ".arch_extension sec\n\t"
- "stmfd sp!, {r4 - r11, lr}\n\t"
-- __asmeq("%0", "r0")
-- __asmeq("%1", "r1")
-- __asmeq("%2", "r2")
- "mov r3, #0\n\t"
- "mov r4, #0\n\t"
- "smc #0\n\t"
---
-2.11.0
-
diff --git a/0016-arm-LLVMLinux-Remove-unreachable-from-naked-function.patch b/0016-arm-LLVMLinux-Remove-unreachable-from-naked-function.patch
deleted file mode 100644
index 93f7a75..0000000
--- a/0016-arm-LLVMLinux-Remove-unreachable-from-naked-function.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 21b07dfa5426577f604743948a45481794e7a241 Mon Sep 17 00:00:00 2001
-From: Behan Webster <behanw@converseincode.com>
-Date: Tue, 23 Sep 2014 22:43:30 -0700
-Subject: [PATCH 16/30] arm, LLVMLinux: Remove unreachable from naked function
-
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Suggested-by: Arnd Bergmann <arnd@arndb.de>
-Cc: Arnd Bergmann <arnd@arndb.de>
----
- drivers/bus/arm-cci.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
-index c49da15d9790..49c257d572f0 100644
---- a/drivers/bus/arm-cci.c
-+++ b/drivers/bus/arm-cci.c
-@@ -2101,7 +2101,7 @@ asmlinkage void __naked cci_enable_port_for_self(void)
- [sizeof_struct_ace_port] "i" (sizeof(struct cci_ace_port)),
- [offsetof_port_phys] "i" (offsetof(struct cci_ace_port, phys)) );
-
-- unreachable();
-+ // unreachable(); // not allowed in naked function
- }
-
- /**
---
-2.11.0
-
diff --git a/0017-MIPS-LLVMLinux-Fix-a-cast-to-type-not-present-in-uni.patch b/0017-MIPS-LLVMLinux-Fix-a-cast-to-type-not-present-in-uni.patch
deleted file mode 100644
index 577cf49..0000000
--- a/0017-MIPS-LLVMLinux-Fix-a-cast-to-type-not-present-in-uni.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 0ad5200769177645876d71c2375f4659e49a1bcf Mon Sep 17 00:00:00 2001
-From: Toma Tabacu <toma.tabacu@imgtec.com>
-Date: Mon, 8 Dec 2014 14:55:09 +0000
-Subject: [PATCH 17/30] MIPS: LLVMLinux: Fix a 'cast to type not present in
- union' error.
-
-Replace a 16-bit unsigned int member bitfield with an unsigned short member
-variable in the 'mips16e_instruction' union.
-
-This follows the example set by the 'mips_instruction' union, which doesn't use
-bitfields for its generic union members.
-
-This error gets reported by clang, but not by gcc.
-The changed code can be compiled successfully by both gcc and clang.
-
-Signed-off-by: Toma Tabacu <toma.tabacu@imgtec.com>
----
- arch/mips/include/uapi/asm/inst.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h
-index 77429d1622b3..248e718180a0 100644
---- a/arch/mips/include/uapi/asm/inst.h
-+++ b/arch/mips/include/uapi/asm/inst.h
-@@ -1071,7 +1071,7 @@ union mips_instruction {
- };
-
- union mips16e_instruction {
-- unsigned int full : 16;
-+ unsigned short full;
- struct m16e_rr rr;
- struct m16e_jal jal;
- struct m16e_i64 i64;
---
-2.11.0
-
diff --git a/0018-MIPS-LLVMLinux-Fix-an-inline-asm-input-output-type-m.patch b/0018-MIPS-LLVMLinux-Fix-an-inline-asm-input-output-type-m.patch
deleted file mode 100644
index 3183812..0000000
--- a/0018-MIPS-LLVMLinux-Fix-an-inline-asm-input-output-type-m.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From a4bf1a8f23047a1c91ca2d3db64892af92c2436d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
-Date: Wed, 1 Feb 2017 16:13:16 +0100
-Subject: [PATCH 18/30] MIPS: LLVMLinux: Fix an 'inline asm input/output type
- mismatch' error.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Change the type of csum_ipv6_magic's 'proto' argument from unsigned short to
-__u32.
-
-This fixes a type mismatch between the 'htonl(proto)' inline asm input, which
-is __u32, and the 'proto' output, which is unsigned short.
-
-This error gets reported by clang, but not by gcc.
-The changed code can be compiled successfully by both gcc and clang.
-
-Signed-off-by: Toma Tabacu <toma.tabacu@imgtec.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/mips/include/asm/checksum.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
-index c8b574f7e0cc..f963fff3be29 100644
---- a/arch/mips/include/asm/checksum.h
-+++ b/arch/mips/include/asm/checksum.h
-@@ -217,7 +217,7 @@ static inline __sum16 ip_compute_csum(const void *buff, int len)
- #define _HAVE_ARCH_IPV6_CSUM
- static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
- const struct in6_addr *daddr,
-- __u32 len, __u8 proto,
-+ __u32 len, __u32 proto,
- __wsum sum)
- {
- __wsum tmp;
---
-2.11.0
-
diff --git a/0019-MIPS-LLVMLinux-Silence-variable-self-assignment-warn.patch b/0019-MIPS-LLVMLinux-Silence-variable-self-assignment-warn.patch
deleted file mode 100644
index 89b8430..0000000
--- a/0019-MIPS-LLVMLinux-Silence-variable-self-assignment-warn.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 8bd652c08ac8662f3ce461c99517fab21b75a1cd Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
- <Bernhard.Rosenkranzer@linaro.org>
-Date: Wed, 30 Mar 2016 01:02:19 +0200
-Subject: [PATCH 19/30] MIPS: LLVMLinux: Silence variable self-assignment
- warnings.
-
-Replace variable self-assignments with explanatory comments.
-
-This silences a bunch of -Wself-assign warnings reported by clang.
-The changed code can be compiled without warnings by both gcc and clang.
-
-Signed-off-by: Toma Tabacu <toma.tabacu@imgtec.com>
----
- arch/mips/math-emu/dp_add.c | 5 +++++
- arch/mips/math-emu/dp_sub.c | 5 +++++
- arch/mips/math-emu/sp_add.c | 5 +++++
- arch/mips/math-emu/sp_sub.c | 5 +++++
- 4 files changed, 20 insertions(+)
-
-diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c
-index 8954ef031f84..34081484db6c 100644
---- a/arch/mips/math-emu/dp_add.c
-+++ b/arch/mips/math-emu/dp_add.c
-@@ -151,6 +151,8 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
- * leaving result in xm, xs and xe.
- */
- xm = xm + ym;
-+ /* xe does not change */
-+ /* xs does not change */
-
- if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */
- xm = XDPSRS1(xm);
-@@ -159,8 +161,11 @@ union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y)
- } else {
- if (xm >= ym) {
- xm = xm - ym;
-+ /* xe does not change */
-+ /* xs does not change */
- } else {
- xm = ym - xm;
-+ /* xe does not change */
- xs = ys;
- }
- if (xm == 0)
-diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c
-index fc17a781b9ae..22fac9097e7f 100644
---- a/arch/mips/math-emu/dp_sub.c
-+++ b/arch/mips/math-emu/dp_sub.c
-@@ -154,6 +154,8 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
- /* generate 28 bit result of adding two 27 bit numbers
- */
- xm = xm + ym;
-+ /* xe does not change */
-+ /* xs does not change */
-
- if (xm >> (DP_FBITS + 1 + 3)) { /* carry out */
- xm = XDPSRS1(xm); /* shift preserving sticky */
-@@ -162,8 +164,11 @@ union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y)
- } else {
- if (xm >= ym) {
- xm = xm - ym;
-+ /* xe does not change */
-+ /* xs does not change */
- } else {
- xm = ym - xm;
-+ /* xe does not change */
- xs = ys;
- }
- if (xm == 0) {
-diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c
-index c55c0c00bca8..91566a8bb8f6 100644
---- a/arch/mips/math-emu/sp_add.c
-+++ b/arch/mips/math-emu/sp_add.c
-@@ -151,6 +151,8 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
- * leaving result in xm, xs and xe.
- */
- xm = xm + ym;
-+ /* xe does not change */
-+ /* xs does not change */
-
- if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */
- SPXSRSX1();
-@@ -158,8 +160,11 @@ union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y)
- } else {
- if (xm >= ym) {
- xm = xm - ym;
-+ /* xe does not change */
-+ /* xs does not change */
- } else {
- xm = ym - xm;
-+ /* xe does not change */
- xs = ys;
- }
- if (xm == 0)
-diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c
-index dc998ed47295..0bacd49b9815 100644
---- a/arch/mips/math-emu/sp_sub.c
-+++ b/arch/mips/math-emu/sp_sub.c
-@@ -151,6 +151,8 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
- /* generate 28 bit result of adding two 27 bit numbers
- */
- xm = xm + ym;
-+ /* xe does not change */
-+ /* xs does not change */
-
- if (xm >> (SP_FBITS + 1 + 3)) { /* carry out */
- SPXSRSX1(); /* shift preserving sticky */
-@@ -158,8 +160,11 @@ union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y)
- } else {
- if (xm >= ym) {
- xm = xm - ym;
-+ /* xe does not change */
-+ /* xs does not change */
- } else {
- xm = ym - xm;
-+ /* xe does not change */
- xs = ys;
- }
- if (xm == 0) {
---
-2.11.0
-
diff --git a/0020-MIPS-LLVMLinux-Silence-unicode-warnings-when-preproc.patch b/0020-MIPS-LLVMLinux-Silence-unicode-warnings-when-preproc.patch
deleted file mode 100644
index 785878d..0000000
--- a/0020-MIPS-LLVMLinux-Silence-unicode-warnings-when-preproc.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 706cb8d4c962002068f26b0acc69642d25c74f76 Mon Sep 17 00:00:00 2001
-From: Toma Tabacu <toma.tabacu@imgtec.com>
-Date: Mon, 8 Dec 2014 15:05:17 +0000
-Subject: [PATCH 20/30] MIPS: LLVMLinux: Silence unicode warnings when
- preprocessing assembly.
-
-Differentiate the 'u' GAS .macro argument from the '\u' C preprocessor unicode
-escape sequence by renaming it to '_u'.
-
-When the 'u' argument is evaluated, we end up writing '\u', which causes
-clang to emit -Wunicode warnings.
-
-This silences a couple of -Wunicode warnings reported by clang.
-The changed code can be preprocessed without warnings by both gcc and clang.
-
-Signed-off-by: Toma Tabacu <toma.tabacu@imgtec.com>
----
- arch/mips/include/asm/asmmacro.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
-index 83054f79f72a..6588350df089 100644
---- a/arch/mips/include/asm/asmmacro.h
-+++ b/arch/mips/include/asm/asmmacro.h
-@@ -225,12 +225,12 @@
- .word 0x41600021 | (\reg << 16)
- .endm
-
-- .macro MFTR rt=0, rd=0, u=0, sel=0
-- .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
-+ .macro MFTR rt=0, rd=0, _u=0, sel=0
-+ .word 0x41000000 | (\rt << 16) | (\rd << 11) | (\_u << 5) | (\sel)
- .endm
-
-- .macro MTTR rt=0, rd=0, u=0, sel=0
-- .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
-+ .macro MTTR rt=0, rd=0, _u=0, sel=0
-+ .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\_u << 5) | (\sel)
- .endm
-
- #ifdef TOOLCHAIN_SUPPORTS_MSA
---
-2.11.0
-
diff --git a/0023-HACK-firmware-LLVMLinux-fix-EFI-libstub-with-clang.patch b/0023-HACK-firmware-LLVMLinux-fix-EFI-libstub-with-clang.patch
deleted file mode 100644
index 327a516..0000000
--- a/0023-HACK-firmware-LLVMLinux-fix-EFI-libstub-with-clang.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 746104bee67aca342c77887648efc471215dd6d8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:42:02 +0100
-Subject: [PATCH 23/30] HACK: firmware, LLVMLinux: fix EFI libstub with clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Without any extra guidance, clang will generate libstub with either
-absolute or relative ELF relocations. Use the right combination of
--fpic and -fno-pic on different files to avoid this.
-
-Signed-off-by: Greg Hackmann <ghackmann@google.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- drivers/firmware/efi/libstub/Makefile | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
-index f7425960f6a5..abe4d91bcc89 100644
---- a/drivers/firmware/efi/libstub/Makefile
-+++ b/drivers/firmware/efi/libstub/Makefile
-@@ -11,6 +11,9 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
- -mno-mmx -mno-sse
-
- cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS))
-+ifeq ($(cc-name),clang)
-+cflags-$(CONFIG_ARM64) += -fpic
-+endif
- cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
- -fno-builtin -fpic -mno-single-pic-base
-
-@@ -42,6 +45,9 @@ lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o random.o \
- lib-$(CONFIG_ARM) += arm32-stub.o
- lib-$(CONFIG_ARM64) += arm64-stub.o
- CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
-+ifeq ($(cc-name),clang)
-+CFLAGS_arm64-stub.o += -fno-pic
-+endif
-
- #
- # arm64 puts the stub in the kernel proper, which will unnecessarily retain all
---
-2.11.0
-
diff --git a/0024-aarch64-crypto-LLVMLinux-Fix-inline-assembly-for-cla.patch b/0024-aarch64-crypto-LLVMLinux-Fix-inline-assembly-for-cla.patch
deleted file mode 100644
index ba06cf6..0000000
--- a/0024-aarch64-crypto-LLVMLinux-Fix-inline-assembly-for-cla.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 87257c567c10ef01b28988ef6caf890949f33593 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:43:25 +0100
-Subject: [PATCH 24/30] aarch64: crypto: LLVMLinux: Fix inline assembly for
- clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fix inline assembly to be compatible with both gcc and clang
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/arm64/crypto/sha1-ce-glue.c | 2 +-
- arch/arm64/crypto/sha2-ce-glue.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c
-index aefda9868627..c71e94ba0e43 100644
---- a/arch/arm64/crypto/sha1-ce-glue.c
-+++ b/arch/arm64/crypto/sha1-ce-glue.c
-@@ -18,7 +18,7 @@
- #include <linux/module.h>
-
- #define ASM_EXPORT(sym, val) \
-- asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
-+ asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
-
- MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions");
- MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
-diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
-index 7cd587564a41..381b5fb2dcb2 100644
---- a/arch/arm64/crypto/sha2-ce-glue.c
-+++ b/arch/arm64/crypto/sha2-ce-glue.c
-@@ -18,7 +18,7 @@
- #include <linux/module.h>
-
- #define ASM_EXPORT(sym, val) \
-- asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
-+ asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
-
- MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
- MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
---
-2.11.0
-
diff --git a/0025-aarch64-LLVMLinux-Make-spin_lock_prefetch-asm-code-c.patch b/0025-aarch64-LLVMLinux-Make-spin_lock_prefetch-asm-code-c.patch
deleted file mode 100644
index 82c1b2c..0000000
--- a/0025-aarch64-LLVMLinux-Make-spin_lock_prefetch-asm-code-c.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From f0d4542049a4041f34ec8c66a16d02d23a272599 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:44:18 +0100
-Subject: [PATCH 25/30] aarch64: LLVMLinux: Make spin_lock_prefetch asm code
- compatible with clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This version is accepted by both gcc and clang.
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/arm64/include/asm/processor.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
-index c97b8bd2acba..edc9fe9bb7c6 100644
---- a/arch/arm64/include/asm/processor.h
-+++ b/arch/arm64/include/asm/processor.h
-@@ -178,8 +178,8 @@ static inline void prefetchw(const void *ptr)
- static inline void spin_lock_prefetch(const void *ptr)
- {
- asm volatile(ARM64_LSE_ATOMIC_INSN(
-- "prfm pstl1strm, %a0",
-- "nop") : : "p" (ptr));
-+ "prfm pstl1strm, [%x0]",
-+ "nop") : : "r" (ptr));
- }
-
- #define HAVE_ARCH_PICK_MMAP_LAYOUT
---
-2.11.0
-
diff --git a/0026-LLVMLinux-Don-t-use-attribute-externally_visible-whe.patch b/0026-LLVMLinux-Don-t-use-attribute-externally_visible-whe.patch
deleted file mode 100644
index 43548de..0000000
--- a/0026-LLVMLinux-Don-t-use-attribute-externally_visible-whe.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From d94e33448ec3cd7807600c83e46db3c96084be76 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:45:31 +0100
-Subject: [PATCH 26/30] LLVMLinux: Don't use attribute externally_visible when
- building with clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-As of 4.0, clang doesn't support attribute externally_visible (PR16683).
-Don't use the attribute when building with clang.
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- include/linux/compiler-gcc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
-index 85bf55a08b3f..44dc519ca5e2 100644
---- a/include/linux/compiler-gcc.h
-+++ b/include/linux/compiler-gcc.h
-@@ -211,7 +211,7 @@
-
- #endif /* GCC_VERSION >= 40500 */
-
--#if GCC_VERSION >= 40600
-+#if GCC_VERSION >= 40600 && !defined(__clang__)
- /*
- * When used with Link Time Optimization, gcc can optimize away C functions or
- * variables which are referenced only from assembly code. __visible tells the
---
-2.11.0
-
diff --git a/0027-x86-crypto-LLVMLinux-Fix-building-x86_64-AES-extensi.patch b/0027-x86-crypto-LLVMLinux-Fix-building-x86_64-AES-extensi.patch
deleted file mode 100644
index e301ca0..0000000
--- a/0027-x86-crypto-LLVMLinux-Fix-building-x86_64-AES-extensi.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 68c9b1821b70a7c58a66be42b0e18cf0a0ede537 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:46:28 +0100
-Subject: [PATCH 27/30] x86, crypto, LLVMLinux: Fix building x86_64 AES
- extensions with clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is a workaround for PR24494
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/x86/crypto/aes_ctrby8_avx-x86_64.S | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S
-index a916c4a61165..7a71553b23dc 100644
---- a/arch/x86/crypto/aes_ctrby8_avx-x86_64.S
-+++ b/arch/x86/crypto/aes_ctrby8_avx-x86_64.S
-@@ -93,7 +93,7 @@
-
- #define tmp %r10
- #define DDQ(i) CONCAT(ddq_add_,i)
--#define XMM(i) CONCAT(%xmm, i)
-+#define XMM(i) CONCAT(%xmm,i)
- #define DDQ_DATA 0
- #define XDATA 1
- #define KEY_128 1
---
-2.11.0
-
diff --git a/0028-x86-LLVMLinux-Qualify-mul-as-mulq-to-make-clang-happ.patch b/0028-x86-LLVMLinux-Qualify-mul-as-mulq-to-make-clang-happ.patch
deleted file mode 100644
index cacd635..0000000
--- a/0028-x86-LLVMLinux-Qualify-mul-as-mulq-to-make-clang-happ.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From d582ae8c61d52a3a7c3841c87ac48942c2b556ef Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 00:47:09 +0100
-Subject: [PATCH 28/30] x86, LLVMLinux: Qualify mul as mulq to make clang happy
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/x86/lib/kaslr.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/x86/lib/kaslr.c b/arch/x86/lib/kaslr.c
-index 121f59c6ee54..9915ff924a5e 100644
---- a/arch/x86/lib/kaslr.c
-+++ b/arch/x86/lib/kaslr.c
-@@ -79,7 +79,11 @@ unsigned long kaslr_get_random_long(const char *purpose)
- }
-
- /* Circular multiply for better bit diffusion */
-- asm("mul %3"
-+#ifdef CONFIG_X86_64
-+ asm("mulq %3"
-+#else
-+ asm("mull %3"
-+#endif
- : "=a" (random), "=d" (raw)
- : "a" (random), "rm" (mix_const));
- random += raw;
---
-2.11.0
-
diff --git a/0029-kbuild-LLVMLinux-Add-Werror-to-cc-option-in-order-to.patch b/0029-kbuild-LLVMLinux-Add-Werror-to-cc-option-in-order-to.patch
deleted file mode 100644
index fc62b87..0000000
--- a/0029-kbuild-LLVMLinux-Add-Werror-to-cc-option-in-order-to.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 8de733e8e653892cae10581b816e58f8ad29846e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 05:09:42 +0100
-Subject: [PATCH 29/30] kbuild, LLVMLinux: Add -Werror to cc-option in order to
- support clang
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Clang will warn about unknown warnings but will not return false
-unless -Werror is set. GCC will return false if an unknown
-warning is passed.
-
-Adding -Werror make both compiler behave the same.
-
-Signed-off-by: Mark Charlebois <charlebm@gmail.com>
-Signed-off-by: Behan Webster <behanw@converseincode.com>
-Forward-ported-by: Bernhard Rosenkränzer <bero@linaro.org>
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
-Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
----
- scripts/Kbuild.include | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
-index d6ca649cb0e9..a70fd26204de 100644
---- a/scripts/Kbuild.include
-+++ b/scripts/Kbuild.include
-@@ -116,12 +116,12 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
- # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
-
- cc-option = $(call try-run,\
-- $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
-+ $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
-
- # cc-option-yn
- # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
- cc-option-yn = $(call try-run,\
-- $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
-+ $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
-
- # cc-option-align
- # Prefix align with either -falign or -malign
-@@ -131,7 +131,7 @@ cc-option-align = $(subst -functions=0,,\
- # cc-disable-warning
- # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
- cc-disable-warning = $(call try-run,\
-- $(CC) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
-+ $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
-
- # cc-name
- # Expands to either gcc or clang
---
-2.11.0
-
diff --git a/0030-x86-kbuild-LLVMLinux-Check-for-compiler-support-of-f.patch b/0030-x86-kbuild-LLVMLinux-Check-for-compiler-support-of-f.patch
deleted file mode 100644
index 79fc95a..0000000
--- a/0030-x86-kbuild-LLVMLinux-Check-for-compiler-support-of-f.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 5747a302540b1b3b1fe66caf7aa724b8bdc8cc6f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@linaro.org>
-Date: Thu, 23 Feb 2017 15:03:10 +0100
-Subject: [PATCH 30/30] x86, kbuild, LLVMLinux: Check for compiler support of
- -falign-*=1
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-As of 4.0, clang doesn't support -falign-loops=1 -falign-jumps=1.
-Don't add those flags unconditionally.
-
-Signed-off-by: Bernhard Rosenkränzer <bero@linaro.org>
----
- arch/x86/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/x86/Makefile b/arch/x86/Makefile
-index 2d449337a360..0a62ebada700 100644
---- a/arch/x86/Makefile
-+++ b/arch/x86/Makefile
-@@ -88,10 +88,10 @@ else
- KBUILD_CFLAGS += -m64
-
- # Align jump targets to 1 byte, not the default 16 bytes:
-- KBUILD_CFLAGS += -falign-jumps=1
-+ KBUILD_CFLAGS += $(call cc-option,-falign-jumps=1)
-
- # Pack loops tightly as well:
-- KBUILD_CFLAGS += -falign-loops=1
-+ KBUILD_CFLAGS += $(call cc-option,-falign-loops=1)
-
- # Don't autogenerate traditional x87 instructions
- KBUILD_CFLAGS += $(call cc-option,-mno-80387)
---
-2.11.0
-
diff --git a/0107-intel_idle-tweak-cpuidle-cstates.patch b/0107-intel_idle-tweak-cpuidle-cstates.patch
index 984d4f6..4804923 100644
--- a/0107-intel_idle-tweak-cpuidle-cstates.patch
+++ b/0107-intel_idle-tweak-cpuidle-cstates.patch
@@ -1,32 +1,16 @@
-From 790db86f51a23533d457b361bb61e2845b6de6b8 Mon Sep 17 00:00:00 2001
-From: Arjan van de Ven <arjan@linux.intel.com>
-Date: Sat, 19 Mar 2016 21:32:19 -0400
-Subject: [PATCH 107/126] intel_idle: tweak cpuidle cstates
-
-Increase target_residency in cpuidle cstate
-
-Tune intel_idle to be a bit less agressive;
-Clear linux is cleaner in hygiene (wakupes) than the average linux,
-so we can afford changing these in a way that increases
-performance while keeping power efficiency
----
- drivers/idle/intel_idle.c | 46 +++++++++++++++++++++++-----------------------
- 1 file changed, 23 insertions(+), 23 deletions(-)
-
-diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
-index f0b06b14e782..24609fbb1010 100644
---- a/drivers/idle/intel_idle.c
-+++ b/drivers/idle/intel_idle.c
-@@ -466,7 +466,7 @@ static struct cpuidle_state hsw_cstates[] = {
+diff -up linux-5.6/drivers/idle/intel_idle.c.23~ linux-5.6/drivers/idle/intel_idle.c
+--- linux-5.6/drivers/idle/intel_idle.c.23~ 2020-03-30 00:25:41.000000000 +0200
++++ linux-5.6/drivers/idle/intel_idle.c 2020-04-01 01:18:28.274248595 +0200
+@@ -462,7 +462,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x01",
- .flags = MWAIT2flg(0x01),
+ .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
.exit_latency = 10,
- .target_residency = 20,
+ .target_residency = 120,
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -474,7 +474,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -470,7 +470,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x10",
.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 33,
@@ -35,7 +19,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -482,7 +482,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -478,7 +478,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x20",
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 133,
@@ -44,7 +28,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -490,7 +490,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -486,7 +486,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x32",
.flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 166,
@@ -53,7 +37,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -498,7 +498,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -494,7 +494,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x40",
.flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 300,
@@ -62,7 +46,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -506,7 +506,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -502,7 +502,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x50",
.flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 600,
@@ -71,7 +55,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -514,7 +514,7 @@ static struct cpuidle_state hsw_cstates[] = {
+@@ -510,7 +510,7 @@ static struct cpuidle_state hsw_cstates[
.desc = "MWAIT 0x60",
.flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 2600,
@@ -80,16 +64,16 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -534,7 +534,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -530,7 +530,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x01",
- .flags = MWAIT2flg(0x01),
+ .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
.exit_latency = 10,
- .target_residency = 20,
+ .target_residency = 120,
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -542,7 +542,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -538,7 +538,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x10",
.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 40,
@@ -98,7 +82,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -550,7 +550,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -546,7 +546,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x20",
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 133,
@@ -107,7 +91,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -558,7 +558,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -554,7 +554,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x32",
.flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 166,
@@ -116,7 +100,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -566,7 +566,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -562,7 +562,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x40",
.flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 300,
@@ -125,7 +109,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -574,7 +574,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -570,7 +570,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x50",
.flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 600,
@@ -134,7 +118,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -582,7 +582,7 @@ static struct cpuidle_state bdw_cstates[] = {
+@@ -578,7 +578,7 @@ static struct cpuidle_state bdw_cstates[
.desc = "MWAIT 0x60",
.flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 2600,
@@ -143,16 +127,16 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -603,7 +603,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -599,7 +599,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x01",
- .flags = MWAIT2flg(0x01),
+ .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
.exit_latency = 10,
- .target_residency = 20,
+ .target_residency = 120,
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -611,7 +611,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -607,7 +607,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x10",
.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 70,
@@ -161,7 +145,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -619,7 +619,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -615,7 +615,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x20",
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 85,
@@ -170,7 +154,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -627,7 +627,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -623,7 +623,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x33",
.flags = MWAIT2flg(0x33) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 124,
@@ -179,7 +163,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -635,7 +635,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -631,7 +631,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x40",
.flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 200,
@@ -188,7 +172,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -643,7 +643,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -639,7 +639,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x50",
.flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 480,
@@ -197,7 +181,7 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -651,7 +651,7 @@ static struct cpuidle_state skl_cstates[] = {
+@@ -647,7 +647,7 @@ static struct cpuidle_state skl_cstates[
.desc = "MWAIT 0x60",
.flags = MWAIT2flg(0x60) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 890,
@@ -206,16 +190,16 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -672,7 +672,7 @@ static struct cpuidle_state skx_cstates[] = {
+@@ -668,7 +668,7 @@ static struct cpuidle_state skx_cstates[
.desc = "MWAIT 0x01",
- .flags = MWAIT2flg(0x01),
+ .flags = MWAIT2flg(0x01) | CPUIDLE_FLAG_ALWAYS_ENABLE,
.exit_latency = 10,
- .target_residency = 20,
+ .target_residency = 1000,
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
-@@ -680,7 +680,7 @@ static struct cpuidle_state skx_cstates[] = {
+@@ -676,7 +676,7 @@ static struct cpuidle_state skx_cstates[
.desc = "MWAIT 0x20",
.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
.exit_latency = 133,
@@ -224,5 +208,3 @@ index f0b06b14e782..24609fbb1010 100644
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
{
---
-2.15.0
diff --git a/4.14-C11.patch b/4.14-C11.patch
deleted file mode 100644
index f020a7d..0000000
--- a/4.14-C11.patch
+++ /dev/null
@@ -1,102 +0,0 @@
---- linux-4.14/drivers/staging/rtl8192u/Makefile.0250~ 2017-11-12 19:46:13.000000000 +0100
-+++ linux-4.14/drivers/staging/rtl8192u/Makefile 2017-12-25 17:45:17.803635299 +0100
-@@ -1,7 +1,7 @@
- # SPDX-License-Identifier: GPL-2.0
- NIC_SELECT = RTL8192U
-
--ccflags-y := -std=gnu89
-+ccflags-y := -std=gnu11
- ccflags-y += -O2
-
- ccflags-y += -DCONFIG_FORCE_HARD_FLOAT=y
---- linux-4.14/drivers/staging/rtl8723bs/include/ieee80211.h.0250~ 2017-11-12 19:46:13.000000000 +0100
-+++ linux-4.14/drivers/staging/rtl8723bs/include/ieee80211.h 2017-12-25 17:45:17.803635299 +0100
-@@ -1008,18 +1008,18 @@ enum ieee80211_state {
- #define IP_FMT "%pI4"
- #define IP_ARG(x) (x)
-
--extern __inline int is_multicast_mac_addr(const u8 *addr)
-+static inline int is_multicast_mac_addr(const u8 *addr)
- {
- return ((addr[0] != 0xff) && (0x01 & addr[0]));
- }
-
--extern __inline int is_broadcast_mac_addr(const u8 *addr)
-+static inline int is_broadcast_mac_addr(const u8 *addr)
- {
- return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
- (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
- }
-
--extern __inline int is_zero_mac_addr(const u8 *addr)
-+static inline int is_zero_mac_addr(const u8 *addr)
- {
- return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
- (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
---- linux-4.14/drivers/video/fbdev/i810/i810_dvt.c.0250~ 2017-11-12 19:46:13.000000000 +0100
-+++ linux-4.14/drivers/video/fbdev/i810/i810_dvt.c 2017-12-25 17:45:17.803635299 +0100
-@@ -207,7 +207,7 @@ void round_off_xres(u32 *xres)
- *xres = 1600;
- }
-
--inline void round_off_yres(u32 *xres, u32 *yres)
-+void round_off_yres(u32 *xres, u32 *yres)
- {
- *yres = (*xres * 3) >> 2;
- }
---- linux-4.14/lib/decompress_unlzo.c.0250~ 2017-11-12 19:46:13.000000000 +0100
-+++ linux-4.14/lib/decompress_unlzo.c 2017-12-25 17:45:17.803635299 +0100
-@@ -52,7 +52,7 @@ static const unsigned char lzop_magic[]
- #define HEADER_SIZE_MIN (9 + 7 + 4 + 8 + 1 + 4)
- #define HEADER_SIZE_MAX (9 + 7 + 1 + 8 + 8 + 4 + 1 + 255 + 4)
-
--STATIC inline long INIT parse_header(u8 *input, long *skip, long in_len)
-+static inline long INIT parse_header(u8 *input, long *skip, long in_len)
- {
- int l;
- u8 *parse = input;
---- linux-4.14/Makefile.0250~ 2017-12-25 17:45:17.567633653 +0100
-+++ linux-4.14/Makefile 2017-12-25 17:47:27.841791582 +0100
-@@ -362,7 +362,7 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIB
- HOSTCC = gcc
- HOSTCXX = g++
- HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
-- -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
-+ -fomit-frame-pointer -std=gnu11 $(HOST_LFS_CFLAGS)
- HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
- HOSTLDFLAGS := $(HOST_LFS_LDFLAGS)
- HOST_LOADLIBES := $(HOST_LFS_LIBS)
-@@ -417,7 +417,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstric
- -fno-strict-aliasing -fno-common -fshort-wchar \
- -Werror-implicit-function-declaration \
- -Wno-format-security \
-- -std=gnu89
-+ -std=gnu11
- KBUILD_CPPFLAGS := -D__KERNEL__
- KBUILD_AFLAGS_KERNEL :=
- KBUILD_CFLAGS_KERNEL :=
---- linux-4.14/tools/testing/selftests/sync/Makefile.0250~ 2017-11-12 19:46:13.000000000 +0100
-+++ linux-4.14/tools/testing/selftests/sync/Makefile 2017-12-25 17:45:17.803635299 +0100
-@@ -1,5 +1,5 @@
- # SPDX-License-Identifier: GPL-2.0
--CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
-+CFLAGS += -O2 -g -std=gnu11 -pthread -Wall -Wextra
- CFLAGS += -I../../../../usr/include/
- LDFLAGS += -pthread
-
-diff -up linux-4.17/drivers/scsi/lpfc/lpfc_sli4.h.omv~ linux-4.17/drivers/scsi/lpfc/lpfc_sli4.h
---- linux-4.17/drivers/scsi/lpfc/lpfc_sli4.h.omv~ 2018-06-06 21:40:30.150363628 +0200
-+++ linux-4.17/drivers/scsi/lpfc/lpfc_sli4.h 2018-06-06 21:40:41.153364231 +0200
-@@ -866,10 +866,10 @@ void lpfc_sli_remove_dflt_fcf(struct lpf
- int lpfc_sli4_get_els_iocb_cnt(struct lpfc_hba *);
- int lpfc_sli4_get_iocb_cnt(struct lpfc_hba *phba);
- int lpfc_sli4_init_vpi(struct lpfc_vport *);
--inline void lpfc_sli4_eq_clr_intr(struct lpfc_queue *);
-+void lpfc_sli4_eq_clr_intr(struct lpfc_queue *);
- uint32_t lpfc_sli4_cq_release(struct lpfc_queue *, bool);
- uint32_t lpfc_sli4_eq_release(struct lpfc_queue *, bool);
--inline void lpfc_sli4_if6_eq_clr_intr(struct lpfc_queue *q);
-+void lpfc_sli4_if6_eq_clr_intr(struct lpfc_queue *q);
- uint32_t lpfc_sli4_if6_cq_release(struct lpfc_queue *q, bool arm);
- uint32_t lpfc_sli4_if6_eq_release(struct lpfc_queue *q, bool arm);
- void lpfc_sli4_fcfi_unreg(struct lpfc_hba *, uint16_t);
diff --git a/RFC-v3-01-13-bootsplash-Initial-implementation-showing-black-screen.patch b/RFC-v3-01-13-bootsplash-Initial-implementation-showing-black-screen.patch
deleted file mode 100644
index 3e6cbd4..0000000
--- a/RFC-v3-01-13-bootsplash-Initial-implementation-showing-black-screen.patch
+++ /dev/null
@@ -1,731 +0,0 @@
-diff -up linux-4.18/drivers/video/console/Kconfig.0100~ linux-4.18/drivers/video/console/Kconfig
---- linux-4.18/drivers/video/console/Kconfig.0100~ 2018-08-27 10:28:08.073909394 +0200
-+++ linux-4.18/drivers/video/console/Kconfig 2018-08-27 10:29:04.500028244 +0200
-@@ -161,6 +161,30 @@ config FRAMEBUFFER_CONSOLE_DEFERRED_TAKE
- by the firmware in place, rather then replacing the contents with a
- black screen as soon as fbcon loads.
-
-+config BOOTSPLASH
-+ bool "Bootup splash screen"
-+ depends on FRAMEBUFFER_CONSOLE
-+ ---help---
-+ This option enables the Linux bootsplash screen.
-+
-+ The bootsplash is a full-screen logo or animation indicating a
-+ booting system. It replaces the classic scrolling text with a
-+ graphical alternative, similar to other systems.
-+
-+ Since this is technically implemented as a hook on top of fbcon,
-+ it can only work if the FRAMEBUFFER_CONSOLE is enabled and a
-+ framebuffer driver is active. Thus, to get a text-free boot,
-+ the system needs to boot with vesafb, efifb, or similar.
-+
-+ Once built into the kernel, the bootsplash needs to be enabled
-+ with bootsplash.enabled=1 and a splash file needs to be supplied.
-+
-+ Further documentation can be found in:
-+ Documentation/fb/bootsplash.txt
-+
-+ If unsure, say N.
-+ This is typically used by distributors and system integrators.
-+
- config STI_CONSOLE
- bool "STI text console"
- depends on PARISC && HAS_IOMEM
-diff -up linux-4.18/drivers/video/fbdev/core/bootsplash.c.0100~ linux-4.18/drivers/video/fbdev/core/bootsplash.c
---- linux-4.18/drivers/video/fbdev/core/bootsplash.c.0100~ 2018-08-27 10:28:08.073909394 +0200
-+++ linux-4.18/drivers/video/fbdev/core/bootsplash.c 2018-08-27 10:28:08.073909394 +0200
-@@ -0,0 +1,294 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (Main file: Glue code, workers, timer, PM, kernel and userland API)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#define pr_fmt(fmt) "bootsplash: " fmt
-+
-+
-+#include <linux/atomic.h>
-+#include <linux/bootsplash.h>
-+#include <linux/console.h>
-+#include <linux/device.h> /* dev_warn() */
-+#include <linux/fb.h>
-+#include <linux/fs.h>
-+#include <linux/kernel.h>
-+#include <linux/jiffies.h>
-+#include <linux/module.h>
-+#include <linux/mutex.h>
-+#include <linux/platform_device.h>
-+#include <linux/printk.h>
-+#include <linux/selection.h> /* console_blanked */
-+#include <linux/stringify.h>
-+#include <linux/types.h>
-+#include <linux/vmalloc.h>
-+#include <linux/vt_kern.h>
-+#include <linux/workqueue.h>
-+
-+#include "bootsplash_internal.h"
-+
-+
-+/*
-+ * We only have one splash screen, so let's keep a single
-+ * instance of the internal state.
-+ */
-+static struct splash_priv splash_state;
-+
-+
-+static void splash_callback_redraw_vc(struct work_struct *ignored)
-+{
-+ if (console_blanked)
-+ return;
-+
-+ console_lock();
-+ if (vc_cons[fg_console].d)
-+ update_screen(vc_cons[fg_console].d);
-+ console_unlock();
-+}
-+
-+
-+static bool is_fb_compatible(const struct fb_info *info)
-+{
-+ if (!(info->flags & FBINFO_BE_MATH)
-+ != !fb_be_math((struct fb_info *)info)) {
-+ dev_warn(info->device,
-+ "Can't draw on foreign endianness framebuffer.\n");
-+
-+ return false;
-+ }
-+
-+ if (info->flags & FBINFO_MISC_TILEBLITTING) {
-+ dev_warn(info->device,
-+ "Can't draw splash on tiling framebuffer.\n");
-+
-+ return false;
-+ }
-+
-+ if (info->fix.type != FB_TYPE_PACKED_PIXELS
-+ || (info->fix.visual != FB_VISUAL_TRUECOLOR
-+ && info->fix.visual != FB_VISUAL_DIRECTCOLOR)) {
-+ dev_warn(info->device,
-+ "Can't draw splash on non-packed or non-truecolor framebuffer.\n");
-+
-+ dev_warn(info->device,
-+ " type: %u visual: %u\n",
-+ info->fix.type, info->fix.visual);
-+
-+ return false;
-+ }
-+
-+ if (info->var.bits_per_pixel != 16
-+ && info->var.bits_per_pixel != 24
-+ && info->var.bits_per_pixel != 32) {
-+ dev_warn(info->device,
-+ "We only support drawing on framebuffers with 16, 24, or 32 bpp, not %d.\n",
-+ info->var.bits_per_pixel);
-+
-+ return false;
-+ }
-+
-+ return true;
-+}
-+
-+
-+/*
-+ * Called by fbcon_switch() when an instance is activated or refreshed.
-+ */
-+void bootsplash_render_full(struct fb_info *info)
-+{
-+ if (!is_fb_compatible(info))
-+ return;
-+
-+ bootsplash_do_render_background(info);
-+}
-+
-+
-+/*
-+ * External status enquiry and on/off switch
-+ */
-+bool bootsplash_would_render_now(void)
-+{
-+ return !oops_in_progress
-+ && !console_blanked
-+ && bootsplash_is_enabled();
-+}
-+
-+bool bootsplash_is_enabled(void)
-+{
-+ bool was_enabled;
-+
-+ /* Make sure we have the newest state */
-+ smp_rmb();
-+
-+ was_enabled = test_bit(0, &splash_state.enabled);
-+
-+ return was_enabled;
-+}
-+
-+void bootsplash_disable(void)
-+{
-+ int was_enabled;
-+
-+ was_enabled = test_and_clear_bit(0, &splash_state.enabled);
-+
-+ if (was_enabled) {
-+ if (oops_in_progress) {
-+ /* Redraw screen now so we can see a panic */
-+ if (vc_cons[fg_console].d)
-+ update_screen(vc_cons[fg_console].d);
-+ } else {
-+ /* No urgency, redraw at next opportunity */
-+ schedule_work(&splash_state.work_redraw_vc);
-+ }
-+ }
-+}
-+
-+void bootsplash_enable(void)
-+{
-+ bool was_enabled;
-+
-+ if (oops_in_progress)
-+ return;
-+
-+ was_enabled = test_and_set_bit(0, &splash_state.enabled);
-+
-+ if (!was_enabled)
-+ schedule_work(&splash_state.work_redraw_vc);
-+}
-+
-+
-+/*
-+ * Userland API via platform device in sysfs
-+ */
-+static ssize_t splash_show_enabled(struct device *dev,
-+ struct device_attribute *attr, char *buf)
-+{
-+ return sprintf(buf, "%d\n", bootsplash_is_enabled());
-+}
-+
-+static ssize_t splash_store_enabled(struct device *device,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ bool enable;
-+ int err;
-+
-+ if (!buf || !count)
-+ return -EFAULT;
-+
-+ err = kstrtobool(buf, &enable);
-+ if (err)
-+ return err;
-+
-+ if (enable)
-+ bootsplash_enable();
-+ else
-+ bootsplash_disable();
-+
-+ return count;
-+}
-+
-+static DEVICE_ATTR(enabled, 0644, splash_show_enabled, splash_store_enabled);
-+
-+
-+static struct attribute *splash_dev_attrs[] = {
-+ &dev_attr_enabled.attr,
-+ NULL
-+};
-+
-+ATTRIBUTE_GROUPS(splash_dev);
-+
-+
-+
-+
-+/*
-+ * Power management fixup via platform device
-+ *
-+ * When the system is woken from sleep or restored after hibernating, we
-+ * cannot expect the screen contents to still be present in video RAM.
-+ * Thus, we have to redraw the splash if we're currently active.
-+ */
-+static int splash_resume(struct device *device)
-+{
-+ if (bootsplash_would_render_now())
-+ schedule_work(&splash_state.work_redraw_vc);
-+
-+ return 0;
-+}
-+
-+static int splash_suspend(struct device *device)
-+{
-+ cancel_work_sync(&splash_state.work_redraw_vc);
-+
-+ return 0;
-+}
-+
-+
-+static const struct dev_pm_ops splash_pm_ops = {
-+ .thaw = splash_resume,
-+ .restore = splash_resume,
-+ .resume = splash_resume,
-+ .suspend = splash_suspend,
-+ .freeze = splash_suspend,
-+};
-+
-+static struct platform_driver splash_driver = {
-+ .driver = {
-+ .name = "bootsplash",
-+ .pm = &splash_pm_ops,
-+ },
-+};
-+
-+
-+/*
-+ * Main init
-+ */
-+void bootsplash_init(void)
-+{
-+ int ret;
-+
-+ /* Initialized already? */
-+ if (splash_state.splash_device)
-+ return;
-+
-+
-+ /* Register platform device to export user API */
-+ ret = platform_driver_register(&splash_driver);
-+ if (ret) {
-+ pr_err("platform_driver_register() failed: %d\n", ret);
-+ goto err;
-+ }
-+
-+ splash_state.splash_device
-+ = platform_device_alloc("bootsplash", 0);
-+
-+ if (!splash_state.splash_device)
-+ goto err_driver;
-+
-+ splash_state.splash_device->dev.groups = splash_dev_groups;
-+
-+ ret = platform_device_add(splash_state.splash_device);
-+ if (ret) {
-+ pr_err("platform_device_add() failed: %d\n", ret);
-+ goto err_device;
-+ }
-+
-+
-+ INIT_WORK(&splash_state.work_redraw_vc, splash_callback_redraw_vc);
-+
-+ return;
-+
-+err_device:
-+ platform_device_put(splash_state.splash_device);
-+ splash_state.splash_device = NULL;
-+err_driver:
-+ platform_driver_unregister(&splash_driver);
-+err:
-+ pr_err("Failed to initialize.\n");
-+}
-diff -up linux-4.18/drivers/video/fbdev/core/bootsplash_internal.h.0100~ linux-4.18/drivers/video/fbdev/core/bootsplash_internal.h
---- linux-4.18/drivers/video/fbdev/core/bootsplash_internal.h.0100~ 2018-08-27 10:28:08.073909394 +0200
-+++ linux-4.18/drivers/video/fbdev/core/bootsplash_internal.h 2018-08-27 10:28:08.073909394 +0200
-@@ -0,0 +1,55 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (Internal data structures used at runtime)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#ifndef __BOOTSPLASH_INTERNAL_H
-+#define __BOOTSPLASH_INTERNAL_H
-+
-+
-+#include <linux/types.h>
-+#include <linux/fb.h>
-+#include <linux/kernel.h>
-+#include <linux/mutex.h>
-+#include <linux/spinlock.h>
-+
-+
-+/*
-+ * Runtime types
-+ */
-+struct splash_priv {
-+ /*
-+ * Enabled/disabled state, to be used with atomic bit operations.
-+ * Bit 0: 0 = Splash hidden
-+ * 1 = Splash shown
-+ *
-+ * Note: fbcon.c uses this twice, by calling
-+ * bootsplash_would_render_now() in set_blitting_type() and
-+ * in fbcon_switch().
-+ * This is racy, but eventually consistent: Turning the
-+ * splash on/off will cause a redraw, which calls
-+ * fbcon_switch(), which calls set_blitting_type().
-+ * So the last on/off toggle will make things consistent.
-+ */
-+ unsigned long enabled;
-+
-+ /* Our gateway to userland via sysfs */
-+ struct platform_device *splash_device;
-+
-+ struct work_struct work_redraw_vc;
-+};
-+
-+
-+
-+/*
-+ * Rendering functions
-+ */
-+void bootsplash_do_render_background(struct fb_info *info);
-+
-+#endif
-diff -up linux-4.18/drivers/video/fbdev/core/bootsplash_render.c.0100~ linux-4.18/drivers/video/fbdev/core/bootsplash_render.c
---- linux-4.18/drivers/video/fbdev/core/bootsplash_render.c.0100~ 2018-08-27 10:28:08.073909394 +0200
-+++ linux-4.18/drivers/video/fbdev/core/bootsplash_render.c 2018-08-27 10:28:08.073909394 +0200
-@@ -0,0 +1,93 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (Rendering functions)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#define pr_fmt(fmt) "bootsplash: " fmt
-+
-+
-+#include <linux/bootsplash.h>
-+#include <linux/fb.h>
-+#include <linux/kernel.h>
-+#include <linux/printk.h>
-+#include <linux/types.h>
-+
-+#include "bootsplash_internal.h"
-+
-+
-+
-+
-+/*
-+ * Rendering: Internal drawing routines
-+ */
-+
-+
-+/*
-+ * Pack pixel into target format and do Big/Little Endian handling.
-+ * This would be a good place to handle endianness conversion if necessary.
-+ */
-+static inline u32 pack_pixel(const struct fb_var_screeninfo *dst_var,
-+ u8 red, u8 green, u8 blue)
-+{
-+ u32 dstpix;
-+
-+ /* Quantize pixel */
-+ red = red >> (8 - dst_var->red.length);
-+ green = green >> (8 - dst_var->green.length);
-+ blue = blue >> (8 - dst_var->blue.length);
-+
-+ /* Pack pixel */
-+ dstpix = red << (dst_var->red.offset)
-+ | green << (dst_var->green.offset)
-+ | blue << (dst_var->blue.offset);
-+
-+ /*
-+ * Move packed pixel to the beginning of the memory cell,
-+ * so we can memcpy() it out easily
-+ */
-+#ifdef __BIG_ENDIAN
-+ switch (dst_var->bits_per_pixel) {
-+ case 16:
-+ dstpix <<= 16;
-+ break;
-+ case 24:
-+ dstpix <<= 8;
-+ break;
-+ case 32:
-+ break;
-+ }
-+#else
-+ /* This is intrinsically unnecessary on Little Endian */
-+#endif
-+
-+ return dstpix;
-+}
-+
-+
-+void bootsplash_do_render_background(struct fb_info *info)
-+{
-+ unsigned int x, y;
-+ u32 dstpix;
-+ u32 dst_octpp = info->var.bits_per_pixel / 8;
-+
-+ dstpix = pack_pixel(&info->var,
-+ 0,
-+ 0,
-+ 0);
-+
-+ for (y = 0; y < info->var.yres_virtual; y++) {
-+ u8 *dstline = info->screen_buffer + (y * info->fix.line_length);
-+
-+ for (x = 0; x < info->var.xres_virtual; x++) {
-+ memcpy(dstline, &dstpix, dst_octpp);
-+
-+ dstline += dst_octpp;
-+ }
-+ }
-+}
-diff -up linux-4.18/drivers/video/fbdev/core/dummyblit.c.0100~ linux-4.18/drivers/video/fbdev/core/dummyblit.c
---- linux-4.18/drivers/video/fbdev/core/dummyblit.c.0100~ 2018-08-27 10:28:08.074909396 +0200
-+++ linux-4.18/drivers/video/fbdev/core/dummyblit.c 2018-08-27 10:28:08.074909396 +0200
-@@ -0,0 +1,89 @@
-+/*
-+ * linux/drivers/video/fbdev/core/dummyblit.c -- Dummy Blitting Operation
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * These functions are used in place of blitblit/tileblit to suppress
-+ * fbcon's text output while a splash is shown.
-+ *
-+ * Only suppressing actual rendering keeps the text buffer in the VC layer
-+ * intact and makes it easy to switch back from the bootsplash to a full
-+ * text console with a simple redraw (with the original functions in place).
-+ *
-+ * Based on linux/drivers/video/fbdev/core/bitblit.c
-+ * and linux/drivers/video/fbdev/core/tileblit.c
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/fb.h>
-+#include <linux/vt_kern.h>
-+#include <linux/console.h>
-+#include <asm/types.h>
-+#include "fbcon.h"
-+
-+static void dummy_bmove(struct vc_data *vc, struct fb_info *info, int sy,
-+ int sx, int dy, int dx, int height, int width)
-+{
-+ ;
-+}
-+
-+static void dummy_clear(struct vc_data *vc, struct fb_info *info, int sy,
-+ int sx, int height, int width)
-+{
-+ ;
-+}
-+
-+static void dummy_putcs(struct vc_data *vc, struct fb_info *info,
-+ const unsigned short *s, int count, int yy, int xx,
-+ int fg, int bg)
-+{
-+ ;
-+}
-+
-+static void dummy_clear_margins(struct vc_data *vc, struct fb_info *info,
-+ int color, int bottom_only)
-+{
-+ ;
-+}
-+
-+static void dummy_cursor(struct vc_data *vc, struct fb_info *info, int mode,
-+ int softback_lines, int fg, int bg)
-+{
-+ ;
-+}
-+
-+static int dummy_update_start(struct fb_info *info)
-+{
-+ /*
-+ * Copied from bitblit.c and tileblit.c
-+ *
-+ * As of Linux 4.12, nobody seems to care about our return value.
-+ */
-+ struct fbcon_ops *ops = info->fbcon_par;
-+ int err;
-+
-+ err = fb_pan_display(info, &ops->var);
-+ ops->var.xoffset = info->var.xoffset;
-+ ops->var.yoffset = info->var.yoffset;
-+ ops->var.vmode = info->var.vmode;
-+ return err;
-+}
-+
-+void fbcon_set_dummyops(struct fbcon_ops *ops)
-+{
-+ ops->bmove = dummy_bmove;
-+ ops->clear = dummy_clear;
-+ ops->putcs = dummy_putcs;
-+ ops->clear_margins = dummy_clear_margins;
-+ ops->cursor = dummy_cursor;
-+ ops->update_start = dummy_update_start;
-+ ops->rotate_font = NULL;
-+}
-+EXPORT_SYMBOL_GPL(fbcon_set_dummyops);
-+
-+MODULE_AUTHOR("Max Staudt <mstaudt@suse.de>");
-+MODULE_DESCRIPTION("Dummy Blitting Operation");
-+MODULE_LICENSE("GPL");
-diff -up linux-4.18/drivers/video/fbdev/core/fbcon.c.0100~ linux-4.18/drivers/video/fbdev/core/fbcon.c
---- linux-4.18/drivers/video/fbdev/core/fbcon.c.0100~ 2018-08-27 10:28:08.025909293 +0200
-+++ linux-4.18/drivers/video/fbdev/core/fbcon.c 2018-08-27 10:28:08.074909396 +0200
-@@ -80,6 +80,7 @@
- #include <asm/irq.h>
-
- #include "fbcon.h"
-+#include <linux/bootsplash.h>
-
- #ifdef FBCONDEBUG
- # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
-@@ -553,6 +554,8 @@ static int do_fbcon_takeover(int show_lo
- for (i = first_fb_vc; i <= last_fb_vc; i++)
- con2fb_map[i] = info_idx;
-
-+ bootsplash_init();
-+
- err = do_take_over_console(&fb_con, first_fb_vc, last_fb_vc,
- fbcon_is_default);
-
-@@ -673,6 +676,9 @@ static void set_blitting_type(struct vc_
- else {
- fbcon_set_rotation(info);
- fbcon_set_bitops(ops);
-+
-+ if (bootsplash_would_render_now())
-+ fbcon_set_dummyops(ops);
- }
- }
-
-@@ -695,6 +701,19 @@ static void set_blitting_type(struct vc_
- ops->p = &fb_display[vc->vc_num];
- fbcon_set_rotation(info);
- fbcon_set_bitops(ops);
-+
-+ /*
-+ * Note:
-+ * This is *eventually correct*.
-+ * Setting the fbcon operations and drawing the splash happen at
-+ * different points in time. If the splash is enabled/disabled
-+ * in between, then bootsplash_{en,dis}able will schedule a
-+ * redraw, which will again render the splash (or not) and set
-+ * the correct fbcon ops.
-+ * The last run will then be the right one.
-+ */
-+ if (bootsplash_would_render_now())
-+ fbcon_set_dummyops(ops);
- }
-
- static int fbcon_invalid_charcount(struct fb_info *info, unsigned charcount)
-@@ -2206,6 +2225,9 @@ static int fbcon_switch(struct vc_data *
- info = registered_fb[con2fb_map[vc->vc_num]];
- ops = info->fbcon_par;
-
-+ if (bootsplash_would_render_now())
-+ bootsplash_render_full(info);
-+
- if (softback_top) {
- if (softback_lines)
- fbcon_set_origin(vc);
-diff -up linux-4.18/drivers/video/fbdev/core/fbcon.h.0100~ linux-4.18/drivers/video/fbdev/core/fbcon.h
---- linux-4.18/drivers/video/fbdev/core/fbcon.h.0100~ 2018-08-12 22:41:04.000000000 +0200
-+++ linux-4.18/drivers/video/fbdev/core/fbcon.h 2018-08-27 10:28:08.074909396 +0200
-@@ -215,6 +215,11 @@ static inline int attr_col_ec(int shift,
- #define SCROLL_REDRAW 0x004
- #define SCROLL_PAN_REDRAW 0x005
-
-+#ifdef CONFIG_BOOTSPLASH
-+extern void fbcon_set_dummyops(struct fbcon_ops *ops);
-+#else /* CONFIG_BOOTSPLASH */
-+#define fbcon_set_dummyops(x)
-+#endif /* CONFIG_BOOTSPLASH */
- #ifdef CONFIG_FB_TILEBLITTING
- extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
- #endif
-diff -up linux-4.18/drivers/video/fbdev/core/Makefile.0100~ linux-4.18/drivers/video/fbdev/core/Makefile
---- linux-4.18/drivers/video/fbdev/core/Makefile.0100~ 2018-08-12 22:41:04.000000000 +0200
-+++ linux-4.18/drivers/video/fbdev/core/Makefile 2018-08-27 10:28:08.074909396 +0200
-@@ -27,3 +27,6 @@ obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimg
- obj-$(CONFIG_FB_SYS_FOPS) += fb_sys_fops.o
- obj-$(CONFIG_FB_SVGALIB) += svgalib.o
- obj-$(CONFIG_FB_DDC) += fb_ddc.o
-+
-+obj-$(CONFIG_BOOTSPLASH) += bootsplash.o bootsplash_render.o \
-+ dummyblit.o
-diff -up linux-4.18/include/linux/bootsplash.h.0100~ linux-4.18/include/linux/bootsplash.h
---- linux-4.18/include/linux/bootsplash.h.0100~ 2018-08-27 10:28:08.074909396 +0200
-+++ linux-4.18/include/linux/bootsplash.h 2018-08-27 10:28:08.074909396 +0200
-@@ -0,0 +1,43 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#ifndef __LINUX_BOOTSPLASH_H
-+#define __LINUX_BOOTSPLASH_H
-+
-+#include <linux/fb.h>
-+
-+
-+#ifdef CONFIG_BOOTSPLASH
-+
-+extern void bootsplash_render_full(struct fb_info *info);
-+
-+extern bool bootsplash_would_render_now(void);
-+
-+extern bool bootsplash_is_enabled(void);
-+extern void bootsplash_disable(void);
-+extern void bootsplash_enable(void);
-+
-+extern void bootsplash_init(void);
-+
-+#else /* CONFIG_BOOTSPLASH */
-+
-+#define bootsplash_render_full(x)
-+
-+#define bootsplash_would_render_now() (false)
-+
-+#define bootsplash_is_enabled() (false)
-+#define bootsplash_disable()
-+#define bootsplash_enable()
-+
-+#define bootsplash_init()
-+
-+#endif /* CONFIG_BOOTSPLASH */
-+
-+
-+#endif
-diff -up linux-4.18/MAINTAINERS.0100~ linux-4.18/MAINTAINERS
---- linux-4.18/MAINTAINERS.0100~ 2018-08-27 10:28:07.950909135 +0200
-+++ linux-4.18/MAINTAINERS 2018-08-27 10:28:08.076909400 +0200
-@@ -2807,6 +2807,14 @@ S: Supported
- F: drivers/net/bonding/
- F: include/uapi/linux/if_bonding.h
-
-+BOOTSPLASH
-+M: Max Staudt <mstaudt@suse.de>
-+L: linux-fbdev@vger.kernel.org
-+S: Maintained
-+F: drivers/video/fbdev/core/bootsplash*.*
-+F: drivers/video/fbdev/core/dummycon.c
-+F: include/linux/bootsplash.h
-+
- BPF (Safe dynamic programs and tools)
- M: Alexei Starovoitov <ast@kernel.org>
- M: Daniel Borkmann <daniel@iogearbox.net>
diff --git a/RFC-v3-02-13-bootsplash-Add-file-reading-and-picture-rendering.patch b/RFC-v3-02-13-bootsplash-Add-file-reading-and-picture-rendering.patch
deleted file mode 100644
index 92d62ca..0000000
--- a/RFC-v3-02-13-bootsplash-Add-file-reading-and-picture-rendering.patch
+++ /dev/null
@@ -1,669 +0,0 @@
-diff --git a/MAINTAINERS b/MAINTAINERS
-index b5633b56391e..5c237445761e 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -2712,6 +2712,7 @@ S: Maintained
- F: drivers/video/fbdev/core/bootsplash*.*
- F: drivers/video/fbdev/core/dummycon.c
- F: include/linux/bootsplash.h
-+F: include/uapi/linux/bootsplash_file.h
-
- BPF (Safe dynamic programs and tools)
- M: Alexei Starovoitov <ast@kernel.org>
-diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile
-index 66895321928e..6a8d1bab8a01 100644
---- a/drivers/video/fbdev/core/Makefile
-+++ b/drivers/video/fbdev/core/Makefile
-@@ -31,4 +31,4 @@ obj-$(CONFIG_FB_SVGALIB) += svgalib.o
- obj-$(CONFIG_FB_DDC) += fb_ddc.o
-
- obj-$(CONFIG_BOOTSPLASH) += bootsplash.o bootsplash_render.o \
-- dummyblit.o
-+ bootsplash_load.o dummyblit.o
-diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
-index e449755af268..843c5400fefc 100644
---- a/drivers/video/fbdev/core/bootsplash.c
-+++ b/drivers/video/fbdev/core/bootsplash.c
-@@ -32,6 +32,7 @@
- #include <linux/workqueue.h>
-
- #include "bootsplash_internal.h"
-+#include "uapi/linux/bootsplash_file.h"
-
-
- /*
-@@ -102,10 +103,17 @@ static bool is_fb_compatible(const struct fb_info *info)
- */
- void bootsplash_render_full(struct fb_info *info)
- {
-+ mutex_lock(&splash_state.data_lock);
-+
- if (!is_fb_compatible(info))
-- return;
-+ goto out;
-+
-+ bootsplash_do_render_background(info, splash_state.file);
-+
-+ bootsplash_do_render_pictures(info, splash_state.file);
-
-- bootsplash_do_render_background(info);
-+out:
-+ mutex_unlock(&splash_state.data_lock);
- }
-
-
-@@ -116,6 +124,7 @@ bool bootsplash_would_render_now(void)
- {
- return !oops_in_progress
- && !console_blanked
-+ && splash_state.file
- && bootsplash_is_enabled();
- }
-
-@@ -252,6 +261,7 @@ static struct platform_driver splash_driver = {
- void bootsplash_init(void)
- {
- int ret;
-+ struct splash_file_priv *fp;
-
- /* Initialized already? */
- if (splash_state.splash_device)
-@@ -280,8 +290,26 @@ void bootsplash_init(void)
- }
-
-
-+ mutex_init(&splash_state.data_lock);
-+ set_bit(0, &splash_state.enabled);
-+
- INIT_WORK(&splash_state.work_redraw_vc, splash_callback_redraw_vc);
-
-+
-+ if (!splash_state.bootfile || !strlen(splash_state.bootfile))
-+ return;
-+
-+ fp = bootsplash_load_firmware(&splash_state.splash_device->dev,
-+ splash_state.bootfile);
-+
-+ if (!fp)
-+ goto err;
-+
-+ mutex_lock(&splash_state.data_lock);
-+ splash_state.splash_fb = NULL;
-+ splash_state.file = fp;
-+ mutex_unlock(&splash_state.data_lock);
-+
- return;
-
- err_device:
-@@ -292,3 +320,7 @@ void bootsplash_init(void)
- err:
- pr_err("Failed to initialize.\n");
- }
-+
-+
-+module_param_named(bootfile, splash_state.bootfile, charp, 0444);
-+MODULE_PARM_DESC(bootfile, "Bootsplash file to load on boot");
-diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h
-index b11da5cb90bf..71e2a27ac0b8 100644
---- a/drivers/video/fbdev/core/bootsplash_internal.h
-+++ b/drivers/video/fbdev/core/bootsplash_internal.h
-@@ -15,15 +15,43 @@
-
- #include <linux/types.h>
- #include <linux/fb.h>
-+#include <linux/firmware.h>
- #include <linux/kernel.h>
- #include <linux/mutex.h>
- #include <linux/spinlock.h>
-
-+#include "uapi/linux/bootsplash_file.h"
-+
-
- /*
- * Runtime types
- */
-+struct splash_blob_priv {
-+ struct splash_blob_header *blob_header;
-+ const void *data;
-+};
-+
-+
-+struct splash_pic_priv {
-+ const struct splash_pic_header *pic_header;
-+
-+ struct splash_blob_priv *blobs;
-+ u16 blobs_loaded;
-+};
-+
-+
-+struct splash_file_priv {
-+ const struct firmware *fw;
-+ const struct splash_file_header *header;
-+
-+ struct splash_pic_priv *pics;
-+};
-+
-+
- struct splash_priv {
-+ /* Bootup and runtime state */
-+ char *bootfile;
-+
- /*
- * Enabled/disabled state, to be used with atomic bit operations.
- * Bit 0: 0 = Splash hidden
-@@ -43,6 +71,13 @@ struct splash_priv {
- struct platform_device *splash_device;
-
- struct work_struct work_redraw_vc;
-+
-+ /* Splash data structures including lock for everything below */
-+ struct mutex data_lock;
-+
-+ struct fb_info *splash_fb;
-+
-+ struct splash_file_priv *file;
- };
-
-
-@@ -50,6 +85,14 @@ struct splash_priv {
- /*
- * Rendering functions
- */
--void bootsplash_do_render_background(struct fb_info *info);
-+void bootsplash_do_render_background(struct fb_info *info,
-+ const struct splash_file_priv *fp);
-+void bootsplash_do_render_pictures(struct fb_info *info,
-+ const struct splash_file_priv *fp);
-+
-+
-+void bootsplash_free_file(struct splash_file_priv *fp);
-+struct splash_file_priv *bootsplash_load_firmware(struct device *device,
-+ const char *path);
-
- #endif
-diff --git a/drivers/video/fbdev/core/bootsplash_load.c b/drivers/video/fbdev/core/bootsplash_load.c
-new file mode 100644
-index 000000000000..fd807571ab7d
---- /dev/null
-+++ b/drivers/video/fbdev/core/bootsplash_load.c
-@@ -0,0 +1,225 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (Loading and freeing functions)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#define pr_fmt(fmt) "bootsplash: " fmt
-+
-+
-+#include <linux/bootsplash.h>
-+#include <linux/fb.h>
-+#include <linux/firmware.h>
-+#include <linux/kernel.h>
-+#include <linux/mutex.h>
-+#include <linux/printk.h>
-+#include <linux/types.h>
-+#include <linux/vmalloc.h>
-+
-+#include "bootsplash_internal.h"
-+#include "uapi/linux/bootsplash_file.h"
-+
-+
-+
-+
-+/*
-+ * Free all vmalloc()'d resources describing a splash file.
-+ */
-+void bootsplash_free_file(struct splash_file_priv *fp)
-+{
-+ if (!fp)
-+ return;
-+
-+ if (fp->pics) {
-+ unsigned int i;
-+
-+ for (i = 0; i < fp->header->num_pics; i++) {
-+ struct splash_pic_priv *pp = &fp->pics[i];
-+
-+ if (pp->blobs)
-+ vfree(pp->blobs);
-+ }
-+
-+ vfree(fp->pics);
-+ }
-+
-+ release_firmware(fp->fw);
-+ vfree(fp);
-+}
-+
-+
-+
-+
-+/*
-+ * Load a splash screen from a "firmware" file.
-+ *
-+ * Parsing, and sanity checks.
-+ */
-+#ifdef __BIG_ENDIAN
-+ #define BOOTSPLASH_MAGIC BOOTSPLASH_MAGIC_BE
-+#else
-+ #define BOOTSPLASH_MAGIC BOOTSPLASH_MAGIC_LE
-+#endif
-+
-+struct splash_file_priv *bootsplash_load_firmware(struct device *device,
-+ const char *path)
-+{
-+ const struct firmware *fw;
-+ struct splash_file_priv *fp;
-+ unsigned int i;
-+ const u8 *walker;
-+
-+ if (request_firmware(&fw, path, device))
-+ return NULL;
-+
-+ if (fw->size < sizeof(struct splash_file_header)
-+ || memcmp(fw->data, BOOTSPLASH_MAGIC, sizeof(fp->header->id))) {
-+ pr_err("Not a bootsplash file.\n");
-+
-+ release_firmware(fw);
-+ return NULL;
-+ }
-+
-+ fp = vzalloc(sizeof(struct splash_file_priv));
-+ if (!fp) {
-+ release_firmware(fw);
-+ return NULL;
-+ }
-+
-+ pr_info("Loading splash file (%li bytes)\n", fw->size);
-+
-+ fp->fw = fw;
-+ fp->header = (struct splash_file_header *)fw->data;
-+
-+ /* Sanity checks */
-+ if (fp->header->version != BOOTSPLASH_VERSION) {
-+ pr_err("Loaded v%d file, but we only support version %d\n",
-+ fp->header->version,
-+ BOOTSPLASH_VERSION);
-+
-+ goto err;
-+ }
-+
-+ if (fw->size < sizeof(struct splash_file_header)
-+ + fp->header->num_pics
-+ * sizeof(struct splash_pic_header)
-+ + fp->header->num_blobs
-+ * sizeof(struct splash_blob_header)) {
-+ pr_err("File incomplete.\n");
-+
-+ goto err;
-+ }
-+
-+ /* Read picture headers */
-+ if (fp->header->num_pics) {
-+ fp->pics = vzalloc(fp->header->num_pics
-+ * sizeof(struct splash_pic_priv));
-+ if (!fp->pics)
-+ goto err;
-+ }
-+
-+ walker = fw->data + sizeof(struct splash_file_header);
-+ for (i = 0; i < fp->header->num_pics; i++) {
-+ struct splash_pic_priv *pp = &fp->pics[i];
-+ struct splash_pic_header *ph = (void *)walker;
-+
-+ pr_debug("Picture %u: Size %ux%u\n", i, ph->width, ph->height);
-+
-+ if (ph->num_blobs < 1) {
-+ pr_err("Picture %u: Zero blobs? Aborting load.\n", i);
-+ goto err;
-+ }
-+
-+ pp->pic_header = ph;
-+ pp->blobs = vzalloc(ph->num_blobs
-+ * sizeof(struct splash_blob_priv));
-+ if (!pp->blobs)
-+ goto err;
-+
-+ walker += sizeof(struct splash_pic_header);
-+ }
-+
-+ /* Read blob headers */
-+ for (i = 0; i < fp->header->num_blobs; i++) {
-+ struct splash_blob_header *bh = (void *)walker;
-+ struct splash_pic_priv *pp;
-+
-+ if (walker + sizeof(struct splash_blob_header)
-+ > fw->data + fw->size)
-+ goto err;
-+
-+ walker += sizeof(struct splash_blob_header);
-+
-+ if (walker + bh->length > fw->data + fw->size)
-+ goto err;
-+
-+ if (bh->picture_id >= fp->header->num_pics)
-+ goto nextblob;
-+
-+ pp = &fp->pics[bh->picture_id];
-+
-+ pr_debug("Blob %u, pic %u, blobs_loaded %u, num_blobs %u.\n",
-+ i, bh->picture_id,
-+ pp->blobs_loaded, pp->pic_header->num_blobs);
-+
-+ if (pp->blobs_loaded >= pp->pic_header->num_blobs)
-+ goto nextblob;
-+
-+ switch (bh->type) {
-+ case 0:
-+ /* Raw 24-bit packed pixels */
-+ if (bh->length != pp->pic_header->width
-+ * pp->pic_header->height * 3) {
-+ pr_err("Blob %u, type 1: Length doesn't match picture.\n",
-+ i);
-+
-+ goto err;
-+ }
-+ break;
-+ default:
-+ pr_warn("Blob %u, unknown type %u.\n", i, bh->type);
-+ goto nextblob;
-+ }
-+
-+ pp->blobs[pp->blobs_loaded].blob_header = bh;
-+ pp->blobs[pp->blobs_loaded].data = walker;
-+ pp->blobs_loaded++;
-+
-+nextblob:
-+ walker += bh->length;
-+ if (bh->length % 16)
-+ walker += 16 - (bh->length % 16);
-+ }
-+
-+ if (walker != fw->data + fw->size)
-+ pr_warn("Trailing data in splash file.\n");
-+
-+ /* Walk over pictures and ensure all blob slots are filled */
-+ for (i = 0; i < fp->header->num_pics; i++) {
-+ struct splash_pic_priv *pp = &fp->pics[i];
-+
-+ if (pp->blobs_loaded != pp->pic_header->num_blobs) {
-+ pr_err("Picture %u doesn't have all blob slots filled.\n",
-+ i);
-+
-+ goto err;
-+ }
-+ }
-+
-+ pr_info("Loaded (%ld bytes, %u pics, %u blobs).\n",
-+ fw->size,
-+ fp->header->num_pics,
-+ fp->header->num_blobs);
-+
-+ return fp;
-+
-+
-+err:
-+ bootsplash_free_file(fp);
-+ return NULL;
-+}
-diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
-index 4d7e0117f653..2ae36949d0e3 100644
---- a/drivers/video/fbdev/core/bootsplash_render.c
-+++ b/drivers/video/fbdev/core/bootsplash_render.c
-@@ -19,6 +19,7 @@
- #include <linux/types.h>
-
- #include "bootsplash_internal.h"
-+#include "uapi/linux/bootsplash_file.h"
-
-
-
-@@ -70,16 +71,69 @@ static inline u32 pack_pixel(const struct fb_var_screeninfo *dst_var,
- }
-
-
--void bootsplash_do_render_background(struct fb_info *info)
-+/*
-+ * Copy from source and blend into the destination picture.
-+ * Currently assumes that the source picture is 24bpp.
-+ * Currently assumes that the destination is <= 32bpp.
-+ */
-+static int splash_convert_to_fb(u8 *dst,
-+ const struct fb_var_screeninfo *dst_var,
-+ unsigned int dst_stride,
-+ unsigned int dst_xoff,
-+ unsigned int dst_yoff,
-+ const u8 *src,
-+ unsigned int src_width,
-+ unsigned int src_height)
-+{
-+ unsigned int x, y;
-+ unsigned int src_stride = 3 * src_width; /* Assume 24bpp packed */
-+ u32 dst_octpp = dst_var->bits_per_pixel / 8;
-+
-+ dst_xoff += dst_var->xoffset;
-+ dst_yoff += dst_var->yoffset;
-+
-+ /* Copy with stride and pixel size adjustment */
-+ for (y = 0;
-+ y < src_height && y + dst_yoff < dst_var->yres_virtual;
-+ y++) {
-+ const u8 *srcline = src + (y * src_stride);
-+ u8 *dstline = dst + ((y + dst_yoff) * dst_stride)
-+ + (dst_xoff * dst_octpp);
-+
-+ for (x = 0;
-+ x < src_width && x + dst_xoff < dst_var->xres_virtual;
-+ x++) {
-+ u8 red, green, blue;
-+ u32 dstpix;
-+
-+ /* Read pixel */
-+ red = *srcline++;
-+ green = *srcline++;
-+ blue = *srcline++;
-+
-+ /* Write pixel */
-+ dstpix = pack_pixel(dst_var, red, green, blue);
-+ memcpy(dstline, &dstpix, dst_octpp);
-+
-+ dstline += dst_octpp;
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+
-+void bootsplash_do_render_background(struct fb_info *info,
-+ const struct splash_file_priv *fp)
- {
- unsigned int x, y;
- u32 dstpix;
- u32 dst_octpp = info->var.bits_per_pixel / 8;
-
- dstpix = pack_pixel(&info->var,
-- 0,
-- 0,
-- 0);
-+ fp->header->bg_red,
-+ fp->header->bg_green,
-+ fp->header->bg_blue);
-
- for (y = 0; y < info->var.yres_virtual; y++) {
- u8 *dstline = info->screen_buffer + (y * info->fix.line_length);
-@@ -91,3 +145,44 @@ void bootsplash_do_render_background(struct fb_info *info)
- }
- }
- }
-+
-+
-+void bootsplash_do_render_pictures(struct fb_info *info,
-+ const struct splash_file_priv *fp)
-+{
-+ unsigned int i;
-+
-+ for (i = 0; i < fp->header->num_pics; i++) {
-+ struct splash_blob_priv *bp;
-+ struct splash_pic_priv *pp = &fp->pics[i];
-+ long dst_xoff, dst_yoff;
-+
-+ if (pp->blobs_loaded < 1)
-+ continue;
-+
-+ bp = &pp->blobs[0];
-+
-+ if (!bp || bp->blob_header->type != 0)
-+ continue;
-+
-+ dst_xoff = (info->var.xres - pp->pic_header->width) / 2;
-+ dst_yoff = (info->var.yres - pp->pic_header->height) / 2;
-+
-+ if (dst_xoff < 0
-+ || dst_yoff < 0
-+ || dst_xoff + pp->pic_header->width > info->var.xres
-+ || dst_yoff + pp->pic_header->height > info->var.yres) {
-+ pr_info_once("Picture %u is out of bounds at current resolution: %dx%d\n"
-+ "(this will only be printed once every reboot)\n",
-+ i, info->var.xres, info->var.yres);
-+
-+ continue;
-+ }
-+
-+ /* Draw next splash frame */
-+ splash_convert_to_fb(info->screen_buffer, &info->var,
-+ info->fix.line_length, dst_xoff, dst_yoff,
-+ bp->data,
-+ pp->pic_header->width, pp->pic_header->height);
-+ }
-+}
-diff --git a/include/uapi/linux/bootsplash_file.h b/include/uapi/linux/bootsplash_file.h
-new file mode 100644
-index 000000000000..89dc9cca8f0c
---- /dev/null
-+++ b/include/uapi/linux/bootsplash_file.h
-@@ -0,0 +1,118 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (File format)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
-+ */
-+
-+#ifndef __BOOTSPLASH_FILE_H
-+#define __BOOTSPLASH_FILE_H
-+
-+
-+#define BOOTSPLASH_VERSION 55561
-+
-+
-+#include <linux/kernel.h>
-+#include <linux/types.h>
-+
-+
-+/*
-+ * On-disk types
-+ *
-+ * A splash file consists of:
-+ * - One single 'struct splash_file_header'
-+ * - An array of 'struct splash_pic_header'
-+ * - An array of raw data blocks, each padded to 16 bytes and
-+ * preceded by a 'struct splash_blob_header'
-+ *
-+ * A single-frame splash may look like this:
-+ *
-+ * +--------------------+
-+ * | |
-+ * | splash_file_header |
-+ * | -> num_blobs = 1 |
-+ * | -> num_pics = 1 |
-+ * | |
-+ * +--------------------+
-+ * | |
-+ * | splash_pic_header |
-+ * | |
-+ * +--------------------+
-+ * | |
-+ * | splash_blob_header |
-+ * | -> type = 0 |
-+ * | -> picture_id = 0 |
-+ * | |
-+ * | (raw RGB data) |
-+ * | (pad to 16 bytes) |
-+ * | |
-+ * +--------------------+
-+ *
-+ * All multi-byte values are stored on disk in the native format
-+ * expected by the system the file will be used on.
-+ */
-+#define BOOTSPLASH_MAGIC_BE "Linux bootsplash"
-+#define BOOTSPLASH_MAGIC_LE "hsalpstoob xuniL"
-+
-+struct splash_file_header {
-+ uint8_t id[16]; /* "Linux bootsplash" (no trailing NUL) */
-+
-+ /* Splash file format version to avoid clashes */
-+ uint16_t version;
-+
-+ /* The background color */
-+ uint8_t bg_red;
-+ uint8_t bg_green;
-+ uint8_t bg_blue;
-+ uint8_t bg_reserved;
-+
-+ /*
-+ * Number of pic/blobs so we can allocate memory for internal
-+ * structures ahead of time when reading the file
-+ */
-+ uint16_t num_blobs;
-+ uint8_t num_pics;
-+
-+ uint8_t padding[103];
-+} __attribute__((__packed__));
-+
-+
-+struct splash_pic_header {
-+ uint16_t width;
-+ uint16_t height;
-+
-+ /*
-+ * Number of data packages associated with this picture.
-+ * Currently, the only use for more than 1 is for animations.
-+ */
-+ uint8_t num_blobs;
-+
-+ uint8_t padding[27];
-+} __attribute__((__packed__));
-+
-+
-+struct splash_blob_header {
-+ /* Length of the data block in bytes. */
-+ uint32_t length;
-+
-+ /*
-+ * Type of the contents.
-+ * 0 - Raw RGB data.
-+ */
-+ uint16_t type;
-+
-+ /*
-+ * Picture this blob is associated with.
-+ * Blobs will be added to a picture in the order they are
-+ * found in the file.
-+ */
-+ uint8_t picture_id;
-+
-+ uint8_t padding[9];
-+} __attribute__((__packed__));
-+
-+#endif
diff --git a/RFC-v3-03-13-bootsplash-Flush-framebuffer-after-drawing.patch b/RFC-v3-03-13-bootsplash-Flush-framebuffer-after-drawing.patch
deleted file mode 100644
index 2169537..0000000
--- a/RFC-v3-03-13-bootsplash-Flush-framebuffer-after-drawing.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
-index 843c5400fefc..815b007f81ca 100644
---- a/drivers/video/fbdev/core/bootsplash.c
-+++ b/drivers/video/fbdev/core/bootsplash.c
-@@ -112,6 +112,8 @@ void bootsplash_render_full(struct fb_info *info)
-
- bootsplash_do_render_pictures(info, splash_state.file);
-
-+ bootsplash_do_render_flush(info);
-+
- out:
- mutex_unlock(&splash_state.data_lock);
- }
-diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h
-index 71e2a27ac0b8..0acb383aa4e3 100644
---- a/drivers/video/fbdev/core/bootsplash_internal.h
-+++ b/drivers/video/fbdev/core/bootsplash_internal.h
-@@ -89,6 +89,7 @@ void bootsplash_do_render_background(struct fb_info *info,
- const struct splash_file_priv *fp);
- void bootsplash_do_render_pictures(struct fb_info *info,
- const struct splash_file_priv *fp);
-+void bootsplash_do_render_flush(struct fb_info *info);
-
-
- void bootsplash_free_file(struct splash_file_priv *fp);
-diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
-index 2ae36949d0e3..8c09c306ff67 100644
---- a/drivers/video/fbdev/core/bootsplash_render.c
-+++ b/drivers/video/fbdev/core/bootsplash_render.c
-@@ -186,3 +186,36 @@ void bootsplash_do_render_pictures(struct fb_info *info,
- pp->pic_header->width, pp->pic_header->height);
- }
- }
-+
-+
-+void bootsplash_do_render_flush(struct fb_info *info)
-+{
-+ /*
-+ * FB drivers using deferred_io (such as Xen) need to sync the
-+ * screen after modifying its contents. When the FB is mmap()ed
-+ * from userspace, this happens via a dirty pages callback, but
-+ * when modifying the FB from the kernel, there is no such thing.
-+ *
-+ * So let's issue a fake fb_copyarea (copying the FB onto itself)
-+ * to trick the FB driver into syncing the screen.
-+ *
-+ * A few DRM drivers' FB implementations are broken by not using
-+ * deferred_io when they really should - we match on the known
-+ * bad ones manually for now.
-+ */
-+ if (info->fbdefio
-+ || !strcmp(info->fix.id, "astdrmfb")
-+ || !strcmp(info->fix.id, "cirrusdrmfb")
-+ || !strcmp(info->fix.id, "mgadrmfb")) {
-+ struct fb_copyarea area;
-+
-+ area.dx = 0;
-+ area.dy = 0;
-+ area.width = info->var.xres;
-+ area.height = info->var.yres;
-+ area.sx = 0;
-+ area.sy = 0;
-+
-+ info->fbops->fb_copyarea(info, &area);
-+ }
-+}
diff --git a/RFC-v3-04-13-bootsplash-Add-corner-positioning.patch b/RFC-v3-04-13-bootsplash-Add-corner-positioning.patch
deleted file mode 100644
index 7eb54af..0000000
--- a/RFC-v3-04-13-bootsplash-Add-corner-positioning.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
-index 8c09c306ff67..07e3a4eab811 100644
---- a/drivers/video/fbdev/core/bootsplash_render.c
-+++ b/drivers/video/fbdev/core/bootsplash_render.c
-@@ -155,6 +155,7 @@ void bootsplash_do_render_pictures(struct fb_info *info,
- for (i = 0; i < fp->header->num_pics; i++) {
- struct splash_blob_priv *bp;
- struct splash_pic_priv *pp = &fp->pics[i];
-+ const struct splash_pic_header *ph = pp->pic_header;
- long dst_xoff, dst_yoff;
-
- if (pp->blobs_loaded < 1)
-@@ -165,8 +166,139 @@ void bootsplash_do_render_pictures(struct fb_info *info,
- if (!bp || bp->blob_header->type != 0)
- continue;
-
-- dst_xoff = (info->var.xres - pp->pic_header->width) / 2;
-- dst_yoff = (info->var.yres - pp->pic_header->height) / 2;
-+ switch (ph->position) {
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP_LEFT:
-+ dst_xoff = 0;
-+ dst_yoff = 0;
-+
-+ dst_xoff += ph->position_offset;
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = 0;
-+
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_TOP_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_yoff = 0;
-+
-+ dst_xoff -= ph->position_offset;
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff -= ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+
-+ dst_xoff -= ph->position_offset;
-+ dst_yoff -= ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+
-+ dst_yoff -= ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_BOTTOM_LEFT:
-+ dst_xoff = 0 + ph->position_offset;
-+ dst_yoff = info->var.yres - pp->pic_header->height
-+ - ph->position_offset;
-+ break;
-+ case SPLASH_POS_FLAG_CORNER | SPLASH_CORNER_LEFT:
-+ dst_xoff = 0;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff += ph->position_offset;
-+ break;
-+
-+ case SPLASH_CORNER_TOP_LEFT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff -= ph->position_offset;
-+ dst_yoff -= ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_TOP:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_yoff -= ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_TOP_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff += ph->position_offset;
-+ dst_yoff -= ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff += ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_BOTTOM_RIGHT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff += ph->position_offset;
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_BOTTOM:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_BOTTOM_LEFT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff -= ph->position_offset;
-+ dst_yoff += ph->position_offset;
-+ break;
-+ case SPLASH_CORNER_LEFT:
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+
-+ dst_xoff -= ph->position_offset;
-+ break;
-+
-+ default:
-+ /* As a fallback, center the picture. */
-+ dst_xoff = info->var.xres - pp->pic_header->width;
-+ dst_xoff /= 2;
-+ dst_yoff = info->var.yres - pp->pic_header->height;
-+ dst_yoff /= 2;
-+ break;
-+ }
-
- if (dst_xoff < 0
- || dst_yoff < 0
-diff --git a/include/uapi/linux/bootsplash_file.h b/include/uapi/linux/bootsplash_file.h
-index 89dc9cca8f0c..71cedcc68933 100644
---- a/include/uapi/linux/bootsplash_file.h
-+++ b/include/uapi/linux/bootsplash_file.h
-@@ -91,7 +91,32 @@ struct splash_pic_header {
- */
- uint8_t num_blobs;
-
-- uint8_t padding[27];
-+ /*
-+ * Corner to move the picture to / from.
-+ * 0x00 - Top left
-+ * 0x01 - Top
-+ * 0x02 - Top right
-+ * 0x03 - Right
-+ * 0x04 - Bottom right
-+ * 0x05 - Bottom
-+ * 0x06 - Bottom left
-+ * 0x07 - Left
-+ *
-+ * Flags:
-+ * 0x10 - Calculate offset from the corner towards the center,
-+ * rather than from the center towards the corner
-+ */
-+ uint8_t position;
-+
-+ /*
-+ * Pixel offset from the selected position.
-+ * Example: If the picture is in the top right corner, it will
-+ * be placed position_offset pixels from the top and
-+ * position_offset pixels from the right margin.
-+ */
-+ uint16_t position_offset;
-+
-+ uint8_t padding[24];
- } __attribute__((__packed__));
-
-
-@@ -115,4 +140,22 @@ struct splash_blob_header {
- uint8_t padding[9];
- } __attribute__((__packed__));
-
-+
-+
-+
-+/*
-+ * Enums for on-disk types
-+ */
-+enum splash_position {
-+ SPLASH_CORNER_TOP_LEFT = 0,
-+ SPLASH_CORNER_TOP = 1,
-+ SPLASH_CORNER_TOP_RIGHT = 2,
-+ SPLASH_CORNER_RIGHT = 3,
-+ SPLASH_CORNER_BOTTOM_RIGHT = 4,
-+ SPLASH_CORNER_BOTTOM = 5,
-+ SPLASH_CORNER_BOTTOM_LEFT = 6,
-+ SPLASH_CORNER_LEFT = 7,
-+ SPLASH_POS_FLAG_CORNER = 0x10,
-+};
-+
- #endif
diff --git a/RFC-v3-05-13-bootsplash-Add-animation-support.patch b/RFC-v3-05-13-bootsplash-Add-animation-support.patch
deleted file mode 100644
index 2785c5e..0000000
--- a/RFC-v3-05-13-bootsplash-Add-animation-support.patch
+++ /dev/null
@@ -1,327 +0,0 @@
-diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
-index 815b007f81ca..c8642142cfea 100644
---- a/drivers/video/fbdev/core/bootsplash.c
-+++ b/drivers/video/fbdev/core/bootsplash.c
-@@ -53,6 +53,14 @@ static void splash_callback_redraw_vc(struct work_struct *ignored)
- console_unlock();
- }
-
-+static void splash_callback_animation(struct work_struct *ignored)
-+{
-+ if (bootsplash_would_render_now()) {
-+ /* This will also re-schedule this delayed worker */
-+ splash_callback_redraw_vc(ignored);
-+ }
-+}
-+
-
- static bool is_fb_compatible(const struct fb_info *info)
- {
-@@ -103,17 +111,44 @@ static bool is_fb_compatible(const struct fb_info *info)
- */
- void bootsplash_render_full(struct fb_info *info)
- {
-+ bool is_update = false;
-+
- mutex_lock(&splash_state.data_lock);
-
-- if (!is_fb_compatible(info))
-- goto out;
-+ /*
-+ * If we've painted on this FB recently, we don't have to do
-+ * the sanity checks and background drawing again.
-+ */
-+ if (splash_state.splash_fb == info)
-+ is_update = true;
-+
-+
-+ if (!is_update) {
-+ /* Check whether we actually support this FB. */
-+ splash_state.splash_fb = NULL;
-+
-+ if (!is_fb_compatible(info))
-+ goto out;
-+
-+ /* Draw the background only once */
-+ bootsplash_do_render_background(info, splash_state.file);
-
-- bootsplash_do_render_background(info, splash_state.file);
-+ /* Mark this FB as last seen */
-+ splash_state.splash_fb = info;
-+ }
-
-- bootsplash_do_render_pictures(info, splash_state.file);
-+ bootsplash_do_render_pictures(info, splash_state.file, is_update);
-
- bootsplash_do_render_flush(info);
-
-+ bootsplash_do_step_animations(splash_state.file);
-+
-+ /* Schedule update for animated splash screens */
-+ if (splash_state.file->frame_ms > 0)
-+ schedule_delayed_work(&splash_state.dwork_animation,
-+ msecs_to_jiffies(
-+ splash_state.file->frame_ms));
-+
- out:
- mutex_unlock(&splash_state.data_lock);
- }
-@@ -169,8 +204,14 @@ void bootsplash_enable(void)
-
- was_enabled = test_and_set_bit(0, &splash_state.enabled);
-
-- if (!was_enabled)
-+ if (!was_enabled) {
-+ /* Force a full redraw when the splash is re-activated */
-+ mutex_lock(&splash_state.data_lock);
-+ splash_state.splash_fb = NULL;
-+ mutex_unlock(&splash_state.data_lock);
-+
- schedule_work(&splash_state.work_redraw_vc);
-+ }
- }
-
-
-@@ -227,6 +268,14 @@ ATTRIBUTE_GROUPS(splash_dev);
- */
- static int splash_resume(struct device *device)
- {
-+ /*
-+ * Force full redraw on resume since we've probably lost the
-+ * framebuffer's contents meanwhile
-+ */
-+ mutex_lock(&splash_state.data_lock);
-+ splash_state.splash_fb = NULL;
-+ mutex_unlock(&splash_state.data_lock);
-+
- if (bootsplash_would_render_now())
- schedule_work(&splash_state.work_redraw_vc);
-
-@@ -235,6 +284,7 @@ static int splash_resume(struct device *device)
-
- static int splash_suspend(struct device *device)
- {
-+ cancel_delayed_work_sync(&splash_state.dwork_animation);
- cancel_work_sync(&splash_state.work_redraw_vc);
-
- return 0;
-@@ -296,6 +346,8 @@ void bootsplash_init(void)
- set_bit(0, &splash_state.enabled);
-
- INIT_WORK(&splash_state.work_redraw_vc, splash_callback_redraw_vc);
-+ INIT_DELAYED_WORK(&splash_state.dwork_animation,
-+ splash_callback_animation);
-
-
- if (!splash_state.bootfile || !strlen(splash_state.bootfile))
-diff --git a/drivers/video/fbdev/core/bootsplash_internal.h b/drivers/video/fbdev/core/bootsplash_internal.h
-index 0acb383aa4e3..b3a74835d90f 100644
---- a/drivers/video/fbdev/core/bootsplash_internal.h
-+++ b/drivers/video/fbdev/core/bootsplash_internal.h
-@@ -37,6 +37,8 @@ struct splash_pic_priv {
-
- struct splash_blob_priv *blobs;
- u16 blobs_loaded;
-+
-+ u16 anim_nextframe;
- };
-
-
-@@ -45,6 +47,12 @@ struct splash_file_priv {
- const struct splash_file_header *header;
-
- struct splash_pic_priv *pics;
-+
-+ /*
-+ * A local copy of the frame delay in the header.
-+ * We modify it to keep the code simple.
-+ */
-+ u16 frame_ms;
- };
-
-
-@@ -71,6 +79,7 @@ struct splash_priv {
- struct platform_device *splash_device;
-
- struct work_struct work_redraw_vc;
-+ struct delayed_work dwork_animation;
-
- /* Splash data structures including lock for everything below */
- struct mutex data_lock;
-@@ -88,8 +97,10 @@ struct splash_priv {
- void bootsplash_do_render_background(struct fb_info *info,
- const struct splash_file_priv *fp);
- void bootsplash_do_render_pictures(struct fb_info *info,
-- const struct splash_file_priv *fp);
-+ const struct splash_file_priv *fp,
-+ bool is_update);
- void bootsplash_do_render_flush(struct fb_info *info);
-+void bootsplash_do_step_animations(struct splash_file_priv *fp);
-
-
- void bootsplash_free_file(struct splash_file_priv *fp);
-diff --git a/drivers/video/fbdev/core/bootsplash_load.c b/drivers/video/fbdev/core/bootsplash_load.c
-index fd807571ab7d..1f661b2d4cc9 100644
---- a/drivers/video/fbdev/core/bootsplash_load.c
-+++ b/drivers/video/fbdev/core/bootsplash_load.c
-@@ -71,6 +71,7 @@ struct splash_file_priv *bootsplash_load_firmware(struct device *device,
- {
- const struct firmware *fw;
- struct splash_file_priv *fp;
-+ bool have_anim = false;
- unsigned int i;
- const u8 *walker;
-
-@@ -135,6 +136,13 @@ struct splash_file_priv *bootsplash_load_firmware(struct device *device,
- goto err;
- }
-
-+ if (ph->anim_type > SPLASH_ANIM_LOOP_FORWARD) {
-+ pr_warn("Picture %u: Unsupported animation type %u.\n",
-+ i, ph->anim_type);
-+
-+ ph->anim_type = SPLASH_ANIM_NONE;
-+ }
-+
- pp->pic_header = ph;
- pp->blobs = vzalloc(ph->num_blobs
- * sizeof(struct splash_blob_priv));
-@@ -202,6 +210,7 @@ struct splash_file_priv *bootsplash_load_firmware(struct device *device,
- /* Walk over pictures and ensure all blob slots are filled */
- for (i = 0; i < fp->header->num_pics; i++) {
- struct splash_pic_priv *pp = &fp->pics[i];
-+ const struct splash_pic_header *ph = pp->pic_header;
-
- if (pp->blobs_loaded != pp->pic_header->num_blobs) {
- pr_err("Picture %u doesn't have all blob slots filled.\n",
-@@ -209,8 +218,20 @@ struct splash_file_priv *bootsplash_load_firmware(struct device *device,
-
- goto err;
- }
-+
-+ if (ph->anim_type
-+ && ph->num_blobs > 1
-+ && ph->anim_loop < pp->blobs_loaded)
-+ have_anim = true;
- }
-
-+ if (!have_anim)
-+ /* Disable animation timer if there is nothing to animate */
-+ fp->frame_ms = 0;
-+ else
-+ /* Enforce minimum delay between frames */
-+ fp->frame_ms = max((u16)20, fp->header->frame_ms);
-+
- pr_info("Loaded (%ld bytes, %u pics, %u blobs).\n",
- fw->size,
- fp->header->num_pics,
-diff --git a/drivers/video/fbdev/core/bootsplash_render.c b/drivers/video/fbdev/core/bootsplash_render.c
-index 07e3a4eab811..76033606ca8a 100644
---- a/drivers/video/fbdev/core/bootsplash_render.c
-+++ b/drivers/video/fbdev/core/bootsplash_render.c
-@@ -148,7 +148,8 @@ void bootsplash_do_render_background(struct fb_info *info,
-
-
- void bootsplash_do_render_pictures(struct fb_info *info,
-- const struct splash_file_priv *fp)
-+ const struct splash_file_priv *fp,
-+ bool is_update)
- {
- unsigned int i;
-
-@@ -161,7 +162,11 @@ void bootsplash_do_render_pictures(struct fb_info *info,
- if (pp->blobs_loaded < 1)
- continue;
-
-- bp = &pp->blobs[0];
-+ /* Skip static pictures when refreshing animations */
-+ if (ph->anim_type == SPLASH_ANIM_NONE && is_update)
-+ continue;
-+
-+ bp = &pp->blobs[pp->anim_nextframe];
-
- if (!bp || bp->blob_header->type != 0)
- continue;
-@@ -351,3 +356,24 @@ void bootsplash_do_render_flush(struct fb_info *info)
- info->fbops->fb_copyarea(info, &area);
- }
- }
-+
-+
-+void bootsplash_do_step_animations(struct splash_file_priv *fp)
-+{
-+ unsigned int i;
-+
-+ /* Step every animation once */
-+ for (i = 0; i < fp->header->num_pics; i++) {
-+ struct splash_pic_priv *pp = &fp->pics[i];
-+
-+ if (pp->blobs_loaded < 2
-+ || pp->pic_header->anim_loop > pp->blobs_loaded)
-+ continue;
-+
-+ if (pp->pic_header->anim_type == SPLASH_ANIM_LOOP_FORWARD) {
-+ pp->anim_nextframe++;
-+ if (pp->anim_nextframe >= pp->pic_header->num_blobs)
-+ pp->anim_nextframe = pp->pic_header->anim_loop;
-+ }
-+ }
-+}
-diff --git a/include/uapi/linux/bootsplash_file.h b/include/uapi/linux/bootsplash_file.h
-index 71cedcc68933..b3af0a3c6487 100644
---- a/include/uapi/linux/bootsplash_file.h
-+++ b/include/uapi/linux/bootsplash_file.h
-@@ -77,7 +77,17 @@ struct splash_file_header {
- uint16_t num_blobs;
- uint8_t num_pics;
-
-- uint8_t padding[103];
-+ uint8_t unused_1;
-+
-+ /*
-+ * Milliseconds to wait before painting the next frame in
-+ * an animation.
-+ * This is actually a minimum, as the system is allowed to
-+ * stall for longer between frames.
-+ */
-+ uint16_t frame_ms;
-+
-+ uint8_t padding[100];
- } __attribute__((__packed__));
-
-
-@@ -116,7 +126,23 @@ struct splash_pic_header {
- */
- uint16_t position_offset;
-
-- uint8_t padding[24];
-+ /*
-+ * Animation type.
-+ * 0 - off
-+ * 1 - forward loop
-+ */
-+ uint8_t anim_type;
-+
-+ /*
-+ * Animation loop point.
-+ * Actual meaning depends on animation type:
-+ * Type 0 - Unused
-+ * 1 - Frame at which to restart the forward loop
-+ * (allowing for "intro" frames)
-+ */
-+ uint8_t anim_loop;
-+
-+ uint8_t padding[22];
- } __attribute__((__packed__));
-
-
-@@ -158,4 +184,9 @@ enum splash_position {
- SPLASH_POS_FLAG_CORNER = 0x10,
- };
-
-+enum splash_anim_type {
-+ SPLASH_ANIM_NONE = 0,
-+ SPLASH_ANIM_LOOP_FORWARD = 1,
-+};
-+
- #endif
diff --git a/RFC-v3-06-13-vt-Redraw-bootsplash-fully-on-console_unblank.patch b/RFC-v3-06-13-vt-Redraw-bootsplash-fully-on-console_unblank.patch
deleted file mode 100644
index 827e65d..0000000
--- a/RFC-v3-06-13-vt-Redraw-bootsplash-fully-on-console_unblank.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-diff -up linux-4.19/drivers/tty/vt/vt.c.0105~ linux-4.19/drivers/tty/vt/vt.c
---- linux-4.19/drivers/tty/vt/vt.c.0105~ 2018-11-15 02:55:33.904454394 +0100
-+++ linux-4.19/drivers/tty/vt/vt.c 2018-11-15 02:56:30.804027773 +0100
-@@ -104,6 +104,7 @@
- #include <linux/kdb.h>
- #include <linux/ctype.h>
- #include <linux/bsearch.h>
-+#include <linux/bootsplash.h>
- #include <linux/gcd.h>
-
- #define MAX_NR_CON_DRIVER 16
-@@ -4235,6 +4236,7 @@ void do_unblank_screen(int leaving_gfx)
- }
-
- console_blanked = 0;
-+ bootsplash_mark_dirty();
- if (vc->vc_sw->con_blank(vc, 0, leaving_gfx))
- /* Low-level driver cannot restore -> do it ourselves */
- update_screen(vc);
-diff -up linux-4.19/drivers/video/fbdev/core/bootsplash.c.0105~ linux-4.19/drivers/video/fbdev/core/bootsplash.c
---- linux-4.19/drivers/video/fbdev/core/bootsplash.c.0105~ 2018-11-15 02:55:33.982455190 +0100
-+++ linux-4.19/drivers/video/fbdev/core/bootsplash.c 2018-11-15 02:55:33.983455200 +0100
-@@ -165,6 +165,13 @@ bool bootsplash_would_render_now(void)
- && bootsplash_is_enabled();
- }
-
-+void bootsplash_mark_dirty(void)
-+{
-+ mutex_lock(&splash_state.data_lock);
-+ splash_state.splash_fb = NULL;
-+ mutex_unlock(&splash_state.data_lock);
-+}
-+
- bool bootsplash_is_enabled(void)
- {
- bool was_enabled;
-@@ -206,9 +213,7 @@ void bootsplash_enable(void)
-
- if (!was_enabled) {
- /* Force a full redraw when the splash is re-activated */
-- mutex_lock(&splash_state.data_lock);
-- splash_state.splash_fb = NULL;
-- mutex_unlock(&splash_state.data_lock);
-+ bootsplash_mark_dirty();
-
- schedule_work(&splash_state.work_redraw_vc);
- }
-@@ -272,9 +277,7 @@ static int splash_resume(struct device *
- * Force full redraw on resume since we've probably lost the
- * framebuffer's contents meanwhile
- */
-- mutex_lock(&splash_state.data_lock);
-- splash_state.splash_fb = NULL;
-- mutex_unlock(&splash_state.data_lock);
-+ bootsplash_mark_dirty();
-
- if (bootsplash_would_render_now())
- schedule_work(&splash_state.work_redraw_vc);
-diff -up linux-4.19/include/linux/bootsplash.h.0105~ linux-4.19/include/linux/bootsplash.h
---- linux-4.19/include/linux/bootsplash.h.0105~ 2018-11-15 02:55:33.975455118 +0100
-+++ linux-4.19/include/linux/bootsplash.h 2018-11-15 02:55:33.984455210 +0100
-@@ -19,6 +19,8 @@ extern void bootsplash_render_full(struc
-
- extern bool bootsplash_would_render_now(void);
-
-+extern void bootsplash_mark_dirty(void);
-+
- extern bool bootsplash_is_enabled(void);
- extern void bootsplash_disable(void);
- extern void bootsplash_enable(void);
-@@ -31,6 +33,8 @@ extern void bootsplash_init(void);
-
- #define bootsplash_would_render_now() (false)
-
-+#define bootsplash_mark_dirty()
-+
- #define bootsplash_is_enabled() (false)
- #define bootsplash_disable()
- #define bootsplash_enable()
diff --git a/RFC-v3-07-13-vt-Add-keyboard-hook-to-disable-bootsplash.patch b/RFC-v3-07-13-vt-Add-keyboard-hook-to-disable-bootsplash.patch
deleted file mode 100644
index e8cd479..0000000
--- a/RFC-v3-07-13-vt-Add-keyboard-hook-to-disable-bootsplash.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
-index f4166263bb3a..a248429194bb 100644
---- a/drivers/tty/vt/keyboard.c
-+++ b/drivers/tty/vt/keyboard.c
-@@ -47,6 +47,8 @@
-
- #include <asm/irq_regs.h>
-
-+#include <linux/bootsplash.h>
-+
- extern void ctrl_alt_del(void);
-
- /*
-@@ -1353,6 +1355,28 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
- }
- #endif
-
-+ /* Trap keys when bootsplash is shown */
-+ if (bootsplash_would_render_now()) {
-+ /* Deactivate bootsplash on ESC or Alt+Fxx VT switch */
-+ if (keycode >= KEY_F1 && keycode <= KEY_F12) {
-+ bootsplash_disable();
-+
-+ /*
-+ * No return here since we want to actually
-+ * perform the VT switch.
-+ */
-+ } else {
-+ if (keycode == KEY_ESC)
-+ bootsplash_disable();
-+
-+ /*
-+ * Just drop any other keys.
-+ * Their effect would be hidden by the splash.
-+ */
-+ return;
-+ }
-+ }
-+
- if (kbd->kbdmode == VC_MEDIUMRAW) {
- /*
- * This is extended medium raw mode, with keys above 127
diff --git a/RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch b/RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch
deleted file mode 100644
index 8a3b715..0000000
--- a/RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
-index 3ffc1ce29023..bc6a24c9dfa8 100644
---- a/drivers/tty/sysrq.c
-+++ b/drivers/tty/sysrq.c
-@@ -49,6 +49,7 @@
- #include <linux/syscalls.h>
- #include <linux/of.h>
- #include <linux/rcupdate.h>
-+#include <linux/bootsplash.h>
-
- #include <asm/ptrace.h>
- #include <asm/irq_regs.h>
-@@ -104,6 +105,8 @@ static void sysrq_handle_SAK(int key)
- {
- struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work;
- schedule_work(SAK_work);
-+
-+ bootsplash_disable();
- }
- static struct sysrq_key_op sysrq_SAK_op = {
- .handler = sysrq_handle_SAK,
diff --git a/RFC-v3-09-13-fbcon-Disable-bootsplash-on-oops.patch b/RFC-v3-09-13-fbcon-Disable-bootsplash-on-oops.patch
deleted file mode 100644
index add68e7..0000000
--- a/RFC-v3-09-13-fbcon-Disable-bootsplash-on-oops.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
-index 9a39a6fcfe98..8a9c67e1c5d8 100644
---- a/drivers/video/fbdev/core/fbcon.c
-+++ b/drivers/video/fbdev/core/fbcon.c
-@@ -1343,6 +1343,16 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
- int y;
- int c = scr_readw((u16 *) vc->vc_pos);
-
-+ /*
-+ * Disable the splash here so we don't have to hook into
-+ * vt_console_print() in drivers/tty/vt/vt.c
-+ *
-+ * We'd disable the splash just before the call to
-+ * hide_cursor() anyway, so this spot is just fine.
-+ */
-+ if (oops_in_progress)
-+ bootsplash_disable();
-+
- ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
-
- if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
diff --git a/RFC-v3-10-13-Documentation-Add-bootsplash-main-documentation.patch b/RFC-v3-10-13-Documentation-Add-bootsplash-main-documentation.patch
deleted file mode 100644
index e5c1fd0..0000000
--- a/RFC-v3-10-13-Documentation-Add-bootsplash-main-documentation.patch
+++ /dev/null
@@ -1,321 +0,0 @@
-diff --git a/Documentation/ABI/testing/sysfs-platform-bootsplash b/Documentation/ABI/testing/sysfs-platform-bootsplash
-new file mode 100644
-index 000000000000..742c7b035ded
---- /dev/null
-+++ b/Documentation/ABI/testing/sysfs-platform-bootsplash
-@@ -0,0 +1,11 @@
-+What: /sys/devices/platform/bootsplash.0/enabled
-+Date: Oct 2017
-+KernelVersion: 4.14
-+Contact: Max Staudt <mstaudt@suse.de>
-+Description:
-+ Can be set and read.
-+
-+ 0: Splash is disabled.
-+ 1: Splash is shown whenever fbcon would show a text console
-+ (i.e. no graphical application is running), and a splash
-+ file is loaded.
-diff --git a/Documentation/bootsplash.rst b/Documentation/bootsplash.rst
-new file mode 100644
-index 000000000000..611f0c558925
---- /dev/null
-+++ b/Documentation/bootsplash.rst
-@@ -0,0 +1,285 @@
-+====================
-+The Linux bootsplash
-+====================
-+
-+:Date: November, 2017
-+:Author: Max Staudt <mstaudt@suse.de>
-+
-+
-+The Linux bootsplash is a graphical replacement for the '``quiet``' boot
-+option, typically showing a logo and a spinner animation as the system starts.
-+
-+Currently, it is a part of the Framebuffer Console support, and can be found
-+as ``CONFIG_BOOTSPLASH`` in the kernel configuration. This means that as long
-+as it is enabled, it hijacks fbcon's output and draws a splash screen instead.
-+
-+Purely compiling in the bootsplash will not render it functional - to actually
-+render a splash, you will also need a splash theme file. See the example
-+utility and script in ``tools/bootsplash`` for a live demo.
-+
-+
-+
-+Motivation
-+==========
-+
-+- The '``quiet``' boot option only suppresses most messages during boot, but
-+ errors are still shown.
-+
-+- A user space implementation can only show a logo once user space has been
-+ initialized far enough to allow this. A kernel splash can display a splash
-+ immediately as soon as fbcon can be displayed.
-+
-+- Implementing a splash screen in user space (e.g. Plymouth) is problematic
-+ due to resource conflicts.
-+
-+ For example, if Plymouth is keeping ``/dev/fb0`` (provided via vesafb/efifb)
-+ open, then most DRM drivers can't replace it because the address space is
-+ still busy - thus leading to a VRAM reservation error.
-+
-+ See: https://bugzilla.opensuse.org/show_bug.cgi?id=980750
-+
-+
-+
-+Command line arguments
-+======================
-+
-+``bootsplash.bootfile``
-+ Which file in the initramfs to load.
-+
-+ The splash theme is loaded via request_firmware(), thus to load
-+ ``/lib/firmware/bootsplash/mytheme`` pass the command line:
-+
-+ ``bootsplash.bootfile=bootsplash/mytheme``
-+
-+ Note: The splash file *has to be* in the initramfs, as it needs to be
-+ available when the splash is initialized early on.
-+
-+ Default: none, i.e. a non-functional splash, falling back to showing text.
-+
-+
-+
-+sysfs run-time configuration
-+============================
-+
-+``/sys/devices/platform/bootsplash.0/enabled``
-+ Enable/disable the bootsplash.
-+ The system boots with this set to 1, but will not show a splash unless
-+ a splash theme file is also loaded.
-+
-+
-+
-+Kconfig
-+=======
-+
-+``BOOTSPLASH``
-+ Whether to compile in bootsplash support
-+ (depends on fbcon compiled in, i.e. ``FRAMEBUFFER_CONSOLE=y``)
-+
-+
-+
-+Bootsplash file format
-+======================
-+
-+A file specified in the kernel configuration as ``CONFIG_BOOTSPLASH_FILE``
-+or specified on the command line as ``bootsplash.bootfile`` will be loaded
-+and displayed as soon as fbcon is initialized.
-+
-+
-+Main blocks
-+-----------
-+
-+There are 3 main blocks in each file:
-+
-+ - one File header
-+ - n Picture headers
-+ - m (Blob header + payload) blocks
-+
-+
-+Structures
-+----------
-+
-+The on-disk structures are defined in
-+``drivers/video/fbdev/core/bootsplash_file.h`` and represent these blocks:
-+
-+ - ``struct splash_file_header``
-+
-+ Represents the file header, with splash-wide information including:
-+
-+ - The magic string "``Linux bootsplash``" on big-endian platforms
-+ (the reverse on little endian)
-+ - The file format version (for incompatible updates, hopefully never)
-+ - The background color
-+ - Number of picture and blob blocks
-+ - Animation speed (we only allow one delay for all animations)
-+
-+ The file header is followed by the first picture header.
-+
-+
-+ - ``struct splash_picture_header``
-+
-+ Represents an object (picture) drawn on screen, including its immutable
-+ properties:
-+ - Width, height
-+ - Positioning relative to screen corners or in the center
-+ - Animation, if any
-+ - Animation type
-+ - Number of blobs
-+
-+ The picture header is followed by another picture header, up until n
-+ picture headers (as defined in the file header) have been read. Then,
-+ the (blob header, payload) pairs follow.
-+
-+
-+ - ``struct splash_blob_header``
-+ (followed by payload)
-+
-+ Represents one raw data stream. So far, only picture data is defined.
-+
-+ The blob header is followed by a payload, then padding to n*16 bytes,
-+ then (if further blobs are defined in the file header) a further blob
-+ header.
-+
-+
-+Alignment
-+---------
-+
-+The bootsplash file is designed to be loaded into memory as-is.
-+
-+All structures are a multiple of 16 bytes long, all elements therein are
-+aligned to multiples of their length, and the payloads are always padded
-+up to multiples of 16 bytes. This is to allow aligned accesses in all
-+cases while still simply mapping the structures over an in-memory copy of
-+the bootsplash file.
-+
-+
-+Further information
-+-------------------
-+
-+Please see ``drivers/video/fbdev/core/bootsplash_file.h`` for further
-+details and possible values in the file.
-+
-+
-+
-+Hooks - how the bootsplash is integrated
-+========================================
-+
-+``drivers/video/fbdev/core/fbcon.c``
-+ ``fbcon_init()`` calls ``bootsplash_init()``, which loads the default
-+ bootsplash file or the one specified on the kernel command line.
-+
-+ ``fbcon_switch()`` draws the bootsplash when it's active, and is also
-+ one of the callers of ``set_blitting_type()``.
-+
-+ ``set_blitting_type()`` calls ``fbcon_set_dummyops()`` when the
-+ bootsplash is active, overriding the text rendering functions.
-+
-+ ``fbcon_cursor()`` will call ``bootsplash_disable()`` when an oops is
-+ being printed in order to make a kernel panic visible.
-+
-+``drivers/video/fbdev/core/dummyblit.c``
-+ This contains the dummy text rendering functions used to suppress text
-+ output while the bootsplash is shown.
-+
-+``drivers/tty/vt/keyboard.c``
-+ ``kbd_keycode()`` can call ``bootsplash_disable()`` when the user
-+ presses ESC or F1-F12 (changing VT). This is to provide a built-in way
-+ of disabling the splash manually at any time.
-+
-+
-+
-+FAQ: Frequently Asked Questions
-+===============================
-+
-+I want to see the log! How do I show the log?
-+---------------------------------------------
-+
-+Press ESC while the splash is shown, or remove the ``bootsplash.bootfile``
-+parameter from the kernel cmdline. Without that parameter, the bootsplash
-+will boot disabled.
-+
-+
-+Why use FB instead of modern DRM/KMS?
-+-------------------------------------
-+
-+This is a semantic problem:
-+ - What memory to draw the splash to?
-+ - And what mode will the screen be set to?
-+
-+Using the fbdev emulation solves these issues.
-+
-+Let's start from a bare KMS system, without fbcon, and without fbdev
-+emulation. In this case, as long as userspace doesn't open the KMS
-+device, the state of the screen is undefined. No framebuffer is
-+allocated in video RAM, and no particular mode is set.
-+
-+In this case, we'd have to allocate a framebuffer to show the splash,
-+and set our mode ourselves. This either wastes a screenful of video RAM
-+if the splash is to co-exist with the userspace program's own allocated
-+framebuffer, or there is a flicker as we deactivate and delete the
-+bootsplash's framebuffer and hand control over to userspace. Since we
-+may set a different mode than userspace, we'd also have flicker due
-+to mode switching.
-+
-+This logic is already contained in every KMS driver that performs fbdev
-+emulation. So we might as well use that. And the correct API to do so is
-+fbdev. Plus, we get compatibility with old, pure fbdev drivers for free.
-+With the fbdev emulation, there is *always* a well-defined framebuffer
-+to draw on. And the selection of mode has already been done by the
-+graphics driver, so we don't need to reinvent that wheel, either.
-+Finally, if userspace decides to use /dev/fbX, we don't have to worry
-+about wasting video RAM, either.
-+
-+
-+Why is the bootsplash integrated in fbcon?
-+------------------------------------------
-+
-+Right now, the bootsplash is drawn from within fbcon, as this allows us
-+to easily know *when* to draw - i.e. when we're safe from fbcon and
-+userspace drawing all over our beautiful splash logo.
-+
-+Separating them is not easy - see the to-do list below.
-+
-+
-+
-+TO DO list for future development
-+=================================
-+
-+Second enable/disable switch for the system
-+-------------------------------------------
-+
-+It may be helpful to differentiate between the system and the user
-+switching off the bootsplash. Thus, the system may make it disappear and
-+reappear e.g. for a password prompt, yet once the user has pressed ESC,
-+it could stay gone.
-+
-+
-+Fix buggy DRM/KMS drivers
-+-------------------------
-+
-+Currently, the splash code manually checks for fbdev emulation provided by
-+the ast, cirrus, and mgag200 DRM/KMS drivers.
-+These drivers use a manual mechanism similar to deferred I/O for their FB
-+emulation, and thus need to be manually flushed onto the screen in the same
-+way.
-+
-+This may be improved upon in several ways:
-+
-+1. Changing these drivers to expose the fbdev BO's memory directly, like
-+ bochsdrmfb does.
-+2. Creating a new fb_ops->fb_flush() API to allow the kernel to flush the
-+ framebuffer once the bootsplash has been drawn into it.
-+
-+
-+Separating from fbcon
-+---------------------
-+
-+Separating these two components would yield independence from fbcon being
-+compiled into the kernel, and thus lowering code size in embedded
-+applications.
-+
-+To do this cleanly will involve a clean separation of users of an FB device
-+within the kernel, i.e. fbcon, bootsplash, and userspace. Right now, the
-+legacy fbcon code and VT code co-operate to switch between fbcon and
-+userspace (by setting the VT into KD_GRAPHICS mode). Installing a muxer
-+between these components ensues refactoring of old code and checking for
-+correct locking.
-diff --git a/MAINTAINERS b/MAINTAINERS
-index 5c237445761e..7ffac272434e 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -2709,6 +2709,8 @@ BOOTSPLASH
- M: Max Staudt <mstaudt@suse.de>
- L: linux-fbdev@vger.kernel.org
- S: Maintained
-+F: Documentation/ABI/testing/sysfs-platform-bootsplash
-+F: Documentation/bootsplash.rst
- F: drivers/video/fbdev/core/bootsplash*.*
- F: drivers/video/fbdev/core/dummycon.c
- F: include/linux/bootsplash.h
diff --git a/RFC-v3-11-13-bootsplash-sysfs-entries-to-load-and-unload-files.patch b/RFC-v3-11-13-bootsplash-sysfs-entries-to-load-and-unload-files.patch
deleted file mode 100644
index 8e87eb4..0000000
--- a/RFC-v3-11-13-bootsplash-sysfs-entries-to-load-and-unload-files.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-diff --git a/Documentation/ABI/testing/sysfs-platform-bootsplash b/Documentation/ABI/testing/sysfs-platform-bootsplash
-index 742c7b035ded..f8f4b259220e 100644
---- a/Documentation/ABI/testing/sysfs-platform-bootsplash
-+++ b/Documentation/ABI/testing/sysfs-platform-bootsplash
-@@ -9,3 +9,35 @@ Description:
- 1: Splash is shown whenever fbcon would show a text console
- (i.e. no graphical application is running), and a splash
- file is loaded.
-+
-+What: /sys/devices/platform/bootsplash.0/drop_splash
-+Date: Oct 2017
-+KernelVersion: 4.14
-+Contact: Max Staudt <mstaudt@suse.de>
-+Description:
-+ Can only be set.
-+
-+ Any value written will cause the current splash theme file
-+ to be unloaded and the text console to be redrawn.
-+
-+What: /sys/devices/platform/bootsplash.0/load_file
-+Date: Oct 2017
-+KernelVersion: 4.14
-+Contact: Max Staudt <mstaudt@suse.de>
-+Description:
-+ Can only be set.
-+
-+ Any value written will cause the splash to be disabled and
-+ internal memory structures to be freed.
-+
-+ A firmware path written will cause a new theme file to be
-+ loaded and the current bootsplash to be replaced.
-+ The current enabled/disabled status is not touched.
-+ If the splash is already active, it will be redrawn.
-+
-+ The path has to be a path in /lib/firmware since
-+ request_firmware() is used to fetch the data.
-+
-+ When setting the splash from the shell, echo -n has to be
-+ used as any trailing '\n' newline will be interpreted as
-+ part of the path.
-diff --git a/Documentation/bootsplash.rst b/Documentation/bootsplash.rst
-index 611f0c558925..b35aba5093e8 100644
---- a/Documentation/bootsplash.rst
-+++ b/Documentation/bootsplash.rst
-@@ -67,6 +67,14 @@ sysfs run-time configuration
- a splash theme file is also loaded.
-
-
-+``/sys/devices/platform/bootsplash.0/drop_splash``
-+ Unload splash data and free memory.
-+
-+``/sys/devices/platform/bootsplash.0/load_file``
-+ Load a splash file from ``/lib/firmware/``.
-+ Note that trailing newlines will be interpreted as part of the file name.
-+
-+
-
- Kconfig
- =======
-diff --git a/drivers/video/fbdev/core/bootsplash.c b/drivers/video/fbdev/core/bootsplash.c
-index 13fcaabbc2ca..16cb0493629d 100644
---- a/drivers/video/fbdev/core/bootsplash.c
-+++ b/drivers/video/fbdev/core/bootsplash.c
-@@ -251,11 +251,65 @@ static ssize_t splash_store_enabled(struct device *device,
- return count;
- }
-
-+static ssize_t splash_store_drop_splash(struct device *device,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ struct splash_file_priv *fp;
-+
-+ if (!buf || !count || !splash_state.file)
-+ return count;
-+
-+ mutex_lock(&splash_state.data_lock);
-+ fp = splash_state.file;
-+ splash_state.file = NULL;
-+ mutex_unlock(&splash_state.data_lock);
-+
-+ /* Redraw the text console */
-+ schedule_work(&splash_state.work_redraw_vc);
-+
-+ bootsplash_free_file(fp);
-+
-+ return count;
-+}
-+
-+static ssize_t splash_store_load_file(struct device *device,
-+ struct device_attribute *attr,
-+ const char *buf, size_t count)
-+{
-+ struct splash_file_priv *fp, *fp_old;
-+
-+ if (!count)
-+ return 0;
-+
-+ fp = bootsplash_load_firmware(&splash_state.splash_device->dev,
-+ buf);
-+
-+ if (!fp)
-+ return -ENXIO;
-+
-+ mutex_lock(&splash_state.data_lock);
-+ fp_old = splash_state.file;
-+ splash_state.splash_fb = NULL;
-+ splash_state.file = fp;
-+ mutex_unlock(&splash_state.data_lock);
-+
-+ /* Update the splash or text console */
-+ schedule_work(&splash_state.work_redraw_vc);
-+
-+ bootsplash_free_file(fp_old);
-+ return count;
-+}
-+
- static DEVICE_ATTR(enabled, 0644, splash_show_enabled, splash_store_enabled);
-+static DEVICE_ATTR(drop_splash, 0200, NULL, splash_store_drop_splash);
-+static DEVICE_ATTR(load_file, 0200, NULL, splash_store_load_file);
-
-
- static struct attribute *splash_dev_attrs[] = {
- &dev_attr_enabled.attr,
-+ &dev_attr_drop_splash.attr,
-+ &dev_attr_load_file.attr,
- NULL
- };
-
diff --git a/RFC-v3-12-13-tools-bootsplash-Add-a-basic-splash-file-creation-tool.patch b/RFC-v3-12-13-tools-bootsplash-Add-a-basic-splash-file-creation-tool.patch
deleted file mode 100644
index 69bde2e..0000000
--- a/RFC-v3-12-13-tools-bootsplash-Add-a-basic-splash-file-creation-tool.patch
+++ /dev/null
@@ -1,511 +0,0 @@
-diff --git a/MAINTAINERS b/MAINTAINERS
-index 7ffac272434e..ddff07cd794c 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -2715,6 +2715,7 @@ F: drivers/video/fbdev/core/bootsplash*.*
- F: drivers/video/fbdev/core/dummycon.c
- F: include/linux/bootsplash.h
- F: include/uapi/linux/bootsplash_file.h
-+F: tools/bootsplash/*
-
- BPF (Safe dynamic programs and tools)
- M: Alexei Starovoitov <ast@kernel.org>
-diff --git a/tools/bootsplash/.gitignore b/tools/bootsplash/.gitignore
-new file mode 100644
-index 000000000000..091b99a17567
---- /dev/null
-+++ b/tools/bootsplash/.gitignore
-@@ -0,0 +1 @@
-+bootsplash-packer
-diff --git a/tools/bootsplash/Makefile b/tools/bootsplash/Makefile
-new file mode 100644
-index 000000000000..0ad8e8a84942
---- /dev/null
-+++ b/tools/bootsplash/Makefile
-@@ -0,0 +1,9 @@
-+CC := $(CROSS_COMPILE)gcc
-+CFLAGS := -I../../include/uapi -I../../include -I../../usr/include
-+
-+PROGS := bootsplash-packer
-+
-+all: $(PROGS)
-+
-+clean:
-+ rm -fr $(PROGS)
-diff --git a/tools/bootsplash/bootsplash-packer.c b/tools/bootsplash/bootsplash-packer.c
-new file mode 100644
-index 000000000000..ffb6a8b69885
---- /dev/null
-+++ b/tools/bootsplash/bootsplash-packer.c
-@@ -0,0 +1,471 @@
-+/*
-+ * Kernel based bootsplash.
-+ *
-+ * (Splash file packer tool)
-+ *
-+ * Authors:
-+ * Max Staudt <mstaudt@suse.de>
-+ *
-+ * SPDX-License-Identifier: GPL-2.0
-+ */
-+
-+#include <endian.h>
-+#include <getopt.h>
-+#include <stdint.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+#include <linux/bootsplash_file.h>
-+
-+
-+static void print_help(char *progname)
-+{
-+ printf("Usage: %s [OPTIONS] outfile\n", progname);
-+ printf("\n"
-+ "Options, executed in order given:\n"
-+ " -h, --help Print this help message\n"
-+ "\n"
-+ " --bg_red <u8> Background color (red part)\n"
-+ " --bg_green <u8> Background color (green part)\n"
-+ " --bg_blue <u8> Background color (blue part)\n"
-+ " --bg_reserved <u8> (do not use)\n"
-+ " --frame_ms <u16> Minimum milliseconds between animation steps\n"
-+ "\n"
-+ " --picture Start describing the next picture\n"
-+ " --pic_width <u16> Picture width in pixels\n"
-+ " --pic_height <u16> Picture height in pixels\n"
-+ " --pic_position <u8> Coarse picture placement:\n"
-+ " 0x00 - Top left\n"
-+ " 0x01 - Top\n"
-+ " 0x02 - Top right\n"
-+ " 0x03 - Right\n"
-+ " 0x04 - Bottom right\n"
-+ " 0x05 - Bottom\n"
-+ " 0x06 - Bottom left\n"
-+ " 0x07 - Left\n"
-+ "\n"
-+ " Flags:\n"
-+ " 0x10 - Calculate offset from corner towards center,\n"
-+ " rather than from center towards corner\n"
-+ " --pic_position_offset <u16> Distance from base position in pixels\n"
-+ " --pic_anim_type <u8> Animation type:\n"
-+ " 0 - None\n"
-+ " 1 - Forward loop\n"
-+ " --pic_anim_loop <u8> Loop point for animation\n"
-+ "\n"
-+ " --blob <filename> Include next data stream\n"
-+ " --blob_type <u16> Type of data\n"
-+ " --blob_picture_id <u8> Picture to associate this blob with, starting at 0\n"
-+ " (default: number of last --picture)\n"
-+ "\n");
-+ printf("This tool will write %s files.\n\n",
-+#if __BYTE_ORDER == __BIG_ENDIAN
-+ "Big Endian (BE)");
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
-+ "Little Endian (LE)");
-+#else
-+#error
-+#endif
-+}
-+
-+
-+struct blob_entry {
-+ struct blob_entry *next;
-+
-+ char *fn;
-+
-+ struct splash_blob_header header;
-+};
-+
-+
-+static void dump_file_header(struct splash_file_header *h)
-+{
-+ printf(" --- File header ---\n");
-+ printf("\n");
-+ printf(" version: %5u\n", h->version);
-+ printf("\n");
-+ printf(" bg_red: %5u\n", h->bg_red);
-+ printf(" bg_green: %5u\n", h->bg_green);
-+ printf(" bg_blue: %5u\n", h->bg_blue);
-+ printf(" bg_reserved: %5u\n", h->bg_reserved);
-+ printf("\n");
-+ printf(" num_blobs: %5u\n", h->num_blobs);
-+ printf(" num_pics: %5u\n", h->num_pics);
-+ printf("\n");
-+ printf(" frame_ms: %5u\n", h->frame_ms);
-+ printf("\n");
-+}
-+
-+static void dump_pic_header(struct splash_pic_header *ph)
-+{
-+ printf(" --- Picture header ---\n");
-+ printf("\n");
-+ printf(" width: %5u\n", ph->width);
-+ printf(" height: %5u\n", ph->height);
-+ printf("\n");
-+ printf(" num_blobs: %5u\n", ph->num_blobs);
-+ printf("\n");
-+ printf(" position: %0x3x\n", ph->position);
-+ printf(" position_offset: %5u\n", ph->position_offset);
-+ printf("\n");
-+ printf(" anim_type: %5u\n", ph->anim_type);
-+ printf(" anim_loop: %5u\n", ph->anim_loop);
-+ printf("\n");
-+}
-+
-+static void dump_blob(struct blob_entry *b)
-+{
-+ printf(" --- Blob header ---\n");
-+ printf("\n");
-+ printf(" length: %7u\n", b->header.length);
-+ printf(" type: %7u\n", b->header.type);
-+ printf("\n");
-+ printf(" picture_id: %7u\n", b->header.picture_id);
-+ printf("\n");
-+}
-+
-+
-+#define OPT_MAX(var, max) \
-+ do { \
-+ if ((var) > max) { \
-+ fprintf(stderr, "--%s: Invalid value\n", \
-+ long_options[option_index].name); \
-+ break; \
-+ } \
-+ } while (0)
-+
-+static struct option long_options[] = {
-+ {"help", 0, 0, 'h'},
-+ {"bg_red", 1, 0, 10001},
-+ {"bg_green", 1, 0, 10002},
-+ {"bg_blue", 1, 0, 10003},
-+ {"bg_reserved", 1, 0, 10004},
-+ {"frame_ms", 1, 0, 10005},
-+ {"picture", 0, 0, 20000},
-+ {"pic_width", 1, 0, 20001},
-+ {"pic_height", 1, 0, 20002},
-+ {"pic_position", 1, 0, 20003},
-+ {"pic_position_offset", 1, 0, 20004},
-+ {"pic_anim_type", 1, 0, 20005},
-+ {"pic_anim_loop", 1, 0, 20006},
-+ {"blob", 1, 0, 30000},
-+ {"blob_type", 1, 0, 30001},
-+ {"blob_picture_id", 1, 0, 30002},
-+ {NULL, 0, NULL, 0}
-+};
-+
-+
-+int main(int argc, char **argv)
-+{
-+ FILE *of;
-+ char *ofn;
-+ int c;
-+ int option_index = 0;
-+
-+ unsigned long ul;
-+ struct splash_file_header fh = {};
-+ struct splash_pic_header ph[255];
-+ struct blob_entry *blob_first = NULL;
-+ struct blob_entry *blob_last = NULL;
-+ struct blob_entry *blob_cur = NULL;
-+
-+ if (argc < 2) {
-+ print_help(argv[0]);
-+ return EXIT_FAILURE;
-+ }
-+
-+
-+ /* Parse and and execute user commands */
-+ while ((c = getopt_long(argc, argv, "h",
-+ long_options, &option_index)) != -1) {
-+ switch (c) {
-+ case 10001: /* bg_red */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ fh.bg_red = ul;
-+ break;
-+ case 10002: /* bg_green */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ fh.bg_green = ul;
-+ break;
-+ case 10003: /* bg_blue */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ fh.bg_blue = ul;
-+ break;
-+ case 10004: /* bg_reserved */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ fh.bg_reserved = ul;
-+ break;
-+ case 10005: /* frame_ms */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 65535);
-+ fh.frame_ms = ul;
-+ break;
-+
-+
-+ case 20000: /* picture */
-+ if (fh.num_pics >= 255) {
-+ fprintf(stderr, "--%s: Picture array full\n",
-+ long_options[option_index].name);
-+ break;
-+ }
-+
-+ fh.num_pics++;
-+ break;
-+
-+ case 20001: /* pic_width */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 65535);
-+ ph[fh.num_pics - 1].width = ul;
-+ break;
-+
-+ case 20002: /* pic_height */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 65535);
-+ ph[fh.num_pics - 1].height = ul;
-+ break;
-+
-+ case 20003: /* pic_position */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ ph[fh.num_pics - 1].position = ul;
-+ break;
-+
-+ case 20004: /* pic_position_offset */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ ph[fh.num_pics - 1].position_offset = ul;
-+ break;
-+
-+ case 20005: /* pic_anim_type */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ ph[fh.num_pics - 1].anim_type = ul;
-+ break;
-+
-+ case 20006: /* pic_anim_loop */
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ ph[fh.num_pics - 1].anim_loop = ul;
-+ break;
-+
-+
-+ case 30000: /* blob */
-+ if (fh.num_blobs >= 65535) {
-+ fprintf(stderr, "--%s: Blob array full\n",
-+ long_options[option_index].name);
-+ break;
-+ }
-+
-+ blob_cur = calloc(1, sizeof(struct blob_entry));
-+ if (!blob_cur) {
-+ fprintf(stderr, "--%s: Out of memory\n",
-+ long_options[option_index].name);
-+ break;
-+ }
-+
-+ blob_cur->fn = optarg;
-+ if (fh.num_pics)
-+ blob_cur->header.picture_id = fh.num_pics - 1;
-+
-+ if (!blob_first)
-+ blob_first = blob_cur;
-+ if (blob_last)
-+ blob_last->next = blob_cur;
-+ blob_last = blob_cur;
-+ fh.num_blobs++;
-+ break;
-+
-+ case 30001: /* blob_type */
-+ if (!blob_cur) {
-+ fprintf(stderr, "--%s: No blob selected\n",
-+ long_options[option_index].name);
-+ break;
-+ }
-+
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ blob_cur->header.type = ul;
-+ break;
-+
-+ case 30002: /* blob_picture_id */
-+ if (!blob_cur) {
-+ fprintf(stderr, "--%s: No blob selected\n",
-+ long_options[option_index].name);
-+ break;
-+ }
-+
-+ ul = strtoul(optarg, NULL, 0);
-+ OPT_MAX(ul, 255);
-+ blob_cur->header.picture_id = ul;
-+ break;
-+
-+
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ print_help(argv[0]);
-+ goto EXIT;
-+ } /* switch (c) */
-+ } /* while ((c = getopt_long(...)) != -1) */
-+
-+ /* Consume and drop lone arguments */
-+ while (optind < argc) {
-+ ofn = argv[optind];
-+ optind++;
-+ }
-+
-+
-+ /* Read file lengths */
-+ for (blob_cur = blob_first; blob_cur; blob_cur = blob_cur->next) {
-+ FILE *f;
-+ long pos;
-+ int i;
-+
-+ if (!blob_cur->fn)
-+ continue;
-+
-+ f = fopen(blob_cur->fn, "rb");
-+ if (!f)
-+ goto ERR_FILE_LEN;
-+
-+ if (fseek(f, 0, SEEK_END))
-+ goto ERR_FILE_LEN;
-+
-+ pos = ftell(f);
-+ if (pos < 0 || pos > (1 << 30))
-+ goto ERR_FILE_LEN;
-+
-+ blob_cur->header.length = pos;
-+
-+ fclose(f);
-+ continue;
-+
-+ERR_FILE_LEN:
-+ fprintf(stderr, "Error getting file length (or too long): %s\n",
-+ blob_cur->fn);
-+ if (f)
-+ fclose(f);
-+ continue;
-+ }
-+
-+
-+ /* Set magic headers */
-+#if __BYTE_ORDER == __BIG_ENDIAN
-+ memcpy(&fh.id[0], BOOTSPLASH_MAGIC_BE, 16);
-+#elif __BYTE_ORDER == __LITTLE_ENDIAN
-+ memcpy(&fh.id[0], BOOTSPLASH_MAGIC_LE, 16);
-+#else
-+#error
-+#endif
-+ fh.version = BOOTSPLASH_VERSION;
-+
-+ /* Set blob counts */
-+ for (blob_cur = blob_first; blob_cur; blob_cur = blob_cur->next) {
-+ if (blob_cur->header.picture_id < fh.num_pics)
-+ ph[blob_cur->header.picture_id].num_blobs++;
-+ }
-+
-+
-+ /* Dump structs */
-+ dump_file_header(&fh);
-+
-+ for (ul = 0; ul < fh.num_pics; ul++)
-+ dump_pic_header(&ph[ul]);
-+
-+ for (blob_cur = blob_first; blob_cur; blob_cur = blob_cur->next)
-+ dump_blob(blob_cur);
-+
-+
-+ /* Write to file */
-+ printf("Writing splash to file: %s\n", ofn);
-+ of = fopen(ofn, "wb");
-+ if (!of)
-+ goto ERR_WRITING;
-+
-+ if (fwrite(&fh, sizeof(struct splash_file_header), 1, of) != 1)
-+ goto ERR_WRITING;
-+
-+ for (ul = 0; ul < fh.num_pics; ul++) {
-+ if (fwrite(&ph[ul], sizeof(struct splash_pic_header), 1, of)
-+ != 1)
-+ goto ERR_WRITING;
-+ }
-+
-+ blob_cur = blob_first;
-+ while (blob_cur) {
-+ struct blob_entry *blob_old = blob_cur;
-+ FILE *f;
-+ char *buf[256];
-+ uint32_t left;
-+
-+ if (fwrite(&blob_cur->header,
-+ sizeof(struct splash_blob_header), 1, of) != 1)
-+ goto ERR_WRITING;
-+
-+ if (!blob_cur->header.length || !blob_cur->fn)
-+ continue;
-+
-+ f = fopen(blob_cur->fn, "rb");
-+ if (!f)
-+ goto ERR_FILE_COPY;
-+
-+ left = blob_cur->header.length;
-+ while (left >= sizeof(buf)) {
-+ if (fread(buf, sizeof(buf), 1, f) != 1)
-+ goto ERR_FILE_COPY;
-+ if (fwrite(buf, sizeof(buf), 1, of) != 1)
-+ goto ERR_FILE_COPY;
-+ left -= sizeof(buf);
-+ }
-+ if (left) {
-+ if (fread(buf, left, 1, f) != 1)
-+ goto ERR_FILE_COPY;
-+ if (fwrite(buf, left, 1, of) != 1)
-+ goto ERR_FILE_COPY;
-+ }
-+
-+ /* Pad data stream to 16 bytes */
-+ if (left % 16) {
-+ if (fwrite("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
-+ 16 - (left % 16), 1, of) != 1)
-+ goto ERR_FILE_COPY;
-+ }
-+
-+ fclose(f);
-+ blob_cur = blob_cur->next;
-+ free(blob_old);
-+ continue;
-+
-+ERR_FILE_COPY:
-+ if (f)
-+ fclose(f);
-+ goto ERR_WRITING;
-+ }
-+
-+ fclose(of);
-+
-+EXIT:
-+ return EXIT_SUCCESS;
-+
-+
-+ERR_WRITING:
-+ fprintf(stderr, "Error writing splash.\n");
-+ fprintf(stderr, "The output file is probably corrupt.\n");
-+ if (of)
-+ fclose(of);
-+
-+ while (blob_cur) {
-+ struct blob_entry *blob_old = blob_cur;
-+
-+ blob_cur = blob_cur->next;
-+ free(blob_old);
-+ }
-+
-+ return EXIT_FAILURE;
-+}
diff --git a/RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-file.patch b/RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-file.patch
deleted file mode 100644
index 124ad07..0000000
--- a/RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-file.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-diff --git a/Documentation/bootsplash.rst b/Documentation/bootsplash.rst
-index b35aba5093e8..d4f132eca615 100644
---- a/Documentation/bootsplash.rst
-+++ b/Documentation/bootsplash.rst
-@@ -195,6 +195,16 @@ Hooks - how the bootsplash is integrated
-
-
-
-+Crating a bootsplash theme file
-+===============================
-+
-+A simple tool for theme file creation is included in ``tools/bootsplash``.
-+
-+There is also an example shell script, as an example on how to use the tool
-+and in order to generate a reference bootsplash file.
-+
-+
-+
- FAQ: Frequently Asked Questions
- ===============================
-
-diff --git a/tools/bootsplash/.gitignore b/tools/bootsplash/.gitignore
-index 091b99a17567..5dfced41ba82 100644
---- a/tools/bootsplash/.gitignore
-+++ b/tools/bootsplash/.gitignore
-@@ -1 +1,4 @@
- bootsplash-packer
-+bootsplash
-+logo.rgb
-+throbber*.rgb
-diff --git a/tools/bootsplash/ajax-loader.gif b/tools/bootsplash/ajax-loader.gif
-new file mode 100644
-index 0000000000000000000000000000000000000000..3288d1035d70bb86517e2c233f1a904e41f06b29
-GIT binary patch
-literal 3208
-zcmc(iX;4#H9>pJdFE7h`I{IF)0|5<6L}(j=N}5%L009EB2nYfyF)E0PvIqo$u!IC;
-z4PgyY5|S9AEh38G)(9eq4TbH7_UHg@yWrlIJ$6smIADL7s^P;_O;ykRc<bJ}b<Y2s
-zU)AOL`#QVCGXW;>9soXl`UC*LwQJXkii*0rx|*7rI2=x7WaRkx_~XZqFJ8R3c=2Kg
-zf@aSAv8+BJ8+^hyay>(QR@t*blbKzsf0}bscEqRc5Hd3o(-N5RyW=zWB*zQw6Zh>*
-z2CROCDAbu#D`)S|J_<lj7Yz9)#_Og>o(lL9Yn3l*+8RdiRD_>iNz$#_IAzCna&Wl5
-zSF_(rRCDD!wi#i8oAm&jYtn2_@VB%2-H*G%bN#|(6R6N?wM)3u`PiGzwuX7qmTgyF
-zpE)h0kuoxQ9?=kW7Y!=R@DmhU9)vwT<ZMc0Y;&y4jY1%TT3z!|H=R-GXDHPiKcVWh
-zY+!etO=DI2rIs8{iFWtPv(Lu|O3u|$F3Sbq;+xF{gTX$#T%m?MUUZy&ug3$=zXgXj
-zrxrf}reg*D3HB~8JyLgl$UCyV?EQ`@OKjW@tGrvh6ZqPD#+m=rK0T{FT01>*EZWzJ
-zrt+=2tqFts72yIp?|gvdLhs8Hfku^Z(){gmN%Y=K#<L1VKWYjwV^JDyeS;Y$p1xw*
-z#3VzfAV>P|%fkvg<hUP3U1Q=Hdgg~ik+2zyAc79kpuA<f*-~l+ZBH3*S2jBrEOF0w
-zrxe9#Vx$SxnL0JE4WeeXY1)ppOIy3@Vvexu&oeIa&QvoD`jBE#Gd7rT{j&OMLz1Wu
-zOEj;)PR^=mxjCG0NOUJb&U;ui6*-`3&wmcQ>Uj~HfIp3CuXqCtYGtJ#me+n+-LmP(
-z*XNuk%!aH8bIE@_Bj46>M*dSro|7<6vZ7WUHh5YQzN$>IJFqCb|CT!wj~R2C2%=q{
-zpt8rzY$aw?W?=Ustv{jo?Ow@<k6~~d?F>ZRkLe<)NItY>Cyhle*wR59dTdF6(@{5^
-zAQBOB*hNtc3bkY-8{Cm$nFS@elbTtSqrt7MB{h_4y+~`!mVa}?c&N>&?P}GqdMuhQ
-z&@TD5Czd((DcG_Su~dKKV)Pj$-qi1WHM8_vc^O4?^!oY|tmK~i!{fjd&@_1E(T~r7
-z_REZy&hMT^ySJB3W7l<L=l9ZMvC<Gz>$4YhR`M(J7S5S~+4Q&3HPa)z%zPpisOp$^
-zTEe99ig2$5_qFr!$;<oK+H}=wcaT3=%Nm!;Kw7MHnU5paWS{tI1+DOU?!7xefZ57L
-ze_iPrUrRQct0FSCtTFLtg*<#jo}Z3{E?T{skj>7A6CJ}PJmRhli>w?LC}Y`#HLGy6
-zMU4<C6_PR!wGq`HQyoWJb;nj8>EhL~dKCN5Ut;U2jd*83ShB<kA1Y@1U)Ar;N|HhS
-znIkwkT(&i5XhkI;xwmC%DvPhGNIi?aY<|8rajSt<ap(2E-#qSPQxAp@jIY@-@>Niu
-zcJB0l9>1Modc?-oM<<M{t-|U0{*W+=Ct2ZY_02y-De{7vW<f^HJQhd1l&4)Gw2oOS
-zm46KASlsKI@J$sA#$$|7D5QMbewIaFv4fXyNbL5Ac~kS&g^#5XHaYBvNxbF3Y2L*6
-ztrn?JmgOFAo1lh99BEb^pp>R<Z&2wFwWd*z2wF6&nmW9}nyMfWMO`hc&zkr2AeBP3
-zj75NZQ8-VthLviI^j@e=FN6wxR@1uCRv<b;Y<3t(dr<e}N%b}FQtKxHi9xU2C!#0Z
-zO2<#(;s&964KtWfkQVi``vIFT7kbT~d;ITb0T9+U1AwIgET*ciil)~4gl;xgoy5M!
-z-UJHerGNh_`lO!vA)%ly=~<}ykhlnQnoP$oqido+`qK(cOpmt^pbhf`n-FQaIK5ix
-zq@=#Sl2Y&s<pe8B!1!YA78W7dA?2Xu9v7QHc?}NN)sx(o6iZ#|kHX64nijZG(yB1J
-zfMQm;1rb5O!-+1Pov;csFu7z>4?<d6>}3g}UJ%@K);kriq>)e*rh%hdqM)5Q)*+O8
-zXm;SEbs@koiYS!9YXIclSg+5m_s~yrW#kKMdiRszg(gCP5HPmP7L)vCf8@fxUh6qY
-z@Z#TmkjzAZX{rwE+q|K~F2v5{_@vt%>yT_a#fF03SFt{0RX<yi^Bg0BS3UHmG;U4d
-z`2QlHs<l7ezUo)s<V^9ZccYv>vDAiaY~K9CgS1O>frXgAjBCS}mEd4mIWZ$=ovd5|
-zR?GRdU}d6+Q`+JRW)|=v7$)X<at#L3(d9WVd8CstDNPh>Nkn3yE`!nAiSCvOB1jKT
-zG<1aK3s<0b0m==egTD#8i(<nFTpHvxfx|aIng5yR81z6E<naz8-Ow^p@sCs8mz=%h
-zO$v$X0NS?ofjnp~62AE}^z%gY8Nsqj=NwUqyj+o6s$@kK@d+U4Vp-^_G32vzv@8nI
-z01{`FL$DXQL%WB*9R<xn7$ya31flsbiVh+-0m=YeB_ocaW;YRxI51d(jP?N!ane91
-z9~^yzJ;S;OWRKC8PrrXYkZCaruNYE>Of=1pGDTOCho0XpIOMQ&P87cVKY1W=C6kIg
-z9cH=@a&zbm2+`|{(_?YC9fdm?1TY~-pwlBn?>=(~1pDKbco6jloP;0-cqRiwV1A_S
-zEyV0Dj8Pwy!nekzaN>{)7rgZ&_QLxK{~1yRe865^<m)Ax^m58MY|zev&92(G7#vQU
-zn~8r)5oUrwM9`}05|I<Nx*n}jlvg&C9_310Dd4OT2txd91Z*_U8bRtrNaq+nGd{E#
-zVGckZFpr^;mv}%%T{jHtz<a=^%;mPXVY7SR`@6_Uw@(0*>yx>}+a!ECd>#MMwddow
-z@CU{l+Rt$xuXuf}?ga{3IAr?Raql^c@a%sI0U5m}HvJ5O1#I%_MMPt#BH>OqUZ{-k
-zt>4Xzz=%jT*FVW(uYkWyx}9Gw$HdN*qU?Bit#ji(Wi7p-u|_8?h^%szIS^s^fNM}b
-zgGy>|=cbEufpguY5_6w~&ZLv=Bo06UF9EYIY;Er-1VK)SyF&!|J{axiE1z^(hXwVq
-zsFS=K-#zC}CcOs^8W{KAt+kK)jYDgDYbCXv{{<mZ_TMxh0{w%6lzzG*pm+Dj4XaZ5
-zoJwkk5)~fyUmzYbwMERR3j)XePHj^2P!5GK`~^RXuEz>rwsgqtIU3<910$CJi)s??
-z_t8k{>7*0~4l~LLF7$WXT5OSq5QCTbP_l!SN|{R}3D&eWA8~0ltWh1IL+ZBX4rRSt
-zWF6Om3WDMu4xK^1(BF`2cL}rUCzhHAB`@j5&R-yk_l*t;mPGY|u2^o|myvcOdrg0W
-z%=lX;f^Vkqfp?u7*4qQq%A3Mpf!xspWBSKS@O%r*TSM}?dl(@*%{0Jm_8;(h{R__M
-Bt<?Yk
-
-literal 0
-HcmV?d00001
-
-diff --git a/tools/bootsplash/bootsplash-tux.sh b/tools/bootsplash/bootsplash-tux.sh
-new file mode 100755
-index 000000000000..1078f87644b9
---- /dev/null
-+++ b/tools/bootsplash/bootsplash-tux.sh
-@@ -0,0 +1,66 @@
-+#!/bin/bash
-+#
-+# A simple script to show how to create a bootsplash.
-+# Do with it whatever you wish.
-+#
-+# This needs ImageMagick for the 'convert' and 'identify' tools.
-+#
-+
-+LOGO=../../Documentation/logo.gif
-+LOGO_WIDTH=$(identify $LOGO | cut -d " " -f 3 | cut -d x -f 1)
-+LOGO_HEIGHT=$(identify $LOGO | cut -d " " -f 3 | cut -d x -f 2)
-+
-+THROBBER=ajax-loader.gif
-+THROBBER_WIDTH=$(identify $THROBBER | head -1 | cut -d " " -f 3 | \
-+ cut -d x -f 1)
-+THROBBER_HEIGHT=$(identify $THROBBER | head -1 | cut -d " " -f 3 | \
-+ cut -d x -f 2)
-+
-+convert -alpha remove \
-+ -background "#ff3a40" \
-+ $LOGO \
-+ logo.rgb
-+
-+convert -alpha remove \
-+ -background "#ff3a40" \
-+ $THROBBER \
-+ throbber%02d.rgb
-+
-+
-+make clean
-+make bootsplash-packer
-+
-+
-+# Let's put Tux in the center of an orange background.
-+./bootsplash-packer \
-+ --bg_red 0xff \
-+ --bg_green 0x3a \
-+ --bg_blue 0x40 \
-+ --frame_ms 48 \
-+ --picture \
-+ --pic_width $LOGO_WIDTH \
-+ --pic_height $LOGO_HEIGHT \
-+ --pic_position 0 \
-+ --blob logo.rgb \
-+ --picture \
-+ --pic_width $THROBBER_WIDTH \
-+ --pic_height $THROBBER_HEIGHT \
-+ --pic_position 0x14 \
-+ --pic_position_offset 20 \
-+ --pic_anim_type 1 \
-+ --pic_anim_loop 0 \
-+ --blob throbber00.rgb \
-+ --blob throbber01.rgb \
-+ --blob throbber02.rgb \
-+ --blob throbber03.rgb \
-+ --blob throbber04.rgb \
-+ --blob throbber05.rgb \
-+ --blob throbber06.rgb \
-+ --blob throbber07.rgb \
-+ --blob throbber08.rgb \
-+ --blob throbber09.rgb \
-+ --blob throbber10.rgb \
-+ --blob throbber11.rgb \
-+ bootsplash
-+
-+rm *.rgb
diff --git a/android-enable-building-ashmem-and-binder-as-modules.patch b/android-enable-building-ashmem-and-binder-as-modules.patch
index 115ec80..6428a5c 100644
--- a/android-enable-building-ashmem-and-binder-as-modules.patch
+++ b/android-enable-building-ashmem-and-binder-as-modules.patch
@@ -21,8 +21,6 @@ need them.
drivers/staging/android/ashmem.c | 3 +++
6 files changed, 12 insertions(+), 7 deletions(-)
-diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
-index 6fdf2abe4598..329ec9941fbf 100644
--- a/drivers/android/Kconfig
+++ b/drivers/android/Kconfig
@@ -9,7 +9,7 @@ config ANDROID
@@ -34,8 +32,6 @@ index 6fdf2abe4598..329ec9941fbf 100644
depends on MMU
default n
---help---
-diff --git a/drivers/android/Makefile b/drivers/android/Makefile
-index c9d3d0c99c25..55411d9a9c2a 100644
--- a/drivers/android/Makefile
+++ b/drivers/android/Makefile
@@ -1,6 +1,7 @@
@@ -49,11 +45,9 @@ index c9d3d0c99c25..55411d9a9c2a 100644
+binder_linux-y := binder.o binder_alloc.o
+binder_linux-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
+binder_linux-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
-diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
-index ce5603c2291c..099fef731148 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
-@@ -37,7 +37,7 @@ enum {
+@@ -38,7 +38,7 @@ enum {
};
static uint32_t binder_alloc_debug_mask = BINDER_DEBUG_USER_ERROR;
@@ -62,8 +56,6 @@ index ce5603c2291c..099fef731148 100644
uint, 0644);
#define binder_alloc_debug(mask, x...) \
-diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
-index d6d605d5cbde..afe9085369a3 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -4,7 +4,7 @@ menu "Android"
@@ -75,20 +67,15 @@ index d6d605d5cbde..afe9085369a3 100644
depends on SHMEM
help
The ashmem subsystem is a new shared memory allocator, similar to
-diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
-index 14bd9c6ce10d..c202aa4f8323 100644
--- a/drivers/staging/android/Makefile
+++ b/drivers/staging/android/Makefile
-@@ -3,5 +3,6 @@ ccflags-y += -I$(src) # needed for trace events
+@@ -3,4 +3,5 @@ ccflags-y += -I$(src) # needed for tra
obj-y += ion/
-obj-$(CONFIG_ASHMEM) += ashmem.o
+obj-$(CONFIG_ASHMEM) += ashmem_linux.o
+ashmem_linux-y += ashmem.o
- obj-$(CONFIG_ANDROID_VSOC) += vsoc.o
-diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
-index 74d497d39c5a..fbbe467b0ba8 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -24,6 +24,7 @@
@@ -99,12 +86,9 @@ index 74d497d39c5a..fbbe467b0ba8 100644
#include "ashmem.h"
#define ASHMEM_NAME_PREFIX "dev/ashmem/"
-@@ -925,3 +926,5 @@ static int __init ashmem_init(void)
+@@ -953,3 +954,5 @@ out:
return ret;
}
device_initcall(ashmem_init);
+
+MODULE_LICENSE("GPL v2");
---
-2.20.1
-
diff --git a/common-desktop.config b/common-desktop.config
index ee8e309..d7b0c2f 100644
--- a/common-desktop.config
+++ b/common-desktop.config
@@ -5,6 +5,7 @@
# CONFIG_EARLY_PRINTK is not set
# CONFIG_EARLY_PRINTK_USB is not set
# CONFIG_EARLY_PRINTK_USB_XDBC is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
CONFIG_SCHED_MUQSS=y
@@ -35,7 +36,8 @@ CONFIG_UKSM=y
# Processor type and features
#
# CONFIG_PREEMPT_NONE is not set
-# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
-# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_COUNT=y
+CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_HZ_1000=y
+CONFIG_HZ=1000
diff --git a/common-server.config b/common-server.config
index a6d6012..b56c92e 100644
--- a/common-server.config
+++ b/common-server.config
@@ -31,3 +31,7 @@ CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT is not set
# CONFIG_PREEMPT_COUNT is not set
CONFIG_SLAB=y
+CONFIG_HZ_300=y
+CONFIG_HZ=300
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_100 is not set
diff --git a/common.config b/common.config
index 8eaaac4..939ee41 100644
--- a/common.config
+++ b/common.config
@@ -361,6 +361,7 @@ CONFIG_NET_KEY_MIGRATE=y
CONFIG_SMC=m
CONFIG_SMC_DIAG=m
# CONFIG_XDP_SOCKETS is not set
+# CONFIG_PNP_DEBUG_MESSAGES is not set
CONFIG_IP_ROUTE_CLASSID=y
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
@@ -373,6 +374,8 @@ CONFIG_NET_IPVTI=m
CONFIG_NET_UDP_TUNNEL=m
CONFIG_NET_FOU=m
CONFIG_NET_FOU_IP_TUNNELS=y
+CONFIG_WIREGUARD=m
+# CONFIG_WIREGUARD_DEBUG is not set
CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_ESP_OFFLOAD=m
@@ -859,6 +862,7 @@ CONFIG_NET_SCH_QFQ=m
CONFIG_NET_SCH_CODEL=m
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_SCH_FQ=m
+CONFIG_NET_SCH_FQ_PIE=m
CONFIG_NET_SCH_HHF=m
CONFIG_NET_SCH_PIE=m
CONFIG_NET_SCH_INGRESS=m
@@ -1429,7 +1433,7 @@ CONFIG_IDE_GD_ATAPI=y
CONFIG_BLK_DEV_IDECS=m
CONFIG_BLK_DEV_DELKIN=m
CONFIG_BLK_DEV_IDECD=m
-CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
+# CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS is not set
CONFIG_BLK_DEV_IDETAPE=m
CONFIG_BLK_DEV_IDEACPI=y
CONFIG_IDE_TASK_IOCTL=y
@@ -4332,7 +4336,7 @@ CONFIG_DRM_AMDGPU=m
CONFIG_DRM_AMDGPU_SI=y
CONFIG_DRM_AMDGPU_CIK=y
CONFIG_DRM_AMDGPU_USERPTR=y
-CONFIG_DRM_AMDGPU_GART_DEBUGFS=y
+# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set
CONFIG_DRM_AMD_ACP=y
#
@@ -4348,8 +4352,8 @@ CONFIG_CHASH=m
# CONFIG_CHASH_STATS is not set
# CONFIG_CHASH_SELFTEST is not set
CONFIG_DRM_NOUVEAU=m
-CONFIG_NOUVEAU_DEBUG=5
-CONFIG_NOUVEAU_DEBUG_DEFAULT=3
+CONFIG_NOUVEAU_DEBUG=3
+CONFIG_NOUVEAU_DEBUG_DEFAULT=1
# CONFIG_NOUVEAU_DEBUG_MMU is not set
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_I915=m
@@ -4534,7 +4538,7 @@ CONFIG_SOUND=m
CONFIG_SOUND_OSS_CORE=y
# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
CONFIG_SND=m
-CONFIG_SND_DEBUG_VERBOSE=y
+# CONFIG_SND_DEBUG_VERBOSE is not set
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_PCM_ELD=y
@@ -7036,7 +7040,7 @@ CONFIG_LRU_CACHE=m
CONFIG_CORDIC=m
CONFIG_DDR=y
CONFIG_IRQ_POLL=y
-CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=2
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_UNUSED_SYMBOLS=y
@@ -7093,7 +7097,7 @@ CONFIG_RING_BUFFER_BENCHMARK=m
CONFIG_TRACING_EVENTS_GPIO=y
# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
# CONFIG_RUNTIME_TESTING_MENU is not set
-CONFIG_MEMTEST=y
+# CONFIG_MEMTEST is not set
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IO_WQ=y
# CONFIG_EARLY_PRINTK_DBGP is not set
diff --git a/cpupower-gcc10.patch b/cpupower-gcc10.patch
deleted file mode 100644
index 58ea7a3..0000000
--- a/cpupower-gcc10.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -up linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c.omv~ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
---- linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c.omv~ 2020-02-13 17:52:30.247315834 +0100
-+++ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c 2020-02-13 17:52:36.175315446 +0100
-@@ -13,6 +13,8 @@
- #include "helpers/helpers.h"
- #include "idle_monitor/cpupower-monitor.h"
-
-+int cpu_count;
-+
- #define CPUIDLE_STATES_MAX 10
- static cstate_t cpuidle_cstates[CPUIDLE_STATES_MAX];
- struct cpuidle_monitor cpuidle_sysfs_monitor;
-diff -up linux-5.5/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h.omv~ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
---- linux-5.5/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h.omv~ 2020-02-13 17:51:59.327317859 +0100
-+++ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h 2020-02-13 17:52:07.205317343 +0100
-@@ -25,7 +25,7 @@
- #endif
- #define CSTATE_DESC_LEN 60
-
--int cpu_count;
-+extern int cpu_count;
-
- /* Hard to define the right names ...: */
- enum power_range_e {
-diff -up linux-5.5/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c.omv~ linux-5.5/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
---- linux-5.5/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c.omv~ 2020-02-13 21:38:49.575426637 +0100
-+++ linux-5.5/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c 2020-02-13 21:38:55.711426235 +0100
-@@ -82,7 +82,7 @@ static struct pci_access *pci_acc;
- static struct pci_dev *amd_fam14h_pci_dev;
- static int nbp1_entered;
-
--struct timespec start_time;
-+static struct timespec start_time;
- static unsigned long long timediff;
-
- #ifdef DEBUG
-diff -up linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c.omv~ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
---- linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c.omv~ 2020-02-13 21:38:30.488427887 +0100
-+++ linux-5.5/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c 2020-02-13 21:38:40.148427254 +0100
-@@ -21,7 +21,7 @@ struct cpuidle_monitor cpuidle_sysfs_mon
-
- static unsigned long long **previous_count;
- static unsigned long long **current_count;
--struct timespec start_time;
-+static struct timespec start_time;
- static unsigned long long timediff;
-
- static int cpuidle_get_count_percent(unsigned int id, double *percent,
diff --git a/drm-i915-perf-Reverse-a-ternary-to-make-sparse-happy.patch b/drm-i915-perf-Reverse-a-ternary-to-make-sparse-happy.patch
deleted file mode 100644
index 18d1082..0000000
--- a/drm-i915-perf-Reverse-a-ternary-to-make-sparse-happy.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -up linux-5.5/drivers/gpu/drm/i915/i915_perf.c.46~ linux-5.5/drivers/gpu/drm/i915/i915_perf.c
---- linux-5.5/drivers/gpu/drm/i915/i915_perf.c.46~ 2020-03-18 10:40:48.112632296 +0100
-+++ linux-5.5/drivers/gpu/drm/i915/i915_perf.c 2020-03-18 10:41:57.531824858 +0100
-@@ -2462,6 +2462,13 @@ gen8_enable_metric_set(struct i915_perf_
- return emit_oa_config(stream, oa_config, oa_context(stream));
- }
-
-+static u32 oag_report_ctx_switches(const struct i915_perf_stream *stream)
-+{
-+ return _MASKED_FIELD(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS,
-+ (stream->sample_flags & SAMPLE_OA_REPORT) ?
-+ 0 : GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS);
-+}
-+
- static struct i915_request *
- gen12_enable_metric_set(struct i915_perf_stream *stream)
- {
-@@ -2476,12 +2483,10 @@ gen12_enable_metric_set(struct i915_perf
- _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CLK_RATIO_REPORTS |
- GEN12_OAG_OA_DEBUG_INCLUDE_CLK_RATIO) |
- /*
-- * If the user didn't require OA reports, instruct the
-- * hardware not to emit ctx switch reports.
-+ * If the user didn't require OA reports, instruct
-+ * the hardware not to emit ctx switch reports.
- */
-- !(stream->sample_flags & SAMPLE_OA_REPORT) ?
-- _MASKED_BIT_ENABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS) :
-- _MASKED_BIT_DISABLE(GEN12_OAG_OA_DEBUG_DISABLE_CTX_SWITCH_REPORTS));
-+ oag_report_ctx_switches(stream));
-
- intel_uncore_write(uncore, GEN12_OAG_OAGLBCTXCTRL, periodic ?
- (GEN12_OAG_OAGLBCTXCTRL_COUNTER_RESUME |
diff --git a/extra-wifi-drivers-port-to-5.6.patch b/extra-wifi-drivers-port-to-5.6.patch
new file mode 100644
index 0000000..adcce3b
--- /dev/null
+++ b/extra-wifi-drivers-port-to-5.6.patch
@@ -0,0 +1,412 @@
+diff -up linux-5.6-rc4/drivers/net/wireless/rtl8723de/os_dep/linux/rtw_proc.c.omv~ linux-5.6-rc4/drivers/net/wireless/rtl8723de/os_dep/linux/rtw_proc.c
+--- linux-5.6-rc4/drivers/net/wireless/rtl8723de/os_dep/linux/rtw_proc.c.omv~ 2020-03-02 19:01:13.164067081 +0100
++++ linux-5.6-rc4/drivers/net/wireless/rtl8723de/os_dep/linux/rtw_proc.c 2020-03-02 23:08:55.704439445 +0100
+@@ -69,12 +69,12 @@ inline struct proc_dir_entry *rtw_proc_c
+ }
+
+ inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
+- const struct file_operations *fops, void * data)
++ const struct proc_ops *ops, void * data)
+ {
+ struct proc_dir_entry *entry;
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
+- entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
++ entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, ops, data);
+ #else
+ entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
+ if (entry) {
+@@ -219,22 +219,20 @@ static ssize_t rtw_drv_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_drv_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_drv_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_drv_proc_write,
++static const struct proc_ops rtw_drv_proc_seq_ops = {
++ .proc_open = rtw_drv_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_drv_proc_write,
+ };
+
+-static const struct file_operations rtw_drv_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_drv_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_drv_proc_write,
++static const struct proc_ops rtw_drv_proc_sseq_ops = {
++ .proc_open = rtw_drv_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_drv_proc_write,
+ };
+
+ int rtw_drv_proc_init(void)
+@@ -257,9 +255,9 @@ int rtw_drv_proc_init(void)
+
+ for (i = 0; i < drv_proc_hdls_num; i++) {
+ if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_ops, (void *)i);
+ else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -2335,22 +2333,20 @@ static ssize_t rtw_adapter_proc_write(st
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_adapter_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_adapter_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_adapter_proc_write,
++static const struct proc_ops rtw_adapter_proc_seq_ops = {
++ .proc_open = rtw_adapter_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_adapter_proc_write,
+ };
+
+-static const struct file_operations rtw_adapter_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_adapter_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_adapter_proc_write,
++static const struct proc_ops rtw_adapter_proc_sseq_ops = {
++ .proc_open = rtw_adapter_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_adapter_proc_write,
+ };
+
+ int proc_get_odm_dbg_comp(struct seq_file *m, void *v)
+@@ -2670,22 +2666,20 @@ static ssize_t rtw_odm_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_odm_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_odm_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_odm_proc_write,
++static const struct proc_ops rtw_odm_proc_seq_ops = {
++ .proc_open = rtw_odm_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_odm_proc_write,
+ };
+
+-static const struct file_operations rtw_odm_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_odm_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_odm_proc_write,
++static const struct proc_ops rtw_odm_proc_sseq_ops = {
++ .proc_open = rtw_odm_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_odm_proc_write,
+ };
+
+ struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
+@@ -2715,9 +2709,9 @@ struct proc_dir_entry *rtw_odm_proc_init
+
+ for (i = 0; i < odm_proc_hdls_num; i++) {
+ if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_ops, (void *)i);
+ else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -2809,22 +2803,20 @@ static ssize_t rtw_mcc_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_mcc_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_mcc_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_mcc_proc_write,
++static const struct file_operations rtw_mcc_proc_seq_ops = {
++ .proc_open = rtw_mcc_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_mcc_proc_write,
+ };
+
+-static const struct file_operations rtw_mcc_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_mcc_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_mcc_proc_write,
++static const struct file_operations rtw_mcc_proc_sseq_ops = {
++ .proc_open = rtw_mcc_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_mcc_proc_write,
+ };
+
+ struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
+@@ -2854,9 +2846,9 @@ struct proc_dir_entry *rtw_mcc_proc_init
+
+ for (i = 0; i < mcc_proc_hdls_num; i++) {
+ if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_ops, (void *)i);
+ else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -2920,9 +2912,9 @@ struct proc_dir_entry *rtw_adapter_proc_
+
+ for (i = 0; i < adapter_proc_hdls_num; i++) {
+ if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_ops, (void *)i);
+ else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+diff -up linux-5.6-rc4/drivers/net/wireless/rtl8821ce/os_dep/linux/rtw_proc.c.omv~ linux-5.6-rc4/drivers/net/wireless/rtl8821ce/os_dep/linux/rtw_proc.c
+--- linux-5.6-rc4/drivers/net/wireless/rtl8821ce/os_dep/linux/rtw_proc.c.omv~ 2020-03-02 23:04:39.749450254 +0100
++++ linux-5.6-rc4/drivers/net/wireless/rtl8821ce/os_dep/linux/rtw_proc.c 2020-03-02 23:08:18.209441028 +0100
+@@ -62,12 +62,12 @@ inline struct proc_dir_entry *rtw_proc_c
+ }
+
+ inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
+- const struct file_operations *fops, void * data)
++ const struct proc_ops *ops, void * data)
+ {
+ struct proc_dir_entry *entry;
+
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))
+- entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, fops, data);
++ entry = proc_create_data(name, S_IFREG | S_IRUGO | S_IWUGO, parent, ops, data);
+ #else
+ entry = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUGO, parent);
+ if (entry) {
+@@ -238,22 +238,20 @@ static ssize_t rtw_drv_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_drv_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_drv_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_drv_proc_write,
++static const struct proc_ops rtw_drv_proc_seq_ops = {
++ .proc_open = rtw_drv_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_drv_proc_write,
+ };
+
+-static const struct file_operations rtw_drv_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_drv_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_drv_proc_write,
++static const struct proc_ops rtw_drv_proc_sseq_ops = {
++ .proc_open = rtw_drv_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_drv_proc_write,
+ };
+
+ int rtw_drv_proc_init(void)
+@@ -276,9 +274,9 @@ int rtw_drv_proc_init(void)
+
+ for (i = 0; i < drv_proc_hdls_num; i++) {
+ if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_seq_ops, (void *)i);
+ else if (drv_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -3899,22 +3897,20 @@ static ssize_t rtw_adapter_proc_write(st
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_adapter_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_adapter_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_adapter_proc_write,
++static const struct proc_ops rtw_adapter_proc_seq_ops = {
++ .proc_open = rtw_adapter_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_adapter_proc_write,
+ };
+
+-static const struct file_operations rtw_adapter_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_adapter_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_adapter_proc_write,
++static const struct proc_ops rtw_adapter_proc_sseq_ops = {
++ .proc_open = rtw_adapter_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_adapter_proc_write,
+ };
+
+ int proc_get_odm_adaptivity(struct seq_file *m, void *v)
+@@ -4068,22 +4064,20 @@ static ssize_t rtw_odm_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_odm_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_odm_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_odm_proc_write,
++static const struct proc_ops rtw_odm_proc_seq_ops = {
++ .proc_open = rtw_odm_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_odm_proc_write,
+ };
+
+-static const struct file_operations rtw_odm_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_odm_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_odm_proc_write,
++static const struct proc_ops rtw_odm_proc_sseq_ops = {
++ .proc_open = rtw_odm_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_odm_proc_write,
+ };
+
+ struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
+@@ -4113,9 +4107,9 @@ struct proc_dir_entry *rtw_odm_proc_init
+
+ for (i = 0; i < odm_proc_hdls_num; i++) {
+ if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_seq_ops, (void *)i);
+ else if (odm_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -4209,22 +4203,20 @@ static ssize_t rtw_mcc_proc_write(struct
+ return -EROFS;
+ }
+
+-static const struct file_operations rtw_mcc_proc_seq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_mcc_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = seq_release,
+- .write = rtw_mcc_proc_write,
++static const struct proc_ops rtw_mcc_proc_seq_ops = {
++ .proc_open = rtw_mcc_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = seq_release,
++ .proc_write = rtw_mcc_proc_write,
+ };
+
+-static const struct file_operations rtw_mcc_proc_sseq_fops = {
+- .owner = THIS_MODULE,
+- .open = rtw_mcc_proc_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+- .write = rtw_mcc_proc_write,
++static const struct proc_ops rtw_mcc_proc_sseq_ops = {
++ .proc_open = rtw_mcc_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++ .proc_write = rtw_mcc_proc_write,
+ };
+
+ struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
+@@ -4254,9 +4246,9 @@ struct proc_dir_entry *rtw_mcc_proc_init
+
+ for (i = 0; i < mcc_proc_hdls_num; i++) {
+ if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_seq_ops, (void *)i);
+ else if (mcc_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(mcc_proc_hdls[i].name, dir_mcc, &rtw_mcc_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
+@@ -4319,9 +4311,9 @@ struct proc_dir_entry *rtw_adapter_proc_
+
+ for (i = 0; i < adapter_proc_hdls_num; i++) {
+ if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SEQ)
+- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_fops, (void *)i);
++ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_seq_ops, (void *)i);
+ else if (adapter_proc_hdls[i].type == RTW_PROC_HDL_TYPE_SSEQ)
+- entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_fops, (void *)i);
++ entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_sseq_ops, (void *)i);
+ else
+ entry = NULL;
+
diff --git a/kernel-release-clang.spec b/kernel-release-clang.spec
index 5545609..55064b2 100644
--- a/kernel-release-clang.spec
+++ b/kernel-release-clang.spec
@@ -4,9 +4,6 @@
#end
%define _disable_ld_no_undefined 1
-# (tpg) try to speed up things
-%global optflags %{optflags} -O3
-
# (crazy) , well that new way of doing buil-id symlinks
# does not seems to work, see:
# https://issues.openmandriva.org/show_bug.cgi?id=2400
@@ -17,14 +14,14 @@
# This is the place where you set kernel version i.e 4.5.0
# compose tar.xz name and release
%define kernelversion 5
-%define patchlevel 5
-%define sublevel 13
+%define patchlevel 6
+%define sublevel 2
%define relc %{nil}
# Only ever wrong on x.0 releases...
%define previous %{kernelversion}.%(echo $((%{patchlevel}-1)))
%define buildrel %{kversion}-%{buildrpmrel}
-%define rpmtag %{disttag}
+%define rpmtag %{disttag}
# IMPORTANT
# This is the place where you set release version %{version}-1omv2015
@@ -75,7 +72,13 @@
%bcond_without clang
-%bcond_with bootsplash
+## enabled it runs dracut -f --regenerate-all
+## we *should* enable that, is bc we keep or can keep lots
+## kernel around and the initrd is created using sys libs, sys configs,
+## *systemd* service & apps etc. IOW, a old initrd may have old files, libs, etc
+## changed since last rebuild and may result in either broken boot, or very hard to debug bugs.
+%bcond_with dracut_all_initrd
+
# (tpg) enable patches from ClearLinux
%bcond_without clr
@@ -232,6 +235,7 @@ Source51: cpupower.config
%if 0%{sublevel}
Source90: https://cdn.kernel.org/pub/linux/kernel/v%(echo %{version}|cut -d. -f1).x/patch-%{version}.xz
%endif
+Patch1: linux-5.6-fix-disassembler-4args-detection.patch
Patch2: die-floppy-die.patch
Patch3: 0001-Add-support-for-Acer-Predator-macro-keys.patch
Patch4: linux-4.7-intel-dvi-duallink.patch
@@ -241,39 +245,6 @@ Patch6: linux-5.2.9-riscv-compile.patch
# caused by aacraid versioning ("1.2.1[50983]-custom")
Patch7: aacraid-dont-freak-out-dependency-generator.patch
-# Bootsplash system
-# (tpg) disable it for now 2018-11-07
-%if %{with bootsplash}
-# https://lkml.org/lkml/2017/10/25/346
-# https://patchwork.kernel.org/patch/10172665/, rebased
-Patch100: RFC-v3-01-13-bootsplash-Initial-implementation-showing-black-screen.patch
-# https://patchwork.kernel.org/patch/10172669/
-Patch101: RFC-v3-02-13-bootsplash-Add-file-reading-and-picture-rendering.patch
-# https://patchwork.kernel.org/patch/10172715/
-Patch102: RFC-v3-03-13-bootsplash-Flush-framebuffer-after-drawing.patch
-# https://patchwork.kernel.org/patch/10172699/
-Patch103: RFC-v3-04-13-bootsplash-Add-corner-positioning.patch
-# https://patchwork.kernel.org/patch/10172667/
-Patch104: RFC-v3-05-13-bootsplash-Add-animation-support.patch
-# https://patchwork.kernel.org/patch/10172605/, rebased
-Patch105: RFC-v3-06-13-vt-Redraw-bootsplash-fully-on-console_unblank.patch
-# https://patchwork.kernel.org/patch/10172599/
-Patch106: RFC-v3-07-13-vt-Add-keyboard-hook-to-disable-bootsplash.patch
-# https://patchwork.kernel.org/patch/10172603/
-Patch107: RFC-v3-08-13-sysrq-Disable-bootsplash-on-SAK.patch
-# https://patchwork.kernel.org/patch/10172601/
-Patch108: RFC-v3-09-13-fbcon-Disable-bootsplash-on-oops.patch
-# https://patchwork.kernel.org/patch/10172663/
-Patch109: RFC-v3-10-13-Documentation-Add-bootsplash-main-documentation.patch
-# https://patchwork.kernel.org/patch/10172685/
-Patch110: RFC-v3-11-13-bootsplash-sysfs-entries-to-load-and-unload-files.patch
-# https://patchwork.kernel.org/patch/10172597/
-Patch111: RFC-v3-12-13-tools-bootsplash-Add-a-basic-splash-file-creation-tool.patch
-# https://patchwork.kernel.org/patch/10172661/
-# Contains git binary patch -- needs to be applied with git apply instead of autopatch -p1
-Source112: RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-file.patch
-%endif
-
# Patches to VirtualBox and other external modules are
# pulled in as Source: rather than Patch: because it's arch specific
# and can't be applied by %%autopatch -p1
@@ -282,14 +253,18 @@ Source112: RFC-v3-13-13-tools-bootsplash-Add-script-and-data-to-create-sample-fi
# (tpg) http://kerneldedup.org/en/projects/uksm/download/
# (tpg) sources can be found here https://github.com/dolohow/uksm
%if %{with uksm}
-Patch120: https://raw.githubusercontent.com/dolohow/uksm/master/v5.x/uksm-5.5.patch
+Patch120: https://raw.githubusercontent.com/dolohow/uksm/master/v5.x/uksm-5.6.patch
%endif
%if %{with build_modzstd}
-# https://patchwork.kernel.org/patch/10003007/
-Patch126: v2-1-2-lib-Add-support-for-ZSTD-compressed-kernel.patch
-# https://patchwork.kernel.org/patch/10003011/
-Patch127: v2-2-2-x86-Add-support-for-ZSTD-compressed-kernel.patch
+# https://lkml.org/lkml/2020/3/25/991
+Patch126: v3-1-8-lib-prepare-zstd-for-preboot-environment.patch
+Patch127: v3-2-8-lib-prepare-xxhash-for-preboot-environment.patch
+Patch128: v3-3-8-lib-add-zstd-support-to-decompress.patch
+Patch129: v3-4-8-init-add-support-for-zstd-compressed-kernel.patch
+Patch130: v3-5-8-usr-add-support-for-zstd-compressed-initramfs.patch
+Patch131: v3-6-8-x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch
+Patch132: v3-7-8-x86-Add-support-for-ZSTD-compressed-kernel.patch
%endif
### Additional hardware support
@@ -319,14 +294,13 @@ Patch148: saa716x-5.4.patch
# zstd -19 extra-wifi-drivers*.tar
Source200: extra-wifi-drivers-20200301.tar.zst
Patch201: extra-wifi-drivers-compile.patch
+Patch202: extra-wifi-drivers-port-to-5.6.patch
%if %{with virtualbox}
-# VirtualBox shared folders support
-# https://patchwork.kernel.org/patch/10906949/
-# For newer versions, check
-# https://patchwork.kernel.org/project/linux-fsdevel/list/?submitter=582
-Patch300: v19-fs-Add-VirtualBox-guest-shared-folder-vboxsf-support.diff
-Source300: virtualbox-kernel-5.3.patch
+# VirtualBox patches -- added as Source: rather than Patch:
+# because they need to be applied after stuff from the
+# virtualbox-kernel-module-sources package is copied around
+Source300: vbox-kernel-5.6.patch
Source301: vbox-6.1-fix-build-on-znver1-hosts.patch
Source302: vbox-6.1.2-clang.patch
%endif
@@ -362,7 +336,8 @@ Patch405: 0107-intel_idle-tweak-cpuidle-cstates.patch
%ifarch %{ix86} %{x86_64}
Patch407: 0114-smpboot-reuse-timer-calibration.patch
%endif
-Patch408: 0109-raid6-add-Kconfig-option-to-skip-raid6-benchmarking.patch
+# waiting for rediff ?
+#Patch408: 0109-raid6-add-Kconfig-option-to-skip-raid6-benchmarking.patch
Patch409: 0116-Initialize-ata-before-graphics.patch
Patch410: 0119-e1000e-change-default-policy.patch
Patch411: 0112-give-rdrand-some-credit.patch
@@ -399,7 +374,6 @@ Patch810: linux-5.4.5-fix-build.patch
Patch811: futex-wait-multiple-5.2.1.patch
Patch812: linux-5.5-corsair-strafe-quirks.patch
-Patch813: cpupower-gcc10.patch
# No need to be overly verbose about something that will happen 18 years from now
Patch850: https://gitweb.frugalware.org/frugalware-current/blob/master/source/base/kernel/do_not_bug_the_next_18-years.patch
@@ -422,7 +396,6 @@ Patch902: ix86-cant-create-dynamic-relocation-R_386_32-with-LLD.patch
Patch903: i386-percpu.patch
%endif
Patch904: drm-i915-Cast-remain-to-unsigned-long-in-eb_relocate_vma.patch
-Patch905: drm-i915-perf-Reverse-a-ternary-to-make-sparse-happy.patch
%endif
%define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \
@@ -451,6 +424,7 @@ input and output, etc.
%define kconflicts3 dkms-nvidia-current < 325.15-1
%define kconflicts4 dkms-nvidia-long-lived < 319.49-1
%define kconflicts5 dkms-nvidia304 < 304.108-1
+%define kconflicts6 fuse-exfat < 1.3.0.-6
# nvidia173 does not support this kernel
Autoreqprov: no
@@ -506,10 +480,7 @@ BuildRequires: asciidoc
BuildRequires: pkgconfig(audit)
BuildRequires: binutils-devel
BuildRequires: bison
-# BuildRequires: docbook-style-xsl
BuildRequires: flex
-# BuildRequires: gettext
-# BuildRequires: gtk2-devel
BuildRequires: pkgconfig(libunwind)
BuildRequires: pkgconfig(libnewt)
BuildRequires: pkgconfig(gtk+-2.0)
@@ -555,7 +526,7 @@ Requires(pre): %requires3 %requires4 \
Requires: %requires5 \
Obsoletes: %kobsoletes1 %kobsoletes2 %kobsoletes3 \
Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \
-Conflicts: %kconflicts4 %kconflicts5 \
+Conflicts: %kconflicts4 %kconflicts5 %kconflicts6 \
Conflicts: %{kname}-%{1}-latest <= %{kversion}-%{rpmrel} \
Obsoletes: %{kname}-%{1}-latest <= %{kversion}-%{rpmrel} \
Provides: installonlypkg(kernel) \
@@ -682,7 +653,7 @@ voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%define summary_server_clang Linux Kernel for server use with i686 & 64GB RAM
%define info_server This kernel is compiled for server use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \
-no preempt, HZ_100, CFS cpu scheduler and BFQ i/o scheduler, PERFORMANCE governor.
+no preempt, HZ_300, CFS cpu scheduler and BFQ i/o scheduler, PERFORMANCE governor.
%else
%define summary_server_clang Linux Kernel for server use with %{_arch}
%define info_server This kernel is compiled for server use, single or \
@@ -785,15 +756,6 @@ Conflicts: %{_lib}cpufreq-devel
This package contains the development files for cpupower.
%endif
-%package -n bootsplash-packer
-Summary: Tool for packing bootsplash images
-Group: System/Kernel and hardware
-Version: %{kversion}
-Release: %{rpmrel}
-
-%description -n bootsplash-packer
-Tool for packing bootsplash images.
-
%if %{with build_x86_energy_perf_policy}
%package -n x86_energy_perf_policy
Version: %{kversion}
@@ -892,10 +854,6 @@ rm -rf .git
%apply_patches
%endif
-%if %{with bootsplash}
-git apply %{SOURCE112}
-%endif
-
# merge SAA716x DVB driver from extra tarball
sed -i -e '/saa7164/isource "drivers/media/pci/saa716x/Kconfig"' drivers/media/pci/Kconfig
sed -i -e '/saa7164/iobj-$(CONFIG_SAA716X_CORE) += saa716x/' drivers/media/pci/Makefile
@@ -977,7 +935,7 @@ cp -a $(ls --sort=time -1d /usr/src/virtualbox-*|head -n1)/vboxpci drivers/pci/
sed -i -e 's,\$(KBUILD_EXTMOD),drivers/pci/vboxpci,g' drivers/pci/vboxpci/Makefile*
sed -i -e "s,^KERN_DIR.*,KERN_DIR := $(pwd)," drivers/pci/vboxpci/Makefile*
echo 'obj-m += vboxpci/' >>drivers/pci/Makefile
-#patch -p1 -z .300a~ -b <%{S:300}
+patch -p1 -z .300a~ -b <%{S:300}
patch -p1 -z .301a~ -b <%{S:301}
patch -p1 -z .302a~ -b <%{S:302}
%endif
@@ -1187,9 +1145,6 @@ SaveDevel() {
# Needed for external dvb tree (#41418)
cp -fR drivers/media/dvb-frontends/lgdt330x.h $TempDevelRoot/drivers/media/dvb-frontends/
-# add acpica header files, needed for fglrx build
- cp -fR drivers/acpi/acpica/*.h $TempDevelRoot/drivers/acpi/acpica/
-
# orc unwinder needs theese
cp -fR tools/build/Build{,.include} $TempDevelRoot/tools/build
cp -fR tools/build/fixdep.c $TempDevelRoot/tools/build
@@ -1291,7 +1246,6 @@ if [ -d /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel} ]; then
fi
EOF
-
### Create -devel Preun script on the fly
cat > $kernel_devel_files-preun <<EOF
if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build ]; then
@@ -1353,56 +1307,19 @@ cat kernel_exclude_debug_files.$kernel_flavour >> $kernel_files
### Create kernel Post script
cat > $kernel_files-post <<EOF
-
-# create initrd/grub.cfg for installed kernel first.
+%if %{with dracut_all_initrd}
+[ -x /sbin/dracut ] && /sbin/dracut -f --regenerate-all
+%endif
/sbin/depmod -a %{kversion}-$kernel_flavour-%{buildrpmrel}
[ -x /sbin/dracut ] && /sbin/dracut -f --kver %{kversion}-$kernel_flavour-%{buildrpmrel}
-# try rebuild all other initrd's , however that may take a while with lots
-# kernels installed
-cd /boot > /dev/null
-
-for i in $(ls vmlinuz-[0-9]*| sed 's/.*vmlinuz-//g')
-do
- if [[ vmlinuz-$i =~ vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} ]]; then
- # we just create this
- continue
- fi
- if [[ -e "initrd-$i.img" ]]; then
- ## if exist ignore
- continue
- fi
- /sbin/depmod -a "$i"
- [ -x /sbin/dracut ] && /sbin/dracut -f --kver "$i"
-done
-
## cleanup some werid symlinks we never used anyway
-rm -rf vmlinuz-{server,desktop} initrd0.img initrd-{server,desktop}
+rm -rf vmlinuz-{server,desktop} initrd0.img initrd-{server,desktop} ||:
# run update-grub2
[ -x /usr/sbin/update-grub2 ] && /usr/sbin/update-grub2
-# (crazy) only half the story , need grub patches , OM scripts ( including ARM ) removed suport for systemd-boot
-# and so on .. we hit a limit here with lots kernels installed.
-# also half of that is not used bc missing grub part support. Also we produce ofc broken symlinks and ducplicate
-# 'wath-should-be-machine-id' too. I cannot see why we need that anyway.
-
-#/usr/bin/kernel-install add %{kversion}-$kernel_flavour-%{buildrpmrel} /boot/vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}
-#cd /boot > /dev/null
-#if [ -L vmlinuz-$kernel_flavour ]; then
-# rm -f vmlinuz-$kernel_flavour
-#fi
-#ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz-$kernel_flavour
-#if [ -L initrd-$kernel_flavour.img ]; then
-# rm -f initrd-$kernel_flavour.img
-#fi
-#ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd-$kernel_flavour.img
-#if [ -e initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img ]; then
-# ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz
-# ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd.img
-#fi
-
cd - > /dev/null
%if %{with build_devel}
# create kernel-devel symlinks if matching -devel- rpm is installed
@@ -1420,17 +1337,15 @@ if [ -x /usr/sbin/dkms_autoinstaller ] && [ -d /usr/src/linux-%{kversion}-$kerne
/usr/sbin/dkms_autoinstaller start %{kversion}-$kernel_flavour-%{buildrpmrel}
fi
-if [ -x %{_sbindir}/dkms -a -e %{_unitdir}/dkms.service ] && [ -d /usr/src/linux-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
+if [ -x %{_sbindir}/dkms ] && [ -e %{_unitdir}/dkms.service ] && [ -d /usr/src/linux-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
/bin/systemctl --quiet restart dkms.service
- /bin/systemctl --quiet try-restart fedora-loadmodules.service
+ /bin/systemctl --quiet try-restart loadmodules.service
%{_sbindir}/dkms autoinstall --verbose --kernelver %{kversion}-$kernel_flavour-%{buildrpmrel}
fi
-
EOF
### Create kernel Preun script on the fly
cat > $kernel_files-preun <<EOF
-
rm -rf /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
cd /boot > /dev/null
@@ -1442,22 +1357,6 @@ if [ -e initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img ]; then
rm -rf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img
fi
-
-#/usr/bin/kernel-install remove %{kversion}-$kernel_flavour-%{buildrpmrel}
-#cd /boot > /dev/null
-## (crazy) we dont use ( nor have support in grub to look ) for initrd-fooname or vmlinuz-fooname
-## so that never worked anyway.
-#if [ -L vmlinuz-$kernel_flavour ]; then
-# if [ "$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then
-# rm -f vmlinuz-$kernel_flavour
-# fi
-#fi
-#if [ -L initrd-$kernel_flavour.img ]; then
-# if [ "$(readlink initrd-$kernel_flavour.img)" = "initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img" ]; then
-# rm -f initrd-$kernel_flavour.img
-# fi
-#fi
-
cd - > /dev/null
%if %{with build_devel}
if [ -L /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/build ]; then
@@ -1587,10 +1486,6 @@ chmod +x tools/power/cpupower/utils/version-gen.sh
%kmake -C tools/power/cpupower CPUFREQ_BENCH=false LDFLAGS="%{optflags}"
%endif
-%if %{with bootsplash}
-%kmake -C tools/bootsplash LDFLAGS="%{optflags}"
-%endif
-
%ifarch %{ix86} %{x86_64}
%if %{with build_x86_energy_perf_policy}
%kmake -C tools/power/x86/x86_energy_perf_policy CC=%{__cc} LDFLAGS="%{optflags} -Wl,--build-id=none"
@@ -1685,11 +1580,6 @@ install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
%endif
-%if %{with bootsplash}
-mkdir -p %{buildroot}%{_bindir}
-install -m755 tools/bootsplash/bootsplash-packer %{buildroot}%{_bindir}/
-%endif
-
%ifarch %{ix86} %{x86_64}
%if %{with build_x86_energy_perf_policy}
mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man8
@@ -1858,11 +1748,6 @@ cd -
%{_includedir}/cpufreq.h
%endif
-%if %{with bootsplash}
-%files -n bootsplash-packer
-%{_bindir}/bootsplash-packer
-%endif
-
%ifarch %{ix86} %{x86_64}
%if %{with build_x86_energy_perf_policy}
%files -n x86_energy_perf_policy
diff --git a/linux-5.6-fix-disassembler-4args-detection.patch b/linux-5.6-fix-disassembler-4args-detection.patch
new file mode 100644
index 0000000..36aa382
--- /dev/null
+++ b/linux-5.6-fix-disassembler-4args-detection.patch
@@ -0,0 +1,13 @@
+diff -up linux-5.6/tools/bpf/bpftool/jit_disasm.c.omv~ linux-5.6/tools/bpf/bpftool/jit_disasm.c
+diff -up linux-5.6/tools/build/feature/Makefile.omv~ linux-5.6/tools/build/feature/Makefile
+--- linux-5.6/tools/build/feature/Makefile.omv~ 2020-04-02 06:07:08.488570621 +0200
++++ linux-5.6/tools/build/feature/Makefile 2020-04-02 06:07:19.983631490 +0200
+@@ -224,7 +224,7 @@ $(OUTPUT)test-libbfd.bin:
+ $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl
+
+ $(OUTPUT)test-disassembler-four-args.bin:
+- $(BUILD) -DPACKAGE='"perf"' -lbfd -lopcodes
++ $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl -lopcodes
+
+ $(OUTPUT)test-reallocarray.bin:
+ $(BUILD)
diff --git a/uksm-5.5.patch b/uksm-5.6.patch
similarity index 99%
rename from uksm-5.5.patch
rename to uksm-5.6.patch
index e19c7ff..2643553 100644
--- a/uksm-5.5.patch
+++ b/uksm-5.6.patch
@@ -66,7 +66,7 @@ index 000000000000..be19a3127001
+2016-09-10 UKSM 0.1.2.5 Fix a bug in dedup ratio calculation.
+2017-02-26 UKSM 0.1.2.6 Fix a bug in hugetlbpage handling and a race bug with page migration.
diff --git a/fs/exec.c b/fs/exec.c
-index 74d88dab98dd..5480a7826078 100644
+index db17be51b112..0ce4c6303f53 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -62,6 +62,7 @@
@@ -77,7 +77,7 @@ index 74d88dab98dd..5480a7826078 100644
#include <linux/uaccess.h>
#include <asm/mmu_context.h>
-@@ -1383,6 +1384,7 @@ void setup_new_exec(struct linux_binprm * bprm)
+@@ -1387,6 +1388,7 @@ void setup_new_exec(struct linux_binprm * bprm)
/* An exec changes our domain. We are no longer part of the thread
group */
current->self_exec_id++;
@@ -102,7 +102,7 @@ index 8c1f1bb1a5ce..62e28cf10bbf 100644
global_node_page_state(NR_UNSTABLE_NFS));
show_val_kb(m, "Bounce: ",
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
-index 798ea36a0549..ff7733decbd0 100644
+index e2e2bef07dd2..59675a348878 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -866,12 +866,25 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
@@ -219,10 +219,10 @@ index e48b1e453ff5..095d59310ce0 100644
+
#endif /* __LINUX_KSM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 270aa8fd2800..8e1eaf6a2de3 100644
+index c28911c3afa8..d14689c20e56 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
-@@ -353,6 +353,9 @@ struct vm_area_struct {
+@@ -358,6 +358,9 @@ struct vm_area_struct {
struct mempolicy *vm_policy; /* NUMA policy for the VMA */
#endif
struct vm_userfaultfd_ctx vm_userfaultfd_ctx;
@@ -233,7 +233,7 @@ index 270aa8fd2800..8e1eaf6a2de3 100644
struct core_thread {
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 5334ad8fc7bd..5919df54d9e6 100644
+index 462f6873905a..43edd793d4e7 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -206,6 +206,9 @@ enum zone_stat_item {
@@ -485,7 +485,7 @@ index 000000000000..bb8651f534f2
+#endif /* !CONFIG_UKSM */
+#endif /* __LINUX_UKSM_H */
diff --git a/kernel/fork.c b/kernel/fork.c
-index 080809560072..49019ca35dce 100644
+index d90af13431c7..b9d771b1acfb 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -598,7 +598,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
@@ -498,10 +498,10 @@ index 080809560072..49019ca35dce 100644
if (!(tmp->vm_flags & VM_WIPEONFORK))
retval = copy_page_range(mm, oldmm, mpnt);
diff --git a/lib/Makefile b/lib/Makefile
-index 93217d44237f..f03103335a89 100644
+index 611872c06926..1e3d86def26c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
-@@ -25,7 +25,7 @@ CFLAGS_string.o := $(call cc-option, -fno-stack-protector)
+@@ -26,7 +26,7 @@ CFLAGS_string.o := $(call cc-option, -fno-stack-protector)
endif
lib-y := ctype.o string.o vsprintf.o cmdline.o \
@@ -1030,10 +1030,10 @@ index ab80933be65f..04796660748f 100644
config DEFAULT_MMAP_MIN_ADDR
int "Low address space to protect from user allocation"
diff --git a/mm/Makefile b/mm/Makefile
-index 1937cc251883..c2c7e6f16cce 100644
+index 272e66039e70..20ec701eda60 100644
--- a/mm/Makefile
+++ b/mm/Makefile
-@@ -66,7 +66,8 @@ obj-$(CONFIG_SPARSEMEM) += sparse.o
+@@ -67,7 +67,8 @@ obj-$(CONFIG_SPARSEMEM) += sparse.o
obj-$(CONFIG_SPARSEMEM_VMEMMAP) += sparse-vmemmap.o
obj-$(CONFIG_SLOB) += slob.o
obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o
@@ -1066,7 +1066,7 @@ index d17c7d57d0d8..d9942db0a21e 100644
/*
* Only called through the sysfs control interface:
diff --git a/mm/memory.c b/mm/memory.c
-index 45442d9a4f52..9beaa229bb0d 100644
+index e8bfdf0d9d1d..3507bfef1c5e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -144,6 +144,25 @@ EXPORT_SYMBOL(zero_pfn);
@@ -1129,7 +1129,7 @@ index 45442d9a4f52..9beaa229bb0d 100644
if (!PageAnon(page)) {
if (pte_dirty(ptent)) {
-@@ -2230,6 +2257,7 @@ static inline bool cow_user_page(struct page *dst, struct page *src,
+@@ -2266,6 +2293,7 @@ static inline bool cow_user_page(struct page *dst, struct page *src,
if (likely(src)) {
copy_user_highpage(dst, src, addr, vma);
@@ -1137,7 +1137,7 @@ index 45442d9a4f52..9beaa229bb0d 100644
return true;
}
-@@ -2457,6 +2485,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
+@@ -2512,6 +2540,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
vmf->address);
if (!new_page)
goto oom;
@@ -1145,7 +1145,7 @@ index 45442d9a4f52..9beaa229bb0d 100644
} else {
new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma,
vmf->address);
-@@ -2498,7 +2527,9 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
+@@ -2553,7 +2582,9 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
mm_counter_file(old_page));
inc_mm_counter_fast(mm, MM_ANONPAGES);
}
@@ -1156,7 +1156,7 @@ index 45442d9a4f52..9beaa229bb0d 100644
}
flush_cache_page(vma, vmf->address, pte_pfn(vmf->orig_pte));
diff --git a/mm/mmap.c b/mm/mmap.c
-index 71e4ffc83bcd..4557183fcf58 100644
+index d681a20eb4ea..acf07b12677c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -46,6 +46,7 @@
@@ -1175,7 +1175,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
vm_area_free(vma);
return next;
}
-@@ -707,9 +709,16 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
+@@ -705,9 +707,16 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
long adjust_next = 0;
int remove_next = 0;
@@ -1192,7 +1192,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
if (end >= next->vm_end) {
/*
* vma expands, overlapping all the next, and
-@@ -840,6 +849,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
+@@ -838,6 +847,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
end_changed = true;
}
vma->vm_pgoff = pgoff;
@@ -1200,7 +1200,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
if (adjust_next) {
next->vm_start += adjust_next << PAGE_SHIFT;
next->vm_pgoff += adjust_next;
-@@ -945,6 +955,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
+@@ -943,6 +953,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
if (remove_next == 2) {
remove_next = 1;
end = next->vm_end;
@@ -1208,7 +1208,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
goto again;
}
else if (next)
-@@ -971,10 +982,14 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
+@@ -969,10 +980,14 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
*/
VM_WARN_ON(mm->highest_vm_end != vm_end_gap(vma));
}
@@ -1223,7 +1223,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
validate_mm(mm);
return 0;
-@@ -1437,6 +1452,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
+@@ -1431,6 +1446,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
vm_flags |= calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(flags) |
mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
@@ -1233,7 +1233,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
if (flags & MAP_LOCKED)
if (!can_do_mlock())
return -EPERM;
-@@ -1807,6 +1825,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1799,6 +1817,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
allow_write_access(file);
}
file = vma->vm_file;
@@ -1241,7 +1241,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
out:
perf_event_mmap(vma);
-@@ -1849,6 +1868,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1841,6 +1860,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
if (vm_flags & VM_DENYWRITE)
allow_write_access(file);
free_vma:
@@ -1249,7 +1249,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
vm_area_free(vma);
unacct_error:
if (charged)
-@@ -2678,6 +2698,8 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2670,6 +2690,8 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
else
err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
@@ -1258,7 +1258,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
/* Success. */
if (!err)
return 0;
-@@ -2984,6 +3006,7 @@ static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long fla
+@@ -2976,6 +2998,7 @@ static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long fla
if ((flags & (~VM_EXEC)) != 0)
return -EINVAL;
flags |= VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
@@ -1266,7 +1266,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
mapped_addr = get_unmapped_area(NULL, addr, len, 0, MAP_FIXED);
if (IS_ERR_VALUE(mapped_addr))
-@@ -3034,6 +3057,7 @@ static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long fla
+@@ -3026,6 +3049,7 @@ static int do_brk_flags(unsigned long addr, unsigned long len, unsigned long fla
vma->vm_flags = flags;
vma->vm_page_prot = vm_get_page_prot(flags);
vma_link(mm, vma, prev, rb_link, rb_parent);
@@ -1274,7 +1274,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
out:
perf_event_mmap(vma);
mm->total_vm += len >> PAGE_SHIFT;
-@@ -3111,6 +3135,12 @@ void exit_mmap(struct mm_struct *mm)
+@@ -3103,6 +3127,12 @@ void exit_mmap(struct mm_struct *mm)
up_write(&mm->mmap_sem);
}
@@ -1287,7 +1287,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
if (mm->locked_vm) {
vma = mm->mmap;
while (vma) {
-@@ -3145,6 +3175,11 @@ void exit_mmap(struct mm_struct *mm)
+@@ -3137,6 +3167,11 @@ void exit_mmap(struct mm_struct *mm)
vma = remove_vma(vma);
}
vm_unacct_memory(nr_accounted);
@@ -1299,7 +1299,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
}
/* Insert vm structure into process list sorted by address
-@@ -3252,6 +3287,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -3244,6 +3279,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
new_vma->vm_ops->open(new_vma);
vma_link(mm, new_vma, prev, rb_link, rb_parent);
*need_rmap_locks = false;
@@ -1307,7 +1307,7 @@ index 71e4ffc83bcd..4557183fcf58 100644
}
return new_vma;
-@@ -3402,6 +3438,7 @@ static struct vm_area_struct *__install_special_mapping(
+@@ -3396,6 +3432,7 @@ static struct vm_area_struct *__install_special_mapping(
vm_stat_account(mm, vma->vm_flags, len >> PAGE_SHIFT);
perf_event_mmap(vma);
diff --git a/v19-fs-Add-VirtualBox-guest-shared-folder-vboxsf-support.diff b/v19-fs-Add-VirtualBox-guest-shared-folder-vboxsf-support.diff
deleted file mode 100644
index 56008db..0000000
--- a/v19-fs-Add-VirtualBox-guest-shared-folder-vboxsf-support.diff
+++ /dev/null
@@ -1,3370 +0,0 @@
-diff --git a/MAINTAINERS b/MAINTAINERS
-index 02d5278a4c9a..90302540b12d 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -17591,6 +17591,12 @@ F: include/linux/vbox_utils.h
- F: include/uapi/linux/vbox*.h
- F: drivers/virt/vboxguest/
-
-+VIRTUAL BOX SHARED FOLDER VFS DRIVER:
-+M: Hans de Goede <hdegoede@redhat.com>
-+L: linux-fsdevel@vger.kernel.org
-+S: Maintained
-+F: fs/vboxsf/*
-+
- VIRTUAL SERIO DEVICE DRIVER
- M: Stephen Chandler Paul <thatslyude@gmail.com>
- S: Maintained
-diff --git a/fs/Kconfig b/fs/Kconfig
-index 7b623e9fc1b0..8493a3f0c4b1 100644
---- a/fs/Kconfig
-+++ b/fs/Kconfig
-@@ -264,6 +264,7 @@ source "fs/pstore/Kconfig"
- source "fs/sysv/Kconfig"
- source "fs/ufs/Kconfig"
- source "fs/erofs/Kconfig"
-+source "fs/vboxsf/Kconfig"
-
- endif # MISC_FILESYSTEMS
-
-diff --git a/fs/Makefile b/fs/Makefile
-index 1148c555c4d3..b807cbff3790 100644
---- a/fs/Makefile
-+++ b/fs/Makefile
-@@ -133,3 +133,4 @@ obj-$(CONFIG_CEPH_FS) += ceph/
- obj-$(CONFIG_PSTORE) += pstore/
- obj-$(CONFIG_EFIVAR_FS) += efivarfs/
- obj-$(CONFIG_EROFS_FS) += erofs/
-+obj-$(CONFIG_VBOXSF_FS) += vboxsf/
-diff --git a/fs/vboxsf/Kconfig b/fs/vboxsf/Kconfig
-new file mode 100644
-index 000000000000..b84586ae08b3
---- /dev/null
-+++ b/fs/vboxsf/Kconfig
-@@ -0,0 +1,10 @@
-+config VBOXSF_FS
-+ tristate "VirtualBox guest shared folder (vboxsf) support"
-+ depends on X86 && VBOXGUEST
-+ select NLS
-+ help
-+ VirtualBox hosts can share folders with guests, this driver
-+ implements the Linux-guest side of this allowing folders exported
-+ by the host to be mounted under Linux.
-+
-+ If you want to use shared folders in VirtualBox guests, answer Y or M.
-diff --git a/fs/vboxsf/Makefile b/fs/vboxsf/Makefile
-new file mode 100644
-index 000000000000..9e4328e79623
---- /dev/null
-+++ b/fs/vboxsf/Makefile
-@@ -0,0 +1,5 @@
-+# SPDX-License-Identifier: MIT
-+
-+obj-$(CONFIG_VBOXSF_FS) += vboxsf.o
-+
-+vboxsf-y := dir.o file.o utils.o vboxsf_wrappers.o super.o
-diff --git a/fs/vboxsf/dir.c b/fs/vboxsf/dir.c
-new file mode 100644
-index 000000000000..dd147b490982
---- /dev/null
-+++ b/fs/vboxsf/dir.c
-@@ -0,0 +1,427 @@
-+// SPDX-License-Identifier: MIT
-+/*
-+ * VirtualBox Guest Shared Folders support: Directory inode and file operations
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#include <linux/namei.h>
-+#include <linux/vbox_utils.h>
-+#include "vfsmod.h"
-+
-+static int vboxsf_dir_open(struct inode *inode, struct file *file)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
-+ struct shfl_createparms params = {};
-+ struct vboxsf_dir_info *sf_d;
-+ int err;
-+
-+ sf_d = vboxsf_dir_info_alloc();
-+ if (!sf_d)
-+ return -ENOMEM;
-+
-+ params.handle = SHFL_HANDLE_NIL;
-+ params.create_flags = SHFL_CF_DIRECTORY | SHFL_CF_ACT_OPEN_IF_EXISTS |
-+ SHFL_CF_ACT_FAIL_IF_NEW | SHFL_CF_ACCESS_READ;
-+
-+ err = vboxsf_create_at_dentry(file_dentry(file), ¶ms);
-+ if (err)
-+ goto err_free_dir_info;
-+
-+ if (params.result != SHFL_FILE_EXISTS) {
-+ err = -ENOENT;
-+ goto err_close;
-+ }
-+
-+ err = vboxsf_dir_read_all(sbi, sf_d, params.handle);
-+ if (err)
-+ goto err_close;
-+
-+ vboxsf_close(sbi->root, params.handle);
-+ file->private_data = sf_d;
-+ return 0;
-+
-+err_close:
-+ vboxsf_close(sbi->root, params.handle);
-+err_free_dir_info:
-+ vboxsf_dir_info_free(sf_d);
-+ return err;
-+}
-+
-+static int vboxsf_dir_release(struct inode *inode, struct file *file)
-+{
-+ if (file->private_data)
-+ vboxsf_dir_info_free(file->private_data);
-+
-+ return 0;
-+}
-+
-+static unsigned int vboxsf_get_d_type(u32 mode)
-+{
-+ unsigned int d_type;
-+
-+ switch (mode & SHFL_TYPE_MASK) {
-+ case SHFL_TYPE_FIFO:
-+ d_type = DT_FIFO;
-+ break;
-+ case SHFL_TYPE_DEV_CHAR:
-+ d_type = DT_CHR;
-+ break;
-+ case SHFL_TYPE_DIRECTORY:
-+ d_type = DT_DIR;
-+ break;
-+ case SHFL_TYPE_DEV_BLOCK:
-+ d_type = DT_BLK;
-+ break;
-+ case SHFL_TYPE_FILE:
-+ d_type = DT_REG;
-+ break;
-+ case SHFL_TYPE_SYMLINK:
-+ d_type = DT_LNK;
-+ break;
-+ case SHFL_TYPE_SOCKET:
-+ d_type = DT_SOCK;
-+ break;
-+ case SHFL_TYPE_WHITEOUT:
-+ d_type = DT_WHT;
-+ break;
-+ default:
-+ d_type = DT_UNKNOWN;
-+ break;
-+ }
-+ return d_type;
-+}
-+
-+static bool vboxsf_dir_emit(struct file *dir, struct dir_context *ctx)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(file_inode(dir)->i_sb);
-+ struct vboxsf_dir_info *sf_d = dir->private_data;
-+ struct shfl_dirinfo *info;
-+ struct vboxsf_dir_buf *b;
-+ unsigned int d_type;
-+ loff_t i, cur = 0;
-+ ino_t fake_ino;
-+ void *end;
-+ int err;
-+
-+ list_for_each_entry(b, &sf_d->info_list, head) {
-+try_next_entry:
-+ if (ctx->pos >= cur + b->entries) {
-+ cur += b->entries;
-+ continue;
-+ }
-+
-+ /*
-+ * Note the vboxsf_dir_info objects we are iterating over here
-+ * are variable sized, so the info pointer may end up being
-+ * unaligned. This is how we get the data from the host.
-+ * Since vboxsf is only supported on x86 machines this is not
-+ * a problem.
-+ */
-+ for (i = 0, info = b->buf; i < ctx->pos - cur; i++) {
-+ end = &info->name.string.utf8[info->name.size];
-+ /* Only happens if the host gives us corrupt data */
-+ if (WARN_ON(end > (b->buf + b->used)))
-+ return false;
-+ info = end;
-+ }
-+
-+ end = &info->name.string.utf8[info->name.size];
-+ if (WARN_ON(end > (b->buf + b->used)))
-+ return false;
-+
-+ /* Info now points to the right entry, emit it. */
-+ d_type = vboxsf_get_d_type(info->info.attr.mode);
-+
-+ /*
-+ * On 32 bit systems pos is 64 signed, while ino is 32 bit
-+ * unsigned so fake_ino may overflow, check for this.
-+ */
-+ if ((ino_t)(ctx->pos + 1) != (u64)(ctx->pos + 1)) {
-+ vbg_err("vboxsf: fake ino overflow, truncating dir\n");
-+ return false;
-+ }
-+ fake_ino = ctx->pos + 1;
-+
-+ if (sbi->nls) {
-+ char d_name[NAME_MAX];
-+
-+ err = vboxsf_nlscpy(sbi, d_name, NAME_MAX,
-+ info->name.string.utf8,
-+ info->name.length);
-+ if (err) {
-+ /* skip erroneous entry and proceed */
-+ ctx->pos += 1;
-+ goto try_next_entry;
-+ }
-+
-+ return dir_emit(ctx, d_name, strlen(d_name),
-+ fake_ino, d_type);
-+ }
-+
-+ return dir_emit(ctx, info->name.string.utf8, info->name.length,
-+ fake_ino, d_type);
-+ }
-+
-+ return false;
-+}
-+
-+static int vboxsf_dir_iterate(struct file *dir, struct dir_context *ctx)
-+{
-+ bool emitted;
-+
-+ do {
-+ emitted = vboxsf_dir_emit(dir, ctx);
-+ if (emitted)
-+ ctx->pos += 1;
-+ } while (emitted);
-+
-+ return 0;
-+}
-+
-+const struct file_operations vboxsf_dir_fops = {
-+ .open = vboxsf_dir_open,
-+ .iterate = vboxsf_dir_iterate,
-+ .release = vboxsf_dir_release,
-+ .read = generic_read_dir,
-+ .llseek = generic_file_llseek,
-+};
-+
-+/*
-+ * This is called during name resolution/lookup to check if the @dentry in
-+ * the cache is still valid. the job is handled by vboxsf_inode_revalidate.
-+ */
-+static int vboxsf_dentry_revalidate(struct dentry *dentry, unsigned int flags)
-+{
-+ if (flags & LOOKUP_RCU)
-+ return -ECHILD;
-+
-+ if (d_really_is_positive(dentry))
-+ return vboxsf_inode_revalidate(dentry) == 0;
-+ else
-+ return vboxsf_stat_dentry(dentry, NULL) == -ENOENT;
-+}
-+
-+const struct dentry_operations vboxsf_dentry_ops = {
-+ .d_revalidate = vboxsf_dentry_revalidate
-+};
-+
-+/* iops */
-+
-+static struct dentry *vboxsf_dir_lookup(struct inode *parent,
-+ struct dentry *dentry,
-+ unsigned int flags)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
-+ struct shfl_fsobjinfo fsinfo;
-+ struct inode *inode;
-+ int err;
-+
-+ dentry->d_time = jiffies;
-+
-+ err = vboxsf_stat_dentry(dentry, &fsinfo);
-+ if (err) {
-+ inode = (err == -ENOENT) ? NULL : ERR_PTR(err);
-+ } else {
-+ inode = vboxsf_new_inode(parent->i_sb);
-+ if (!IS_ERR(inode))
-+ vboxsf_init_inode(sbi, inode, &fsinfo);
-+ }
-+
-+ return d_splice_alias(inode, dentry);
-+}
-+
-+static int vboxsf_dir_instantiate(struct inode *parent, struct dentry *dentry,
-+ struct shfl_fsobjinfo *info)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
-+ struct vboxsf_inode *sf_i;
-+ struct inode *inode;
-+
-+ inode = vboxsf_new_inode(parent->i_sb);
-+ if (IS_ERR(inode))
-+ return PTR_ERR(inode);
-+
-+ sf_i = VBOXSF_I(inode);
-+ /* The host may have given us different attr then requested */
-+ sf_i->force_restat = 1;
-+ vboxsf_init_inode(sbi, inode, info);
-+
-+ d_instantiate(dentry, inode);
-+
-+ return 0;
-+}
-+
-+static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,
-+ umode_t mode, int is_dir)
-+{
-+ struct vboxsf_inode *sf_parent_i = VBOXSF_I(parent);
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
-+ struct shfl_createparms params = {};
-+ int err;
-+
-+ params.handle = SHFL_HANDLE_NIL;
-+ params.create_flags = SHFL_CF_ACT_CREATE_IF_NEW |
-+ SHFL_CF_ACT_FAIL_IF_EXISTS |
-+ SHFL_CF_ACCESS_READWRITE |
-+ (is_dir ? SHFL_CF_DIRECTORY : 0);
-+ params.info.attr.mode = (mode & 0777) |
-+ (is_dir ? SHFL_TYPE_DIRECTORY : SHFL_TYPE_FILE);
-+ params.info.attr.additional = SHFLFSOBJATTRADD_NOTHING;
-+
-+ err = vboxsf_create_at_dentry(dentry, ¶ms);
-+ if (err)
-+ return err;
-+
-+ if (params.result != SHFL_FILE_CREATED)
-+ return -EPERM;
-+
-+ vboxsf_close(sbi->root, params.handle);
-+
-+ err = vboxsf_dir_instantiate(parent, dentry, ¶ms.info);
-+ if (err)
-+ return err;
-+
-+ /* parent directory access/change time changed */
-+ sf_parent_i->force_restat = 1;
-+
-+ return 0;
-+}
-+
-+static int vboxsf_dir_mkfile(struct inode *parent, struct dentry *dentry,
-+ umode_t mode, bool excl)
-+{
-+ return vboxsf_dir_create(parent, dentry, mode, 0);
-+}
-+
-+static int vboxsf_dir_mkdir(struct inode *parent, struct dentry *dentry,
-+ umode_t mode)
-+{
-+ return vboxsf_dir_create(parent, dentry, mode, 1);
-+}
-+
-+static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
-+ struct vboxsf_inode *sf_parent_i = VBOXSF_I(parent);
-+ struct inode *inode = d_inode(dentry);
-+ struct shfl_string *path;
-+ u32 flags;
-+ int err;
-+
-+ if (S_ISDIR(inode->i_mode))
-+ flags = SHFL_REMOVE_DIR;
-+ else
-+ flags = SHFL_REMOVE_FILE;
-+
-+ if (S_ISLNK(inode->i_mode))
-+ flags |= SHFL_REMOVE_SYMLINK;
-+
-+ path = vboxsf_path_from_dentry(sbi, dentry);
-+ if (IS_ERR(path))
-+ return PTR_ERR(path);
-+
-+ err = vboxsf_remove(sbi->root, path, flags);
-+ __putname(path);
-+ if (err)
-+ return err;
-+
-+ /* parent directory access/change time changed */
-+ sf_parent_i->force_restat = 1;
-+
-+ return 0;
-+}
-+
-+static int vboxsf_dir_rename(struct inode *old_parent,
-+ struct dentry *old_dentry,
-+ struct inode *new_parent,
-+ struct dentry *new_dentry,
-+ unsigned int flags)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(old_parent->i_sb);
-+ struct vboxsf_inode *sf_old_parent_i = VBOXSF_I(old_parent);
-+ struct vboxsf_inode *sf_new_parent_i = VBOXSF_I(new_parent);
-+ u32 shfl_flags = SHFL_RENAME_FILE | SHFL_RENAME_REPLACE_IF_EXISTS;
-+ struct shfl_string *old_path, *new_path;
-+ int err;
-+
-+ if (flags)
-+ return -EINVAL;
-+
-+ old_path = vboxsf_path_from_dentry(sbi, old_dentry);
-+ if (IS_ERR(old_path))
-+ return PTR_ERR(old_path);
-+
-+ new_path = vboxsf_path_from_dentry(sbi, new_dentry);
-+ if (IS_ERR(new_path)) {
-+ err = PTR_ERR(new_path);
-+ goto err_put_old_path;
-+ }
-+
-+ if (d_inode(old_dentry)->i_mode & S_IFDIR)
-+ shfl_flags = 0;
-+
-+ err = vboxsf_rename(sbi->root, old_path, new_path, shfl_flags);
-+ if (err == 0) {
-+ /* parent directories access/change time changed */
-+ sf_new_parent_i->force_restat = 1;
-+ sf_old_parent_i->force_restat = 1;
-+ }
-+
-+ __putname(new_path);
-+err_put_old_path:
-+ __putname(old_path);
-+ return err;
-+}
-+
-+static int vboxsf_dir_symlink(struct inode *parent, struct dentry *dentry,
-+ const char *symname)
-+{
-+ struct vboxsf_inode *sf_parent_i = VBOXSF_I(parent);
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(parent->i_sb);
-+ int symname_size = strlen(symname) + 1;
-+ struct shfl_string *path, *ssymname;
-+ struct shfl_fsobjinfo info;
-+ int err;
-+
-+ path = vboxsf_path_from_dentry(sbi, dentry);
-+ if (IS_ERR(path))
-+ return PTR_ERR(path);
-+
-+ ssymname = kmalloc(SHFLSTRING_HEADER_SIZE + symname_size, GFP_KERNEL);
-+ if (!ssymname) {
-+ __putname(path);
-+ return -ENOMEM;
-+ }
-+ ssymname->length = symname_size - 1;
-+ ssymname->size = symname_size;
-+ memcpy(ssymname->string.utf8, symname, symname_size);
-+
-+ err = vboxsf_symlink(sbi->root, path, ssymname, &info);
-+ kfree(ssymname);
-+ __putname(path);
-+ if (err) {
-+ /* -EROFS means symlinks are note support -> -EPERM */
-+ return (err == -EROFS) ? -EPERM : err;
-+ }
-+
-+ err = vboxsf_dir_instantiate(parent, dentry, &info);
-+ if (err)
-+ return err;
-+
-+ /* parent directory access/change time changed */
-+ sf_parent_i->force_restat = 1;
-+ return 0;
-+}
-+
-+const struct inode_operations vboxsf_dir_iops = {
-+ .lookup = vboxsf_dir_lookup,
-+ .create = vboxsf_dir_mkfile,
-+ .mkdir = vboxsf_dir_mkdir,
-+ .rmdir = vboxsf_dir_unlink,
-+ .unlink = vboxsf_dir_unlink,
-+ .rename = vboxsf_dir_rename,
-+ .symlink = vboxsf_dir_symlink,
-+ .getattr = vboxsf_getattr,
-+ .setattr = vboxsf_setattr,
-+};
-diff --git a/fs/vboxsf/file.c b/fs/vboxsf/file.c
-new file mode 100644
-index 000000000000..c4ab5996d97a
---- /dev/null
-+++ b/fs/vboxsf/file.c
-@@ -0,0 +1,379 @@
-+// SPDX-License-Identifier: MIT
-+/*
-+ * VirtualBox Guest Shared Folders support: Regular file inode and file ops.
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#include <linux/mm.h>
-+#include <linux/page-flags.h>
-+#include <linux/pagemap.h>
-+#include <linux/highmem.h>
-+#include <linux/sizes.h>
-+#include "vfsmod.h"
-+
-+struct vboxsf_handle {
-+ u64 handle;
-+ u32 root;
-+ u32 access_flags;
-+ struct kref refcount;
-+ struct list_head head;
-+};
-+
-+static int vboxsf_file_open(struct inode *inode, struct file *file)
-+{
-+ struct vboxsf_inode *sf_i = VBOXSF_I(inode);
-+ struct shfl_createparms params = {};
-+ struct vboxsf_handle *sf_handle;
-+ u32 access_flags = 0;
-+ int err;
-+
-+ sf_handle = kmalloc(sizeof(*sf_handle), GFP_KERNEL);
-+ if (!sf_handle)
-+ return -ENOMEM;
-+
-+ /*
-+ * We check the value of params.handle afterwards to find out if
-+ * the call succeeded or failed, as the API does not seem to cleanly
-+ * distinguish error and informational messages.
-+ *
-+ * Furthermore, we must set params.handle to SHFL_HANDLE_NIL to
-+ * make the shared folders host service use our mode parameter.
-+ */
-+ params.handle = SHFL_HANDLE_NIL;
-+ if (file->f_flags & O_CREAT) {
-+ params.create_flags |= SHFL_CF_ACT_CREATE_IF_NEW;
-+ /*
-+ * We ignore O_EXCL, as the Linux kernel seems to call create
-+ * beforehand itself, so O_EXCL should always fail.
-+ */
-+ if (file->f_flags & O_TRUNC)
-+ params.create_flags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
-+ else
-+ params.create_flags |= SHFL_CF_ACT_OPEN_IF_EXISTS;
-+ } else {
-+ params.create_flags |= SHFL_CF_ACT_FAIL_IF_NEW;
-+ if (file->f_flags & O_TRUNC)
-+ params.create_flags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
-+ }
-+
-+ switch (file->f_flags & O_ACCMODE) {
-+ case O_RDONLY:
-+ access_flags |= SHFL_CF_ACCESS_READ;
-+ break;
-+
-+ case O_WRONLY:
-+ access_flags |= SHFL_CF_ACCESS_WRITE;
-+ break;
-+
-+ case O_RDWR:
-+ access_flags |= SHFL_CF_ACCESS_READWRITE;
-+ break;
-+
-+ default:
-+ WARN_ON(1);
-+ }
-+
-+ if (file->f_flags & O_APPEND)
-+ access_flags |= SHFL_CF_ACCESS_APPEND;
-+
-+ params.create_flags |= access_flags;
-+ params.info.attr.mode = inode->i_mode;
-+
-+ err = vboxsf_create_at_dentry(file_dentry(file), ¶ms);
-+ if (err == 0 && params.handle == SHFL_HANDLE_NIL)
-+ err = (params.result == SHFL_FILE_EXISTS) ? -EEXIST : -ENOENT;
-+ if (err) {
-+ kfree(sf_handle);
-+ return err;
-+ }
-+
-+ /* the host may have given us different attr then requested */
-+ sf_i->force_restat = 1;
-+
-+ /* init our handle struct and add it to the inode's handles list */
-+ sf_handle->handle = params.handle;
-+ sf_handle->root = VBOXSF_SBI(inode->i_sb)->root;
-+ sf_handle->access_flags = access_flags;
-+ kref_init(&sf_handle->refcount);
-+
-+ mutex_lock(&sf_i->handle_list_mutex);
-+ list_add(&sf_handle->head, &sf_i->handle_list);
-+ mutex_unlock(&sf_i->handle_list_mutex);
-+
-+ file->private_data = sf_handle;
-+ return 0;
-+}
-+
-+static void vboxsf_handle_release(struct kref *refcount)
-+{
-+ struct vboxsf_handle *sf_handle =
-+ container_of(refcount, struct vboxsf_handle, refcount);
-+
-+ vboxsf_close(sf_handle->root, sf_handle->handle);
-+ kfree(sf_handle);
-+}
-+
-+static int vboxsf_file_release(struct inode *inode, struct file *file)
-+{
-+ struct vboxsf_inode *sf_i = VBOXSF_I(inode);
-+ struct vboxsf_handle *sf_handle = file->private_data;
-+
-+ /*
-+ * When a file is closed on our (the guest) side, we want any subsequent
-+ * accesses done on the host side to see all changes done from our side.
-+ */
-+ filemap_write_and_wait(inode->i_mapping);
-+
-+ mutex_lock(&sf_i->handle_list_mutex);
-+ list_del(&sf_handle->head);
-+ mutex_unlock(&sf_i->handle_list_mutex);
-+
-+ kref_put(&sf_handle->refcount, vboxsf_handle_release);
-+ return 0;
-+}
-+
-+/*
-+ * Write back dirty pages now, because there may not be any suitable
-+ * open files later
-+ */
-+static void vboxsf_vma_close(struct vm_area_struct *vma)
-+{
-+ filemap_write_and_wait(vma->vm_file->f_mapping);
-+}
-+
-+static const struct vm_operations_struct vboxsf_file_vm_ops = {
-+ .close = vboxsf_vma_close,
-+ .fault = filemap_fault,
-+ .map_pages = filemap_map_pages,
-+};
-+
-+static int vboxsf_file_mmap(struct file *file, struct vm_area_struct *vma)
-+{
-+ int err;
-+
-+ err = generic_file_mmap(file, vma);
-+ if (!err)
-+ vma->vm_ops = &vboxsf_file_vm_ops;
-+
-+ return err;
-+}
-+
-+/*
-+ * Note that since we are accessing files on the host's filesystem, files
-+ * may always be changed underneath us by the host!
-+ *
-+ * The vboxsf API between the guest and the host does not offer any functions
-+ * to deal with this. There is no inode-generation to check for changes, no
-+ * events / callback on changes and no way to lock files.
-+ *
-+ * To avoid returning stale data when a file gets *opened* on our (the guest)
-+ * side, we do a "stat" on the host side, then compare the mtime with the
-+ * last known mtime and invalidate the page-cache if they differ.
-+ * This is done from vboxsf_inode_revalidate().
-+ *
-+ * When reads are done through the read_iter fop, it is possible to do
-+ * further cache revalidation then, there are 3 options to deal with this:
-+ *
-+ * 1) Rely solely on the revalidation done at open time
-+ * 2) Do another "stat" and compare mtime again. Unfortunately the vboxsf
-+ * host API does not allow stat on handles, so we would need to use
-+ * file->f_path.dentry and the stat will then fail if the file was unlinked
-+ * or renamed (and there is no thing like NFS' silly-rename). So we get:
-+ * 2a) "stat" and compare mtime, on stat failure invalidate the cache
-+ * 2b) "stat" and compare mtime, on stat failure do nothing
-+ * 3) Simply always call invalidate_inode_pages2_range on the range of the read
-+ *
-+ * Currently we are keeping things KISS and using option 1. this allows
-+ * directly using generic_file_read_iter without wrapping it.
-+ *
-+ * This means that only data written on the host side before open() on
-+ * the guest side is guaranteed to be seen by the guest. If necessary
-+ * we may provide other read-cache strategies in the future and make this
-+ * configurable through a mount option.
-+ */
-+const struct file_operations vboxsf_reg_fops = {
-+ .llseek = generic_file_llseek,
-+ .read_iter = generic_file_read_iter,
-+ .write_iter = generic_file_write_iter,
-+ .mmap = vboxsf_file_mmap,
-+ .open = vboxsf_file_open,
-+ .release = vboxsf_file_release,
-+ .fsync = noop_fsync,
-+ .splice_read = generic_file_splice_read,
-+};
-+
-+const struct inode_operations vboxsf_reg_iops = {
-+ .getattr = vboxsf_getattr,
-+ .setattr = vboxsf_setattr
-+};
-+
-+static int vboxsf_readpage(struct file *file, struct page *page)
-+{
-+ struct vboxsf_handle *sf_handle = file->private_data;
-+ loff_t off = page_offset(page);
-+ u32 nread = PAGE_SIZE;
-+ u8 *buf;
-+ int err;
-+
-+ buf = kmap(page);
-+
-+ err = vboxsf_read(sf_handle->root, sf_handle->handle, off, &nread, buf);
-+ if (err == 0) {
-+ memset(&buf[nread], 0, PAGE_SIZE - nread);
-+ flush_dcache_page(page);
-+ SetPageUptodate(page);
-+ } else {
-+ SetPageError(page);
-+ }
-+
-+ kunmap(page);
-+ unlock_page(page);
-+ return err;
-+}
-+
-+static struct vboxsf_handle *vboxsf_get_write_handle(struct vboxsf_inode *sf_i)
-+{
-+ struct vboxsf_handle *h, *sf_handle = NULL;
-+
-+ mutex_lock(&sf_i->handle_list_mutex);
-+ list_for_each_entry(h, &sf_i->handle_list, head) {
-+ if (h->access_flags == SHFL_CF_ACCESS_WRITE ||
-+ h->access_flags == SHFL_CF_ACCESS_READWRITE) {
-+ kref_get(&h->refcount);
-+ sf_handle = h;
-+ break;
-+ }
-+ }
-+ mutex_unlock(&sf_i->handle_list_mutex);
-+
-+ return sf_handle;
-+}
-+
-+static int vboxsf_writepage(struct page *page, struct writeback_control *wbc)
-+{
-+ struct inode *inode = page->mapping->host;
-+ struct vboxsf_inode *sf_i = VBOXSF_I(inode);
-+ struct vboxsf_handle *sf_handle;
-+ loff_t off = page_offset(page);
-+ loff_t size = i_size_read(inode);
-+ u32 nwrite = PAGE_SIZE;
-+ u8 *buf;
-+ int err;
-+
-+ if (off + PAGE_SIZE > size)
-+ nwrite = size & ~PAGE_MASK;
-+
-+ sf_handle = vboxsf_get_write_handle(sf_i);
-+ if (!sf_handle)
-+ return -EBADF;
-+
-+ buf = kmap(page);
-+ err = vboxsf_write(sf_handle->root, sf_handle->handle,
-+ off, &nwrite, buf);
-+ kunmap(page);
-+
-+ kref_put(&sf_handle->refcount, vboxsf_handle_release);
-+
-+ if (err == 0) {
-+ ClearPageError(page);
-+ /* mtime changed */
-+ sf_i->force_restat = 1;
-+ } else {
-+ ClearPageUptodate(page);
-+ }
-+
-+ unlock_page(page);
-+ return err;
-+}
-+
-+static int vboxsf_write_end(struct file *file, struct address_space *mapping,
-+ loff_t pos, unsigned int len, unsigned int copied,
-+ struct page *page, void *fsdata)
-+{
-+ struct inode *inode = mapping->host;
-+ struct vboxsf_handle *sf_handle = file->private_data;
-+ unsigned int from = pos & ~PAGE_MASK;
-+ u32 nwritten = len;
-+ u8 *buf;
-+ int err;
-+
-+ /* zero the stale part of the page if we did a short copy */
-+ if (!PageUptodate(page) && copied < len)
-+ zero_user(page, from + copied, len - copied);
-+
-+ buf = kmap(page);
-+ err = vboxsf_write(sf_handle->root, sf_handle->handle,
-+ pos, &nwritten, buf + from);
-+ kunmap(page);
-+
-+ if (err) {
-+ nwritten = 0;
-+ goto out;
-+ }
-+
-+ /* mtime changed */
-+ VBOXSF_I(inode)->force_restat = 1;
-+
-+ if (!PageUptodate(page) && nwritten == PAGE_SIZE)
-+ SetPageUptodate(page);
-+
-+ pos += nwritten;
-+ if (pos > inode->i_size)
-+ i_size_write(inode, pos);
-+
-+out:
-+ unlock_page(page);
-+ put_page(page);
-+
-+ return nwritten;
-+}
-+
-+/*
-+ * Note simple_write_begin does not read the page from disk on partial writes
-+ * this is ok since vboxsf_write_end only writes the written parts of the
-+ * page and it does not call SetPageUptodate for partial writes.
-+ */
-+const struct address_space_operations vboxsf_reg_aops = {
-+ .readpage = vboxsf_readpage,
-+ .writepage = vboxsf_writepage,
-+ .set_page_dirty = __set_page_dirty_nobuffers,
-+ .write_begin = simple_write_begin,
-+ .write_end = vboxsf_write_end,
-+};
-+
-+static const char *vboxsf_get_link(struct dentry *dentry, struct inode *inode,
-+ struct delayed_call *done)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
-+ struct shfl_string *path;
-+ char *link;
-+ int err;
-+
-+ if (!dentry)
-+ return ERR_PTR(-ECHILD);
-+
-+ path = vboxsf_path_from_dentry(sbi, dentry);
-+ if (IS_ERR(path))
-+ return ERR_CAST(path);
-+
-+ link = kzalloc(PATH_MAX, GFP_KERNEL);
-+ if (!link) {
-+ __putname(path);
-+ return ERR_PTR(-ENOMEM);
-+ }
-+
-+ err = vboxsf_readlink(sbi->root, path, PATH_MAX, link);
-+ __putname(path);
-+ if (err) {
-+ kfree(link);
-+ return ERR_PTR(err);
-+ }
-+
-+ set_delayed_call(done, kfree_link, link);
-+ return link;
-+}
-+
-+const struct inode_operations vboxsf_lnk_iops = {
-+ .get_link = vboxsf_get_link
-+};
-diff --git a/fs/vboxsf/shfl_hostintf.h b/fs/vboxsf/shfl_hostintf.h
-new file mode 100644
-index 000000000000..aca829062c12
---- /dev/null
-+++ b/fs/vboxsf/shfl_hostintf.h
-@@ -0,0 +1,901 @@
-+/* SPDX-License-Identifier: MIT */
-+/*
-+ * VirtualBox Shared Folders: host interface definition.
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#ifndef SHFL_HOSTINTF_H
-+#define SHFL_HOSTINTF_H
-+
-+#include <linux/vbox_vmmdev_types.h>
-+
-+/* The max in/out buffer size for a FN_READ or FN_WRITE call */
-+#define SHFL_MAX_RW_COUNT (16 * SZ_1M)
-+
-+/*
-+ * Structures shared between guest and the service
-+ * can be relocated and use offsets to point to variable
-+ * length parts.
-+ *
-+ * Shared folders protocol works with handles.
-+ * Before doing any action on a file system object,
-+ * one have to obtain the object handle via a SHFL_FN_CREATE
-+ * request. A handle must be closed with SHFL_FN_CLOSE.
-+ */
-+
-+enum {
-+ SHFL_FN_QUERY_MAPPINGS = 1, /* Query mappings changes. */
-+ SHFL_FN_QUERY_MAP_NAME = 2, /* Query map name. */
-+ SHFL_FN_CREATE = 3, /* Open/create object. */
-+ SHFL_FN_CLOSE = 4, /* Close object handle. */
-+ SHFL_FN_READ = 5, /* Read object content. */
-+ SHFL_FN_WRITE = 6, /* Write new object content. */
-+ SHFL_FN_LOCK = 7, /* Lock/unlock a range in the object. */
-+ SHFL_FN_LIST = 8, /* List object content. */
-+ SHFL_FN_INFORMATION = 9, /* Query/set object information. */
-+ /* Note function number 10 is not used! */
-+ SHFL_FN_REMOVE = 11, /* Remove object */
-+ SHFL_FN_MAP_FOLDER_OLD = 12, /* Map folder (legacy) */
-+ SHFL_FN_UNMAP_FOLDER = 13, /* Unmap folder */
-+ SHFL_FN_RENAME = 14, /* Rename object */
-+ SHFL_FN_FLUSH = 15, /* Flush file */
-+ SHFL_FN_SET_UTF8 = 16, /* Select UTF8 filename encoding */
-+ SHFL_FN_MAP_FOLDER = 17, /* Map folder */
-+ SHFL_FN_READLINK = 18, /* Read symlink dest (as of VBox 4.0) */
-+ SHFL_FN_SYMLINK = 19, /* Create symlink (as of VBox 4.0) */
-+ SHFL_FN_SET_SYMLINKS = 20, /* Ask host to show symlinks (4.0+) */
-+};
-+
-+/* Root handles for a mapping are of type u32, Root handles are unique. */
-+#define SHFL_ROOT_NIL UINT_MAX
-+
-+/* Shared folders handle for an opened object are of type u64. */
-+#define SHFL_HANDLE_NIL ULLONG_MAX
-+
-+/* Hardcoded maximum length (in chars) of a shared folder name. */
-+#define SHFL_MAX_LEN (256)
-+/* Hardcoded maximum number of shared folder mapping available to the guest. */
-+#define SHFL_MAX_MAPPINGS (64)
-+
-+/** Shared folder string buffer structure. */
-+struct shfl_string {
-+ /** Allocated size of the string member in bytes. */
-+ u16 size;
-+
-+ /** Length of string without trailing nul in bytes. */
-+ u16 length;
-+
-+ /** UTF-8 or UTF-16 string. Nul terminated. */
-+ union {
-+ u8 utf8[2];
-+ u16 utf16[1];
-+ u16 ucs2[1]; /* misnomer, use utf16. */
-+ } string;
-+};
-+VMMDEV_ASSERT_SIZE(shfl_string, 6);
-+
-+/* The size of shfl_string w/o the string part. */
-+#define SHFLSTRING_HEADER_SIZE 4
-+
-+/* Calculate size of the string. */
-+static inline u32 shfl_string_buf_size(const struct shfl_string *string)
-+{
-+ return string ? SHFLSTRING_HEADER_SIZE + string->size : 0;
-+}
-+
-+/* Set user id on execution (S_ISUID). */
-+#define SHFL_UNIX_ISUID 0004000U
-+/* Set group id on execution (S_ISGID). */
-+#define SHFL_UNIX_ISGID 0002000U
-+/* Sticky bit (S_ISVTX / S_ISTXT). */
-+#define SHFL_UNIX_ISTXT 0001000U
-+
-+/* Owner readable (S_IRUSR). */
-+#define SHFL_UNIX_IRUSR 0000400U
-+/* Owner writable (S_IWUSR). */
-+#define SHFL_UNIX_IWUSR 0000200U
-+/* Owner executable (S_IXUSR). */
-+#define SHFL_UNIX_IXUSR 0000100U
-+
-+/* Group readable (S_IRGRP). */
-+#define SHFL_UNIX_IRGRP 0000040U
-+/* Group writable (S_IWGRP). */
-+#define SHFL_UNIX_IWGRP 0000020U
-+/* Group executable (S_IXGRP). */
-+#define SHFL_UNIX_IXGRP 0000010U
-+
-+/* Other readable (S_IROTH). */
-+#define SHFL_UNIX_IROTH 0000004U
-+/* Other writable (S_IWOTH). */
-+#define SHFL_UNIX_IWOTH 0000002U
-+/* Other executable (S_IXOTH). */
-+#define SHFL_UNIX_IXOTH 0000001U
-+
-+/* Named pipe (fifo) (S_IFIFO). */
-+#define SHFL_TYPE_FIFO 0010000U
-+/* Character device (S_IFCHR). */
-+#define SHFL_TYPE_DEV_CHAR 0020000U
-+/* Directory (S_IFDIR). */
-+#define SHFL_TYPE_DIRECTORY 0040000U
-+/* Block device (S_IFBLK). */
-+#define SHFL_TYPE_DEV_BLOCK 0060000U
-+/* Regular file (S_IFREG). */
-+#define SHFL_TYPE_FILE 0100000U
-+/* Symbolic link (S_IFLNK). */
-+#define SHFL_TYPE_SYMLINK 0120000U
-+/* Socket (S_IFSOCK). */
-+#define SHFL_TYPE_SOCKET 0140000U
-+/* Whiteout (S_IFWHT). */
-+#define SHFL_TYPE_WHITEOUT 0160000U
-+/* Type mask (S_IFMT). */
-+#define SHFL_TYPE_MASK 0170000U
-+
-+/* Checks the mode flags indicate a directory (S_ISDIR). */
-+#define SHFL_IS_DIRECTORY(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY)
-+/* Checks the mode flags indicate a symbolic link (S_ISLNK). */
-+#define SHFL_IS_SYMLINK(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK)
-+
-+/** The available additional information in a shfl_fsobjattr object. */
-+enum shfl_fsobjattr_add {
-+ /** No additional information is available / requested. */
-+ SHFLFSOBJATTRADD_NOTHING = 1,
-+ /**
-+ * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are
-+ * available / requested.
-+ */
-+ SHFLFSOBJATTRADD_UNIX,
-+ /**
-+ * The additional extended attribute size (shfl_fsobjattr::u::size) is
-+ * available / requested.
-+ */
-+ SHFLFSOBJATTRADD_EASIZE,
-+ /**
-+ * The last valid item (inclusive).
-+ * The valid range is SHFLFSOBJATTRADD_NOTHING thru
-+ * SHFLFSOBJATTRADD_LAST.
-+ */
-+ SHFLFSOBJATTRADD_LAST = SHFLFSOBJATTRADD_EASIZE,
-+
-+ /** The usual 32-bit hack. */
-+ SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
-+};
-+
-+/**
-+ * Additional unix Attributes, these are available when
-+ * shfl_fsobjattr.additional == SHFLFSOBJATTRADD_UNIX.
-+ */
-+struct shfl_fsobjattr_unix {
-+ /**
-+ * The user owning the filesystem object (st_uid).
-+ * This field is ~0U if not supported.
-+ */
-+ u32 uid;
-+
-+ /**
-+ * The group the filesystem object is assigned (st_gid).
-+ * This field is ~0U if not supported.
-+ */
-+ u32 gid;
-+
-+ /**
-+ * Number of hard links to this filesystem object (st_nlink).
-+ * This field is 1 if the filesystem doesn't support hardlinking or
-+ * the information isn't available.
-+ */
-+ u32 hardlinks;
-+
-+ /**
-+ * The device number of the device which this filesystem object resides
-+ * on (st_dev). This field is 0 if this information is not available.
-+ */
-+ u32 inode_id_device;
-+
-+ /**
-+ * The unique identifier (within the filesystem) of this filesystem
-+ * object (st_ino). Together with inode_id_device, this field can be
-+ * used as a OS wide unique id, when both their values are not 0.
-+ * This field is 0 if the information is not available.
-+ */
-+ u64 inode_id;
-+
-+ /**
-+ * User flags (st_flags).
-+ * This field is 0 if this information is not available.
-+ */
-+ u32 flags;
-+
-+ /**
-+ * The current generation number (st_gen).
-+ * This field is 0 if this information is not available.
-+ */
-+ u32 generation_id;
-+
-+ /**
-+ * The device number of a char. or block device type object (st_rdev).
-+ * This field is 0 if the file isn't a char. or block device or when
-+ * the OS doesn't use the major+minor device idenfication scheme.
-+ */
-+ u32 device;
-+} __packed;
-+
-+/** Extended attribute size. */
-+struct shfl_fsobjattr_easize {
-+ /** Size of EAs. */
-+ s64 cb;
-+} __packed;
-+
-+/** Shared folder filesystem object attributes. */
-+struct shfl_fsobjattr {
-+ /** Mode flags (st_mode). SHFL_UNIX_*, SHFL_TYPE_*, and SHFL_DOS_*. */
-+ u32 mode;
-+
-+ /** The additional attributes available. */
-+ enum shfl_fsobjattr_add additional;
-+
-+ /**
-+ * Additional attributes.
-+ *
-+ * Unless explicitly specified to an API, the API can provide additional
-+ * data as it is provided by the underlying OS.
-+ */
-+ union {
-+ struct shfl_fsobjattr_unix unix_attr;
-+ struct shfl_fsobjattr_easize size;
-+ } __packed u;
-+} __packed;
-+VMMDEV_ASSERT_SIZE(shfl_fsobjattr, 44);
-+
-+struct shfl_timespec {
-+ s64 ns_relative_to_unix_epoch;
-+};
-+
-+/** Filesystem object information structure. */
-+struct shfl_fsobjinfo {
-+ /**
-+ * Logical size (st_size).
-+ * For normal files this is the size of the file.
-+ * For symbolic links, this is the length of the path name contained
-+ * in the symbolic link.
-+ * For other objects this fields needs to be specified.
-+ */
-+ s64 size;
-+
-+ /** Disk allocation size (st_blocks * DEV_BSIZE). */
-+ s64 allocated;
-+
-+ /** Time of last access (st_atime). */
-+ struct shfl_timespec access_time;
-+
-+ /** Time of last data modification (st_mtime). */
-+ struct shfl_timespec modification_time;
-+
-+ /**
-+ * Time of last status change (st_ctime).
-+ * If not available this is set to modification_time.
-+ */
-+ struct shfl_timespec change_time;
-+
-+ /**
-+ * Time of file birth (st_birthtime).
-+ * If not available this is set to change_time.
-+ */
-+ struct shfl_timespec birth_time;
-+
-+ /** Attributes. */
-+ struct shfl_fsobjattr attr;
-+
-+} __packed;
-+VMMDEV_ASSERT_SIZE(shfl_fsobjinfo, 92);
-+
-+/**
-+ * result of an open/create request.
-+ * Along with handle value the result code
-+ * identifies what has happened while
-+ * trying to open the object.
-+ */
-+enum shfl_create_result {
-+ SHFL_NO_RESULT,
-+ /** Specified path does not exist. */
-+ SHFL_PATH_NOT_FOUND,
-+ /** Path to file exists, but the last component does not. */
-+ SHFL_FILE_NOT_FOUND,
-+ /** File already exists and either has been opened or not. */
-+ SHFL_FILE_EXISTS,
-+ /** New file was created. */
-+ SHFL_FILE_CREATED,
-+ /** Existing file was replaced or overwritten. */
-+ SHFL_FILE_REPLACED
-+};
-+
-+/* No flags. Initialization value. */
-+#define SHFL_CF_NONE (0x00000000)
-+
-+/*
-+ * Only lookup the object, do not return a handle. When this is set all other
-+ * flags are ignored.
-+ */
-+#define SHFL_CF_LOOKUP (0x00000001)
-+
-+/*
-+ * Open parent directory of specified object.
-+ * Useful for the corresponding Windows FSD flag
-+ * and for opening paths like \\dir\\*.* to search the 'dir'.
-+ */
-+#define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002)
-+
-+/* Create/open a directory. */
-+#define SHFL_CF_DIRECTORY (0x00000004)
-+
-+/*
-+ * Open/create action to do if object exists
-+ * and if the object does not exists.
-+ * REPLACE file means atomically DELETE and CREATE.
-+ * OVERWRITE file means truncating the file to 0 and
-+ * setting new size.
-+ * When opening an existing directory REPLACE and OVERWRITE
-+ * actions are considered invalid, and cause returning
-+ * FILE_EXISTS with NIL handle.
-+ */
-+#define SHFL_CF_ACT_MASK_IF_EXISTS (0x000000f0)
-+#define SHFL_CF_ACT_MASK_IF_NEW (0x00000f00)
-+
-+/* What to do if object exists. */
-+#define SHFL_CF_ACT_OPEN_IF_EXISTS (0x00000000)
-+#define SHFL_CF_ACT_FAIL_IF_EXISTS (0x00000010)
-+#define SHFL_CF_ACT_REPLACE_IF_EXISTS (0x00000020)
-+#define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
-+
-+/* What to do if object does not exist. */
-+#define SHFL_CF_ACT_CREATE_IF_NEW (0x00000000)
-+#define SHFL_CF_ACT_FAIL_IF_NEW (0x00000100)
-+
-+/* Read/write requested access for the object. */
-+#define SHFL_CF_ACCESS_MASK_RW (0x00003000)
-+
-+/* No access requested. */
-+#define SHFL_CF_ACCESS_NONE (0x00000000)
-+/* Read access requested. */
-+#define SHFL_CF_ACCESS_READ (0x00001000)
-+/* Write access requested. */
-+#define SHFL_CF_ACCESS_WRITE (0x00002000)
-+/* Read/Write access requested. */
-+#define SHFL_CF_ACCESS_READWRITE (0x00003000)
-+
-+/* Requested share access for the object. */
-+#define SHFL_CF_ACCESS_MASK_DENY (0x0000c000)
-+
-+/* Allow any access. */
-+#define SHFL_CF_ACCESS_DENYNONE (0x00000000)
-+/* Do not allow read. */
-+#define SHFL_CF_ACCESS_DENYREAD (0x00004000)
-+/* Do not allow write. */
-+#define SHFL_CF_ACCESS_DENYWRITE (0x00008000)
-+/* Do not allow access. */
-+#define SHFL_CF_ACCESS_DENYALL (0x0000c000)
-+
-+/* Requested access to attributes of the object. */
-+#define SHFL_CF_ACCESS_MASK_ATTR (0x00030000)
-+
-+/* No access requested. */
-+#define SHFL_CF_ACCESS_ATTR_NONE (0x00000000)
-+/* Read access requested. */
-+#define SHFL_CF_ACCESS_ATTR_READ (0x00010000)
-+/* Write access requested. */
-+#define SHFL_CF_ACCESS_ATTR_WRITE (0x00020000)
-+/* Read/Write access requested. */
-+#define SHFL_CF_ACCESS_ATTR_READWRITE (0x00030000)
-+
-+/*
-+ * The file is opened in append mode.
-+ * Ignored if SHFL_CF_ACCESS_WRITE is not set.
-+ */
-+#define SHFL_CF_ACCESS_APPEND (0x00040000)
-+
-+/** Create parameters buffer struct for SHFL_FN_CREATE call */
-+struct shfl_createparms {
-+ /** Returned handle of opened object. */
-+ u64 handle;
-+
-+ /** Returned result of the operation */
-+ enum shfl_create_result result;
-+
-+ /** SHFL_CF_* */
-+ u32 create_flags;
-+
-+ /**
-+ * Attributes of object to create and
-+ * returned actual attributes of opened/created object.
-+ */
-+ struct shfl_fsobjinfo info;
-+} __packed;
-+
-+/** Shared Folder directory information */
-+struct shfl_dirinfo {
-+ /** Full information about the object. */
-+ struct shfl_fsobjinfo info;
-+ /**
-+ * The length of the short field (number of UTF16 chars).
-+ * It is 16-bit for reasons of alignment.
-+ */
-+ u16 short_name_len;
-+ /**
-+ * The short name for 8.3 compatibility.
-+ * Empty string if not available.
-+ */
-+ u16 short_name[14];
-+ struct shfl_string name;
-+};
-+
-+/** Shared folder filesystem properties. */
-+struct shfl_fsproperties {
-+ /**
-+ * The maximum size of a filesystem object name.
-+ * This does not include the '\\0'.
-+ */
-+ u32 max_component_len;
-+
-+ /**
-+ * True if the filesystem is remote.
-+ * False if the filesystem is local.
-+ */
-+ bool remote;
-+
-+ /**
-+ * True if the filesystem is case sensitive.
-+ * False if the filesystem is case insensitive.
-+ */
-+ bool case_sensitive;
-+
-+ /**
-+ * True if the filesystem is mounted read only.
-+ * False if the filesystem is mounted read write.
-+ */
-+ bool read_only;
-+
-+ /**
-+ * True if the filesystem can encode unicode object names.
-+ * False if it can't.
-+ */
-+ bool supports_unicode;
-+
-+ /**
-+ * True if the filesystem is compresses.
-+ * False if it isn't or we don't know.
-+ */
-+ bool compressed;
-+
-+ /**
-+ * True if the filesystem compresses of individual files.
-+ * False if it doesn't or we don't know.
-+ */
-+ bool file_compression;
-+};
-+VMMDEV_ASSERT_SIZE(shfl_fsproperties, 12);
-+
-+struct shfl_volinfo {
-+ s64 total_allocation_bytes;
-+ s64 available_allocation_bytes;
-+ u32 bytes_per_allocation_unit;
-+ u32 bytes_per_sector;
-+ u32 serial;
-+ struct shfl_fsproperties properties;
-+};
-+
-+
-+/** SHFL_FN_MAP_FOLDER Parameters structure. */
-+struct shfl_map_folder {
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string buffer.
-+ */
-+ struct vmmdev_hgcm_function_parameter path;
-+
-+ /**
-+ * pointer, out: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in: UTF16
-+ * Path delimiter
-+ */
-+ struct vmmdev_hgcm_function_parameter delimiter;
-+
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Case senstive flag
-+ */
-+ struct vmmdev_hgcm_function_parameter case_sensitive;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_MAP_FOLDER (4)
-+
-+
-+/** SHFL_FN_UNMAP_FOLDER Parameters structure. */
-+struct shfl_unmap_folder {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_UNMAP_FOLDER (1)
-+
-+
-+/** SHFL_FN_CREATE Parameters structure. */
-+struct shfl_create {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string buffer.
-+ */
-+ struct vmmdev_hgcm_function_parameter path;
-+
-+ /**
-+ * pointer, in/out:
-+ * Points to struct shfl_createparms buffer.
-+ */
-+ struct vmmdev_hgcm_function_parameter parms;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_CREATE (3)
-+
-+
-+/** SHFL_FN_CLOSE Parameters structure. */
-+struct shfl_close {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * value64, in:
-+ * SHFLHANDLE (u64) of object to close.
-+ */
-+ struct vmmdev_hgcm_function_parameter handle;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_CLOSE (2)
-+
-+
-+/** SHFL_FN_READ Parameters structure. */
-+struct shfl_read {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * value64, in:
-+ * SHFLHANDLE (u64) of object to read from.
-+ */
-+ struct vmmdev_hgcm_function_parameter handle;
-+
-+ /**
-+ * value64, in:
-+ * Offset to read from.
-+ */
-+ struct vmmdev_hgcm_function_parameter offset;
-+
-+ /**
-+ * value64, in/out:
-+ * Bytes to read/How many were read.
-+ */
-+ struct vmmdev_hgcm_function_parameter cb;
-+
-+ /**
-+ * pointer, out:
-+ * Buffer to place data to.
-+ */
-+ struct vmmdev_hgcm_function_parameter buffer;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_READ (5)
-+
-+
-+/** SHFL_FN_WRITE Parameters structure. */
-+struct shfl_write {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * value64, in:
-+ * SHFLHANDLE (u64) of object to write to.
-+ */
-+ struct vmmdev_hgcm_function_parameter handle;
-+
-+ /**
-+ * value64, in:
-+ * Offset to write to.
-+ */
-+ struct vmmdev_hgcm_function_parameter offset;
-+
-+ /**
-+ * value64, in/out:
-+ * Bytes to write/How many were written.
-+ */
-+ struct vmmdev_hgcm_function_parameter cb;
-+
-+ /**
-+ * pointer, in:
-+ * Data to write.
-+ */
-+ struct vmmdev_hgcm_function_parameter buffer;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_WRITE (5)
-+
-+
-+/*
-+ * SHFL_FN_LIST
-+ * Listing information includes variable length RTDIRENTRY[EX] structures.
-+ */
-+
-+#define SHFL_LIST_NONE 0
-+#define SHFL_LIST_RETURN_ONE 1
-+
-+/** SHFL_FN_LIST Parameters structure. */
-+struct shfl_list {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * value64, in:
-+ * SHFLHANDLE (u64) of object to be listed.
-+ */
-+ struct vmmdev_hgcm_function_parameter handle;
-+
-+ /**
-+ * value32, in:
-+ * List flags SHFL_LIST_*.
-+ */
-+ struct vmmdev_hgcm_function_parameter flags;
-+
-+ /**
-+ * value32, in/out:
-+ * Bytes to be used for listing information/How many bytes were used.
-+ */
-+ struct vmmdev_hgcm_function_parameter cb;
-+
-+ /**
-+ * pointer, in/optional
-+ * Points to struct shfl_string buffer that specifies a search path.
-+ */
-+ struct vmmdev_hgcm_function_parameter path;
-+
-+ /**
-+ * pointer, out:
-+ * Buffer to place listing information to. (struct shfl_dirinfo)
-+ */
-+ struct vmmdev_hgcm_function_parameter buffer;
-+
-+ /**
-+ * value32, in/out:
-+ * Indicates a key where the listing must be resumed.
-+ * in: 0 means start from begin of object.
-+ * out: 0 means listing completed.
-+ */
-+ struct vmmdev_hgcm_function_parameter resume_point;
-+
-+ /**
-+ * pointer, out:
-+ * Number of files returned
-+ */
-+ struct vmmdev_hgcm_function_parameter file_count;
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_LIST (8)
-+
-+
-+/** SHFL_FN_READLINK Parameters structure. */
-+struct shfl_readLink {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string buffer.
-+ */
-+ struct vmmdev_hgcm_function_parameter path;
-+
-+ /**
-+ * pointer, out:
-+ * Buffer to place data to.
-+ */
-+ struct vmmdev_hgcm_function_parameter buffer;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_READLINK (3)
-+
-+
-+/* SHFL_FN_INFORMATION */
-+
-+/* Mask of Set/Get bit. */
-+#define SHFL_INFO_MODE_MASK (0x1)
-+/* Get information */
-+#define SHFL_INFO_GET (0x0)
-+/* Set information */
-+#define SHFL_INFO_SET (0x1)
-+
-+/* Get name of the object. */
-+#define SHFL_INFO_NAME (0x2)
-+/* Set size of object (extend/trucate); only applies to file objects */
-+#define SHFL_INFO_SIZE (0x4)
-+/* Get/Set file object info. */
-+#define SHFL_INFO_FILE (0x8)
-+/* Get volume information. */
-+#define SHFL_INFO_VOLUME (0x10)
-+
-+/** SHFL_FN_INFORMATION Parameters structure. */
-+struct shfl_information {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * value64, in:
-+ * SHFLHANDLE (u64) of object to be listed.
-+ */
-+ struct vmmdev_hgcm_function_parameter handle;
-+
-+ /**
-+ * value32, in:
-+ * SHFL_INFO_*
-+ */
-+ struct vmmdev_hgcm_function_parameter flags;
-+
-+ /**
-+ * value32, in/out:
-+ * Bytes to be used for information/How many bytes were used.
-+ */
-+ struct vmmdev_hgcm_function_parameter cb;
-+
-+ /**
-+ * pointer, in/out:
-+ * Information to be set/get (shfl_fsobjinfo or shfl_string). Do not
-+ * forget to set the shfl_fsobjinfo::attr::additional for a get
-+ * operation as well.
-+ */
-+ struct vmmdev_hgcm_function_parameter info;
-+
-+};
-+
-+/* Number of parameters */
-+#define SHFL_CPARMS_INFORMATION (5)
-+
-+
-+/* SHFL_FN_REMOVE */
-+
-+#define SHFL_REMOVE_FILE (0x1)
-+#define SHFL_REMOVE_DIR (0x2)
-+#define SHFL_REMOVE_SYMLINK (0x4)
-+
-+/** SHFL_FN_REMOVE Parameters structure. */
-+struct shfl_remove {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string buffer.
-+ */
-+ struct vmmdev_hgcm_function_parameter path;
-+
-+ /**
-+ * value32, in:
-+ * remove flags (file/directory)
-+ */
-+ struct vmmdev_hgcm_function_parameter flags;
-+
-+};
-+
-+#define SHFL_CPARMS_REMOVE (3)
-+
-+
-+/* SHFL_FN_RENAME */
-+
-+#define SHFL_RENAME_FILE (0x1)
-+#define SHFL_RENAME_DIR (0x2)
-+#define SHFL_RENAME_REPLACE_IF_EXISTS (0x4)
-+
-+/** SHFL_FN_RENAME Parameters structure. */
-+struct shfl_rename {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string src.
-+ */
-+ struct vmmdev_hgcm_function_parameter src;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string dest.
-+ */
-+ struct vmmdev_hgcm_function_parameter dest;
-+
-+ /**
-+ * value32, in:
-+ * rename flags (file/directory)
-+ */
-+ struct vmmdev_hgcm_function_parameter flags;
-+
-+};
-+
-+#define SHFL_CPARMS_RENAME (4)
-+
-+
-+/** SHFL_FN_SYMLINK Parameters structure. */
-+struct shfl_symlink {
-+ /**
-+ * pointer, in: SHFLROOT (u32)
-+ * Root handle of the mapping which name is queried.
-+ */
-+ struct vmmdev_hgcm_function_parameter root;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string of path for the new symlink.
-+ */
-+ struct vmmdev_hgcm_function_parameter new_path;
-+
-+ /**
-+ * pointer, in:
-+ * Points to struct shfl_string of destination for symlink.
-+ */
-+ struct vmmdev_hgcm_function_parameter old_path;
-+
-+ /**
-+ * pointer, out:
-+ * Information about created symlink.
-+ */
-+ struct vmmdev_hgcm_function_parameter info;
-+
-+};
-+
-+#define SHFL_CPARMS_SYMLINK (4)
-+
-+#endif
-diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
-new file mode 100644
-index 000000000000..b14ecd2948f4
---- /dev/null
-+++ b/fs/vboxsf/super.c
-@@ -0,0 +1,497 @@
-+// SPDX-License-Identifier: MIT
-+/*
-+ * VirtualBox Guest Shared Folders support: Virtual File System.
-+ *
-+ * Module initialization/finalization
-+ * File system registration/deregistration
-+ * Superblock reading
-+ * Few utility functions
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#include <linux/idr.h>
-+#include <linux/fs_parser.h>
-+#include <linux/magic.h>
-+#include <linux/module.h>
-+#include <linux/nls.h>
-+#include <linux/statfs.h>
-+#include <linux/vbox_utils.h>
-+#include "vfsmod.h"
-+
-+#define VBOXSF_SUPER_MAGIC 0x786f4256 /* 'VBox' little endian */
-+
-+#define VBSF_MOUNT_SIGNATURE_BYTE_0 ('\000')
-+#define VBSF_MOUNT_SIGNATURE_BYTE_1 ('\377')
-+#define VBSF_MOUNT_SIGNATURE_BYTE_2 ('\376')
-+#define VBSF_MOUNT_SIGNATURE_BYTE_3 ('\375')
-+
-+static int follow_symlinks;
-+module_param(follow_symlinks, int, 0444);
-+MODULE_PARM_DESC(follow_symlinks,
-+ "Let host resolve symlinks rather than showing them");
-+
-+static DEFINE_IDA(vboxsf_bdi_ida);
-+static DEFINE_MUTEX(vboxsf_setup_mutex);
-+static bool vboxsf_setup_done;
-+static struct super_operations vboxsf_super_ops; /* forward declaration */
-+static struct kmem_cache *vboxsf_inode_cachep;
-+
-+static char * const vboxsf_default_nls = CONFIG_NLS_DEFAULT;
-+
-+enum { opt_nls, opt_uid, opt_gid, opt_ttl, opt_dmode, opt_fmode,
-+ opt_dmask, opt_fmask };
-+
-+static const struct fs_parameter_spec vboxsf_param_specs[] = {
-+ fsparam_string ("nls", opt_nls),
-+ fsparam_u32 ("uid", opt_uid),
-+ fsparam_u32 ("gid", opt_gid),
-+ fsparam_u32 ("ttl", opt_ttl),
-+ fsparam_u32oct ("dmode", opt_dmode),
-+ fsparam_u32oct ("fmode", opt_fmode),
-+ fsparam_u32oct ("dmask", opt_dmask),
-+ fsparam_u32oct ("fmask", opt_fmask),
-+ {}
-+};
-+
-+static const struct fs_parameter_description vboxsf_fs_parameters = {
-+ .name = "vboxsf",
-+ .specs = vboxsf_param_specs,
-+};
-+
-+static int vboxsf_parse_param(struct fs_context *fc, struct fs_parameter *param)
-+{
-+ struct vboxsf_fs_context *ctx = fc->fs_private;
-+ struct fs_parse_result result;
-+ kuid_t uid;
-+ kgid_t gid;
-+ int opt;
-+
-+ opt = fs_parse(fc, &vboxsf_fs_parameters, param, &result);
-+ if (opt < 0)
-+ return opt;
-+
-+ switch (opt) {
-+ case opt_nls:
-+ if (ctx->nls_name || fc->purpose != FS_CONTEXT_FOR_MOUNT) {
-+ vbg_err("vboxsf: Cannot reconfigure nls option\n");
-+ return -EINVAL;
-+ }
-+ ctx->nls_name = param->string;
-+ param->string = NULL;
-+ break;
-+ case opt_uid:
-+ uid = make_kuid(current_user_ns(), result.uint_32);
-+ if (!uid_valid(uid))
-+ return -EINVAL;
-+ ctx->o.uid = uid;
-+ break;
-+ case opt_gid:
-+ gid = make_kgid(current_user_ns(), result.uint_32);
-+ if (!gid_valid(gid))
-+ return -EINVAL;
-+ ctx->o.gid = gid;
-+ break;
-+ case opt_ttl:
-+ ctx->o.ttl = msecs_to_jiffies(result.uint_32);
-+ break;
-+ case opt_dmode:
-+ if (result.uint_32 & ~0777)
-+ return -EINVAL;
-+ ctx->o.dmode = result.uint_32;
-+ ctx->o.dmode_set = true;
-+ break;
-+ case opt_fmode:
-+ if (result.uint_32 & ~0777)
-+ return -EINVAL;
-+ ctx->o.fmode = result.uint_32;
-+ ctx->o.fmode_set = true;
-+ break;
-+ case opt_dmask:
-+ if (result.uint_32 & ~07777)
-+ return -EINVAL;
-+ ctx->o.dmask = result.uint_32;
-+ break;
-+ case opt_fmask:
-+ if (result.uint_32 & ~07777)
-+ return -EINVAL;
-+ ctx->o.fmask = result.uint_32;
-+ break;
-+ default:
-+ return -EINVAL;
-+ }
-+
-+ return 0;
-+}
-+
-+static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
-+{
-+ struct vboxsf_fs_context *ctx = fc->fs_private;
-+ struct shfl_string *folder_name, root_path;
-+ struct vboxsf_sbi *sbi;
-+ struct dentry *droot;
-+ struct inode *iroot;
-+ char *nls_name;
-+ size_t size;
-+ int err;
-+
-+ if (!fc->source)
-+ return -EINVAL;
-+
-+ sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
-+ if (!sbi)
-+ return -ENOMEM;
-+
-+ sbi->o = ctx->o;
-+ idr_init(&sbi->ino_idr);
-+ spin_lock_init(&sbi->ino_idr_lock);
-+ sbi->next_generation = 1;
-+ sbi->bdi_id = -1;
-+
-+ /* Load nls if not utf8 */
-+ nls_name = ctx->nls_name ? ctx->nls_name : vboxsf_default_nls;
-+ if (strcmp(nls_name, "utf8") != 0) {
-+ if (nls_name == vboxsf_default_nls)
-+ sbi->nls = load_nls_default();
-+ else
-+ sbi->nls = load_nls(nls_name);
-+
-+ if (!sbi->nls) {
-+ vbg_err("vboxsf: Count not load '%s' nls\n", nls_name);
-+ err = -EINVAL;
-+ goto fail_free;
-+ }
-+ }
-+
-+ sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL);
-+ if (sbi->bdi_id < 0) {
-+ err = sbi->bdi_id;
-+ goto fail_free;
-+ }
-+
-+ err = super_setup_bdi_name(sb, "vboxsf-%s.%d", fc->source, sbi->bdi_id);
-+ if (err)
-+ goto fail_free;
-+
-+ /* Turn source into a shfl_string and map the folder */
-+ size = strlen(fc->source) + 1;
-+ folder_name = kmalloc(SHFLSTRING_HEADER_SIZE + size, GFP_KERNEL);
-+ if (!folder_name) {
-+ err = -ENOMEM;
-+ goto fail_free;
-+ }
-+ folder_name->size = size;
-+ folder_name->length = size - 1;
-+ strlcpy(folder_name->string.utf8, fc->source, size);
-+ err = vboxsf_map_folder(folder_name, &sbi->root);
-+ kfree(folder_name);
-+ if (err) {
-+ vbg_err("vboxsf: Host rejected mount of '%s' with error %d\n",
-+ fc->source, err);
-+ goto fail_free;
-+ }
-+
-+ root_path.length = 1;
-+ root_path.size = 2;
-+ root_path.string.utf8[0] = '/';
-+ root_path.string.utf8[1] = 0;
-+ err = vboxsf_stat(sbi, &root_path, &sbi->root_info);
-+ if (err)
-+ goto fail_unmap;
-+
-+ sb->s_magic = VBOXSF_SUPER_MAGIC;
-+ sb->s_blocksize = 1024;
-+ sb->s_maxbytes = MAX_LFS_FILESIZE;
-+ sb->s_op = &vboxsf_super_ops;
-+ sb->s_d_op = &vboxsf_dentry_ops;
-+
-+ iroot = iget_locked(sb, 0);
-+ if (!iroot) {
-+ err = -ENOMEM;
-+ goto fail_unmap;
-+ }
-+ vboxsf_init_inode(sbi, iroot, &sbi->root_info);
-+ unlock_new_inode(iroot);
-+
-+ droot = d_make_root(iroot);
-+ if (!droot) {
-+ err = -ENOMEM;
-+ goto fail_unmap;
-+ }
-+
-+ sb->s_root = droot;
-+ sb->s_fs_info = sbi;
-+ return 0;
-+
-+fail_unmap:
-+ vboxsf_unmap_folder(sbi->root);
-+fail_free:
-+ if (sbi->bdi_id >= 0)
-+ ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
-+ if (sbi->nls)
-+ unload_nls(sbi->nls);
-+ idr_destroy(&sbi->ino_idr);
-+ kfree(sbi);
-+ return err;
-+}
-+
-+static void vboxsf_inode_init_once(void *data)
-+{
-+ struct vboxsf_inode *sf_i = data;
-+
-+ mutex_init(&sf_i->handle_list_mutex);
-+ inode_init_once(&sf_i->vfs_inode);
-+}
-+
-+static struct inode *vboxsf_alloc_inode(struct super_block *sb)
-+{
-+ struct vboxsf_inode *sf_i;
-+
-+ sf_i = kmem_cache_alloc(vboxsf_inode_cachep, GFP_NOFS);
-+ if (!sf_i)
-+ return NULL;
-+
-+ sf_i->force_restat = 0;
-+ INIT_LIST_HEAD(&sf_i->handle_list);
-+
-+ return &sf_i->vfs_inode;
-+}
-+
-+static void vboxsf_free_inode(struct inode *inode)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
-+ unsigned long flags;
-+
-+ spin_lock_irqsave(&sbi->ino_idr_lock, flags);
-+ idr_remove(&sbi->ino_idr, inode->i_ino);
-+ spin_unlock_irqrestore(&sbi->ino_idr_lock, flags);
-+ kmem_cache_free(vboxsf_inode_cachep, VBOXSF_I(inode));
-+}
-+
-+static void vboxsf_put_super(struct super_block *sb)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(sb);
-+
-+ vboxsf_unmap_folder(sbi->root);
-+ if (sbi->bdi_id >= 0)
-+ ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
-+ if (sbi->nls)
-+ unload_nls(sbi->nls);
-+
-+ /*
-+ * vboxsf_free_inode uses the idr, make sure all delayed rcu free
-+ * inodes are flushed.
-+ */
-+ rcu_barrier();
-+ idr_destroy(&sbi->ino_idr);
-+ kfree(sbi);
-+}
-+
-+static int vboxsf_statfs(struct dentry *dentry, struct kstatfs *stat)
-+{
-+ struct super_block *sb = dentry->d_sb;
-+ struct shfl_volinfo shfl_volinfo;
-+ struct vboxsf_sbi *sbi;
-+ u32 buf_len;
-+ int err;
-+
-+ sbi = VBOXSF_SBI(sb);
-+ buf_len = sizeof(shfl_volinfo);
-+ err = vboxsf_fsinfo(sbi->root, 0, SHFL_INFO_GET | SHFL_INFO_VOLUME,
-+ &buf_len, &shfl_volinfo);
-+ if (err)
-+ return err;
-+
-+ stat->f_type = VBOXSF_SUPER_MAGIC;
-+ stat->f_bsize = shfl_volinfo.bytes_per_allocation_unit;
-+
-+ do_div(shfl_volinfo.total_allocation_bytes,
-+ shfl_volinfo.bytes_per_allocation_unit);
-+ stat->f_blocks = shfl_volinfo.total_allocation_bytes;
-+
-+ do_div(shfl_volinfo.available_allocation_bytes,
-+ shfl_volinfo.bytes_per_allocation_unit);
-+ stat->f_bfree = shfl_volinfo.available_allocation_bytes;
-+ stat->f_bavail = shfl_volinfo.available_allocation_bytes;
-+
-+ stat->f_files = 1000;
-+ /*
-+ * Don't return 0 here since the guest may then think that it is not
-+ * possible to create any more files.
-+ */
-+ stat->f_ffree = 1000000;
-+ stat->f_fsid.val[0] = 0;
-+ stat->f_fsid.val[1] = 0;
-+ stat->f_namelen = 255;
-+ return 0;
-+}
-+
-+static struct super_operations vboxsf_super_ops = {
-+ .alloc_inode = vboxsf_alloc_inode,
-+ .free_inode = vboxsf_free_inode,
-+ .put_super = vboxsf_put_super,
-+ .statfs = vboxsf_statfs,
-+};
-+
-+static int vboxsf_setup(void)
-+{
-+ int err;
-+
-+ mutex_lock(&vboxsf_setup_mutex);
-+
-+ if (vboxsf_setup_done)
-+ goto success;
-+
-+ vboxsf_inode_cachep =
-+ kmem_cache_create("vboxsf_inode_cache",
-+ sizeof(struct vboxsf_inode), 0,
-+ (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
-+ SLAB_ACCOUNT),
-+ vboxsf_inode_init_once);
-+ if (!vboxsf_inode_cachep) {
-+ err = -ENOMEM;
-+ goto fail_nomem;
-+ }
-+
-+ err = vboxsf_connect();
-+ if (err) {
-+ vbg_err("vboxsf: err %d connecting to guest PCI-device\n", err);
-+ vbg_err("vboxsf: make sure you are inside a VirtualBox VM\n");
-+ vbg_err("vboxsf: and check dmesg for vboxguest errors\n");
-+ goto fail_free_cache;
-+ }
-+
-+ err = vboxsf_set_utf8();
-+ if (err) {
-+ vbg_err("vboxsf_setutf8 error %d\n", err);
-+ goto fail_disconnect;
-+ }
-+
-+ if (!follow_symlinks) {
-+ err = vboxsf_set_symlinks();
-+ if (err)
-+ vbg_warn("vboxsf: Unable to show symlinks: %d\n", err);
-+ }
-+
-+ vboxsf_setup_done = true;
-+success:
-+ mutex_unlock(&vboxsf_setup_mutex);
-+ return 0;
-+
-+fail_disconnect:
-+ vboxsf_disconnect();
-+fail_free_cache:
-+ kmem_cache_destroy(vboxsf_inode_cachep);
-+fail_nomem:
-+ mutex_unlock(&vboxsf_setup_mutex);
-+ return err;
-+}
-+
-+static int vboxsf_parse_monolithic(struct fs_context *fc, void *data)
-+{
-+ char *options = data;
-+
-+ if (options && options[0] == VBSF_MOUNT_SIGNATURE_BYTE_0 &&
-+ options[1] == VBSF_MOUNT_SIGNATURE_BYTE_1 &&
-+ options[2] == VBSF_MOUNT_SIGNATURE_BYTE_2 &&
-+ options[3] == VBSF_MOUNT_SIGNATURE_BYTE_3) {
-+ vbg_err("vboxsf: Old binary mount data not supported, remove obsolete mount.vboxsf and/or update your VBoxService.\n");
-+ return -EINVAL;
-+ }
-+
-+ return generic_parse_monolithic(fc, data);
-+}
-+
-+static int vboxsf_get_tree(struct fs_context *fc)
-+{
-+ int err;
-+
-+ err = vboxsf_setup();
-+ if (err)
-+ return err;
-+
-+ return get_tree_nodev(fc, vboxsf_fill_super);
-+}
-+
-+static int vboxsf_reconfigure(struct fs_context *fc)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(fc->root->d_sb);
-+ struct vboxsf_fs_context *ctx = fc->fs_private;
-+ struct inode *iroot = fc->root->d_sb->s_root->d_inode;
-+
-+ /* Apply changed options to the root inode */
-+ sbi->o = ctx->o;
-+ vboxsf_init_inode(sbi, iroot, &sbi->root_info);
-+
-+ return 0;
-+}
-+
-+static void vboxsf_free_fc(struct fs_context *fc)
-+{
-+ struct vboxsf_fs_context *ctx = fc->fs_private;
-+
-+ kfree(ctx->nls_name);
-+ kfree(ctx);
-+}
-+
-+static const struct fs_context_operations vboxsf_context_ops = {
-+ .free = vboxsf_free_fc,
-+ .parse_param = vboxsf_parse_param,
-+ .parse_monolithic = vboxsf_parse_monolithic,
-+ .get_tree = vboxsf_get_tree,
-+ .reconfigure = vboxsf_reconfigure,
-+};
-+
-+static int vboxsf_init_fs_context(struct fs_context *fc)
-+{
-+ struct vboxsf_fs_context *ctx;
-+
-+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-+ if (!ctx)
-+ return -ENOMEM;
-+
-+ current_uid_gid(&ctx->o.uid, &ctx->o.gid);
-+
-+ fc->fs_private = ctx;
-+ fc->ops = &vboxsf_context_ops;
-+ return 0;
-+}
-+
-+static struct file_system_type vboxsf_fs_type = {
-+ .owner = THIS_MODULE,
-+ .name = "vboxsf",
-+ .init_fs_context = vboxsf_init_fs_context,
-+ .parameters = &vboxsf_fs_parameters,
-+ .kill_sb = kill_anon_super
-+};
-+
-+/* Module initialization/finalization handlers */
-+static int __init vboxsf_init(void)
-+{
-+ return register_filesystem(&vboxsf_fs_type);
-+}
-+
-+static void __exit vboxsf_fini(void)
-+{
-+ unregister_filesystem(&vboxsf_fs_type);
-+
-+ mutex_lock(&vboxsf_setup_mutex);
-+ if (vboxsf_setup_done) {
-+ vboxsf_disconnect();
-+ /*
-+ * Make sure all delayed rcu free inodes are flushed
-+ * before we destroy the cache.
-+ */
-+ rcu_barrier();
-+ kmem_cache_destroy(vboxsf_inode_cachep);
-+ }
-+ mutex_unlock(&vboxsf_setup_mutex);
-+}
-+
-+module_init(vboxsf_init);
-+module_exit(vboxsf_fini);
-+
-+MODULE_DESCRIPTION("Oracle VM VirtualBox Module for Host File System Access");
-+MODULE_AUTHOR("Oracle Corporation");
-+MODULE_LICENSE("GPL v2");
-+MODULE_ALIAS_FS("vboxsf");
-diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c
-new file mode 100644
-index 000000000000..96bd160da48b
---- /dev/null
-+++ b/fs/vboxsf/utils.c
-@@ -0,0 +1,551 @@
-+// SPDX-License-Identifier: MIT
-+/*
-+ * VirtualBox Guest Shared Folders support: Utility functions.
-+ * Mainly conversion from/to VirtualBox/Linux data structures.
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#include <linux/namei.h>
-+#include <linux/nls.h>
-+#include <linux/sizes.h>
-+#include <linux/vfs.h>
-+#include "vfsmod.h"
-+
-+struct inode *vboxsf_new_inode(struct super_block *sb)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(sb);
-+ struct inode *inode;
-+ unsigned long flags;
-+ int cursor, ret;
-+ u32 gen;
-+
-+ inode = new_inode(sb);
-+ if (!inode)
-+ return ERR_PTR(-ENOMEM);
-+
-+ idr_preload(GFP_KERNEL);
-+ spin_lock_irqsave(&sbi->ino_idr_lock, flags);
-+ cursor = idr_get_cursor(&sbi->ino_idr);
-+ ret = idr_alloc_cyclic(&sbi->ino_idr, inode, 1, 0, GFP_ATOMIC);
-+ if (ret >= 0 && ret < cursor)
-+ sbi->next_generation++;
-+ gen = sbi->next_generation;
-+ spin_unlock_irqrestore(&sbi->ino_idr_lock, flags);
-+ idr_preload_end();
-+
-+ if (ret < 0) {
-+ iput(inode);
-+ return ERR_PTR(ret);
-+ }
-+
-+ inode->i_ino = ret;
-+ inode->i_generation = gen;
-+ return inode;
-+}
-+
-+/* set [inode] attributes based on [info], uid/gid based on [sbi] */
-+void vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode,
-+ const struct shfl_fsobjinfo *info)
-+{
-+ const struct shfl_fsobjattr *attr;
-+ s64 allocated;
-+ int mode;
-+
-+ attr = &info->attr;
-+
-+#define mode_set(r) ((attr->mode & (SHFL_UNIX_##r)) ? (S_##r) : 0)
-+
-+ mode = mode_set(IRUSR);
-+ mode |= mode_set(IWUSR);
-+ mode |= mode_set(IXUSR);
-+
-+ mode |= mode_set(IRGRP);
-+ mode |= mode_set(IWGRP);
-+ mode |= mode_set(IXGRP);
-+
-+ mode |= mode_set(IROTH);
-+ mode |= mode_set(IWOTH);
-+ mode |= mode_set(IXOTH);
-+
-+#undef mode_set
-+
-+ /* We use the host-side values for these */
-+ inode->i_flags |= S_NOATIME | S_NOCMTIME;
-+ inode->i_mapping->a_ops = &vboxsf_reg_aops;
-+
-+ if (SHFL_IS_DIRECTORY(attr->mode)) {
-+ inode->i_mode = sbi->o.dmode_set ? sbi->o.dmode : mode;
-+ inode->i_mode &= ~sbi->o.dmask;
-+ inode->i_mode |= S_IFDIR;
-+ inode->i_op = &vboxsf_dir_iops;
-+ inode->i_fop = &vboxsf_dir_fops;
-+ /*
-+ * XXX: this probably should be set to the number of entries
-+ * in the directory plus two (. ..)
-+ */
-+ set_nlink(inode, 1);
-+ } else if (SHFL_IS_SYMLINK(attr->mode)) {
-+ inode->i_mode = sbi->o.fmode_set ? sbi->o.fmode : mode;
-+ inode->i_mode &= ~sbi->o.fmask;
-+ inode->i_mode |= S_IFLNK;
-+ inode->i_op = &vboxsf_lnk_iops;
-+ set_nlink(inode, 1);
-+ } else {
-+ inode->i_mode = sbi->o.fmode_set ? sbi->o.fmode : mode;
-+ inode->i_mode &= ~sbi->o.fmask;
-+ inode->i_mode |= S_IFREG;
-+ inode->i_op = &vboxsf_reg_iops;
-+ inode->i_fop = &vboxsf_reg_fops;
-+ set_nlink(inode, 1);
-+ }
-+
-+ inode->i_uid = sbi->o.uid;
-+ inode->i_gid = sbi->o.gid;
-+
-+ inode->i_size = info->size;
-+ inode->i_blkbits = 12;
-+ /* i_blocks always in units of 512 bytes! */
-+ allocated = info->allocated + 511;
-+ do_div(allocated, 512);
-+ inode->i_blocks = allocated;
-+
-+ inode->i_atime = ns_to_timespec64(
-+ info->access_time.ns_relative_to_unix_epoch);
-+ inode->i_ctime = ns_to_timespec64(
-+ info->change_time.ns_relative_to_unix_epoch);
-+ inode->i_mtime = ns_to_timespec64(
-+ info->modification_time.ns_relative_to_unix_epoch);
-+}
-+
-+int vboxsf_create_at_dentry(struct dentry *dentry,
-+ struct shfl_createparms *params)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(dentry->d_sb);
-+ struct shfl_string *path;
-+ int err;
-+
-+ path = vboxsf_path_from_dentry(sbi, dentry);
-+ if (IS_ERR(path))
-+ return PTR_ERR(path);
-+
-+ err = vboxsf_create(sbi->root, path, params);
-+ __putname(path);
-+
-+ return err;
-+}
-+
-+int vboxsf_stat(struct vboxsf_sbi *sbi, struct shfl_string *path,
-+ struct shfl_fsobjinfo *info)
-+{
-+ struct shfl_createparms params = {};
-+ int err;
-+
-+ params.handle = SHFL_HANDLE_NIL;
-+ params.create_flags = SHFL_CF_LOOKUP | SHFL_CF_ACT_FAIL_IF_NEW;
-+
-+ err = vboxsf_create(sbi->root, path, ¶ms);
-+ if (err)
-+ return err;
-+
-+ if (params.result != SHFL_FILE_EXISTS)
-+ return -ENOENT;
-+
-+ if (info)
-+ *info = params.info;
-+
-+ return 0;
-+}
-+
-+int vboxsf_stat_dentry(struct dentry *dentry, struct shfl_fsobjinfo *info)
-+{
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(dentry->d_sb);
-+ struct shfl_string *path;
-+ int err;
-+
-+ path = vboxsf_path_from_dentry(sbi, dentry);
-+ if (IS_ERR(path))
-+ return PTR_ERR(path);
-+
-+ err = vboxsf_stat(sbi, path, info);
-+ __putname(path);
-+ return err;
-+}
-+
-+int vboxsf_inode_revalidate(struct dentry *dentry)
-+{
-+ struct vboxsf_sbi *sbi;
-+ struct vboxsf_inode *sf_i;
-+ struct shfl_fsobjinfo info;
-+ struct timespec64 prev_mtime;
-+ struct inode *inode;
-+ int err;
-+
-+ if (!dentry || !d_really_is_positive(dentry))
-+ return -EINVAL;
-+
-+ inode = d_inode(dentry);
-+ prev_mtime = inode->i_mtime;
-+ sf_i = VBOXSF_I(inode);
-+ sbi = VBOXSF_SBI(dentry->d_sb);
-+ if (!sf_i->force_restat) {
-+ if (time_before(jiffies, dentry->d_time + sbi->o.ttl))
-+ return 0;
-+ }
-+
-+ err = vboxsf_stat_dentry(dentry, &info);
-+ if (err)
-+ return err;
-+
-+ dentry->d_time = jiffies;
-+ sf_i->force_restat = 0;
-+ vboxsf_init_inode(sbi, inode, &info);
-+
-+ /*
-+ * If the file was changed on the host side we need to invalidate the
-+ * page-cache for it. Note this also gets triggered by our own writes,
-+ * this is unavoidable.
-+ */
-+ if (timespec64_compare(&inode->i_mtime, &prev_mtime) > 0)
-+ invalidate_inode_pages2(inode->i_mapping);
-+
-+ return 0;
-+}
-+
-+int vboxsf_getattr(const struct path *path, struct kstat *kstat,
-+ u32 request_mask, unsigned int flags)
-+{
-+ int err;
-+ struct dentry *dentry = path->dentry;
-+ struct inode *inode = d_inode(dentry);
-+ struct vboxsf_inode *sf_i = VBOXSF_I(inode);
-+
-+ switch (flags & AT_STATX_SYNC_TYPE) {
-+ case AT_STATX_DONT_SYNC:
-+ err = 0;
-+ break;
-+ case AT_STATX_FORCE_SYNC:
-+ sf_i->force_restat = 1;
-+ /* fall-through */
-+ default:
-+ err = vboxsf_inode_revalidate(dentry);
-+ }
-+ if (err)
-+ return err;
-+
-+ generic_fillattr(d_inode(dentry), kstat);
-+ return 0;
-+}
-+
-+int vboxsf_setattr(struct dentry *dentry, struct iattr *iattr)
-+{
-+ struct vboxsf_inode *sf_i = VBOXSF_I(d_inode(dentry));
-+ struct vboxsf_sbi *sbi = VBOXSF_SBI(dentry->d_sb);
-+ struct shfl_createparms params = {};
-+ struct shfl_fsobjinfo info = {};
-+ u32 buf_len;
-+ int err;
-+
-+ params.handle = SHFL_HANDLE_NIL;
-+ params.create_flags = SHFL_CF_ACT_OPEN_IF_EXISTS |
-+ SHFL_CF_ACT_FAIL_IF_NEW |
-+ SHFL_CF_ACCESS_ATTR_WRITE;
-+
-+ /* this is at least required for Posix hosts */
-+ if (iattr->ia_valid & ATTR_SIZE)
-+ params.create_flags |= SHFL_CF_ACCESS_WRITE;
-+
-+ err = vboxsf_create_at_dentry(dentry, ¶ms);
-+ if (err || params.result != SHFL_FILE_EXISTS)
-+ return err ? err : -ENOENT;
-+
-+#define mode_set(r) ((iattr->ia_mode & (S_##r)) ? SHFL_UNIX_##r : 0)
-+
-+ /*
-+ * Setting the file size and setting the other attributes has to
-+ * be handled separately.
-+ */
-+ if (iattr->ia_valid & (ATTR_MODE | ATTR_ATIME | ATTR_MTIME)) {
-+ if (iattr->ia_valid & ATTR_MODE) {
-+ info.attr.mode = mode_set(IRUSR);
-+ info.attr.mode |= mode_set(IWUSR);
-+ info.attr.mode |= mode_set(IXUSR);
-+ info.attr.mode |= mode_set(IRGRP);
-+ info.attr.mode |= mode_set(IWGRP);
-+ info.attr.mode |= mode_set(IXGRP);
-+ info.attr.mode |= mode_set(IROTH);
-+ info.attr.mode |= mode_set(IWOTH);
-+ info.attr.mode |= mode_set(IXOTH);
-+
-+ if (iattr->ia_mode & S_IFDIR)
-+ info.attr.mode |= SHFL_TYPE_DIRECTORY;
-+ else
-+ info.attr.mode |= SHFL_TYPE_FILE;
-+ }
-+
-+ if (iattr->ia_valid & ATTR_ATIME)
-+ info.access_time.ns_relative_to_unix_epoch =
-+ timespec64_to_ns(&iattr->ia_atime);
-+
-+ if (iattr->ia_valid & ATTR_MTIME)
-+ info.modification_time.ns_relative_to_unix_epoch =
-+ timespec64_to_ns(&iattr->ia_mtime);
-+
-+ /*
-+ * Ignore ctime (inode change time) as it can't be set
-+ * from userland anyway.
-+ */
-+
-+ buf_len = sizeof(info);
-+ err = vboxsf_fsinfo(sbi->root, params.handle,
-+ SHFL_INFO_SET | SHFL_INFO_FILE, &buf_len,
-+ &info);
-+ if (err) {
-+ vboxsf_close(sbi->root, params.handle);
-+ return err;
-+ }
-+
-+ /* the host may have given us different attr then requested */
-+ sf_i->force_restat = 1;
-+ }
-+
-+#undef mode_set
-+
-+ if (iattr->ia_valid & ATTR_SIZE) {
-+ memset(&info, 0, sizeof(info));
-+ info.size = iattr->ia_size;
-+ buf_len = sizeof(info);
-+ err = vboxsf_fsinfo(sbi->root, params.handle,
-+ SHFL_INFO_SET | SHFL_INFO_SIZE, &buf_len,
-+ &info);
-+ if (err) {
-+ vboxsf_close(sbi->root, params.handle);
-+ return err;
-+ }
-+
-+ /* the host may have given us different attr then requested */
-+ sf_i->force_restat = 1;
-+ }
-+
-+ vboxsf_close(sbi->root, params.handle);
-+
-+ /* Update the inode with what the host has actually given us. */
-+ if (sf_i->force_restat)
-+ vboxsf_inode_revalidate(dentry);
-+
-+ return 0;
-+}
-+
-+/*
-+ * [dentry] contains string encoded in coding system that corresponds
-+ * to [sbi]->nls, we must convert it to UTF8 here.
-+ * Returns a shfl_string allocated through __getname (must be freed using
-+ * __putname), or an ERR_PTR on error.
-+ */
-+struct shfl_string *vboxsf_path_from_dentry(struct vboxsf_sbi *sbi,
-+ struct dentry *dentry)
-+{
-+ struct shfl_string *shfl_path;
-+ int path_len, out_len, nb;
-+ char *buf, *path;
-+ wchar_t uni;
-+ u8 *out;
-+
-+ buf = __getname();
-+ if (!buf)
-+ return ERR_PTR(-ENOMEM);
-+
-+ path = dentry_path_raw(dentry, buf, PATH_MAX);
-+ if (IS_ERR(path)) {
-+ __putname(buf);
-+ return ERR_CAST(path);
-+ }
-+ path_len = strlen(path);
-+
-+ if (sbi->nls) {
-+ shfl_path = __getname();
-+ if (!shfl_path) {
-+ __putname(buf);
-+ return ERR_PTR(-ENOMEM);
-+ }
-+
-+ out = shfl_path->string.utf8;
-+ out_len = PATH_MAX - SHFLSTRING_HEADER_SIZE - 1;
-+
-+ while (path_len) {
-+ nb = sbi->nls->char2uni(path, path_len, &uni);
-+ if (nb < 0) {
-+ __putname(shfl_path);
-+ __putname(buf);
-+ return ERR_PTR(-EINVAL);
-+ }
-+ path += nb;
-+ path_len -= nb;
-+
-+ nb = utf32_to_utf8(uni, out, out_len);
-+ if (nb < 0) {
-+ __putname(shfl_path);
-+ __putname(buf);
-+ return ERR_PTR(-ENAMETOOLONG);
-+ }
-+ out += nb;
-+ out_len -= nb;
-+ }
-+ *out = 0;
-+ shfl_path->length = out - shfl_path->string.utf8;
-+ shfl_path->size = shfl_path->length + 1;
-+ __putname(buf);
-+ } else {
-+ if ((SHFLSTRING_HEADER_SIZE + path_len + 1) > PATH_MAX) {
-+ __putname(buf);
-+ return ERR_PTR(-ENAMETOOLONG);
-+ }
-+ /*
-+ * dentry_path stores the name at the end of buf, but the
-+ * shfl_string string we return must be properly aligned.
-+ */
-+ shfl_path = (struct shfl_string *)buf;
-+ memmove(shfl_path->string.utf8, path, path_len);
-+ shfl_path->string.utf8[path_len] = 0;
-+ shfl_path->length = path_len;
-+ shfl_path->size = path_len + 1;
-+ }
-+
-+ return shfl_path;
-+}
-+
-+int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
-+ const unsigned char *utf8_name, size_t utf8_len)
-+{
-+ const char *in;
-+ char *out;
-+ size_t out_len;
-+ size_t out_bound_len;
-+ size_t in_bound_len;
-+
-+ in = utf8_name;
-+ in_bound_len = utf8_len;
-+
-+ out = name;
-+ out_len = 0;
-+ /* Reserve space for terminating 0 */
-+ out_bound_len = name_bound_len - 1;
-+
-+ while (in_bound_len) {
-+ int nb;
-+ unicode_t uni;
-+
-+ nb = utf8_to_utf32(in, in_bound_len, &uni);
-+ if (nb < 0)
-+ return -EINVAL;
-+
-+ in += nb;
-+ in_bound_len -= nb;
-+
-+ nb = sbi->nls->uni2char(uni, out, out_bound_len);
-+ if (nb < 0)
-+ return nb;
-+
-+ out += nb;
-+ out_bound_len -= nb;
-+ out_len += nb;
-+ }
-+
-+ *out = 0;
-+
-+ return 0;
-+}
-+
-+static struct vboxsf_dir_buf *vboxsf_dir_buf_alloc(struct list_head *list)
-+{
-+ struct vboxsf_dir_buf *b;
-+
-+ b = kmalloc(sizeof(*b), GFP_KERNEL);
-+ if (!b)
-+ return NULL;
-+
-+ b->buf = kmalloc(DIR_BUFFER_SIZE, GFP_KERNEL);
-+ if (!b->buf) {
-+ kfree(b);
-+ return NULL;
-+ }
-+
-+ b->entries = 0;
-+ b->used = 0;
-+ b->free = DIR_BUFFER_SIZE;
-+ list_add(&b->head, list);
-+
-+ return b;
-+}
-+
-+static void vboxsf_dir_buf_free(struct vboxsf_dir_buf *b)
-+{
-+ list_del(&b->head);
-+ kfree(b->buf);
-+ kfree(b);
-+}
-+
-+struct vboxsf_dir_info *vboxsf_dir_info_alloc(void)
-+{
-+ struct vboxsf_dir_info *p;
-+
-+ p = kmalloc(sizeof(*p), GFP_KERNEL);
-+ if (!p)
-+ return NULL;
-+
-+ INIT_LIST_HEAD(&p->info_list);
-+ return p;
-+}
-+
-+void vboxsf_dir_info_free(struct vboxsf_dir_info *p)
-+{
-+ struct list_head *list, *pos, *tmp;
-+
-+ list = &p->info_list;
-+ list_for_each_safe(pos, tmp, list) {
-+ struct vboxsf_dir_buf *b;
-+
-+ b = list_entry(pos, struct vboxsf_dir_buf, head);
-+ vboxsf_dir_buf_free(b);
-+ }
-+ kfree(p);
-+}
-+
-+int vboxsf_dir_read_all(struct vboxsf_sbi *sbi, struct vboxsf_dir_info *sf_d,
-+ u64 handle)
-+{
-+ struct vboxsf_dir_buf *b;
-+ u32 entries, size;
-+ int err = 0;
-+ void *buf;
-+
-+ /* vboxsf_dirinfo returns 1 on end of dir */
-+ while (err == 0) {
-+ b = vboxsf_dir_buf_alloc(&sf_d->info_list);
-+ if (!b) {
-+ err = -ENOMEM;
-+ break;
-+ }
-+
-+ buf = b->buf;
-+ size = b->free;
-+
-+ err = vboxsf_dirinfo(sbi->root, handle, NULL, 0, 0,
-+ &size, buf, &entries);
-+ if (err < 0)
-+ break;
-+
-+ b->entries += entries;
-+ b->free -= size;
-+ b->used += size;
-+ }
-+
-+ if (b && b->used == 0)
-+ vboxsf_dir_buf_free(b);
-+
-+ /* -EILSEQ means the host could not translate a filename, ignore */
-+ if (err > 0 || err == -EILSEQ)
-+ err = 0;
-+
-+ return err;
-+}
-diff --git a/fs/vboxsf/vboxsf_wrappers.c b/fs/vboxsf/vboxsf_wrappers.c
-new file mode 100644
-index 000000000000..bfc78a097dae
---- /dev/null
-+++ b/fs/vboxsf/vboxsf_wrappers.c
-@@ -0,0 +1,371 @@
-+// SPDX-License-Identifier: MIT
-+/*
-+ * Wrapper functions for the shfl host calls.
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#include <linux/mm.h>
-+#include <linux/slab.h>
-+#include <linux/vbox_err.h>
-+#include <linux/vbox_utils.h>
-+#include "vfsmod.h"
-+
-+#define SHFL_REQUEST \
-+ (VMMDEV_REQUESTOR_KERNEL | VMMDEV_REQUESTOR_USR_DRV_OTHER | \
-+ VMMDEV_REQUESTOR_CON_DONT_KNOW | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN)
-+
-+static u32 vboxsf_client_id;
-+
-+int vboxsf_connect(void)
-+{
-+ struct vbg_dev *gdev;
-+ struct vmmdev_hgcm_service_location loc;
-+ int err, vbox_status;
-+
-+ loc.type = VMMDEV_HGCM_LOC_LOCALHOST_EXISTING;
-+ strcpy(loc.u.localhost.service_name, "VBoxSharedFolders");
-+
-+ gdev = vbg_get_gdev();
-+ if (IS_ERR(gdev))
-+ return -ENODEV; /* No guest-device */
-+
-+ err = vbg_hgcm_connect(gdev, SHFL_REQUEST, &loc,
-+ &vboxsf_client_id, &vbox_status);
-+ vbg_put_gdev(gdev);
-+
-+ return err ? err : vbg_status_code_to_errno(vbox_status);
-+}
-+
-+void vboxsf_disconnect(void)
-+{
-+ struct vbg_dev *gdev;
-+ int vbox_status;
-+
-+ gdev = vbg_get_gdev();
-+ if (IS_ERR(gdev))
-+ return; /* guest-device is gone, already disconnected */
-+
-+ vbg_hgcm_disconnect(gdev, SHFL_REQUEST, vboxsf_client_id, &vbox_status);
-+ vbg_put_gdev(gdev);
-+}
-+
-+static int vboxsf_call(u32 function, void *parms, u32 parm_count, int *status)
-+{
-+ struct vbg_dev *gdev;
-+ int err, vbox_status;
-+
-+ gdev = vbg_get_gdev();
-+ if (IS_ERR(gdev))
-+ return -ESHUTDOWN; /* guest-dev removed underneath us */
-+
-+ err = vbg_hgcm_call(gdev, SHFL_REQUEST, vboxsf_client_id, function,
-+ U32_MAX, parms, parm_count, &vbox_status);
-+ vbg_put_gdev(gdev);
-+
-+ if (err < 0)
-+ return err;
-+
-+ if (status)
-+ *status = vbox_status;
-+
-+ return vbg_status_code_to_errno(vbox_status);
-+}
-+
-+int vboxsf_map_folder(struct shfl_string *folder_name, u32 *root)
-+{
-+ struct shfl_map_folder parms;
-+ int err, status;
-+
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL;
-+ parms.path.u.pointer.size = shfl_string_buf_size(folder_name);
-+ parms.path.u.pointer.u.linear_addr = (uintptr_t)folder_name;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = 0;
-+
-+ parms.delimiter.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.delimiter.u.value32 = '/';
-+
-+ parms.case_sensitive.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.case_sensitive.u.value32 = 1;
-+
-+ err = vboxsf_call(SHFL_FN_MAP_FOLDER, &parms, SHFL_CPARMS_MAP_FOLDER,
-+ &status);
-+ if (err == -ENOSYS && status == VERR_NOT_IMPLEMENTED)
-+ vbg_err("%s: Error host is too old\n", __func__);
-+
-+ *root = parms.root.u.value32;
-+ return err;
-+}
-+
-+int vboxsf_unmap_folder(u32 root)
-+{
-+ struct shfl_unmap_folder parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ return vboxsf_call(SHFL_FN_UNMAP_FOLDER, &parms,
-+ SHFL_CPARMS_UNMAP_FOLDER, NULL);
-+}
-+
-+/**
-+ * vboxsf_create - Create a new file or folder
-+ * @root: Root of the shared folder in which to create the file
-+ * @parsed_path: The path of the file or folder relative to the shared folder
-+ * @param: create_parms Parameters for file/folder creation.
-+ *
-+ * Create a new file or folder or open an existing one in a shared folder.
-+ * Note this function always returns 0 / success unless an exceptional condition
-+ * occurs - out of memory, invalid arguments, etc. If the file or folder could
-+ * not be opened or created, create_parms->handle will be set to
-+ * SHFL_HANDLE_NIL on return. In this case the value in create_parms->result
-+ * provides information as to why (e.g. SHFL_FILE_EXISTS), create_parms->result
-+ * is also set on success as additional information.
-+ *
-+ * Returns:
-+ * 0 or negative errno value.
-+ */
-+int vboxsf_create(u32 root, struct shfl_string *parsed_path,
-+ struct shfl_createparms *create_parms)
-+{
-+ struct shfl_create parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL;
-+ parms.path.u.pointer.size = shfl_string_buf_size(parsed_path);
-+ parms.path.u.pointer.u.linear_addr = (uintptr_t)parsed_path;
-+
-+ parms.parms.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL;
-+ parms.parms.u.pointer.size = sizeof(struct shfl_createparms);
-+ parms.parms.u.pointer.u.linear_addr = (uintptr_t)create_parms;
-+
-+ return vboxsf_call(SHFL_FN_CREATE, &parms, SHFL_CPARMS_CREATE, NULL);
-+}
-+
-+int vboxsf_close(u32 root, u64 handle)
-+{
-+ struct shfl_close parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.handle.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.handle.u.value64 = handle;
-+
-+ return vboxsf_call(SHFL_FN_CLOSE, &parms, SHFL_CPARMS_CLOSE, NULL);
-+}
-+
-+int vboxsf_remove(u32 root, struct shfl_string *parsed_path, u32 flags)
-+{
-+ struct shfl_remove parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.path.u.pointer.size = shfl_string_buf_size(parsed_path);
-+ parms.path.u.pointer.u.linear_addr = (uintptr_t)parsed_path;
-+
-+ parms.flags.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.flags.u.value32 = flags;
-+
-+ return vboxsf_call(SHFL_FN_REMOVE, &parms, SHFL_CPARMS_REMOVE, NULL);
-+}
-+
-+int vboxsf_rename(u32 root, struct shfl_string *src_path,
-+ struct shfl_string *dest_path, u32 flags)
-+{
-+ struct shfl_rename parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.src.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.src.u.pointer.size = shfl_string_buf_size(src_path);
-+ parms.src.u.pointer.u.linear_addr = (uintptr_t)src_path;
-+
-+ parms.dest.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.dest.u.pointer.size = shfl_string_buf_size(dest_path);
-+ parms.dest.u.pointer.u.linear_addr = (uintptr_t)dest_path;
-+
-+ parms.flags.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.flags.u.value32 = flags;
-+
-+ return vboxsf_call(SHFL_FN_RENAME, &parms, SHFL_CPARMS_RENAME, NULL);
-+}
-+
-+int vboxsf_read(u32 root, u64 handle, u64 offset, u32 *buf_len, u8 *buf)
-+{
-+ struct shfl_read parms;
-+ int err;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.handle.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.handle.u.value64 = handle;
-+ parms.offset.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.offset.u.value64 = offset;
-+ parms.cb.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.cb.u.value32 = *buf_len;
-+ parms.buffer.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_OUT;
-+ parms.buffer.u.pointer.size = *buf_len;
-+ parms.buffer.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ err = vboxsf_call(SHFL_FN_READ, &parms, SHFL_CPARMS_READ, NULL);
-+
-+ *buf_len = parms.cb.u.value32;
-+ return err;
-+}
-+
-+int vboxsf_write(u32 root, u64 handle, u64 offset, u32 *buf_len, u8 *buf)
-+{
-+ struct shfl_write parms;
-+ int err;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.handle.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.handle.u.value64 = handle;
-+ parms.offset.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.offset.u.value64 = offset;
-+ parms.cb.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.cb.u.value32 = *buf_len;
-+ parms.buffer.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.buffer.u.pointer.size = *buf_len;
-+ parms.buffer.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ err = vboxsf_call(SHFL_FN_WRITE, &parms, SHFL_CPARMS_WRITE, NULL);
-+
-+ *buf_len = parms.cb.u.value32;
-+ return err;
-+}
-+
-+/* Returns 0 on success, 1 on end-of-dir, negative errno otherwise */
-+int vboxsf_dirinfo(u32 root, u64 handle,
-+ struct shfl_string *parsed_path, u32 flags, u32 index,
-+ u32 *buf_len, struct shfl_dirinfo *buf, u32 *file_count)
-+{
-+ struct shfl_list parms;
-+ int err, status;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.handle.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.handle.u.value64 = handle;
-+ parms.flags.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.flags.u.value32 = flags;
-+ parms.cb.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.cb.u.value32 = *buf_len;
-+ if (parsed_path) {
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.path.u.pointer.size = shfl_string_buf_size(parsed_path);
-+ parms.path.u.pointer.u.linear_addr = (uintptr_t)parsed_path;
-+ } else {
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_IN;
-+ parms.path.u.pointer.size = 0;
-+ parms.path.u.pointer.u.linear_addr = 0;
-+ }
-+
-+ parms.buffer.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_OUT;
-+ parms.buffer.u.pointer.size = *buf_len;
-+ parms.buffer.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ parms.resume_point.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.resume_point.u.value32 = index;
-+ parms.file_count.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.file_count.u.value32 = 0; /* out parameter only */
-+
-+ err = vboxsf_call(SHFL_FN_LIST, &parms, SHFL_CPARMS_LIST, &status);
-+ if (err == -ENODATA && status == VERR_NO_MORE_FILES)
-+ err = 1;
-+
-+ *buf_len = parms.cb.u.value32;
-+ *file_count = parms.file_count.u.value32;
-+ return err;
-+}
-+
-+int vboxsf_fsinfo(u32 root, u64 handle, u32 flags,
-+ u32 *buf_len, void *buf)
-+{
-+ struct shfl_information parms;
-+ int err;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.handle.type = VMMDEV_HGCM_PARM_TYPE_64BIT;
-+ parms.handle.u.value64 = handle;
-+ parms.flags.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.flags.u.value32 = flags;
-+ parms.cb.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.cb.u.value32 = *buf_len;
-+ parms.info.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL;
-+ parms.info.u.pointer.size = *buf_len;
-+ parms.info.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ err = vboxsf_call(SHFL_FN_INFORMATION, &parms, SHFL_CPARMS_INFORMATION,
-+ NULL);
-+
-+ *buf_len = parms.cb.u.value32;
-+ return err;
-+}
-+
-+int vboxsf_readlink(u32 root, struct shfl_string *parsed_path,
-+ u32 buf_len, u8 *buf)
-+{
-+ struct shfl_readLink parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.path.u.pointer.size = shfl_string_buf_size(parsed_path);
-+ parms.path.u.pointer.u.linear_addr = (uintptr_t)parsed_path;
-+
-+ parms.buffer.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_OUT;
-+ parms.buffer.u.pointer.size = buf_len;
-+ parms.buffer.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ return vboxsf_call(SHFL_FN_READLINK, &parms, SHFL_CPARMS_READLINK,
-+ NULL);
-+}
-+
-+int vboxsf_symlink(u32 root, struct shfl_string *new_path,
-+ struct shfl_string *old_path, struct shfl_fsobjinfo *buf)
-+{
-+ struct shfl_symlink parms;
-+
-+ parms.root.type = VMMDEV_HGCM_PARM_TYPE_32BIT;
-+ parms.root.u.value32 = root;
-+
-+ parms.new_path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.new_path.u.pointer.size = shfl_string_buf_size(new_path);
-+ parms.new_path.u.pointer.u.linear_addr = (uintptr_t)new_path;
-+
-+ parms.old_path.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_IN;
-+ parms.old_path.u.pointer.size = shfl_string_buf_size(old_path);
-+ parms.old_path.u.pointer.u.linear_addr = (uintptr_t)old_path;
-+
-+ parms.info.type = VMMDEV_HGCM_PARM_TYPE_LINADDR_KERNEL_OUT;
-+ parms.info.u.pointer.size = sizeof(struct shfl_fsobjinfo);
-+ parms.info.u.pointer.u.linear_addr = (uintptr_t)buf;
-+
-+ return vboxsf_call(SHFL_FN_SYMLINK, &parms, SHFL_CPARMS_SYMLINK, NULL);
-+}
-+
-+int vboxsf_set_utf8(void)
-+{
-+ return vboxsf_call(SHFL_FN_SET_UTF8, NULL, 0, NULL);
-+}
-+
-+int vboxsf_set_symlinks(void)
-+{
-+ return vboxsf_call(SHFL_FN_SET_SYMLINKS, NULL, 0, NULL);
-+}
-diff --git a/fs/vboxsf/vfsmod.h b/fs/vboxsf/vfsmod.h
-new file mode 100644
-index 000000000000..18f95b00fc33
---- /dev/null
-+++ b/fs/vboxsf/vfsmod.h
-@@ -0,0 +1,137 @@
-+/* SPDX-License-Identifier: MIT */
-+/*
-+ * VirtualBox Guest Shared Folders support: module header.
-+ *
-+ * Copyright (C) 2006-2018 Oracle Corporation
-+ */
-+
-+#ifndef VFSMOD_H
-+#define VFSMOD_H
-+
-+#include <linux/backing-dev.h>
-+#include <linux/idr.h>
-+#include "shfl_hostintf.h"
-+
-+#define DIR_BUFFER_SIZE SZ_16K
-+
-+/* The cast is to prevent assignment of void * to pointers of arbitrary type */
-+#define VBOXSF_SBI(sb) ((struct vboxsf_sbi *)(sb)->s_fs_info)
-+#define VBOXSF_I(i) container_of(i, struct vboxsf_inode, vfs_inode)
-+
-+struct vboxsf_options {
-+ unsigned long ttl;
-+ kuid_t uid;
-+ kgid_t gid;
-+ bool dmode_set;
-+ bool fmode_set;
-+ umode_t dmode;
-+ umode_t fmode;
-+ umode_t dmask;
-+ umode_t fmask;
-+};
-+
-+struct vboxsf_fs_context {
-+ struct vboxsf_options o;
-+ char *nls_name;
-+};
-+
-+/* per-shared folder information */
-+struct vboxsf_sbi {
-+ struct vboxsf_options o;
-+ struct shfl_fsobjinfo root_info;
-+ struct idr ino_idr;
-+ spinlock_t ino_idr_lock; /* This protects ino_idr */
-+ struct nls_table *nls;
-+ u32 next_generation;
-+ u32 root;
-+ int bdi_id;
-+};
-+
-+/* per-inode information */
-+struct vboxsf_inode {
-+ /* some information was changed, update data on next revalidate */
-+ int force_restat;
-+ /* list of open handles for this inode + lock protecting it */
-+ struct list_head handle_list;
-+ /* This mutex protects handle_list accesses */
-+ struct mutex handle_list_mutex;
-+ /* The VFS inode struct */
-+ struct inode vfs_inode;
-+};
-+
-+struct vboxsf_dir_info {
-+ struct list_head info_list;
-+};
-+
-+struct vboxsf_dir_buf {
-+ size_t entries;
-+ size_t free;
-+ size_t used;
-+ void *buf;
-+ struct list_head head;
-+};
-+
-+/* globals */
-+extern const struct inode_operations vboxsf_dir_iops;
-+extern const struct inode_operations vboxsf_lnk_iops;
-+extern const struct inode_operations vboxsf_reg_iops;
-+extern const struct file_operations vboxsf_dir_fops;
-+extern const struct file_operations vboxsf_reg_fops;
-+extern const struct address_space_operations vboxsf_reg_aops;
-+extern const struct dentry_operations vboxsf_dentry_ops;
-+
-+/* from utils.c */
-+struct inode *vboxsf_new_inode(struct super_block *sb);
-+void vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode,
-+ const struct shfl_fsobjinfo *info);
-+int vboxsf_create_at_dentry(struct dentry *dentry,
-+ struct shfl_createparms *params);
-+int vboxsf_stat(struct vboxsf_sbi *sbi, struct shfl_string *path,
-+ struct shfl_fsobjinfo *info);
-+int vboxsf_stat_dentry(struct dentry *dentry, struct shfl_fsobjinfo *info);
-+int vboxsf_inode_revalidate(struct dentry *dentry);
-+int vboxsf_getattr(const struct path *path, struct kstat *kstat,
-+ u32 request_mask, unsigned int query_flags);
-+int vboxsf_setattr(struct dentry *dentry, struct iattr *iattr);
-+struct shfl_string *vboxsf_path_from_dentry(struct vboxsf_sbi *sbi,
-+ struct dentry *dentry);
-+int vboxsf_nlscpy(struct vboxsf_sbi *sbi, char *name, size_t name_bound_len,
-+ const unsigned char *utf8_name, size_t utf8_len);
-+struct vboxsf_dir_info *vboxsf_dir_info_alloc(void);
-+void vboxsf_dir_info_free(struct vboxsf_dir_info *p);
-+int vboxsf_dir_read_all(struct vboxsf_sbi *sbi, struct vboxsf_dir_info *sf_d,
-+ u64 handle);
-+
-+/* from vboxsf_wrappers.c */
-+int vboxsf_connect(void);
-+void vboxsf_disconnect(void);
-+
-+int vboxsf_create(u32 root, struct shfl_string *parsed_path,
-+ struct shfl_createparms *create_parms);
-+
-+int vboxsf_close(u32 root, u64 handle);
-+int vboxsf_remove(u32 root, struct shfl_string *parsed_path, u32 flags);
-+int vboxsf_rename(u32 root, struct shfl_string *src_path,
-+ struct shfl_string *dest_path, u32 flags);
-+
-+int vboxsf_read(u32 root, u64 handle, u64 offset, u32 *buf_len, u8 *buf);
-+int vboxsf_write(u32 root, u64 handle, u64 offset, u32 *buf_len, u8 *buf);
-+
-+int vboxsf_dirinfo(u32 root, u64 handle,
-+ struct shfl_string *parsed_path, u32 flags, u32 index,
-+ u32 *buf_len, struct shfl_dirinfo *buf, u32 *file_count);
-+int vboxsf_fsinfo(u32 root, u64 handle, u32 flags,
-+ u32 *buf_len, void *buf);
-+
-+int vboxsf_map_folder(struct shfl_string *folder_name, u32 *root);
-+int vboxsf_unmap_folder(u32 root);
-+
-+int vboxsf_readlink(u32 root, struct shfl_string *parsed_path,
-+ u32 buf_len, u8 *buf);
-+int vboxsf_symlink(u32 root, struct shfl_string *new_path,
-+ struct shfl_string *old_path, struct shfl_fsobjinfo *buf);
-+
-+int vboxsf_set_utf8(void);
-+int vboxsf_set_symlinks(void);
-+
-+#endif
diff --git a/v2-1-2-lib-Add-support-for-ZSTD-compressed-kernel.patch b/v2-1-2-lib-Add-support-for-ZSTD-compressed-kernel.patch
deleted file mode 100644
index 8acb356..0000000
--- a/v2-1-2-lib-Add-support-for-ZSTD-compressed-kernel.patch
+++ /dev/null
@@ -1,710 +0,0 @@
-diff -up linux-5.1/include/linux/decompress/unzstd.h.19~ linux-5.1/include/linux/decompress/unzstd.h
---- linux-5.1/include/linux/decompress/unzstd.h.19~ 2019-05-07 17:19:25.014249610 +0200
-+++ linux-5.1/include/linux/decompress/unzstd.h 2019-05-07 17:19:25.014249610 +0200
-@@ -0,0 +1,26 @@
-+/*
-+ * Copyright (C) 2017 Facebook
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public
-+ * License v2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef LINUX_DECOMPRESS_UNZSTD_H
-+#define LINUX_DECOMPRESS_UNZSTD_H
-+
-+int unzstd(unsigned char *inbuf, long len,
-+ long (*fill)(void*, unsigned long),
-+ long (*flush)(void*, unsigned long),
-+ unsigned char *output,
-+ long *pos,
-+ void (*error_fn)(char *x));
-+#endif
-diff -up linux-5.1/init/Kconfig.19~ linux-5.1/init/Kconfig
---- linux-5.1/init/Kconfig.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/init/Kconfig 2019-05-07 17:19:25.015249595 +0200
-@@ -153,13 +153,16 @@ config HAVE_KERNEL_LZO
- config HAVE_KERNEL_LZ4
- bool
-
-+config HAVE_KERNEL_ZSTD
-+ bool
-+
- config HAVE_KERNEL_UNCOMPRESSED
- bool
-
- choice
- prompt "Kernel compression mode"
- default KERNEL_GZIP
-- depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_UNCOMPRESSED
-+ depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
- help
- The linux kernel is a kind of self-extracting executable.
- Several compression algorithms are available, which differ
-@@ -238,6 +241,15 @@ config KERNEL_LZ4
- is about 8% bigger than LZO. But the decompression speed is
- faster than LZO.
-
-+config KERNEL_ZSTD
-+ bool "ZSTD"
-+ depends on HAVE_KERNEL_ZSTD
-+ help
-+ ZSTD is a compression algorithm targeting intermediate compression
-+ with fast decompression speed. It will compress better than GZIP and
-+ decompress around the same speed as LZO, but slower than LZ4. You
-+ will need at least 192 KB RAM or more for booting.
-+
- config KERNEL_UNCOMPRESSED
- bool "None"
- depends on HAVE_KERNEL_UNCOMPRESSED
-diff -up linux-5.1/lib/decompress.c.19~ linux-5.1/lib/decompress.c
---- linux-5.1/lib/decompress.c.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/decompress.c 2019-05-07 17:19:25.015249595 +0200
-@@ -13,6 +13,7 @@
- #include <linux/decompress/inflate.h>
- #include <linux/decompress/unlzo.h>
- #include <linux/decompress/unlz4.h>
-+#include <linux/decompress/unzstd.h>
-
- #include <linux/types.h>
- #include <linux/string.h>
-@@ -37,6 +38,9 @@
- #ifndef CONFIG_DECOMPRESS_LZ4
- # define unlz4 NULL
- #endif
-+#ifndef CONFIG_DECOMPRESS_ZSTD
-+# define unzstd NULL
-+#endif
-
- struct compress_format {
- unsigned char magic[2];
-@@ -52,6 +56,7 @@ static const struct compress_format comp
- { {0xfd, 0x37}, "xz", unxz },
- { {0x89, 0x4c}, "lzo", unlzo },
- { {0x02, 0x21}, "lz4", unlz4 },
-+ { {0x28, 0xb5}, "zstd", unzstd },
- { {0, 0}, NULL, NULL }
- };
-
-diff -up linux-5.1/lib/decompress_unzstd.c.19~ linux-5.1/lib/decompress_unzstd.c
---- linux-5.1/lib/decompress_unzstd.c.19~ 2019-05-07 17:19:25.015249595 +0200
-+++ linux-5.1/lib/decompress_unzstd.c 2019-05-07 17:19:25.015249595 +0200
-@@ -0,0 +1,341 @@
-+/*
-+ * Copyright (C) 2017 Facebook
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public
-+ * License v2 as published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
-+ */
-+
-+/*
-+ * Important notes about in-place decompression
-+ *
-+ * At least on x86, the kernel is decompressed in place: the compressed data
-+ * is placed to the end of the output buffer, and the decompressor overwrites
-+ * most of the compressed data. There must be enough safety margin to
-+ * guarantee that the write position is always behind the read position.
-+ *
-+ * The safety margin for ZSTD with a 128 KB block size is calculated below.
-+ * Note that the margin with ZSTD is bigger than with GZIP or XZ!
-+ *
-+ * The worst case for in-place decompression is that the beginning of
-+ * the file is compressed extremely well, and the rest of the file is
-+ * uncompressible. Thus, we must look for worst-case expansion when the
-+ * compressor is encoding uncompressible data.
-+ *
-+ * The structure of the .zst file in case of a compresed kernel is as follows.
-+ * Maximum sizes (as bytes) of the fields are in parenthesis.
-+ *
-+ * Frame Header: (18)
-+ * Blocks: (N)
-+ * Checksum: (4)
-+ *
-+ * The frame header and checksum overhead is at most 22 bytes.
-+ *
-+ * ZSTD stores the data in blocks. Each block has a header whose size is
-+ * a 3 bytes. After the block header, there is up to 128 KB of payload.
-+ * The maximum uncompressed size of the payload is 128 KB. The minimum
-+ * uncompressed size of the payload is never less than the payload size
-+ * (excluding the block header).
-+ *
-+ * The assumption, that the uncompressed size of the payload is never
-+ * smaller than the payload itself, is valid only when talking about
-+ * the payload as a whole. It is possible that the payload has parts where
-+ * the decompressor consumes more input than it produces output. Calculating
-+ * the worst case for this would be tricky. Instead of trying to do that,
-+ * let's simply make sure that the decompressor never overwrites any bytes
-+ * of the payload which it is currently reading.
-+ *
-+ * Now we have enough information to calculate the safety margin. We need
-+ * - 22 bytes for the .zst file format headers;
-+ * - 3 bytes per every 128 KiB of uncompressed size (one block header per
-+ * block); and
-+ * - 128 KiB (biggest possible zstd block size) to make sure that the
-+ * decompressor never overwrites anything from the block it is currently
-+ * reading.
-+ *
-+ * We get the following formula:
-+ *
-+ * safety_margin = 22 + uncompressed_size * 3 / 131072 + 131072
-+ * <= 22 + (uncompressed_size >> 15) + 131072
-+ */
-+
-+#ifdef STATIC
-+ /* Preboot environments #include "path/to/decompress_unzstd.c".
-+ * All of the source files we depend on must be #included.
-+ * zstd's only source dependeny is xxhash, which has no source
-+ * dependencies.
-+ *
-+ * zstd and xxhash both avoid declaring themselves as modules
-+ * when PREBOOT is defined.
-+ */
-+# define PREBOOT
-+# include "xxhash.c"
-+# include "zstd/entropy_common.c"
-+# include "zstd/fse_decompress.c"
-+# include "zstd/huf_decompress.c"
-+# include "zstd/zstd_common.c"
-+# include "zstd/decompress.c"
-+#endif
-+
-+#include <linux/decompress/mm.h>
-+#include <linux/kernel.h>
-+#include <linux/zstd.h>
-+
-+/* 8 MB maximum window size */
-+#define ZSTD_WINDOWSIZE_MAX (1 << 23)
-+/* Size of the input and output buffers in multi-call mdoe */
-+#define ZSTD_IOBUF_SIZE 4096
-+
-+static int INIT handle_zstd_error(size_t ret, void (*error)(char *x))
-+{
-+ const int err = ZSTD_getErrorCode(ret);
-+
-+ if (!ZSTD_isError(ret))
-+ return 0;
-+
-+ switch (err) {
-+ case ZSTD_error_memory_allocation:
-+ error("ZSTD decompressor ran out of memory");
-+ break;
-+ case ZSTD_error_prefix_unknown:
-+ error("Input is not in the ZSTD format (wrong magic bytes)");
-+ break;
-+ case ZSTD_error_dstSize_tooSmall:
-+ case ZSTD_error_corruption_detected:
-+ case ZSTD_error_checksum_wrong:
-+ error("ZSTD-compressed data is corrupt");
-+ break;
-+ default:
-+ error("ZSTD-compressed data is probably corrupt");
-+ break;
-+ }
-+ return -1;
-+}
-+
-+/* Handle the case where we have the entire input and output in one segment.
-+ * We can allocate less memory (no circular buffer for the sliding window),
-+ * and avoid some memcpy() calls.
-+ */
-+static int INIT decompress_single(const u8 *in_buf, long in_len, u8 *out_buf,
-+ long out_len, long *in_pos,
-+ void (*error)(char *x))
-+{
-+ const size_t wksp_size = ZSTD_DCtxWorkspaceBound();
-+ void *wksp = large_malloc(wksp_size);
-+ ZSTD_DCtx *dctx = ZSTD_initDCtx(wksp, wksp_size);
-+ int err;
-+ size_t ret;
-+
-+ if (dctx == NULL) {
-+ error("Out of memory while allocating ZSTD_DCtx");
-+ err = -1;
-+ goto out;
-+ }
-+ /* Find out how large the frame actually is, there may be junk at
-+ * the end of the frame that ZSTD_decompressDCtx() can't handle.
-+ */
-+ ret = ZSTD_findFrameCompressedSize(in_buf, in_len);
-+ err = handle_zstd_error(ret, error);
-+ if (err)
-+ goto out;
-+ in_len = (long)ret;
-+
-+ ret = ZSTD_decompressDCtx(dctx, out_buf, out_len, in_buf, in_len);
-+ err = handle_zstd_error(ret, error);
-+ if (err)
-+ goto out;
-+
-+ if (in_pos != NULL)
-+ *in_pos = in_len;
-+
-+ err = 0;
-+out:
-+ if (wksp != NULL)
-+ large_free(wksp);
-+ return err;
-+}
-+
-+static int INIT __unzstd(unsigned char *in_buf, long in_len,
-+ long (*fill)(void*, unsigned long),
-+ long (*flush)(void*, unsigned long),
-+ unsigned char *out_buf, long out_len,
-+ long *in_pos,
-+ void (*error)(char *x))
-+{
-+ ZSTD_inBuffer in;
-+ ZSTD_outBuffer out;
-+ ZSTD_frameParams params;
-+ void *in_allocated = NULL;
-+ void *out_allocated = NULL;
-+ void *wksp = NULL;
-+ size_t wksp_size;
-+ ZSTD_DStream *dstream;
-+ int err;
-+ size_t ret;
-+
-+ if (out_len == 0)
-+ out_len = LONG_MAX; /* no limit */
-+
-+ if (fill == NULL && flush == NULL)
-+ /* We can decompress faster and with less memory when we have a
-+ * single chunk.
-+ */
-+ return decompress_single(in_buf, in_len, out_buf, out_len,
-+ in_pos, error);
-+
-+ /* If in_buf is not provided, we must be using fill(), so allocate
-+ * a large enough buffer. If it is provided, it must be at least
-+ * ZSTD_IOBUF_SIZE large.
-+ */
-+ if (in_buf == NULL) {
-+ in_allocated = malloc(ZSTD_IOBUF_SIZE);
-+ if (in_allocated == NULL) {
-+ error("Out of memory while allocating input buffer");
-+ err = -1;
-+ goto out;
-+ }
-+ in_buf = in_allocated;
-+ in_len = 0;
-+ }
-+ /* Read the first chunk, since we need to decode the frame header */
-+ if (fill != NULL)
-+ in_len = fill(in_buf, ZSTD_IOBUF_SIZE);
-+ if (in_len < 0) {
-+ error("ZSTD-compressed data is truncated");
-+ err = -1;
-+ goto out;
-+ }
-+ /* Set the first non-empty input buffer */
-+ in.src = in_buf;
-+ in.pos = 0;
-+ in.size = in_len;
-+ /* Allocate the output buffer if we are using flush(). */
-+ if (flush != NULL) {
-+ out_allocated = malloc(ZSTD_IOBUF_SIZE);
-+ if (out_allocated == NULL) {
-+ error("Out of memory while allocating output buffer");
-+ err = -1;
-+ goto out;
-+ }
-+ out_buf = out_allocated;
-+ out_len = ZSTD_IOBUF_SIZE;
-+ }
-+ /* Set the output buffer */
-+ out.dst = out_buf;
-+ out.pos = 0;
-+ out.size = out_len;
-+
-+ /* We need to know the window size to allocate the ZSTD_DStream.
-+ * Since we are streaming, we need to allocate a buffer for the sliding
-+ * window. The window size varies from 1 KB to ZSTD_WINDOWSIZE_MAX
-+ * (8 MB), so it is important to use the actual value so as not to
-+ * waste memory when it is smaller.
-+ */
-+ ret = ZSTD_getFrameParams(¶ms, in.src, in.size);
-+ err = handle_zstd_error(ret, error);
-+ if (err)
-+ goto out;
-+ if (ret != 0) {
-+ error("ZSTD-compressed data has an incomplete frame header");
-+ err = -1;
-+ goto out;
-+ }
-+ if (params.windowSize > ZSTD_WINDOWSIZE_MAX) {
-+ error("ZSTD-compressed data has too large a window size");
-+ err = -1;
-+ goto out;
-+ }
-+
-+ /* Allocate the ZSTD_DStream now that we know how much memory is
-+ * required.
-+ */
-+ wksp_size = ZSTD_DStreamWorkspaceBound(params.windowSize);
-+ wksp = large_malloc(wksp_size);
-+ dstream = ZSTD_initDStream(params.windowSize, wksp, wksp_size);
-+ if (dstream == NULL) {
-+ error("Out of memory while allocating ZSTD_DStream");
-+ err = -1;
-+ goto out;
-+ }
-+ /* Decompression loop:
-+ * Read more data if necessary (error if no more data can be read).
-+ * Call the decompression function, which returns 0 when finished.
-+ * Flush any data produced if using flush().
-+ */
-+ if (in_pos != NULL)
-+ *in_pos = 0;
-+ do {
-+ /* If we need to reload data, either we have fill() and can
-+ * try to get more data, or we don't and the input is truncated.
-+ */
-+ if (in.pos == in.size) {
-+ if (in_pos != NULL)
-+ *in_pos += in.pos;
-+ in_len = fill ? fill(in_buf, ZSTD_IOBUF_SIZE) : -1;
-+ if (in_len < 0) {
-+ error("ZSTD-compressed data is truncated");
-+ err = -1;
-+ goto out;
-+ }
-+ in.pos = 0;
-+ in.size = in_len;
-+ }
-+ /* Returns zero when the frame is complete */
-+ ret = ZSTD_decompressStream(dstream, &out, &in);
-+ err = handle_zstd_error(ret, error);
-+ if (err)
-+ goto out;
-+ /* Flush all of the data produced if using flush() */
-+ if (flush != NULL && out.pos > 0) {
-+ if (out.pos != flush(out.dst, out.pos)) {
-+ error("Failed to flush()");
-+ err = -1;
-+ goto out;
-+ }
-+ out.pos = 0;
-+ }
-+ } while (ret != 0);
-+
-+ if (in_pos != NULL)
-+ *in_pos += in.pos;
-+
-+ err = 0;
-+out:
-+ if (in_allocated != NULL)
-+ free(in_allocated);
-+ if (out_allocated != NULL)
-+ free(out_allocated);
-+ if (wksp != NULL)
-+ large_free(wksp);
-+ return err;
-+}
-+
-+#ifndef PREBOOT
-+STATIC int INIT unzstd(unsigned char *buf, long len,
-+ long (*fill)(void*, unsigned long),
-+ long (*flush)(void*, unsigned long),
-+ unsigned char *out_buf,
-+ long *pos,
-+ void (*error)(char *x))
-+{
-+ return __unzstd(buf, len, fill, flush, out_buf, 0, pos, error);
-+}
-+#else
-+STATIC int INIT __decompress(unsigned char *buf, long len,
-+ long (*fill)(void*, unsigned long),
-+ long (*flush)(void*, unsigned long),
-+ unsigned char *out_buf, long out_len,
-+ long *pos,
-+ void (*error)(char *x))
-+{
-+ return __unzstd(buf, len, fill, flush, out_buf, out_len, pos, error);
-+}
-+#endif
-diff -up linux-5.1/lib/Kconfig.19~ linux-5.1/lib/Kconfig
---- linux-5.1/lib/Kconfig.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/Kconfig 2019-05-07 17:19:25.015249595 +0200
-@@ -312,6 +312,10 @@ config DECOMPRESS_LZ4
- select LZ4_DECOMPRESS
- tristate
-
-+config DECOMPRESS_ZSTD
-+ select ZSTD_DECOMPRESS
-+ tristate
-+
- #
- # Generic allocator support is selected if needed
- #
-diff -up linux-5.1/lib/Makefile.19~ linux-5.1/lib/Makefile
---- linux-5.1/lib/Makefile.19~ 2019-05-07 17:19:25.005249746 +0200
-+++ linux-5.1/lib/Makefile 2019-05-07 17:19:25.016249580 +0200
-@@ -156,6 +156,7 @@ lib-$(CONFIG_DECOMPRESS_LZMA) += decompr
- lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o
- lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
- lib-$(CONFIG_DECOMPRESS_LZ4) += decompress_unlz4.o
-+lib-$(CONFIG_DECOMPRESS_ZSTD) += decompress_unzstd.o
-
- obj-$(CONFIG_TEXTSEARCH) += textsearch.o
- obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
-diff -up linux-5.1/lib/xxhash.c.19~ linux-5.1/lib/xxhash.c
---- linux-5.1/lib/xxhash.c.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/xxhash.c 2019-05-07 17:19:25.016249580 +0200
-@@ -80,13 +80,11 @@ void xxh32_copy_state(struct xxh32_state
- {
- memcpy(dst, src, sizeof(*dst));
- }
--EXPORT_SYMBOL(xxh32_copy_state);
-
- void xxh64_copy_state(struct xxh64_state *dst, const struct xxh64_state *src)
- {
- memcpy(dst, src, sizeof(*dst));
- }
--EXPORT_SYMBOL(xxh64_copy_state);
-
- /*-***************************
- * Simple Hash Functions
-@@ -151,7 +149,6 @@ uint32_t xxh32(const void *input, const
-
- return h32;
- }
--EXPORT_SYMBOL(xxh32);
-
- static uint64_t xxh64_round(uint64_t acc, const uint64_t input)
- {
-@@ -234,7 +231,6 @@ uint64_t xxh64(const void *input, const
-
- return h64;
- }
--EXPORT_SYMBOL(xxh64);
-
- /*-**************************************************
- * Advanced Hash Functions
-@@ -251,7 +247,6 @@ void xxh32_reset(struct xxh32_state *sta
- state.v4 = seed - PRIME32_1;
- memcpy(statePtr, &state, sizeof(state));
- }
--EXPORT_SYMBOL(xxh32_reset);
-
- void xxh64_reset(struct xxh64_state *statePtr, const uint64_t seed)
- {
-@@ -265,7 +260,6 @@ void xxh64_reset(struct xxh64_state *sta
- state.v4 = seed - PRIME64_1;
- memcpy(statePtr, &state, sizeof(state));
- }
--EXPORT_SYMBOL(xxh64_reset);
-
- int xxh32_update(struct xxh32_state *state, const void *input, const size_t len)
- {
-@@ -334,7 +328,6 @@ int xxh32_update(struct xxh32_state *sta
-
- return 0;
- }
--EXPORT_SYMBOL(xxh32_update);
-
- uint32_t xxh32_digest(const struct xxh32_state *state)
- {
-@@ -372,7 +365,6 @@ uint32_t xxh32_digest(const struct xxh32
-
- return h32;
- }
--EXPORT_SYMBOL(xxh32_digest);
-
- int xxh64_update(struct xxh64_state *state, const void *input, const size_t len)
- {
-@@ -439,7 +431,6 @@ int xxh64_update(struct xxh64_state *sta
-
- return 0;
- }
--EXPORT_SYMBOL(xxh64_update);
-
- uint64_t xxh64_digest(const struct xxh64_state *state)
- {
-@@ -494,7 +485,19 @@ uint64_t xxh64_digest(const struct xxh64
-
- return h64;
- }
-+
-+#ifndef PREBOOT
-+EXPORT_SYMBOL(xxh32_copy_state);
-+EXPORT_SYMBOL(xxh64_copy_state);
-+EXPORT_SYMBOL(xxh32);
-+EXPORT_SYMBOL(xxh64);
-+EXPORT_SYMBOL(xxh32_reset);
-+EXPORT_SYMBOL(xxh64_reset);
-+EXPORT_SYMBOL(xxh32_update);
-+EXPORT_SYMBOL(xxh32_digest);
-+EXPORT_SYMBOL(xxh64_update);
- EXPORT_SYMBOL(xxh64_digest);
-
- MODULE_LICENSE("Dual BSD/GPL");
- MODULE_DESCRIPTION("xxHash");
-+#endif
-diff -up linux-5.1/lib/zstd/decompress.c.19~ linux-5.1/lib/zstd/decompress.c
---- linux-5.1/lib/zstd/decompress.c.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/zstd/decompress.c 2019-05-07 17:19:25.016249580 +0200
-@@ -2487,6 +2487,7 @@ size_t ZSTD_decompressStream(ZSTD_DStrea
- }
- }
-
-+#ifndef PREBOOT
- EXPORT_SYMBOL(ZSTD_DCtxWorkspaceBound);
- EXPORT_SYMBOL(ZSTD_initDCtx);
- EXPORT_SYMBOL(ZSTD_decompressDCtx);
-@@ -2526,3 +2527,4 @@ EXPORT_SYMBOL(ZSTD_insertBlock);
-
- MODULE_LICENSE("Dual BSD/GPL");
- MODULE_DESCRIPTION("Zstd Decompressor");
-+#endif
-diff -up linux-5.1/lib/zstd/fse_decompress.c.19~ linux-5.1/lib/zstd/fse_decompress.c
---- linux-5.1/lib/zstd/fse_decompress.c.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/zstd/fse_decompress.c 2019-05-07 17:19:25.016249580 +0200
-@@ -47,6 +47,7 @@
- ****************************************************************/
- #include "bitstream.h"
- #include "fse.h"
-+#include "zstd_internal.h"
- #include <linux/compiler.h>
- #include <linux/kernel.h>
- #include <linux/string.h> /* memcpy, memset */
-@@ -60,14 +61,6 @@
- enum { FSE_static_assert = 1 / (int)(!!(c)) }; \
- } /* use only *after* variable declarations */
-
--/* check and forward error code */
--#define CHECK_F(f) \
-- { \
-- size_t const e = f; \
-- if (FSE_isError(e)) \
-- return e; \
-- }
--
- /* **************************************************************
- * Templates
- ****************************************************************/
-diff -up linux-5.1/lib/zstd/zstd_internal.h.19~ linux-5.1/lib/zstd/zstd_internal.h
---- linux-5.1/lib/zstd/zstd_internal.h.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/lib/zstd/zstd_internal.h 2019-05-07 17:19:25.016249580 +0200
-@@ -127,7 +127,13 @@ static const U32 OF_defaultNormLog = OF_
- * Shared functions to include for inlining
- *********************************************/
- ZSTD_STATIC void ZSTD_copy8(void *dst, const void *src) {
-- memcpy(dst, src, 8);
-+ /* zstd relies heavily on gcc being able to analyze and inline this
-+ * memcpy() call, since it is called in a tight loop. Preboot mode
-+ * is compiled in freestanding mode, which stops gcc from analyzing
-+ * memcpy(). Use __builtin_memcpy() to tell gcc to analyze this as a
-+ * regular memcpy().
-+ */
-+ __builtin_memcpy(dst, src, 8);
- }
- /*! ZSTD_wildcopy() :
- * custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
-@@ -137,6 +143,7 @@ ZSTD_STATIC void ZSTD_wildcopy(void *dst
- const BYTE* ip = (const BYTE*)src;
- BYTE* op = (BYTE*)dst;
- BYTE* const oend = op + length;
-+#if GCC_VERSION >= 70000 && GCC_VERSION < 70200
- /* Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.
- * Avoid the bad case where the loop only runs once by handling the
- * special case separately. This doesn't trigger the bug because it
-@@ -144,6 +151,7 @@ ZSTD_STATIC void ZSTD_wildcopy(void *dst
- */
- if (length <= 8)
- return ZSTD_copy8(dst, src);
-+#endif
- do {
- ZSTD_copy8(op, ip);
- op += 8;
-diff -up linux-5.1/scripts/Makefile.lib.19~ linux-5.1/scripts/Makefile.lib
---- linux-5.1/scripts/Makefile.lib.19~ 2019-05-07 17:19:25.017249565 +0200
-+++ linux-5.1/scripts/Makefile.lib 2019-05-07 17:19:58.549750595 +0200
-@@ -402,6 +402,21 @@ quiet_cmd_xzkern = XZKERN $@
- quiet_cmd_xzmisc = XZMISC $@
- cmd_xzmisc = cat $(real-prereqs) | xz --check=crc32 --lzma2=dict=1MiB > $@
-
-+# ZSTD
-+# ---------------------------------------------------------------------------
-+# Appends the uncompressed size of the data using size_append. The .zst
-+# format has the size information available at the beginning of the file too,
-+# but it's in a more complex format and it's good to avoid changing the part
-+# of the boot code that reads the uncompressed size.
-+# Note that the bytes added by size_append will make the zstd tool think that
-+# the file is corrupt. This is expected.
-+
-+quiet_cmd_zstd = ZSTD $@
-+cmd_zstd = (cat $(filter-out FORCE,$^) | \
-+ zstd -19 && \
-+ $(call size_append, $(filter-out FORCE,$^))) > $@ || \
-+ (rm -f $@ ; false)
-+
- # ASM offsets
- # ---------------------------------------------------------------------------
-
-diff -up linux-5.1/usr/Kconfig.19~ linux-5.1/usr/Kconfig
---- linux-5.1/usr/Kconfig.19~ 2019-05-06 02:42:58.000000000 +0200
-+++ linux-5.1/usr/Kconfig 2019-05-07 17:19:25.017249565 +0200
-@@ -106,6 +106,15 @@ config RD_LZ4
- Support loading of a LZ4 encoded initial ramdisk or cpio buffer
- If unsure, say N.
-
-+config RD_ZSTD
-+ bool "Support initial ramdisk/ramfs compressed using ZSTD"
-+ default y
-+ depends on BLK_DEV_INITRD
-+ select DECOMPRESS_ZSTD
-+ help
-+ Support loading of a ZSTD encoded initial ramdisk or cpio buffer.
-+ If unsure, say N.
-+
- choice
- prompt "Built-in initramfs compression mode"
- depends on INITRAMFS_SOURCE!=""
-@@ -214,6 +223,17 @@ config INITRAMFS_COMPRESSION_LZ4
- If you choose this, keep in mind that most distros don't provide lz4
- by default which could cause a build failure.
-
-+config INITRAMFS_COMPRESSION_ZSTD
-+ bool "ZSTD"
-+ depends on RD_ZSTD
-+ help
-+ ZSTD is a compression algorithm targeting intermediate compression
-+ with fast decompression speed. It will compress better than GZIP and
-+ decompress around the same speed as LZO, but slower than LZ4.
-+
-+ If you choose this, keep in mind that you may need to install the zstd
-+ tool to be able to compress the initram.
-+
- endchoice
-
- config INITRAMFS_COMPRESSION
-@@ -226,10 +246,12 @@ config INITRAMFS_COMPRESSION
- default ".xz" if INITRAMFS_COMPRESSION_XZ
- default ".lzo" if INITRAMFS_COMPRESSION_LZO
- default ".lz4" if INITRAMFS_COMPRESSION_LZ4
-+ default ".zst" if INITRAMFS_COMPRESSION_ZSTD
- default ".gz" if RD_GZIP
- default ".lz4" if RD_LZ4
- default ".lzo" if RD_LZO
- default ".xz" if RD_XZ
- default ".lzma" if RD_LZMA
- default ".bz2" if RD_BZIP2
-+ default ".zst" if RD_ZSTD
- default ""
diff --git a/v2-2-2-x86-Add-support-for-ZSTD-compressed-kernel.patch b/v2-2-2-x86-Add-support-for-ZSTD-compressed-kernel.patch
deleted file mode 100644
index 21e762a..0000000
--- a/v2-2-2-x86-Add-support-for-ZSTD-compressed-kernel.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-diff -up linux-5.2-rc1/arch/x86/boot/compressed/Makefile.20~ linux-5.2-rc1/arch/x86/boot/compressed/Makefile
---- linux-5.2-rc1/arch/x86/boot/compressed/Makefile.20~ 2019-05-20 00:47:09.000000000 +0200
-+++ linux-5.2-rc1/arch/x86/boot/compressed/Makefile 2019-05-21 02:58:19.920070437 +0200
-@@ -24,7 +24,7 @@ OBJECT_FILES_NON_STANDARD := y
- KCOV_INSTRUMENT := n
-
- targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
-- vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
-+ vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 vmlinux.bin.zst
-
- KBUILD_CFLAGS := -m$(BITS) -O2
- KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
-@@ -144,6 +144,8 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.al
- $(call if_changed,lzo)
- $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
- $(call if_changed,lz4)
-+$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
-+ $(call if_changed,zstd)
-
- suffix-$(CONFIG_KERNEL_GZIP) := gz
- suffix-$(CONFIG_KERNEL_BZIP2) := bz2
-@@ -151,6 +153,7 @@ suffix-$(CONFIG_KERNEL_LZMA) := lzma
- suffix-$(CONFIG_KERNEL_XZ) := xz
- suffix-$(CONFIG_KERNEL_LZO) := lzo
- suffix-$(CONFIG_KERNEL_LZ4) := lz4
-+suffix-$(CONFIG_KERNEL_ZSTD) := zst
-
- quiet_cmd_mkpiggy = MKPIGGY $@
- cmd_mkpiggy = $(obj)/mkpiggy $< > $@
-diff -up linux-5.2-rc1/arch/x86/boot/compressed/misc.c.20~ linux-5.2-rc1/arch/x86/boot/compressed/misc.c
---- linux-5.2-rc1/arch/x86/boot/compressed/misc.c.20~ 2019-05-20 00:47:09.000000000 +0200
-+++ linux-5.2-rc1/arch/x86/boot/compressed/misc.c 2019-05-21 02:58:19.920070437 +0200
-@@ -76,6 +76,10 @@ static int lines, cols;
- #ifdef CONFIG_KERNEL_LZ4
- #include "../../../../lib/decompress_unlz4.c"
- #endif
-+
-+#ifdef CONFIG_KERNEL_ZSTD
-+#include "../../../../lib/decompress_unzstd.c"
-+#endif
- /*
- * NOTE: When adding a new decompressor, please update the analysis in
- * ../header.S.
-diff -up linux-5.2-rc1/arch/x86/boot/header.S.20~ linux-5.2-rc1/arch/x86/boot/header.S
---- linux-5.2-rc1/arch/x86/boot/header.S.20~ 2019-05-20 00:47:09.000000000 +0200
-+++ linux-5.2-rc1/arch/x86/boot/header.S 2019-05-21 02:58:19.920070437 +0200
-@@ -526,8 +526,14 @@ pref_address: .quad LOAD_PHYSICAL_ADDR
- # the size-dependent part now grows so fast.
- #
- # extra_bytes = (uncompressed_size >> 8) + 65536
-+#
-+# ZSTD compressed data grows by at most 3 bytes per 128K, and only has a 22
-+# byte fixed overhead but has a maximum block size of 128K, so it needs a
-+# larger margin.
-+#
-+# extra_bytes = (uncompressed_size >> 8) + 131072
-
--#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 65536)
-+#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 131072)
- #if ZO_z_output_len > ZO_z_input_len
- # define ZO_z_extract_offset (ZO_z_output_len + ZO_z_extra_bytes - \
- ZO_z_input_len)
-diff -up linux-5.2-rc1/arch/x86/include/asm/boot.h.20~ linux-5.2-rc1/arch/x86/include/asm/boot.h
---- linux-5.2-rc1/arch/x86/include/asm/boot.h.20~ 2019-05-20 00:47:09.000000000 +0200
-+++ linux-5.2-rc1/arch/x86/include/asm/boot.h 2019-05-21 02:58:19.920070437 +0200
-@@ -24,9 +24,11 @@
- # error "Invalid value for CONFIG_PHYSICAL_ALIGN"
- #endif
-
--#ifdef CONFIG_KERNEL_BZIP2
-+#if defined(CONFIG_KERNEL_BZIP2)
- # define BOOT_HEAP_SIZE 0x400000
--#else /* !CONFIG_KERNEL_BZIP2 */
-+#elif defined(CONFIG_KERNEL_ZSTD)
-+# define BOOT_HEAP_SIZE 0x30000
-+#else
- # define BOOT_HEAP_SIZE 0x10000
- #endif
-
-diff -up linux-5.2-rc1/arch/x86/Kconfig.20~ linux-5.2-rc1/arch/x86/Kconfig
---- linux-5.2-rc1/arch/x86/Kconfig.20~ 2019-05-20 00:47:09.000000000 +0200
-+++ linux-5.2-rc1/arch/x86/Kconfig 2019-05-21 02:58:19.921070428 +0200
-@@ -172,6 +172,7 @@ config X86
- select HAVE_KERNEL_LZMA
- select HAVE_KERNEL_LZO
- select HAVE_KERNEL_XZ
-+ select HAVE_KERNEL_ZSTD
- select HAVE_KPROBES
- select HAVE_KPROBES_ON_FTRACE
- select HAVE_FUNCTION_ERROR_INJECTION
-diff -up linux-5.2-rc1/Documentation/x86/boot.rst.20~ linux-5.2-rc1/Documentation/x86/boot.rst
---- linux-5.2-rc1/Documentation/x86/boot.rst.20~ 2019-05-21 02:58:19.921070428 +0200
-+++ linux-5.2-rc1/Documentation/x86/boot.rst 2019-05-21 02:59:27.597466111 +0200
-@@ -768,7 +768,7 @@ Protocol: 2.08+
- numbers. The currently supported compression formats are gzip
- (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
- (magic number 5D 00), XZ (magic number FD 37), and LZ4 (magic number
-- 02 21). The uncompressed payload is currently always ELF (magic
-+ 02 21) and ZSTD (magic number 28 B5). The uncompressed payload is currently always ELF (magic
- number 7F 45 4C 46).
-
- ============ ==============
diff --git a/v3-1-8-lib-prepare-zstd-for-preboot-environment.patch b/v3-1-8-lib-prepare-zstd-for-preboot-environment.patch
new file mode 100644
index 0000000..7e091cd
--- /dev/null
+++ b/v3-1-8-lib-prepare-zstd-for-preboot-environment.patch
@@ -0,0 +1,113 @@
+From Nick Terrell <>
+Subject [PATCH v3 1/8] lib: prepare zstd for preboot environment
+Date Wed, 25 Mar 2020 12:58:42 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+* 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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ lib/zstd/decompress.c | 2 ++
+ lib/zstd/fse_decompress.c | 9 +--------
+ lib/zstd/zstd_internal.h | 14 ++++++++++++--
+ 3 files changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/lib/zstd/decompress.c b/lib/zstd/decompress.c
+index 269ee9a796c1..73ded63278cf 100644
+--- a/lib/zstd/decompress.c
++++ b/lib/zstd/decompress.c
+@@ -2490,6 +2490,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inB
+ }
+ }
+
++#ifndef ZSTD_PREBOOT
+ EXPORT_SYMBOL(ZSTD_DCtxWorkspaceBound);
+ EXPORT_SYMBOL(ZSTD_initDCtx);
+ EXPORT_SYMBOL(ZSTD_decompressDCtx);
+@@ -2529,3 +2530,4 @@ EXPORT_SYMBOL(ZSTD_insertBlock);
+
+ MODULE_LICENSE("Dual BSD/GPL");
+ MODULE_DESCRIPTION("Zstd Decompressor");
++#endif
+diff --git a/lib/zstd/fse_decompress.c b/lib/zstd/fse_decompress.c
+index a84300e5a013..0b353530fb3f 100644
+--- a/lib/zstd/fse_decompress.c
++++ b/lib/zstd/fse_decompress.c
+@@ -47,6 +47,7 @@
+ ****************************************************************/
+ #include "bitstream.h"
+ #include "fse.h"
++#include "zstd_internal.h"
+ #include <linux/compiler.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h> /* memcpy, memset */
+@@ -60,14 +61,6 @@
+ enum { FSE_static_assert = 1 / (int)(!!(c)) }; \
+ } /* use only *after* variable declarations */
+
+-/* check and forward error code */
+-#define CHECK_F(f) \
+- { \
+- size_t const e = f; \
+- if (FSE_isError(e)) \
+- return e; \
+- }
+-
+ /* **************************************************************
+ * Templates
+ ****************************************************************/
+diff --git a/lib/zstd/zstd_internal.h b/lib/zstd/zstd_internal.h
+index 1a79fab9e13a..dac753397f86 100644
+--- a/lib/zstd/zstd_internal.h
++++ b/lib/zstd/zstd_internal.h
+@@ -127,7 +127,14 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG;
+ * Shared functions to include for inlining
+ *********************************************/
+ ZSTD_STATIC void ZSTD_copy8(void *dst, const void *src) {
+- memcpy(dst, src, 8);
++ /*
++ * zstd relies heavily on gcc being able to analyze and inline this
++ * memcpy() call, since it is called in a tight loop. Preboot mode
++ * is compiled in freestanding mode, which stops gcc from analyzing
++ * memcpy(). Use __builtin_memcpy() to tell gcc to analyze this as a
++ * regular memcpy().
++ */
++ __builtin_memcpy(dst, src, 8);
+ }
+ /*! ZSTD_wildcopy() :
+ * custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
+@@ -137,13 +144,16 @@ ZSTD_STATIC void ZSTD_wildcopy(void *dst, const void *src, ptrdiff_t length)
+ const BYTE* ip = (const BYTE*)src;
+ BYTE* op = (BYTE*)dst;
+ BYTE* const oend = op + length;
+- /* Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.
++#if defined(GCC_VERSION) && GCC_VERSION >= 70000 && GCC_VERSION < 70200
++ /*
++ * Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.
+ * Avoid the bad case where the loop only runs once by handling the
+ * special case separately. This doesn't trigger the bug because it
+ * doesn't involve pointer/integer overflow.
+ */
+ if (length <= 8)
+ return ZSTD_copy8(dst, src);
++#endif
+ do {
+ ZSTD_copy8(op, ip);
+ op += 8;
+--
+2.25.1
+
diff --git a/v3-2-8-lib-prepare-xxhash-for-preboot-environment.patch b/v3-2-8-lib-prepare-xxhash-for-preboot-environment.patch
new file mode 100644
index 0000000..5b4e7c2
--- /dev/null
+++ b/v3-2-8-lib-prepare-xxhash-for-preboot-environment.patch
@@ -0,0 +1,115 @@
+From Nick Terrell <>
+Subject [PATCH v3 2/8] lib: prepare xxhash for preboot environment
+Date Wed, 25 Mar 2020 12:58:43 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ lib/xxhash.c | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/lib/xxhash.c b/lib/xxhash.c
+index aa61e2a3802f..b4364e011392 100644
+--- a/lib/xxhash.c
++++ b/lib/xxhash.c
+@@ -80,13 +80,11 @@ void xxh32_copy_state(struct xxh32_state *dst, const struct xxh32_state *src)
+ {
+ memcpy(dst, src, sizeof(*dst));
+ }
+-EXPORT_SYMBOL(xxh32_copy_state);
+
+ void xxh64_copy_state(struct xxh64_state *dst, const struct xxh64_state *src)
+ {
+ memcpy(dst, src, sizeof(*dst));
+ }
+-EXPORT_SYMBOL(xxh64_copy_state);
+
+ /*-***************************
+ * Simple Hash Functions
+@@ -151,7 +149,6 @@ uint32_t xxh32(const void *input, const size_t len, const uint32_t seed)
+
+ return h32;
+ }
+-EXPORT_SYMBOL(xxh32);
+
+ static uint64_t xxh64_round(uint64_t acc, const uint64_t input)
+ {
+@@ -234,7 +231,6 @@ uint64_t xxh64(const void *input, const size_t len, const uint64_t seed)
+
+ return h64;
+ }
+-EXPORT_SYMBOL(xxh64);
+
+ /*-**************************************************
+ * Advanced Hash Functions
+@@ -251,7 +247,6 @@ void xxh32_reset(struct xxh32_state *statePtr, const uint32_t seed)
+ state.v4 = seed - PRIME32_1;
+ memcpy(statePtr, &state, sizeof(state));
+ }
+-EXPORT_SYMBOL(xxh32_reset);
+
+ void xxh64_reset(struct xxh64_state *statePtr, const uint64_t seed)
+ {
+@@ -265,7 +260,6 @@ void xxh64_reset(struct xxh64_state *statePtr, const uint64_t seed)
+ state.v4 = seed - PRIME64_1;
+ memcpy(statePtr, &state, sizeof(state));
+ }
+-EXPORT_SYMBOL(xxh64_reset);
+
+ int xxh32_update(struct xxh32_state *state, const void *input, const size_t len)
+ {
+@@ -334,7 +328,6 @@ int xxh32_update(struct xxh32_state *state, const void *input, const size_t len)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(xxh32_update);
+
+ uint32_t xxh32_digest(const struct xxh32_state *state)
+ {
+@@ -372,7 +365,6 @@ uint32_t xxh32_digest(const struct xxh32_state *state)
+
+ return h32;
+ }
+-EXPORT_SYMBOL(xxh32_digest);
+
+ int xxh64_update(struct xxh64_state *state, const void *input, const size_t len)
+ {
+@@ -439,7 +431,6 @@ int xxh64_update(struct xxh64_state *state, const void *input, const size_t len)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(xxh64_update);
+
+ uint64_t xxh64_digest(const struct xxh64_state *state)
+ {
+@@ -494,7 +485,19 @@ uint64_t xxh64_digest(const struct xxh64_state *state)
+
+ return h64;
+ }
++
++#ifndef XXH_PREBOOT
++EXPORT_SYMBOL(xxh32_copy_state);
++EXPORT_SYMBOL(xxh64_copy_state);
++EXPORT_SYMBOL(xxh32);
++EXPORT_SYMBOL(xxh64);
++EXPORT_SYMBOL(xxh32_reset);
++EXPORT_SYMBOL(xxh64_reset);
++EXPORT_SYMBOL(xxh32_update);
++EXPORT_SYMBOL(xxh32_digest);
++EXPORT_SYMBOL(xxh64_update);
+ EXPORT_SYMBOL(xxh64_digest);
+
+ MODULE_LICENSE("Dual BSD/GPL");
+ MODULE_DESCRIPTION("xxHash");
++#endif
+--
+2.25.1
+
+
\ No newline at end of file
diff --git a/v3-3-8-lib-add-zstd-support-to-decompress.patch b/v3-3-8-lib-add-zstd-support-to-decompress.patch
new file mode 100644
index 0000000..63e3365
--- /dev/null
+++ b/v3-3-8-lib-add-zstd-support-to-decompress.patch
@@ -0,0 +1,450 @@
+From Nick Terrell <>
+Subject [PATCH v3 3/8] lib: add zstd support to decompress
+Date Wed, 25 Mar 2020 12:58:44 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+* 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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ include/linux/decompress/unzstd.h | 11 +
+ lib/Kconfig | 4 +
+ lib/Makefile | 1 +
+ lib/decompress.c | 5 +
+ lib/decompress_unzstd.c | 338 ++++++++++++++++++++++++++++++
+ 5 files changed, 359 insertions(+)
+ create mode 100644 include/linux/decompress/unzstd.h
+ create mode 100644 lib/decompress_unzstd.c
+
+diff --git a/include/linux/decompress/unzstd.h b/include/linux/decompress/unzstd.h
+new file mode 100644
+index 000000000000..56d539ae880f
+--- /dev/null
++++ b/include/linux/decompress/unzstd.h
+@@ -0,0 +1,11 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef LINUX_DECOMPRESS_UNZSTD_H
++#define LINUX_DECOMPRESS_UNZSTD_H
++
++int unzstd(unsigned char *inbuf, long len,
++ long (*fill)(void*, unsigned long),
++ long (*flush)(void*, unsigned long),
++ unsigned char *output,
++ long *pos,
++ void (*error_fn)(char *x));
++#endif
+diff --git a/lib/Kconfig b/lib/Kconfig
+index bc7e56370129..11de5fa09a52 100644
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -336,6 +336,10 @@ config DECOMPRESS_LZ4
+ select LZ4_DECOMPRESS
+ tristate
+
++config DECOMPRESS_ZSTD
++ select ZSTD_DECOMPRESS
++ tristate
++
+ #
+ # Generic allocator support is selected if needed
+ #
+diff --git a/lib/Makefile b/lib/Makefile
+index 611872c06926..09ad45ba6883 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -160,6 +160,7 @@ lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
+ lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o
+ lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
+ lib-$(CONFIG_DECOMPRESS_LZ4) += decompress_unlz4.o
++lib-$(CONFIG_DECOMPRESS_ZSTD) += decompress_unzstd.o
+
+ obj-$(CONFIG_TEXTSEARCH) += textsearch.o
+ obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
+diff --git a/lib/decompress.c b/lib/decompress.c
+index 857ab1af1ef3..ab3fc90ffc64 100644
+--- a/lib/decompress.c
++++ b/lib/decompress.c
+@@ -13,6 +13,7 @@
+ #include <linux/decompress/inflate.h>
+ #include <linux/decompress/unlzo.h>
+ #include <linux/decompress/unlz4.h>
++#include <linux/decompress/unzstd.h>
+
+ #include <linux/types.h>
+ #include <linux/string.h>
+@@ -37,6 +38,9 @@
+ #ifndef CONFIG_DECOMPRESS_LZ4
+ # define unlz4 NULL
+ #endif
++#ifndef CONFIG_DECOMPRESS_ZSTD
++# define unzstd NULL
++#endif
+
+ struct compress_format {
+ unsigned char magic[2];
+@@ -52,6 +56,7 @@ static const struct compress_format compressed_formats[] __initconst = {
+ { {0xfd, 0x37}, "xz", unxz },
+ { {0x89, 0x4c}, "lzo", unlzo },
+ { {0x02, 0x21}, "lz4", unlz4 },
++ { {0x28, 0xb5}, "zstd", unzstd },
+ { {0, 0}, NULL, NULL }
+ };
+
+diff --git a/lib/decompress_unzstd.c b/lib/decompress_unzstd.c
+new file mode 100644
+index 000000000000..a6b391b47ab8
+--- /dev/null
++++ b/lib/decompress_unzstd.c
+@@ -0,0 +1,338 @@
++// SPDX-License-Identifier: GPL-2.0
++
++/*
++ * Important notes about in-place decompression
++ *
++ * At least on x86, the kernel is decompressed in place: the compressed data
++ * is placed to the end of the output buffer, and the decompressor overwrites
++ * most of the compressed data. There must be enough safety margin to
++ * guarantee that the write position is always behind the read position.
++ *
++ * The safety margin for ZSTD with a 128 KB block size is calculated below.
++ * Note that the margin with ZSTD is bigger than with GZIP or XZ!
++ *
++ * The worst case for in-place decompression is that the beginning of
++ * the file is compressed extremely well, and the rest of the file is
++ * uncompressible. Thus, we must look for worst-case expansion when the
++ * compressor is encoding uncompressible data.
++ *
++ * The structure of the .zst file in case of a compresed kernel is as follows.
++ * Maximum sizes (as bytes) of the fields are in parenthesis.
++ *
++ * Frame Header: (18)
++ * Blocks: (N)
++ * Checksum: (4)
++ *
++ * The frame header and checksum overhead is at most 22 bytes.
++ *
++ * ZSTD stores the data in blocks. Each block has a header whose size is
++ * a 3 bytes. After the block header, there is up to 128 KB of payload.
++ * The maximum uncompressed size of the payload is 128 KB. The minimum
++ * uncompressed size of the payload is never less than the payload size
++ * (excluding the block header).
++ *
++ * The assumption, that the uncompressed size of the payload is never
++ * smaller than the payload itself, is valid only when talking about
++ * the payload as a whole. It is possible that the payload has parts where
++ * the decompressor consumes more input than it produces output. Calculating
++ * the worst case for this would be tricky. Instead of trying to do that,
++ * let's simply make sure that the decompressor never overwrites any bytes
++ * of the payload which it is currently reading.
++ *
++ * Now we have enough information to calculate the safety margin. We need
++ * - 22 bytes for the .zst file format headers;
++ * - 3 bytes per every 128 KiB of uncompressed size (one block header per
++ * block); and
++ * - 128 KiB (biggest possible zstd block size) to make sure that the
++ * decompressor never overwrites anything from the block it is currently
++ * reading.
++ *
++ * We get the following formula:
++ *
++ * safety_margin = 22 + uncompressed_size * 3 / 131072 + 131072
++ * <= 22 + (uncompressed_size >> 15) + 131072
++ */
++
++/*
++ * Preboot environments #include "path/to/decompress_unzstd.c".
++ * All of the source files we depend on must be #included.
++ * zstd's only source dependeny is xxhash, which has no source
++ * dependencies.
++ *
++ * zstd and xxhash avoid declaring themselves as modules
++ * when ZSTD_PREBOOT and XXH_PREBOOT are defined.
++ */
++#ifdef STATIC
++# define ZSTD_PREBOOT
++# define XXH_PREBOOT
++# include "xxhash.c"
++# include "zstd/entropy_common.c"
++# include "zstd/fse_decompress.c"
++# include "zstd/huf_decompress.c"
++# include "zstd/zstd_common.c"
++# include "zstd/decompress.c"
++#endif
++
++#include <linux/decompress/mm.h>
++#include <linux/kernel.h>
++#include <linux/zstd.h>
++
++/* 8 MB maximum window size */
++#define ZSTD_WINDOWSIZE_MAX (1 << 23)
++/* Size of the input and output buffers in multi-call mdoe */
++#define ZSTD_IOBUF_SIZE 4096
++
++static int INIT handle_zstd_error(size_t ret, void (*error)(char *x))
++{
++ const int err = ZSTD_getErrorCode(ret);
++
++ if (!ZSTD_isError(ret))
++ return 0;
++
++ switch (err) {
++ case ZSTD_error_memory_allocation:
++ error("ZSTD decompressor ran out of memory");
++ break;
++ case ZSTD_error_prefix_unknown:
++ error("Input is not in the ZSTD format (wrong magic bytes)");
++ break;
++ case ZSTD_error_dstSize_tooSmall:
++ case ZSTD_error_corruption_detected:
++ case ZSTD_error_checksum_wrong:
++ error("ZSTD-compressed data is corrupt");
++ break;
++ default:
++ error("ZSTD-compressed data is probably corrupt");
++ break;
++ }
++ return -1;
++}
++
++/*
++ * Handle the case where we have the entire input and output in one segment.
++ * We can allocate less memory (no circular buffer for the sliding window),
++ * and avoid some memcpy() calls.
++ */
++static int INIT decompress_single(const u8 *in_buf, long in_len, u8 *out_buf,
++ long out_len, long *in_pos,
++ void (*error)(char *x))
++{
++ const size_t wksp_size = ZSTD_DCtxWorkspaceBound();
++ void *wksp = large_malloc(wksp_size);
++ ZSTD_DCtx *dctx = ZSTD_initDCtx(wksp, wksp_size);
++ int err;
++ size_t ret;
++
++ if (dctx == NULL) {
++ error("Out of memory while allocating ZSTD_DCtx");
++ err = -1;
++ goto out;
++ }
++ /*
++ * Find out how large the frame actually is, there may be junk at
++ * the end of the frame that ZSTD_decompressDCtx() can't handle.
++ */
++ ret = ZSTD_findFrameCompressedSize(in_buf, in_len);
++ err = handle_zstd_error(ret, error);
++ if (err)
++ goto out;
++ in_len = (long)ret;
++
++ ret = ZSTD_decompressDCtx(dctx, out_buf, out_len, in_buf, in_len);
++ err = handle_zstd_error(ret, error);
++ if (err)
++ goto out;
++
++ if (in_pos != NULL)
++ *in_pos = in_len;
++
++ err = 0;
++out:
++ if (wksp != NULL)
++ large_free(wksp);
++ return err;
++}
++
++static int INIT __unzstd(unsigned char *in_buf, long in_len,
++ long (*fill)(void*, unsigned long),
++ long (*flush)(void*, unsigned long),
++ unsigned char *out_buf, long out_len,
++ long *in_pos,
++ void (*error)(char *x))
++{
++ ZSTD_inBuffer in;
++ ZSTD_outBuffer out;
++ ZSTD_frameParams params;
++ void *in_allocated = NULL;
++ void *out_allocated = NULL;
++ void *wksp = NULL;
++ size_t wksp_size;
++ ZSTD_DStream *dstream;
++ int err;
++ size_t ret;
++
++ if (out_len == 0)
++ out_len = LONG_MAX; /* no limit */
++
++ if (fill == NULL && flush == NULL)
++ /*
++ * We can decompress faster and with less memory when we have a
++ * single chunk.
++ */
++ return decompress_single(in_buf, in_len, out_buf, out_len,
++ in_pos, error);
++
++ /*
++ * If in_buf is not provided, we must be using fill(), so allocate
++ * a large enough buffer. If it is provided, it must be at least
++ * ZSTD_IOBUF_SIZE large.
++ */
++ if (in_buf == NULL) {
++ in_allocated = malloc(ZSTD_IOBUF_SIZE);
++ if (in_allocated == NULL) {
++ error("Out of memory while allocating input buffer");
++ err = -1;
++ goto out;
++ }
++ in_buf = in_allocated;
++ in_len = 0;
++ }
++ /* Read the first chunk, since we need to decode the frame header. */
++ if (fill != NULL)
++ in_len = fill(in_buf, ZSTD_IOBUF_SIZE);
++ if (in_len < 0) {
++ error("ZSTD-compressed data is truncated");
++ err = -1;
++ goto out;
++ }
++ /* Set the first non-empty input buffer. */
++ in.src = in_buf;
++ in.pos = 0;
++ in.size = in_len;
++ /* Allocate the output buffer if we are using flush(). */
++ if (flush != NULL) {
++ out_allocated = malloc(ZSTD_IOBUF_SIZE);
++ if (out_allocated == NULL) {
++ error("Out of memory while allocating output buffer");
++ err = -1;
++ goto out;
++ }
++ out_buf = out_allocated;
++ out_len = ZSTD_IOBUF_SIZE;
++ }
++ /* Set the output buffer. */
++ out.dst = out_buf;
++ out.pos = 0;
++ out.size = out_len;
++
++ /*
++ * We need to know the window size to allocate the ZSTD_DStream.
++ * Since we are streaming, we need to allocate a buffer for the sliding
++ * window. The window size varies from 1 KB to ZSTD_WINDOWSIZE_MAX
++ * (8 MB), so it is important to use the actual value so as not to
++ * waste memory when it is smaller.
++ */
++ ret = ZSTD_getFrameParams(¶ms, in.src, in.size);
++ err = handle_zstd_error(ret, error);
++ if (err)
++ goto out;
++ if (ret != 0) {
++ error("ZSTD-compressed data has an incomplete frame header");
++ err = -1;
++ goto out;
++ }
++ if (params.windowSize > ZSTD_WINDOWSIZE_MAX) {
++ error("ZSTD-compressed data has too large a window size");
++ err = -1;
++ goto out;
++ }
++
++ /*
++ * Allocate the ZSTD_DStream now that we know how much memory is
++ * required.
++ */
++ wksp_size = ZSTD_DStreamWorkspaceBound(params.windowSize);
++ wksp = large_malloc(wksp_size);
++ dstream = ZSTD_initDStream(params.windowSize, wksp, wksp_size);
++ if (dstream == NULL) {
++ error("Out of memory while allocating ZSTD_DStream");
++ err = -1;
++ goto out;
++ }
++
++ /*
++ * Decompression loop:
++ * Read more data if necessary (error if no more data can be read).
++ * Call the decompression function, which returns 0 when finished.
++ * Flush any data produced if using flush().
++ */
++ if (in_pos != NULL)
++ *in_pos = 0;
++ do {
++ /*
++ * If we need to reload data, either we have fill() and can
++ * try to get more data, or we don't and the input is truncated.
++ */
++ if (in.pos == in.size) {
++ if (in_pos != NULL)
++ *in_pos += in.pos;
++ in_len = fill ? fill(in_buf, ZSTD_IOBUF_SIZE) : -1;
++ if (in_len < 0) {
++ error("ZSTD-compressed data is truncated");
++ err = -1;
++ goto out;
++ }
++ in.pos = 0;
++ in.size = in_len;
++ }
++ /* Returns zero when the frame is complete. */
++ ret = ZSTD_decompressStream(dstream, &out, &in);
++ err = handle_zstd_error(ret, error);
++ if (err)
++ goto out;
++ /* Flush all of the data produced if using flush(). */
++ if (flush != NULL && out.pos > 0) {
++ if (out.pos != flush(out.dst, out.pos)) {
++ error("Failed to flush()");
++ err = -1;
++ goto out;
++ }
++ out.pos = 0;
++ }
++ } while (ret != 0);
++
++ if (in_pos != NULL)
++ *in_pos += in.pos;
++
++ err = 0;
++out:
++ if (in_allocated != NULL)
++ free(in_allocated);
++ if (out_allocated != NULL)
++ free(out_allocated);
++ if (wksp != NULL)
++ large_free(wksp);
++ return err;
++}
++
++#ifndef ZSTD_PREBOOT
++STATIC int INIT unzstd(unsigned char *buf, long len,
++ long (*fill)(void*, unsigned long),
++ long (*flush)(void*, unsigned long),
++ unsigned char *out_buf,
++ long *pos,
++ void (*error)(char *x))
++{
++ return __unzstd(buf, len, fill, flush, out_buf, 0, pos, error);
++}
++#else
++STATIC int INIT __decompress(unsigned char *buf, long len,
++ long (*fill)(void*, unsigned long),
++ long (*flush)(void*, unsigned long),
++ unsigned char *out_buf, long out_len,
++ long *pos,
++ void (*error)(char *x))
++{
++ return __unzstd(buf, len, fill, flush, out_buf, out_len, pos, error);
++}
++#endif
+--
+2.25.1
+
+
\ No newline at end of file
diff --git a/v3-4-8-init-add-support-for-zstd-compressed-kernel.patch b/v3-4-8-init-add-support-for-zstd-compressed-kernel.patch
new file mode 100644
index 0000000..f23178e
--- /dev/null
+++ b/v3-4-8-init-add-support-for-zstd-compressed-kernel.patch
@@ -0,0 +1,87 @@
+From Nick Terrell <>
+Subject [PATCH v3 4/8] init: add support for zstd compressed kernel
+Date Wed, 25 Mar 2020 12:58:45 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+* 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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ init/Kconfig | 15 ++++++++++++++-
+ scripts/Makefile.lib | 15 +++++++++++++++
+ 2 files changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 20a6ac33761c..9b646a25918e 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -173,13 +173,16 @@ config HAVE_KERNEL_LZO
+ config HAVE_KERNEL_LZ4
+ bool
+
++config HAVE_KERNEL_ZSTD
++ bool
++
+ config HAVE_KERNEL_UNCOMPRESSED
+ bool
+
+ choice
+ prompt "Kernel compression mode"
+ default KERNEL_GZIP
+- depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_UNCOMPRESSED
++ depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
+ help
+ The linux kernel is a kind of self-extracting executable.
+ Several compression algorithms are available, which differ
+@@ -258,6 +261,16 @@ config KERNEL_LZ4
+ is about 8% bigger than LZO. But the decompression speed is
+ faster than LZO.
+
++config KERNEL_ZSTD
++ bool "ZSTD"
++ depends on HAVE_KERNEL_ZSTD
++ help
++ ZSTD is a compression algorithm targeting intermediate compression
++ with fast decompression speed. It will compress better than GZIP and
++ decompress around the same speed as LZO, but slower than LZ4. You
++ will need at least 192 KB RAM or more for booting. The zstd command
++ line tools is required for compression.
++
+ config KERNEL_UNCOMPRESSED
+ bool "None"
+ depends on HAVE_KERNEL_UNCOMPRESSED
+diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
+index 752ff0a225a9..4b99893efa3d 100644
+--- a/scripts/Makefile.lib
++++ b/scripts/Makefile.lib
+@@ -394,6 +394,21 @@ quiet_cmd_xzkern = XZKERN $@
+ quiet_cmd_xzmisc = XZMISC $@
+ cmd_xzmisc = cat $(real-prereqs) | xz --check=crc32 --lzma2=dict=1MiB > $@
+
++# ZSTD
++# ---------------------------------------------------------------------------
++# Appends the uncompressed size of the data using size_append. The .zst
++# format has the size information available at the beginning of the file too,
++# but it's in a more complex format and it's good to avoid changing the part
++# of the boot code that reads the uncompressed size.
++# Note that the bytes added by size_append will make the zstd tool think that
++# the file is corrupt. This is expected.
++
++quiet_cmd_zstd = ZSTD $@
++cmd_zstd = (cat $(filter-out FORCE,$^) | \
++ zstd -19 && \
++ $(call size_append, $(filter-out FORCE,$^))) > $@ || \
++ (rm -f $@ ; false)
++
+ # ASM offsets
+ # ---------------------------------------------------------------------------
+
+--
+2.25.1
+
+
\ No newline at end of file
diff --git a/v3-5-8-usr-add-support-for-zstd-compressed-initramfs.patch b/v3-5-8-usr-add-support-for-zstd-compressed-initramfs.patch
new file mode 100644
index 0000000..841c11f
--- /dev/null
+++ b/v3-5-8-usr-add-support-for-zstd-compressed-initramfs.patch
@@ -0,0 +1,79 @@
+From Nick Terrell <>
+Subject [PATCH v3 5/8] usr: add support for zstd compressed initramfs
+Date Wed, 25 Mar 2020 12:58:46 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+* 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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+---
+ usr/Kconfig | 20 ++++++++++++++++++++
+ usr/Makefile | 1 +
+ 2 files changed, 21 insertions(+)
+
+diff -Naur a/usr/Kconfig b/usr/Kconfig
+--- a/usr/Kconfig 2020-03-29 22:25:41.000000000 +0000
++++ b/usr/Kconfig 2020-04-02 23:28:00.634293312 +0000
+@@ -100,6 +100,15 @@
+ Support loading of a LZ4 encoded initial ramdisk or cpio buffer
+ If unsure, say N.
+
++config RD_ZSTD
++ bool "Support initial ramdisk/ramfs compressed using ZSTD"
++ default y
++ depends on BLK_DEV_INITRD
++ select DECOMPRESS_ZSTD
++ help
++ Support loading of a ZSTD encoded initial ramdisk or cpio buffer.
++ If unsure, say N.
++
+ choice
+ prompt "Built-in initramfs compression mode"
+ depends on INITRAMFS_SOURCE != ""
+@@ -196,6 +205,17 @@
+ If you choose this, keep in mind that most distros don't provide lz4
+ by default which could cause a build failure.
+
++config INITRAMFS_COMPRESSION_ZSTD
++ bool "ZSTD"
++ depends on RD_ZSTD
++ help
++ ZSTD is a compression algorithm targeting intermediate compression
++ with fast decompression speed. It will compress better than GZIP and
++ decompress around the same speed as LZO, but slower than LZ4.
++
++ If you choose this, keep in mind that you may need to install the zstd
++ tool to be able to compress the initram.
++
+ config INITRAMFS_COMPRESSION_NONE
+ bool "None"
+ help
+diff -Naur a/usr/Makefile b/usr/Makefile
+--- a/usr/Makefile 2020-03-29 22:25:41.000000000 +0000
++++ b/usr/Makefile 2020-04-02 23:28:21.302441204 +0000
+@@ -15,6 +15,7 @@
+ compress-$(CONFIG_INITRAMFS_COMPRESSION_XZ) := xzmisc
+ compress-$(CONFIG_INITRAMFS_COMPRESSION_LZO) := lzo
+ compress-$(CONFIG_INITRAMFS_COMPRESSION_LZ4) := lz4
++compress-$(CONFIG_INITRAMFS_COMPRESSION_ZSTD) := zstd
+
+ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
+
+---
+2.25.1
diff --git a/v3-6-8-x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch b/v3-6-8-x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch
new file mode 100644
index 0000000..2e97111
--- /dev/null
+++ b/v3-6-8-x86-bump-ZO_z_extra_bytes-margin-for-zstd.patch
@@ -0,0 +1,43 @@
+From Nick Terrell <>
+Subject [PATCH v3 6/8] x86: bump ZO_z_extra_bytes margin for zstd
+Date Wed, 25 Mar 2020 12:58:47 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ arch/x86/boot/header.S | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
+index 97d9b6d6c1af..b820875c5c95 100644
+--- a/arch/x86/boot/header.S
++++ b/arch/x86/boot/header.S
+@@ -536,8 +536,14 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr
+ # the size-dependent part now grows so fast.
+ #
+ # extra_bytes = (uncompressed_size >> 8) + 65536
++#
++# ZSTD compressed data grows by at most 3 bytes per 128K, and only has a 22
++# byte fixed overhead but has a maximum block size of 128K, so it needs a
++# larger margin.
++#
++# extra_bytes = (uncompressed_size >> 8) + 131072
+
+-#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 65536)
++#define ZO_z_extra_bytes ((ZO_z_output_len >> 8) + 131072)
+ #if ZO_z_output_len > ZO_z_input_len
+ # define ZO_z_extract_offset (ZO_z_output_len + ZO_z_extra_bytes - \
+ ZO_z_input_len)
+--
+2.25.1
+
+
\ No newline at end of file
diff --git a/v3-7-8-x86-Add-support-for-ZSTD-compressed-kernel.patch b/v3-7-8-x86-Add-support-for-ZSTD-compressed-kernel.patch
new file mode 100644
index 0000000..8689c2c
--- /dev/null
+++ b/v3-7-8-x86-Add-support-for-ZSTD-compressed-kernel.patch
@@ -0,0 +1,129 @@
+From Nick Terrell <>
+Subject [PATCH v3 7/8] x86: Add support for ZSTD compressed kernel
+Date Wed, 25 Mar 2020 12:58:48 -0700
+share
+From: Nick Terrell <terrelln@fb.com>
+
+* 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.
+
+Signed-off-by: Nick Terrell <terrelln@fb.com>
+
+---
+ Documentation/x86/boot.rst | 6 +++---
+ arch/x86/Kconfig | 1 +
+ arch/x86/boot/compressed/Makefile | 5 ++++-
+ arch/x86/boot/compressed/misc.c | 4 ++++
+ arch/x86/include/asm/boot.h | 6 ++++--
+ 5 files changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/Documentation/x86/boot.rst b/Documentation/x86/boot.rst
+index c9c201596c3e..cedcf4d49bf0 100644
+--- a/Documentation/x86/boot.rst
++++ b/Documentation/x86/boot.rst
+@@ -786,9 +786,9 @@ Protocol: 2.08+
+ uncompressed data should be determined using the standard magic
+ numbers. The currently supported compression formats are gzip
+ (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
+- (magic number 5D 00), XZ (magic number FD 37), and LZ4 (magic number
+- 02 21). The uncompressed payload is currently always ELF (magic
+- number 7F 45 4C 46).
++ (magic number 5D 00), XZ (magic number FD 37), LZ4 (magic number
++ 02 21) and ZSTD (magic number 28 B5). The uncompressed payload is
++ currently always ELF (magic number 7F 45 4C 46).
+
+ ============ ==============
+ Field name: payload_length
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
+index beea77046f9b..12d88997a3a6 100644
+--- a/arch/x86/Kconfig
++++ b/arch/x86/Kconfig
+@@ -183,6 +183,7 @@ config X86
+ select HAVE_KERNEL_LZMA
+ select HAVE_KERNEL_LZO
+ select HAVE_KERNEL_XZ
++ select HAVE_KERNEL_ZSTD
+ select HAVE_KPROBES
+ select HAVE_KPROBES_ON_FTRACE
+ select HAVE_FUNCTION_ERROR_INJECTION
+diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
+index 26050ae0b27e..8233f598f15b 100644
+--- a/arch/x86/boot/compressed/Makefile
++++ b/arch/x86/boot/compressed/Makefile
+@@ -24,7 +24,7 @@ OBJECT_FILES_NON_STANDARD := y
+ KCOV_INSTRUMENT := n
+
+ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
+- vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
++ vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 vmlinux.bin.zst
+
+ KBUILD_CFLAGS := -m$(BITS) -O2
+ KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
+@@ -145,6 +145,8 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
+ $(call if_changed,lzo)
+ $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
+ $(call if_changed,lz4)
++$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
++ $(call if_changed,zstd)
+
+ suffix-$(CONFIG_KERNEL_GZIP) := gz
+ suffix-$(CONFIG_KERNEL_BZIP2) := bz2
+@@ -152,6 +154,7 @@ suffix-$(CONFIG_KERNEL_LZMA) := lzma
+ suffix-$(CONFIG_KERNEL_XZ) := xz
+ suffix-$(CONFIG_KERNEL_LZO) := lzo
+ suffix-$(CONFIG_KERNEL_LZ4) := lz4
++suffix-$(CONFIG_KERNEL_ZSTD) := zst
+
+ quiet_cmd_mkpiggy = MKPIGGY $@
+ cmd_mkpiggy = $(obj)/mkpiggy $< > $@
+diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
+index 9652d5c2afda..39e592d0e0b4 100644
+--- a/arch/x86/boot/compressed/misc.c
++++ b/arch/x86/boot/compressed/misc.c
+@@ -77,6 +77,10 @@ static int lines, cols;
+ #ifdef CONFIG_KERNEL_LZ4
+ #include "../../../../lib/decompress_unlz4.c"
+ #endif
++
++#ifdef CONFIG_KERNEL_ZSTD
++#include "../../../../lib/decompress_unzstd.c"
++#endif
+ /*
+ * NOTE: When adding a new decompressor, please update the analysis in
+ * ../header.S.
+diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
+index 680c320363db..d6dd43d25d9f 100644
+--- a/arch/x86/include/asm/boot.h
++++ b/arch/x86/include/asm/boot.h
+@@ -24,9 +24,11 @@
+ # error "Invalid value for CONFIG_PHYSICAL_ALIGN"
+ #endif
+
+-#ifdef CONFIG_KERNEL_BZIP2
++#if defined(CONFIG_KERNEL_BZIP2)
+ # define BOOT_HEAP_SIZE 0x400000
+-#else /* !CONFIG_KERNEL_BZIP2 */
++#elif defined(CONFIG_KERNEL_ZSTD)
++# define BOOT_HEAP_SIZE 0x30000
++#else
+ # define BOOT_HEAP_SIZE 0x10000
+ #endif
+
+--
+2.25.1
+
+
\ No newline at end of file
diff --git a/vbox-kernel-5.6.patch b/vbox-kernel-5.6.patch
new file mode 100644
index 0000000..9b1a919
--- /dev/null
+++ b/vbox-kernel-5.6.patch
@@ -0,0 +1,154 @@
+diff -up linux-5.6-rc4/drivers/net/vboxnetadp/include/iprt/time.h.302a~ linux-5.6-rc4/drivers/net/vboxnetadp/include/iprt/time.h
+--- linux-5.6-rc4/drivers/net/vboxnetadp/include/iprt/time.h.302a~ 2020-01-13 11:44:20.000000000 +0100
++++ linux-5.6-rc4/drivers/net/vboxnetadp/include/iprt/time.h 2020-03-03 04:29:44.706626571 +0100
+@@ -357,7 +357,7 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++#if 0 && defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
+ /**
+ * Gets the time as POSIX timeval.
+@@ -433,7 +433,7 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ }
+
+
+-# ifdef _LINUX_TIME64_H
++# if 1 //def _LINUX_TIME64_H
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+diff -up linux-5.6-rc4/drivers/net/vboxnetflt/include/iprt/time.h.302a~ linux-5.6-rc4/drivers/net/vboxnetflt/include/iprt/time.h
+--- linux-5.6-rc4/drivers/net/vboxnetflt/include/iprt/time.h.302a~ 2020-01-13 11:44:20.000000000 +0100
++++ linux-5.6-rc4/drivers/net/vboxnetflt/include/iprt/time.h 2020-03-03 16:55:57.194735855 +0100
+@@ -357,8 +357,8 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++#if 0 && (defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timeval.
+ *
+@@ -433,7 +433,7 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ }
+
+
+-# ifdef _LINUX_TIME64_H
++# if 1 //def _LINUX_TIME64_H
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+diff -up linux-5.6-rc4/drivers/pci/vboxpci/include/iprt/time.h.302a~ linux-5.6-rc4/drivers/pci/vboxpci/include/iprt/time.h
+--- linux-5.6-rc4/drivers/pci/vboxpci/include/iprt/time.h.302a~ 2020-01-13 11:44:20.000000000 +0100
++++ linux-5.6-rc4/drivers/pci/vboxpci/include/iprt/time.h 2020-03-03 04:29:44.707626571 +0100
+@@ -357,7 +357,7 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++#if 0 && defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
+ /**
+ * Gets the time as POSIX timeval.
+@@ -433,7 +433,7 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ }
+
+
+-# ifdef _LINUX_TIME64_H
++# if 1 //def _LINUX_TIME64_H
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+diff -up linux-5.6-rc4/drivers/pci/vboxpci/linux/VBoxPci-linux.c.302a~ linux-5.6-rc4/drivers/pci/vboxpci/linux/VBoxPci-linux.c
+--- linux-5.6-rc4/drivers/pci/vboxpci/linux/VBoxPci-linux.c.302a~ 2020-01-13 11:53:40.000000000 +0100
++++ linux-5.6-rc4/drivers/pci/vboxpci/linux/VBoxPci-linux.c 2020-03-03 04:29:44.705626571 +0100
+@@ -843,8 +843,8 @@ DECLHIDDEN(int) vboxPciOsDevMapRegion(PV
+ if (!rcLnx)
+ {
+ /* For now no caching, try to optimize later. */
+- RTR0PTR R0PtrMapping = ioremap_nocache(pci_resource_start(pPciDev, iRegion),
+- pci_resource_len(pPciDev, iRegion));
++ RTR0PTR R0PtrMapping = ioremap(pci_resource_start(pPciDev, iRegion),
++ pci_resource_len(pPciDev, iRegion));
+
+ if (R0PtrMapping != NIL_RTR0PTR)
+ pIns->aRegionR0Mapping[iRegion] = R0PtrMapping;
+diff -up linux-5.6-rc4/drivers/virt/vboxdrv/include/iprt/time.h.302a~ linux-5.6-rc4/drivers/virt/vboxdrv/include/iprt/time.h
+--- linux-5.6-rc4/drivers/virt/vboxdrv/include/iprt/time.h.302a~ 2020-01-13 11:44:20.000000000 +0100
++++ linux-5.6-rc4/drivers/virt/vboxdrv/include/iprt/time.h 2020-03-03 17:07:41.953706093 +0100
+@@ -357,8 +357,8 @@ DECLINLINE(void) RTTimeSpecGetSecondsAnd
+
+
+ /* PORTME: Add struct timeval guard macro here. */
+-#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
+- || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
++#if 0 && (defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
++ || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
+ /**
+ * Gets the time as POSIX timeval.
+ *
+@@ -433,7 +433,7 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim
+ }
+
+
+-# ifdef _LINUX_TIME64_H
++# if 1 //def _LINUX_TIME64_H
+ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
+ {
+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
+diff -up linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/memobj-r0drv-linux.c.302a~ linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/memobj-r0drv-linux.c
+--- linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/memobj-r0drv-linux.c.302a~ 2020-01-13 11:54:19.000000000 +0100
++++ linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/memobj-r0drv-linux.c 2020-03-03 04:29:44.705626571 +0100
+@@ -1461,9 +1461,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne
+ * MMIO / physical memory.
+ */
+ Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
+- pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
+- ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
+- : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
++ pMemLnx->Core.pv = ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
+ if (pMemLnx->Core.pv)
+ {
+ /** @todo fix protection. */
+diff -up linux-5.6-rc4/virt/kvm/kvm_main.c.302a~ linux-5.6-rc4/virt/kvm/kvm_main.c
+--- linux-5.6-rc4/virt/kvm/kvm_main.c.302a~ 2020-03-01 23:38:46.000000000 +0100
++++ linux-5.6-rc4/virt/kvm/kvm_main.c 2020-03-03 04:29:44.706626571 +0100
+@@ -2219,7 +2219,7 @@ static int __kvm_gfn_to_hva_cache_init(s
+ gfn_t start_gfn = gpa >> PAGE_SHIFT;
+ gfn_t end_gfn = (gpa + len - 1) >> PAGE_SHIFT;
+ gfn_t nr_pages_needed = end_gfn - start_gfn + 1;
+- gfn_t nr_pages_avail;
++ gfn_t nr_pages_avail = 0;
+
+ /* Update ghc->generation before performing any error checks. */
+ ghc->generation = slots->generation;
+diff -up linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/time-r0drv-linux.c.omv~ linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/time-r0drv-linux.c
+--- linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/time-r0drv-linux.c.omv~ 2020-03-03 17:10:12.583699732 +0100
++++ linux-5.6-rc4/drivers/virt/vboxdrv/r0drv/linux/time-r0drv-linux.c 2020-03-03 17:12:59.803692670 +0100
+@@ -34,7 +34,10 @@
+ #include <iprt/time.h>
+ #include <iprt/asm.h>
+
+-
++DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
++{
++ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
++}
+
+ DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
+ {
+@@ -43,8 +46,8 @@ DECLINLINE(uint64_t) rtTimeGetSystemNano
+ * Use ktime_get_ts, this is also what clock_gettime(CLOCK_MONOTONIC,) is using.
+ */
+ uint64_t u64;
+- struct timespec Ts;
+- ktime_get_ts(&Ts);
++ struct timespec64 Ts;
++ ktime_get_ts64(&Ts);
+ u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec;
+ return u64;
+
diff --git a/x86_64-common.config b/x86_64-common.config
index 5c5270e..b2680b6 100644
--- a/x86_64-common.config
+++ b/x86_64-common.config
@@ -95,7 +95,6 @@ CONFIG_CRYPTO_SERPENT=AVX_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
-# CONFIG_X86_VERBOSE_BOOTUP is not set
# CONFIG_X86_DEBUG_FPU is not set
CONFIG_UEFI_CPER_X86=y
CONFIG_RAID6_FORCE_ALGO=y