From d9b751a55b1b0d2b048d4387c80ce78fada867db Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Sat, 25 May 2019 16:08:30 -0700 Subject: Updated to 5.0.18.a Reorganized patches --- PKGBUILD | 40 ++++++++++++++++++--------------- bdver2-fix-for-graysky.patch | 11 ---------- ck_modify-for-hardened.patch | 44 +++++++++++++++++++++++++++++++++++++ ck_remove-excess-extraversion.patch | 18 +++++++++++++++ config.x86_64 | 2 +- graysky_bdver2-hotfix.patch | 11 ++++++++++ modify-ck-for-hardened.patch | 44 ------------------------------------- remove-excess-ck-extraversion.patch | 24 -------------------- 8 files changed, 96 insertions(+), 98 deletions(-) delete mode 100644 bdver2-fix-for-graysky.patch create mode 100644 ck_modify-for-hardened.patch create mode 100644 ck_remove-excess-extraversion.patch create mode 100644 graysky_bdver2-hotfix.patch delete mode 100644 modify-ck-for-hardened.patch delete mode 100644 remove-excess-ck-extraversion.patch diff --git a/PKGBUILD b/PKGBUILD index 8406055..4f19a3d 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,8 @@ # # I maintain this because: # Arch version patch script does not apply consistently -# Arch version lacks ath9k, bdver2, greysky2, and raid6 patches +# Arch version lacks graysky gcc patch with bdver2 fix +# Arch version lacks ath9k regdom and raid6 algo patches # Arch version lacks ck patches # Arch version allows SEED, SM3, SM4, and Streebog # Arch version is 300 Hz @@ -17,7 +18,7 @@ pkgbase=linux-hardened-ck _majver=5.0 -_minver=17 +_minver=18 if [ "$_minver" == "0" ]; then _pkgver=${_majver} else @@ -25,7 +26,7 @@ _minver=17 fi _hardenedver=a _ckpatchversion=1 -_ckpatch="patch-5.0-ck${_ckpatchversion}" +_ckpatch="patch-${_majver}-ck${_ckpatchversion}" _gcc_more_v='20180509' _srcname=linux-${_pkgver} pkgver=${_pkgver}.${_hardenedver} @@ -40,11 +41,11 @@ options=('!strip') source=( https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_pkgver.tar.{xz,sign} https://github.com/anthraxx/linux-hardened/releases/download/${pkgver}/linux-hardened-${pkgver}.patch{,.sig} - remove-excess-ck-extraversion.patch - modify-ck-for-hardened.patch + ck_remove-excess-extraversion.patch + ck_modify-for-hardened.patch http://ck.kolivas.org/patches/5.0/${_majver}/${_majver}-ck${_ckpatchversion}/${_ckpatch}.xz + graysky_bdver2-hotfix.patch enable_additional_cpu_optimizations-$_gcc_more_v.tar.gz::https://github.com/graysky2/kernel_gcc_patch/archive/$_gcc_more_v.tar.gz - bdver2-fix-for-graysky.patch ath9k-regdom-hack.patch raid6-default-algo.patch config.x86_64 # the main kernel config files @@ -52,18 +53,18 @@ source=( 90-linux.hook # pacman hook for initramfs regeneration linux.preset # standard config files for mkinitcpio ramdisk ) -sha256sums=('ab37029bdc9a4e3fc5dc2cc6f6e8f506a62fa42f68e50897c24fc9dbba789629' +sha256sums=('7fbd0b3d90a7a28a013f1e3f006c02235c12b41fd020460722a0b7c9936db0d8' 'SKIP' - '12a6c606905b4b425fc1e883e67cf5a0f28730fa4ae72637740ac98176b8aae6' + 'e9c0b0d389c166ea6f2c0e5d526d294a5fa39ddc04a6733c2aa2fd5c60962269' 'SKIP' - '2a551169f8cbb424900372fe698ae9003fbcad3614a46ca3f56b103f9c1ea763' + 'a2db6672b2d35f3006c7151e8fa90f5187dcdac9fcc46e88e78d45c7d8226d1f' 'b6defd1ef672b73631ecfa79fc204d6219175f333b53d86af668c1e1a9b6288e' '661f64bbd8bf49afcc7c760c4148b2e2108511a1eadcae917cfe6056a83d8476' + '229e063a578db0a278108f37b24da20c2a2a18d825e98a67e426cb0f4b492e4a' '226e30068ea0fecdb22f337391385701996bfbdba37cdcf0f1dbf55f1080542d' - 'd35338c92d0dbf27ffedaf100bd852dd13fd9b5d49b12a10b91194a2ae654447' 'e7ebf050c22bcec0028c0b3c79fd6d3913b0370ecc6a23dfe78ce475630cf503' '0f81d6e4158b7beeb0eb514f1b9401f7e23699cb0f7b0d513e25dae1815daaeb' - 'a0e2af5becc3b629d8be2bd917a8cac8449ec5c629707855b39f99b4774ae571' + '6e94ea91bb1e249bbe2485c6ebed420ddd844e6a1bf919b2486797dd8e656cc3' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65') @@ -92,23 +93,26 @@ prepare() { msg2 "Applying hardened patch" patch -Np1 < ../linux-hardened-${pkgver}.patch + # ck hotfixes msg2 "Applying ck patch hotfixes" - patch -p1 -i ../remove-excess-ck-extraversion.patch "$srcdir/${_ckpatch}" - patch -p1 -i ../modify-ck-for-hardened.patch "$srcdir/${_ckpatch}" + patch -p1 -i ../ck_remove-excess-extraversion.patch "$srcdir/${_ckpatch}" + patch -p1 -i ../ck_modify-for-hardened.patch "$srcdir/${_ckpatch}" sed -i '/-CFLAGS/ s/$/ \$(LIBELF_FLAGS)/' "$srcdir/${_ckpatch}" # ck patch msg2 "Applying ck patch" patch -F 3 -Np1 -i ../${_ckpatch} - # graysky2 gcc patch - msg2 "Applying graysky2 cpu patch" + + # graysky gcc hotfixes + msg2 "Applying graysky gcc patch hotfixes" + patch -p1 -i ../graysky_bdver2-hotfix.patch "$srcdir/kernel_gcc_patch-${_gcc_more_v}/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch" + + # graysky gcc patch + msg2 "Applying graysky cpu patch" patch -p1 -i ../kernel_gcc_patch-${_gcc_more_v}/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch - # Fix stack warnings and ldconfig segfaults on bdver2 with graysky2 gcc patch - msg2 "Applying bdver2 fix for graysky2 cpu patch" - patch -p1 -i ../bdver2-fix-for-graysky.patch # Ignore ath9k eeprom patch msg2 "Applying ath9k patch" diff --git a/bdver2-fix-for-graysky.patch b/bdver2-fix-for-graysky.patch deleted file mode 100644 index b7e5402..0000000 --- a/bdver2-fix-for-graysky.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/x86/Makefile -+++ b/arch/x86/Makefile -@@ -492,7 +492,7 @@ - cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1) - cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2) - cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1) -- cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) -+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) $(call cc-option,-mno-tbm) - cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3) - cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4) - cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1) diff --git a/ck_modify-for-hardened.patch b/ck_modify-for-hardened.patch new file mode 100644 index 0000000..c54860a --- /dev/null +++ b/ck_modify-for-hardened.patch @@ -0,0 +1,44 @@ +--- a/patch-5.0-ck1 ++++ b/patch-5.0-ck1 +@@ -16348,15 +16348,11 @@ + index ba4d9e85feb8..226771720139 100644 + --- a/kernel/sysctl.c + +++ b/kernel/sysctl.c +-@@ -127,9 +127,17 @@ static int __maybe_unused one = 1; +- static int __maybe_unused two = 2; +- static int __maybe_unused four = 4; +- static unsigned long one_ul = 1; +--static int one_hundred = 100; +--static int one_thousand = 1000; ++@@ -127,7 +127,15 @@ static int __maybe_unused four __read_only = 4; ++ static unsigned long one_ul __read_only = 1; ++ static int one_hundred __read_only = 100; ++ static int one_thousand __read_only = 1000; + -#ifdef CONFIG_PRINTK +-+static int __read_mostly one_hundred = 100; +-+static int __read_mostly one_thousand = 1000; + +#ifdef CONFIG_SCHED_MUQSS + +extern int rr_interval; + +extern int sched_interactive; +@@ -16366,7 +16362,7 @@ + +extern int hrtimer_granularity_us; + +extern int hrtimeout_min_us; + +#if defined(CONFIG_PRINTK) || defined(CONFIG_SCHED_MUQSS) +- static int ten_thousand = 10000; ++ static int ten_thousand __read_only = 10000; + #endif + #ifdef CONFIG_PERF_EVENTS + @@ -296,7 +304,7 @@ static struct ctl_table sysctl_base_table[] = { +@@ -16375,9 +16371,9 @@ + + -#ifdef CONFIG_SCHED_DEBUG + +#if defined(CONFIG_SCHED_DEBUG) && !defined(CONFIG_SCHED_MUQSS) +- static int min_sched_granularity_ns = 100000; /* 100 usecs */ +- static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ +- static int min_wakeup_granularity_ns; /* 0 usecs */ ++ static int min_sched_granularity_ns __read_only = 100000; /* 100 usecs */ ++ static int max_sched_granularity_ns __read_only = NSEC_PER_SEC; /* 1 second */ ++ static int min_wakeup_granularity_ns __read_only; /* 0 usecs */ + @@ -313,6 +321,7 @@ static int max_extfrag_threshold = 1000; + #endif + diff --git a/ck_remove-excess-extraversion.patch b/ck_remove-excess-extraversion.patch new file mode 100644 index 0000000..9182f31 --- /dev/null +++ b/ck_remove-excess-extraversion.patch @@ -0,0 +1,18 @@ +--- a/patch-5.1-ck1 ++++ b/patch-5.1-ck1 +@@ -833,15 +833,0 @@ +-diff --git a/Makefile b/Makefile +-index 26c92f892d24..e3325aecd55c 100644 +---- a/Makefile +-+++ b/Makefile +-@@ -15,6 +15,10 @@ NAME = Shy Crocodile +- PHONY := _all +- _all: +- +-+CKVERSION = -ck1 +-+CKNAME = MuQSS Powered +-+EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION) +-+ +- # We are using a recursive build, so we need to do a little thinking +- # to get the ordering right. +- # diff --git a/config.x86_64 b/config.x86_64 index 3f9b06c..3c2203a 100644 --- a/config.x86_64 +++ b/config.x86_64 @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/x86 5.0.17 Kernel Configuration +# Linux/x86 5.0.18 Kernel Configuration # # diff --git a/graysky_bdver2-hotfix.patch b/graysky_bdver2-hotfix.patch new file mode 100644 index 0000000..5cd9dbc --- /dev/null +++ b/graysky_bdver2-hotfix.patch @@ -0,0 +1,11 @@ +--- a/kernel_gcc_patch-20180509/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch ++++ b/kernel_gcc_patch-20180509/enable_additional_cpu_optimizations_for_gcc_v8.1+_kernel_v4.13+.patch +@@ -492,7 +492,7 @@ + cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona) + + cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1) + + cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2) + + cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1) +-+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) +++ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2) $(call cc-option,-mno-tbm) + + cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3) + + cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4) + + cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1) diff --git a/modify-ck-for-hardened.patch b/modify-ck-for-hardened.patch deleted file mode 100644 index c54860a..0000000 --- a/modify-ck-for-hardened.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/patch-5.0-ck1 -+++ b/patch-5.0-ck1 -@@ -16348,15 +16348,11 @@ - index ba4d9e85feb8..226771720139 100644 - --- a/kernel/sysctl.c - +++ b/kernel/sysctl.c --@@ -127,9 +127,17 @@ static int __maybe_unused one = 1; -- static int __maybe_unused two = 2; -- static int __maybe_unused four = 4; -- static unsigned long one_ul = 1; ---static int one_hundred = 100; ---static int one_thousand = 1000; -+@@ -127,7 +127,15 @@ static int __maybe_unused four __read_only = 4; -+ static unsigned long one_ul __read_only = 1; -+ static int one_hundred __read_only = 100; -+ static int one_thousand __read_only = 1000; - -#ifdef CONFIG_PRINTK --+static int __read_mostly one_hundred = 100; --+static int __read_mostly one_thousand = 1000; - +#ifdef CONFIG_SCHED_MUQSS - +extern int rr_interval; - +extern int sched_interactive; -@@ -16366,7 +16362,7 @@ - +extern int hrtimer_granularity_us; - +extern int hrtimeout_min_us; - +#if defined(CONFIG_PRINTK) || defined(CONFIG_SCHED_MUQSS) -- static int ten_thousand = 10000; -+ static int ten_thousand __read_only = 10000; - #endif - #ifdef CONFIG_PERF_EVENTS - @@ -296,7 +304,7 @@ static struct ctl_table sysctl_base_table[] = { -@@ -16375,9 +16371,9 @@ - - -#ifdef CONFIG_SCHED_DEBUG - +#if defined(CONFIG_SCHED_DEBUG) && !defined(CONFIG_SCHED_MUQSS) -- static int min_sched_granularity_ns = 100000; /* 100 usecs */ -- static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ -- static int min_wakeup_granularity_ns; /* 0 usecs */ -+ static int min_sched_granularity_ns __read_only = 100000; /* 100 usecs */ -+ static int max_sched_granularity_ns __read_only = NSEC_PER_SEC; /* 1 second */ -+ static int min_wakeup_granularity_ns __read_only; /* 0 usecs */ - @@ -313,6 +321,7 @@ static int max_extfrag_threshold = 1000; - #endif - diff --git a/remove-excess-ck-extraversion.patch b/remove-excess-ck-extraversion.patch deleted file mode 100644 index 4e751e5..0000000 --- a/remove-excess-ck-extraversion.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/patch-5.0-ck1 -+++ b/patch-5.0-ck1 -@@ -833,21 +833,6 @@ - + 2: Expire timeslice and recalculate deadline. - + - +============================================================== --diff --git a/Makefile b/Makefile --index d5713e7b1e50..3ee4f3805466 100644 ----- a/Makefile --+++ b/Makefile --@@ -15,6 +15,10 @@ NAME = Shy Crocodile -- PHONY := _all -- _all: -- --+CKVERSION = -ck1 --+CKNAME = MuQSS Powered --+EXTRAVERSION := $(EXTRAVERSION)$(CKVERSION) --+ -- # Do not use make's built-in rules and variables -- # (this increases performance and avoids hard-to-debug behaviour) -- MAKEFLAGS += -rR - diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig - index 584a6e114853..2d497c3710f2 100644 - --- a/arch/alpha/Kconfig -- cgit v1.2.1