From 574951475cda65ca7dd634ba6d6ddeee58596c35 Mon Sep 17 00:00:00 2001 From: David P Date: Wed, 22 Jun 2022 17:37:44 -0400 Subject: updpkg: libre/linux-libre 5.18.5-1 Signed-off-by: David P --- ...ctl-and-CONFIG-to-disallow-unprivileged-C.patch | 22 +- ...roperly-handle-function-keys-on-Keychron-.patch | 107 +++ ...t-bootloader-trust-toggle-the-same-way-as.patch | 94 --- ...-tick-Detect-and-fix-jiffies-update-stall.patch | 86 -- ...-Remove-obsolete-rcu_needs_cpu-parameters.patch | 101 --- ...ick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch | 119 --- ...l-Declare-IRQ_POLL-softirq-vector-as-ksof.patch | 55 -- ...vide-mount-option-to-toggle-trunking-disc.patch | 81 -- libre/linux-libre/PKGBUILD | 37 +- libre/linux-libre/config.i686 | 939 +++++++++++++-------- libre/linux-libre/config.x86_64 | 845 ++++++++++-------- 11 files changed, 1217 insertions(+), 1269 deletions(-) create mode 100644 libre/linux-libre/0002-HID-apple-Properly-handle-function-keys-on-Keychron-.patch delete mode 100644 libre/linux-libre/0002-random-treat-bootloader-trust-toggle-the-same-way-as.patch delete mode 100644 libre/linux-libre/0003-tick-Detect-and-fix-jiffies-update-stall.patch delete mode 100644 libre/linux-libre/0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch delete mode 100644 libre/linux-libre/0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch delete mode 100644 libre/linux-libre/0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch delete mode 100644 libre/linux-libre/0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.patch diff --git a/libre/linux-libre/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/libre/linux-libre/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch index 2727486e4..a1c62dc7f 100644 --- a/libre/linux-libre/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch +++ b/libre/linux-libre/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -1,7 +1,7 @@ -From e9ff9783ac7b7111552f54608d730df42e5e99d2 Mon Sep 17 00:00:00 2001 +From 9baf57b4c2d9348bd5adecbb893870d1d79fade1 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 16 Sep 2019 04:53:20 +0200 -Subject: [PATCH 1/7] ZEN: Add sysctl and CONFIG to disallow unprivileged +Subject: [PATCH 1/2] ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER Our default behavior continues to match the vanilla kernel. @@ -36,10 +36,10 @@ index 33a4240e6a6f..82213f9c4c17 100644 { return &init_user_ns; diff --git a/init/Kconfig b/init/Kconfig -index e9119bf54b1f..a1a5a68aea07 100644 +index b19e2eeaae80..2c2e01d76076 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1231,6 +1231,22 @@ config USER_NS +@@ -1240,6 +1240,22 @@ config USER_NS If unsure, say N. @@ -63,12 +63,12 @@ index e9119bf54b1f..a1a5a68aea07 100644 bool "PID Namespaces" default y diff --git a/kernel/fork.c b/kernel/fork.c -index f1e89007f228..49144b49a3d1 100644 +index 0d8abfb9e0f4..bd7c215e315f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -98,6 +98,10 @@ - #include +@@ -99,6 +99,10 @@ #include + #include +#ifdef CONFIG_USER_NS +#include @@ -77,7 +77,7 @@ index f1e89007f228..49144b49a3d1 100644 #include #include #include -@@ -1922,6 +1926,10 @@ static __latent_entropy struct task_struct *copy_process( +@@ -1992,6 +1996,10 @@ static __latent_entropy struct task_struct *copy_process( if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) return ERR_PTR(-EINVAL); @@ -88,7 +88,7 @@ index f1e89007f228..49144b49a3d1 100644 /* * Thread groups must share signals as well, and detached threads * can only be started up within the thread group. -@@ -3036,6 +3044,12 @@ int ksys_unshare(unsigned long unshare_flags) +@@ -3128,6 +3136,12 @@ int ksys_unshare(unsigned long unshare_flags) if (unshare_flags & CLONE_NEWNS) unshare_flags |= CLONE_FS; @@ -102,7 +102,7 @@ index f1e89007f228..49144b49a3d1 100644 if (err) goto bad_unshare_out; diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 730ab56d9e92..6cf4e5c36ec9 100644 +index 830aaf8ca08e..af4c0806bd8e 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -91,6 +91,9 @@ @@ -115,7 +115,7 @@ index 730ab56d9e92..6cf4e5c36ec9 100644 #if defined(CONFIG_SYSCTL) -@@ -1814,6 +1817,15 @@ static struct ctl_table kern_table[] = { +@@ -1803,6 +1806,15 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, diff --git a/libre/linux-libre/0002-HID-apple-Properly-handle-function-keys-on-Keychron-.patch b/libre/linux-libre/0002-HID-apple-Properly-handle-function-keys-on-Keychron-.patch new file mode 100644 index 000000000..4d36e40fb --- /dev/null +++ b/libre/linux-libre/0002-HID-apple-Properly-handle-function-keys-on-Keychron-.patch @@ -0,0 +1,107 @@ +From e410435c977a01e386fda83b5215540365a0086f Mon Sep 17 00:00:00 2001 +From: Bryan Cain +Date: Thu, 5 May 2022 13:12:21 -0600 +Subject: [PATCH 2/2] HID: apple: Properly handle function keys on Keychron + keyboards +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Keychron's C-series and K-series of keyboards copy the vendor and +product IDs of an Apple keyboard, but only behave like that device when +set to "Mac" mode. In "Windows" mode, the Fn key doesn't generate a +scancode, so it's impossible to use the F1-F12 keys when fnmode is set +to its default value of 1. + +To fix this, make fnmode default to the new value of 3, which behaves +like fnmode=2 for Keychron keyboards and like fnmode=1 for actual Apple +keyboards. This way, Keychron devices are fully usable in both "Windows" +and "Mac" modes, while behavior is unchanged for everything else. + +Signed-off-by: Bryan Cain +Reviewed-by: Hans de Goede +Tested-by: José Expósito +Signed-off-by: Jiri Kosina +--- + drivers/hid/hid-apple.c | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c +index 0cf35caee9fa..42a568902f49 100644 +--- a/drivers/hid/hid-apple.c ++++ b/drivers/hid/hid-apple.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "hid-ids.h" + +@@ -35,16 +36,17 @@ + #define APPLE_NUMLOCK_EMULATION BIT(8) + #define APPLE_RDESC_BATTERY BIT(9) + #define APPLE_BACKLIGHT_CTL BIT(10) ++#define APPLE_IS_KEYCHRON BIT(11) + + #define APPLE_FLAG_FKEY 0x01 + + #define HID_COUNTRY_INTERNATIONAL_ISO 13 + #define APPLE_BATTERY_TIMEOUT_MS 60000 + +-static unsigned int fnmode = 1; ++static unsigned int fnmode = 3; + module_param(fnmode, uint, 0644); + MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, " +- "[1] = fkeyslast, 2 = fkeysfirst)"); ++ "1 = fkeyslast, 2 = fkeysfirst, [3] = auto)"); + + static int iso_layout = -1; + module_param(iso_layout, int, 0644); +@@ -349,6 +351,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, + const struct apple_key_translation *trans, *table; + bool do_translate; + u16 code = 0; ++ unsigned int real_fnmode; + + u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN); + +@@ -359,7 +362,13 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, + return 1; + } + +- if (fnmode) { ++ if (fnmode == 3) { ++ real_fnmode = (asc->quirks & APPLE_IS_KEYCHRON) ? 2 : 1; ++ } else { ++ real_fnmode = fnmode; ++ } ++ ++ if (real_fnmode) { + if (hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI || + hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO || + hid->product == USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS || +@@ -406,7 +415,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, + + if (!code) { + if (trans->flags & APPLE_FLAG_FKEY) { +- switch (fnmode) { ++ switch (real_fnmode) { + case 1: + do_translate = !asc->fn_on; + break; +@@ -660,6 +669,11 @@ static int apple_input_configured(struct hid_device *hdev, + asc->quirks &= ~APPLE_HAS_FN; + } + ++ if (strncmp(hdev->name, "Keychron", 8) == 0) { ++ hid_info(hdev, "Keychron keyboard detected; function keys will default to fnmode=2 behavior\n"); ++ asc->quirks |= APPLE_IS_KEYCHRON; ++ } ++ + return 0; + } + +-- +2.36.1 + diff --git a/libre/linux-libre/0002-random-treat-bootloader-trust-toggle-the-same-way-as.patch b/libre/linux-libre/0002-random-treat-bootloader-trust-toggle-the-same-way-as.patch deleted file mode 100644 index 38c3d217a..000000000 --- a/libre/linux-libre/0002-random-treat-bootloader-trust-toggle-the-same-way-as.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 00903d94f8ef47f1da2f87c31e32753c36a1911a Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Wed, 23 Mar 2022 23:09:30 -0600 -Subject: [PATCH 2/7] random: treat bootloader trust toggle the same way as cpu - trust toggle - -If CONFIG_RANDOM_TRUST_CPU is set, the RNG initializes using RDRAND. -But, the user can disable (or enable) this behavior by setting -`random.trust_cpu=0/1` on the kernel command line. This allows system -builders to do reasonable things while avoiding howls from tinfoil -hatters. (Or vice versa.) - -CONFIG_RANDOM_TRUST_BOOTLOADER is basically the same thing, but regards -the seed passed via EFI or device tree, which might come from RDRAND or -a TPM or somewhere else. In order to allow distros to more easily enable -this while avoiding those same howls (or vice versa), this commit adds -the corresponding `random.trust_bootloader=0/1` toggle. - -Cc: Theodore Ts'o -Cc: Graham Christensen -Reviewed-by: Ard Biesheuvel -Reviewed-by: Dominik Brodowski -Link: https://github.com/NixOS/nixpkgs/pull/165355 -Signed-off-by: Jason A. Donenfeld ---- - Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ - drivers/char/Kconfig | 3 ++- - drivers/char/random.c | 8 +++++++- - 3 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt -index 59f881f36779..bdc733c2561d 100644 ---- a/Documentation/admin-guide/kernel-parameters.txt -+++ b/Documentation/admin-guide/kernel-parameters.txt -@@ -4355,6 +4355,12 @@ - fully seed the kernel's CRNG. Default is controlled - by CONFIG_RANDOM_TRUST_CPU. - -+ random.trust_bootloader={on,off} -+ [KNL] Enable or disable trusting the use of the -+ a seed passed by the bootloader (if available) to -+ fully seed the kernel's CRNG. Default is controlled -+ by CONFIG_RANDOM_TRUST_BOOTLOADER. -+ - randomize_kstack_offset= - [KNL] Enable or disable kernel stack offset - randomization, which provides roughly 5 bits of -diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 740811893c57..55f48375e3fe 100644 ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -449,6 +449,7 @@ config RANDOM_TRUST_BOOTLOADER - device randomness. Say Y here to assume the entropy provided by the - booloader is trustworthy so it will be added to the kernel's entropy - pool. Otherwise, say N here so it will be regarded as device input that -- only mixes the entropy pool. -+ only mixes the entropy pool. This can also be configured at boot with -+ "random.trust_bootloader=on/off". - - endmenu -diff --git a/drivers/char/random.c b/drivers/char/random.c -index 3404a91edf29..19bf14e253f7 100644 ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -738,11 +738,17 @@ static void invalidate_batched_entropy(void); - static void numa_crng_init(void); - - static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); -+static bool trust_bootloader __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER); - static int __init parse_trust_cpu(char *arg) - { - return kstrtobool(arg, &trust_cpu); - } -+static int __init parse_trust_bootloader(char *arg) -+{ -+ return kstrtobool(arg, &trust_bootloader); -+} - early_param("random.trust_cpu", parse_trust_cpu); -+early_param("random.trust_bootloader", parse_trust_bootloader); - - static bool crng_init_try_arch(struct crng_state *crng) - { -@@ -2229,7 +2235,7 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness); - */ - void add_bootloader_randomness(const void *buf, unsigned int size) - { -- if (IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER)) -+ if (trust_bootloader) - add_hwgenerator_randomness(buf, size, size * 8); - else - add_device_randomness(buf, size); --- -2.36.1 - diff --git a/libre/linux-libre/0003-tick-Detect-and-fix-jiffies-update-stall.patch b/libre/linux-libre/0003-tick-Detect-and-fix-jiffies-update-stall.patch deleted file mode 100644 index b0962dc75..000000000 --- a/libre/linux-libre/0003-tick-Detect-and-fix-jiffies-update-stall.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 725479ba08eb2f1da6eec1b23852c1c70e002ed1 Mon Sep 17 00:00:00 2001 -From: Frederic Weisbecker -Date: Wed, 2 Feb 2022 01:01:07 +0100 -Subject: [PATCH 3/7] tick: Detect and fix jiffies update stall - -On some rare cases, the timekeeper CPU may be delaying its jiffies -update duty for a while. Known causes include: - -* The timekeeper is waiting on stop_machine in a MULTI_STOP_DISABLE_IRQ - or MULTI_STOP_RUN state. Disabled interrupts prevent from timekeeping - updates while waiting for the target CPU to complete its - stop_machine() callback. - -* The timekeeper vcpu has VMEXIT'ed for a long while due to some overload - on the host. - -Detect and fix these situations with emergency timekeeping catchups. - -Original-patch-by: Paul E. McKenney -Signed-off-by: Frederic Weisbecker -Cc: Thomas Gleixner ---- - kernel/time/tick-sched.c | 17 +++++++++++++++++ - kernel/time/tick-sched.h | 4 ++++ - 2 files changed, 21 insertions(+) - -diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 5e80ee44c32a..0578c9301b17 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -169,6 +169,8 @@ static ktime_t tick_init_jiffy_update(void) - return period; - } - -+#define MAX_STALLED_JIFFIES 5 -+ - static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now) - { - int cpu = smp_processor_id(); -@@ -196,6 +198,21 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now) - if (tick_do_timer_cpu == cpu) - tick_do_update_jiffies64(now); - -+ /* -+ * If jiffies update stalled for too long (timekeeper in stop_machine() -+ * or VMEXIT'ed for several msecs), force an update. -+ */ -+ if (ts->last_tick_jiffies != jiffies) { -+ ts->stalled_jiffies = 0; -+ ts->last_tick_jiffies = READ_ONCE(jiffies); -+ } else { -+ if (++ts->stalled_jiffies == MAX_STALLED_JIFFIES) { -+ tick_do_update_jiffies64(now); -+ ts->stalled_jiffies = 0; -+ ts->last_tick_jiffies = READ_ONCE(jiffies); -+ } -+ } -+ - if (ts->inidle) - ts->got_idle_tick = 1; - } -diff --git a/kernel/time/tick-sched.h b/kernel/time/tick-sched.h -index d952ae393423..504649513399 100644 ---- a/kernel/time/tick-sched.h -+++ b/kernel/time/tick-sched.h -@@ -49,6 +49,8 @@ enum tick_nohz_mode { - * @timer_expires_base: Base time clock monotonic for @timer_expires - * @next_timer: Expiry time of next expiring timer for debugging purpose only - * @tick_dep_mask: Tick dependency mask - is set, if someone needs the tick -+ * @last_tick_jiffies: Value of jiffies seen on last tick -+ * @stalled_jiffies: Number of stalled jiffies detected across ticks - */ - struct tick_sched { - struct hrtimer sched_timer; -@@ -77,6 +79,8 @@ struct tick_sched { - u64 next_timer; - ktime_t idle_expires; - atomic_t tick_dep_mask; -+ unsigned long last_tick_jiffies; -+ unsigned int stalled_jiffies; - }; - - extern struct tick_sched *tick_get_tick_sched(int cpu); --- -2.36.1 - diff --git a/libre/linux-libre/0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch b/libre/linux-libre/0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch deleted file mode 100644 index f4b878cd7..000000000 --- a/libre/linux-libre/0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch +++ /dev/null @@ -1,101 +0,0 @@ -From f70a9a8cdb921524c618ea0e703856c96f9fec40 Mon Sep 17 00:00:00 2001 -From: Frederic Weisbecker -Date: Tue, 8 Feb 2022 17:16:33 +0100 -Subject: [PATCH 4/7] tick/rcu: Remove obsolete rcu_needs_cpu() parameters - -With the removal of CONFIG_RCU_FAST_NO_HZ, the parameters in -rcu_needs_cpu() are not necessary anymore. Simply remove them. - -Signed-off-by: Frederic Weisbecker -Cc: Thomas Gleixner -Cc: Peter Zijlstra -Cc: Paul E. McKenney -Cc: Paul Menzel ---- - include/linux/rcutiny.h | 3 +-- - include/linux/rcutree.h | 2 +- - kernel/rcu/tree.c | 3 +-- - kernel/time/tick-sched.c | 10 ++++------ - 4 files changed, 7 insertions(+), 11 deletions(-) - -diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h -index 858f4d429946..5fed476f977f 100644 ---- a/include/linux/rcutiny.h -+++ b/include/linux/rcutiny.h -@@ -64,9 +64,8 @@ static inline void rcu_softirq_qs(void) - rcu_tasks_qs(current, (preempt)); \ - } while (0) - --static inline int rcu_needs_cpu(u64 basemono, u64 *nextevt) -+static inline int rcu_needs_cpu(void) - { -- *nextevt = KTIME_MAX; - return 0; - } - -diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h -index 53209d669400..6cc91291d078 100644 ---- a/include/linux/rcutree.h -+++ b/include/linux/rcutree.h -@@ -19,7 +19,7 @@ - - void rcu_softirq_qs(void); - void rcu_note_context_switch(bool preempt); --int rcu_needs_cpu(u64 basem, u64 *nextevt); -+int rcu_needs_cpu(void); - void rcu_cpu_stall_reset(void); - - /* -diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c -index 73a4c9d07b86..5dae0da879ae 100644 ---- a/kernel/rcu/tree.c -+++ b/kernel/rcu/tree.c -@@ -1086,9 +1086,8 @@ void rcu_irq_enter_irqson(void) - * Just check whether or not this CPU has non-offloaded RCU callbacks - * queued. - */ --int rcu_needs_cpu(u64 basemono, u64 *nextevt) -+int rcu_needs_cpu(void) - { -- *nextevt = KTIME_MAX; - return !rcu_segcblist_empty(&this_cpu_ptr(&rcu_data)->cblist) && - !rcu_rdp_is_offloaded(this_cpu_ptr(&rcu_data)); - } -diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 0578c9301b17..4c62fa0f70f1 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -785,7 +785,7 @@ static inline bool local_timer_softirq_pending(void) - - static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) - { -- u64 basemono, next_tick, next_tmr, next_rcu, delta, expires; -+ u64 basemono, next_tick, delta, expires; - unsigned long basejiff; - unsigned int seq; - -@@ -808,7 +808,7 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) - * minimal delta which brings us back to this place - * immediately. Lather, rinse and repeat... - */ -- if (rcu_needs_cpu(basemono, &next_rcu) || arch_needs_cpu() || -+ if (rcu_needs_cpu() || arch_needs_cpu() || - irq_work_needs_cpu() || local_timer_softirq_pending()) { - next_tick = basemono + TICK_NSEC; - } else { -@@ -819,10 +819,8 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) - * disabled this also looks at the next expiring - * hrtimer. - */ -- next_tmr = get_next_timer_interrupt(basejiff, basemono); -- ts->next_timer = next_tmr; -- /* Take the next rcu event into account */ -- next_tick = next_rcu < next_tmr ? next_rcu : next_tmr; -+ next_tick = get_next_timer_interrupt(basejiff, basemono); -+ ts->next_timer = next_tick; - } - - /* --- -2.36.1 - diff --git a/libre/linux-libre/0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch b/libre/linux-libre/0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch deleted file mode 100644 index 7d67087ac..000000000 --- a/libre/linux-libre/0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch +++ /dev/null @@ -1,119 +0,0 @@ -From e4bc9f7cc85243a32f100925bde5f48c23bfe1de Mon Sep 17 00:00:00 2001 -From: Frederic Weisbecker -Date: Tue, 8 Feb 2022 17:16:34 +0100 -Subject: [PATCH 5/7] tick/rcu: Stop allowing RCU_SOFTIRQ in idle - -RCU_SOFTIRQ used to be special in that it could be raised on purpose -within the idle path to prevent from stopping the tick. Some code still -prevents from unnecessary warnings related to this specific behaviour -while entering in dynticks-idle mode. - -However the nohz layout has changed quite a bit in ten years, and the -removal of CONFIG_RCU_FAST_NO_HZ has been the final straw to this -safe-conduct. Now the RCU_SOFTIRQ vector is expected to be raised from -sane places. - -A remaining corner case is admitted though when the vector is invoked -in fragile hotplug path. - -Signed-off-by: Frederic Weisbecker -Cc: Thomas Gleixner -Cc: Peter Zijlstra -Cc: Paul E. McKenney -Cc: Paul Menzel ---- - include/linux/interrupt.h | 8 ++++++- - kernel/time/tick-sched.c | 50 +++++++++++++++++++++++++++++++-------- - 2 files changed, 47 insertions(+), 11 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 9367f1cb2e3c..9613326d2f8a 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -579,7 +579,13 @@ enum - NR_SOFTIRQS - }; - --#define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ)) -+/* -+ * Ignoring the RCU vector after ksoftirqd is parked is fine -+ * because: -+ * 1) rcutree_migrate_callbacks() takes care of the queue. -+ * 2) rcu_report_dead() reports the final quiescent states. -+ */ -+#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(RCU_SOFTIRQ)) - - /* map softirq index to softirq name. update 'softirq_to_name' in - * kernel/softirq.c when adding a new softirq. -diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 4c62fa0f70f1..3506f6ed790c 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -999,6 +999,45 @@ static void tick_nohz_full_update_tick(struct tick_sched *ts) - __tick_nohz_full_update_tick(ts, ktime_get()); - } - -+/* -+ * A pending softirq outside an IRQ (or softirq disabled section) context -+ * should be waiting for ksoftirqd to handle it. Therefore we shouldn't -+ * reach here due to the need_resched() early check in can_stop_idle_tick(). -+ * -+ * However if we are between CPUHP_AP_SMPBOOT_THREADS and CPU_TEARDOWN_CPU on the -+ * cpu_down() process, softirqs can still be raised while ksoftirqd is parked, -+ * triggering the below since wakep_softirqd() is ignored. -+ * -+ */ -+static bool report_idle_softirq(void) -+{ -+ static int ratelimit; -+ unsigned int pending = local_softirq_pending(); -+ -+ if (likely(!pending)) -+ return false; -+ -+ /* Some softirqs claim to be safe against hotplug and ksoftirqd parking */ -+ if (!cpu_active(smp_processor_id())) { -+ pending &= ~SOFTIRQ_HOTPLUG_SAFE_MASK; -+ if (!pending) -+ return false; -+ } -+ -+ if (ratelimit < 10) -+ return false; -+ -+ /* On RT, softirqs handling may be waiting on some lock */ -+ if (!local_bh_blocked()) -+ return false; -+ -+ pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n", -+ pending); -+ ratelimit++; -+ -+ return true; -+} -+ - static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) - { - /* -@@ -1025,17 +1064,8 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) - if (need_resched()) - return false; - -- if (unlikely(local_softirq_pending())) { -- static int ratelimit; -- -- if (ratelimit < 10 && !local_bh_blocked() && -- (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { -- pr_warn("NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #%02x!!!\n", -- (unsigned int) local_softirq_pending()); -- ratelimit++; -- } -+ if (unlikely(report_idle_softirq())) - return false; -- } - - if (tick_nohz_full_enabled()) { - /* --- -2.36.1 - diff --git a/libre/linux-libre/0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch b/libre/linux-libre/0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch deleted file mode 100644 index 35eb4607c..000000000 --- a/libre/linux-libre/0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 8c66e21dcb22e21cca0c1d765a9305ab0bad9855 Mon Sep 17 00:00:00 2001 -From: Frederic Weisbecker -Date: Tue, 8 Feb 2022 17:16:35 +0100 -Subject: [PATCH 6/7] lib/irq_poll: Declare IRQ_POLL softirq vector as - ksoftirqd-parking safe - -The following warning may appear while setting a CPU down: - - NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #20!!! - -The IRQ_POLL_SOFTIRQ vector can be raised during the hotplug cpu_down() -path after ksoftirqd is parked and before the CPU actually dies. However -this is handled afterward at the CPUHP_IRQ_POLL_DEAD stage where the -queue gets migrated. - -Hence this warning can be considered spurious and the vector can join -the "hotplug-safe" list. - -Reported-and-tested-by: Paul Menzel -Signed-off-by: Frederic Weisbecker -Cc: Thomas Gleixner -Cc: Peter Zijlstra -Cc: Paul E. McKenney -Cc: Paul Menzel ---- - include/linux/interrupt.h | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 9613326d2f8a..f40754caaefa 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -580,12 +580,15 @@ enum - }; - - /* -- * Ignoring the RCU vector after ksoftirqd is parked is fine -- * because: -- * 1) rcutree_migrate_callbacks() takes care of the queue. -+ * The following vectors can be safely ignored after ksoftirqd is parked: -+ * -+ * _ RCU: -+ * 1) rcutree_migrate_callbacks() migrates the queue. - * 2) rcu_report_dead() reports the final quiescent states. -+ * -+ * _ IRQ_POLL: irq_poll_cpu_dead() migrates the queue - */ --#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(RCU_SOFTIRQ)) -+#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(RCU_SOFTIRQ) | BIT(IRQ_POLL_SOFTIRQ)) - - /* map softirq index to softirq name. update 'softirq_to_name' in - * kernel/softirq.c when adding a new softirq. --- -2.36.1 - diff --git a/libre/linux-libre/0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.patch b/libre/linux-libre/0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.patch deleted file mode 100644 index 70a2c1435..000000000 --- a/libre/linux-libre/0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 2753466eb2227d33f26b10a3b65924c1b94217c7 Mon Sep 17 00:00:00 2001 -From: Olga Kornievskaia -Date: Wed, 16 Mar 2022 18:24:26 -0400 -Subject: [PATCH 7/7] NFSv4.1 provide mount option to toggle trunking discovery - -Introduce a new mount option -- trunkdiscovery,notrunkdiscovery -- to -toggle whether or not the client will engage in actively discovery -of trunking locations. - -v2 make notrunkdiscovery default - -Signed-off-by: Olga Kornievskaia -Cherry-picked-for: https://bugs.archlinux.org/task/74272 ---- - fs/nfs/client.c | 3 ++- - fs/nfs/fs_context.c | 8 ++++++++ - include/linux/nfs_fs_sb.h | 1 + - 3 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/fs/nfs/client.c b/fs/nfs/client.c -index d1f34229e11a..e828504cc396 100644 ---- a/fs/nfs/client.c -+++ b/fs/nfs/client.c -@@ -857,7 +857,8 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str - } - - if (clp->rpc_ops->discover_trunking != NULL && -- (server->caps & NFS_CAP_FS_LOCATIONS)) { -+ (server->caps & NFS_CAP_FS_LOCATIONS && -+ (server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) { - error = clp->rpc_ops->discover_trunking(server, mntfh); - if (error < 0) - return error; -diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c -index ea17fa1f31ec..e2d59bb5e6bb 100644 ---- a/fs/nfs/fs_context.c -+++ b/fs/nfs/fs_context.c -@@ -80,6 +80,7 @@ enum nfs_param { - Opt_source, - Opt_tcp, - Opt_timeo, -+ Opt_trunkdiscovery, - Opt_udp, - Opt_v, - Opt_vers, -@@ -180,6 +181,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = { - fsparam_string("source", Opt_source), - fsparam_flag ("tcp", Opt_tcp), - fsparam_u32 ("timeo", Opt_timeo), -+ fsparam_flag_no("trunkdiscovery", Opt_trunkdiscovery), - fsparam_flag ("udp", Opt_udp), - fsparam_flag ("v2", Opt_v), - fsparam_flag ("v3", Opt_v), -@@ -529,6 +531,12 @@ static int nfs_fs_context_parse_param(struct fs_context *fc, - else - ctx->flags &= ~NFS_MOUNT_NOCTO; - break; -+ case Opt_trunkdiscovery: -+ if (result.negated) -+ ctx->flags &= ~NFS_MOUNT_TRUNK_DISCOVERY; -+ else -+ ctx->flags |= NFS_MOUNT_TRUNK_DISCOVERY; -+ break; - case Opt_ac: - if (result.negated) - ctx->flags |= NFS_MOUNT_NOAC; -diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h -index ca0959e51e81..b0e3fd550122 100644 ---- a/include/linux/nfs_fs_sb.h -+++ b/include/linux/nfs_fs_sb.h -@@ -151,6 +151,7 @@ struct nfs_server { - #define NFS_MOUNT_SOFTREVAL 0x800000 - #define NFS_MOUNT_WRITE_EAGER 0x01000000 - #define NFS_MOUNT_WRITE_WAIT 0x02000000 -+#define NFS_MOUNT_TRUNK_DISCOVERY 0x04000000 - - unsigned int fattr_valid; /* Valid attributes */ - unsigned int caps; /* server capabilities */ --- -2.36.1 - diff --git a/libre/linux-libre/PKGBUILD b/libre/linux-libre/PKGBUILD index f6ad95b3a..06574adaf 100644 --- a/libre/linux-libre/PKGBUILD +++ b/libre/linux-libre/PKGBUILD @@ -14,11 +14,11 @@ _replacesoldkernels=() # '%' gets replaced with kernel suffix _replacesoldmodules=() # '%' gets replaced with kernel suffix pkgbase=linux-libre -pkgver=5.17.8 +pkgver=5.18.5 pkgrel=1 pkgdesc='Linux-libre' -rcnver=5.17.3 -rcnrel=armv7-x9 +rcnver=5.18.2 +rcnrel=armv7-x6 url='https://linux-libre.fsfla.org/' arch=(i686 x86_64 armv7h) license=(GPL2) @@ -26,10 +26,9 @@ makedepends=( bc libelf pahole cpio perl tar xz xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick texlive-latexextra ) -makedepends=( ${makedepends[*]/git/} ) makedepends_armv7h=(uboot-tools vboot-utils dtc) # required by linux-libre-chromebook options=('!strip') -_srcname=linux-5.17 +_srcname=linux-5.18 source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcname##*-}-gnu/linux-libre-${_srcname##*-}-gnu.tar.xz"{,.sign} "https://linux-libre.fsfla.org/pub/linux-libre/releases/$pkgver-gnu/patch-${_srcname##*-}-gnu-$pkgver-gnu.xz"{,.sign} @@ -47,12 +46,7 @@ source=( 0002-fix-Atmel-maXTouch-touchscreen-support.patch # Arch Linux patches 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch - 0002-random-treat-bootloader-trust-toggle-the-same-way-as.patch - 0003-tick-Detect-and-fix-jiffies-update-stall.patch - 0004-tick-rcu-Remove-obsolete-rcu_needs_cpu-parameters.patch - 0005-tick-rcu-Stop-allowing-RCU_SOFTIRQ-in-idle.patch - 0006-lib-irq_poll-Declare-IRQ_POLL-softirq-vector-as-ksof.patch - 0007-NFSv4.1-provide-mount-option-to-toggle-trunking-disc.patch + 0002-HID-apple-Properly-handle-function-keys-on-Keychron-.patch ) source_i686=( # avoid using zstd compression in ultra mode (exhausts virtual memory) @@ -76,9 +70,9 @@ validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. ) -sha512sums=('565de7f956e40a931858cb29b61619f25fc57ce588b8762bef806e470d20bbbdf98a6e1c55eccae61a7365c0ecaae4825d81f7eec8689911710949ba5b34ce0c' +sha512sums=('13be3762fffd74c63eeb23b0d34b994a3e5198bfdbda4f013b38f8d3edd24b9bbebe5a4bfde0f5191aa1cf2678e4517f3b5540a40b30ebc05da1f6708cbb98bb' 'SKIP' - '71ba9ae3f75d72d2d86cc8cab1df463725e00088fb93b09553066a9b968d3a32abed77fac6011433377ac2970c8149a28e85ed25429da7dec56b47ba871cd4ae' + '9355c0f22606c0401e8a01d6e22f0fa6e97b69a9fce6d991235da6430907fb6a788fca30bd48e5cbb743cc4a211a40806c896f660db7432e7bc85ba7634b5d06' 'SKIP' '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' 'SKIP' @@ -86,8 +80,8 @@ sha512sums=('565de7f956e40a931858cb29b61619f25fc57ce588b8762bef806e470d20bbbdf98 'SKIP' '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' 'SKIP' - 'b1f013835dcf521dcadb58ed22f271f7f01b3b15403924bd0076eb9ef4e8aa31f98b1b99d47ae726f8e981b3da44f1c484ce14e2030e31a67ad7c8eea55848d9' - '5a955a795f9f49d8617897300d3d03c431b1a6fa2bc9ed4106606617e4f16b28f94906498b13c24fd5c186c76a685e5f877013093184ae80435e7b86f52e8755' + 'bcec71d3bd1daaa27bdf4c9a10f0b302b915e8236ef47b5e6d6eaf65bfd0b34644d8d3ff6c25d894ae21dedbece3c1f1ff152fbf8525b77100bc790d0541f3f1' + 'e141c387e8045030278d683a1294bfd3d13197bf3466a9c89c4f72a53aafed606acc8e42e528479527c638af895bce2303944b5d8b8a29040f5aae8a9581dd5a' '47d16ffc94510d4a8773146a46cfb35aca8cfdae38d17283334cd62d92de36250fbec90e9892357033398ecc7d970127b1a41b703a8372972422ca4af7c90c70' '53103bf55b957b657039510527df0df01279dec59cda115a4d6454e4135025d4546167fa30bdc99107f232561c1e096d8328609ab5a876cf7017176f92ad3e0b' 'f10af02f0cb2d31259d9633e1ba845f555f525789f750fc2ddc51bd18c5ff64fcdd242dae801623887f5ce5cdb5528bce890459f0fab9fd31a28868bb7f6bba5' @@ -95,15 +89,10 @@ sha512sums=('565de7f956e40a931858cb29b61619f25fc57ce588b8762bef806e470d20bbbdf98 '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232' '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' - 'cf6a2987d5f27aaea040bd01ab82de0bc054f0b0747bf74a8fb57355ac5a1700a4d6ba91b0a8528e7f394694e98a768323c6657a109297b7b44fc7c5e82182de' - 'c8a22540dee3a005ebd2ab5f0230a744e493ba34efbd92cc817564f209f5db9c0719eeed49b03a0b5d75957bee8e369c14a4ebeb2cb776ff971ece8896178942' - 'e6787fa101be723e7828ad3f79e7334ba25f5c53b9a98fb3f32882b1f13c707d2382b9d142aad1457d68cdbadb6f12a8620f8e179ce97bd3cc88a7b709867ada' - '8173fa14d68bd5a88bfe1af22a584f0cf6afa442f3ed0f7df80e346c27eda9e45e4e965771158ed424d1ae1d0d18b7e91cc2b566ac859db48e5158846b4c848f' - '1f95f5824f869b6a307f0e11ac2a3a0b54f02eff30e0923e04ef75a9a7fa0b09da50cc6cdcdb69176cb419aba332869086225572ca857ee98cd1bf5c007aa92c' - 'c631403c2398271334b5815c0abdcc66c35a17f8f965f594fa3367088c84dd1062e6282a611ee87f8bafe5dbe19a302babde8307688fa09d393dd64b03142dff' - '782014cb1a5e7fc22dc92137c098438908182749b4f98a7db5edd7f068c1e7def229f4889ccbbadd1d0be96f4dc8e3e72e10b62d5c2e87d8f16595f811b8e309') + '1b6c3108d5628ca6db20c2bc3431e560ab2a274aaf863e7a796f1931a35982d175247f47cbfbb7d643ffc6b742442806755bb10339e5b0577c3f232b38288891' + 'bf6d9a66be49c2cc67b0a0f3cfb61734adf7a3b032b5ed133e1e0afbf4a6ddbd3e8231e4b85fef2e3aeb7274a60f7572a4469c057ff13d81134613f01767d3b2') sha512sums_i686=('bca15cc96f64c38adcd13a46752866b5b30555ac21e19b3f7afcd20fcb7ec585c9d990fe8f842f44d5f69d477d72867fe6a9102729f26f93f5a80b372e41ce85') -sha512sums_armv7h=('8adea742801f797c1586671725631389d7d5fac9c4473a08136afba0647fa8076c9919f4802e06974e1a71c054a4b83f8200327c723d9479e8ed804ac6bd4e76' +sha512sums_armv7h=('5a75b12dd386940a0bf1be630d45a514ef3c32289ec5976988764baa8483b254e5dcc879337556bfa041b6dbf9ac16debbe4b57bf86db30089661e9536ffaa0a' 'SKIP' '8da996a42249672893fa532ccbd096347580a0dc1698c45e9c865646e2765789553b1bb42793e721de30aea70340fdc116d2e4a50580fef999ca5fc627aaf4c3' '0e6ddc24011d77a2e422b642c4507317fc2d26b20f5649818a2f11acac165ccab2cf2e64ab50d44ce7affcfe12c2ef5158790e499058831e7995400b2087df78' @@ -178,7 +167,7 @@ prepare() { echo "Setting config..." cp ../config.$CARCH .config make olddefconfig - diff -u ../config .config || : + diff -u ../config.$CARCH .config || : make -s kernelrelease > version echo "Prepared $pkgbase version $(