Merge master into staging-next

This commit is contained in:
Frederik Rietdijk
2019-10-08 11:56:52 +02:00
366 changed files with 7208 additions and 3820 deletions
@@ -0,0 +1,42 @@
From 1e010beda2896bdf3082fb37a3e49f8ce20e04d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 2 May 2019 05:28:08 +0100
Subject: [PATCH] x86/fpu: Export kernel_fpu_{begin,end}() with
EXPORT_SYMBOL_GPL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We need these symbols in zfs as the fpu implementation breaks userspace:
https://github.com/zfsonlinux/zfs/issues/9346
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
arch/x86/kernel/fpu/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 12c70840980e..352538b3bb5d 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -102,7 +102,7 @@ void kernel_fpu_begin(void)
}
__cpu_invalidate_fpregs_state();
}
-EXPORT_SYMBOL_GPL(kernel_fpu_begin);
+EXPORT_SYMBOL(kernel_fpu_begin);
void kernel_fpu_end(void)
{
@@ -111,7 +111,7 @@ void kernel_fpu_end(void)
this_cpu_write(in_kernel_fpu, false);
preempt_enable();
}
-EXPORT_SYMBOL_GPL(kernel_fpu_end);
+EXPORT_SYMBOL(kernel_fpu_end);
/*
* Save the FPU state (mark it for reload if necessary):
--
2.23.0
@@ -0,0 +1,86 @@
From 2cc99c9cdc8fde5e92e34f9655829449cebd3e00 Mon Sep 17 00:00:00 2001
From: Dmitry Goldin <dgoldin+lkml@protonmail.ch>
Date: Fri, 4 Oct 2019 10:40:07 +0000
Subject: kheaders: make headers archive reproducible
In commit 43d8ce9d65a5 ("Provide in-kernel headers to make
extending kernel easier") a new mechanism was introduced, for kernels
>=5.2, which embeds the kernel headers in the kernel image or a module
and exposes them in procfs for use by userland tools.
The archive containing the header files has nondeterminism caused by
header files metadata. This patch normalizes the metadata and utilizes
KBUILD_BUILD_TIMESTAMP if provided and otherwise falls back to the
default behaviour.
In commit f7b101d33046 ("kheaders: Move from proc to sysfs") it was
modified to use sysfs and the script for generation of the archive was
renamed to what is being patched.
Signed-off-by: Dmitry Goldin <dgoldin+lkml@protonmail.ch>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
nixos note: This patch is from
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/commit/?h=fixes&id=2cc99c9cdc8fde5e92e34f9655829449cebd3e00
I commented out the documentation part here, so that it easily applies
to linux 5.2 and 5.3, which does not ship with the reproducible build
documentation yet, which only was introduced recently.
---
Documentation/kbuild/reproducible-builds.rst | 13 +++++++++----
kernel/gen_kheaders.sh | 5 ++++-
2 files changed, 13 insertions(+), 5 deletions(-)
#diff --git a/Documentation/kbuild/reproducible-builds.rst b/Documentation/kbuild/reproducible-builds.rst
#index ab92e98c89c8..503393854e2e 100644
# --- a/Documentation/kbuild/reproducible-builds.rst
#+++ b/Documentation/kbuild/reproducible-builds.rst
#@@ -16,16 +16,21 @@ the kernel may be unreproducible, and how to avoid them.
# Timestamps
# ----------
#
#-The kernel embeds a timestamp in two places:
#+The kernel embeds timestamps in three places:
#
# * The version string exposed by ``uname()`` and included in
# ``/proc/version``
#
# * File timestamps in the embedded initramfs
#
#-By default the timestamp is the current time. This must be overridden
#-using the `KBUILD_BUILD_TIMESTAMP`_ variable. If you are building
#-from a git commit, you could use its commit date.
#+* If enabled via ``CONFIG_IKHEADERS``, file timestamps of kernel
#+ headers embedded in the kernel or respective module,
#+ exposed via ``/sys/kernel/kheaders.tar.xz``
#+
#+By default the timestamp is the current time and in the case of
#+``kheaders`` the various files' modification times. This must
#+be overridden using the `KBUILD_BUILD_TIMESTAMP`_ variable.
#+If you are building from a git commit, you could use its commit date.
#
# The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros,
# and enables warnings if they are used. If you incorporate external
diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh
index 9ff449888d9c..aff79e461fc9 100755
--- a/kernel/gen_kheaders.sh
+++ b/kernel/gen_kheaders.sh
@@ -71,7 +71,10 @@ done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1
find $cpio_dir -type f -print0 |
xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;'
-tar -Jcf $tarfile -C $cpio_dir/ . > /dev/null
+# Create archive and try to normalize metadata for reproducibility
+tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
+ --owner=0 --group=0 --sort=name --numeric-owner \
+ -Jcf $tarfile -C $cpio_dir/ . > /dev/null
echo "$src_files_md5" > kernel/kheaders.md5
echo "$obj_files_md5" >> kernel/kheaders.md5
--
cgit 1.2-0.3.lf.el7
+2 -2
View File
@@ -3,7 +3,7 @@
with stdenv.lib;
buildLinux (args // rec {
version = "4.14.146";
version = "4.14.148";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "1x9343pvlxdgx0zbsn12mcfhf6r8d9p57h6l5cw7krm3gs44pid3";
sha256 = "1b8ggknvaidsvqnzpgbcmz3ybys9a8jm8iq6aqcnqfp10d0bglhj";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -3,7 +3,7 @@
with stdenv.lib;
buildLinux (args // rec {
version = "4.19.76";
version = "4.19.78";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "0rhyjw5r3xdnj37dd6wrpihdqc3zn5ih6hcpa4x2cjvk0acx4kds";
sha256 = "0jah57k3q7b674dr544cniwhya667d8h7x9k5886d1g2qrvylqyz";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -1,11 +1,11 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args:
buildLinux (args // rec {
version = "4.4.194";
version = "4.4.196";
extraMeta.branch = "4.4";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "0kvlp2v4nvkilaanhpgwf8dkyfj24msaw0m38rbc4y51y69yhqvz";
sha256 = "0vd7fra22ky4sqp6vamracp5xd4900md5vdx0n4i6dhkf03kz7hn";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -1,11 +1,11 @@
{ stdenv, buildPackages, fetchurl, perl, buildLinux, ... } @ args:
buildLinux (args // rec {
version = "4.9.194";
version = "4.9.196";
extraMeta.branch = "4.9";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "1qy20vw5bhnsfbh95sdhjbk6y94js8m4ryd3m7xg2qg4hisvpx6m";
sha256 = "1vy6j9ycl5aw0dmj4n9kih5i8igybk0ilahlwbn30mlp9aq15az0";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -3,7 +3,7 @@
with stdenv.lib;
buildLinux (args // rec {
version = "5.2.18";
version = "5.2.20";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "0q6akmhcdj52lhvs5fjxrr25r0hyklh7115hg0zl0fcpdj30y2bd";
sha256 = "0sddasxka08c1qjhbd9w4z7rzprfly2i67q4iwppbldngi4y48di";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -3,7 +3,7 @@
with stdenv.lib;
buildLinux (args // rec {
version = "5.3.2";
version = "5.3.5";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStringsSep "." (take 3 (splitVersion "${version}.0")) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "0szw21mpp94gp3zn2fgllbv6fdjjf20njgrcjay7vjmm7farq7rn";
sha256 = "1w2k3q6q9cf3r27z084c9nsxh49bq4cvky39pp6dp3r9zif8rvc0";
};
} // (args.argsOverride or {}))
+2 -2
View File
@@ -49,8 +49,8 @@ lib.overrideDerivation (buildLinux (args // {
cp -v "$dtbDir/$1" "$dtbDir/$2"
}
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv6l-linux"]) ''
copyDTB bcm2708-rpi-0-w.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-0-w.dtb bcm2835-rpi-zero-w.dtb
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
@@ -1,13 +1,13 @@
{ stdenv, buildPackages, fetchgit, fetchpatch, perl, buildLinux, ... } @ args:
buildLinux (args // {
version = "5.2.2019.09.24";
version = "5.2.2019.10.01";
modDirVersion = "5.2.0";
src = fetchgit {
url = "https://evilpiepirate.org/git/bcachefs.git";
rev = "5a3a4087af27aa10da5f23cb174a439946153584";
sha256 = "1yn40n2iyflbfv1z8l86nixv8wlybg7abz49nq5k6hmf7r9z56mk";
rev = "45920b5139a752bb4f22871b8b916beacc4f9fb9";
sha256 = "1hi98jckzd8d7whivmgl1ywdfdixhq7la37jagwnwbf8lsqsp25i";
};
extraConfig = "BCACHEFS_FS m";
@@ -94,7 +94,9 @@ let
patches =
map (p: p.patch) kernelPatches
# Required for deterministic builds along with some postPatch magic.
++ optional (stdenv.lib.versionAtLeast version "4.13") ./randstruct-provide-seed.patch;
++ optional (stdenv.lib.versionAtLeast version "4.13") ./randstruct-provide-seed.patch
# Fixes determinism by normalizing metadata for the archive of kheaders
++ optional (stdenv.lib.versionAtLeast version "5.2") ./gen-kheaders-metadata.patch;
prePatch = ''
for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
+8 -2
View File
@@ -59,8 +59,14 @@
};
export_kernel_fpu_functions = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions.patch;
"4.14" = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions_4_14.patch;
};
"5.3" = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions_5_3.patch;
};
};
# patches from https://lkml.org/lkml/2019/7/15/1748