From 24cdd62c17d9b6f587a67973230a9701288d5146 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Tue, 16 Jan 2018 20:48:55 +0100 Subject: [PATCH 01/11] RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) --- debian/changelog | 6 ++++ ...p-OOB-write-in-rds_message_alloc_sgs.patch | 34 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 41 insertions(+) create mode 100644 debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch diff --git a/debian/changelog b/debian/changelog index 9eac6c5cd..9412c94d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linux (4.14.13-2) UNRELEASED; urgency=medium + + * RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) + + -- Salvatore Bonaccorso Tue, 16 Jan 2018 20:50:23 +0100 + linux (4.14.13-1) unstable; urgency=medium * New upstream stable update: diff --git a/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch b/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch new file mode 100644 index 000000000..e59fab0bb --- /dev/null +++ b/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch @@ -0,0 +1,34 @@ +From: Mohamed Ghannam +Date: Tue, 2 Jan 2018 19:44:34 +0000 +Subject: RDS: Heap OOB write in rds_message_alloc_sgs() +Origin: https://git.kernel.org/linus/c095508770aebf1b9218e77026e48345d719b17c +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5332 + +When args->nr_local is 0, nr_pages gets also 0 due some size +calculation via rds_rm_size(), which is later used to allocate +pages for DMA, this bug produces a heap Out-Of-Bound write access +to a specific memory region. + +Signed-off-by: Mohamed Ghannam +Signed-off-by: David S. Miller +--- + net/rds/rdma.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/net/rds/rdma.c b/net/rds/rdma.c +index bc2f1e0977d6..94729d9da437 100644 +--- a/net/rds/rdma.c ++++ b/net/rds/rdma.c +@@ -525,6 +525,9 @@ int rds_rdma_extra_size(struct rds_rdma_args *args) + + local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr; + ++ if (args->nr_local == 0) ++ return -EINVAL; ++ + /* figure out the number of pages in the vector */ + for (i = 0; i < args->nr_local; i++) { + if (copy_from_user(&vec, &local_vec[i], +-- +2.15.1 + diff --git a/debian/patches/series b/debian/patches/series index 60bf5e200..0cae9fedb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -131,6 +131,7 @@ bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch bugfix/all/bpf-fix-integer-overflows.patch +bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From 6c0d6a6239bb0b6757a45bbd8e4779f113cff52b Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Tue, 16 Jan 2018 20:52:43 +0100 Subject: [PATCH 02/11] RDS: null pointer dereference in rds_atomic_free_op (CVE-2018-5333) --- debian/changelog | 1 + ...er-dereference-in-rds_atomic_free_op.patch | 32 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 34 insertions(+) create mode 100644 debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch diff --git a/debian/changelog b/debian/changelog index 9412c94d8..2f2a5cc5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ linux (4.14.13-2) UNRELEASED; urgency=medium * RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) + * RDS: null pointer dereference in rds_atomic_free_op (CVE-2018-5333) -- Salvatore Bonaccorso Tue, 16 Jan 2018 20:50:23 +0100 diff --git a/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch b/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch new file mode 100644 index 000000000..47620427f --- /dev/null +++ b/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch @@ -0,0 +1,32 @@ +From: Mohamed Ghannam +Date: Wed, 3 Jan 2018 21:06:06 +0000 +Subject: RDS: null pointer dereference in rds_atomic_free_op +Origin: https://git.kernel.org/linus/7d11f77f84b27cef452cee332f4e469503084737 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5333 + +set rm->atomic.op_active to 0 when rds_pin_pages() fails +or the user supplied address is invalid, +this prevents a NULL pointer usage in rds_atomic_free_op() + +Signed-off-by: Mohamed Ghannam +Acked-by: Santosh Shilimkar +Signed-off-by: David S. Miller +--- + net/rds/rdma.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/net/rds/rdma.c b/net/rds/rdma.c +index 94729d9da437..634cfcb7bba6 100644 +--- a/net/rds/rdma.c ++++ b/net/rds/rdma.c +@@ -877,6 +877,7 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, + err: + if (page) + put_page(page); ++ rm->atomic.op_active = 0; + kfree(rm->atomic.op_notifier); + + return ret; +-- +2.15.1 + diff --git a/debian/patches/series b/debian/patches/series index 0cae9fedb..f502e75d5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -132,6 +132,7 @@ bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch bugfix/all/bpf-fix-integer-overflows.patch bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch +bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From 0bb5e7cccb41f7a32ee7adafa7495d2743bae279 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Tue, 16 Jan 2018 20:57:31 +0100 Subject: [PATCH 03/11] loop: fix concurrent lo_open/lo_release (CVE-2018-5344) --- debian/changelog | 1 + ...op-fix-concurrent-lo_open-lo_release.patch | 56 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 58 insertions(+) create mode 100644 debian/patches/bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch diff --git a/debian/changelog b/debian/changelog index 2f2a5cc5f..9c2c7fac0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ linux (4.14.13-2) UNRELEASED; urgency=medium * RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) * RDS: null pointer dereference in rds_atomic_free_op (CVE-2018-5333) + * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) -- Salvatore Bonaccorso Tue, 16 Jan 2018 20:50:23 +0100 diff --git a/debian/patches/bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch b/debian/patches/bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch new file mode 100644 index 000000000..a5ba39e4b --- /dev/null +++ b/debian/patches/bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch @@ -0,0 +1,56 @@ +From: Linus Torvalds +Date: Fri, 5 Jan 2018 16:26:00 -0800 +Subject: loop: fix concurrent lo_open/lo_release +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Origin: https://git.kernel.org/linus/ae6650163c66a7eff1acd6eb8b0f752dcfa8eba5 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5344 + +范龙飞 reports that KASAN can report a use-after-free in __lock_acquire. +The reason is due to insufficient serialization in lo_release(), which +will continue to use the loop device even after it has decremented the +lo_refcnt to zero. + +In the meantime, another process can come in, open the loop device +again as it is being shut down. Confusion ensues. + +Reported-by: 范龙飞 +Signed-off-by: Linus Torvalds +Signed-off-by: Jens Axboe +--- + drivers/block/loop.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/drivers/block/loop.c b/drivers/block/loop.c +index bc8e61506968..d5fe720cf149 100644 +--- a/drivers/block/loop.c ++++ b/drivers/block/loop.c +@@ -1581,9 +1581,8 @@ static int lo_open(struct block_device *bdev, fmode_t mode) + return err; + } + +-static void lo_release(struct gendisk *disk, fmode_t mode) ++static void __lo_release(struct loop_device *lo) + { +- struct loop_device *lo = disk->private_data; + int err; + + if (atomic_dec_return(&lo->lo_refcnt)) +@@ -1610,6 +1609,13 @@ static void lo_release(struct gendisk *disk, fmode_t mode) + mutex_unlock(&lo->lo_ctl_mutex); + } + ++static void lo_release(struct gendisk *disk, fmode_t mode) ++{ ++ mutex_lock(&loop_index_mutex); ++ __lo_release(disk->private_data); ++ mutex_unlock(&loop_index_mutex); ++} ++ + static const struct block_device_operations lo_fops = { + .owner = THIS_MODULE, + .open = lo_open, +-- +2.15.1 + diff --git a/debian/patches/series b/debian/patches/series index f502e75d5..8e4bcf339 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -133,6 +133,7 @@ bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch bugfix/all/bpf-fix-integer-overflows.patch bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch +bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From 6f43038466454410817931a2afccbd0154973898 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 18 Jan 2018 05:38:40 +0000 Subject: [PATCH 04/11] Update to 4.14.14 Mostly done by Salvatore Bonaccorso. --- debian/changelog | 117 +- ...p-OOB-write-in-rds_message_alloc_sgs.patch | 34 - ...er-dereference-in-rds_atomic_free_op.patch | 32 - ...stack-info-leak-from-the-efs-element.patch | 48 - ...-verifier-log-state-into-a-structure.patch | 201 -- .../all/bpf-fix-integer-overflows.patch | 63 - ...verifier-log-into-verifier-environme.patch | 1667 ----------------- ...for_copper_link_ich8lan-return-value.patch | 60 - ...ack-out-of-bounds-read-in-write_mmio.patch | 153 -- .../bpf-avoid-abi-change-in-4.14.14.patch | 138 ++ debian/patches/series | 9 +- 11 files changed, 253 insertions(+), 2269 deletions(-) delete mode 100644 debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch delete mode 100644 debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch delete mode 100644 debian/patches/bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch delete mode 100644 debian/patches/bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch delete mode 100644 debian/patches/bugfix/all/bpf-fix-integer-overflows.patch delete mode 100644 debian/patches/bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch delete mode 100644 debian/patches/bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch delete mode 100644 debian/patches/bugfix/all/kvm-fix-stack-out-of-bounds-read-in-write_mmio.patch create mode 100644 debian/patches/debian/bpf-avoid-abi-change-in-4.14.14.patch diff --git a/debian/changelog b/debian/changelog index 9c2c7fac0..412c0e2db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,120 @@ -linux (4.14.13-2) UNRELEASED; urgency=medium +linux (4.14.14-1) UNRELEASED; urgency=medium - * RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) - * RDS: null pointer dereference in rds_atomic_free_op (CVE-2018-5333) + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.14.14 + - dm bufio: fix shrinker scans when (nr_to_scan < retain_target) + - can: gs_usb: fix return value of the "set_bittiming" callback + - IB/srpt: Disable RDMA access by the initiator + - IB/srpt: Fix ACL lookup during login + - [mips*] Validate PR_SET_FP_MODE prctl(2) requests against the ABI of the + task + - [mips*] Factor out NT_PRFPREG regset access helpers + - [mips*] Guard against any partial write attempt with PTRACE_SETREGSET + - [mips*] Consistently handle buffer counter with PTRACE_SETREGSET + - [mips*] Fix an FCSR access API regression with NT_PRFPREG and MSA + - [mips*] Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET + - [mips*] Disallow outsized PTRACE_SETREGSET NT_PRFPREG regset accesses + - cgroup: fix css_task_iter crash on CSS_TASK_ITER_PROC + - [x86] kvm: vmx: Scrub hardware GPRs at VM-exit (partial mitigation of + CVE-2017-5715, CVE-2017-5753) + - [x86] platform: wmi: Call acpi_wmi_init() later + - iw_cxgb4: only call the cq comp_handler when the cq is armed + - iw_cxgb4: atomically flush the qp + - iw_cxgb4: only clear the ARMED bit if a notification is needed + - iw_cxgb4: reflect the original WR opcode in drain cqes + - iw_cxgb4: when flushing, complete all wrs in a chain + - [x86] acpi: Handle SCI interrupts above legacy space gracefully + - ALSA: pcm: Remove incorrect snd_BUG_ON() usages + - ALSA: pcm: Workaround for weird PulseAudio behavior on rewind error + - ALSA: pcm: Add missing error checks in OSS emulation plugin builder + - ALSA: pcm: Abort properly at pending signal in OSS read/write loops + - ALSA: pcm: Allow aborting mutex lock at OSS read/write loops + - ALSA: aloop: Release cable upon open error path + - ALSA: aloop: Fix inconsistent format due to incomplete rule + - ALSA: aloop: Fix racy hw constraints adjustment + - [x86] acpi: Reduce code duplication in mp_override_legacy_irq() + - 8021q: fix a memory leak for VLAN 0 device + - ip6_tunnel: disable dst caching if tunnel is dual-stack + - net: core: fix module type in sock_diag_bind + - RDS: Heap OOB write in rds_message_alloc_sgs() (CVE-2018-5332) + - RDS: null pointer dereference in rds_atomic_free_op (CVE-2018-5333) + - net: fec: restore dev_id in the cases of probe error + - net: fec: defer probe if regulator is not ready + - net: fec: free/restore resource in related probe error pathes + - sctp: do not retransmit upon FragNeeded if PMTU discovery is disabled + - sctp: fix the handling of ICMP Frag Needed for too small MTUs + - [arm64, armhf] net: stmmac: enable EEE in MII, GMII or RGMII only + - ipv6: fix possible mem leaks in ipv6_make_skb() + - net/sched: Fix update of lastuse in act modules implementing + stats_update + - ipv6: sr: fix TLVs not being copied using setsockopt + - sfp: fix sfp-bus oops when removing socket/upstream + - membarrier: Disable preemption when calling smp_call_function_many() + - crypto: algapi - fix NULL dereference in crypto_remove_spawns() + - rbd: reacquire lock should update lock owner client id + - rbd: set max_segments to USHRT_MAX + - iwlwifi: pcie: fix DMA memory mapping / unmapping + - [x86] microcode/intel: Extend BDW late-loading with a revision check + - [x86] KVM: Add memory barrier on vmcs field lookup + - [powerpc*] KVM: Book3S PR: Fix WIMG handling under pHyp + - [powerpc*] KVM: Book3S HV: Drop prepare_done from struct kvm_resize_hpt + - [powerpc*] KVM: Book3S HV: Fix use after free in case of multiple resize + requests + - [powerpc*] KVM: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt() + - [x86] drm/vmwgfx: Don't cache framebuffer maps + - [x86] drm/vmwgfx: Potential off by one in vmw_view_add() + - [x86] drm/i915/gvt: Clear the shadow page table entry after post-sync + - [x86] drm/i915: Whitelist SLICE_COMMON_ECO_CHICKEN1 on Geminilake. + - [x86] drm/i915: Move init_clock_gating() back to where it was + - [x86] drm/i915: Fix init_clock_gating for resume + - bpf: prevent out-of-bounds speculation (partial mitigation of CVE-2017-5753) + - bpf, array: fix overflow in max_entries and undefined behavior in + index_mask + - bpf: arsh is not supported in 32 bit alu thus reject it + - [arm64, armhf] usb: misc: usb3503: make sure reset is low for at least + 100us + - USB: fix usbmon BUG trigger + - USB: UDC core: fix double-free in usb_add_gadget_udc_release + - usbip: remove kernel addresses from usb device and urb debug msgs + - usbip: fix vudc_rx: harden CMD_SUBMIT path to handle malicious input + - usbip: vudc_tx: fix v_send_ret_submit() vulnerability to null xfer + buffer + - staging: android: ashmem: fix a race condition in ASHMEM_SET_SIZE ioctl + (CVE-2017-13216) + - mux: core: fix double get_device() + - kdump: write correct address of mem_section into vmcoreinfo + - apparmor: fix ptrace label match when matching stacked labels + - [x86] pti: Unbreak EFI old_memmap + - [x86] Documentation: Add PTI description + - [x86] cpufeatures: Add X86_BUG_SPECTRE_V[12] + - sysfs/cpu: Add vulnerability folder + - [x86] cpu: Implement CPU vulnerabilites sysfs functions + - [x86] tboot: Unbreak tboot with PTI enabled + - [x86] mm/pti: Remove dead logic in pti_user_pagetable_walk*() + - [x86] cpu/AMD: Make LFENCE a serializing instruction + - [x86] cpu/AMD: Use LFENCE_RDTSC in preference to MFENCE_RDTSC + - [x86] alternatives: Fix optimize_nops() checking + - [x86] pti: Make unpoison of pgd for trusted boot work for real + - [x86] retpoline: Add initial retpoline support (partial mitigation of + CVE-2017-5715) + - [x86] spectre: Add boot time option to select Spectre v2 mitigation + - [x86] retpoline/crypto: Convert crypto assembler indirect jumps + - [x86] retpoline/entry: Convert entry assembler indirect jumps + - [x86] retpoline/ftrace: Convert ftrace assembler indirect jumps + - [x86] retpoline/hyperv: Convert assembler indirect jumps + - [x86] retpoline/xen: Convert Xen hypercall indirect jumps + - [x86] retpoline/checksum32: Convert assembler indirect jumps + - [x86] retpoline/irq32: Convert assembler indirect jumps + - [x86] retpoline: Fill return stack buffer on vmexit + - [x86] pti: Fix !PCID and sanitize defines + - [x86] perf: Disable intel_bts when PTI + + [ Salvatore Bonaccorso ] * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) + [ Ben Hutchings ] + * bpf: Avoid ABI change in 4.14.14 + -- Salvatore Bonaccorso Tue, 16 Jan 2018 20:50:23 +0100 linux (4.14.13-1) unstable; urgency=medium diff --git a/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch b/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch deleted file mode 100644 index e59fab0bb..000000000 --- a/debian/patches/bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Mohamed Ghannam -Date: Tue, 2 Jan 2018 19:44:34 +0000 -Subject: RDS: Heap OOB write in rds_message_alloc_sgs() -Origin: https://git.kernel.org/linus/c095508770aebf1b9218e77026e48345d719b17c -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5332 - -When args->nr_local is 0, nr_pages gets also 0 due some size -calculation via rds_rm_size(), which is later used to allocate -pages for DMA, this bug produces a heap Out-Of-Bound write access -to a specific memory region. - -Signed-off-by: Mohamed Ghannam -Signed-off-by: David S. Miller ---- - net/rds/rdma.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/net/rds/rdma.c b/net/rds/rdma.c -index bc2f1e0977d6..94729d9da437 100644 ---- a/net/rds/rdma.c -+++ b/net/rds/rdma.c -@@ -525,6 +525,9 @@ int rds_rdma_extra_size(struct rds_rdma_args *args) - - local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr; - -+ if (args->nr_local == 0) -+ return -EINVAL; -+ - /* figure out the number of pages in the vector */ - for (i = 0; i < args->nr_local; i++) { - if (copy_from_user(&vec, &local_vec[i], --- -2.15.1 - diff --git a/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch b/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch deleted file mode 100644 index 47620427f..000000000 --- a/debian/patches/bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Mohamed Ghannam -Date: Wed, 3 Jan 2018 21:06:06 +0000 -Subject: RDS: null pointer dereference in rds_atomic_free_op -Origin: https://git.kernel.org/linus/7d11f77f84b27cef452cee332f4e469503084737 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5333 - -set rm->atomic.op_active to 0 when rds_pin_pages() fails -or the user supplied address is invalid, -this prevents a NULL pointer usage in rds_atomic_free_op() - -Signed-off-by: Mohamed Ghannam -Acked-by: Santosh Shilimkar -Signed-off-by: David S. Miller ---- - net/rds/rdma.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/net/rds/rdma.c b/net/rds/rdma.c -index 94729d9da437..634cfcb7bba6 100644 ---- a/net/rds/rdma.c -+++ b/net/rds/rdma.c -@@ -877,6 +877,7 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, - err: - if (page) - put_page(page); -+ rm->atomic.op_active = 0; - kfree(rm->atomic.op_notifier); - - return ret; --- -2.15.1 - diff --git a/debian/patches/bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch b/debian/patches/bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch deleted file mode 100644 index 308204888..000000000 --- a/debian/patches/bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Ben Seri -Date: Mon, 04 Dec 2017 14:13:25 +0000 -Subject: bluetooth: Prevent stack info leak from the EFS element. -Origin: http://www.openwall.com/lists/oss-security/2017/12/06/3 -Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2017-1000410 - -Signed-off-by: Ben Seri ---- ---- a/net/bluetooth/l2cap_core.c -+++ b/net/bluetooth/l2cap_core.c -@@ -3363,9 +3363,10 @@ static int l2cap_parse_conf_req(struct l - break; - - case L2CAP_CONF_EFS: -- remote_efs = 1; -- if (olen == sizeof(efs)) -+ if (olen == sizeof(efs)) { -+ remote_efs = 1; - memcpy(&efs, (void *) val, olen); -+ } - break; - - case L2CAP_CONF_EWS: -@@ -3584,16 +3585,17 @@ static int l2cap_parse_conf_rsp(struct l - break; - - case L2CAP_CONF_EFS: -- if (olen == sizeof(efs)) -+ if (olen == sizeof(efs)) { - memcpy(&efs, (void *)val, olen); - -- if (chan->local_stype != L2CAP_SERV_NOTRAFIC && -- efs.stype != L2CAP_SERV_NOTRAFIC && -- efs.stype != chan->local_stype) -- return -ECONNREFUSED; -+ if (chan->local_stype != L2CAP_SERV_NOTRAFIC && -+ efs.stype != L2CAP_SERV_NOTRAFIC && -+ efs.stype != chan->local_stype) -+ return -ECONNREFUSED; - -- l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS, sizeof(efs), -- (unsigned long) &efs, endptr - ptr); -+ l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS, sizeof(efs), -+ (unsigned long) &efs, endptr - ptr); -+ } - break; - - case L2CAP_CONF_FCS: diff --git a/debian/patches/bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch b/debian/patches/bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch deleted file mode 100644 index bf0f1c5b0..000000000 --- a/debian/patches/bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch +++ /dev/null @@ -1,201 +0,0 @@ -From: Jakub Kicinski -Date: Mon, 9 Oct 2017 10:30:10 -0700 -Subject: bpf: encapsulate verifier log state into a structure -Origin: https://git.kernel.org/linus/e7bf8249e8f1bac64885eeccb55bcf6111901a81 - -Put the loose log_* variables into a structure. This will make -it simpler to remove the global verifier state in following patches. - -Signed-off-by: Jakub Kicinski -Reviewed-by: Simon Horman -Acked-by: Alexei Starovoitov -Acked-by: Daniel Borkmann -Signed-off-by: David S. Miller ---- - include/linux/bpf_verifier.h | 13 ++++++++++ - kernel/bpf/verifier.c | 57 +++++++++++++++++++++++--------------------- - 2 files changed, 43 insertions(+), 27 deletions(-) - ---- a/include/linux/bpf_verifier.h -+++ b/include/linux/bpf_verifier.h -@@ -115,6 +115,19 @@ struct bpf_insn_aux_data { - - #define MAX_USED_MAPS 64 /* max number of maps accessed by one eBPF program */ - -+struct bpf_verifer_log { -+ u32 level; -+ char *kbuf; -+ char __user *ubuf; -+ u32 len_used; -+ u32 len_total; -+}; -+ -+static inline bool bpf_verifier_log_full(const struct bpf_verifer_log *log) -+{ -+ return log->len_used >= log->len_total - 1; -+} -+ - struct bpf_verifier_env; - struct bpf_ext_analyzer_ops { - int (*insn_hook)(struct bpf_verifier_env *env, ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -156,8 +156,7 @@ struct bpf_call_arg_meta { - /* verbose verifier prints what it's seeing - * bpf_check() is called under lock, so no race to access these global vars - */ --static u32 log_level, log_size, log_len; --static char *log_buf; -+static struct bpf_verifer_log verifier_log; - - static DEFINE_MUTEX(bpf_verifier_lock); - -@@ -167,13 +166,15 @@ static DEFINE_MUTEX(bpf_verifier_lock); - */ - static __printf(1, 2) void verbose(const char *fmt, ...) - { -+ struct bpf_verifer_log *log = &verifier_log; - va_list args; - -- if (log_level == 0 || log_len >= log_size - 1) -+ if (!log->level || bpf_verifier_log_full(log)) - return; - - va_start(args, fmt); -- log_len += vscnprintf(log_buf + log_len, log_size - log_len, fmt, args); -+ log->len_used += vscnprintf(log->kbuf + log->len_used, -+ log->len_total - log->len_used, fmt, args); - va_end(args); - } - -@@ -834,7 +835,7 @@ static int check_map_access(struct bpf_v - * need to try adding each of min_value and max_value to off - * to make sure our theoretical access will be safe. - */ -- if (log_level) -+ if (verifier_log.level) - print_verifier_state(state); - /* The minimum value is only important with signed - * comparisons where we can't assume the floor of a -@@ -2915,7 +2916,7 @@ static int check_cond_jmp_op(struct bpf_ - verbose("R%d pointer comparison prohibited\n", insn->dst_reg); - return -EACCES; - } -- if (log_level) -+ if (verifier_log.level) - print_verifier_state(this_branch); - return 0; - } -@@ -3633,7 +3634,7 @@ static int do_check(struct bpf_verifier_ - return err; - if (err == 1) { - /* found equivalent state, can prune the search */ -- if (log_level) { -+ if (verifier_log.level) { - if (do_print_state) - verbose("\nfrom %d to %d: safe\n", - prev_insn_idx, insn_idx); -@@ -3646,8 +3647,9 @@ static int do_check(struct bpf_verifier_ - if (need_resched()) - cond_resched(); - -- if (log_level > 1 || (log_level && do_print_state)) { -- if (log_level > 1) -+ if (verifier_log.level > 1 || -+ (verifier_log.level && do_print_state)) { -+ if (verifier_log.level > 1) - verbose("%d:", insn_idx); - else - verbose("\nfrom %d to %d:", -@@ -3656,7 +3658,7 @@ static int do_check(struct bpf_verifier_ - do_print_state = false; - } - -- if (log_level) { -+ if (verifier_log.level) { - verbose("%d: ", insn_idx); - print_bpf_insn(env, insn); - } -@@ -4307,7 +4309,7 @@ static void free_states(struct bpf_verif - - int bpf_check(struct bpf_prog **prog, union bpf_attr *attr) - { -- char __user *log_ubuf = NULL; -+ struct bpf_verifer_log *log = &verifier_log; - struct bpf_verifier_env *env; - int ret = -EINVAL; - -@@ -4332,23 +4334,23 @@ int bpf_check(struct bpf_prog **prog, un - /* user requested verbose verifier output - * and supplied buffer to store the verification trace - */ -- log_level = attr->log_level; -- log_ubuf = (char __user *) (unsigned long) attr->log_buf; -- log_size = attr->log_size; -- log_len = 0; -+ log->level = attr->log_level; -+ log->ubuf = (char __user *) (unsigned long) attr->log_buf; -+ log->len_total = attr->log_size; -+ log->len_used = 0; - - ret = -EINVAL; -- /* log_* values have to be sane */ -- if (log_size < 128 || log_size > UINT_MAX >> 8 || -- log_level == 0 || log_ubuf == NULL) -+ /* log attributes have to be sane */ -+ if (log->len_total < 128 || log->len_total > UINT_MAX >> 8 || -+ !log->level || !log->ubuf) - goto err_unlock; - - ret = -ENOMEM; -- log_buf = vmalloc(log_size); -- if (!log_buf) -+ log->kbuf = vmalloc(log->len_total); -+ if (!log->kbuf) - goto err_unlock; - } else { -- log_level = 0; -+ log->level = 0; - } - - env->strict_alignment = !!(attr->prog_flags & BPF_F_STRICT_ALIGNMENT); -@@ -4385,15 +4387,16 @@ skip_full_check: - if (ret == 0) - ret = fixup_bpf_calls(env); - -- if (log_level && log_len >= log_size - 1) { -- BUG_ON(log_len >= log_size); -+ if (log->level && bpf_verifier_log_full(log)) { -+ BUG_ON(log->len_used >= log->len_total); - /* verifier log exceeded user supplied buffer */ - ret = -ENOSPC; - /* fall through to return what was recorded */ - } - - /* copy verifier log back to user space including trailing zero */ -- if (log_level && copy_to_user(log_ubuf, log_buf, log_len + 1) != 0) { -+ if (log->level && copy_to_user(log->ubuf, log->kbuf, -+ log->len_used + 1) != 0) { - ret = -EFAULT; - goto free_log_buf; - } -@@ -4420,8 +4423,8 @@ skip_full_check: - } - - free_log_buf: -- if (log_level) -- vfree(log_buf); -+ if (log->level) -+ vfree(log->kbuf); - if (!env->prog->aux->used_maps) - /* if we didn't copy map pointers into bpf_prog_info, release - * them now. Otherwise free_bpf_prog_info() will release them. -@@ -4458,7 +4461,7 @@ int bpf_analyzer(struct bpf_prog *prog, - /* grab the mutex to protect few globals used by verifier */ - mutex_lock(&bpf_verifier_lock); - -- log_level = 0; -+ verifier_log.level = 0; - - env->strict_alignment = false; - if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) diff --git a/debian/patches/bugfix/all/bpf-fix-integer-overflows.patch b/debian/patches/bugfix/all/bpf-fix-integer-overflows.patch deleted file mode 100644 index a26b5f057..000000000 --- a/debian/patches/bugfix/all/bpf-fix-integer-overflows.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Alexei Starovoitov -Date: Mon, 18 Dec 2017 20:12:00 -0800 -Subject: [8/9] bpf: fix integer overflows -Origin: https://git.kernel.org/linus/bb7f0f989ca7de1153bd128a40a71709e339fa03 - -There were various issues related to the limited size of integers used in -the verifier: - - `off + size` overflow in __check_map_access() - - `off + reg->off` overflow in check_mem_access() - - `off + reg->var_off.value` overflow or 32-bit truncation of - `reg->var_off.value` in check_mem_access() - - 32-bit truncation in check_stack_boundary() - -Make sure that any integer math cannot overflow by not allowing -pointer math with large values. - -Also reduce the scope of "scalar op scalar" tracking. - -Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") -Reported-by: Jann Horn -Signed-off-by: Alexei Starovoitov -Signed-off-by: Daniel Borkmann -[carnil: - - adjust context, we previously change verbose() signature - - drop changes to include/linux/bpf_verifier.h already set -] ---- - include/linux/bpf_verifier.h | 4 ++-- - kernel/bpf/verifier.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 50 insertions(+), 2 deletions(-) - ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -1821,25 +1821,25 @@ static bool check_reg_sane_offset(struct - s64 smin = reg->smin_value; - - if (known && (val >= BPF_MAX_VAR_OFF || val <= -BPF_MAX_VAR_OFF)) { -- verbose("math between %s pointer and %lld is not allowed\n", -+ verbose(env, "math between %s pointer and %lld is not allowed\n", - reg_type_str[type], val); - return false; - } - - if (reg->off >= BPF_MAX_VAR_OFF || reg->off <= -BPF_MAX_VAR_OFF) { -- verbose("%s pointer offset %d is not allowed\n", -+ verbose(env, "%s pointer offset %d is not allowed\n", - reg_type_str[type], reg->off); - return false; - } - - if (smin == S64_MIN) { -- verbose("math between %s pointer and register with unbounded min value is not allowed\n", -+ verbose(env, "math between %s pointer and register with unbounded min value is not allowed\n", - reg_type_str[type]); - return false; - } - - if (smin >= BPF_MAX_VAR_OFF || smin <= -BPF_MAX_VAR_OFF) { -- verbose("value %lld makes %s pointer be out of bounds\n", -+ verbose(env, "value %lld makes %s pointer be out of bounds\n", - smin, reg_type_str[type]); - return false; - } diff --git a/debian/patches/bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch b/debian/patches/bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch deleted file mode 100644 index 70f75677e..000000000 --- a/debian/patches/bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch +++ /dev/null @@ -1,1667 +0,0 @@ -From: Jakub Kicinski -Date: Mon, 9 Oct 2017 10:30:11 -0700 -Subject: bpf: move global verifier log into verifier environment -Origin: https://git.kernel.org/linus/61bd5218eef349fcacc4976a251bc83a4748b4af - -The biggest piece of global state protected by the verifier lock -is the verifier_log. Move that log to struct bpf_verifier_env. -struct bpf_verifier_env has to be passed now to all invocations -of verbose(). - -Signed-off-by: Jakub Kicinski -Reviewed-by: Simon Horman -Acked-by: Alexei Starovoitov -Acked-by: Daniel Borkmann -Signed-off-by: David S. Miller -[bwh: Backported to 4.14] -[carnil: refresh after 4.14.9 import] ---- - include/linux/bpf_verifier.h | 2 + - kernel/bpf/verifier.c | 491 +++++++++++++++++++++++-------------------- - 2 files changed, 261 insertions(+), 232 deletions(-) - ---- a/include/linux/bpf_verifier.h -+++ b/include/linux/bpf_verifier.h -@@ -152,6 +152,8 @@ struct bpf_verifier_env { - bool allow_ptr_leaks; - bool seen_direct_write; - struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ -+ -+ struct bpf_verifer_log log; - }; - - int bpf_analyzer(struct bpf_prog *prog, const struct bpf_ext_analyzer_ops *ops, ---- a/kernel/bpf/verifier.c -+++ b/kernel/bpf/verifier.c -@@ -153,20 +153,16 @@ struct bpf_call_arg_meta { - int access_size; - }; - --/* verbose verifier prints what it's seeing -- * bpf_check() is called under lock, so no race to access these global vars -- */ --static struct bpf_verifer_log verifier_log; -- - static DEFINE_MUTEX(bpf_verifier_lock); - - /* log_level controls verbosity level of eBPF verifier. - * verbose() is used to dump the verification trace to the log, so the user - * can figure out what's wrong with the program - */ --static __printf(1, 2) void verbose(const char *fmt, ...) -+static __printf(2, 3) void verbose(struct bpf_verifier_env *env, -+ const char *fmt, ...) - { -- struct bpf_verifer_log *log = &verifier_log; -+ struct bpf_verifer_log *log = &env->log; - va_list args; - - if (!log->level || bpf_verifier_log_full(log)) -@@ -207,7 +203,8 @@ static const char *func_id_name(int id) - return "unknown"; - } - --static void print_verifier_state(struct bpf_verifier_state *state) -+static void print_verifier_state(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *state) - { - struct bpf_reg_state *reg; - enum bpf_reg_type t; -@@ -218,21 +215,21 @@ static void print_verifier_state(struct - t = reg->type; - if (t == NOT_INIT) - continue; -- verbose(" R%d=%s", i, reg_type_str[t]); -+ verbose(env, " R%d=%s", i, reg_type_str[t]); - if ((t == SCALAR_VALUE || t == PTR_TO_STACK) && - tnum_is_const(reg->var_off)) { - /* reg->off should be 0 for SCALAR_VALUE */ -- verbose("%lld", reg->var_off.value + reg->off); -+ verbose(env, "%lld", reg->var_off.value + reg->off); - } else { -- verbose("(id=%d", reg->id); -+ verbose(env, "(id=%d", reg->id); - if (t != SCALAR_VALUE) -- verbose(",off=%d", reg->off); -+ verbose(env, ",off=%d", reg->off); - if (t == PTR_TO_PACKET) -- verbose(",r=%d", reg->range); -+ verbose(env, ",r=%d", reg->range); - else if (t == CONST_PTR_TO_MAP || - t == PTR_TO_MAP_VALUE || - t == PTR_TO_MAP_VALUE_OR_NULL) -- verbose(",ks=%d,vs=%d", -+ verbose(env, ",ks=%d,vs=%d", - reg->map_ptr->key_size, - reg->map_ptr->value_size); - if (tnum_is_const(reg->var_off)) { -@@ -240,38 +237,38 @@ static void print_verifier_state(struct - * could be a pointer whose offset is too big - * for reg->off - */ -- verbose(",imm=%llx", reg->var_off.value); -+ verbose(env, ",imm=%llx", reg->var_off.value); - } else { - if (reg->smin_value != reg->umin_value && - reg->smin_value != S64_MIN) -- verbose(",smin_value=%lld", -+ verbose(env, ",smin_value=%lld", - (long long)reg->smin_value); - if (reg->smax_value != reg->umax_value && - reg->smax_value != S64_MAX) -- verbose(",smax_value=%lld", -+ verbose(env, ",smax_value=%lld", - (long long)reg->smax_value); - if (reg->umin_value != 0) -- verbose(",umin_value=%llu", -+ verbose(env, ",umin_value=%llu", - (unsigned long long)reg->umin_value); - if (reg->umax_value != U64_MAX) -- verbose(",umax_value=%llu", -+ verbose(env, ",umax_value=%llu", - (unsigned long long)reg->umax_value); - if (!tnum_is_unknown(reg->var_off)) { - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -- verbose(",var_off=%s", tn_buf); -+ verbose(env, ",var_off=%s", tn_buf); - } - } -- verbose(")"); -+ verbose(env, ")"); - } - } - for (i = 0; i < MAX_BPF_STACK; i += BPF_REG_SIZE) { - if (state->stack_slot_type[i] == STACK_SPILL) -- verbose(" fp%d=%s", -MAX_BPF_STACK + i, -+ verbose(env, " fp%d=%s", -MAX_BPF_STACK + i, - reg_type_str[state->spilled_regs[i / BPF_REG_SIZE].type]); - } -- verbose("\n"); -+ verbose(env, "\n"); - } - - static const char *const bpf_class_string[] = { -@@ -326,21 +323,21 @@ static const char *const bpf_jmp_string[ - [BPF_EXIT >> 4] = "exit", - }; - --static void print_bpf_insn(const struct bpf_verifier_env *env, -+static void print_bpf_insn(struct bpf_verifier_env *env, - const struct bpf_insn *insn) - { - u8 class = BPF_CLASS(insn->code); - - if (class == BPF_ALU || class == BPF_ALU64) { - if (BPF_SRC(insn->code) == BPF_X) -- verbose("(%02x) %sr%d %s %sr%d\n", -+ verbose(env, "(%02x) %sr%d %s %sr%d\n", - insn->code, class == BPF_ALU ? "(u32) " : "", - insn->dst_reg, - bpf_alu_string[BPF_OP(insn->code) >> 4], - class == BPF_ALU ? "(u32) " : "", - insn->src_reg); - else -- verbose("(%02x) %sr%d %s %s%d\n", -+ verbose(env, "(%02x) %sr%d %s %s%d\n", - insn->code, class == BPF_ALU ? "(u32) " : "", - insn->dst_reg, - bpf_alu_string[BPF_OP(insn->code) >> 4], -@@ -348,46 +345,46 @@ static void print_bpf_insn(const struct - insn->imm); - } else if (class == BPF_STX) { - if (BPF_MODE(insn->code) == BPF_MEM) -- verbose("(%02x) *(%s *)(r%d %+d) = r%d\n", -+ verbose(env, "(%02x) *(%s *)(r%d %+d) = r%d\n", - insn->code, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->dst_reg, - insn->off, insn->src_reg); - else if (BPF_MODE(insn->code) == BPF_XADD) -- verbose("(%02x) lock *(%s *)(r%d %+d) += r%d\n", -+ verbose(env, "(%02x) lock *(%s *)(r%d %+d) += r%d\n", - insn->code, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->dst_reg, insn->off, - insn->src_reg); - else -- verbose("BUG_%02x\n", insn->code); -+ verbose(env, "BUG_%02x\n", insn->code); - } else if (class == BPF_ST) { - if (BPF_MODE(insn->code) != BPF_MEM) { -- verbose("BUG_st_%02x\n", insn->code); -+ verbose(env, "BUG_st_%02x\n", insn->code); - return; - } -- verbose("(%02x) *(%s *)(r%d %+d) = %d\n", -+ verbose(env, "(%02x) *(%s *)(r%d %+d) = %d\n", - insn->code, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->dst_reg, - insn->off, insn->imm); - } else if (class == BPF_LDX) { - if (BPF_MODE(insn->code) != BPF_MEM) { -- verbose("BUG_ldx_%02x\n", insn->code); -+ verbose(env, "BUG_ldx_%02x\n", insn->code); - return; - } -- verbose("(%02x) r%d = *(%s *)(r%d %+d)\n", -+ verbose(env, "(%02x) r%d = *(%s *)(r%d %+d)\n", - insn->code, insn->dst_reg, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->src_reg, insn->off); - } else if (class == BPF_LD) { - if (BPF_MODE(insn->code) == BPF_ABS) { -- verbose("(%02x) r0 = *(%s *)skb[%d]\n", -+ verbose(env, "(%02x) r0 = *(%s *)skb[%d]\n", - insn->code, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->imm); - } else if (BPF_MODE(insn->code) == BPF_IND) { -- verbose("(%02x) r0 = *(%s *)skb[r%d + %d]\n", -+ verbose(env, "(%02x) r0 = *(%s *)skb[r%d + %d]\n", - insn->code, - bpf_ldst_string[BPF_SIZE(insn->code) >> 3], - insn->src_reg, insn->imm); -@@ -402,36 +399,37 @@ static void print_bpf_insn(const struct - if (map_ptr && !env->allow_ptr_leaks) - imm = 0; - -- verbose("(%02x) r%d = 0x%llx\n", insn->code, -+ verbose(env, "(%02x) r%d = 0x%llx\n", insn->code, - insn->dst_reg, (unsigned long long)imm); - } else { -- verbose("BUG_ld_%02x\n", insn->code); -+ verbose(env, "BUG_ld_%02x\n", insn->code); - return; - } - } else if (class == BPF_JMP) { - u8 opcode = BPF_OP(insn->code); - - if (opcode == BPF_CALL) { -- verbose("(%02x) call %s#%d\n", insn->code, -+ verbose(env, "(%02x) call %s#%d\n", insn->code, - func_id_name(insn->imm), insn->imm); - } else if (insn->code == (BPF_JMP | BPF_JA)) { -- verbose("(%02x) goto pc%+d\n", -+ verbose(env, "(%02x) goto pc%+d\n", - insn->code, insn->off); - } else if (insn->code == (BPF_JMP | BPF_EXIT)) { -- verbose("(%02x) exit\n", insn->code); -+ verbose(env, "(%02x) exit\n", insn->code); - } else if (BPF_SRC(insn->code) == BPF_X) { -- verbose("(%02x) if r%d %s r%d goto pc%+d\n", -+ verbose(env, "(%02x) if r%d %s r%d goto pc%+d\n", - insn->code, insn->dst_reg, - bpf_jmp_string[BPF_OP(insn->code) >> 4], - insn->src_reg, insn->off); - } else { -- verbose("(%02x) if r%d %s 0x%x goto pc%+d\n", -+ verbose(env, "(%02x) if r%d %s 0x%x goto pc%+d\n", - insn->code, insn->dst_reg, - bpf_jmp_string[BPF_OP(insn->code) >> 4], - insn->imm, insn->off); - } - } else { -- verbose("(%02x) %s\n", insn->code, bpf_class_string[class]); -+ verbose(env, "(%02x) %s\n", -+ insn->code, bpf_class_string[class]); - } - } - -@@ -470,7 +468,7 @@ static struct bpf_verifier_state *push_s - env->head = elem; - env->stack_size++; - if (env->stack_size > BPF_COMPLEXITY_LIMIT_STACK) { -- verbose("BPF program is too complex\n"); -+ verbose(env, "BPF program is too complex\n"); - goto err; - } - return &elem->st; -@@ -508,10 +506,11 @@ static void __mark_reg_known_zero(struct - __mark_reg_known(reg, 0); - } - --static void mark_reg_known_zero(struct bpf_reg_state *regs, u32 regno) -+static void mark_reg_known_zero(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) - { - if (WARN_ON(regno >= MAX_BPF_REG)) { -- verbose("mark_reg_known_zero(regs, %u)\n", regno); -+ verbose(env, "mark_reg_known_zero(regs, %u)\n", regno); - /* Something bad happened, let's kill all regs */ - for (regno = 0; regno < MAX_BPF_REG; regno++) - __mark_reg_not_init(regs + regno); -@@ -596,10 +595,11 @@ static void __mark_reg_unknown(struct bp - __mark_reg_unbounded(reg); - } - --static void mark_reg_unknown(struct bpf_reg_state *regs, u32 regno) -+static void mark_reg_unknown(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) - { - if (WARN_ON(regno >= MAX_BPF_REG)) { -- verbose("mark_reg_unknown(regs, %u)\n", regno); -+ verbose(env, "mark_reg_unknown(regs, %u)\n", regno); - /* Something bad happened, let's kill all regs */ - for (regno = 0; regno < MAX_BPF_REG; regno++) - __mark_reg_not_init(regs + regno); -@@ -614,10 +614,11 @@ static void __mark_reg_not_init(struct b - reg->type = NOT_INIT; - } - --static void mark_reg_not_init(struct bpf_reg_state *regs, u32 regno) -+static void mark_reg_not_init(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs, u32 regno) - { - if (WARN_ON(regno >= MAX_BPF_REG)) { -- verbose("mark_reg_not_init(regs, %u)\n", regno); -+ verbose(env, "mark_reg_not_init(regs, %u)\n", regno); - /* Something bad happened, let's kill all regs */ - for (regno = 0; regno < MAX_BPF_REG; regno++) - __mark_reg_not_init(regs + regno); -@@ -626,22 +627,23 @@ static void mark_reg_not_init(struct bpf - __mark_reg_not_init(regs + regno); - } - --static void init_reg_state(struct bpf_reg_state *regs) -+static void init_reg_state(struct bpf_verifier_env *env, -+ struct bpf_reg_state *regs) - { - int i; - - for (i = 0; i < MAX_BPF_REG; i++) { -- mark_reg_not_init(regs, i); -+ mark_reg_not_init(env, regs, i); - regs[i].live = REG_LIVE_NONE; - } - - /* frame pointer */ - regs[BPF_REG_FP].type = PTR_TO_STACK; -- mark_reg_known_zero(regs, BPF_REG_FP); -+ mark_reg_known_zero(env, regs, BPF_REG_FP); - - /* 1st arg to a function */ - regs[BPF_REG_1].type = PTR_TO_CTX; -- mark_reg_known_zero(regs, BPF_REG_1); -+ mark_reg_known_zero(env, regs, BPF_REG_1); - } - - enum reg_arg_type { -@@ -675,26 +677,26 @@ static int check_reg_arg(struct bpf_veri - struct bpf_reg_state *regs = env->cur_state.regs; - - if (regno >= MAX_BPF_REG) { -- verbose("R%d is invalid\n", regno); -+ verbose(env, "R%d is invalid\n", regno); - return -EINVAL; - } - - if (t == SRC_OP) { - /* check whether register used as source operand can be read */ - if (regs[regno].type == NOT_INIT) { -- verbose("R%d !read_ok\n", regno); -+ verbose(env, "R%d !read_ok\n", regno); - return -EACCES; - } - mark_reg_read(&env->cur_state, regno); - } else { - /* check whether register used as dest operand can be written to */ - if (regno == BPF_REG_FP) { -- verbose("frame pointer is read only\n"); -+ verbose(env, "frame pointer is read only\n"); - return -EACCES; - } - regs[regno].live |= REG_LIVE_WRITTEN; - if (t == DST_OP) -- mark_reg_unknown(regs, regno); -+ mark_reg_unknown(env, regs, regno); - } - return 0; - } -@@ -718,7 +720,8 @@ static bool is_spillable_regtype(enum bp - /* check_stack_read/write functions track spill/fill of registers, - * stack boundary and alignment are checked in check_mem_access() - */ --static int check_stack_write(struct bpf_verifier_state *state, int off, -+static int check_stack_write(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *state, int off, - int size, int value_regno) - { - int i, spi = (MAX_BPF_STACK + off) / BPF_REG_SIZE; -@@ -731,7 +734,7 @@ static int check_stack_write(struct bpf_ - - /* register containing pointer is being spilled into stack */ - if (size != BPF_REG_SIZE) { -- verbose("invalid size of register spill\n"); -+ verbose(env, "invalid size of register spill\n"); - return -EACCES; - } - -@@ -766,7 +769,8 @@ static void mark_stack_slot_read(const s - } - } - --static int check_stack_read(struct bpf_verifier_state *state, int off, int size, -+static int check_stack_read(struct bpf_verifier_env *env, -+ struct bpf_verifier_state *state, int off, int size, - int value_regno) - { - u8 *slot_type; -@@ -776,12 +780,12 @@ static int check_stack_read(struct bpf_v - - if (slot_type[0] == STACK_SPILL) { - if (size != BPF_REG_SIZE) { -- verbose("invalid size of register spill\n"); -+ verbose(env, "invalid size of register spill\n"); - return -EACCES; - } - for (i = 1; i < BPF_REG_SIZE; i++) { - if (slot_type[i] != STACK_SPILL) { -- verbose("corrupted spill memory\n"); -+ verbose(env, "corrupted spill memory\n"); - return -EACCES; - } - } -@@ -797,14 +801,14 @@ static int check_stack_read(struct bpf_v - } else { - for (i = 0; i < size; i++) { - if (slot_type[i] != STACK_MISC) { -- verbose("invalid read from stack off %d+%d size %d\n", -+ verbose(env, "invalid read from stack off %d+%d size %d\n", - off, i, size); - return -EACCES; - } - } - if (value_regno >= 0) - /* have read misc data from the stack */ -- mark_reg_unknown(state->regs, value_regno); -+ mark_reg_unknown(env, state->regs, value_regno); - return 0; - } - } -@@ -816,7 +820,7 @@ static int __check_map_access(struct bpf - struct bpf_map *map = env->cur_state.regs[regno].map_ptr; - - if (off < 0 || size <= 0 || off + size > map->value_size) { -- verbose("invalid access to map value, value_size=%d off=%d size=%d\n", -+ verbose(env, "invalid access to map value, value_size=%d off=%d size=%d\n", - map->value_size, off, size); - return -EACCES; - } -@@ -835,8 +839,8 @@ static int check_map_access(struct bpf_v - * need to try adding each of min_value and max_value to off - * to make sure our theoretical access will be safe. - */ -- if (verifier_log.level) -- print_verifier_state(state); -+ if (env->log.level) -+ print_verifier_state(env, state); - /* The minimum value is only important with signed - * comparisons where we can't assume the floor of a - * value is 0. If we are using signed variables for our -@@ -844,13 +848,14 @@ static int check_map_access(struct bpf_v - * will have a set floor within our range. - */ - if (reg->smin_value < 0) { -- verbose("R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", -+ verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", - regno); - return -EACCES; - } - err = __check_map_access(env, regno, reg->smin_value + off, size); - if (err) { -- verbose("R%d min value is outside of the array range\n", regno); -+ verbose(env, "R%d min value is outside of the array range\n", -+ regno); - return err; - } - -@@ -859,13 +864,14 @@ static int check_map_access(struct bpf_v - * If reg->umax_value + off could overflow, treat that as unbounded too. - */ - if (reg->umax_value >= BPF_MAX_VAR_OFF) { -- verbose("R%d unbounded memory access, make sure to bounds check any array access into a map\n", -+ verbose(env, "R%d unbounded memory access, make sure to bounds check any array access into a map\n", - regno); - return -EACCES; - } - err = __check_map_access(env, regno, reg->umax_value + off, size); - if (err) -- verbose("R%d max value is outside of the array range\n", regno); -+ verbose(env, "R%d max value is outside of the array range\n", -+ regno); - return err; - } - -@@ -904,7 +910,7 @@ static int __check_packet_access(struct - struct bpf_reg_state *reg = ®s[regno]; - - if (off < 0 || size <= 0 || (u64)off + size > reg->range) { -- verbose("invalid access to packet, off=%d size=%d, R%d(id=%d,off=%d,r=%d)\n", -+ verbose(env, "invalid access to packet, off=%d size=%d, R%d(id=%d,off=%d,r=%d)\n", - off, size, regno, reg->id, reg->off, reg->range); - return -EACCES; - } -@@ -927,13 +933,13 @@ static int check_packet_access(struct bp - * detail to prove they're safe. - */ - if (reg->smin_value < 0) { -- verbose("R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", -+ verbose(env, "R%d min value is negative, either use unsigned index or do a if (index >=0) check.\n", - regno); - return -EACCES; - } - err = __check_packet_access(env, regno, off, size); - if (err) { -- verbose("R%d offset is outside of the packet\n", regno); -+ verbose(env, "R%d offset is outside of the packet\n", regno); - return err; - } - return err; -@@ -969,7 +975,7 @@ static int check_ctx_access(struct bpf_v - return 0; - } - -- verbose("invalid bpf_context access off=%d size=%d\n", off, size); -+ verbose(env, "invalid bpf_context access off=%d size=%d\n", off, size); - return -EACCES; - } - -@@ -987,7 +993,8 @@ static bool is_pointer_value(struct bpf_ - return __is_pointer_value(env->allow_ptr_leaks, &env->cur_state.regs[regno]); - } - --static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg, -+static int check_pkt_ptr_alignment(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, - int off, int size, bool strict) - { - struct tnum reg_off; -@@ -1012,7 +1019,8 @@ static int check_pkt_ptr_alignment(const - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -- verbose("misaligned packet access off %d+%s+%d+%d size %d\n", -+ verbose(env, -+ "misaligned packet access off %d+%s+%d+%d size %d\n", - ip_align, tn_buf, reg->off, off, size); - return -EACCES; - } -@@ -1020,7 +1028,8 @@ static int check_pkt_ptr_alignment(const - return 0; - } - --static int check_generic_ptr_alignment(const struct bpf_reg_state *reg, -+static int check_generic_ptr_alignment(struct bpf_verifier_env *env, -+ const struct bpf_reg_state *reg, - const char *pointer_desc, - int off, int size, bool strict) - { -@@ -1035,7 +1044,7 @@ static int check_generic_ptr_alignment(c - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -- verbose("misaligned %saccess off %s+%d+%d size %d\n", -+ verbose(env, "misaligned %saccess off %s+%d+%d size %d\n", - pointer_desc, tn_buf, reg->off, off, size); - return -EACCES; - } -@@ -1053,7 +1062,7 @@ static int check_ptr_alignment(struct bp - switch (reg->type) { - case PTR_TO_PACKET: - /* special case, because of NET_IP_ALIGN */ -- return check_pkt_ptr_alignment(reg, off, size, strict); -+ return check_pkt_ptr_alignment(env, reg, off, size, strict); - case PTR_TO_MAP_VALUE: - pointer_desc = "value "; - break; -@@ -1071,7 +1080,8 @@ static int check_ptr_alignment(struct bp - default: - break; - } -- return check_generic_ptr_alignment(reg, pointer_desc, off, size, strict); -+ return check_generic_ptr_alignment(env, reg, pointer_desc, off, size, -+ strict); - } - - /* truncate register to smaller size (in bytes) -@@ -1126,27 +1136,27 @@ static int check_mem_access(struct bpf_v - if (reg->type == PTR_TO_MAP_VALUE) { - if (t == BPF_WRITE && value_regno >= 0 && - is_pointer_value(env, value_regno)) { -- verbose("R%d leaks addr into map\n", value_regno); -+ verbose(env, "R%d leaks addr into map\n", value_regno); - return -EACCES; - } - - err = check_map_access(env, regno, off, size); - if (!err && t == BPF_READ && value_regno >= 0) -- mark_reg_unknown(state->regs, value_regno); -+ mark_reg_unknown(env, state->regs, value_regno); - - } else if (reg->type == PTR_TO_CTX) { - enum bpf_reg_type reg_type = SCALAR_VALUE; - - if (t == BPF_WRITE && value_regno >= 0 && - is_pointer_value(env, value_regno)) { -- verbose("R%d leaks addr into ctx\n", value_regno); -+ verbose(env, "R%d leaks addr into ctx\n", value_regno); - return -EACCES; - } - /* ctx accesses must be at a fixed offset, so that we can - * determine what type of data were returned. - */ - if (reg->off) { -- verbose("dereference of modified ctx ptr R%d off=%d+%d, ctx+const is allowed, ctx+const+const is not\n", -+ verbose(env, "dereference of modified ctx ptr R%d off=%d+%d, ctx+const is allowed, ctx+const+const is not\n", - regno, reg->off, off - reg->off); - return -EACCES; - } -@@ -1154,7 +1164,8 @@ static int check_mem_access(struct bpf_v - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -- verbose("variable ctx access var_off=%s off=%d size=%d", -+ verbose(env, -+ "variable ctx access var_off=%s off=%d size=%d", - tn_buf, off, size); - return -EACCES; - } -@@ -1165,9 +1176,10 @@ static int check_mem_access(struct bpf_v - * the offset is zero. - */ - if (reg_type == SCALAR_VALUE) -- mark_reg_unknown(state->regs, value_regno); -+ mark_reg_unknown(env, state->regs, value_regno); - else -- mark_reg_known_zero(state->regs, value_regno); -+ mark_reg_known_zero(env, state->regs, -+ value_regno); - state->regs[value_regno].id = 0; - state->regs[value_regno].off = 0; - state->regs[value_regno].range = 0; -@@ -1183,13 +1195,14 @@ static int check_mem_access(struct bpf_v - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); -- verbose("variable stack access var_off=%s off=%d size=%d", -+ verbose(env, "variable stack access var_off=%s off=%d size=%d", - tn_buf, off, size); - return -EACCES; - } - off += reg->var_off.value; - if (off >= 0 || off < -MAX_BPF_STACK) { -- verbose("invalid stack off=%d size=%d\n", off, size); -+ verbose(env, "invalid stack off=%d size=%d\n", off, -+ size); - return -EACCES; - } - -@@ -1200,28 +1213,31 @@ static int check_mem_access(struct bpf_v - if (!env->allow_ptr_leaks && - state->stack_slot_type[MAX_BPF_STACK + off] == STACK_SPILL && - size != BPF_REG_SIZE) { -- verbose("attempt to corrupt spilled pointer on stack\n"); -+ verbose(env, "attempt to corrupt spilled pointer on stack\n"); - return -EACCES; - } -- err = check_stack_write(state, off, size, value_regno); -+ err = check_stack_write(env, state, off, size, -+ value_regno); - } else { -- err = check_stack_read(state, off, size, value_regno); -+ err = check_stack_read(env, state, off, size, -+ value_regno); - } - } else if (reg->type == PTR_TO_PACKET) { - if (t == BPF_WRITE && !may_access_direct_pkt_data(env, NULL, t)) { -- verbose("cannot write into packet\n"); -+ verbose(env, "cannot write into packet\n"); - return -EACCES; - } - if (t == BPF_WRITE && value_regno >= 0 && - is_pointer_value(env, value_regno)) { -- verbose("R%d leaks addr into packet\n", value_regno); -+ verbose(env, "R%d leaks addr into packet\n", -+ value_regno); - return -EACCES; - } - err = check_packet_access(env, regno, off, size); - if (!err && t == BPF_READ && value_regno >= 0) -- mark_reg_unknown(state->regs, value_regno); -+ mark_reg_unknown(env, state->regs, value_regno); - } else { -- verbose("R%d invalid mem access '%s'\n", -+ verbose(env, "R%d invalid mem access '%s'\n", - regno, reg_type_str[reg->type]); - return -EACCES; - } -@@ -1240,7 +1256,7 @@ static int check_xadd(struct bpf_verifie - - if ((BPF_SIZE(insn->code) != BPF_W && BPF_SIZE(insn->code) != BPF_DW) || - insn->imm != 0) { -- verbose("BPF_XADD uses reserved fields\n"); -+ verbose(env, "BPF_XADD uses reserved fields\n"); - return -EINVAL; - } - -@@ -1255,7 +1271,7 @@ static int check_xadd(struct bpf_verifie - return err; - - if (is_pointer_value(env, insn->src_reg)) { -- verbose("R%d leaks addr into mem\n", insn->src_reg); -+ verbose(env, "R%d leaks addr into mem\n", insn->src_reg); - return -EACCES; - } - -@@ -1296,7 +1312,7 @@ static int check_stack_boundary(struct b - register_is_null(regs[regno])) - return 0; - -- verbose("R%d type=%s expected=%s\n", regno, -+ verbose(env, "R%d type=%s expected=%s\n", regno, - reg_type_str[regs[regno].type], - reg_type_str[PTR_TO_STACK]); - return -EACCES; -@@ -1307,14 +1323,14 @@ static int check_stack_boundary(struct b - char tn_buf[48]; - - tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off); -- verbose("invalid variable stack read R%d var_off=%s\n", -+ verbose(env, "invalid variable stack read R%d var_off=%s\n", - regno, tn_buf); - return -EACCES; - } - off = regs[regno].off + regs[regno].var_off.value; - if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 || - access_size <= 0) { -- verbose("invalid stack type R%d off=%d access_size=%d\n", -+ verbose(env, "invalid stack type R%d off=%d access_size=%d\n", - regno, off, access_size); - return -EACCES; - } -@@ -1330,7 +1346,7 @@ static int check_stack_boundary(struct b - - for (i = 0; i < access_size; i++) { - if (state->stack_slot_type[MAX_BPF_STACK + off + i] != STACK_MISC) { -- verbose("invalid indirect read from stack off %d+%d size %d\n", -+ verbose(env, "invalid indirect read from stack off %d+%d size %d\n", - off, i, access_size); - return -EACCES; - } -@@ -1372,7 +1388,8 @@ static int check_func_arg(struct bpf_ver - - if (arg_type == ARG_ANYTHING) { - if (is_pointer_value(env, regno)) { -- verbose("R%d leaks addr into helper function\n", regno); -+ verbose(env, "R%d leaks addr into helper function\n", -+ regno); - return -EACCES; - } - return 0; -@@ -1380,7 +1397,7 @@ static int check_func_arg(struct bpf_ver - - if (type == PTR_TO_PACKET && - !may_access_direct_pkt_data(env, meta, BPF_READ)) { -- verbose("helper access to the packet is not allowed\n"); -+ verbose(env, "helper access to the packet is not allowed\n"); - return -EACCES; - } - -@@ -1416,7 +1433,7 @@ static int check_func_arg(struct bpf_ver - goto err_type; - meta->raw_mode = arg_type == ARG_PTR_TO_UNINIT_MEM; - } else { -- verbose("unsupported arg_type %d\n", arg_type); -+ verbose(env, "unsupported arg_type %d\n", arg_type); - return -EFAULT; - } - -@@ -1434,7 +1451,7 @@ static int check_func_arg(struct bpf_ver - * we have to check map_key here. Otherwise it means - * that kernel subsystem misconfigured verifier - */ -- verbose("invalid map_ptr to access map->key\n"); -+ verbose(env, "invalid map_ptr to access map->key\n"); - return -EACCES; - } - if (type == PTR_TO_PACKET) -@@ -1450,7 +1467,7 @@ static int check_func_arg(struct bpf_ver - */ - if (!meta->map_ptr) { - /* kernel subsystem misconfigured verifier */ -- verbose("invalid map_ptr to access map->value\n"); -+ verbose(env, "invalid map_ptr to access map->value\n"); - return -EACCES; - } - if (type == PTR_TO_PACKET) -@@ -1470,7 +1487,8 @@ static int check_func_arg(struct bpf_ver - */ - if (regno == 0) { - /* kernel subsystem misconfigured verifier */ -- verbose("ARG_CONST_SIZE cannot be first argument\n"); -+ verbose(env, -+ "ARG_CONST_SIZE cannot be first argument\n"); - return -EACCES; - } - -@@ -1487,7 +1505,7 @@ static int check_func_arg(struct bpf_ver - meta = NULL; - - if (reg->smin_value < 0) { -- verbose("R%d min value is negative, either use unsigned or 'var &= const'\n", -+ verbose(env, "R%d min value is negative, either use unsigned or 'var &= const'\n", - regno); - return -EACCES; - } -@@ -1501,7 +1519,7 @@ static int check_func_arg(struct bpf_ver - } - - if (reg->umax_value >= BPF_MAX_VAR_SIZ) { -- verbose("R%d unbounded memory access, use 'var &= const' or 'if (var < const)'\n", -+ verbose(env, "R%d unbounded memory access, use 'var &= const' or 'if (var < const)'\n", - regno); - return -EACCES; - } -@@ -1512,12 +1530,13 @@ static int check_func_arg(struct bpf_ver - - return err; - err_type: -- verbose("R%d type=%s expected=%s\n", regno, -+ verbose(env, "R%d type=%s expected=%s\n", regno, - reg_type_str[type], reg_type_str[expected_type]); - return -EACCES; - } - --static int check_map_func_compatibility(struct bpf_map *map, int func_id) -+static int check_map_func_compatibility(struct bpf_verifier_env *env, -+ struct bpf_map *map, int func_id) - { - if (!map) - return 0; -@@ -1603,7 +1622,7 @@ static int check_map_func_compatibility( - - return 0; - error: -- verbose("cannot pass map_type %d into func %s#%d\n", -+ verbose(env, "cannot pass map_type %d into func %s#%d\n", - map->map_type, func_id_name(func_id), func_id); - return -EINVAL; - } -@@ -1638,7 +1657,7 @@ static void clear_all_pkt_pointers(struc - for (i = 0; i < MAX_BPF_REG; i++) - if (regs[i].type == PTR_TO_PACKET || - regs[i].type == PTR_TO_PACKET_END) -- mark_reg_unknown(regs, i); -+ mark_reg_unknown(env, regs, i); - - for (i = 0; i < MAX_BPF_STACK; i += BPF_REG_SIZE) { - if (state->stack_slot_type[i] != STACK_SPILL) -@@ -1662,7 +1681,8 @@ static int check_call(struct bpf_verifie - - /* find function prototype */ - if (func_id < 0 || func_id >= __BPF_FUNC_MAX_ID) { -- verbose("invalid func %s#%d\n", func_id_name(func_id), func_id); -+ verbose(env, "invalid func %s#%d\n", func_id_name(func_id), -+ func_id); - return -EINVAL; - } - -@@ -1670,13 +1690,14 @@ static int check_call(struct bpf_verifie - fn = env->prog->aux->ops->get_func_proto(func_id); - - if (!fn) { -- verbose("unknown func %s#%d\n", func_id_name(func_id), func_id); -+ verbose(env, "unknown func %s#%d\n", func_id_name(func_id), -+ func_id); - return -EINVAL; - } - - /* eBPF programs must be GPL compatible to use GPL-ed functions */ - if (!env->prog->gpl_compatible && fn->gpl_only) { -- verbose("cannot call GPL only function from proprietary program\n"); -+ verbose(env, "cannot call GPL only function from proprietary program\n"); - return -EINVAL; - } - -@@ -1690,7 +1711,7 @@ static int check_call(struct bpf_verifie - */ - err = check_raw_mode(fn); - if (err) { -- verbose("kernel subsystem misconfigured func %s#%d\n", -+ verbose(env, "kernel subsystem misconfigured func %s#%d\n", - func_id_name(func_id), func_id); - return err; - } -@@ -1723,14 +1744,14 @@ static int check_call(struct bpf_verifie - - /* reset caller saved regs */ - for (i = 0; i < CALLER_SAVED_REGS; i++) { -- mark_reg_not_init(regs, caller_saved[i]); -+ mark_reg_not_init(env, regs, caller_saved[i]); - check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK); - } - - /* update return register (already marked as written above) */ - if (fn->ret_type == RET_INTEGER) { - /* sets type to SCALAR_VALUE */ -- mark_reg_unknown(regs, BPF_REG_0); -+ mark_reg_unknown(env, regs, BPF_REG_0); - } else if (fn->ret_type == RET_VOID) { - regs[BPF_REG_0].type = NOT_INIT; - } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL) { -@@ -1738,14 +1759,15 @@ static int check_call(struct bpf_verifie - - regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL; - /* There is no offset yet applied, variable or fixed */ -- mark_reg_known_zero(regs, BPF_REG_0); -+ mark_reg_known_zero(env, regs, BPF_REG_0); - regs[BPF_REG_0].off = 0; - /* remember map_ptr, so that check_map_access() - * can check 'value_size' boundary of memory access - * to map element returned from bpf_map_lookup_elem() - */ - if (meta.map_ptr == NULL) { -- verbose("kernel subsystem misconfigured verifier\n"); -+ verbose(env, -+ "kernel subsystem misconfigured verifier\n"); - return -EINVAL; - } - regs[BPF_REG_0].map_ptr = meta.map_ptr; -@@ -1756,12 +1778,12 @@ static int check_call(struct bpf_verifie - else if (insn_aux->map_ptr != meta.map_ptr) - insn_aux->map_ptr = BPF_MAP_PTR_POISON; - } else { -- verbose("unknown return type %d of func %s#%d\n", -+ verbose(env, "unknown return type %d of func %s#%d\n", - fn->ret_type, func_id_name(func_id), func_id); - return -EINVAL; - } - -- err = check_map_func_compatibility(meta.map_ptr, func_id); -+ err = check_map_func_compatibility(env, meta.map_ptr, func_id); - if (err) - return err; - -@@ -1847,39 +1869,42 @@ static int adjust_ptr_min_max_vals(struc - dst_reg = ®s[dst]; - - if (WARN_ON_ONCE(known && (smin_val != smax_val))) { -- print_verifier_state(&env->cur_state); -- verbose("verifier internal error: known but bad sbounds\n"); -+ print_verifier_state(env, &env->cur_state); -+ verbose(env, -+ "verifier internal error: known but bad sbounds\n"); - return -EINVAL; - } - if (WARN_ON_ONCE(known && (umin_val != umax_val))) { -- print_verifier_state(&env->cur_state); -- verbose("verifier internal error: known but bad ubounds\n"); -+ print_verifier_state(env, &env->cur_state); -+ verbose(env, -+ "verifier internal error: known but bad ubounds\n"); - return -EINVAL; - } - - if (BPF_CLASS(insn->code) != BPF_ALU64) { - /* 32-bit ALU ops on pointers produce (meaningless) scalars */ - if (!env->allow_ptr_leaks) -- verbose("R%d 32-bit pointer arithmetic prohibited\n", -+ verbose(env, -+ "R%d 32-bit pointer arithmetic prohibited\n", - dst); - return -EACCES; - } - - if (ptr_reg->type == PTR_TO_MAP_VALUE_OR_NULL) { - if (!env->allow_ptr_leaks) -- verbose("R%d pointer arithmetic on PTR_TO_MAP_VALUE_OR_NULL prohibited, null-check it first\n", -+ verbose(env, "R%d pointer arithmetic on PTR_TO_MAP_VALUE_OR_NULL prohibited, null-check it first\n", - dst); - return -EACCES; - } - if (ptr_reg->type == CONST_PTR_TO_MAP) { - if (!env->allow_ptr_leaks) -- verbose("R%d pointer arithmetic on CONST_PTR_TO_MAP prohibited\n", -+ verbose(env, "R%d pointer arithmetic on CONST_PTR_TO_MAP prohibited\n", - dst); - return -EACCES; - } - if (ptr_reg->type == PTR_TO_PACKET_END) { - if (!env->allow_ptr_leaks) -- verbose("R%d pointer arithmetic on PTR_TO_PACKET_END prohibited\n", -+ verbose(env, "R%d pointer arithmetic on PTR_TO_PACKET_END prohibited\n", - dst); - return -EACCES; - } -@@ -1948,7 +1973,7 @@ static int adjust_ptr_min_max_vals(struc - if (dst_reg == off_reg) { - /* scalar -= pointer. Creates an unknown scalar */ - if (!env->allow_ptr_leaks) -- verbose("R%d tried to subtract pointer from scalar\n", -+ verbose(env, "R%d tried to subtract pointer from scalar\n", - dst); - return -EACCES; - } -@@ -1958,7 +1983,7 @@ static int adjust_ptr_min_max_vals(struc - */ - if (ptr_reg->type == PTR_TO_STACK) { - if (!env->allow_ptr_leaks) -- verbose("R%d subtraction from stack pointer prohibited\n", -+ verbose(env, "R%d subtraction from stack pointer prohibited\n", - dst); - return -EACCES; - } -@@ -2013,13 +2038,13 @@ static int adjust_ptr_min_max_vals(struc - * ptr &= ~3 which would reduce min_value by 3.) - */ - if (!env->allow_ptr_leaks) -- verbose("R%d bitwise operator %s on pointer prohibited\n", -+ verbose(env, "R%d bitwise operator %s on pointer prohibited\n", - dst, bpf_alu_string[opcode >> 4]); - return -EACCES; - default: - /* other operators (e.g. MUL,LSH) produce non-pointer results */ - if (!env->allow_ptr_leaks) -- verbose("R%d pointer arithmetic with %s operator prohibited\n", -+ verbose(env, "R%d pointer arithmetic with %s operator prohibited\n", - dst, bpf_alu_string[opcode >> 4]); - return -EACCES; - } -@@ -2194,7 +2219,7 @@ static int adjust_scalar_min_max_vals(st - /* Shifts greater than 31 or 63 are undefined. - * This includes shifts by a negative number. - */ -- mark_reg_unknown(regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->dst_reg); - break; - } - /* We lose all sign bit information (except what we can pick -@@ -2222,7 +2247,7 @@ static int adjust_scalar_min_max_vals(st - /* Shifts greater than 31 or 63 are undefined. - * This includes shifts by a negative number. - */ -- mark_reg_unknown(regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->dst_reg); - break; - } - /* BPF_RSH is an unsigned shift. If the value in dst_reg might -@@ -2252,7 +2277,7 @@ static int adjust_scalar_min_max_vals(st - __update_reg_bounds(dst_reg); - break; - default: -- mark_reg_unknown(regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->dst_reg); - break; - } - -@@ -2290,12 +2315,12 @@ static int adjust_reg_min_max_vals(struc - * an arbitrary scalar. - */ - if (!env->allow_ptr_leaks) { -- verbose("R%d pointer %s pointer prohibited\n", -+ verbose(env, "R%d pointer %s pointer prohibited\n", - insn->dst_reg, - bpf_alu_string[opcode >> 4]); - return -EACCES; - } -- mark_reg_unknown(regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->dst_reg); - return 0; - } else { - /* scalar += pointer -@@ -2347,13 +2372,13 @@ static int adjust_reg_min_max_vals(struc - - /* Got here implies adding two SCALAR_VALUEs */ - if (WARN_ON_ONCE(ptr_reg)) { -- print_verifier_state(&env->cur_state); -- verbose("verifier internal error: unexpected ptr_reg\n"); -+ print_verifier_state(env, &env->cur_state); -+ verbose(env, "verifier internal error: unexpected ptr_reg\n"); - return -EINVAL; - } - if (WARN_ON(!src_reg)) { -- print_verifier_state(&env->cur_state); -- verbose("verifier internal error: no src_reg\n"); -+ print_verifier_state(env, &env->cur_state); -+ verbose(env, "verifier internal error: no src_reg\n"); - return -EINVAL; - } - return adjust_scalar_min_max_vals(env, insn, dst_reg, *src_reg); -@@ -2371,14 +2396,14 @@ static int check_alu_op(struct bpf_verif - if (BPF_SRC(insn->code) != 0 || - insn->src_reg != BPF_REG_0 || - insn->off != 0 || insn->imm != 0) { -- verbose("BPF_NEG uses reserved fields\n"); -+ verbose(env, "BPF_NEG uses reserved fields\n"); - return -EINVAL; - } - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0 || - (insn->imm != 16 && insn->imm != 32 && insn->imm != 64) || - BPF_CLASS(insn->code) == BPF_ALU64) { -- verbose("BPF_END uses reserved fields\n"); -+ verbose(env, "BPF_END uses reserved fields\n"); - return -EINVAL; - } - } -@@ -2389,7 +2414,7 @@ static int check_alu_op(struct bpf_verif - return err; - - if (is_pointer_value(env, insn->dst_reg)) { -- verbose("R%d pointer arithmetic prohibited\n", -+ verbose(env, "R%d pointer arithmetic prohibited\n", - insn->dst_reg); - return -EACCES; - } -@@ -2403,7 +2428,7 @@ static int check_alu_op(struct bpf_verif - - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0 || insn->off != 0) { -- verbose("BPF_MOV uses reserved fields\n"); -+ verbose(env, "BPF_MOV uses reserved fields\n"); - return -EINVAL; - } - -@@ -2413,7 +2438,7 @@ static int check_alu_op(struct bpf_verif - return err; - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0) { -- verbose("BPF_MOV uses reserved fields\n"); -+ verbose(env, "BPF_MOV uses reserved fields\n"); - return -EINVAL; - } - } -@@ -2433,11 +2458,12 @@ static int check_alu_op(struct bpf_verif - } else { - /* R1 = (u32) R2 */ - if (is_pointer_value(env, insn->src_reg)) { -- verbose("R%d partial copy of pointer\n", -+ verbose(env, -+ "R%d partial copy of pointer\n", - insn->src_reg); - return -EACCES; - } -- mark_reg_unknown(regs, insn->dst_reg); -+ mark_reg_unknown(env, regs, insn->dst_reg); - coerce_reg_to_size(®s[insn->dst_reg], 4); - } - } else { -@@ -2455,14 +2481,14 @@ static int check_alu_op(struct bpf_verif - } - - } else if (opcode > BPF_END) { -- verbose("invalid BPF_ALU opcode %x\n", opcode); -+ verbose(env, "invalid BPF_ALU opcode %x\n", opcode); - return -EINVAL; - - } else { /* all other ALU ops: and, sub, xor, add, ... */ - - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0 || insn->off != 0) { -- verbose("BPF_ALU uses reserved fields\n"); -+ verbose(env, "BPF_ALU uses reserved fields\n"); - return -EINVAL; - } - /* check src1 operand */ -@@ -2471,7 +2497,7 @@ static int check_alu_op(struct bpf_verif - return err; - } else { - if (insn->src_reg != BPF_REG_0 || insn->off != 0) { -- verbose("BPF_ALU uses reserved fields\n"); -+ verbose(env, "BPF_ALU uses reserved fields\n"); - return -EINVAL; - } - } -@@ -2483,7 +2509,7 @@ static int check_alu_op(struct bpf_verif - - if ((opcode == BPF_MOD || opcode == BPF_DIV) && - BPF_SRC(insn->code) == BPF_K && insn->imm == 0) { -- verbose("div by zero\n"); -+ verbose(env, "div by zero\n"); - return -EINVAL; - } - -@@ -2492,7 +2518,7 @@ static int check_alu_op(struct bpf_verif - int size = BPF_CLASS(insn->code) == BPF_ALU64 ? 64 : 32; - - if (insn->imm < 0 || insn->imm >= size) { -- verbose("invalid shift %d\n", insn->imm); -+ verbose(env, "invalid shift %d\n", insn->imm); - return -EINVAL; - } - } -@@ -2853,13 +2879,13 @@ static int check_cond_jmp_op(struct bpf_ - int err; - - if (opcode > BPF_JSLE) { -- verbose("invalid BPF_JMP opcode %x\n", opcode); -+ verbose(env, "invalid BPF_JMP opcode %x\n", opcode); - return -EINVAL; - } - - if (BPF_SRC(insn->code) == BPF_X) { - if (insn->imm != 0) { -- verbose("BPF_JMP uses reserved fields\n"); -+ verbose(env, "BPF_JMP uses reserved fields\n"); - return -EINVAL; - } - -@@ -2869,13 +2895,13 @@ static int check_cond_jmp_op(struct bpf_ - return err; - - if (is_pointer_value(env, insn->src_reg)) { -- verbose("R%d pointer comparison prohibited\n", -+ verbose(env, "R%d pointer comparison prohibited\n", - insn->src_reg); - return -EACCES; - } - } else { - if (insn->src_reg != BPF_REG_0) { -- verbose("BPF_JMP uses reserved fields\n"); -+ verbose(env, "BPF_JMP uses reserved fields\n"); - return -EINVAL; - } - } -@@ -2991,11 +3017,12 @@ static int check_cond_jmp_op(struct bpf_ - /* pkt_end <= pkt_data' */ - find_good_pkt_pointers(this_branch, ®s[insn->src_reg], true); - } else if (is_pointer_value(env, insn->dst_reg)) { -- verbose("R%d pointer comparison prohibited\n", insn->dst_reg); -+ verbose(env, "R%d pointer comparison prohibited\n", -+ insn->dst_reg); - return -EACCES; - } -- if (verifier_log.level) -- print_verifier_state(this_branch); -+ if (env->log.level) -+ print_verifier_state(env, this_branch); - return 0; - } - -@@ -3014,11 +3041,11 @@ static int check_ld_imm(struct bpf_verif - int err; - - if (BPF_SIZE(insn->code) != BPF_DW) { -- verbose("invalid BPF_LD_IMM insn\n"); -+ verbose(env, "invalid BPF_LD_IMM insn\n"); - return -EINVAL; - } - if (insn->off != 0) { -- verbose("BPF_LD_IMM64 uses reserved fields\n"); -+ verbose(env, "BPF_LD_IMM64 uses reserved fields\n"); - return -EINVAL; - } - -@@ -3076,14 +3103,14 @@ static int check_ld_abs(struct bpf_verif - int i, err; - - if (!may_access_skb(env->prog->type)) { -- verbose("BPF_LD_[ABS|IND] instructions not allowed for this program type\n"); -+ verbose(env, "BPF_LD_[ABS|IND] instructions not allowed for this program type\n"); - return -EINVAL; - } - - if (insn->dst_reg != BPF_REG_0 || insn->off != 0 || - BPF_SIZE(insn->code) == BPF_DW || - (mode == BPF_ABS && insn->src_reg != BPF_REG_0)) { -- verbose("BPF_LD_[ABS|IND] uses reserved fields\n"); -+ verbose(env, "BPF_LD_[ABS|IND] uses reserved fields\n"); - return -EINVAL; - } - -@@ -3093,7 +3120,8 @@ static int check_ld_abs(struct bpf_verif - return err; - - if (regs[BPF_REG_6].type != PTR_TO_CTX) { -- verbose("at the time of BPF_LD_ABS|IND R6 != pointer to skb\n"); -+ verbose(env, -+ "at the time of BPF_LD_ABS|IND R6 != pointer to skb\n"); - return -EINVAL; - } - -@@ -3106,7 +3134,7 @@ static int check_ld_abs(struct bpf_verif - - /* reset caller saved regs to unreadable */ - for (i = 0; i < CALLER_SAVED_REGS; i++) { -- mark_reg_not_init(regs, caller_saved[i]); -+ mark_reg_not_init(env, regs, caller_saved[i]); - check_reg_arg(env, caller_saved[i], DST_OP_NO_MARK); - } - -@@ -3114,7 +3142,7 @@ static int check_ld_abs(struct bpf_verif - * the value fetched from the packet. - * Already marked as written above. - */ -- mark_reg_unknown(regs, BPF_REG_0); -+ mark_reg_unknown(env, regs, BPF_REG_0); - return 0; - } - -@@ -3178,7 +3206,7 @@ static int push_insn(int t, int w, int e - return 0; - - if (w < 0 || w >= env->prog->len) { -- verbose("jump out of range from insn %d to %d\n", t, w); -+ verbose(env, "jump out of range from insn %d to %d\n", t, w); - return -EINVAL; - } - -@@ -3195,13 +3223,13 @@ static int push_insn(int t, int w, int e - insn_stack[cur_stack++] = w; - return 1; - } else if ((insn_state[w] & 0xF0) == DISCOVERED) { -- verbose("back-edge from insn %d to %d\n", t, w); -+ verbose(env, "back-edge from insn %d to %d\n", t, w); - return -EINVAL; - } else if (insn_state[w] == EXPLORED) { - /* forward- or cross-edge */ - insn_state[t] = DISCOVERED | e; - } else { -- verbose("insn state internal bug\n"); -+ verbose(env, "insn state internal bug\n"); - return -EFAULT; - } - return 0; -@@ -3295,7 +3323,7 @@ peek_stack: - mark_explored: - insn_state[t] = EXPLORED; - if (cur_stack-- <= 0) { -- verbose("pop stack internal bug\n"); -+ verbose(env, "pop stack internal bug\n"); - ret = -EFAULT; - goto err_free; - } -@@ -3304,7 +3332,7 @@ mark_explored: - check_state: - for (i = 0; i < insn_cnt; i++) { - if (insn_state[i] != EXPLORED) { -- verbose("unreachable insn %d\n", i); -+ verbose(env, "unreachable insn %d\n", i); - ret = -EINVAL; - goto err_free; - } -@@ -3683,7 +3711,7 @@ static int do_check(struct bpf_verifier_ - int insn_processed = 0; - bool do_print_state = false; - -- init_reg_state(regs); -+ init_reg_state(env, regs); - state->parent = NULL; - insn_idx = 0; - for (;;) { -@@ -3692,7 +3720,7 @@ static int do_check(struct bpf_verifier_ - int err; - - if (insn_idx >= insn_cnt) { -- verbose("invalid insn idx %d insn_cnt %d\n", -+ verbose(env, "invalid insn idx %d insn_cnt %d\n", - insn_idx, insn_cnt); - return -EFAULT; - } -@@ -3701,7 +3729,8 @@ static int do_check(struct bpf_verifier_ - class = BPF_CLASS(insn->code); - - if (++insn_processed > BPF_COMPLEXITY_LIMIT_INSNS) { -- verbose("BPF program is too large. Processed %d insn\n", -+ verbose(env, -+ "BPF program is too large. Processed %d insn\n", - insn_processed); - return -E2BIG; - } -@@ -3711,12 +3740,12 @@ static int do_check(struct bpf_verifier_ - return err; - if (err == 1) { - /* found equivalent state, can prune the search */ -- if (verifier_log.level) { -+ if (env->log.level) { - if (do_print_state) -- verbose("\nfrom %d to %d: safe\n", -+ verbose(env, "\nfrom %d to %d: safe\n", - prev_insn_idx, insn_idx); - else -- verbose("%d: safe\n", insn_idx); -+ verbose(env, "%d: safe\n", insn_idx); - } - goto process_bpf_exit; - } -@@ -3724,19 +3753,18 @@ static int do_check(struct bpf_verifier_ - if (need_resched()) - cond_resched(); - -- if (verifier_log.level > 1 || -- (verifier_log.level && do_print_state)) { -- if (verifier_log.level > 1) -- verbose("%d:", insn_idx); -+ if (env->log.level > 1 || (env->log.level && do_print_state)) { -+ if (env->log.level > 1) -+ verbose(env, "%d:", insn_idx); - else -- verbose("\nfrom %d to %d:", -+ verbose(env, "\nfrom %d to %d:", - prev_insn_idx, insn_idx); -- print_verifier_state(&env->cur_state); -+ print_verifier_state(env, &env->cur_state); - do_print_state = false; - } - -- if (verifier_log.level) { -- verbose("%d: ", insn_idx); -+ if (env->log.level) { -+ verbose(env, "%d: ", insn_idx); - print_bpf_insn(env, insn); - } - -@@ -3794,7 +3822,7 @@ static int do_check(struct bpf_verifier_ - * src_reg == stack|map in some other branch. - * Reject it. - */ -- verbose("same insn cannot be used with different pointers\n"); -+ verbose(env, "same insn cannot be used with different pointers\n"); - return -EINVAL; - } - -@@ -3834,14 +3862,14 @@ static int do_check(struct bpf_verifier_ - } else if (dst_reg_type != *prev_dst_type && - (dst_reg_type == PTR_TO_CTX || - *prev_dst_type == PTR_TO_CTX)) { -- verbose("same insn cannot be used with different pointers\n"); -+ verbose(env, "same insn cannot be used with different pointers\n"); - return -EINVAL; - } - - } else if (class == BPF_ST) { - if (BPF_MODE(insn->code) != BPF_MEM || - insn->src_reg != BPF_REG_0) { -- verbose("BPF_ST uses reserved fields\n"); -+ verbose(env, "BPF_ST uses reserved fields\n"); - return -EINVAL; - } - /* check src operand */ -@@ -3864,7 +3892,7 @@ static int do_check(struct bpf_verifier_ - insn->off != 0 || - insn->src_reg != BPF_REG_0 || - insn->dst_reg != BPF_REG_0) { -- verbose("BPF_CALL uses reserved fields\n"); -+ verbose(env, "BPF_CALL uses reserved fields\n"); - return -EINVAL; - } - -@@ -3877,7 +3905,7 @@ static int do_check(struct bpf_verifier_ - insn->imm != 0 || - insn->src_reg != BPF_REG_0 || - insn->dst_reg != BPF_REG_0) { -- verbose("BPF_JA uses reserved fields\n"); -+ verbose(env, "BPF_JA uses reserved fields\n"); - return -EINVAL; - } - -@@ -3889,7 +3917,7 @@ static int do_check(struct bpf_verifier_ - insn->imm != 0 || - insn->src_reg != BPF_REG_0 || - insn->dst_reg != BPF_REG_0) { -- verbose("BPF_EXIT uses reserved fields\n"); -+ verbose(env, "BPF_EXIT uses reserved fields\n"); - return -EINVAL; - } - -@@ -3904,7 +3932,7 @@ static int do_check(struct bpf_verifier_ - return err; - - if (is_pointer_value(env, BPF_REG_0)) { -- verbose("R0 leaks addr as return value\n"); -+ verbose(env, "R0 leaks addr as return value\n"); - return -EACCES; - } - -@@ -3937,19 +3965,19 @@ process_bpf_exit: - insn_idx++; - env->insn_aux_data[insn_idx].seen = true; - } else { -- verbose("invalid BPF_LD mode\n"); -+ verbose(env, "invalid BPF_LD mode\n"); - return -EINVAL; - } - } else { -- verbose("unknown insn class %d\n", class); -+ verbose(env, "unknown insn class %d\n", class); - return -EINVAL; - } - - insn_idx++; - } - -- verbose("processed %d insns, stack depth %d\n", -- insn_processed, env->prog->aux->stack_depth); -+ verbose(env, "processed %d insns, stack depth %d\n", insn_processed, -+ env->prog->aux->stack_depth); - return 0; - } - -@@ -3961,7 +3989,8 @@ static int check_map_prealloc(struct bpf - !(map->map_flags & BPF_F_NO_PREALLOC); - } - --static int check_map_prog_compatibility(struct bpf_map *map, -+static int check_map_prog_compatibility(struct bpf_verifier_env *env, -+ struct bpf_map *map, - struct bpf_prog *prog) - - { -@@ -3972,12 +4001,12 @@ static int check_map_prog_compatibility( - */ - if (prog->type == BPF_PROG_TYPE_PERF_EVENT) { - if (!check_map_prealloc(map)) { -- verbose("perf_event programs can only use preallocated hash map\n"); -+ verbose(env, "perf_event programs can only use preallocated hash map\n"); - return -EINVAL; - } - if (map->inner_map_meta && - !check_map_prealloc(map->inner_map_meta)) { -- verbose("perf_event programs can only use preallocated inner hash map\n"); -+ verbose(env, "perf_event programs can only use preallocated inner hash map\n"); - return -EINVAL; - } - } -@@ -4000,14 +4029,14 @@ static int replace_map_fd_with_map_ptr(s - for (i = 0; i < insn_cnt; i++, insn++) { - if (BPF_CLASS(insn->code) == BPF_LDX && - (BPF_MODE(insn->code) != BPF_MEM || insn->imm != 0)) { -- verbose("BPF_LDX uses reserved fields\n"); -+ verbose(env, "BPF_LDX uses reserved fields\n"); - return -EINVAL; - } - - if (BPF_CLASS(insn->code) == BPF_STX && - ((BPF_MODE(insn->code) != BPF_MEM && - BPF_MODE(insn->code) != BPF_XADD) || insn->imm != 0)) { -- verbose("BPF_STX uses reserved fields\n"); -+ verbose(env, "BPF_STX uses reserved fields\n"); - return -EINVAL; - } - -@@ -4018,7 +4047,7 @@ static int replace_map_fd_with_map_ptr(s - if (i == insn_cnt - 1 || insn[1].code != 0 || - insn[1].dst_reg != 0 || insn[1].src_reg != 0 || - insn[1].off != 0) { -- verbose("invalid bpf_ld_imm64 insn\n"); -+ verbose(env, "invalid bpf_ld_imm64 insn\n"); - return -EINVAL; - } - -@@ -4027,19 +4056,20 @@ static int replace_map_fd_with_map_ptr(s - goto next_insn; - - if (insn->src_reg != BPF_PSEUDO_MAP_FD) { -- verbose("unrecognized bpf_ld_imm64 insn\n"); -+ verbose(env, -+ "unrecognized bpf_ld_imm64 insn\n"); - return -EINVAL; - } - - f = fdget(insn->imm); - map = __bpf_map_get(f); - if (IS_ERR(map)) { -- verbose("fd %d is not pointing to valid bpf_map\n", -+ verbose(env, "fd %d is not pointing to valid bpf_map\n", - insn->imm); - return PTR_ERR(map); - } - -- err = check_map_prog_compatibility(map, env->prog); -+ err = check_map_prog_compatibility(env, map, env->prog); - if (err) { - fdput(f); - return err; -@@ -4183,7 +4213,7 @@ static int convert_ctx_accesses(struct b - cnt = ops->gen_prologue(insn_buf, env->seen_direct_write, - env->prog); - if (cnt >= ARRAY_SIZE(insn_buf)) { -- verbose("bpf verifier is misconfigured\n"); -+ verbose(env, "bpf verifier is misconfigured\n"); - return -EINVAL; - } else if (cnt) { - new_prog = bpf_patch_insn_data(env, 0, insn_buf, cnt); -@@ -4231,7 +4261,7 @@ static int convert_ctx_accesses(struct b - u8 size_code; - - if (type == BPF_WRITE) { -- verbose("bpf verifier narrow ctx access misconfigured\n"); -+ verbose(env, "bpf verifier narrow ctx access misconfigured\n"); - return -EINVAL; - } - -@@ -4250,7 +4280,7 @@ static int convert_ctx_accesses(struct b - &target_size); - if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf) || - (ctx_field_size && !target_size)) { -- verbose("bpf verifier is misconfigured\n"); -+ verbose(env, "bpf verifier is misconfigured\n"); - return -EINVAL; - } - -@@ -4332,7 +4362,7 @@ static int fixup_bpf_calls(struct bpf_ve - - cnt = map_ptr->ops->map_gen_lookup(map_ptr, insn_buf); - if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf)) { -- verbose("bpf verifier is misconfigured\n"); -+ verbose(env, "bpf verifier is misconfigured\n"); - return -EINVAL; - } - -@@ -4376,7 +4406,8 @@ patch_call_imm: - * programs to call them, must be real in-kernel functions - */ - if (!fn->func) { -- verbose("kernel subsystem misconfigured func %s#%d\n", -+ verbose(env, -+ "kernel subsystem misconfigured func %s#%d\n", - func_id_name(insn->imm), insn->imm); - return -EFAULT; - } -@@ -4410,8 +4441,8 @@ static void free_states(struct bpf_verif - - int bpf_check(struct bpf_prog **prog, union bpf_attr *attr) - { -- struct bpf_verifer_log *log = &verifier_log; - struct bpf_verifier_env *env; -+ struct bpf_verifer_log *log; - int ret = -EINVAL; - - /* 'struct bpf_verifier_env' can be global, but since it's not small, -@@ -4420,6 +4451,7 @@ int bpf_check(struct bpf_prog **prog, un - env = kzalloc(sizeof(struct bpf_verifier_env), GFP_KERNEL); - if (!env) - return -ENOMEM; -+ log = &env->log; - - env->insn_aux_data = vzalloc(sizeof(struct bpf_insn_aux_data) * - (*prog)->len); -@@ -4438,7 +4470,6 @@ int bpf_check(struct bpf_prog **prog, un - log->level = attr->log_level; - log->ubuf = (char __user *) (unsigned long) attr->log_buf; - log->len_total = attr->log_size; -- log->len_used = 0; - - ret = -EINVAL; - /* log attributes have to be sane */ -@@ -4450,8 +4481,6 @@ int bpf_check(struct bpf_prog **prog, un - log->kbuf = vmalloc(log->len_total); - if (!log->kbuf) - goto err_unlock; -- } else { -- log->level = 0; - } - - env->strict_alignment = !!(attr->prog_flags & BPF_F_STRICT_ALIGNMENT); -@@ -4565,8 +4594,6 @@ int bpf_analyzer(struct bpf_prog *prog, - /* grab the mutex to protect few globals used by verifier */ - mutex_lock(&bpf_verifier_lock); - -- verifier_log.level = 0; -- - env->strict_alignment = false; - if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) - env->strict_alignment = true; diff --git a/debian/patches/bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch b/debian/patches/bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch deleted file mode 100644 index bedfd0282..000000000 --- a/debian/patches/bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch +++ /dev/null @@ -1,60 +0,0 @@ -From: Benjamin Poirier -Date: Mon, 11 Dec 2017 16:26:40 +0900 -Subject: e1000e: Fix e1000_check_for_copper_link_ich8lan return value. -Origin: https://marc.info/?l=linux-kernel&m=151297726823919&w=2 -Bug: https://bugzilla.kernel.org/show_bug.cgi?id=198047 -Bug-Debian: https://bugs.debian.org/885348 - -e1000e_check_for_copper_link() and e1000_check_for_copper_link_ich8lan() -are the two functions that may be assigned to mac.ops.check_for_link when -phy.media_type == e1000_media_type_copper. Commit 19110cfbb34d ("e1000e: -Separate signaling for link check/link up") changed the meaning of the -return value of check_for_link for copper media but only adjusted the first -function. This patch adjusts the second function likewise. - -Reported-by: Christian Hesse -Reported-by: Gabriel C -Link: https://bugzilla.kernel.org/show_bug.cgi?id=198047 -Fixes: 19110cfbb34d ("e1000e: Separate signaling for link check/link up") -Tested-by: Christian Hesse -Signed-off-by: Benjamin Poirier ---- - drivers/net/ethernet/intel/e1000e/ich8lan.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - ---- a/drivers/net/ethernet/intel/e1000e/ich8lan.c -+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c -@@ -1367,6 +1367,9 @@ out: - * Checks to see of the link status of the hardware has changed. If a - * change in link status has been detected, then we read the PHY registers - * to get the current speed/duplex if link exists. -+ * -+ * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link -+ * up). - **/ - static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) - { -@@ -1382,7 +1385,7 @@ static s32 e1000_check_for_copper_link_i - * Change or Rx Sequence Error interrupt. - */ - if (!mac->get_link_status) -- return 0; -+ return 1; - - /* First we want to see if the MII Status Register reports - * link. If so, then we want to get the current speed/duplex -@@ -1613,10 +1616,12 @@ static s32 e1000_check_for_copper_link_i - * different link partner. - */ - ret_val = e1000e_config_fc_after_link_up(hw); -- if (ret_val) -+ if (ret_val) { - e_dbg("Error configuring flow control\n"); -+ return ret_val; -+ } - -- return ret_val; -+ return 1; - } - - static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) diff --git a/debian/patches/bugfix/all/kvm-fix-stack-out-of-bounds-read-in-write_mmio.patch b/debian/patches/bugfix/all/kvm-fix-stack-out-of-bounds-read-in-write_mmio.patch deleted file mode 100644 index c460e89c5..000000000 --- a/debian/patches/bugfix/all/kvm-fix-stack-out-of-bounds-read-in-write_mmio.patch +++ /dev/null @@ -1,153 +0,0 @@ -From: Wanpeng Li -Date: Thu, 14 Dec 2017 17:40:50 -0800 -Subject: KVM: Fix stack-out-of-bounds read in write_mmio -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -Origin: https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit?id=e39d200fa5bf5b94a0948db0dae44c1b73b84a56 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17741 - -Reported by syzkaller: - - BUG: KASAN: stack-out-of-bounds in write_mmio+0x11e/0x270 [kvm] - Read of size 8 at addr ffff8803259df7f8 by task syz-executor/32298 - - CPU: 6 PID: 32298 Comm: syz-executor Tainted: G OE 4.15.0-rc2+ #18 - Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016 - Call Trace: - dump_stack+0xab/0xe1 - print_address_description+0x6b/0x290 - kasan_report+0x28a/0x370 - write_mmio+0x11e/0x270 [kvm] - emulator_read_write_onepage+0x311/0x600 [kvm] - emulator_read_write+0xef/0x240 [kvm] - emulator_fix_hypercall+0x105/0x150 [kvm] - em_hypercall+0x2b/0x80 [kvm] - x86_emulate_insn+0x2b1/0x1640 [kvm] - x86_emulate_instruction+0x39a/0xb90 [kvm] - handle_exception+0x1b4/0x4d0 [kvm_intel] - vcpu_enter_guest+0x15a0/0x2640 [kvm] - kvm_arch_vcpu_ioctl_run+0x549/0x7d0 [kvm] - kvm_vcpu_ioctl+0x479/0x880 [kvm] - do_vfs_ioctl+0x142/0x9a0 - SyS_ioctl+0x74/0x80 - entry_SYSCALL_64_fastpath+0x23/0x9a - -The path of patched vmmcall will patch 3 bytes opcode 0F 01 C1(vmcall) -to the guest memory, however, write_mmio tracepoint always prints 8 bytes -through *(u64 *)val since kvm splits the mmio access into 8 bytes. This -leaks 5 bytes from the kernel stack (CVE-2017-17741). This patch fixes -it by just accessing the bytes which we operate on. - -Before patch: - -syz-executor-5567 [007] .... 51370.561696: kvm_mmio: mmio write len 3 gpa 0x10 val 0x1ffff10077c1010f - -After patch: - -syz-executor-13416 [002] .... 51302.299573: kvm_mmio: mmio write len 3 gpa 0x10 val 0xc1010f - -Reported-by: Dmitry Vyukov -Reviewed-by: Darren Kenny -Reviewed-by: Marc Zyngier -Tested-by: Marc Zyngier -Cc: Paolo Bonzini -Cc: Radim Krčmář -Cc: Marc Zyngier -Cc: Christoffer Dall -Signed-off-by: Wanpeng Li -Signed-off-by: Paolo Bonzini ---- - arch/x86/kvm/x86.c | 8 ++++---- - include/trace/events/kvm.h | 7 +++++-- - virt/kvm/arm/mmio.c | 6 +++--- - 3 files changed, 12 insertions(+), 9 deletions(-) - ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -4362,7 +4362,7 @@ static int vcpu_mmio_read(struct kvm_vcp - addr, n, v)) - && kvm_io_bus_read(vcpu, KVM_MMIO_BUS, addr, n, v)) - break; -- trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, *(u64 *)v); -+ trace_kvm_mmio(KVM_TRACE_MMIO_READ, n, addr, v); - handled += n; - addr += n; - len -= n; -@@ -4621,7 +4621,7 @@ static int read_prepare(struct kvm_vcpu - { - if (vcpu->mmio_read_completed) { - trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes, -- vcpu->mmio_fragments[0].gpa, *(u64 *)val); -+ vcpu->mmio_fragments[0].gpa, val); - vcpu->mmio_read_completed = 0; - return 1; - } -@@ -4643,14 +4643,14 @@ static int write_emulate(struct kvm_vcpu - - static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val) - { -- trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, *(u64 *)val); -+ trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val); - return vcpu_mmio_write(vcpu, gpa, bytes, val); - } - - static int read_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, - void *val, int bytes) - { -- trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, 0); -+ trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, NULL); - return X86EMUL_IO_NEEDED; - } - ---- a/include/trace/events/kvm.h -+++ b/include/trace/events/kvm.h -@@ -211,7 +211,7 @@ TRACE_EVENT(kvm_ack_irq, - { KVM_TRACE_MMIO_WRITE, "write" } - - TRACE_EVENT(kvm_mmio, -- TP_PROTO(int type, int len, u64 gpa, u64 val), -+ TP_PROTO(int type, int len, u64 gpa, void *val), - TP_ARGS(type, len, gpa, val), - - TP_STRUCT__entry( -@@ -225,7 +225,10 @@ TRACE_EVENT(kvm_mmio, - __entry->type = type; - __entry->len = len; - __entry->gpa = gpa; -- __entry->val = val; -+ __entry->val = 0; -+ if (val) -+ memcpy(&__entry->val, val, -+ min_t(u32, sizeof(__entry->val), len)); - ), - - TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx", ---- a/virt/kvm/arm/mmio.c -+++ b/virt/kvm/arm/mmio.c -@@ -112,7 +112,7 @@ int kvm_handle_mmio_return(struct kvm_vc - } - - trace_kvm_mmio(KVM_TRACE_MMIO_READ, len, run->mmio.phys_addr, -- data); -+ &data); - data = vcpu_data_host_to_guest(vcpu, data, len); - vcpu_set_reg(vcpu, vcpu->arch.mmio_decode.rt, data); - } -@@ -182,14 +182,14 @@ int io_mem_abort(struct kvm_vcpu *vcpu, - data = vcpu_data_guest_to_host(vcpu, vcpu_get_reg(vcpu, rt), - len); - -- trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, fault_ipa, data); -+ trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, len, fault_ipa, &data); - kvm_mmio_write_buf(data_buf, len, data); - - ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, fault_ipa, len, - data_buf); - } else { - trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, len, -- fault_ipa, 0); -+ fault_ipa, NULL); - - ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, fault_ipa, len, - data_buf); diff --git a/debian/patches/debian/bpf-avoid-abi-change-in-4.14.14.patch b/debian/patches/debian/bpf-avoid-abi-change-in-4.14.14.patch new file mode 100644 index 000000000..39b879e10 --- /dev/null +++ b/debian/patches/debian/bpf-avoid-abi-change-in-4.14.14.patch @@ -0,0 +1,138 @@ +From: Ben Hutchings +Date: Thu, 18 Jan 2018 05:17:34 +0000 +Subject: bpf: Avoid ABI change in 4.14.14 +Forwarded: not-needed + +Commit b2157399cc98 "bpf: prevent out-of-bounds speculation" added one +member each to struct bpf_map and struct bpf_array (which is +effectively a sub-type of bpf_map). Changing the size of struct +bpf_array is an ABI change, since the array contents immediately +follows the structure. However, bpf_map::work is not used (or even +initialised) until after the map's refcount drops to zero. We can +therefore move the new members into a union with it. + +--- +--- a/include/linux/bpf.h ++++ b/include/linux/bpf.h +@@ -51,10 +51,20 @@ struct bpf_map { + u32 pages; + u32 id; + int numa_node; +- bool unpriv_array; ++ + struct user_struct *user; + const struct bpf_map_ops *ops; ++#ifdef __GENKSYMS__ + struct work_struct work; ++#else ++ union { ++ struct work_struct work; ++ struct { ++ bool unpriv_array; ++ u32 index_mask; ++ }; ++ }; ++#endif + atomic_t usercnt; + struct bpf_map *inner_map_meta; + }; +@@ -196,7 +206,6 @@ struct bpf_prog_aux { + struct bpf_array { + struct bpf_map map; + u32 elem_size; +- u32 index_mask; + /* 'ownership' of prog_array is claimed by the first program that + * is going to use this map or by the first program which FD is stored + * in the map to make sure that all callers and callees have the same +--- a/kernel/bpf/arraymap.c ++++ b/kernel/bpf/arraymap.c +@@ -104,7 +104,7 @@ static struct bpf_map *array_map_alloc(u + array = bpf_map_area_alloc(array_size, numa_node); + if (!array) + return ERR_PTR(-ENOMEM); +- array->index_mask = index_mask; ++ array->map.index_mask = index_mask; + array->map.unpriv_array = unpriv; + + /* copy mandatory map attributes */ +@@ -141,7 +141,7 @@ static void *array_map_lookup_elem(struc + if (unlikely(index >= array->map.max_entries)) + return NULL; + +- return array->value + array->elem_size * (index & array->index_mask); ++ return array->value + array->elem_size * (index & array->map.index_mask); + } + + /* emit BPF instructions equivalent to C code of array_map_lookup_elem() */ +@@ -158,7 +158,7 @@ static u32 array_map_gen_lookup(struct b + *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); + if (map->unpriv_array) { + *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 4); +- *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); ++ *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->map.index_mask); + } else { + *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 3); + } +@@ -183,7 +183,7 @@ static void *percpu_array_map_lookup_ele + if (unlikely(index >= array->map.max_entries)) + return NULL; + +- return this_cpu_ptr(array->pptrs[index & array->index_mask]); ++ return this_cpu_ptr(array->pptrs[index & array->map.index_mask]); + } + + int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value) +@@ -203,7 +203,7 @@ int bpf_percpu_array_copy(struct bpf_map + */ + size = round_up(map->value_size, 8); + rcu_read_lock(); +- pptr = array->pptrs[index & array->index_mask]; ++ pptr = array->pptrs[index & array->map.index_mask]; + for_each_possible_cpu(cpu) { + bpf_long_memcpy(value + off, per_cpu_ptr(pptr, cpu), size); + off += size; +@@ -251,11 +251,11 @@ static int array_map_update_elem(struct + return -EEXIST; + + if (array->map.map_type == BPF_MAP_TYPE_PERCPU_ARRAY) +- memcpy(this_cpu_ptr(array->pptrs[index & array->index_mask]), ++ memcpy(this_cpu_ptr(array->pptrs[index & array->map.index_mask]), + value, map->value_size); + else + memcpy(array->value + +- array->elem_size * (index & array->index_mask), ++ array->elem_size * (index & array->map.index_mask), + value, map->value_size); + return 0; + } +@@ -289,7 +289,7 @@ int bpf_percpu_array_update(struct bpf_m + */ + size = round_up(map->value_size, 8); + rcu_read_lock(); +- pptr = array->pptrs[index & array->index_mask]; ++ pptr = array->pptrs[index & array->map.index_mask]; + for_each_possible_cpu(cpu) { + bpf_long_memcpy(per_cpu_ptr(pptr, cpu), value + off, size); + off += size; +@@ -651,7 +651,7 @@ static u32 array_of_map_gen_lookup(struc + *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); + if (map->unpriv_array) { + *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 6); +- *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); ++ *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->map.index_mask); + } else { + *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 5); + } +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -4344,9 +4344,7 @@ static int fixup_bpf_calls(struct bpf_ve + insn_buf[0] = BPF_JMP_IMM(BPF_JGE, BPF_REG_3, + map_ptr->max_entries, 2); + insn_buf[1] = BPF_ALU32_IMM(BPF_AND, BPF_REG_3, +- container_of(map_ptr, +- struct bpf_array, +- map)->index_mask); ++ map_ptr->index_mask); + insn_buf[2] = *insn; + cnt = 3; + new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); diff --git a/debian/patches/series b/debian/patches/series index 8e4bcf339..6b7526171 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -81,7 +81,6 @@ bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch bugfix/all/i40e-i40evf-organize-and-re-number-feature-flags.patch bugfix/all/i40e-fix-flags-declaration.patch bugfix/all/xen-time-do-not-decrease-steal-time-after-live-migra.patch -bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch @@ -126,13 +125,6 @@ bugfix/all/netfilter-xt_osf-add-missing-permission-checks.patch bugfix/all/media-dvb-usb-v2-lmedm04-Improve-logic-checking-of-w.patch bugfix/all/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_.patch bugfix/all/media-hdpvr-fix-an-error-handling-path-in-hdpvr_prob.patch -bugfix/all/kvm-fix-stack-out-of-bounds-read-in-write_mmio.patch -bugfix/all/bluetooth-prevent-stack-info-leak-from-the-efs-element.patch -bugfix/all/bpf-encapsulate-verifier-log-state-into-a-structure.patch -bugfix/all/bpf-move-global-verifier-log-into-verifier-environme.patch -bugfix/all/bpf-fix-integer-overflows.patch -bugfix/all/RDS-Heap-OOB-write-in-rds_message_alloc_sgs.patch -bugfix/all/RDS-null-pointer-dereference-in-rds_atomic_free_op.patch bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch # Fix exported symbol versions @@ -164,3 +156,4 @@ features/arm/dwmac-sun8i/0008-ARM-dts-sunxi-h3-h5-represent-the-mdio-switch-used features/arm64/tegra210-smp/0001-arm64-tegra-Add-CPU-and-PSCI-nodes-for-NVIDIA-Tegra2.patch # ABI maintenance +debian/bpf-avoid-abi-change-in-4.14.14.patch From e30f878e1d0aba263a53e86818d095f19a3da303 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Thu, 18 Jan 2018 14:28:56 +0100 Subject: [PATCH 05/11] ALSA: seq: Make ioctls race-free (CVE-2018-1000004) --- debian/changelog | 1 + .../all/alsa-seq-make-ioctls-race-free.patch | 64 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 66 insertions(+) create mode 100644 debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch diff --git a/debian/changelog b/debian/changelog index 412c0e2db..13d6522a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -111,6 +111,7 @@ linux (4.14.14-1) UNRELEASED; urgency=medium [ Salvatore Bonaccorso ] * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) + * ALSA: seq: Make ioctls race-free (CVE-2018-1000004) [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 diff --git a/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch b/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch new file mode 100644 index 000000000..9f3b21507 --- /dev/null +++ b/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch @@ -0,0 +1,64 @@ +From: Takashi Iwai +Date: Tue, 9 Jan 2018 23:11:03 +0100 +Subject: ALSA: seq: Make ioctls race-free +Origin: https://git.kernel.org/linus/b3defb791b26ea0683a93a4f49c77ec45ec96f10 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-1000004 + +The ALSA sequencer ioctls have no protection against racy calls while +the concurrent operations may lead to interfere with each other. As +reported recently, for example, the concurrent calls of setting client +pool with a combination of write calls may lead to either the +unkillable dead-lock or UAF. + +As a slightly big hammer solution, this patch introduces the mutex to +make each ioctl exclusive. Although this may reduce performance via +parallel ioctl calls, usually it's not demanded for sequencer usages, +hence it should be negligible. + +Reported-by: Luo Quan +Reviewed-by: Kees Cook +Reviewed-by: Greg Kroah-Hartman +Cc: +Signed-off-by: Takashi Iwai +--- + sound/core/seq/seq_clientmgr.c | 3 +++ + sound/core/seq/seq_clientmgr.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index 6e22eea72654..d01913404581 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -221,6 +221,7 @@ static struct snd_seq_client *seq_create_client1(int client_index, int poolsize) + rwlock_init(&client->ports_lock); + mutex_init(&client->ports_mutex); + INIT_LIST_HEAD(&client->ports_list_head); ++ mutex_init(&client->ioctl_mutex); + + /* find free slot in the client table */ + spin_lock_irqsave(&clients_lock, flags); +@@ -2130,7 +2131,9 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd, + return -EFAULT; + } + ++ mutex_lock(&client->ioctl_mutex); + err = handler->func(client, &buf); ++ mutex_unlock(&client->ioctl_mutex); + if (err >= 0) { + /* Some commands includes a bug in 'dir' field. */ + if (handler->cmd == SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT || +diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h +index c6614254ef8a..0611e1e0ed5b 100644 +--- a/sound/core/seq/seq_clientmgr.h ++++ b/sound/core/seq/seq_clientmgr.h +@@ -61,6 +61,7 @@ struct snd_seq_client { + struct list_head ports_list_head; + rwlock_t ports_lock; + struct mutex ports_mutex; ++ struct mutex ioctl_mutex; + int convert32; /* convert 32->64bit */ + + /* output pool */ +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index 6b7526171..968622e91 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -126,6 +126,7 @@ bugfix/all/media-dvb-usb-v2-lmedm04-Improve-logic-checking-of-w.patch bugfix/all/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_.patch bugfix/all/media-hdpvr-fix-an-error-handling-path-in-hdpvr_prob.patch bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch +bugfix/all/alsa-seq-make-ioctls-race-free.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From 893c18929088b688856ec179fd1023419fe4df00 Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Fri, 26 Jan 2018 10:26:54 +0200 Subject: [PATCH 06/11] [arm64] embed reset drivers to kernel Reset drivers are tiny and are needed often early in boot. Kconfig selects the drivers automatically with arch specific defaults: config COMMON_RESET_HI6220 default ARCH_HISI So remove explicit driver selections from arm 64 config and let kconfig dependencies handle it for us. --- debian/changelog | 3 +++ debian/config/arm64/config | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 13d6522a1..bb64f2203 100644 --- a/debian/changelog +++ b/debian/changelog @@ -116,6 +116,9 @@ linux (4.14.14-1) UNRELEASED; urgency=medium [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 + [ Riku Voipio ] + * [arm64] build in reset drivers + -- Salvatore Bonaccorso Tue, 16 Jan 2018 20:50:23 +0100 linux (4.14.13-1) unstable; urgency=medium diff --git a/debian/config/arm64/config b/debian/config/arm64/config index 41e29d0b2..45f8c0ec8 100644 --- a/debian/config/arm64/config +++ b/debian/config/arm64/config @@ -780,12 +780,6 @@ CONFIG_QCOM_Q6V5_PIL=m ## file: drivers/reset/Kconfig ## CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_MESON=y - -## -## file: drivers/reset/hisilicon/Kconfig -## -CONFIG_COMMON_RESET_HI6220=m ## ## file: drivers/rpmsg/Kconfig From 3a8185547513c05e20b7219da0c35db837fd4cf1 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 28 Jan 2018 14:29:41 +0100 Subject: [PATCH 07/11] Update to 4.14.15 --- debian/changelog | 91 ++++++++++++++++++- .../all/alsa-seq-make-ioctls-race-free.patch | 64 ------------- ...sp-gf119-add-missing-drive-vfunc-ptr.patch | 47 ---------- ...asynchronous-aborts-for-SATA-devices.patch | 57 ------------ debian/patches/series | 3 - 5 files changed, 89 insertions(+), 173 deletions(-) delete mode 100644 debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch delete mode 100644 debian/patches/bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch delete mode 100644 debian/patches/bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch diff --git a/debian/changelog b/debian/changelog index bb64f2203..7491a2763 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.14.14-1) UNRELEASED; urgency=medium +linux (4.14.15-1) UNRELEASED; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.14.14 @@ -108,10 +108,97 @@ linux (4.14.14-1) UNRELEASED; urgency=medium - [x86] retpoline: Fill return stack buffer on vmexit - [x86] pti: Fix !PCID and sanitize defines - [x86] perf: Disable intel_bts when PTI + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.14.15 + - tools/objtool/Makefile: don't assume sync-check.sh is executable + - objtool: Fix seg fault with clang-compiled objects + - objtool: Fix Clang enum conversion warning + - objtool: Fix seg fault caused by missing parameter + - [powerpc*] pseries: Add H_GET_CPU_CHARACTERISTICS flags & wrapper + - [powerpc*] 64: Add macros for annotating the destination of rfid/hrfid + - [powerpc*] 64s: Simple RFI macro conversions + - [powerpc*] 64: Convert the syscall exit path to use RFI_TO_USER/KERNEL + - [powerpc*] 64: Convert fast_exception_return to use RFI_TO_USER/KERNEL + - [powerpc*] 64s: Convert slb_miss_common to use RFI_TO_USER/KERNEL + - [powerpc*] 64s: Add support for RFI flush of L1-D cache + - [powerpc*] 64s: Support disabling RFI flush with no_rfi_flush and nopti + - [powerpc*] pseries: Query hypervisor for RFI flush settings + - [powerpc*] powernv: Check device-tree for RFI flush settings + - futex: Avoid violating the 10th rule of futex + - futex: Prevent overflow by strengthen input validation + - ALSA: seq: Make ioctls race-free (CVE-2018-1000004) + - ALSA: pcm: Remove yet superfluous WARN_ON() + - ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant + - ALSA: hda - Apply the existing quirk to iMac 14,1 + - IB/hfi1: Prevent a NULL dereference + - RDMA/mlx5: Fix out-of-bound access while querying AH + - timers: Unconditionally check deferrable base + - af_key: fix buffer overread in verify_address_len() + - af_key: fix buffer overread in parse_exthdrs() + - iser-target: Fix possible use-after-free in connection establishment + error + - delayacct: Account blkio completion on the correct task + - objtool: Fix seg fault with gold linker + - [armhf] mmc: sdhci-esdhc-imx: Fix i.MX53 eSDHCv3 clock + - [x86] kasan: Panic if there is not enough memory to boot + - [x86] retpoline: Fill RSB on context switch for affected CPUs + - [x86] retpoline: Add LFENCE to the retpoline/RSB filling RSB macros + - objtool: Improve error message for bad file argument + - [x86] cpufeature: Move processor tracing out of scattered features + - module: Add retpoline tag to VERMAGIC + - [x86] intel_rdt/cqm: Prevent use after free + - [x86] mm/pkeys: Fix fill_sig_info_pkey + - [x86] idt: Mark IDT tables __initconst + - [x86] tsc: Future-proof native_calibrate_tsc() + - [x86] tsc: Fix erroneous TSC rate on Skylake Xeon + - pipe: avoid round_pipe_size() nr_pages overflow on 32-bit + - [x86] apic/vector: Fix off by one in error path + - [x86] mm: Clean up register saving in the __enc_copy() assembly code + - [x86] mm: Use a struct to reduce parameters for SME PGD mapping + - [x86] mm: Centralize PMD flags in sme_encrypt_kernel() + - [x86] mm: Prepare sme_encrypt_kernel() for PAGE aligned encryption + - [armhf] OMAP3: hwmod_data: add missing module_offs for MMC3 + - [x86] mm: Encrypt the initrd earlier for BSP microcode update + - Input: ALPS - fix multi-touch decoding on SS4 plus touchpads + - Input: synaptics-rmi4 - prevent UAF reported by KASAN + - [armhf] Input: twl6040-vibra - fix child-node lookup + - [armhf] Input: twl4030-vibra - fix sibling-node lookup + - tracing: Fix converting enum's from the map in trace_event_eval_update() + - phy: work around 'phys' references to usb-nop-xceiv devices + - [arm64] dts: marvell: armada-cp110: Fix clock resources for various node + - [armhf] sunxi_defconfig: Enable CMA + - [armel] dts: kirkwood: fix pin-muxing of MPP7 on OpenBlocks A7 + - can: peak: fix potential bug in packet fragmentation + - can: af_can: can_rcv(): replace WARN_ONCE by pr_warn_once + - can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once + - i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA + - proc: fix coredump vs read /proc/*/stat race + - libata: apply MAX_SEC_1024 to all LITEON EP1 series devices + - workqueue: avoid hard lockups in show_workqueue_state() + - [x86] drm/vmwgfx: fix memory corruption with legacy/sou connectors + - dm btree: fix serious bug in btree_split_beneath() + - dm thin metadata: THIN_MAX_CONCURRENT_LOCKS should be 6 + - dm integrity: don't store cipher request on the stack + - dm crypt: fix crash by adding missing check for auth key size + - dm crypt: wipe kernel key copy after IV initialization + - dm crypt: fix error return code in crypt_ctr() + - [x86] x86: Use __nostackprotect for sme_encrypt_kernel + - [alpha] PCI: Fix noname IRQ level detection + - [mips*] CM: Drop WARN_ON(vp != 0) + - [arm*] KVM: Check pagesize when allocating a hugepage at Stage 2 + - [arm64] KVM: Fix SMCCC handling of unimplemented SMC/HVC calls + - [x86] mce: Make machine check speculation protected + - retpoline: Introduce start/end markers of indirect thunk + - [x86] kprobes: Blacklist indirect thunk functions for kprobes + - [x86] kprobes: Disable optimizing on the function jumps to indirect + thunk + - [x86] retpoline: Optimize inline assembler for vmexit_fill_RSB + - [x86] mm: Rework wbinvd, hlt operation in stop_this_cpu() + - mm, page_vma_mapped: Drop faulty pointer arithmetics in check_pte() + - [arm64, armhf] net: mvpp2: do not disable GMAC padding + - [mips]: AR7: ensure the port type's FCR value is used [ Salvatore Bonaccorso ] * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) - * ALSA: seq: Make ioctls race-free (CVE-2018-1000004) [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 diff --git a/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch b/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch deleted file mode 100644 index 9f3b21507..000000000 --- a/debian/patches/bugfix/all/alsa-seq-make-ioctls-race-free.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Takashi Iwai -Date: Tue, 9 Jan 2018 23:11:03 +0100 -Subject: ALSA: seq: Make ioctls race-free -Origin: https://git.kernel.org/linus/b3defb791b26ea0683a93a4f49c77ec45ec96f10 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-1000004 - -The ALSA sequencer ioctls have no protection against racy calls while -the concurrent operations may lead to interfere with each other. As -reported recently, for example, the concurrent calls of setting client -pool with a combination of write calls may lead to either the -unkillable dead-lock or UAF. - -As a slightly big hammer solution, this patch introduces the mutex to -make each ioctl exclusive. Although this may reduce performance via -parallel ioctl calls, usually it's not demanded for sequencer usages, -hence it should be negligible. - -Reported-by: Luo Quan -Reviewed-by: Kees Cook -Reviewed-by: Greg Kroah-Hartman -Cc: -Signed-off-by: Takashi Iwai ---- - sound/core/seq/seq_clientmgr.c | 3 +++ - sound/core/seq/seq_clientmgr.h | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c -index 6e22eea72654..d01913404581 100644 ---- a/sound/core/seq/seq_clientmgr.c -+++ b/sound/core/seq/seq_clientmgr.c -@@ -221,6 +221,7 @@ static struct snd_seq_client *seq_create_client1(int client_index, int poolsize) - rwlock_init(&client->ports_lock); - mutex_init(&client->ports_mutex); - INIT_LIST_HEAD(&client->ports_list_head); -+ mutex_init(&client->ioctl_mutex); - - /* find free slot in the client table */ - spin_lock_irqsave(&clients_lock, flags); -@@ -2130,7 +2131,9 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd, - return -EFAULT; - } - -+ mutex_lock(&client->ioctl_mutex); - err = handler->func(client, &buf); -+ mutex_unlock(&client->ioctl_mutex); - if (err >= 0) { - /* Some commands includes a bug in 'dir' field. */ - if (handler->cmd == SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT || -diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h -index c6614254ef8a..0611e1e0ed5b 100644 ---- a/sound/core/seq/seq_clientmgr.h -+++ b/sound/core/seq/seq_clientmgr.h -@@ -61,6 +61,7 @@ struct snd_seq_client { - struct list_head ports_list_head; - rwlock_t ports_lock; - struct mutex ports_mutex; -+ struct mutex ioctl_mutex; - int convert32; /* convert 32->64bit */ - - /* output pool */ --- -2.11.0 - diff --git a/debian/patches/bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch b/debian/patches/bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch deleted file mode 100644 index 8ede212fb..000000000 --- a/debian/patches/bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Rob Clark -Date: Sat, 6 Jan 2018 10:59:41 -0500 -Subject: drm/nouveau/disp/gf119: add missing drive vfunc ptr -Origin: https://git.kernel.org/linus/1b5c7ef3d0d0610bda9b63263f7c5b7178d11015 -Bug-Debian: https://bugs.debian.org/880660 - -Fixes broken dp on GF119: - - Call Trace: - ? nvkm_dp_train_drive+0x183/0x2c0 [nouveau] - nvkm_dp_acquire+0x4f3/0xcd0 [nouveau] - nv50_disp_super_2_2+0x5d/0x470 [nouveau] - ? nvkm_devinit_pll_set+0xf/0x20 [nouveau] - gf119_disp_super+0x19c/0x2f0 [nouveau] - process_one_work+0x193/0x3c0 - worker_thread+0x35/0x3b0 - kthread+0x125/0x140 - ? process_one_work+0x3c0/0x3c0 - ? kthread_park+0x60/0x60 - ret_from_fork+0x25/0x30 - Code: Bad RIP value. - RIP: (null) RSP: ffffb1e243e4bc38 - CR2: 0000000000000000 - -Fixes: af85389c614a drm/nouveau/disp: shuffle functions around -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103421 -Signed-off-by: Rob Clark -Signed-off-by: Ben Skeggs ---- - drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c -index a2978a37b4f3..700fc754f28a 100644 ---- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c -+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgf119.c -@@ -174,6 +174,7 @@ gf119_sor = { - .links = gf119_sor_dp_links, - .power = g94_sor_dp_power, - .pattern = gf119_sor_dp_pattern, -+ .drive = gf119_sor_dp_drive, - .vcpi = gf119_sor_dp_vcpi, - .audio = gf119_sor_dp_audio, - .audio_sym = gf119_sor_dp_audio_sym, --- -2.15.1 - diff --git a/debian/patches/bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch b/debian/patches/bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch deleted file mode 100644 index 797c13a4a..000000000 --- a/debian/patches/bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Hannes Reinecke -Date: Wed, 10 Jan 2018 08:34:02 +0100 -Subject: Disable asynchronous aborts for SATA devices -Origin: https://marc.info/?l=linux-scsi&m=151557324907914 - -Handling CD-ROM devices from libsas is decidedly odd, as libata -relies on SCSI EH to be started to figure out that no medium is -present. -So we cannot do asynchronous aborts for SATA devices. - -Fixes: 909657615d9 ("scsi: libsas: allow async aborts") -Cc: # 4.12+ -Signed-off-by: Hannes Reinecke -Reviewed-by: Christoph Hellwig -Tested-by: Yves-Alexis Perez ---- - drivers/scsi/libsas/sas_scsi_host.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c -index 58476b728c57..c9406852c3e9 100644 ---- a/drivers/scsi/libsas/sas_scsi_host.c -+++ b/drivers/scsi/libsas/sas_scsi_host.c -@@ -486,15 +486,28 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type, - - int sas_eh_abort_handler(struct scsi_cmnd *cmd) - { -- int res; -+ int res = TMF_RESP_FUNC_FAILED; - struct sas_task *task = TO_SAS_TASK(cmd); - struct Scsi_Host *host = cmd->device->host; -+ struct domain_device *dev = cmd_to_domain_dev(cmd); - struct sas_internal *i = to_sas_internal(host->transportt); -+ unsigned long flags; - - if (!i->dft->lldd_abort_task) - return FAILED; - -- res = i->dft->lldd_abort_task(task); -+ spin_lock_irqsave(host->host_lock, flags); -+ /* We cannot do async aborts for SATA devices */ -+ if (dev_is_sata(dev) && !host->host_eh_scheduled) { -+ spin_unlock_irqrestore(host->host_lock, flags); -+ return FAILED; -+ } -+ spin_unlock_irqrestore(host->host_lock, flags); -+ -+ if (task) -+ res = i->dft->lldd_abort_task(task); -+ else -+ SAS_DPRINTK("no task to abort\n"); - if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE) - return SUCCESS; - --- -2.11.0 - diff --git a/debian/patches/series b/debian/patches/series index 968622e91..8dc50c625 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -81,8 +81,6 @@ bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch bugfix/all/i40e-i40evf-organize-and-re-number-feature-flags.patch bugfix/all/i40e-fix-flags-declaration.patch bugfix/all/xen-time-do-not-decrease-steal-time-after-live-migra.patch -bugfix/all/libsas-Disable-asynchronous-aborts-for-SATA-devices.patch -bugfix/all/drm-nouveau-disp-gf119-add-missing-drive-vfunc-ptr.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch # Miscellaneous features @@ -126,7 +124,6 @@ bugfix/all/media-dvb-usb-v2-lmedm04-Improve-logic-checking-of-w.patch bugfix/all/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_.patch bugfix/all/media-hdpvr-fix-an-error-handling-path-in-hdpvr_prob.patch bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch -bugfix/all/alsa-seq-make-ioctls-race-free.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From e5ce9cb87ec196d7afd2021d967452f18099da01 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 28 Jan 2018 15:06:29 +0100 Subject: [PATCH 08/11] Revert "module: Add retpoline tag to VERMAGIC" --- debian/changelog | 1 + ...module-add-retpoline-tag-to-vermagic.patch | 52 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 54 insertions(+) create mode 100644 debian/patches/debian/revert-module-add-retpoline-tag-to-vermagic.patch diff --git a/debian/changelog b/debian/changelog index 7491a2763..bef5b4298 100644 --- a/debian/changelog +++ b/debian/changelog @@ -199,6 +199,7 @@ linux (4.14.15-1) UNRELEASED; urgency=medium [ Salvatore Bonaccorso ] * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) + * Revert "module: Add retpoline tag to VERMAGIC" [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 diff --git a/debian/patches/debian/revert-module-add-retpoline-tag-to-vermagic.patch b/debian/patches/debian/revert-module-add-retpoline-tag-to-vermagic.patch new file mode 100644 index 000000000..2b4d0eacc --- /dev/null +++ b/debian/patches/debian/revert-module-add-retpoline-tag-to-vermagic.patch @@ -0,0 +1,52 @@ +From 5132ede0fe8092b043dae09a7cc32b8ae7272baa Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 24 Jan 2018 15:28:17 +0100 +Subject: Revert "module: Add retpoline tag to VERMAGIC" + +From: Greg Kroah-Hartman + +commit 5132ede0fe8092b043dae09a7cc32b8ae7272baa upstream. + +This reverts commit 6cfb521ac0d5b97470883ff9b7facae264b7ab12. + +Turns out distros do not want to make retpoline as part of their "ABI", +so this patch should not have been merged. Sorry Andi, this was my +fault, I suggested it when your original patch was the "correct" way of +doing this instead. + +Reported-by: Jiri Kosina +Fixes: 6cfb521ac0d5 ("module: Add retpoline tag to VERMAGIC") +Acked-by: Andi Kleen +Cc: Thomas Gleixner +Cc: David Woodhouse +Cc: rusty@rustcorp.com.au +Cc: arjan.van.de.ven@intel.com +Cc: jeyu@kernel.org +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/vermagic.h | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/include/linux/vermagic.h ++++ b/include/linux/vermagic.h +@@ -31,17 +31,11 @@ + #else + #define MODULE_RANDSTRUCT_PLUGIN + #endif +-#ifdef RETPOLINE +-#define MODULE_VERMAGIC_RETPOLINE "retpoline " +-#else +-#define MODULE_VERMAGIC_RETPOLINE "" +-#endif + + #define VERMAGIC_STRING \ + UTS_RELEASE " " \ + MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ + MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \ + MODULE_ARCH_VERMAGIC \ +- MODULE_RANDSTRUCT_PLUGIN \ +- MODULE_VERMAGIC_RETPOLINE ++ MODULE_RANDSTRUCT_PLUGIN + diff --git a/debian/patches/series b/debian/patches/series index 8dc50c625..dc77794c0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -155,3 +155,4 @@ features/arm64/tegra210-smp/0001-arm64-tegra-Add-CPU-and-PSCI-nodes-for-NVIDIA-T # ABI maintenance debian/bpf-avoid-abi-change-in-4.14.14.patch +debian/revert-module-add-retpoline-tag-to-vermagic.patch From e53a4aa3b85689d4eda460072016a0f28c68e021 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 28 Jan 2018 15:46:47 +0100 Subject: [PATCH 09/11] [rt] Update to 4.14.15-rt11 --- debian/changelog | 1 + ...c-keys-for-migrate_enable-nohz_activ.patch | 21 ++----- ...t-trigger-Documentation-to-histogram.patch | 2 +- ...unofficial-trace_recursive_lock-patc.patch | 6 +- ...imer-Correct-blantanly-wrong-comment.patch | 2 +- ...-Add-Documentation-for-log2-modifier.patch | 2 +- ...the-order-of-trace_types_lock-and-ev.patch | 26 ++++---- ...erneldoc-for-struct-hrtimer_cpu_base.patch | 2 +- ...pport-to-detect-and-avoid-duplicates.patch | 2 +- ...clock-argument-in-schedule_hrtimeout.patch | 2 +- ...-Remove-code-which-merges-duplicates.patch | 2 +- ...ve-lookups-from-tracing_map-hitcount.patch | 2 +- ...mer-Fix-hrtimer-function-description.patch | 2 +- ...interface-for-setting-absolute-time-.patch | 6 +- ...g-Increase-tracing-map-KEYS_MAX-size.patch | 2 +- ...OSIX-compliance-relative-CLOCK_REALT.patch | 2 +- ...fine-the-unimplemented-RINGBUF_TYPE_.patch | 26 ++++---- ...ake-traceprobe-parsing-code-reusable.patch | 4 +- ...07-hrtimer-Cleanup-hrtimer_mode-enum.patch | 2 +- ...racing-Add-timestamp_mode-trace-file.patch | 4 +- ...acing-Clean-up-hist_field_flags-enum.patch | 2 +- ...tracing-Add-hist_field_name-accessor.patch | 2 +- ...nt-triggers-access-to-ring_buffer_ev.patch | 2 +- ...Take-all-clock-bases-and-modes-into-.patch | 2 +- ...-buffer-event-param-to-hist-field-fu.patch | 2 +- .../rt/0009-tracing-Reimplement-log2.patch | 2 +- ...Print-hrtimer-mode-in-hrtimer_start-.patch | 2 +- ...r-Switch-for-loop-to-_ffs-evaluation.patch | 2 +- ...-out-hist-trigger-assignment-parsing.patch | 2 +- ...-running-timer-in-hrtimer_clock_base.patch | 2 +- ...g-Add-hist-trigger-timestamp-support.patch | 2 +- ...Make-room-in-struct-hrtimer_cpu_base.patch | 2 +- ...element-variable-support-to-tracing_.patch | 2 +- ...-Reduce-conditional-code-hres_active.patch | 2 +- ...g-Add-hist_data-member-to-hist_field.patch | 2 +- ...sor-functions-instead-of-direct-acce.patch | 2 +- ...s-modifier-for-hist-trigger-timestam.patch | 2 +- ...e-remote-enqueue-check-unconditional.patch | 2 +- ...dd-variable-support-to-hist-triggers.patch | 2 +- ...imer_cpu_base.next_timer-handling-un.patch | 2 +- ...for-variables-in-named-trigger-compa.patch | 2 +- ...ake-hrtimer_reprogramm-unconditional.patch | 2 +- ...17-tracing-Move-get_hist_field_flags.patch | 2 +- ...imer_force_reprogramm-unconditionall.patch | 2 +- ...le-expression-support-to-hist-trigge.patch | 2 +- ...mer-Unify-handling-of-hrtimer-remove.patch | 2 +- ...ralize-per-element-hist-trigger-data.patch | 2 +- ...mer-Unify-handling-of-remote-enqueue.patch | 2 +- ...cing_map_elt-to-hist_field-accessor-.patch | 2 +- ...ote-enqueue-decision-less-restrictiv.patch | 2 +- ...21-tracing-Add-hist_field-type-field.patch | 2 +- ...base-argument-from-hrtimer_reprogram.patch | 2 +- ...able-reference-handling-to-hist-trig.patch | 6 +- ...hrtimer-Split-hrtimer_start_range_ns.patch | 2 +- ...tracing-Add-hist-trigger-action-hook.patch | 2 +- ...timer-Split-__hrtimer_get_next_event.patch | 2 +- ...ing-Add-support-for-synthetic-events.patch | 2 +- ...save-irqrestore-around-__run_hrtimer.patch | 2 +- ...cing-Add-support-for-field-variables.patch | 2 +- ...k-bases-and-hrtimer-mode-for-soft-ir.patch | 2 +- ...-onmatch-hist-trigger-action-support.patch | 2 +- ...handling-of-hard-and-softirq-based-h.patch | 2 +- ...dd-onmax-hist-trigger-action-support.patch | 2 +- ...t-support-for-softirq-based-hrtimers.patch | 2 +- ...itespace-to-surround-hist-trigger-fi.patch | 2 +- ...ement-SOFT-HARD-clock-base-selection.patch | 2 +- ...cing-Add-cpu-field-for-hist-triggers.patch | 2 +- ...hrtimer_tasklet-with-softirq-based-h.patch | 2 +- ...-trigger-support-for-variable-refere.patch | 2 +- ...eplace-hrtimer-tasklet-with-softirq-.patch | 2 +- ...-error-error-facility-for-hist-trigg.patch | 2 +- ...ter-event-hist-trigger-Documentation.patch | 2 +- ...hrtimer-tasklet-with-softirq-hrtimer.patch | 2 +- .../0033-softirq-Remove-tasklet_hrtimer.patch | 2 +- ...ng-Make-tracing_set_clock-non-static.patch | 2 +- ...Replace-tasklet-with-softirq-hrtimer.patch | 2 +- ...-a-clock-attribute-for-hist-triggers.patch | 2 +- ...-trace_recursive_lock-limit-for-synt.patch | 4 +- ...Replace-tasklet-with-softirq-hrtimer.patch | 2 +- ...Replace-tasklet-with-softirq-hrtimer.patch | 10 +-- ...r-event-blurb-to-HIST_TRIGGERS-confi.patch | 2 +- ...-Add-inter-event-hist-triggers-testc.patch | 2 +- ...n-translation-section-permission-fau.patch | 2 +- ...recursive-locking-in-hci_send_to_cha.patch | 2 +- ...intk-drop-the-logbuf_lock-more-often.patch | 2 +- ...wngrade-preempt_disable-d-region-to-.patch | 2 +- ...-replace-seqcount_t-with-a-seqlock_t.patch | 2 +- ...kip-that-warning-but-only-on-sleepin.patch | 2 +- ...ull-your-plug-when-waiting-for-space.patch | 2 +- ...l-Prevent-scheduling-while-atomic-in.patch | 2 +- ...acpi_gbl_hardware-lock-back-to-a-raw.patch | 2 +- .../features/all/rt/add_migrate_disable.patch | 2 +- ...-a-locallock-instead-preempt_disable.patch | 2 +- .../arch-arm64-Add-lazy-preempt-support.patch | 2 +- ...ove-irq-handler-when-clock-is-unused.patch | 2 +- ...-tclib-default-to-tclib-timer-for-rt.patch | 2 +- .../all/rt/arm-convert-boot-lock-to-raw.patch | 2 +- .../rt/arm-disable-NEON-in-kernel-mode.patch | 2 +- .../all/rt/arm-enable-highmem-for-rt.patch | 2 +- .../rt/arm-highmem-flush-tlb-on-unmap.patch | 2 +- ...arm-include-definition-for-cpumask_t.patch | 2 +- ...probe-replace-patch_lock-to-raw-lock.patch | 2 +- .../all/rt/arm-preempt-lazy-support.patch | 2 +- .../all/rt/arm-unwind-use_raw_lock.patch | 2 +- ...arm64-xen--Make-XEN-depend-on-non-rt.patch | 2 +- .../rt/at91_dont_enable_disable_clock.patch | 2 +- .../rt/ata-disable-interrupts-if-non-rt.patch | 2 +- .../all/rt/block-blk-mq-use-swait.patch | 10 +-- ...k-mq-don-t-complete-requests-via-IPI.patch | 2 +- .../rt/block-mq-drop-preempt-disable.patch | 2 +- .../all/rt/block-mq-use-cpu_light.patch | 2 +- ...k-shorten-interrupt-disabled-regions.patch | 12 ++-- .../features/all/rt/block-use-cpu-chill.patch | 2 +- .../all/rt/bug-rt-dependend-variants.patch | 2 +- ...heduling-while-atomic-in-cgroup-code.patch | 2 +- ...roups-use-simple-wait-in-css_release.patch | 8 +-- ...om-don-t-print-that-the-init-is-done.patch | 2 +- ...ers-timer-atmel-pit-fix-double-free_.patch | 2 +- ...source-tclib-allow-higher-clockrates.patch | 2 +- .../completion-use-simple-wait-queues.patch | 2 +- .../all/rt/cond-resched-lock-rt-tweak.patch | 2 +- .../all/rt/cond-resched-softirq-rt.patch | 2 +- ...c-Protect-send_msg-with-a-local-lock.patch | 2 +- .../cpu-hotplug--Implement-CPU-pinning.patch | 2 +- ...-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch | 12 ++-- ...rop-K8-s-driver-from-beeing-selected.patch | 2 +- .../rt/cpumask-disable-offstack-on-rt.patch | 4 +- ...vert-callback_lock-to-raw_spinlock_t.patch | 2 +- ...-preempt-disabled-regions-more-algos.patch | 2 +- ...ypto-limit-more-FPU-enabled-sections.patch | 2 +- .../features/all/rt/debugobjects-rt.patch | 2 +- .../all/rt/delayacct-use-raw_spinlocks.patch | 30 +++++---- .../features/all/rt/dm-make-rt-aware.patch | 2 +- ...am-Replace-bit-spinlocks-with-rtmute.patch | 2 +- .../drivers-net-8139-disable-irq-nosync.patch | 2 +- ...rivers-net-vortex-fix-locking-issues.patch | 2 +- ...andom-reduce-preempt-disabled-region.patch | 2 +- .../rt/drivers-tty-fix-omap-lock-crap.patch | 2 +- ...rivers-tty-pl011-irq-disable-madness.patch | 2 +- ...-t-disable-preemption-in-zcomp_strea.patch | 2 +- ...-zcomp_stream_get-smp_processor_id-u.patch | 2 +- ...drm-i915-properly-init-lockdep-class.patch | 2 +- ...rq()_in_intel_pipe_update_startend().patch | 2 +- ...disableenable_rt()_where_recommended.patch | 2 +- .../all/rt/epoll-use-get-cpu-light.patch | 2 +- .../all/rt/fs-aio-simple-simple-work.patch | 2 +- .../features/all/rt/fs-block-rt-support.patch | 2 +- ...-back-explicit-INIT_HLIST_BL_HEAD-in.patch | 2 +- ...e-preemption-on-i_dir_seq-s-write-si.patch | 2 +- ...cache-use-cpu-chill-in-trylock-loops.patch | 2 +- ...use-swait_queue-instead-of-waitqueue.patch | 2 +- .../all/rt/fs-jbd-replace-bh_state-lock.patch | 2 +- ...ull-your-plug-when-waiting-for-space.patch | 2 +- .../all/rt/fs-namespace-preemption-fix.patch | 2 +- ...-nfs-turn-rmdir_sem-into-a-semaphore.patch | 2 +- .../rt/fs-ntfs-disable-interrupt-non-rt.patch | 2 +- .../fs-replace-bh_uptodate_lock-for-rt.patch | 2 +- .../ftrace-Fix-trace-header-alignment.patch | 2 +- .../rt/ftrace-migrate-disable-tracing.patch | 2 +- ...k-unlock-symetry-versus-pi_lock-and-.patch | 2 +- .../all/rt/futex-requeue-pi-fix.patch | 4 +- ...-migrate_disable-enable-in-different.patch | 6 +- .../all/rt/genirq-disable-irqpoll-on-rt.patch | 2 +- ...voke-the-affinity-callback-via-a-wor.patch | 2 +- .../all/rt/genirq-force-threading.patch | 2 +- ...-irq_set_irqchip_state-documentation.patch | 2 +- ...udio-don-t-inclide-rwlock.h-directly.patch | 2 +- ...duct-tape-RT-rwlock-usage-for-non-RT.patch | 2 +- .../rt/hotplug-light-get-online-cpus.patch | 6 +- ...-schedule_work-call-to-helper-thread.patch | 6 +- ...-by-default-into-the-softirq-context.patch | 4 +- ...ate-hrtimer_init-hrtimer_init_sleepe.patch | 18 +++--- .../rt/hrtimers-prepare-full-preemption.patch | 18 +++--- .../rt/ide-use-nort-local-irq-variants.patch | 2 +- .../infiniband-mellanox-ib-use-nort-irq.patch | 2 +- .../rt/inpt-gameport-use-local-irq-nort.patch | 2 +- .../all/rt/iommu-amd--Use-WARN_ON_NORT.patch | 2 +- ...aw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch | 2 +- ...irq-processing-in-irq-thread-context.patch | 2 +- ...rk-Move-irq-safe-work-to-irq-context.patch | 6 +- ...-push_most_work_into_softirq_context.patch | 6 +- .../features/all/rt/jump-label-rt.patch | 2 +- .../rt/kconfig-disable-a-few-options-rt.patch | 2 +- .../all/rt/kconfig-preempt-rt-full.patch | 2 +- ...el-SRCU-provide-a-static-initializer.patch | 2 +- ...n-t-try-to-print-from-IRQ-NMI-region.patch | 2 +- ...vide-a-pointer-to-the-valid-CPU-mask.patch | 2 +- ...e-stack-kprobe-clean-up-to-__put_tas.patch | 2 +- .../kernel-softirq-unlock-with-irqs-on.patch | 2 +- .../all/rt/kgb-serial-hackaround.patch | 2 +- ...ds-trigger-disable-CPU-trigger-on-RT.patch | 2 +- .../list_bl-fixup-bogus-lockdep-warning.patch | 2 +- ..._bl.h-make-list-head-locking-RT-safe.patch | 2 +- .../rt/local-irq-rt-depending-variants.patch | 2 +- .../features/all/rt/localversion.patch | 4 +- .../all/rt/lockdep-disable-self-test.patch | 2 +- .../lockdep-no-softirq-accounting-on-rt.patch | 2 +- ...-fix-warnings-due-to-missing-PREEMPT.patch | 2 +- ...ardirq-context-test-for-raw-spinlock.patch | 2 +- ...eck-for-__LINUX_SPINLOCK_TYPES_H-on-.patch | 2 +- ...ure-Do-NOT-include-rwlock.h-directly.patch | 2 +- ...-fix-deadlock-in-device-mapper-block.patch | 6 +- ...mutex-don-t-drop-the-wait_lock-twice.patch | 4 +- ...re-init-the-wait_lock-in-rt_mutex_in.patch | 4 +- .../features/all/rt/md-disable-bcache.patch | 2 +- .../md-raid5-do-not-disable-interrupts.patch | 2 +- .../md-raid5-percpu-handling-rt-aware.patch | 10 +-- ...fd-syscon-atmel-smc-include-string.h.patch | 2 +- .../all/rt/mips-disable-highmem-on-rt.patch | 2 +- ...--rt--Fix-generic-kmap_atomic-for-RT.patch | 2 +- ...on-t-disable-IRQs-in-wb_congested_pu.patch | 2 +- .../rt/mm-bounce-local-irq-save-nort.patch | 2 +- .../rt/mm-convert-swap-to-percpu-locked.patch | 2 +- .../features/all/rt/mm-disable-sloub-rt.patch | 2 +- .../features/all/rt/mm-enable-slub.patch | 2 +- .../all/rt/mm-make-vmstat-rt-aware.patch | 2 +- ...n-t-call-schedule_work_on-in-preempt.patch | 2 +- .../rt/mm-memcontrol-do_not_disable_irq.patch | 2 +- ...e-alloc-use-local-lock-on-target-cpu.patch | 2 +- ...e_alloc-reduce-lock-sections-further.patch | 2 +- ...page_alloc-rt-friendly-per-cpu-pages.patch | 2 +- ...m-perform-lru_add_drain_all-remotely.patch | 2 +- .../rt/mm-protect-activate-switch-mm.patch | 2 +- .../all/rt/mm-rt-kmap-atomic-scheduling.patch | 2 +- ...-scatterlist-dont-disable-irqs-on-RT.patch | 2 +- ...ssible-memory-leak-in-kmem_cache_all.patch | 2 +- .../all/rt/mm-vmalloc-use-get-cpu-light.patch | 2 +- ...-not-protect-workingset_shadow_nodes.patch | 2 +- ...oc_copy_with_get_cpu_var_and_locking.patch | 2 +- .../all/rt/mmci-remove-bogus-irq-save.patch | 2 +- .../move_sched_delayed_work_to_helper.patch | 2 +- .../features/all/rt/mutex-no-spin-on-rt.patch | 2 +- ...schedule_irqoff-disable-interrupts-o.patch | 6 +- ...Qdisc-use-a-seqlock-instead-seqcount.patch | 2 +- .../rt/net-add-a-lock-around-icmp_sk.patch | 2 +- ...-missing-serialization-in-ip_send_un.patch | 2 +- ...al-irq-disable-alloc-atomic-headache.patch | 2 +- ...tplug-drain-input_pkt_queue-lockless.patch | 4 +- ...-users-of-napi_alloc_cache-against-r.patch | 2 +- ...ake-qdisc-s-busylock-in-__dev_xmit_s.patch | 4 +- ...ble-xt-write-recseq-begin-rt-fallout.patch | 2 +- .../net-make-devnet_rename_seq-a-mutex.patch | 2 +- ...recursion-to-per-task-variable-on-RT.patch | 8 +-- .../all/rt/net-prevent-abba-deadlock.patch | 2 +- ...y-to-delegate-processing-a-softirq-t.patch | 4 +- ...activate_many-use-msleep-1-instead-o.patch | 2 +- ...he-tcp_sk_lock-lock-with-BH-disabled.patch | 2 +- .../features/all/rt/net-use-cpu-chill.patch | 2 +- .../all/rt/net-use-trylock-in-icmp_sk.patch | 2 +- .../all/rt/net-wireless-warn-nort.patch | 2 +- .../all/rt/net_disable_NET_RX_BUSY_POLL.patch | 2 +- ...vent-erroneous-tick-stop-invocations.patch | 54 ++++++++++++++++ .../features/all/rt/oleg-signal-rt-fix.patch | 6 +- .../all/rt/panic-disable-random-on-rt.patch | 2 +- ...ce-rcu-bh-qs-where-safe-from-softirq.patch | 2 +- ...ec-Don-t-use-completion-s-wait-queue.patch | 2 +- .../all/rt/percpu_ida-use-locklocks.patch | 2 +- .../all/rt/peter_zijlstra-frob-rcu.patch | 2 +- .../all/rt/peterz-percpu-rwsem-rt.patch | 2 +- .../all/rt/peterz-srcu-crypto-chain.patch | 4 +- .../all/rt/pid.h-include-atomic.h.patch | 2 +- .../patches/features/all/rt/ping-sysrq.patch | 6 +- .../all/rt/posix-timers-no-broadcast.patch | 2 +- ...timers-thread-posix-cpu-timers-on-rt.patch | 4 +- .../all/rt/power-disable-highmem-on-rt.patch | 2 +- .../rt/power-use-generic-rwsem-on-rt.patch | 2 +- ...ble-in-kernel-MPIC-emulation-for-PRE.patch | 2 +- .../all/rt/powerpc-preempt-lazy-support.patch | 8 +-- ...ce-init.c-adapt-to-completions-using.patch | 2 +- .../all/rt/preempt-lazy-support.patch | 2 +- .../all/rt/preempt-nort-rt-variants.patch | 2 +- ...27-boot-param-to-help-with-debugging.patch | 2 +- .../patches/features/all/rt/printk-kill.patch | 2 +- .../features/all/rt/printk-rt-aware.patch | 2 +- ...ace-fix-ptrace-vs-tasklist_lock-race.patch | 2 +- .../all/rt/radix-tree-use-local-locks.patch | 2 +- ...dom-avoid-preempt_disable-ed-section.patch | 2 +- .../all/rt/random-make-it-work-on-rt.patch | 2 +- ...tree-include-rcu.h-because-we-use-it.patch | 2 +- ...nate-softirq-processing-from-rcutree.patch | 2 +- ...kdep-false-positive-boost_mtx-compla.patch | 2 +- .../rt/rcu-disable-rcu-fast-no-hz-on-rt.patch | 2 +- ..._normal_after_boot-by-default-for-RT.patch | 2 +- .../rt/rcu-make-RCU_BOOST-default-on-RT.patch | 2 +- ...merge-rcu-bh-into-rcu-preempt-for-rt.patch | 2 +- .../rt/rcu-segcblist-include-rcupdate.h.patch | 2 +- ...s-disable-irq-while-calling-rcu_pree.patch | 2 +- ...l-arm-coredump-fails-for-cpu-3e-3d-4.patch | 2 +- ...function-called-from-invalid-context.patch | 2 +- ...ease-the-nr-of-migratory-tasks-when-.patch | 2 +- .../all/rt/rt-introduce-cpu-chill.patch | 4 +- .../features/all/rt/rt-local-irq-lock.patch | 2 +- .../all/rt/rt-preempt-base-config.patch | 2 +- .../features/all/rt/rt-serial-warn-fix.patch | 2 +- ...ndle-non-enqueued-waiters-gracefully.patch | 4 +- .../rt/rtmutex-Make-lock_killable-work.patch | 2 +- ...tex-Provide-rt_mutex_slowlock_locked.patch | 4 +- ...utex-implementation-based-on-rtmutex.patch | 2 +- ...lock-implementation-based-on-rtmutex.patch | 2 +- ...wsem-implementation-based-on-rtmutex.patch | 2 +- ...tex-add-sleeping-lock-implementation.patch | 28 ++++----- ...utex-add-ww_mutex-addon-for-mutex-rt.patch | 14 ++--- .../all/rt/rtmutex-avoid-include-hell.patch | 2 +- ...ockdep-less-version-of-rt_mutex-s-lo.patch | 18 +++--- .../all/rt/rtmutex-futex-prepare-rt.patch | 14 ++--- .../all/rt/rtmutex-lock-killable.patch | 4 +- .../rt/rtmutex-trylock-is-okay-on-RT.patch | 4 +- .../all/rt/rtmutex-wire-up-RT-s-locking.patch | 2 +- .../all/rt/rtmutex_dont_include_rcu.patch | 2 +- ...rxrpc-remove-unused-static-variables.patch | 2 +- ...t-t-disable-interrupts-in-qc_issue-h.patch | 2 +- ...sk-state-corruption-by-spurious-lock.patch | 2 +- .../all/rt/sched-Remove-TASK_ALL.patch | 2 +- .../all/rt/sched-delay-put-task.patch | 2 +- .../sched-disable-rt-group-sched-on-rt.patch | 2 +- .../all/rt/sched-disable-ttwu-queue.patch | 2 +- .../all/rt/sched-limit-nr-migrate.patch | 2 +- ...might-sleep-do-not-account-rcu-depth.patch | 2 +- .../all/rt/sched-mmdrop-delayed.patch | 4 +- .../all/rt/sched-rt-mutex-wakeup.patch | 2 +- .../all/rt/sched-swait-include-wait.h.patch | 2 +- ...twu-ensure-success-return-is-correct.patch | 2 +- ...Only-wake-up-idle-workers-if-not-blo.patch | 2 +- .../features/all/rt/scsi-fcoe-rt-aware.patch | 2 +- ...function-called-from-invalid-context.patch | 2 +- .../rt/seqlock-prevent-rt-starvation.patch | 2 +- .../all/rt/signal-fix-up-rcu-wreckage.patch | 6 +- .../signal-revert-ptrace-preempt-magic.patch | 4 +- ...t-tasks-to-cache-one-sigqueue-struct.patch | 20 +++--- .../features/all/rt/skbufhead-raw-lock.patch | 18 +++--- .../rt/slub-disable-SLUB_CPU_PARTIAL.patch | 2 +- .../all/rt/slub-enable-irqs-for-no-wait.patch | 2 +- ...pcm_stream_lock-irqs_disabled-splats.patch | 2 +- ...oftirq-disable-softirq-stacks-for-rt.patch | 10 +-- .../all/rt/softirq-preempt-fix-3-re.patch | 10 +-- .../features/all/rt/softirq-split-locks.patch | 16 ++--- ...plit-timer-softirqs-out-of-ksoftirqd.patch | 4 +- ...irq-wake-the-timer-softirq-if-needed.patch | 2 +- ...arc64-use-generic-rwsem-spinlocks-rt.patch | 2 +- .../all/rt/spinlock-types-separate-raw.patch | 10 +-- ...it-call_srcu-use-under-raw-spinlocks.patch | 2 +- ...place-local_irqsave-with-a-locallock.patch | 2 +- ...-use-cpu_online-instead-custom-check.patch | 2 +- .../all/rt/stop-machine-raw-lock.patch | 2 +- ...nvert-stop_machine_run-to-PREEMPT_RT.patch | 2 +- ...vc_xprt_do_enqueue-use-get_cpu_light.patch | 2 +- .../suspend-prevernt-might-sleep-splats.patch | 4 +- .../all/rt/sysfs-realtime-entry.patch | 2 +- ...-from-going-into-infinite-spin-in-rt.patch | 12 ++-- ...rmal-Defer-thermal-wakups-to-threads.patch | 2 +- ...id-schedule_work-with-interrupts-dis.patch | 2 +- .../rt/timekeeping-split-jiffies-lock.patch | 2 +- ...-waking-softirqs-from-the-jiffy-tick.patch | 4 +- .../all/rt/timer-fd-avoid-live-lock.patch | 2 +- ...ent-return-values-of-timerqueue_add-.patch | 40 ++++++++++++ .../timers-prepare-for-full-preemption.patch | 14 ++--- .../tpm_tis-fix-stall-after-iowrite-s.patch | 2 +- ...-for-preempt-off-in-preempt_schedule.patch | 2 +- ...ish-Enable-earlycon-only-if-built-in.patch | 2 +- ...0-don-t-take-the-trylock-during-oops.patch | 2 +- ...ove-preemption-disabling-in-netif_rx.patch | 6 +- .../all/rt/usb-use-_nort-in-giveback.patch | 2 +- .../all/rt/user-use-local-irq-nort.patch | 2 +- .../all/rt/wait.h-include-atomic.h.patch | 2 +- ...rk-around-irqsafe-timer-optimization.patch | 8 +-- ...mple-Simple-work-queue-implemenation.patch | 2 +- .../rt/workqueue-distangle-from-rq-lock.patch | 10 +-- .../rt/workqueue-prevent-deadlock-stall.patch | 18 +++--- .../all/rt/workqueue-use-locallock.patch | 30 ++++----- .../features/all/rt/workqueue-use-rcu.patch | 62 +++++++++---------- .../rt/x86-UV-raw_spinlock-conversion.patch | 2 +- ...ypto-reduce-preempt-disabled-regions.patch | 2 +- ...highmem-add-a-already-used-pte-check.patch | 2 +- .../all/rt/x86-io-apic-migra-no-unmask.patch | 2 +- .../rt/x86-kvm-require-const-tsc-for-rt.patch | 2 +- .../all/rt/x86-mce-timer-hrtimer.patch | 6 +- ...-mce-use-swait-queue-for-mce-wakeups.patch | 2 +- .../features/all/rt/x86-preempt-lazy.patch | 8 +-- ...ignal-delay-calling-signals-on-32bit.patch | 2 +- .../rt/x86-stackprot-no-random-on-rt.patch | 2 +- .../rt/x86-use-gen-rwsem-spinlocks-rt.patch | 4 +- ...9pfs-don-t-inclide-rwlock.h-directly.patch | 2 +- debian/patches/series-rt | 6 +- 383 files changed, 767 insertions(+), 675 deletions(-) create mode 100644 debian/patches/features/all/rt/nohz-Prevent-erroneous-tick-stop-invocations.patch create mode 100644 debian/patches/features/all/rt/timerqueue-Document-return-values-of-timerqueue_add-.patch diff --git a/debian/changelog b/debian/changelog index bef5b4298..6004cb1da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -200,6 +200,7 @@ linux (4.14.15-1) UNRELEASED; urgency=medium [ Salvatore Bonaccorso ] * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) * Revert "module: Add retpoline tag to VERMAGIC" + * [rt] Update to 4.14.15-rt11 [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 diff --git a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch index adbe09aaf..f9588d6ec 100644 --- a/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch +++ b/debian/patches/features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 20 Dec 2017 17:12:50 +0100 Subject: [PATCH 01/29] timers: Use static keys for migrate_enable/nohz_active -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The members migrate_enable and nohz_active in the timer/hrtimer per CPU bases have been introduced to avoid accessing global variables for these @@ -19,11 +19,11 @@ Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/hrtimer.h | 4 -- - kernel/time/hrtimer.c | 17 ++------ - kernel/time/tick-internal.h | 19 ++++++--- + kernel/time/hrtimer.c | 17 ++------- + kernel/time/tick-internal.h | 19 ++++++---- kernel/time/tick-sched.c | 2 - - kernel/time/timer.c | 85 ++++++++++++++++++++++---------------------- - 5 files changed, 62 insertions(+), 65 deletions(-) + kernel/time/timer.c | 83 ++++++++++++++++++++++---------------------- + 5 files changed, 61 insertions(+), 64 deletions(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -115,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior DECLARE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases); --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -1103,7 +1103,7 @@ static inline void tick_nohz_activate(st +@@ -1131,7 +1131,7 @@ static inline void tick_nohz_activate(st ts->nohz_mode = mode; /* One update is enough */ if (!test_and_set_bit(0, &tick_nohz_active)) @@ -271,12 +271,3 @@ Signed-off-by: Sebastian Andrzej Siewior /* -@@ -1656,7 +1659,7 @@ void run_local_timers(void) - hrtimer_run_queues(); - /* Raise the softirq only if required. */ - if (time_before(jiffies, base->clk)) { -- if (!IS_ENABLED(CONFIG_NO_HZ_COMMON) || !base->nohz_active) -+ if (!is_timers_nohz_active()) - return; - /* CPU is awake, so check the deferrable base. */ - base++; diff --git a/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch b/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch index 01cde195c..b56271bce 100644 --- a/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch +++ b/debian/patches/features/all/rt/0001-tracing-Move-hist-trigger-Documentation-to-histogram.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:23 -0600 Subject: [PATCH 01/37] tracing: Move hist trigger Documentation to histogram.txt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The hist trigger Documentation takes up a large part of events.txt - since it will be getting even larger, move it to a separate file. diff --git a/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch b/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch index 895545212..9fe58f7eb 100644 --- a/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch +++ b/debian/patches/features/all/rt/0001-tracing-Steve-s-unofficial-trace_recursive_lock-patc.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Fri, 22 Sep 2017 14:58:15 -0500 Subject: [PATCH 01/42] tracing: Steve's unofficial trace_recursive_lock() patch -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On Tue, 5 Sep 2017 16:57:52 -0500 Tom Zanussi wrote: @@ -38,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2538,61 +2538,29 @@ rb_wakeups(struct ring_buffer *buffer, s +@@ -2542,61 +2542,29 @@ rb_wakeups(struct ring_buffer *buffer, s * The lock and unlock are done within a preempt disable section. * The current_context per_cpu variable can only be modified * by the current task between lock and unlock. But it can @@ -115,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2600,7 +2568,9 @@ trace_recursive_lock(struct ring_buffer_ +@@ -2604,7 +2572,9 @@ trace_recursive_lock(struct ring_buffer_ static __always_inline void trace_recursive_unlock(struct ring_buffer_per_cpu *cpu_buffer) { diff --git a/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch b/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch index 55c9a6a14..8ccbba7e1 100644 --- a/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch +++ b/debian/patches/features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 20 Dec 2017 17:12:51 +0100 Subject: [PATCH 02/29] hrtimer: Correct blantanly wrong comment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The protection of a hrtimer which runs its callback against migration to a different CPU has nothing to do with hard interrupt context. diff --git a/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch b/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch index ecd42e2c8..51e1fd944 100644 --- a/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch +++ b/debian/patches/features/all/rt/0002-tracing-Add-Documentation-for-log2-modifier.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:24 -0600 Subject: [PATCH 02/37] tracing: Add Documentation for log2 modifier -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add a line for the log2 modifier, to keep it aligned with tracing/README. diff --git a/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch b/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch index 9938d238d..a455b18f7 100644 --- a/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch +++ b/debian/patches/features/all/rt/0002-tracing-Reverse-the-order-of-trace_types_lock-and-ev.patch @@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" Date: Fri, 22 Sep 2017 14:58:16 -0500 Subject: [PATCH 02/42] tracing: Reverse the order of trace_types_lock and event_mutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In order to make future changes where we need to call tracing_set_clock() from within an event command, the order of @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -7687,6 +7687,7 @@ static int instance_mkdir(const char *na +@@ -7671,6 +7671,7 @@ static int instance_mkdir(const char *na struct trace_array *tr; int ret; @@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&trace_types_lock); ret = -EEXIST; -@@ -7742,6 +7743,7 @@ static int instance_mkdir(const char *na +@@ -7726,6 +7727,7 @@ static int instance_mkdir(const char *na list_add(&tr->list, &ftrace_trace_arrays); mutex_unlock(&trace_types_lock); @@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; -@@ -7753,6 +7755,7 @@ static int instance_mkdir(const char *na +@@ -7737,6 +7739,7 @@ static int instance_mkdir(const char *na out_unlock: mutex_unlock(&trace_types_lock); @@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; -@@ -7765,6 +7768,7 @@ static int instance_rmdir(const char *na +@@ -7749,6 +7752,7 @@ static int instance_rmdir(const char *na int ret; int i; @@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&trace_types_lock); ret = -ENODEV; -@@ -7810,6 +7814,7 @@ static int instance_rmdir(const char *na +@@ -7794,6 +7798,7 @@ static int instance_rmdir(const char *na out_unlock: mutex_unlock(&trace_types_lock); @@ -82,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!system) return -ENODEV; -@@ -2294,15 +2294,15 @@ static void __add_event_to_tracers(struc +@@ -2308,15 +2308,15 @@ static void __add_event_to_tracers(struc int trace_add_event_call(struct trace_event_call *call) { int ret; @@ -100,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2356,13 +2356,13 @@ int trace_remove_event_call(struct trace +@@ -2370,13 +2370,13 @@ int trace_remove_event_call(struct trace { int ret; @@ -116,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2424,8 +2424,8 @@ static int trace_module_notify(struct no +@@ -2438,8 +2438,8 @@ static int trace_module_notify(struct no { struct module *mod = data; @@ -126,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior switch (val) { case MODULE_STATE_COMING: trace_module_add_events(mod); -@@ -2434,8 +2434,8 @@ static int trace_module_notify(struct no +@@ -2448,8 +2448,8 @@ static int trace_module_notify(struct no trace_module_remove_events(mod); break; } @@ -136,7 +136,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -2950,24 +2950,24 @@ create_event_toplevel_files(struct dentr +@@ -2964,24 +2964,24 @@ create_event_toplevel_files(struct dentr * creates the event hierachry in the @parent/events directory. * * Returns 0 on success. @@ -166,7 +166,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2996,9 +2996,10 @@ early_event_add_tracer(struct dentry *pa +@@ -3010,9 +3010,10 @@ early_event_add_tracer(struct dentry *pa return ret; } @@ -178,7 +178,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Disable any event triggers and associated soft-disabled events */ clear_event_triggers(tr); -@@ -3019,8 +3020,6 @@ int event_trace_del_tracer(struct trace_ +@@ -3033,8 +3034,6 @@ int event_trace_del_tracer(struct trace_ tr->event_dir = NULL; diff --git a/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch b/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch index d83e71334..f85a3713b 100644 --- a/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch +++ b/debian/patches/features/all/rt/0003-hrtimer-Fix-kerneldoc-for-struct-hrtimer_cpu_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:52 +0100 Subject: [PATCH 03/29] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The sequence '/**' marks the start of a struct description. Add the missing second asterisk. While at it adapt the ordering of the struct diff --git a/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch b/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch index 5bb005052..e94ebda2e 100644 --- a/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch +++ b/debian/patches/features/all/rt/0003-tracing-Add-support-to-detect-and-avoid-duplicates.patch @@ -1,7 +1,7 @@ From: Vedang Patel Date: Thu, 21 Dec 2017 10:02:25 -0600 Subject: [PATCH 03/37] tracing: Add support to detect and avoid duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz A duplicate in the tracing_map hash table is when 2 different entries have the same key and, as a result, the key_hash. This is possible due diff --git a/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch b/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch index 840723ec0..42e151bde 100644 --- a/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch +++ b/debian/patches/features/all/rt/0004-hrtimer-Cleanup-clock-argument-in-schedule_hrtimeout.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:53 +0100 Subject: [PATCH 04/29] hrtimer: Cleanup clock argument in schedule_hrtimeout_range_clock() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz schedule_hrtimeout_range_clock() uses an integer for the clock id instead of the predefined type "clockid_t". The ID of the clock is diff --git a/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch b/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch index 7e62a7ca2..4d63b4e87 100644 --- a/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch +++ b/debian/patches/features/all/rt/0004-tracing-Remove-code-which-merges-duplicates.patch @@ -1,7 +1,7 @@ From: Vedang Patel Date: Thu, 21 Dec 2017 10:02:26 -0600 Subject: [PATCH 04/37] tracing: Remove code which merges duplicates -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We now have the logic to detect and remove duplicates in the tracing_map hash table. The code which merges duplicates in the diff --git a/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch b/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch index 8ce9fc70f..339cefd86 100644 --- a/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch +++ b/debian/patches/features/all/rt/0004-tracing-Remove-lookups-from-tracing_map-hitcount.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:18 -0500 Subject: [PATCH 04/42] tracing: Remove lookups from tracing_map hitcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Lookups inflate the hitcount, making it essentially useless. Only inserts and updates should really affect the hitcount anyway, so diff --git a/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch b/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch index 73762a801..9d1a6ca35 100644 --- a/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch +++ b/debian/patches/features/all/rt/0005-hrtimer-Fix-hrtimer-function-description.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:54 +0100 Subject: [PATCH 05/29] hrtimer: Fix hrtimer function description -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The hrtimer_start[_range_ns]() starts a timer reliable on this CPU only when HRTIMER_MODE_PINNED is set. Furthermore the HRTIMER_MODE_PINNED mode diff --git a/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch b/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch index 4809e4c44..338aa56ca 100644 --- a/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch +++ b/debian/patches/features/all/rt/0005-ring-buffer-Add-interface-for-setting-absolute-time-.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:27 -0600 Subject: [PATCH 05/37] ring-buffer: Add interface for setting absolute time stamps -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Define a new function, tracing_set_time_stamp_abs(), which can be used to enable or disable the use of absolute timestamps rather than time @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -485,6 +485,7 @@ struct ring_buffer { +@@ -489,6 +489,7 @@ struct ring_buffer { u64 (*clock)(void); struct rb_irq_work irq_work; @@ -42,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct ring_buffer_iter { -@@ -1379,6 +1380,16 @@ void ring_buffer_set_clock(struct ring_b +@@ -1383,6 +1384,16 @@ void ring_buffer_set_clock(struct ring_b buffer->clock = clock; } diff --git a/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch b/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch index 79fa53e4e..394856420 100644 --- a/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch +++ b/debian/patches/features/all/rt/0005-tracing-Increase-tracing-map-KEYS_MAX-size.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:19 -0500 Subject: [PATCH 05/42] tracing: Increase tracing map KEYS_MAX size -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The current default for the number of subkeys in a compound key is 2, which is too restrictive. Increase it to a more realistic value of 3. diff --git a/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch b/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch index 49bdd50d9..90ded228a 100644 --- a/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch +++ b/debian/patches/features/all/rt/0006-hrtimer-Ensure-POSIX-compliance-relative-CLOCK_REALT.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:55 +0100 Subject: [PATCH 06/29] hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz POSIX specification defines, that relative CLOCK_REALTIME timers are not affected by clock modifications. Those timers have to use CLOCK_MONOTONIC diff --git a/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch b/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch index c3d38a278..c16f1c56f 100644 --- a/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch +++ b/debian/patches/features/all/rt/0006-ring-buffer-Redefine-the-unimplemented-RINGBUF_TYPE_.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:28 -0600 Subject: [PATCH 06/37] ring-buffer: Redefine the unimplemented RINGBUF_TYPE_TIME_STAMP -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can gather was reserved for something like an absolute timestamp feature @@ -144,7 +144,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Flag when events were overwritten */ #define RB_MISSED_EVENTS (1 << 31) /* Missed count stored at end */ -@@ -2221,12 +2247,15 @@ rb_move_tail(struct ring_buffer_per_cpu +@@ -2225,12 +2251,15 @@ rb_move_tail(struct ring_buffer_per_cpu /* Slow path, do not inline */ static noinline struct ring_buffer_event * @@ -164,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior event->time_delta = delta & TS_MASK; event->array[0] = delta >> TS_SHIFT; } else { -@@ -2269,7 +2298,9 @@ rb_update_event(struct ring_buffer_per_c +@@ -2273,7 +2302,9 @@ rb_update_event(struct ring_buffer_per_c * add it to the start of the resevered space. */ if (unlikely(info->add_timestamp)) { @@ -175,7 +175,7 @@ Signed-off-by: Sebastian Andrzej Siewior length -= RB_LEN_TIME_EXTEND; delta = 0; } -@@ -2457,7 +2488,7 @@ static __always_inline void rb_end_commi +@@ -2461,7 +2492,7 @@ static __always_inline void rb_end_commi static inline void rb_event_discard(struct ring_buffer_event *event) { @@ -184,7 +184,7 @@ Signed-off-by: Sebastian Andrzej Siewior event = skip_time_extend(event); /* array[0] holds the actual length for the discarded event */ -@@ -2501,10 +2532,11 @@ rb_update_write_stamp(struct ring_buffer +@@ -2505,10 +2536,11 @@ rb_update_write_stamp(struct ring_buffer cpu_buffer->write_stamp = cpu_buffer->commit_page->page->time_stamp; else if (event->type_len == RINGBUF_TYPE_TIME_EXTEND) { @@ -199,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior } else cpu_buffer->write_stamp += event->time_delta; } -@@ -2657,7 +2689,7 @@ static struct ring_buffer_event * +@@ -2661,7 +2693,7 @@ static struct ring_buffer_event * * If this is the first commit on the page, then it has the same * timestamp as the page itself. */ @@ -208,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior info->delta = 0; /* See if we shot pass the end of this buffer page */ -@@ -2735,8 +2767,11 @@ rb_reserve_next_event(struct ring_buffer +@@ -2739,8 +2771,11 @@ rb_reserve_next_event(struct ring_buffer /* make sure this diff is calculated here */ barrier(); @@ -222,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior info.delta = diff; if (unlikely(test_time_stamp(info.delta))) rb_handle_timestamp(cpu_buffer, &info); -@@ -3418,14 +3453,13 @@ rb_update_read_stamp(struct ring_buffer_ +@@ -3422,14 +3457,13 @@ rb_update_read_stamp(struct ring_buffer_ return; case RINGBUF_TYPE_TIME_EXTEND: @@ -240,7 +240,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; case RINGBUF_TYPE_DATA: -@@ -3449,14 +3483,13 @@ rb_update_iter_read_stamp(struct ring_bu +@@ -3453,14 +3487,13 @@ rb_update_iter_read_stamp(struct ring_bu return; case RINGBUF_TYPE_TIME_EXTEND: @@ -258,7 +258,7 @@ Signed-off-by: Sebastian Andrzej Siewior return; case RINGBUF_TYPE_DATA: -@@ -3680,6 +3713,8 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3684,6 +3717,8 @@ rb_buffer_peek(struct ring_buffer_per_cp struct buffer_page *reader; int nr_loops = 0; @@ -267,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior again: /* * We repeat when a time extend is encountered. -@@ -3716,12 +3751,17 @@ rb_buffer_peek(struct ring_buffer_per_cp +@@ -3720,12 +3755,17 @@ rb_buffer_peek(struct ring_buffer_per_cp goto again; case RINGBUF_TYPE_TIME_STAMP: @@ -287,7 +287,7 @@ Signed-off-by: Sebastian Andrzej Siewior *ts = cpu_buffer->read_stamp + event->time_delta; ring_buffer_normalize_time_stamp(cpu_buffer->buffer, cpu_buffer->cpu, ts); -@@ -3746,6 +3786,9 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3750,6 +3790,9 @@ rb_iter_peek(struct ring_buffer_iter *it struct ring_buffer_event *event; int nr_loops = 0; @@ -297,7 +297,7 @@ Signed-off-by: Sebastian Andrzej Siewior cpu_buffer = iter->cpu_buffer; buffer = cpu_buffer->buffer; -@@ -3798,12 +3841,17 @@ rb_iter_peek(struct ring_buffer_iter *it +@@ -3802,12 +3845,17 @@ rb_iter_peek(struct ring_buffer_iter *it goto again; case RINGBUF_TYPE_TIME_STAMP: diff --git a/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch b/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch index f0762e74c..dd83beebf 100644 --- a/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch +++ b/debian/patches/features/all/rt/0006-tracing-Make-traceprobe-parsing-code-reusable.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:20 -0500 Subject: [PATCH 06/42] tracing: Make traceprobe parsing code reusable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz traceprobe_probes_write() and traceprobe_command() actually contain nothing that ties them to kprobes - the code is generically useful for @@ -25,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -8281,6 +8281,92 @@ void ftrace_dump(enum ftrace_dump_mode o +@@ -8265,6 +8265,92 @@ void ftrace_dump(enum ftrace_dump_mode o } EXPORT_SYMBOL_GPL(ftrace_dump); diff --git a/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch b/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch index 2fed0af6c..00127e5d6 100644 --- a/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch +++ b/debian/patches/features/all/rt/0007-hrtimer-Cleanup-hrtimer_mode-enum.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:56 +0100 Subject: [PATCH 07/29] hrtimer: Cleanup hrtimer_mode enum -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It's not obvious that the HRTIMER_MODE variants are bit combinations because all modes are hard coded constants. diff --git a/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch b/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch index 6f3fa3349..70b029b61 100644 --- a/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch +++ b/debian/patches/features/all/rt/0007-tracing-Add-timestamp_mode-trace-file.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:29 -0600 Subject: [PATCH 07/37] tracing: Add timestamp_mode trace file -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add a new option flag indicating whether or not the ring buffer is in 'absolute timestamp' mode. @@ -122,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_TRACER_SNAPSHOT static const struct file_operations snapshot_fops = { .open = tracing_snapshot_open, -@@ -7892,6 +7936,9 @@ init_tracer_tracefs(struct trace_array * +@@ -7887,6 +7931,9 @@ init_tracer_tracefs(struct trace_array * trace_create_file("tracing_on", 0644, d_tracer, tr, &rb_simple_fops); diff --git a/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch b/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch index d37a7e09f..13dced4d7 100644 --- a/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch +++ b/debian/patches/features/all/rt/0007-tracing-Clean-up-hist_field_flags-enum.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:21 -0500 Subject: [PATCH 07/42] tracing: Clean up hist_field_flags enum -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz As we add more flags, specifying explicit integers for the flag values becomes more unwieldy and error-prone - switch them over to left-shift diff --git a/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch b/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch index c633813ff..72ff5089c 100644 --- a/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch +++ b/debian/patches/features/all/rt/0008-tracing-Add-hist_field_name-accessor.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:22 -0500 Subject: [PATCH 08/42] tracing: Add hist_field_name() accessor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In preparation for hist_fields that won't be strictly based on trace_event_fields, add a new hist_field_name() accessor to allow that diff --git a/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch b/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch index ed5f3b3e0..da7d7f4cd 100644 --- a/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch +++ b/debian/patches/features/all/rt/0008-tracing-Give-event-triggers-access-to-ring_buffer_ev.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:30 -0600 Subject: [PATCH 08/37] tracing: Give event triggers access to ring_buffer_event -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The ring_buffer event can provide a timestamp that may be useful to various triggers - pass it into the handlers for that purpose. diff --git a/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch b/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch index cb30f795c..8ff4f21a5 100644 --- a/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch +++ b/debian/patches/features/all/rt/0008-tracing-hrtimer-Take-all-clock-bases-and-modes-into-.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:57 +0100 Subject: [PATCH 08/29] tracing/hrtimer: Take all clock bases and modes into account -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz So far only CLOCK_MONOTONIC and CLOCK_REALTIME were taken into account as well as HRTIMER_MODE_ABS/REL in hrtimer_init tracepoint. The query for diff --git a/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch b/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch index 12201f318..dac733360 100644 --- a/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch +++ b/debian/patches/features/all/rt/0009-tracing-Add-ring-buffer-event-param-to-hist-field-fu.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:31 -0600 Subject: [PATCH 09/37] tracing: Add ring buffer event param to hist field functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Some events such as timestamps require access to a ring_buffer_event struct; add a param so that hist field functions can access that. diff --git a/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch b/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch index e7d86137e..a06eeef2a 100644 --- a/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch +++ b/debian/patches/features/all/rt/0009-tracing-Reimplement-log2.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Fri, 22 Sep 2017 14:58:23 -0500 Subject: [PATCH 09/42] tracing: Reimplement log2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz log2 as currently implemented applies only to u64 trace_event_field derived fields, and assumes that anything it's applied to is a u64 diff --git a/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch b/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch index 0f84457a8..fa75d3948 100644 --- a/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch +++ b/debian/patches/features/all/rt/0009-tracing-hrtimer-Print-hrtimer-mode-in-hrtimer_start-.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:58 +0100 Subject: [PATCH 09/29] tracing/hrtimer: Print hrtimer mode in hrtimer_start tracepoint -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The hrtimer_start tracepoint lacks the mode information. The mode is important because consecutive starts can switch from ABS to REL or from diff --git a/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch b/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch index f9eeacaa1..56c393b3e 100644 --- a/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch +++ b/debian/patches/features/all/rt/0010-hrtimer-Switch-for-loop-to-_ffs-evaluation.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:12:59 +0100 Subject: [PATCH 10/29] hrtimer: Switch for loop to _ffs() evaluation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Looping over all clock bases to find active bits is suboptimal if not all bases are active. diff --git a/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch b/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch index 6051e8896..a70a5c978 100644 --- a/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch +++ b/debian/patches/features/all/rt/0010-tracing-Break-out-hist-trigger-assignment-parsing.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:32 -0600 Subject: [PATCH 10/37] tracing: Break out hist trigger assignment parsing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This will make it easier to add variables, and makes the parsing code cleaner regardless. diff --git a/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch b/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch index 50923ff27..392561c8b 100644 --- a/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch +++ b/debian/patches/features/all/rt/0011-hrtimer-Store-running-timer-in-hrtimer_clock_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:00 +0100 Subject: [PATCH 11/29] hrtimer: Store running timer in hrtimer_clock_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The pointer to the currently running timer is stored in hrtimer_cpu_base before the base lock is dropped and the callback is invoked. diff --git a/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch index 8b2f70d78..56b0b0b7f 100644 --- a/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch +++ b/debian/patches/features/all/rt/0011-tracing-Add-hist-trigger-timestamp-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:33 -0600 Subject: [PATCH 11/37] tracing: Add hist trigger timestamp support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add support for a timestamp event field. This is actually a 'pseudo-' event field in that it behaves like it's part of the event record, but diff --git a/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch b/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch index 5bb419423..510b5035b 100644 --- a/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch +++ b/debian/patches/features/all/rt/0012-hrtimer-Make-room-in-struct-hrtimer_cpu_base.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:01 +0100 Subject: [PATCH 12/29] hrtimer: Make room in struct hrtimer_cpu_base -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The upcoming softirq based hrtimers support requires an additional field in the hrtimer_cpu_base struct, which would grow the struct size beyond a diff --git a/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch b/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch index 500f15aa3..51a0a1ca8 100644 --- a/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch +++ b/debian/patches/features/all/rt/0012-tracing-Add-per-element-variable-support-to-tracing_.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:34 -0600 Subject: [PATCH 12/37] tracing: Add per-element variable support to tracing_map -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In order to allow information to be passed between trace events, add support for per-element variables to tracing_map. This provides a diff --git a/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch b/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch index 3fba5be22..e0ad9f32f 100644 --- a/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch +++ b/debian/patches/features/all/rt/0013-hrtimer-Reduce-conditional-code-hres_active.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:02 +0100 Subject: [PATCH 13/29] hrtimer: Reduce conditional code (hres_active) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The hrtimer_cpu_base struct has the CONFIG_HIGH_RES_TIMERS conditional struct member hres_active. All related functions to this member are diff --git a/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch b/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch index d60cf8241..d9fccaa4b 100644 --- a/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch +++ b/debian/patches/features/all/rt/0013-tracing-Add-hist_data-member-to-hist_field.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:35 -0600 Subject: [PATCH 13/37] tracing: Add hist_data member to hist_field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Allow hist_data access via hist_field. Some users of hist_fields require or will require more access to the associated hist_data. diff --git a/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch b/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch index a6c0b71d6..00d91101f 100644 --- a/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch +++ b/debian/patches/features/all/rt/0014-hrtimer-Use-accesor-functions-instead-of-direct-acce.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:03 +0100 Subject: [PATCH 14/29] hrtimer: Use accesor functions instead of direct access -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz __hrtimer_hres_active() is now available unconditionally. Replace the direct access to hrtimer_cpu_base.hres_active. diff --git a/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch b/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch index c85d8067a..ccb66a2f9 100644 --- a/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch +++ b/debian/patches/features/all/rt/0014-tracing-Add-usecs-modifier-for-hist-trigger-timestam.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:36 -0600 Subject: [PATCH 14/37] tracing: Add usecs modifier for hist trigger timestamps -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Appending .usecs onto a common_timestamp field will cause the timestamp value to be in microseconds instead of the default diff --git a/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch b/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch index 778b326ac..f13df89b4 100644 --- a/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch +++ b/debian/patches/features/all/rt/0015-hrtimer-Make-the-remote-enqueue-check-unconditional.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:04 +0100 Subject: [PATCH 15/29] hrtimer: Make the remote enqueue check unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_cpu_base.expires_next is used to cache the next event armed in the timer hardware. The value is used to check whether an hrtimer can be diff --git a/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch b/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch index f1920c87d..ee133549a 100644 --- a/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch +++ b/debian/patches/features/all/rt/0015-tracing-Add-variable-support-to-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:37 -0600 Subject: [PATCH 15/37] tracing: Add variable support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add support for saving the value of a current event's event field by assigning it to a variable that can be read by a subsequent event. diff --git a/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch b/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch index e86dc3bc3..eba59b75f 100644 --- a/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch +++ b/debian/patches/features/all/rt/0016-hrtimer-Make-hrtimer_cpu_base.next_timer-handling-un.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:05 +0100 Subject: [PATCH 16/29] hrtimer: Make hrtimer_cpu_base.next_timer handling unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer in a cpu base. diff --git a/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch b/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch index 51c4c9000..c31908d13 100644 --- a/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch +++ b/debian/patches/features/all/rt/0016-tracing-Account-for-variables-in-named-trigger-compa.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:38 -0600 Subject: [PATCH 16/37] tracing: Account for variables in named trigger compatibility -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Named triggers must also have the same set of variables in order to be considered compatible - update the trigger match test to account for diff --git a/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch b/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch index 78f1386dd..7780c9156 100644 --- a/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch +++ b/debian/patches/features/all/rt/0017-hrtimer-Make-hrtimer_reprogramm-unconditional.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:06 +0100 Subject: [PATCH 17/29] hrtimer: Make hrtimer_reprogramm() unconditional -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of the diff --git a/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch b/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch index c71d08968..8e3874223 100644 --- a/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch +++ b/debian/patches/features/all/rt/0017-tracing-Move-get_hist_field_flags.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:39 -0600 Subject: [PATCH 17/37] tracing: Move get_hist_field_flags() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). diff --git a/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch index 5e02ca900..c97531d68 100644 --- a/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch +++ b/debian/patches/features/all/rt/0018-hrtimer-Make-hrtimer_force_reprogramm-unconditionall.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:07 +0100 Subject: [PATCH 18/29] hrtimer: Make hrtimer_force_reprogramm() unconditionally available -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_force_reprogram() needs to be available unconditionally for softirq based hrtimers. Move the function and all required struct members out of diff --git a/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch b/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch index 9b66e5b38..28120a73a 100644 --- a/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch +++ b/debian/patches/features/all/rt/0018-tracing-Add-simple-expression-support-to-hist-trigge.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:40 -0600 Subject: [PATCH 18/37] tracing: Add simple expression support to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add support for simple addition, subtraction, and unary expressions (-(expr) and expr, where expr = b-a, a+b, a+b+c) to hist triggers, in diff --git a/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch b/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch index e5756b6af..96cfeec22 100644 --- a/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch +++ b/debian/patches/features/all/rt/0019-hrtimer-Unify-handling-of-hrtimer-remove.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:08 +0100 Subject: [PATCH 19/29] hrtimer: Unify handling of hrtimer remove -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When the first hrtimer on the current CPU is removed, hrtimer_force_reprogram() is invoked but only when diff --git a/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch b/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch index 2c61c6358..298b9ac40 100644 --- a/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch +++ b/debian/patches/features/all/rt/0019-tracing-Generalize-per-element-hist-trigger-data.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:41 -0600 Subject: [PATCH 19/37] tracing: Generalize per-element hist trigger data -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Up until now, hist triggers only needed per-element support for saving 'comm' data, which was saved directly as a private data pointer. diff --git a/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch b/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch index a3f9128f9..862f5503d 100644 --- a/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch +++ b/debian/patches/features/all/rt/0020-hrtimer-Unify-handling-of-remote-enqueue.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:09 +0100 Subject: [PATCH 20/29] hrtimer: Unify handling of remote enqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns() when hrtimer_cpu_base.hres_active is true. diff --git a/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch b/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch index 6f5b7b165..3fde6ee56 100644 --- a/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch +++ b/debian/patches/features/all/rt/0020-tracing-Pass-tracing_map_elt-to-hist_field-accessor-.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:42 -0600 Subject: [PATCH 20/37] tracing: Pass tracing_map_elt to hist_field accessor functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Some accessor functions, such as for variable references, require access to a corrsponding tracing_map_elt. diff --git a/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch b/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch index 21edfb655..86cb9fc16 100644 --- a/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch +++ b/debian/patches/features/all/rt/0021-hrtimer-Make-remote-enqueue-decision-less-restrictiv.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:10 +0100 Subject: [PATCH 21/29] hrtimer: Make remote enqueue decision less restrictive -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The current decision whether a timer can be queued on a remote CPU checks for timer->expiry <= remote_cpu_base.expires_next. diff --git a/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch b/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch index 923e4defe..419d0aa77 100644 --- a/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch +++ b/debian/patches/features/all/rt/0021-tracing-Add-hist_field-type-field.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:43 -0600 Subject: [PATCH 21/37] tracing: Add hist_field 'type' field -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Future support for synthetic events requires hist_field 'type' information, so add a field for that. diff --git a/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch b/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch index 3ccc37d03..77e2706f0 100644 --- a/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch +++ b/debian/patches/features/all/rt/0022-hrtimer-Remove-base-argument-from-hrtimer_reprogram.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:11 +0100 Subject: [PATCH 22/29] hrtimer: Remove base argument from hrtimer_reprogram() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_reprogram() must have access to the hrtimer_clock_base of the new first expiring timer to access hrtimer_clock_base.offset for adjusting the diff --git a/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch b/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch index ef9b805c6..fcc26f3a9 100644 --- a/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch +++ b/debian/patches/features/all/rt/0022-tracing-Add-variable-reference-handling-to-hist-trig.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:44 -0600 Subject: [PATCH 22/37] tracing: Add variable reference handling to hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add the necessary infrastructure to allow the variables defined on one event to be referenced in another. This allows variables set by a @@ -33,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -7793,6 +7793,7 @@ static int instance_mkdir(const char *na +@@ -7788,6 +7788,7 @@ static int instance_mkdir(const char *na INIT_LIST_HEAD(&tr->systems); INIT_LIST_HEAD(&tr->events); @@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (allocate_trace_buffers(tr, trace_buf_size) < 0) goto out_free_tr; -@@ -8543,6 +8544,7 @@ ssize_t trace_parse_run_command(struct f +@@ -8538,6 +8539,7 @@ ssize_t trace_parse_run_command(struct f INIT_LIST_HEAD(&global_trace.systems); INIT_LIST_HEAD(&global_trace.events); diff --git a/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch b/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch index f5a4f106c..9561c67e3 100644 --- a/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch +++ b/debian/patches/features/all/rt/0023-hrtimer-Split-hrtimer_start_range_ns.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:12 +0100 Subject: [PATCH 23/29] hrtimer: Split hrtimer_start_range_ns() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. diff --git a/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch b/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch index a85a4328e..c04a4420e 100644 --- a/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch +++ b/debian/patches/features/all/rt/0023-tracing-Add-hist-trigger-action-hook.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:45 -0600 Subject: [PATCH 23/37] tracing: Add hist trigger action hook -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add a hook for executing extra actions whenever a histogram entry is added or updated. diff --git a/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch b/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch index 02d90afe3..ccda5d7cc 100644 --- a/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch +++ b/debian/patches/features/all/rt/0024-hrtimer-Split-__hrtimer_get_next_event.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:13 +0100 Subject: [PATCH 24/29] hrtimer: Split __hrtimer_get_next_event() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Preparatory patch for softirq based hrtimers to avoid code duplication. No functional change. diff --git a/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch b/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch index f379ca6cc..8c1582f18 100644 --- a/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch +++ b/debian/patches/features/all/rt/0024-tracing-Add-support-for-synthetic-events.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:46 -0600 Subject: [PATCH 24/37] tracing: Add support for 'synthetic' events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Synthetic events are user-defined events generated from hist trigger variables saved from one or more other events. diff --git a/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch b/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch index 6ae532954..b20147789 100644 --- a/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch +++ b/debian/patches/features/all/rt/0025-hrtimer-Use-irqsave-irqrestore-around-__run_hrtimer.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:14 +0100 Subject: [PATCH 25/29] hrtimer: Use irqsave/irqrestore around __run_hrtimer() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz __run_hrtimer() is called with the hrtimer_cpu_base.lock held and interrupts disabled. Before invoking the timer callback the base lock is diff --git a/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch b/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch index b42c63e84..4f3c7a048 100644 --- a/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch +++ b/debian/patches/features/all/rt/0025-tracing-Add-support-for-field-variables.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:47 -0600 Subject: [PATCH 25/37] tracing: Add support for 'field variables' -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Users should be able to directly specify event fields in hist trigger 'actions' rather than being forced to explicitly create a variable for diff --git a/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch b/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch index 75a33d0c1..c21b00bec 100644 --- a/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch +++ b/debian/patches/features/all/rt/0026-hrtimer-Add-clock-bases-and-hrtimer-mode-for-soft-ir.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:15 +0100 Subject: [PATCH 26/29] hrtimer: Add clock bases and hrtimer mode for soft irq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer callback functions are always executed in hard interrupt context. Users of hrtimer which need their timer function to be executed diff --git a/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch index 11511158e..5edafca34 100644 --- a/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch +++ b/debian/patches/features/all/rt/0026-tracing-Add-onmatch-hist-trigger-action-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:48 -0600 Subject: [PATCH 26/37] tracing: Add 'onmatch' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add an 'onmatch(matching.event).(param list)' hist trigger action which is invoked with the set of variables or diff --git a/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch b/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch index af4588457..6a6264632 100644 --- a/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch +++ b/debian/patches/features/all/rt/0027-hrtimer-Prepare-handling-of-hard-and-softirq-based-h.patch @@ -2,7 +2,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:16 +0100 Subject: [PATCH 27/29] hrtimer: Prepare handling of hard and softirq based hrtimers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The softirq based hrtimer can utilize most of the existing hrtimers functions, but need to operate on a different data set. diff --git a/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch b/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch index cb945abad..2ae853264 100644 --- a/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch +++ b/debian/patches/features/all/rt/0027-tracing-Add-onmax-hist-trigger-action-support.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:49 -0600 Subject: [PATCH 27/37] tracing: Add 'onmax' hist trigger action support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add an 'onmax(var).save(field,...)' hist trigger action which is invoked whenever an event exceeds the current maximum. diff --git a/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch b/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch index f7958b03c..83860de50 100644 --- a/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch +++ b/debian/patches/features/all/rt/0028-hrtimer-Implement-support-for-softirq-based-hrtimers.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:17 +0100 Subject: [PATCH 28/29] hrtimer: Implement support for softirq based hrtimers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer callbacks are always invoked in hard interrupt context. Several users in tree require soft interrupt context for their callbacks and diff --git a/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch b/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch index 3deac7de8..7f0ba893a 100644 --- a/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch +++ b/debian/patches/features/all/rt/0028-tracing-Allow-whitespace-to-surround-hist-trigger-fi.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:50 -0600 Subject: [PATCH 28/37] tracing: Allow whitespace to surround hist trigger filter -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The existing code only allows for one space before and after the 'if' specifying the filter for a hist trigger. Add code to make that more diff --git a/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch b/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch index b1608f28a..5ec6e4878 100644 --- a/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch +++ b/debian/patches/features/all/rt/0029-hrtimer-Implement-SOFT-HARD-clock-base-selection.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Wed, 20 Dec 2017 17:13:18 +0100 Subject: [PATCH 29/29] hrtimer: Implement SOFT/HARD clock base selection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz All prerequisites to handle hrtimers for expiry in either hard or soft interrupt context are in place. diff --git a/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch index d713675f1..773666f2c 100644 --- a/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch +++ b/debian/patches/features/all/rt/0029-tracing-Add-cpu-field-for-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:51 -0600 Subject: [PATCH 29/37] tracing: Add cpu field for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz A common key to use in a histogram is the cpuid - add a new cpu 'synthetic' field named 'cpu' for that purpose. diff --git a/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch b/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch index 4012b5ee6..4051a507a 100644 --- a/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch +++ b/debian/patches/features/all/rt/0030-can-bcm-Replace-hrtimer_tasklet-with-softirq-based-h.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:11 +0100 Subject: [PATCH 30/36] can/bcm: Replace hrtimer_tasklet with softirq based hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch b/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch index 2056d74fd..c2463eebe 100644 --- a/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch +++ b/debian/patches/features/all/rt/0030-tracing-Add-hist-trigger-support-for-variable-refere.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:52 -0600 Subject: [PATCH 30/37] tracing: Add hist trigger support for variable reference aliases -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add support for alias=$somevar where alias can be used as onmatch.xxx($alias). diff --git a/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch b/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch index a69fce133..0431f0953 100644 --- a/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch +++ b/debian/patches/features/all/rt/0031-mac80211_hwsim-Replace-hrtimer-tasklet-with-softirq-.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:12 +0100 Subject: [PATCH 31/36] mac80211_hwsim: Replace hrtimer tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch b/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch index 41f212de9..5c7d3271c 100644 --- a/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch +++ b/debian/patches/features/all/rt/0031-tracing-Add-last-error-error-facility-for-hist-trigg.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:53 -0600 Subject: [PATCH 31/37] tracing: Add 'last error' error facility for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz With the addition of variables and actions, it's become necessary to provide more detailed error information to users about syntax errors. diff --git a/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch b/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch index d4efa60aa..9b1220e6e 100644 --- a/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch +++ b/debian/patches/features/all/rt/0032-tracing-Add-inter-event-hist-trigger-Documentation.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:54 -0600 Subject: [PATCH 32/37] tracing: Add inter-event hist trigger Documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add background and details on inter-event hist triggers, including hist variables, synthetic events, and actions. diff --git a/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch index 60f07d224..5e3d38468 100644 --- a/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0032-xfrm-Replace-hrtimer-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:13 +0100 Subject: [PATCH 32/36] xfrm: Replace hrtimer tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Switch the timer to HRTIMER_MODE_SOFT, which executed the timer callback in softirq context and remove the hrtimer_tasklet. diff --git a/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch b/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch index e5fd2e4bd..a448c7e0b 100644 --- a/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch +++ b/debian/patches/features/all/rt/0033-softirq-Remove-tasklet_hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:14 +0100 Subject: [PATCH 33/36] softirq: Remove tasklet_hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are no more tasklet_hrtimer users of this interface. Remove it. diff --git a/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch b/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch index 396936a30..b83e227da 100644 --- a/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch +++ b/debian/patches/features/all/rt/0033-tracing-Make-tracing_set_clock-non-static.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:55 -0600 Subject: [PATCH 33/37] tracing: Make tracing_set_clock() non-static -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Allow tracing code outside of trace.c to access tracing_set_clock(). diff --git a/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch index a61e5fd26..ce3e2cf27 100644 --- a/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0034-ALSA-dummy-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:15 +0100 Subject: [PATCH 34/36] ALSA/dummy: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The tasklet is used to defer the execution of snd_pcm_period_elapsed() to the softirq context. Using the HRTIMER_MODE_SOFT mode invokes the timer diff --git a/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch b/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch index b3954309b..108366689 100644 --- a/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch +++ b/debian/patches/features/all/rt/0034-tracing-Add-a-clock-attribute-for-hist-triggers.patch @@ -1,7 +1,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:56 -0600 Subject: [PATCH 34/37] tracing: Add a clock attribute for hist triggers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The default clock if timestamps are used in a histogram is "global". If timestamps aren't used, the clock is irrelevant. diff --git a/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch b/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch index 4469acc48..762aae6a3 100644 --- a/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch +++ b/debian/patches/features/all/rt/0035-tracing-Increase-trace_recursive_lock-limit-for-synt.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:57 -0600 Subject: [PATCH 35/37] tracing: Increase trace_recursive_lock() limit for synthetic events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Synthetic event generation needs to happen while the current event is still in progress, so add 1 to the trace_recursive_lock() recursion @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c -@@ -2589,16 +2589,16 @@ rb_wakeups(struct ring_buffer *buffer, s +@@ -2593,16 +2593,16 @@ rb_wakeups(struct ring_buffer *buffer, s * IRQ context * NMI context * diff --git a/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch index 0ef3cd1a1..37783c162 100644 --- a/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0035-usb-gadget-NCM-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:16 +0100 Subject: [PATCH 35/36] usb/gadget/NCM: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The tx_tasklet tasklet is used in invoke the hrtimer (task_timer) in softirq context. This can be also achieved without the tasklet but diff --git a/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch b/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch index cf80a1775..1d61ad168 100644 --- a/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch +++ b/debian/patches/features/all/rt/0036-net-mvpp2-Replace-tasklet-with-softirq-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 23 Nov 2017 16:39:17 +0100 Subject: [PATCH 36/36] net/mvpp2: Replace tasklet with softirq hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The tx_done_tasklet tasklet is used in invoke the hrtimer (mvpp2_hr_timer_cb) in softirq context. This can be also achieved without @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior }; struct mvpp2_queue_vector { -@@ -5979,46 +5978,34 @@ static void mvpp2_link_event(struct net_ +@@ -5970,46 +5969,34 @@ static void mvpp2_link_event(struct net_ } } @@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior return HRTIMER_NORESTART; } -@@ -6507,7 +6494,12 @@ static int mvpp2_tx(struct sk_buff *skb, +@@ -6498,7 +6485,12 @@ static int mvpp2_tx(struct sk_buff *skb, txq_pcpu->count > 0) { struct mvpp2_port_pcpu *port_pcpu = this_cpu_ptr(port->pcpu); @@ -107,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior } return NETDEV_TX_OK; -@@ -6896,7 +6888,6 @@ static int mvpp2_stop(struct net_device +@@ -6887,7 +6879,6 @@ static int mvpp2_stop(struct net_device hrtimer_cancel(&port_pcpu->tx_done_timer); port_pcpu->timer_scheduled = false; @@ -115,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior } } mvpp2_cleanup_rxqs(port); -@@ -7664,13 +7655,10 @@ static int mvpp2_port_probe(struct platf +@@ -7655,13 +7646,10 @@ static int mvpp2_port_probe(struct platf port_pcpu = per_cpu_ptr(port->pcpu, cpu); hrtimer_init(&port_pcpu->tx_done_timer, CLOCK_MONOTONIC, diff --git a/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch b/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch index 883aa44c1..f3f1fca9d 100644 --- a/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch +++ b/debian/patches/features/all/rt/0036-tracing-Add-inter-event-blurb-to-HIST_TRIGGERS-confi.patch @@ -2,7 +2,7 @@ From: Tom Zanussi Date: Thu, 21 Dec 2017 10:02:58 -0600 Subject: [PATCH 36/37] tracing: Add inter-event blurb to HIST_TRIGGERS config option -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz So that users know that inter-event tracing is supported as part of the HIST_TRIGGERS option, include text to that effect in the help diff --git a/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch b/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch index 60c730922..d627e74bb 100644 --- a/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch +++ b/debian/patches/features/all/rt/0037-selftests-ftrace-Add-inter-event-hist-triggers-testc.patch @@ -2,7 +2,7 @@ From: Rajvi Jingar Date: Thu, 21 Dec 2017 10:02:59 -0600 Subject: [PATCH 37/37] selftests: ftrace: Add inter-event hist triggers testcases -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This adds inter-event hist triggers testcases which covers following: - create/remove synthetic event diff --git a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 4756a569d..d4b8e09f6 100644 --- a/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches/features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch @@ -1,7 +1,7 @@ From: "Yadi.hu" Date: Wed, 10 Dec 2014 10:32:09 +0800 Subject: ARM: enable irq in translation/section permission fault handlers -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch b/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch index c65c0e2ea..cd86740f1 100644 --- a/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch +++ b/debian/patches/features/all/rt/Bluetooth-avoid-recursive-locking-in-hci_send_to_cha.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 15:35:57 +0200 Subject: Bluetooth: avoid recursive locking in hci_send_to_channel() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Mart reported a deadlock in -RT in the call path: hci_send_monitor_ctrl_event() -> hci_send_to_channel() diff --git a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch index 6a641afc9..db4175121 100644 --- a/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch +++ b/debian/patches/features/all/rt/HACK-printk-drop-the-logbuf_lock-more-often.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 19:01:05 +0100 Subject: printk: Drop the logbuf_lock more often -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The lock is hold with irgs off. The latency drops 500us+ on my arm bugs with a "full" buffer after executing "dmesg" on the shell. diff --git a/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index c0e3e6811..8b9977c68 100644 --- a/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating the vgic and timer states to prevent the calling task from migrating to diff --git a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 5543a0244..a63178a79 100644 --- a/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches/features/all/rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,7 +5,7 @@ Cc: Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this diff --git a/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch b/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch index 95fe517e0..dadc91c6f 100644 --- a/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch +++ b/debian/patches/features/all/rt/RCU-we-need-to-skip-that-warning-but-only-on-sleepin.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 Subject: [PATCH] RCU: we need to skip that warning but only on sleeping locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This check is okay for upstream. On RT we trigger this while blocking on sleeping lock. In this case, it is okay to schedule() within a RCU diff --git a/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch index 574793f19..1871615a5 100644 --- a/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/debian/patches/features/all/rt/Revert-fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 23 Nov 2017 17:51:51 +0100 Subject: [PATCH] Revert "fs: jbd2: pull your plug when waiting for space" -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This reverts commit "fs: jbd2: pull your plug when waiting for space". This was a duct-tape fix which shouldn't be needed since commit diff --git a/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch b/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch index e22d6e278..cfcdd6c68 100644 --- a/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch +++ b/debian/patches/features/all/rt/Revert-memcontrol-Prevent-scheduling-while-atomic-in.patch @@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" Date: Wed, 22 Nov 2017 07:31:19 -0500 Subject: [PATCH] Revert "memcontrol: Prevent scheduling while atomic in cgroup code" -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The commit "memcontrol: Prevent scheduling while atomic in cgroup code" fixed this issue: diff --git a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch index 596fa68b5..e06a07192 100644 --- a/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch +++ b/debian/patches/features/all/rt/acpi-rt-Convert-acpi_gbl_hardware-lock-back-to-a-raw.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Wed, 13 Feb 2013 09:26:05 -0500 Subject: acpi/rt: Convert acpi_gbl_hardware lock back to a raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We hit the following bug with 3.6-rt: diff --git a/debian/patches/features/all/rt/add_migrate_disable.patch b/debian/patches/features/all/rt/add_migrate_disable.patch index 53989f993..bcc9a7128 100644 --- a/debian/patches/features/all/rt/add_migrate_disable.patch +++ b/debian/patches/features/all/rt/add_migrate_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz --- include/linux/preempt.h | 23 ++++++++ diff --git a/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch index fccd4cc31..3c6fa0439 100644 --- a/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches/features/all/rt/apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 Subject: apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is diff --git a/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch index 714be122e..7afcbe792 100644 --- a/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches/features/all/rt/arch-arm64-Add-lazy-preempt-support.patch @@ -1,7 +1,7 @@ From: Anders Roxell Date: Thu, 14 May 2015 17:52:17 +0200 Subject: arch/arm64: Add lazy preempt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz arm64 is missing support for PREEMPT_RT. The main feature which is lacking is support for lazy preemption. The arch-specific entry code, diff --git a/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch index b2f8d758d..591e39bca 100644 --- a/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch +++ b/debian/patches/features/all/rt/arm-at91-pit-remove-irq-handler-when-clock-is-unused.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger Date: Sat, 6 Mar 2010 17:47:10 +0100 Subject: ARM: AT91: PIT: Remove irq handler when clock event is unused -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Setup and remove the interrupt handler in clock event mode selection. This avoids calling the (shared) interrupt handler when the device is diff --git a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch index 2e8f627c1..9fd911235 100644 --- a/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch +++ b/debian/patches/features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 May 2010 18:29:35 +0200 Subject: ARM: at91: tclib: Default to tclib timer for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT is not too happy about the shared timer interrupt in AT91 devices. Default to tclib timer for RT. diff --git a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch index ab01b9156..0e57a7e89 100644 --- a/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch +++ b/debian/patches/features/all/rt/arm-convert-boot-lock-to-raw.patch @@ -1,7 +1,7 @@ From: Frank Rowand Date: Mon, 19 Sep 2011 14:51:14 -0700 Subject: arm: Convert arm boot_lock to raw -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. diff --git a/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch index dcb552d3f..3a8e74600 100644 --- a/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches/features/all/rt/arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 Subject: [PATCH] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON diff --git a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch index 4e87e137b..35ae0f811 100644 --- a/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch @@ -1,7 +1,7 @@ Subject: arm: Enable highmem for rt From: Thomas Gleixner Date: Wed, 13 Feb 2013 11:03:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz fixup highmem for ARM. diff --git a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch index 6425a03cc..b622d87b7 100644 --- a/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches/features/all/rt/arm-highmem-flush-tlb-on-unmap.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 21:37:27 +0100 Subject: arm/highmem: Flush tlb on unmap -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The tlb should be flushed on unmap and thus make the mapping entry invalid. This is only done in the non-debug case which does not look diff --git a/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch index 446dd562a..d98c10540 100644 --- a/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches/features/all/rt/arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 Subject: [PATCH] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. diff --git a/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch index 2f3cd0c4c..658134ff6 100644 --- a/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch +++ b/debian/patches/features/all/rt/arm-kprobe-replace-patch_lock-to-raw-lock.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Thu, 10 Nov 2016 16:17:55 -0800 Subject: [PATCH] arm: kprobe: replace patch_lock to raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When running kprobe on -rt kernel, the below bug is caught: diff --git a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch index 31abb8398..220c73a4a 100644 --- a/debian/patches/features/all/rt/arm-preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: arm: Add support for lazy preemption From: Thomas Gleixner Date: Wed, 31 Oct 2012 12:04:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Implement the arm pieces for lazy preempt. diff --git a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch index 69ae3aa94..a91716e2a 100644 --- a/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch +++ b/debian/patches/features/all/rt/arm-unwind-use_raw_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Sep 2013 14:31:54 +0200 Subject: arm/unwind: use a raw_spin_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. diff --git a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch index 625f67874..021b72ae1 100644 --- a/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch +++ b/debian/patches/features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch @@ -1,7 +1,7 @@ Subject: arm64/xen: Make XEN depend on !RT From: Thomas Gleixner Date: Mon, 12 Oct 2015 11:18:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It's not ready and probably never will be, unless xen folks have a look at it. diff --git a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch index d5d3a70d7..48a9d9d2d 100644 --- a/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches/features/all/rt/at91_dont_enable_disable_clock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 09 Mar 2016 10:51:06 +0100 Subject: arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. diff --git a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch index fc8bf623a..ef13cbd49 100644 --- a/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch +++ b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Fri, 3 Jul 2009 08:44:29 -0500 Subject: ata: Do not disable interrupts in ide code for preempt-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch index a25464832..6a6c29f6c 100644 --- a/debian/patches/features/all/rt/block-blk-mq-use-swait.patch +++ b/debian/patches/features/all/rt/block-blk-mq-use-swait.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 11:01:26 +0100 Subject: block: blk-mq: Use swait -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz | BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 | in_atomic(): 1, irqs_disabled(): 0, pid: 255, name: kworker/u257:6 @@ -46,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -784,7 +784,7 @@ int blk_queue_enter(struct request_queue +@@ -785,7 +785,7 @@ int blk_queue_enter(struct request_queue */ smp_rmb(); @@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior !atomic_read(&q->mq_freeze_depth) || blk_queue_dying(q)); if (blk_queue_dying(q)) -@@ -804,7 +804,7 @@ static void blk_queue_usage_counter_rele +@@ -805,7 +805,7 @@ static void blk_queue_usage_counter_rele struct request_queue *q = container_of(ref, struct request_queue, q_usage_counter); @@ -64,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(unsigned long data) -@@ -880,7 +880,7 @@ struct request_queue *blk_alloc_queue_no +@@ -881,7 +881,7 @@ struct request_queue *blk_alloc_queue_no q->bypass_depth = 1; __set_bit(QUEUE_FLAG_BYPASS, &q->queue_flags); @@ -112,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h -@@ -581,7 +581,7 @@ struct request_queue { +@@ -598,7 +598,7 @@ struct request_queue { struct throtl_data *td; #endif struct rcu_head rcu_head; diff --git a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch index 2684dd211..cbe347888 100644 --- a/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches/features/all/rt/block-mq-don-t-complete-requests-via-IPI.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 15:10:08 +0100 Subject: block/mq: don't complete requests via IPI -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The IPI runs in hardirq context and there are sleeping locks. This patch moves the completion into a workqueue. diff --git a/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch index 59899c819..ddd364d23 100644 --- a/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches/features/all/rt/block-mq-drop-preempt-disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: block/mq: do not invoke preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz preempt_disable() and get_cpu() don't play well together with the sleeping locks it tries to allocate later. diff --git a/debian/patches/features/all/rt/block-mq-use-cpu_light.patch b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch index f5aa218f2..809732de2 100644 --- a/debian/patches/features/all/rt/block-mq-use-cpu_light.patch +++ b/debian/patches/features/all/rt/block-mq-use-cpu_light.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 10:37:23 +0200 Subject: block: mq: use cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz there is a might sleep splat because get_cpu() disables preemption and later we grab a lock. As a workaround for this we use get_cpu_light(). diff --git a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch index 9a8daa696..9f5ffe2db 100644 --- a/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch +++ b/debian/patches/features/all/rt/block-shorten-interrupt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: block: Shorten interrupt disabled regions From: Thomas Gleixner Date: Wed, 22 Jun 2011 19:47:02 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Moving the blk_sched_flush_plug() call out of the interrupt/preempt disabled region in the scheduler allows us to replace @@ -48,7 +48,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -3290,7 +3290,7 @@ static void queue_unplugged(struct reque +@@ -3291,7 +3291,7 @@ static void queue_unplugged(struct reque blk_run_queue_async(q); else __blk_run_queue(q); @@ -57,7 +57,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule) -@@ -3338,7 +3338,6 @@ EXPORT_SYMBOL(blk_check_plugged); +@@ -3339,7 +3339,6 @@ EXPORT_SYMBOL(blk_check_plugged); void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) { struct request_queue *q; @@ -65,7 +65,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de struct request *rq; LIST_HEAD(list); unsigned int depth; -@@ -3358,11 +3357,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3359,11 +3358,6 @@ void blk_flush_plug_list(struct blk_plug q = NULL; depth = 0; @@ -77,7 +77,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de while (!list_empty(&list)) { rq = list_entry_rq(list.next); list_del_init(&rq->queuelist); -@@ -3375,7 +3369,7 @@ void blk_flush_plug_list(struct blk_plug +@@ -3376,7 +3370,7 @@ void blk_flush_plug_list(struct blk_plug queue_unplugged(q, depth, from_schedule); q = rq->q; depth = 0; @@ -86,7 +86,7 @@ Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de } /* -@@ -3402,8 +3396,6 @@ void blk_flush_plug_list(struct blk_plug +@@ -3403,8 +3397,6 @@ void blk_flush_plug_list(struct blk_plug */ if (q) queue_unplugged(q, depth, from_schedule); diff --git a/debian/patches/features/all/rt/block-use-cpu-chill.patch b/debian/patches/features/all/rt/block-use-cpu-chill.patch index 25cb7f51b..e9c04df69 100644 --- a/debian/patches/features/all/rt/block-use-cpu-chill.patch +++ b/debian/patches/features/all/rt/block-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: block: Use cpu_chill() for retry loops From: Thomas Gleixner Date: Thu, 20 Dec 2012 18:28:26 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Steven also observed a live lock when there was a diff --git a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch index ba7a6a660..2decc62d7 100644 --- a/debian/patches/features/all/rt/bug-rt-dependend-variants.patch +++ b/debian/patches/features/all/rt/bug-rt-dependend-variants.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:58 -0500 Subject: bug: BUG_ON/WARN_ON variants dependend on RT/!RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Introduce RT/NON-RT WARN/BUG statements to avoid ifdefs in the code. diff --git a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch index e81eea4c1..b17ebe912 100644 --- a/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch +++ b/debian/patches/features/all/rt/cgroups-scheduling-while-atomic-in-cgroup-code.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sat, 21 Jun 2014 10:09:48 +0200 Subject: memcontrol: Prevent scheduling while atomic in cgroup code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz mm, memcg: make refill_stock() use get_cpu_light() diff --git a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch index 2f3d62551..7a9207095 100644 --- a/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch +++ b/debian/patches/features/all/rt/cgroups-use-simple-wait-in-css_release.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 13 Feb 2015 15:52:24 +0100 Subject: cgroups: use simple wait in css_release() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 @@ -53,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior * PI: the parent css. Placed here for cache proximity to following --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -4500,10 +4500,10 @@ static void css_free_rcu_fn(struct rcu_h +@@ -4498,10 +4498,10 @@ static void css_free_rcu_fn(struct rcu_h queue_work(cgroup_destroy_wq, &css->destroy_work); } @@ -66,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct cgroup_subsys *ss = css->ss; struct cgroup *cgrp = css->cgroup; -@@ -4554,8 +4554,8 @@ static void css_release(struct percpu_re +@@ -4552,8 +4552,8 @@ static void css_release(struct percpu_re struct cgroup_subsys_state *css = container_of(ref, struct cgroup_subsys_state, refcnt); @@ -77,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void init_and_link_css(struct cgroup_subsys_state *css, -@@ -5261,6 +5261,7 @@ static int __init cgroup_wq_init(void) +@@ -5259,6 +5259,7 @@ static int __init cgroup_wq_init(void) */ cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1); BUG_ON(!cgroup_destroy_wq); diff --git a/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch b/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch index fda66e55d..733a5dd8e 100644 --- a/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch +++ b/debian/patches/features/all/rt/char-random-don-t-print-that-the-init-is-done.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 30 May 2017 16:39:01 +0200 Subject: char/random: don't print that the init is done -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On RT we run into circular locking with pendingb_lock (workqueue), port_lock_key (uart) and the primary_crng (random): diff --git a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch index 6eb19c749..f53781d2c 100644 --- a/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch +++ b/debian/patches/features/all/rt/clockevents-drivers-timer-atmel-pit-fix-double-free_.patch @@ -1,7 +1,7 @@ From: Alexandre Belloni Date: Thu, 17 Mar 2016 21:09:43 +0100 Subject: [PATCH] clockevents/drivers/timer-atmel-pit: fix double free_irq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz clockevents_exchange_device() changes the state from detached to shutdown and so at that point the IRQ has not yet been requested. diff --git a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch index aaa6738cf..52a4a6509 100644 --- a/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches/features/all/rt/clocksource-tclib-allow-higher-clockrates.patch @@ -1,7 +1,7 @@ From: Benedikt Spranger Date: Mon, 8 Mar 2010 18:57:04 +0100 Subject: clocksource: TCLIB: Allow higher clock rates for clock events -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz As default the TCLIB uses the 32KiHz base clock rate for clock events. Add a compile time selection to allow higher clock resulution. diff --git a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch index 8c448eabb..6aa9bc701 100644 --- a/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch +++ b/debian/patches/features/all/rt/completion-use-simple-wait-queues.patch @@ -1,7 +1,7 @@ Subject: completion: Use simple wait queues From: Thomas Gleixner Date: Fri, 11 Jan 2013 11:23:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the diff --git a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch index 53940b564..5decbf17d 100644 --- a/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches/features/all/rt/cond-resched-lock-rt-tweak.patch @@ -1,7 +1,7 @@ Subject: sched: Use the proper LOCK_OFFSET for cond_resched() From: Thomas Gleixner Date: Sun, 17 Jul 2011 22:51:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT does not increment preempt count when a 'sleeping' spinlock is locked. Update PREEMPT_LOCK_OFFSET for that case. diff --git a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch index 1be4ef58f..1aa76a2f2 100644 --- a/debian/patches/features/all/rt/cond-resched-softirq-rt.patch +++ b/debian/patches/features/all/rt/cond-resched-softirq-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Take RT softirq semantics into account in cond_resched() From: Thomas Gleixner Date: Thu, 14 Jul 2011 09:56:44 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The softirq semantics work different on -RT. There is no SOFTIRQ_MASK in the preemption counter which leads to the BUG_ON() statement in diff --git a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 8168c20ec..6d8c31f22 100644 --- a/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches/features/all/rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep diff --git a/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch index 9f39d92be..c33c5018a 100644 --- a/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches/features/all/rt/cpu-hotplug--Implement-CPU-pinning.patch @@ -1,7 +1,7 @@ Subject: cpu/hotplug: Implement CPU pinning From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch index 1ebd09b1b..79a4bd4ac 100644 --- a/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch +++ b/debian/patches/features/all/rt/cpu_chill-Add-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Tue, 4 Mar 2014 12:28:32 -0500 Subject: cpu_chill: Add a UNINTERRUPTIBLE hrtimer_nanosleep -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We hit another bug that was caused by switching cpu_chill() from msleep() to hrtimer_nanosleep(). @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1743,12 +1743,13 @@ int nanosleep_copyout(struct restart_blo +@@ -1742,12 +1742,13 @@ int nanosleep_copyout(struct restart_blo return -ERESTART_RESTARTBLOCK; } @@ -50,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_start_expires(&t->timer, mode); if (likely(t->task)) -@@ -1786,13 +1787,15 @@ static long __sched hrtimer_nanosleep_re +@@ -1785,13 +1786,15 @@ static long __sched hrtimer_nanosleep_re hrtimer_init_sleeper_on_stack(&t, restart->nanosleep.clockid, HRTIMER_MODE_ABS, current); hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires); @@ -69,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior { struct restart_block *restart; struct hrtimer_sleeper t; -@@ -1805,7 +1808,7 @@ long hrtimer_nanosleep(const struct time +@@ -1804,7 +1807,7 @@ long hrtimer_nanosleep(const struct time hrtimer_init_sleeper_on_stack(&t, clockid, mode, current); hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); @@ -78,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret != -ERESTART_RESTARTBLOCK) goto out; -@@ -1824,6 +1827,12 @@ long hrtimer_nanosleep(const struct time +@@ -1823,6 +1826,12 @@ long hrtimer_nanosleep(const struct time return ret; } @@ -91,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, struct timespec __user *, rmtp) { -@@ -1871,7 +1880,8 @@ void cpu_chill(void) +@@ -1870,7 +1879,8 @@ void cpu_chill(void) unsigned int freeze_flag = current->flags & PF_NOFREEZE; current->flags |= PF_NOFREEZE; diff --git a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 0e1d1bbea..12eba9329 100644 --- a/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches/features/all/rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 9 Apr 2015 15:23:01 +0200 Subject: cpufreq: drop K8's driver from beeing selected -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch index 52bb1ef9d..1b8e38ca2 100644 --- a/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches/features/all/rt/cpumask-disable-offstack-on-rt.patch @@ -1,7 +1,7 @@ Subject: cpumask: Disable CONFIG_CPUMASK_OFFSTACK for RT From: Thomas Gleixner Date: Wed, 14 Dec 2011 01:03:49 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are "valid" GFP_ATOMIC allocations such as @@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -921,7 +921,7 @@ config IOMMU_HELPER +@@ -934,7 +934,7 @@ config IOMMU_HELPER config MAXSMP bool "Enable Maximum number of SMP Processors and NUMA Nodes" depends on X86_64 && SMP && DEBUG_KERNEL diff --git a/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index c13b7f450..1c36f4c5a 100644 --- a/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches/features/all/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index cfa536da9..b630e0d06 100644 --- a/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches/features/all/rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Feb 2014 17:24:04 +0100 Subject: crypto: Reduce preempt disabled regions, more algos -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Don Estabrook reported | kernel: WARNING: CPU: 2 PID: 858 at kernel/sched/core.c:2428 migrate_disable+0xed/0x100() diff --git a/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch index 35b852071..38b5ca222 100644 --- a/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches/features/all/rt/crypto-limit-more-FPU-enabled-sections.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which diff --git a/debian/patches/features/all/rt/debugobjects-rt.patch b/debian/patches/features/all/rt/debugobjects-rt.patch index 11cc372b1..9ddc45701 100644 --- a/debian/patches/features/all/rt/debugobjects-rt.patch +++ b/debian/patches/features/all/rt/debugobjects-rt.patch @@ -1,7 +1,7 @@ Subject: debugobjects: Make RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:41:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch b/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch index 68db3fe36..fc6c1a249 100644 --- a/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch +++ b/debian/patches/features/all/rt/delayacct-use-raw_spinlocks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 20 May 2017 12:32:23 +0200 Subject: [PATCH] delayacct: use raw_spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz try_to_wake_up() might invoke delayacct_blkio_end() while holding the pi_lock. The lock is only held for a short amount of time so it should @@ -10,8 +10,8 @@ be safe to make it raw. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/delayacct.h | 2 +- - kernel/delayacct.c | 14 +++++++------- - 2 files changed, 8 insertions(+), 8 deletions(-) + kernel/delayacct.c | 16 ++++++++-------- + 2 files changed, 9 insertions(+), 9 deletions(-) --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h @@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* For each stat XXX, add following, aligned appropriately --- a/kernel/delayacct.c +++ b/kernel/delayacct.c -@@ -44,7 +44,7 @@ void __delayacct_tsk_init(struct task_st +@@ -44,23 +44,23 @@ void __delayacct_tsk_init(struct task_st { tsk->delays = kmem_cache_zalloc(delayacct_cache, GFP_KERNEL); if (tsk->delays) @@ -35,20 +35,26 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -57,10 +57,10 @@ static void delayacct_end(u64 *start, u6 + * Finish delay accounting for a statistic using its timestamps (@start), + * accumalator (@total) and @count + */ +-static void delayacct_end(spinlock_t *lock, u64 *start, u64 *total, u32 *count) ++static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total, u32 *count) + { + s64 ns = ktime_get_ns() - *start; unsigned long flags; if (ns > 0) { -- spin_lock_irqsave(¤t->delays->lock, flags); -+ raw_spin_lock_irqsave(¤t->delays->lock, flags); +- spin_lock_irqsave(lock, flags); ++ raw_spin_lock_irqsave(lock, flags); *total += ns; (*count)++; -- spin_unlock_irqrestore(¤t->delays->lock, flags); -+ raw_spin_unlock_irqrestore(¤t->delays->lock, flags); +- spin_unlock_irqrestore(lock, flags); ++ raw_spin_unlock_irqrestore(lock, flags); } } -@@ -119,7 +119,7 @@ int __delayacct_add_tsk(struct taskstats +@@ -127,7 +127,7 @@ int __delayacct_add_tsk(struct taskstats /* zero XXX_total, non-zero XXX_count implies XXX stat overflowed */ @@ -57,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior tmp = d->blkio_delay_total + tsk->delays->blkio_delay; d->blkio_delay_total = (tmp < d->blkio_delay_total) ? 0 : tmp; tmp = d->swapin_delay_total + tsk->delays->swapin_delay; -@@ -129,7 +129,7 @@ int __delayacct_add_tsk(struct taskstats +@@ -137,7 +137,7 @@ int __delayacct_add_tsk(struct taskstats d->blkio_count += tsk->delays->blkio_count; d->swapin_count += tsk->delays->swapin_count; d->freepages_count += tsk->delays->freepages_count; @@ -66,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior return 0; } -@@ -139,10 +139,10 @@ int __delayacct_add_tsk(struct taskstats +@@ -147,10 +147,10 @@ int __delayacct_add_tsk(struct taskstats __u64 ret; unsigned long flags; diff --git a/debian/patches/features/all/rt/dm-make-rt-aware.patch b/debian/patches/features/all/rt/dm-make-rt-aware.patch index fc3616786..57a700a2a 100644 --- a/debian/patches/features/all/rt/dm-make-rt-aware.patch +++ b/debian/patches/features/all/rt/dm-make-rt-aware.patch @@ -1,7 +1,7 @@ Subject: dm: Make rt aware From: Thomas Gleixner Date: Mon, 14 Nov 2011 23:06:09 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the BUG_ON_NORT variant for the irq_disabled() checks. RT has interrupts legitimately enabled here as we cant deadlock against the diff --git a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index c0c1bf99a..cfe23c558 100644 --- a/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches/features/all/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. diff --git a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch index 7774c05e4..70b13732d 100644 --- a/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch +++ b/debian/patches/features/all/rt/drivers-net-8139-disable-irq-nosync.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:24 -0500 Subject: drivers/net: Use disable_irq_nosync() in 8139too -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use disable_irq_nosync() instead of disable_irq() as this might be called in atomic context with netpoll. diff --git a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch index acfbb9dfe..e10783d06 100644 --- a/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch +++ b/debian/patches/features/all/rt/drivers-net-vortex-fix-locking-issues.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Fri, 3 Jul 2009 08:30:00 -0500 Subject: drivers/net: vortex fix locking issues -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Argh, cut and paste wasn't enough... diff --git a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch index da589361c..7295a36d5 100644 --- a/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch +++ b/debian/patches/features/all/rt/drivers-random-reduce-preempt-disabled-region.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:30 -0500 Subject: drivers: random: Reduce preempt disabled region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz No need to keep preemption disabled across the whole function. diff --git a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch index d777e2fba..95db754e0 100644 --- a/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches/features/all/rt/drivers-tty-fix-omap-lock-crap.patch @@ -1,7 +1,7 @@ Subject: tty/serial/omap: Make the locking RT aware From: Thomas Gleixner Date: Thu, 28 Jul 2011 13:32:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and diff --git a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch index 7ed1b0aae..668a14204 100644 --- a/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches/features/all/rt/drivers-tty-pl011-irq-disable-madness.patch @@ -1,7 +1,7 @@ Subject: tty/serial/pl011: Make the locking work on RT From: Thomas Gleixner Date: Tue, 08 Jan 2013 21:36:51 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The lock is a sleeping lock and local_irq_save() is not the optimsation we are looking for. Redo it to make it work on -RT and non-RT. diff --git a/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 401807629..59fdc19f0 100644 --- a/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches/features/all/rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 Subject: [PATCH] drivers/zram: Don't disable preemption in zcomp_stream_get/put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We diff --git a/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch b/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch index 7f59e2c6f..c7aa2cc44 100644 --- a/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch +++ b/debian/patches/features/all/rt/drivers-zram-fix-zcomp_stream_get-smp_processor_id-u.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Wed, 23 Aug 2017 11:57:29 +0200 Subject: [PATCH] drivers/zram: fix zcomp_stream_get() smp_processor_id() use in preemptible code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use get_local_ptr() instead this_cpu_ptr() to avoid a warning regarding smp_processor_id() in preemptible code. diff --git a/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch b/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch index f8c4db108..a19dccd85 100644 --- a/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch +++ b/debian/patches/features/all/rt/drm-i915-properly-init-lockdep-class.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 30 Nov 2017 16:06:13 +0100 Subject: [PATCH] drm/i915: properly init lockdep class -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The code has an ifdef and uses two functions to either init the bare spinlock or init it and set a lock-class. It is possible to do the same diff --git a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch index 6feb21a9b..c86633dfc 100644 --- a/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches/features/all/rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch @@ -1,7 +1,7 @@ Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 diff --git a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index 088a50237..26078703c 100644 --- a/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches/features/all/rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch @@ -1,7 +1,7 @@ Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch index ac3b3b231..4424f3db0 100644 --- a/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch +++ b/debian/patches/features/all/rt/epoll-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: fs/epoll: Do not disable preemption on RT From: Thomas Gleixner Date: Fri, 08 Jul 2011 16:35:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz ep_call_nested() takes a sleeping lock so we can't disable preemption. The light version is enough since ep_call_nested() doesn't mind beeing diff --git a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch index b09f9796e..e8e42f322 100644 --- a/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch +++ b/debian/patches/features/all/rt/fs-aio-simple-simple-work.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 16 Feb 2015 18:49:10 +0100 Subject: fs/aio: simple simple work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:768 |in_atomic(): 1, irqs_disabled(): 0, pid: 26, name: rcuos/2 diff --git a/debian/patches/features/all/rt/fs-block-rt-support.patch b/debian/patches/features/all/rt/fs-block-rt-support.patch index 954d016f9..8508b7687 100644 --- a/debian/patches/features/all/rt/fs-block-rt-support.patch +++ b/debian/patches/features/all/rt/fs-block-rt-support.patch @@ -1,7 +1,7 @@ Subject: block: Turn off warning which is bogus on RT From: Thomas Gleixner Date: Tue, 14 Jun 2011 17:05:09 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On -RT the context is always with IRQs enabled. Ignore this warning on -RT. diff --git a/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch index 36582e10b..b6bc01429 100644 --- a/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches/features/all/rt/fs-dcache-bringt-back-explicit-INIT_HLIST_BL_HEAD-in.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 Subject: [PATCH] fs/dcache: bringt back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However diff --git a/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index d0612224c..99a0a3c7f 100644 --- a/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches/features/all/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is diff --git a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index a293d6648..02af2b128 100644 --- a/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch @@ -1,7 +1,7 @@ Subject: fs: dcache: Use cpu_chill() in trylock loops From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:00:34 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index a2df33383..940dc4720 100644 --- a/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches/features/all/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. diff --git a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch index 93f740a48..356d05483 100644 --- a/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 10:11:25 +0100 Subject: fs: jbd/jbd2: Make state lock and journal head lock rt safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz bit_spin_locks break under RT. diff --git a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch index df47a3298..5a49441d6 100644 --- a/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch +++ b/debian/patches/features/all/rt/fs-jbd2-pull-your-plug-when-waiting-for-space.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 17 Feb 2014 17:30:03 +0100 Subject: fs: jbd2: pull your plug when waiting for space -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Two cps in parallel managed to stall the the ext4 fs. It seems that journal code is either waiting for locks or sleeping waiting for diff --git a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch index 144c09365..c669d2048 100644 --- a/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch +++ b/debian/patches/features/all/rt/fs-namespace-preemption-fix.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 19 Jul 2009 08:44:27 -0500 Subject: fs: namespace preemption fix -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On RT we cannot loop with preemption disabled here as mnt_make_readonly() might have been preempted. We can safely enable diff --git a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index a9424ee3c..343277aac 100644 --- a/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches/features/all/rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The RW semaphore had a reader side which used the _non_owner version because it most likely took the reader lock in one thread and released it diff --git a/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch index a139ac8b0..69324d790 100644 --- a/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch +++ b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 3 Jul 2009 08:44:12 -0500 Subject: fs: ntfs: disable interrupt only on !RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On Sat, 2007-10-27 at 11:44 +0200, Ingo Molnar wrote: > * Nick Piggin wrote: diff --git a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch index 9a1415b04..7dc6a1b6c 100644 --- a/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches/features/all/rt/fs-replace-bh_uptodate_lock-for-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 18 Mar 2011 09:18:52 +0100 Subject: buffer_head: Replace bh_uptodate_lock for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Wrap the bit_spin_lock calls into a separate inline and add the RT replacements with a real spinlock. diff --git a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch index 18f7d1284..da09968c9 100644 --- a/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches/features/all/rt/ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 Subject: [PATCH] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Line up helper arrows to the right column. diff --git a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch index 566d2ad51..19b156121 100644 --- a/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:56:42 +0200 Subject: trace: Add migrate-disabled counter to tracing output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index eac86f27c..9733e933a 100644 --- a/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches/features/all/rt/futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 1 Mar 2013 11:17:42 +0100 Subject: futex: Ensure lock/unlock symetry versus pi_lock and hash bucket lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In exit_pi_state_list() we have the following locking construct: diff --git a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch index 364e2c4d6..0333cccef 100644 --- a/debian/patches/features/all/rt/futex-requeue-pi-fix.patch +++ b/debian/patches/features/all/rt/futex-requeue-pi-fix.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: futex: Fix bug on when a requeued RT task times out -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1730,6 +1731,35 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1742,6 +1743,35 @@ int __rt_mutex_start_proxy_lock(struct r if (try_to_take_rt_mutex(lock, task, NULL)) return 1; diff --git a/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch b/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch index 4e090be26..c442cb857 100644 --- a/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch +++ b/debian/patches/features/all/rt/futex-workaround-migrate_disable-enable-in-different.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 8 Mar 2017 14:23:35 +0100 Subject: [PATCH] futex: workaround migrate_disable/enable in different context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz migrate_disable()/migrate_enable() takes a different path in atomic() vs !atomic() context. These little hacks ensure that we don't underflow / overflow @@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2762,9 +2762,18 @@ static int futex_lock_pi(u32 __user *uad +@@ -2816,9 +2816,18 @@ static int futex_lock_pi(u32 __user *uad * lock handoff sequence. */ raw_spin_lock_irq(&q.pi_state->pi_mutex.wait_lock); @@ -35,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret) { if (ret == 1) -@@ -2911,11 +2920,21 @@ static int futex_unlock_pi(u32 __user *u +@@ -2965,11 +2974,21 @@ static int futex_unlock_pi(u32 __user *u * observed. */ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); diff --git a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch index d3cf1b071..07820b92d 100644 --- a/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches/features/all/rt/genirq-disable-irqpoll-on-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:57 -0500 Subject: genirq: Disable irqpoll on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Creates long latencies for no value diff --git a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch index 9b94ff1b1..71c3a445c 100644 --- a/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch +++ b/debian/patches/features/all/rt/genirq-do-not-invoke-the-affinity-callback-via-a-wor.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 21 Aug 2013 17:48:46 +0200 Subject: genirq: Do not invoke the affinity callback via a workqueue on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Joe Korty reported, that __irq_set_affinity_locked() schedules a workqueue while holding a rawlock which results in a might_sleep() diff --git a/debian/patches/features/all/rt/genirq-force-threading.patch b/debian/patches/features/all/rt/genirq-force-threading.patch index 01603da06..67aa49bb4 100644 --- a/debian/patches/features/all/rt/genirq-force-threading.patch +++ b/debian/patches/features/all/rt/genirq-force-threading.patch @@ -1,7 +1,7 @@ Subject: genirq: Force interrupt thread on RT From: Thomas Gleixner Date: Sun, 03 Apr 2011 11:57:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. diff --git a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch index 4b135a533..266a7a987 100644 --- a/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On -rt kernels, the use of migrate_disable()/migrate_enable() is sufficient to guarantee a task isn't moved to another CPU. Update the diff --git a/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch b/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch index 7556dce65..de7af388e 100644 --- a/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 Subject: [PATCH] greybus: audio: don't inclide rwlock.h directly. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. diff --git a/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index e01630c06..75a8bfb4f 100644 --- a/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches/features/all/rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no diff --git a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch index f44d9fe50..6a12a6225 100644 --- a/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches/features/all/rt/hotplug-light-get-online-cpus.patch @@ -1,7 +1,7 @@ Subject: hotplug: Lightweight get online cpus From: Thomas Gleixner Date: Wed, 15 Jun 2011 12:36:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only @@ -20,7 +20,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/cpu.h +++ b/include/linux/cpu.h -@@ -109,6 +109,8 @@ extern void cpu_hotplug_disable(void); +@@ -116,6 +116,8 @@ extern void cpu_hotplug_disable(void); extern void cpu_hotplug_enable(void); void clear_tasks_mm_cpumask(int cpu); int cpu_down(unsigned int cpu); @@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner #else /* CONFIG_HOTPLUG_CPU */ -@@ -119,6 +121,9 @@ static inline void cpus_read_unlock(void +@@ -126,6 +128,9 @@ static inline void cpus_read_unlock(void static inline void lockdep_assert_cpus_held(void) { } static inline void cpu_hotplug_disable(void) { } static inline void cpu_hotplug_enable(void) { } diff --git a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch index 95a9cf321..306175f56 100644 --- a/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch +++ b/debian/patches/features/all/rt/hrtimer-Move-schedule_work-call-to-helper-thread.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Mon, 16 Sep 2013 14:09:19 -0700 Subject: hrtimer: Move schedule_work call to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When run ltp leapsec_timer test, the following call trace is caught: @@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -730,6 +730,29 @@ static void hrtimer_switch_to_hres(void) +@@ -715,6 +715,29 @@ static void hrtimer_switch_to_hres(void) retrigger_next_event(NULL); } @@ -82,7 +82,7 @@ Signed-off-by: Sebastian Andrzej Siewior static void clock_was_set_work(struct work_struct *work) { clock_was_set(); -@@ -745,6 +768,7 @@ void clock_was_set_delayed(void) +@@ -730,6 +753,7 @@ void clock_was_set_delayed(void) { schedule_work(&hrtimer_work); } diff --git a/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch index 2b979ee2d..29fbc5d4d 100644 --- a/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches/features/all/rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 Subject: hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -191,7 +191,7 @@ Signed-off-by: Sebastian Andrzej Siewior } --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -1226,7 +1226,7 @@ void tick_setup_sched_timer(void) +@@ -1254,7 +1254,7 @@ void tick_setup_sched_timer(void) /* * Emulate tick processing via per-CPU hrtimers: */ diff --git a/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index 1c1ec6cfc..3b7395416 100644 --- a/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches/features/all/rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 4 Sep 2017 18:31:50 +0200 Subject: [PATCH] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of the @@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior current->timer_slack_ns, \ --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2588,10 +2588,9 @@ static int futex_wait(u32 __user *uaddr, +@@ -2642,10 +2642,9 @@ static int futex_wait(u32 __user *uaddr, if (abs_time) { to = &timeout; @@ -107,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&to->timer, *abs_time, current->timer_slack_ns); } -@@ -2690,9 +2689,8 @@ static int futex_lock_pi(u32 __user *uad +@@ -2744,9 +2743,8 @@ static int futex_lock_pi(u32 __user *uad if (time) { to = &timeout; @@ -119,7 +119,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires(&to->timer, *time); } -@@ -3108,10 +3106,9 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3162,10 +3160,9 @@ static int futex_wait_requeue_pi(u32 __u if (abs_time) { to = &timeout; @@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior } --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1604,13 +1604,44 @@ static enum hrtimer_restart hrtimer_wake +@@ -1603,13 +1603,44 @@ static enum hrtimer_restart hrtimer_wake return HRTIMER_NORESTART; } @@ -181,7 +181,7 @@ Signed-off-by: Sebastian Andrzej Siewior int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) { switch(restart->nanosleep.type) { -@@ -1634,8 +1665,6 @@ static int __sched do_nanosleep(struct h +@@ -1633,8 +1664,6 @@ static int __sched do_nanosleep(struct h { struct restart_block *restart; @@ -190,7 +190,7 @@ Signed-off-by: Sebastian Andrzej Siewior do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); -@@ -1672,10 +1701,9 @@ static long __sched hrtimer_nanosleep_re +@@ -1671,10 +1700,9 @@ static long __sched hrtimer_nanosleep_re struct hrtimer_sleeper t; int ret; @@ -203,7 +203,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = do_nanosleep(&t, HRTIMER_MODE_ABS); destroy_hrtimer_on_stack(&t.timer); return ret; -@@ -1693,7 +1721,7 @@ long hrtimer_nanosleep(const struct time +@@ -1692,7 +1720,7 @@ long hrtimer_nanosleep(const struct time if (dl_task(current) || rt_task(current)) slack = 0; @@ -212,7 +212,7 @@ Signed-off-by: Sebastian Andrzej Siewior hrtimer_set_expires_range_ns(&t.timer, timespec64_to_ktime(*rqtp), slack); ret = do_nanosleep(&t, mode); if (ret != -ERESTART_RESTARTBLOCK) -@@ -1878,11 +1906,9 @@ schedule_hrtimeout_range_clock(ktime_t * +@@ -1883,11 +1911,9 @@ schedule_hrtimeout_range_clock(ktime_t * return -EINTR; } diff --git a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch index 5899ffa4a..5b8578ae4 100644 --- a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: hrtimers: Prepare full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Make cancellation of a running callback in softirq context safe against preemption. @@ -61,7 +61,7 @@ Signed-off-by: Thomas Gleixner } --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -932,6 +932,33 @@ u64 hrtimer_forward(struct hrtimer *time +@@ -926,6 +926,33 @@ u64 hrtimer_forward(struct hrtimer *time } EXPORT_SYMBOL_GPL(hrtimer_forward); @@ -104,7 +104,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1432,6 +1459,7 @@ static __latent_entropy void hrtimer_run +@@ -1431,6 +1458,7 @@ static __latent_entropy void hrtimer_run hrtimer_update_softirq_timer(cpu_base, true); raw_spin_unlock_irqrestore(&cpu_base->lock, flags); @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1794,6 +1822,9 @@ int hrtimers_prepare_cpu(unsigned int cp +@@ -1793,6 +1821,9 @@ int hrtimers_prepare_cpu(unsigned int cp cpu_base->hres_active = 0; cpu_base->expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX; @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner expires = timeval_to_ktime(value->it_value); --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c -@@ -791,6 +791,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_ +@@ -796,6 +796,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_ return overrun; } @@ -155,7 +155,7 @@ Signed-off-by: Thomas Gleixner static void common_hrtimer_arm(struct k_itimer *timr, ktime_t expires, bool absolute, bool sigev_none) { -@@ -885,6 +899,7 @@ static int do_timer_settime(timer_t time +@@ -890,6 +904,7 @@ static int do_timer_settime(timer_t time if (!timr) return -EINVAL; @@ -163,7 +163,7 @@ Signed-off-by: Thomas Gleixner kc = timr->kclock; if (WARN_ON_ONCE(!kc || !kc->timer_set)) error = -EINVAL; -@@ -893,9 +908,12 @@ static int do_timer_settime(timer_t time +@@ -898,9 +913,12 @@ static int do_timer_settime(timer_t time unlock_timer(timr, flag); if (error == TIMER_RETRY) { @@ -176,7 +176,7 @@ Signed-off-by: Thomas Gleixner return error; } -@@ -977,10 +995,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t +@@ -982,10 +1000,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t if (!timer) return -EINVAL; @@ -192,7 +192,7 @@ Signed-off-by: Thomas Gleixner spin_lock(¤t->sighand->siglock); list_del(&timer->list); -@@ -1006,8 +1029,18 @@ static void itimer_delete(struct k_itime +@@ -1011,8 +1034,18 @@ static void itimer_delete(struct k_itime retry_delete: spin_lock_irqsave(&timer->it_lock, flags); diff --git a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch index 772a016bb..f5126ff5a 100644 --- a/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch +++ b/debian/patches/features/all/rt/ide-use-nort-local-irq-variants.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 Subject: ide: Do not disable interrupts for PREEMPT-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch index c1615b7d0..262602b38 100644 --- a/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch +++ b/debian/patches/features/all/rt/infiniband-mellanox-ib-use-nort-irq.patch @@ -1,7 +1,7 @@ From: Sven-Thorsten Dietrich Date: Fri, 3 Jul 2009 08:30:35 -0500 Subject: infiniband: Mellanox IB driver patch use _nort() primitives -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Fixes in_atomic stack-dump, when Mellanox module is loaded into the RT Kernel. diff --git a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch index 84e2fe57a..1f91b7c5c 100644 --- a/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch +++ b/debian/patches/features/all/rt/inpt-gameport-use-local-irq-nort.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:16 -0500 Subject: input: gameport: Do not disable interrupts on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the _nort() primitives. diff --git a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch index e4fc57378..5678d1486 100644 --- a/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch +++ b/debian/patches/features/all/rt/iommu-amd--Use-WARN_ON_NORT.patch @@ -1,7 +1,7 @@ Subject: iommu/amd: Use WARN_ON_NORT in __attach_device() From: Thomas Gleixner Date: Sat, 27 Feb 2016 10:22:23 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT does not disable interrupts here, but the protection is still correct. Fixup the WARN_ON so it won't yell on RT. diff --git a/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch b/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch index b3a40d4db..ed2ae585c 100644 --- a/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch +++ b/debian/patches/features/all/rt/iommu-iova-Use-raw_cpu_ptr-instead-of-get_cpu_ptr-fo.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 17:21:40 +0200 Subject: [PATCH] iommu/iova: Use raw_cpu_ptr() instead of get_cpu_ptr() for ->fq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz get_cpu_ptr() disabled preemption and returns the ->fq object of the current CPU. raw_cpu_ptr() does the same except that it not disable diff --git a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch index 6efb96bb6..420963683 100644 --- a/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch +++ b/debian/patches/features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch @@ -1,7 +1,7 @@ Subject: genirq: Allow disabling of softirq processing in irq thread context From: Thomas Gleixner Date: Tue, 31 Jan 2012 13:01:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The processing of softirqs in irq thread context is a performance gain for the non-rt workloads of a system, but it's counterproductive for diff --git a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch index 73fb32868..2f2140fba 100644 --- a/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch +++ b/debian/patches/features/all/rt/irqwork-Move-irq-safe-work-to-irq-context.patch @@ -1,7 +1,7 @@ Subject: irqwork: Move irq safe work to irq context From: Thomas Gleixner Date: Sun, 15 Nov 2015 18:40:17 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On architectures where arch_irq_work_has_interrupt() returns false, we end up running the irq safe work from the softirq context. That @@ -56,7 +56,7 @@ Cc: stable-rt@vger.kernel.org * Synchronize against the irq_work @entry, ensures the entry is not --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1640,7 +1640,7 @@ void update_process_times(int user_tick) +@@ -1638,7 +1638,7 @@ void update_process_times(int user_tick) scheduler_tick(); run_local_timers(); rcu_check_callbacks(user_tick); @@ -65,7 +65,7 @@ Cc: stable-rt@vger.kernel.org if (in_irq()) irq_work_tick(); #endif -@@ -1681,9 +1681,7 @@ static __latent_entropy void run_timer_s +@@ -1679,9 +1679,7 @@ static __latent_entropy void run_timer_s { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); diff --git a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch index e20fe4f6e..4897ef533 100644 --- a/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches/features/all/rt/irqwork-push_most_work_into_softirq_context.patch @@ -1,7 +1,7 @@ Subject: irqwork: push most work into softirq context From: Sebastian Andrzej Siewior Date: Tue, 23 Jun 2015 15:32:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Initially we defered all irqwork into softirq because we didn't want the latency spikes if perf or another user was busy and delayed the RT task. @@ -164,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1640,7 +1640,7 @@ void update_process_times(int user_tick) +@@ -1638,7 +1638,7 @@ void update_process_times(int user_tick) scheduler_tick(); run_local_timers(); rcu_check_callbacks(user_tick); @@ -173,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (in_irq()) irq_work_tick(); #endif -@@ -1681,6 +1681,9 @@ static __latent_entropy void run_timer_s +@@ -1679,6 +1679,9 @@ static __latent_entropy void run_timer_s { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); diff --git a/debian/patches/features/all/rt/jump-label-rt.patch b/debian/patches/features/all/rt/jump-label-rt.patch index b4c9d4815..3c158bda8 100644 --- a/debian/patches/features/all/rt/jump-label-rt.patch +++ b/debian/patches/features/all/rt/jump-label-rt.patch @@ -1,7 +1,7 @@ Subject: jump-label: disable if stop_machine() is used From: Thomas Gleixner Date: Wed, 08 Jul 2015 17:14:48 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch index f88ae4e9e..e15d291ed 100644 --- a/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches/features/all/rt/kconfig-disable-a-few-options-rt.patch @@ -1,7 +1,7 @@ Subject: kconfig: Disable config options which are not RT compatible From: Thomas Gleixner Date: Sun, 24 Jul 2011 12:11:43 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch index 2011bcf98..79da9cd86 100644 --- a/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch +++ b/debian/patches/features/all/rt/kconfig-preempt-rt-full.patch @@ -1,7 +1,7 @@ Subject: kconfig: Add PREEMPT_RT_FULL From: Thomas Gleixner Date: Wed, 29 Jun 2011 14:58:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch index 02dec5d8d..ea6eac408 100644 --- a/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch +++ b/debian/patches/features/all/rt/kernel-SRCU-provide-a-static-initializer.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 19 Mar 2013 14:44:30 +0100 Subject: kernel/SRCU: provide a static initializer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are macros for static initializer for the three out of four possible notifier types, that are: diff --git a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch index 9d86ff7a1..c0ef480df 100644 --- a/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch +++ b/debian/patches/features/all/rt/kernel-printk-Don-t-try-to-print-from-IRQ-NMI-region.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 19 May 2016 17:45:27 +0200 Subject: [PATCH] kernel/printk: Don't try to print from IRQ/NMI region -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On -RT we try to acquire sleeping locks which might lead to warnings from lockdep or a warn_on() from spin_try_lock() (which is a rtmutex on diff --git a/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index 5c08f5180..2717a7df2 100644 --- a/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches/features/all/rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -4,7 +4,7 @@ Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not diff --git a/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index b9165de62..466250027 100644 --- a/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches/features/all/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 Subject: [PATCH] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There is no need to free the stack before the task struct. This also comes handy on -RT because we can't free memory in preempt disabled diff --git a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch index 64817cfc9..9da69994e 100644 --- a/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch +++ b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 9 Feb 2016 18:17:18 +0100 Subject: kernel: softirq: unlock with irqs on -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We unlock the lock while the interrupts are off. This isn't a problem now but will get because the migrate_disable() + enable are not diff --git a/debian/patches/features/all/rt/kgb-serial-hackaround.patch b/debian/patches/features/all/rt/kgb-serial-hackaround.patch index 23a06f7d6..7e58e0e9d 100644 --- a/debian/patches/features/all/rt/kgb-serial-hackaround.patch +++ b/debian/patches/features/all/rt/kgb-serial-hackaround.patch @@ -1,7 +1,7 @@ From: Jason Wessel Date: Thu, 28 Jul 2011 12:42:23 -0500 Subject: kgdb/serial: Short term workaround -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due diff --git a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 8924da89d..105f5e38c 100644 --- a/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches/features/all/rt/leds-trigger-disable-CPU-trigger-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 23 Jan 2014 14:45:59 +0100 Subject: leds: trigger: disable CPU trigger on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch index 841a18c99..285c6b2d3 100644 --- a/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches/features/all/rt/list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 Subject: [PATCH] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch index aecd50c4f..d74040e33 100644 --- a/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches/features/all/rt/list_bl.h-make-list-head-locking-RT-safe.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Fri, 21 Jun 2013 15:07:25 -0400 Subject: list_bl: Make list head locking RT safe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz As per changes in include/linux/jbd_common.h for avoiding the bit_spin_locks on RT ("fs: jbd/jbd2: Make state lock and journal diff --git a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch index e7891f2d2..ff67e0002 100644 --- a/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch +++ b/debian/patches/features/all/rt/local-irq-rt-depending-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 21 Jul 2009 22:34:14 +0200 Subject: rt: local_irq_* variants depending on RT/!RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add local_irq_*_(no)rt variant which are mainly used to break interrupt disabled sections on PREEMPT_RT or to explicitely disable diff --git a/debian/patches/features/all/rt/localversion.patch b/debian/patches/features/all/rt/localversion.patch index b69383376..091b22f6a 100644 --- a/debian/patches/features/all/rt/localversion.patch +++ b/debian/patches/features/all/rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt9 ++-rt11 diff --git a/debian/patches/features/all/rt/lockdep-disable-self-test.patch b/debian/patches/features/all/rt/lockdep-disable-self-test.patch index 696772a7c..e20a65fed 100644 --- a/debian/patches/features/all/rt/lockdep-disable-self-test.patch +++ b/debian/patches/features/all/rt/lockdep-disable-self-test.patch @@ -4,7 +4,7 @@ Subject: [PATCH] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some diff --git a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch index b43e0fc6e..a31ef1f06 100644 --- a/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches/features/all/rt/lockdep-no-softirq-accounting-on-rt.patch @@ -1,7 +1,7 @@ Subject: lockdep: Make it RT aware From: Thomas Gleixner Date: Sun, 17 Jul 2011 18:51:23 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz teach lockdep that we don't really do softirqs on -RT. diff --git a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index eac780d15..63627a7ff 100644 --- a/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches/features/all/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Wed, 28 Jan 2015 13:08:45 -0600 Subject: lockdep: selftest: fix warnings due to missing PREEMPT_RT conditionals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz "lockdep: Selftest: Only do hardirq context test for raw spinlock" disabled the execution of certain tests with PREEMPT_RT_FULL, but did diff --git a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index 9db303da5..1d1de296b 100644 --- a/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches/features/all/rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch @@ -1,7 +1,7 @@ Subject: lockdep: selftest: Only do hardirq context test for raw spinlock From: Yong Zhang Date: Mon, 16 Apr 2012 15:01:56 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz From: Yong Zhang diff --git a/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 675e8d5bf..f13bf592e 100644 --- a/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches/features/all/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index 04cbd31d6..d4cd893c0 100644 --- a/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: "Wolfgang M. Reimer" Date: Tue, 21 Jul 2015 16:20:07 +0200 Subject: locking: locktorture: Do NOT include rwlock.h directly -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Including rwlock.h directly will cause kernel builds to fail if CONFIG_PREEMPT_RT_FULL is defined. The correct header file diff --git a/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 002960d38..294852448 100644 --- a/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches/features/all/rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,7 @@ From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to @@ -46,7 +46,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rtmutex_common.h" -@@ -1926,6 +1927,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, +@@ -1933,6 +1934,15 @@ rt_mutex_fastlock(struct rt_mutex *lock, if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; @@ -62,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); } -@@ -1943,6 +1953,9 @@ rt_mutex_timed_fastlock(struct rt_mutex +@@ -1950,6 +1960,9 @@ rt_mutex_timed_fastlock(struct rt_mutex likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) return 0; diff --git a/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch b/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch index fb07d8da3..fc1bbbc4d 100644 --- a/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch +++ b/debian/patches/features/all/rt/locking-rtmutex-don-t-drop-the-wait_lock-twice.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 7 Sep 2017 12:38:47 +0200 Subject: locking/rtmutex: don't drop the wait_lock twice -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Since the futex rework, __rt_mutex_start_proxy_lock() does no longer acquire the wait_lock so it must not drop it. Otherwise the lock is not @@ -20,7 +20,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1753,7 +1753,6 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1765,7 +1765,6 @@ int __rt_mutex_start_proxy_lock(struct r raw_spin_lock(&task->pi_lock); if (task->pi_blocked_on) { raw_spin_unlock(&task->pi_lock); diff --git a/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 4ae60cf1e..bbb0f0454 100644 --- a/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches/features/all/rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 Subject: [PATCH] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep @@ -16,7 +16,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -2260,6 +2260,14 @@ void rt_mutex_init_proxy_locked(struct r +@@ -2272,6 +2272,14 @@ void rt_mutex_init_proxy_locked(struct r struct task_struct *proxy_owner) { __rt_mutex_init(lock, NULL, NULL); diff --git a/debian/patches/features/all/rt/md-disable-bcache.patch b/debian/patches/features/all/rt/md-disable-bcache.patch index a12f30848..73f33e061 100644 --- a/debian/patches/features/all/rt/md-disable-bcache.patch +++ b/debian/patches/features/all/rt/md-disable-bcache.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 11:48:57 +0200 Subject: md: disable bcache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch b/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch index 5bcd0a662..c9c687a07 100644 --- a/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch +++ b/debian/patches/features/all/rt/md-raid5-do-not-disable-interrupts.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 17 Nov 2017 16:21:00 +0100 Subject: [PATCH] md/raid5: do not disable interrupts -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:974 |in_atomic(): 0, irqs_disabled(): 1, pid: 2992, name: lvm diff --git a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch index 212abb161..553ece15d 100644 --- a/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 6 Apr 2010 16:51:31 +0200 Subject: md: raid5: Make raid5_percpu handling RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic @@ -21,7 +21,7 @@ Tested-by: Udo van den Heuvel --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c -@@ -2064,8 +2064,9 @@ static void raid_run_ops(struct stripe_h +@@ -2067,8 +2067,9 @@ static void raid_run_ops(struct stripe_h struct raid5_percpu *percpu; unsigned long cpu; @@ -32,7 +32,7 @@ Tested-by: Udo van den Heuvel if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { ops_run_biofill(sh); overlap_clear++; -@@ -2124,7 +2125,8 @@ static void raid_run_ops(struct stripe_h +@@ -2127,7 +2128,8 @@ static void raid_run_ops(struct stripe_h if (test_and_clear_bit(R5_Overlap, &dev->flags)) wake_up(&sh->raid_conf->wait_for_overlap); } @@ -42,7 +42,7 @@ Tested-by: Udo van den Heuvel } static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -6793,6 +6795,7 @@ static int raid456_cpu_up_prepare(unsign +@@ -6796,6 +6798,7 @@ static int raid456_cpu_up_prepare(unsign __func__, cpu); return -ENOMEM; } @@ -50,7 +50,7 @@ Tested-by: Udo van den Heuvel return 0; } -@@ -6803,7 +6806,6 @@ static int raid5_alloc_percpu(struct r5c +@@ -6806,7 +6809,6 @@ static int raid5_alloc_percpu(struct r5c conf->percpu = alloc_percpu(struct raid5_percpu); if (!conf->percpu) return -ENOMEM; diff --git a/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch b/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch index 1b937e6b2..f118bfcf3 100644 --- a/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch +++ b/debian/patches/features/all/rt/mfd-syscon-atmel-smc-include-string.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 09:55:58 +0200 Subject: [PATCH] mfd: syscon: atmel-smc: include string.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The string.h header file is needed for the memset() definition. The RT build fails because it is not pulled in via other header files. diff --git a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch index e08086bec..7c907d51f 100644 --- a/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches/features/all/rt/mips-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: mips: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:10:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch index b66def352..49683f8d3 100644 --- a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch +++ b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT.patch @@ -1,7 +1,7 @@ Subject: mm: rt: Fix generic kmap_atomic for RT From: Thomas Gleixner Date: Sat, 19 Sep 2015 10:15:00 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The update to 4.1 brought in the mainline variant of the pagefault disable distangling from preempt count. That introduced a diff --git a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch index 9b48fce66..af507364e 100644 --- a/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch +++ b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 5 Feb 2016 12:17:14 +0100 Subject: mm: backing-dev: don't disable IRQs in wb_congested_put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz it triggers: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:930 diff --git a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch index 20d322a13..ae6c6481b 100644 --- a/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch +++ b/debian/patches/features/all/rt/mm-bounce-local-irq-save-nort.patch @@ -1,7 +1,7 @@ Subject: mm: bounce: Use local_irq_save_nort From: Thomas Gleixner Date: Wed, 09 Jan 2013 10:33:09 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz kmap_atomic() is preemptible on RT. diff --git a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch index 787ce2ad1..af27f021b 100644 --- a/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches/features/all/rt/mm-convert-swap-to-percpu-locked.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:51 -0500 Subject: mm/swap: Convert to percpu locked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". diff --git a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch index 0f45b5571..f7ed05af9 100644 --- a/debian/patches/features/all/rt/mm-disable-sloub-rt.patch +++ b/debian/patches/features/all/rt/mm-disable-sloub-rt.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:03 -0500 Subject: mm: Allow only slub on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. diff --git a/debian/patches/features/all/rt/mm-enable-slub.patch b/debian/patches/features/all/rt/mm-enable-slub.patch index 7f06664e4..3a68dd72c 100644 --- a/debian/patches/features/all/rt/mm-enable-slub.patch +++ b/debian/patches/features/all/rt/mm-enable-slub.patch @@ -1,7 +1,7 @@ Subject: mm: Enable SLUB for RT From: Thomas Gleixner Date: Thu, 25 Oct 2012 10:32:35 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Make SLUB RT aware by converting locks to raw and using free lists to move the freeing out of the lock held region. diff --git a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch index b675b64b4..a25cba049 100644 --- a/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches/features/all/rt/mm-make-vmstat-rt-aware.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:13 -0500 Subject: mm/vmstat: Protect per cpu variables with preempt disable on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Disable preemption on -RT for the vmstat code. On vanila the code runs in IRQ-off regions while on -RT it is not. "preempt_disable" ensures that the diff --git a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index b4ab5a387..88dc59340 100644 --- a/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches/features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch @@ -1,7 +1,7 @@ From: Yang Shi Subject: mm/memcontrol: Don't call schedule_work_on in preemption disabled context Date: Wed, 30 Oct 2013 11:48:33 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The following trace is triggered when running ltp oom test cases: diff --git a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch index daa52619c..8fa2fd67a 100644 --- a/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches/features/all/rt/mm-memcontrol-do_not_disable_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Subject: mm/memcontrol: Replace local_irq_disable with local locks Date: Wed, 28 Jan 2015 17:14:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. diff --git a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch index d49421dd7..eb3c025f3 100644 --- a/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch +++ b/debian/patches/features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch @@ -1,7 +1,7 @@ Subject: mm: page_alloc: Use local_lock_on() instead of plain spinlock From: Thomas Gleixner Date: Thu, 27 Sep 2012 11:11:46 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The plain spinlock while sufficient does not update the local_lock internals. Use a proper local_lock function instead to ease debugging. diff --git a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch index e53d9ae0c..7ab3e23ad 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-reduce-lock-sections-further.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Fri Jul 3 08:44:37 2009 -0500 Subject: mm: page_alloc: Reduce lock sections further -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Split out the pages which are to be freed into a separate list and call free_pages_bulk() outside of the percpu page allocator locks. diff --git a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index c723df1ed..66f80ed0b 100644 --- a/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches/features/all/rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:37 -0500 Subject: mm: page_alloc: rt-friendly per-cpu pages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz rt-friendly per-cpu pages: convert the irqs-off per-cpu locking method into a preemptible, explicit-per-cpu-locks method. diff --git a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch index 1b51ff99c..d01dcc044 100644 --- a/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches/features/all/rt/mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 Subject: [PATCH] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for diff --git a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch index 8e619288e..019c2c1fa 100644 --- a/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch @@ -1,7 +1,7 @@ From: Yong Zhang Date: Tue, 15 May 2012 13:53:56 +0800 Subject: mm: Protect activate_mm() by preempt_[disable&enable]_rt() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz User preempt_*_rt instead of local_irq_*_rt or otherwise there will be warning on ARM like below: diff --git a/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch index d081f5e7d..6c66b8344 100644 --- a/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches/features/all/rt/mm-rt-kmap-atomic-scheduling.patch @@ -1,7 +1,7 @@ Subject: mm, rt: kmap_atomic scheduling From: Peter Zijlstra Date: Thu, 28 Jul 2011 10:43:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In fact, with migrate_disable() existing one could play games with kmap_atomic. You could save/restore the kmap_atomic slots on context diff --git a/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index 769110ef2..52bbd44f4 100644 --- a/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches/features/all/rt/mm-scatterlist-dont-disable-irqs-on-RT.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:34 -0500 Subject: mm/scatterlist: Do not disable irqs on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). diff --git a/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch b/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch index ccc424dfb..512a0f5e1 100644 --- a/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch +++ b/debian/patches/features/all/rt/mm-slub-close-possible-memory-leak-in-kmem_cache_all.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Dec 2017 12:44:14 +0100 Subject: [PATCH] mm/slub: close possible memory-leak in kmem_cache_alloc_bulk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Under certain circumstances we could leak elements which were moved to the local "to_free" list. The damage is limited since I can't find diff --git a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch index 5b441d969..7f84da876 100644 --- a/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches/features/all/rt/mm-vmalloc-use-get-cpu-light.patch @@ -1,7 +1,7 @@ Subject: mm/vmalloc: Another preempt disable region which sucks From: Thomas Gleixner Date: Tue, 12 Jul 2011 11:39:36 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. diff --git a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch index cfd71ec00..901e453f7 100644 --- a/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch +++ b/debian/patches/features/all/rt/mm-workingset-do-not-protect-workingset_shadow_nodes.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Jan 2015 17:19:44 +0100 Subject: mm/workingset: Do not protect workingset_shadow_nodes with irq off -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz workingset_shadow_nodes is protected by local_irq_disable(). Some users use spin_lock_irq(). diff --git a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 7c65e007b..7bf31eefd 100644 --- a/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches/features/all/rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch index 0a5cf9ec6..aecd04547 100644 --- a/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch +++ b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch @@ -1,7 +1,7 @@ Subject: mmci: Remove bogus local_irq_save() From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:11:12 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On !RT interrupt runs with interrupts disabled. On RT it's in a thread, so no need to disable interrupts at all. diff --git a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch index 236bcefb0..2091e0383 100644 --- a/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch +++ b/debian/patches/features/all/rt/move_sched_delayed_work_to_helper.patch @@ -1,7 +1,7 @@ Date: Wed, 26 Jun 2013 15:28:11 -0400 From: Steven Rostedt Subject: rt,ntp: Move call to schedule_delayed_work() to helper thread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The ntp code for notify_cmos_timer() is called from a hard interrupt context. schedule_delayed_work() under PREEMPT_RT_FULL calls spinlocks diff --git a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch index ebf7697ab..165299226 100644 --- a/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch +++ b/debian/patches/features/all/rt/mutex-no-spin-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:51:45 +0200 Subject: locking: Disable spin on owner for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index dc0dbfd01..fdd6b5da8 100644 --- a/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches/features/all/rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5237,6 +5237,7 @@ bool napi_schedule_prep(struct napi_stru +@@ -5238,6 +5238,7 @@ bool napi_schedule_prep(struct napi_stru } EXPORT_SYMBOL(napi_schedule_prep); @@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -5248,6 +5249,7 @@ void __napi_schedule_irqoff(struct napi_ +@@ -5249,6 +5250,7 @@ void __napi_schedule_irqoff(struct napi_ ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); diff --git a/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 3f78b9b7a..fda841eea 100644 --- a/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches/features/all/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is diff --git a/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch index 47e53a98b..1b5c7b335 100644 --- a/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch +++ b/debian/patches/features/all/rt/net-add-a-lock-around-icmp_sk.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 31 Aug 2016 17:54:09 +0200 Subject: [PATCH] net: add a lock around icmp_sk() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It looks like the this_cpu_ptr() access in icmp_sk() is protected with local_bh_disable(). To avoid missing serialization in -RT I am adding diff --git a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch index d721d8743..9e307dd9d 100644 --- a/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch +++ b/debian/patches/features/all/rt/net-add-back-the-missing-serialization-in-ip_send_un.patch @@ -5,7 +5,7 @@ Subject: [PATCH] net: add back the missing serialization in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Some time ago Sami Pietikäinen reported a crash on -RT in ip_send_unicast_reply() which was later fixed by Nicholas Mc Guire diff --git a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch index 4e696359a..8dab3159f 100644 --- a/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 26 Sep 2012 16:21:08 +0200 Subject: net: Another local_irq_disable/kmalloc headache -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Replace it by a local lock. Though that's pretty inefficient :( diff --git a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch index e2ca9173f..ab3485915 100644 --- a/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch +++ b/debian/patches/features/all/rt/net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch @@ -1,7 +1,7 @@ Subject: net/core/cpuhotplug: Drain input_pkt_queue lockless From: Grygorii Strashko Date: Fri, 9 Oct 2015 09:25:49 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz I can constantly see below error report with 4.1 RT-kernel on TI ARM dra7-evm if I'm trying to unplug cpu1: @@ -36,7 +36,7 @@ Cc: stable-rt@vger.kernel.org --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -8422,7 +8422,7 @@ static int dev_cpu_dead(unsigned int old +@@ -8423,7 +8423,7 @@ static int dev_cpu_dead(unsigned int old netif_rx_ni(skb); input_queue_head_incr(oldsd); } diff --git a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch index 021ed944b..63fe05315 100644 --- a/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches/features/all/rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 16:33:34 +0100 Subject: net/core: protect users of napi_alloc_cache against reentrance -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On -RT the code running in BH can not be moved to another CPU so CPU local variable remain local. However the code can be preempted diff --git a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index d9c89329c..5774339a9 100644 --- a/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches/features/all/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away @@ -21,7 +21,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3158,7 +3158,11 @@ static inline int __dev_xmit_skb(struct +@@ -3159,7 +3159,11 @@ static inline int __dev_xmit_skb(struct * This permits qdisc->running owner to get the lock more * often and dequeue packets faster. */ diff --git a/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch index 5b6eb0106..99089bbec 100644 --- a/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches/features/all/rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch @@ -1,7 +1,7 @@ Subject: net: netfilter: Serialize xt_write_recseq sections on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 11:18:08 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The netfilter code relies only on the implicit semantics of local_bh_disable() for serializing wt_write_recseq sections. RT breaks diff --git a/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch index 694ef4468..5c1ba48cf 100644 --- a/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches/features/all/rt/net-make-devnet_rename_seq-a-mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2013 18:06:20 +0100 Subject: net: Add a mutex around devnet_rename_seq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On RT write_seqcount_begin() disables preemption and device_rename() allocates memory with GFP_KERNEL and grabs later the sysfs_mutex diff --git a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch index 139c2f8d9..d6288f63b 100644 --- a/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch +++ b/debian/patches/features/all/rt/net-move-xmit_recursion-to-per-task-variable-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 15:55:02 +0100 Subject: net: move xmit_recursion to per-task variable on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz A softirq on -RT can be preempted. That means one task is in __dev_queue_xmit(), gets preempted and another task may enter @@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct task_struct *oom_reaper_list; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3221,8 +3221,10 @@ static void skb_update_prio(struct sk_bu +@@ -3222,8 +3222,10 @@ static void skb_update_prio(struct sk_bu #define skb_update_prio(skb) #endif @@ -104,7 +104,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * dev_loopback_xmit - loop back @skb -@@ -3463,8 +3465,7 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3464,8 +3466,7 @@ static int __dev_queue_xmit(struct sk_bu int cpu = smp_processor_id(); /* ok because BHs are off */ if (txq->xmit_lock_owner != cpu) { @@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto recursion_alert; skb = validate_xmit_skb(skb, dev); -@@ -3474,9 +3475,9 @@ static int __dev_queue_xmit(struct sk_bu +@@ -3475,9 +3476,9 @@ static int __dev_queue_xmit(struct sk_bu HARD_TX_LOCK(dev, txq, cpu); if (!netif_xmit_stopped(txq)) { diff --git a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch index 6fb649d30..952a2db01 100644 --- a/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch +++ b/debian/patches/features/all/rt/net-prevent-abba-deadlock.patch @@ -1,7 +1,7 @@ Subject: net-flip-lock-dep-thingy.patch From: Thomas Gleixner Date: Tue, 28 Jun 2011 10:59:58 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz ======================================================= [ INFO: possible circular locking dependency detected ] diff --git a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch index 1e008a490..758a8de28 100644 --- a/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch +++ b/debian/patches/features/all/rt/net-provide-a-way-to-delegate-processing-a-softirq-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:39:05 +0100 Subject: net: provide a way to delegate processing a softirq to ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz If the NET_RX uses up all of his budget it moves the following NAPI invocations into the `ksoftirqd`. On -RT it does not do so. Instead it @@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior void raise_softirq_irqoff(unsigned int nr) --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5642,7 +5642,7 @@ static __latent_entropy void net_rx_acti +@@ -5643,7 +5643,7 @@ static __latent_entropy void net_rx_acti list_splice_tail(&repoll, &list); list_splice(&list, &sd->poll_list); if (!list_empty(&sd->poll_list)) diff --git a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch index 5bf4e0619..4c9e880f7 100644 --- a/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches/features/all/rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch @@ -1,7 +1,7 @@ From: Marc Kleine-Budde Date: Wed, 5 Mar 2014 00:49:47 +0100 Subject: net: sched: Use msleep() instead of yield() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On PREEMPT_RT enabled systems the interrupt handler run as threads at prio 50 (by default). If a high priority userspace process tries to shut down a busy diff --git a/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch b/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch index 7464fe767..5aa1dff86 100644 --- a/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch +++ b/debian/patches/features/all/rt/net-take-the-tcp_sk_lock-lock-with-BH-disabled.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 21 Aug 2017 15:09:13 +0200 Subject: [PATCH] net: take the tcp_sk_lock lock with BH disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Lockdep may complain about an unsafe locking scenario: | CPU0 CPU1 diff --git a/debian/patches/features/all/rt/net-use-cpu-chill.patch b/debian/patches/features/all/rt/net-use-cpu-chill.patch index fc8f9ace5..48b31511b 100644 --- a/debian/patches/features/all/rt/net-use-cpu-chill.patch +++ b/debian/patches/features/all/rt/net-use-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: net: Use cpu_chill() instead of cpu_relax() From: Thomas Gleixner Date: Wed, 07 Mar 2012 21:10:04 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Use cpu_chill() instead of cpu_relax() to let the system diff --git a/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch b/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch index 18dd74938..18d9bab6a 100644 --- a/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch +++ b/debian/patches/features/all/rt/net-use-trylock-in-icmp_sk.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:42:04 +0200 Subject: net: use trylock in icmp_sk -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The locking path can be recursive (same as for sk->sk_lock.slock) and therefore we need a trylock version for the locallock, too. diff --git a/debian/patches/features/all/rt/net-wireless-warn-nort.patch b/debian/patches/features/all/rt/net-wireless-warn-nort.patch index 9842f81c1..0ab3ea9f3 100644 --- a/debian/patches/features/all/rt/net-wireless-warn-nort.patch +++ b/debian/patches/features/all/rt/net-wireless-warn-nort.patch @@ -1,7 +1,7 @@ Subject: net/wireless: Use WARN_ON_NORT() From: Thomas Gleixner Date: Thu, 21 Jul 2011 21:05:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The softirq counter is meaningless on RT, so the check triggers a false positive. diff --git a/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch index f706d05dc..39c0dda60 100644 --- a/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches/features/all/rt/net_disable_NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: net/core: disable NET_RX_BUSY_POLL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. diff --git a/debian/patches/features/all/rt/nohz-Prevent-erroneous-tick-stop-invocations.patch b/debian/patches/features/all/rt/nohz-Prevent-erroneous-tick-stop-invocations.patch new file mode 100644 index 000000000..30818aa04 --- /dev/null +++ b/debian/patches/features/all/rt/nohz-Prevent-erroneous-tick-stop-invocations.patch @@ -0,0 +1,54 @@ +From: Thomas Gleixner +Date: Fri, 22 Dec 2017 15:51:13 +0100 +Subject: [PATCH 2/4] nohz: Prevent erroneous tick stop invocations +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz + +The conditions in irq_exit() to invoke tick_nohz_irq_exit() are: + + if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) + +This is too permissive in various aspects: + + 1) If need_resched() is set, then the tick cannot be stopped whether + the CPU is idle or in nohz full mode. + + 2) If need_resched() is not set, but softirqs are pending then this is an + indication that the softirq code punted and delegated the execution to + softirqd. need_resched() is not true because the current interrupted + task takes precedence over softirqd. + +Invoking tick_nohz_irq_exit() in these cases can cause an endless loop of +timer interrupts because the timer wheel contains an expired timer, but +softirqs are not yet executed. So it returns an immediate expiry request, +which causes the timer to fire immediately again. Lather, rinse and +repeat.... + +Prevent that by making the conditions proper and only allow invokation when +in idle or nohz full mode and neither need_resched() nor +local_softirq_pending() are set. + +Signed-off-by: Thomas Gleixner +[ bigeasy: XXX still needed for RT, to avoid hangup due to pending timer softirq, + keep it RT only ] +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/softirq.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -381,7 +381,13 @@ static inline void tick_irq_exit(void) + int cpu = smp_processor_id(); + + /* Make sure that timer wheel updates are propagated */ +- if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) { ++#ifdef CONFIG_PREEMPT_RT_BASE ++ if ((idle_cpu(cpu) || tick_nohz_full_cpu(cpu)) && ++ !need_resched() && !local_softirq_pending()) ++#else ++ if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) ++#endif ++ { + if (!in_interrupt()) + tick_nohz_irq_exit(); + } diff --git a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch index 7609656ac..0754ab0d9 100644 --- a/debian/patches/features/all/rt/oleg-signal-rt-fix.patch +++ b/debian/patches/features/all/rt/oleg-signal-rt-fix.patch @@ -1,7 +1,7 @@ From: Oleg Nesterov Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: signal/x86: Delay calling signals in atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using @@ -90,7 +90,7 @@ Signed-off-by: Thomas Gleixner unsigned int sas_ss_flags; --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1236,8 +1236,8 @@ int do_send_sig_info(int sig, struct sig +@@ -1238,8 +1238,8 @@ int do_send_sig_info(int sig, struct sig * We don't want to have recursive SIGSEGV's etc, for example, * that is why we also clear SIGNAL_UNKILLABLE. */ @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner { unsigned long int flags; int ret, blocked, ignored; -@@ -1266,6 +1266,39 @@ force_sig_info(int sig, struct siginfo * +@@ -1268,6 +1268,39 @@ force_sig_info(int sig, struct siginfo * return ret; } diff --git a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch index 9a7ff449b..2eaedb523 100644 --- a/debian/patches/features/all/rt/panic-disable-random-on-rt.patch +++ b/debian/patches/features/all/rt/panic-disable-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: panic: skip get_random_bytes for RT_FULL in init_oops_id -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Disable on -RT. If this is invoked from irq-context we will have problems to acquire the sleeping lock. diff --git a/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch index 8f7c323e3..40b62bfe6 100644 --- a/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch +++ b/debian/patches/features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch @@ -1,7 +1,7 @@ Subject: rcu: Make ksoftirqd do RCU quiescent states From: "Paul E. McKenney" Date: Wed, 5 Oct 2011 11:45:18 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore diff --git a/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch index be81a98d8..27fe4b51f 100644 --- a/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches/features/all/rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 Subject: [PATCH] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command diff --git a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch index c96429816..7081485c2 100644 --- a/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch +++ b/debian/patches/features/all/rt/percpu_ida-use-locklocks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 9 Apr 2014 11:58:17 +0200 Subject: percpu_ida: Use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz the local_irq_save() + spin_lock() does not work that well on -RT diff --git a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch index 28a9b9428..b37e15395 100644 --- a/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch +++ b/debian/patches/features/all/rt/peter_zijlstra-frob-rcu.patch @@ -1,7 +1,7 @@ Subject: rcu: Frob softirq test From: Peter Zijlstra Date: Sat Aug 13 00:23:17 CEST 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz With RT_FULL we get the below wreckage: diff --git a/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch b/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch index 6044b8ce0..d11a16499 100644 --- a/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch +++ b/debian/patches/features/all/rt/peterz-percpu-rwsem-rt.patch @@ -1,7 +1,7 @@ Subject: locking/percpu-rwsem: Remove preempt_disable variants From: Peter Zijlstra Date: Wed Nov 23 16:29:32 CET 2016 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Effective revert commit: diff --git a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch index b336a6a2e..002e9fe7e 100644 --- a/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch +++ b/debian/patches/features/all/rt/peterz-srcu-crypto-chain.patch @@ -1,7 +1,7 @@ Subject: crypto: Convert crypto notifier chain to SRCU From: Peter Zijlstra Date: Fri, 05 Oct 2012 09:03:24 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The crypto notifier deadlocks on RT. Though this can be a real deadlock on mainline as well due to fifo fair rwsems. @@ -121,7 +121,7 @@ Signed-off-by: Thomas Gleixner --- a/crypto/algapi.c +++ b/crypto/algapi.c -@@ -719,13 +719,13 @@ EXPORT_SYMBOL_GPL(crypto_spawn_tfm2); +@@ -731,13 +731,13 @@ EXPORT_SYMBOL_GPL(crypto_spawn_tfm2); int crypto_register_notifier(struct notifier_block *nb) { diff --git a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch index cb2b1cfb1..b8c4116b2 100644 --- a/debian/patches/features/all/rt/pid.h-include-atomic.h.patch +++ b/debian/patches/features/all/rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches/features/all/rt/ping-sysrq.patch b/debian/patches/features/all/rt/ping-sysrq.patch index 7e83fb5ea..3b551c342 100644 --- a/debian/patches/features/all/rt/ping-sysrq.patch +++ b/debian/patches/features/all/rt/ping-sysrq.patch @@ -1,7 +1,7 @@ Subject: net: sysrq via icmp From: Carsten Emde Date: Tue, 19 Jul 2011 13:51:17 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are (probably rare) situations when a system crashed and the system console becomes unresponsive but the network icmp layer still is alive. @@ -60,7 +60,7 @@ Signed-off-by: Carsten Emde #include #include #include -@@ -915,6 +916,30 @@ static bool icmp_redirect(struct sk_buff +@@ -924,6 +925,30 @@ static bool icmp_redirect(struct sk_buff } /* @@ -91,7 +91,7 @@ Signed-off-by: Carsten Emde * Handle ICMP_ECHO ("ping") requests. * * RFC 1122: 3.2.2.6 MUST have an echo server that answers ICMP echo -@@ -941,6 +966,11 @@ static bool icmp_echo(struct sk_buff *sk +@@ -950,6 +975,11 @@ static bool icmp_echo(struct sk_buff *sk icmp_param.data_len = skb->len; icmp_param.head_len = sizeof(struct icmphdr); icmp_reply(&icmp_param, skb); diff --git a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch index 3f90d1dca..8f35cb50c 100644 --- a/debian/patches/features/all/rt/posix-timers-no-broadcast.patch +++ b/debian/patches/features/all/rt/posix-timers-no-broadcast.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:29:20 -0500 Subject: posix-timers: Prevent broadcast signals -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Posix timers should not send broadcast signals and kernel only signals. Prevent it. diff --git a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index 85fca3029..700d01cf7 100644 --- a/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches/features/all/rt/posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -1,7 +1,7 @@ From: John Stultz Date: Fri, 3 Jul 2009 08:29:58 -0500 Subject: posix-timers: Thread posix-cpu-timers on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. @@ -55,7 +55,7 @@ Signed-off-by: Thomas Gleixner /* Process credentials: */ --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1497,6 +1497,9 @@ static void rt_mutex_init_task(struct ta +@@ -1496,6 +1496,9 @@ static void rt_mutex_init_task(struct ta */ static void posix_cpu_timers_init(struct task_struct *tsk) { diff --git a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch index 954d29f7a..341a07cab 100644 --- a/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch +++ b/debian/patches/features/all/rt/power-disable-highmem-on-rt.patch @@ -1,7 +1,7 @@ Subject: powerpc: Disable highmem on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:08:34 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch index f9eb7755f..d0a3bb22a 100644 --- a/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch +++ b/debian/patches/features/all/rt/power-use-generic-rwsem-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: powerpc: Use generic rwsem on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use generic code which uses rtmutex diff --git a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index 0feea72eb..8f5c074e9 100644 --- a/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches/features/all/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch @@ -1,7 +1,7 @@ From: Bogdan Purcareata Date: Fri, 24 Apr 2015 15:53:13 +0000 Subject: powerpc/kvm: Disable in-kernel MPIC emulation for PREEMPT_RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz While converting the openpic emulation code to use a raw_spinlock_t enables guests to run on RT, there's still a performance issue. For interrupts sent in diff --git a/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch index d6fefa477..345e3b119 100644 --- a/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/powerpc-preempt-lazy-support.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 1 Nov 2012 10:14:11 +0100 Subject: powerpc: Add support for lazy preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Implement the powerpc pieces for lazy preempt. @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner beq restore_user --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S -@@ -675,7 +675,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -689,7 +689,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG bl restore_math b restore #endif @@ -143,7 +143,7 @@ Signed-off-by: Thomas Gleixner beq 2f bl restore_interrupts SCHEDULE_USER -@@ -737,10 +737,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -751,10 +751,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG #ifdef CONFIG_PREEMPT /* Check if we need to preempt */ @@ -163,7 +163,7 @@ Signed-off-by: Thomas Gleixner cmpwi cr1,r8,0 ld r0,SOFTE(r1) cmpdi r0,0 -@@ -757,7 +765,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG +@@ -771,7 +779,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEG /* Re-test flags and eventually loop */ CURRENT_THREAD_INFO(r9, r1) ld r4,TI_FLAGS(r9) diff --git a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch index 221636542..f1ee95766 100644 --- a/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch +++ b/debian/patches/features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Sun, 31 May 2015 14:44:42 -0400 Subject: powerpc: ps3/device-init.c - adapt to completions using swait vs wait -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz To fix: diff --git a/debian/patches/features/all/rt/preempt-lazy-support.patch b/debian/patches/features/all/rt/preempt-lazy-support.patch index 6464a2bb2..7dfbfb290 100644 --- a/debian/patches/features/all/rt/preempt-lazy-support.patch +++ b/debian/patches/features/all/rt/preempt-lazy-support.patch @@ -1,7 +1,7 @@ Subject: sched: Add support for lazy preemption From: Thomas Gleixner Date: Fri, 26 Oct 2012 18:50:54 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points diff --git a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch index 9b0fd0a2f..7fad91492 100644 --- a/debian/patches/features/all/rt/preempt-nort-rt-variants.patch +++ b/debian/patches/features/all/rt/preempt-nort-rt-variants.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 24 Jul 2009 12:38:56 +0200 Subject: preempt: Provide preempt_*_(no)rt variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT needs a few preempt_disable/enable points which are not necessary otherwise. Implement variants to avoid #ifdeffery. diff --git a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch index c00a04f65..fb2b57dba 100644 --- a/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch +++ b/debian/patches/features/all/rt/printk-27force_early_printk-27-boot-param-to-help-with-debugging.patch @@ -1,7 +1,7 @@ Subject: printk: Add "force_early_printk" boot param to help with debugging From: Peter Zijlstra Date: Fri, 02 Sep 2011 14:41:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Gives me an option to screw printk and actually see what the machine says. diff --git a/debian/patches/features/all/rt/printk-kill.patch b/debian/patches/features/all/rt/printk-kill.patch index 5cf2eaef9..ca6cf306b 100644 --- a/debian/patches/features/all/rt/printk-kill.patch +++ b/debian/patches/features/all/rt/printk-kill.patch @@ -1,7 +1,7 @@ Subject: printk: Add a printk kill switch From: Ingo Molnar Date: Fri, 22 Jul 2011 17:58:40 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add a prinkt-kill-switch. This is used from (NMI) watchdog to ensure that it does not dead-lock with the early printk code. diff --git a/debian/patches/features/all/rt/printk-rt-aware.patch b/debian/patches/features/all/rt/printk-rt-aware.patch index 220a251d5..9e7890630 100644 --- a/debian/patches/features/all/rt/printk-rt-aware.patch +++ b/debian/patches/features/all/rt/printk-rt-aware.patch @@ -1,7 +1,7 @@ Subject: printk: Make rt aware From: Thomas Gleixner Date: Wed, 19 Sep 2012 14:50:37 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Drop the lock before calling the console driver and do not disable interrupts while printing to a serial console. diff --git a/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index a2a7e333c..2b208862d 100644 --- a/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches/features/all/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 29 Aug 2013 18:21:04 +0200 Subject: ptrace: fix ptrace vs tasklist_lock race -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz As explained by Alexander Fyodorov : diff --git a/debian/patches/features/all/rt/radix-tree-use-local-locks.patch b/debian/patches/features/all/rt/radix-tree-use-local-locks.patch index cf97684b2..492582975 100644 --- a/debian/patches/features/all/rt/radix-tree-use-local-locks.patch +++ b/debian/patches/features/all/rt/radix-tree-use-local-locks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 Subject: [PATCH] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds diff --git a/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch b/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch index 856bef994..27aa7da32 100644 --- a/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch +++ b/debian/patches/features/all/rt/random-avoid-preempt_disable-ed-section.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 12 May 2017 15:46:17 +0200 Subject: [PATCH] random: avoid preempt_disable()ed section -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz extract_crng() will use sleeping locks while in a preempt_disable() section due to get_cpu_var(). diff --git a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch index 5ced91eba..af41e6e5a 100644 --- a/debian/patches/features/all/rt/random-make-it-work-on-rt.patch +++ b/debian/patches/features/all/rt/random-make-it-work-on-rt.patch @@ -1,7 +1,7 @@ Subject: random: Make it work on rt From: Thomas Gleixner Date: Tue, 21 Aug 2012 20:38:50 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq diff --git a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch index fbc8fde1b..5ec371f0c 100644 --- a/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch +++ b/debian/patches/features/all/rt/rbtree-include-rcu.h-because-we-use-it.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 11:52:17 +0200 Subject: rbtree: include rcu.h because we use it -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Since commit c1adf20052d8 ("Introduce rb_replace_node_rcu()") rbtree_augmented.h uses RCU related data structures but does not include diff --git a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index 27fd2f159..8eb69523c 100644 --- a/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Mon, 4 Nov 2013 13:21:10 -0800 Subject: rcu: Eliminate softirq processing from rcutree -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Running RCU out of softirq is a problem for some workloads that would like to manage RCU core processing independently of other softirq work, diff --git a/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch b/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch index a154b94ef..eab6873bb 100644 --- a/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch +++ b/debian/patches/features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Tue, 19 Sep 2017 15:36:42 -0700 Subject: [PATCH] rcu: Suppress lockdep false-positive ->boost_mtx complaints -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Upstream commit bcda31a2659497df39d6bedfbdf17498b4f4ac89 diff --git a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch index f5e066a5d..2576dc94e 100644 --- a/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch +++ b/debian/patches/features/all/rt/rcu-disable-rcu-fast-no-hz-on-rt.patch @@ -1,7 +1,7 @@ Subject: rcu: Disable RCU_FAST_NO_HZ on RT From: Thomas Gleixner Date: Sun, 28 Oct 2012 13:26:09 +0000 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This uses a timer_list timer from the irq disabled guts of the idle code. Disable it for now to prevent wreckage. diff --git a/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index 84e2ba9df..75eb27bed 100644 --- a/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches/features/all/rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running diff --git a/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch index 87da4f99b..93a2b0242 100644 --- a/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Mar 2014 20:19:05 +0100 Subject: rcu: make RCU_BOOST default on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Since it is no longer invoked from the softirq people run into OOM more often if the priority of the RCU thread is too low. Making boosting diff --git a/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch index d6818b621..6059654d8 100644 --- a/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch +++ b/debian/patches/features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch @@ -1,7 +1,7 @@ Subject: rcu: Merge RCU-bh into RCU-preempt Date: Wed, 5 Oct 2011 11:59:38 -0700 From: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The Linux kernel has long RCU-bh read-side critical sections that intolerably increase scheduling latency under mainline's RCU-bh rules, diff --git a/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch b/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch index b5bd7fafb..09a4ff52c 100644 --- a/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch +++ b/debian/patches/features/all/rt/rcu-segcblist-include-rcupdate.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 22 Sep 2017 15:01:46 +0200 Subject: [PATCH] rcu/segcblist: include rcupdate.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The RT build on ARM complains about non-existing ULONG_CMP_LT. Since rcu_segcblist.c uses that macro it should include the header file. diff --git a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch index 483954637..d828a9234 100644 --- a/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch +++ b/debian/patches/features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch @@ -1,7 +1,7 @@ From: Tiejun Chen Date: Wed, 18 Dec 2013 17:51:49 +0800 Subject: rcutree/rcu_bh_qs: Disable irq while calling rcu_preempt_qs() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Any callers to the function rcu_preempt_qs() must disable irqs in order to protect the assignment to ->rcu_read_unlock_special. In diff --git a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index c9973b15d..f27d13af6 100644 --- a/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches/features/all/rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch @@ -1,7 +1,7 @@ Subject: ARM: Initialize split page table locks for vector page From: Frank Rowand Date: Sat, 1 Oct 2011 18:58:13 -0700 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Without this patch, ARM can not use SPLIT_PTLOCK_CPUS if PREEMPT_RT_FULL=y because vectors_user_mapping() creates a diff --git a/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch index 32b2fd101..7cbfb7460 100644 --- a/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch +++ b/debian/patches/features/all/rt/rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patch @@ -1,7 +1,7 @@ Subject: ARM: smp: Move clear_tasks_mm_cpumask() call to __cpu_die() From: Grygorii Strashko Date: Fri, 11 Sep 2015 21:21:23 +0300 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When running with the RT-kernel (4.1.5-rt5) on TI OMAP dra7-evm and trying to do Suspend to RAM, the following backtrace occurs: diff --git a/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index 2fbd27453..8f5aa4546 100644 --- a/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches/features/all/rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,7 @@ From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem diff --git a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch index 472210859..7a9387343 100644 --- a/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch +++ b/debian/patches/features/all/rt/rt-introduce-cpu-chill.patch @@ -1,7 +1,7 @@ Subject: rt: Introduce cpu_chill() From: Thomas Gleixner Date: Wed, 07 Mar 2012 20:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() @@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif /* defined(_LINUX_DELAY_H) */ --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1859,6 +1859,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct +@@ -1858,6 +1858,25 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct } #endif diff --git a/debian/patches/features/all/rt/rt-local-irq-lock.patch b/debian/patches/features/all/rt/rt-local-irq-lock.patch index af0bf9140..08cc1f911 100644 --- a/debian/patches/features/all/rt/rt-local-irq-lock.patch +++ b/debian/patches/features/all/rt/rt-local-irq-lock.patch @@ -1,7 +1,7 @@ Subject: rt: Add local irq locks From: Thomas Gleixner Date: Mon, 20 Jun 2011 09:03:47 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Introduce locallock. For !RT this maps to preempt_disable()/ local_irq_disable() so there is not much that changes. For RT this will diff --git a/debian/patches/features/all/rt/rt-preempt-base-config.patch b/debian/patches/features/all/rt/rt-preempt-base-config.patch index 4f17e52a6..400e8363e 100644 --- a/debian/patches/features/all/rt/rt-preempt-base-config.patch +++ b/debian/patches/features/all/rt/rt-preempt-base-config.patch @@ -1,7 +1,7 @@ Subject: rt: Provide PREEMPT_RT_BASE config switch From: Thomas Gleixner Date: Fri, 17 Jun 2011 12:39:57 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Introduce PREEMPT_RT_BASE which enables parts of PREEMPT_RT_FULL. Forces interrupt threading and enables some of the RT diff --git a/debian/patches/features/all/rt/rt-serial-warn-fix.patch b/debian/patches/features/all/rt/rt-serial-warn-fix.patch index c27e2bd4e..f5925f4c5 100644 --- a/debian/patches/features/all/rt/rt-serial-warn-fix.patch +++ b/debian/patches/features/all/rt/rt-serial-warn-fix.patch @@ -1,7 +1,7 @@ Subject: rt: Improve the serial console PASS_LIMIT From: Ingo Molnar Date: Wed Dec 14 13:05:54 CET 2011 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Beyond the warning: diff --git a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch index 413218e43..ff537d48f 100644 --- a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch +++ b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle non enqueued waiters gracefully From: Thomas Gleixner Date: Fri, 06 Nov 2015 18:51:03 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Yimin debugged that in case of a PI wakeup in progress when rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter @@ -22,7 +22,7 @@ Cc: stable-rt@vger.kernel.org --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1716,7 +1716,7 @@ int __rt_mutex_start_proxy_lock(struct r +@@ -1728,7 +1728,7 @@ int __rt_mutex_start_proxy_lock(struct r ret = 0; } diff --git a/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch b/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch index f4913ce27..162dda3b4 100644 --- a/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches/features/all/rt/rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch index 2b487033e..5b1adcd1d 100644 --- a/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches/features/all/rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 Subject: rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. @@ -117,7 +117,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -157,6 +157,12 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -158,6 +158,12 @@ extern bool __rt_mutex_futex_unlock(stru struct wake_q_head *wqh); extern void rt_mutex_postunlock(struct wake_q_head *wake_q); diff --git a/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch index a0aa5b3b7..0251ba9d0 100644 --- a/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 Subject: rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index a2dc5ae03..3c7a78b99 100644 --- a/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 Subject: rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 4bdc31e24..fb153ed5c 100644 --- a/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches/features/all/rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 Subject: rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its diff --git a/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch index a0b342ee5..9142cf56c 100644 --- a/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches/features/all/rt/rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 Subject: rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior @@ -414,7 +414,7 @@ Signed-off-by: Sebastian Andrzej Siewior return ret; } -@@ -2757,7 +2758,7 @@ static int futex_lock_pi(u32 __user *uad +@@ -2811,7 +2812,7 @@ static int futex_lock_pi(u32 __user *uad goto no_block; } @@ -423,7 +423,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3129,7 +3130,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3183,7 +3184,7 @@ static int futex_wait_requeue_pi(u32 __u * The waiter is allocated on our stack, manipulated by the requeue * code while we sleep on uaddr. */ @@ -930,7 +930,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Technically we could use raw_spin_[un]lock_irq() here, but this can -@@ -1361,7 +1705,8 @@ static inline int rt_mutex_slowtrylock(s +@@ -1368,7 +1712,8 @@ static inline int rt_mutex_slowtrylock(s * Return whether the current task needs to call rt_mutex_postunlock(). */ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, @@ -940,7 +940,7 @@ Signed-off-by: Sebastian Andrzej Siewior { unsigned long flags; -@@ -1415,7 +1760,7 @@ static bool __sched rt_mutex_slowunlock( +@@ -1422,7 +1767,7 @@ static bool __sched rt_mutex_slowunlock( * * Queue the next waiter for wakeup once we release the wait_lock. */ @@ -949,7 +949,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&lock->wait_lock, flags); return true; /* call rt_mutex_postunlock() */ -@@ -1467,9 +1812,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lo +@@ -1474,9 +1819,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lo /* * Performs the wakeup of the the top-waiter and re-enables preemption. */ @@ -962,7 +962,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Pairs with preempt_disable() in rt_mutex_slowunlock() */ preempt_enable(); -@@ -1478,15 +1825,17 @@ void rt_mutex_postunlock(struct wake_q_h +@@ -1485,15 +1832,17 @@ void rt_mutex_postunlock(struct wake_q_h static inline void rt_mutex_fastunlock(struct rt_mutex *lock, bool (*slowfn)(struct rt_mutex *lock, @@ -983,7 +983,7 @@ Signed-off-by: Sebastian Andrzej Siewior } int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) -@@ -1641,16 +1990,13 @@ void __sched __rt_mutex_unlock(struct rt +@@ -1653,16 +2002,13 @@ void __sched __rt_mutex_unlock(struct rt void __sched rt_mutex_unlock(struct rt_mutex *lock) { mutex_release(&lock->dep_map, 1, _RET_IP_); @@ -1004,7 +1004,7 @@ Signed-off-by: Sebastian Andrzej Siewior { lockdep_assert_held(&lock->wait_lock); -@@ -1667,22 +2013,34 @@ bool __sched __rt_mutex_futex_unlock(str +@@ -1679,22 +2025,34 @@ bool __sched __rt_mutex_futex_unlock(str * avoid inversion prior to the wakeup. preempt_disable() * therein pairs with rt_mutex_postunlock(). */ @@ -1042,7 +1042,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /** -@@ -1721,7 +2079,7 @@ void __rt_mutex_init(struct rt_mutex *lo +@@ -1733,7 +2091,7 @@ void __rt_mutex_init(struct rt_mutex *lo if (name && key) debug_rt_mutex_init(lock, name, key); } @@ -1051,7 +1051,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1890,6 +2248,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1902,6 +2260,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m struct hrtimer_sleeper *to, struct rt_mutex_waiter *waiter) { @@ -1059,7 +1059,7 @@ Signed-off-by: Sebastian Andrzej Siewior int ret; raw_spin_lock_irq(&lock->wait_lock); -@@ -1901,6 +2260,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -1913,6 +2272,24 @@ int rt_mutex_wait_proxy_lock(struct rt_m * have to fix that up. */ fixup_rt_mutex_waiters(lock); @@ -1111,7 +1111,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct task_struct *task); -@@ -154,9 +156,12 @@ extern int rt_mutex_futex_trylock(struct +@@ -155,9 +157,12 @@ extern int __rt_mutex_futex_trylock(stru extern void rt_mutex_futex_unlock(struct rt_mutex *lock); extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, @@ -1126,7 +1126,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* RW semaphore special interface */ extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); -@@ -166,6 +171,10 @@ int __sched rt_mutex_slowlock_locked(str +@@ -167,6 +172,10 @@ int __sched rt_mutex_slowlock_locked(str struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, struct rt_mutex_waiter *waiter); diff --git a/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index 25dfdb65a..55cdb1062 100644 --- a/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches/features/all/rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 Subject: rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- @@ -237,7 +237,7 @@ Signed-off-by: Sebastian Andrzej Siewior raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -@@ -1774,29 +1917,33 @@ static bool __sched rt_mutex_slowunlock( +@@ -1781,29 +1924,33 @@ static bool __sched rt_mutex_slowunlock( */ static inline int rt_mutex_fastlock(struct rt_mutex *lock, int state, @@ -275,7 +275,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline int -@@ -1934,6 +2081,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1946,6 +2093,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); ret = rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, RT_MUTEX_MIN_CHAINWALK, @@ -283,7 +283,7 @@ Signed-off-by: Sebastian Andrzej Siewior rt_mutex_slowlock); if (ret) mutex_release(&lock->dep_map, 1, _RET_IP_); -@@ -2254,7 +2402,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m +@@ -2266,7 +2414,7 @@ int rt_mutex_wait_proxy_lock(struct rt_m raw_spin_lock_irq(&lock->wait_lock); /* sleep on the mutex */ set_current_state(TASK_INTERRUPTIBLE); @@ -292,7 +292,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might * have to fix that up. -@@ -2338,3 +2486,99 @@ bool rt_mutex_cleanup_proxy_lock(struct +@@ -2350,3 +2498,99 @@ bool rt_mutex_cleanup_proxy_lock(struct return cleanup; } @@ -394,7 +394,7 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -163,6 +163,7 @@ extern void rt_mutex_postunlock(struct w +@@ -164,6 +164,7 @@ extern void rt_mutex_postunlock(struct w struct wake_q_head *wake_sleeper_q); /* RW semaphore special interface */ @@ -402,7 +402,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); extern int __rt_mutex_trylock(struct rt_mutex *lock); -@@ -170,6 +171,7 @@ extern void __rt_mutex_unlock(struct rt_ +@@ -171,6 +172,7 @@ extern void __rt_mutex_unlock(struct rt_ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, enum rtmutex_chainwalk chwalk, diff --git a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch index 91f0dbe28..7fb9077a9 100644 --- a/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches/features/all/rt/rtmutex-avoid-include-hell.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Avoid include hell From: Thomas Gleixner Date: Wed, 29 Jun 2011 20:06:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Include only the required raw types. This avoids pulling in the complete spinlock header which in turn requires rtmutex.h at some point. diff --git a/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index 324a5dd80..79b35342a 100644 --- a/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches/features/all/rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 Subject: rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Required for lock implementation ontop of rtmutex. @@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1489,6 +1489,29 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1496,6 +1496,29 @@ rt_mutex_fastunlock(struct rt_mutex *loc rt_mutex_postunlock(&wake_q); } @@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_lock - lock a rt_mutex * -@@ -1496,10 +1519,7 @@ rt_mutex_fastunlock(struct rt_mutex *loc +@@ -1503,10 +1526,7 @@ rt_mutex_fastunlock(struct rt_mutex *loc */ void __sched rt_mutex_lock(struct rt_mutex *lock) { @@ -57,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock); -@@ -1514,16 +1534,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_lock); +@@ -1521,16 +1541,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_lock); */ int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock) { @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible); -@@ -1544,13 +1555,10 @@ int __sched rt_mutex_futex_trylock(struc +@@ -1556,13 +1567,10 @@ int __sched __rt_mutex_futex_trylock(str * Returns: * 0 on success * -EINTR when interrupted by a signal @@ -90,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); -@@ -1585,6 +1593,18 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1597,6 +1605,18 @@ rt_mutex_timed_lock(struct rt_mutex *loc } EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); @@ -109,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * rt_mutex_trylock - try to lock a rt_mutex * -@@ -1600,14 +1620,7 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1612,14 +1632,7 @@ int __sched rt_mutex_trylock(struct rt_m { int ret; @@ -125,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (ret) mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); -@@ -1615,6 +1628,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1627,6 +1640,11 @@ int __sched rt_mutex_trylock(struct rt_m } EXPORT_SYMBOL_GPL(rt_mutex_trylock); @@ -139,7 +139,7 @@ Signed-off-by: Sebastian Andrzej Siewior * --- a/kernel/locking/rtmutex_common.h +++ b/kernel/locking/rtmutex_common.h -@@ -159,6 +159,9 @@ extern bool __rt_mutex_futex_unlock(stru +@@ -160,6 +160,9 @@ extern bool __rt_mutex_futex_unlock(stru extern void rt_mutex_postunlock(struct wake_q_head *wake_q); /* RW semaphore special interface */ diff --git a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch index 3249de1c8..91d235a38 100644 --- a/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch +++ b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Handle the various new futex race conditions From: Thomas Gleixner Date: Fri, 10 Jun 2011 11:04:15 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT opens a few new interesting race conditions in the rtmutex/futex combo due to futex hash bucket lock being a 'sleeping' spinlock and @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/futex.c +++ b/kernel/futex.c -@@ -2101,6 +2101,16 @@ static int futex_requeue(u32 __user *uad +@@ -2104,6 +2104,16 @@ static int futex_requeue(u32 __user *uad requeue_pi_wake_futex(this, &key2, hb2); drop_count++; continue; @@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner } else if (ret) { /* * rt_mutex_start_proxy_lock() detected a -@@ -3090,7 +3100,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3144,7 +3154,7 @@ static int futex_wait_requeue_pi(u32 __u struct hrtimer_sleeper timeout, *to = NULL; struct futex_pi_state *pi_state = NULL; struct rt_mutex_waiter rt_waiter; @@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner union futex_key key2 = FUTEX_KEY_INIT; struct futex_q q = futex_q_init; int res, ret; -@@ -3148,20 +3158,55 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3202,20 +3212,55 @@ static int futex_wait_requeue_pi(u32 __u /* Queue the futex_q, drop the hb lock, wait for wakeup. */ futex_wait_queue_me(hb, &q, to); @@ -109,7 +109,7 @@ Signed-off-by: Thomas Gleixner /* Check if the requeue code acquired the second futex for us. */ if (!q.rt_waiter) { -@@ -3170,7 +3215,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3224,7 +3269,8 @@ static int futex_wait_requeue_pi(u32 __u * did a lock-steal - fix up the PI-state in that case. */ if (q.pi_state && (q.pi_state->owner != current)) { @@ -119,7 +119,7 @@ Signed-off-by: Thomas Gleixner ret = fixup_pi_state_owner(uaddr2, &q, current); if (ret && rt_mutex_owner(&q.pi_state->pi_mutex) == current) { pi_state = q.pi_state; -@@ -3181,7 +3227,7 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3235,7 +3281,7 @@ static int futex_wait_requeue_pi(u32 __u * the requeue_pi() code acquired for us. */ put_pi_state(q.pi_state); @@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner } } else { struct rt_mutex *pi_mutex; -@@ -3195,7 +3241,8 @@ static int futex_wait_requeue_pi(u32 __u +@@ -3249,7 +3295,8 @@ static int futex_wait_requeue_pi(u32 __u pi_mutex = &q.pi_state->pi_mutex; ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); diff --git a/debian/patches/features/all/rt/rtmutex-lock-killable.patch b/debian/patches/features/all/rt/rtmutex-lock-killable.patch index ee81680ef..a8023d404 100644 --- a/debian/patches/features/all/rt/rtmutex-lock-killable.patch +++ b/debian/patches/features/all/rt/rtmutex-lock-killable.patch @@ -1,7 +1,7 @@ Subject: rtmutex: Add rtmutex_lock_killable() From: Thomas Gleixner Date: Thu, 09 Jun 2011 11:43:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. @@ -24,7 +24,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1531,6 +1531,25 @@ int __sched rt_mutex_futex_trylock(struc +@@ -1543,6 +1543,25 @@ int __sched __rt_mutex_futex_trylock(str } /** diff --git a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch index 97c9acb1a..50964e36b 100644 --- a/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches/features/all/rt/rtmutex-trylock-is-okay-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed 02 Dec 2015 11:34:07 +0100 Subject: rtmutex: trylock is okay on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On -RT we don't run softirqs in IRQ context but in thread context so it is @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1551,7 +1551,11 @@ int __sched rt_mutex_trylock(struct rt_m +@@ -1563,7 +1563,11 @@ int __sched rt_mutex_trylock(struct rt_m { int ret; diff --git a/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch index e5fd1e51d..a0cd49672 100644 --- a/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches/features/all/rt/rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch index c319328bd..4561b4563 100644 --- a/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches/features/all/rt/rtmutex_dont_include_rcu.patch @@ -1,6 +1,6 @@ From: Sebastian Andrzej Siewior Subject: rbtree: don't include the rcu header -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: diff --git a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch index b0d6040f0..2b6755807 100644 --- a/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch +++ b/debian/patches/features/all/rt/rxrpc-remove-unused-static-variables.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 21 Oct 2016 10:54:50 +0200 Subject: [PATCH] rxrpc: remove unused static variables -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The rxrpc_security_methods and rxrpc_security_sem user has been removed in 648af7fca159 ("rxrpc: Absorb the rxkad security module"). This was diff --git a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch index bd02ab099..99481fa80 100644 --- a/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch +++ b/debian/patches/features/all/rt/sas-ata-isci-dont-t-disable-interrupts-in-qc_issue-h.patch @@ -1,7 +1,7 @@ From: Paul Gortmaker Date: Sat, 14 Feb 2015 11:01:16 -0500 Subject: sas-ata/isci: dont't disable interrupts in qc_issue handler -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On 3.14-rt we see the following trace on Canoe Pass for SCSI_ISCI "Intel(R) C600 Series Chipset SAS Controller" diff --git a/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch b/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch index f5661d70b..fba3e4130 100644 --- a/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch +++ b/debian/patches/features/all/rt/sched-Prevent-task-state-corruption-by-spurious-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 6 Jun 2017 14:20:37 +0200 Subject: sched: Prevent task state corruption by spurious lock wakeup -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Mathias and others reported GDB failures on RT. diff --git a/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch b/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch index cbb018a7f..8ffb0db44 100644 --- a/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch +++ b/debian/patches/features/all/rt/sched-Remove-TASK_ALL.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Wed, 7 Jun 2017 10:12:45 +0200 Subject: [PATCH] sched: Remove TASK_ALL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz It's unused: diff --git a/debian/patches/features/all/rt/sched-delay-put-task.patch b/debian/patches/features/all/rt/sched-delay-put-task.patch index 18883a0ac..0a145c07b 100644 --- a/debian/patches/features/all/rt/sched-delay-put-task.patch +++ b/debian/patches/features/all/rt/sched-delay-put-task.patch @@ -1,7 +1,7 @@ Subject: sched: Move task_struct cleanup to RCU From: Thomas Gleixner Date: Tue, 31 May 2011 16:59:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. diff --git a/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch index 3f803b501..c579af655 100644 --- a/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches/features/all/rt/sched-disable-rt-group-sched-on-rt.patch @@ -1,7 +1,7 @@ Subject: sched: Disable CONFIG_RT_GROUP_SCHED on RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 17:03:52 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Carsten reported problems when running: diff --git a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch index ab54cb8d8..0553b37fe 100644 --- a/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch +++ b/debian/patches/features/all/rt/sched-disable-ttwu-queue.patch @@ -1,7 +1,7 @@ Subject: sched: Disable TTWU_QUEUE on RT From: Thomas Gleixner Date: Tue, 13 Sep 2011 16:42:35 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The queued remote wakeup mechanism can introduce rather large latencies if the number of migrated tasks is high. Disable it for RT. diff --git a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch index 90bf06058..62a3233b6 100644 --- a/debian/patches/features/all/rt/sched-limit-nr-migrate.patch +++ b/debian/patches/features/all/rt/sched-limit-nr-migrate.patch @@ -1,7 +1,7 @@ Subject: sched: Limit the number of task migrations per batch From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:12:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Put an upper limit on the number of tasks which are migrated per batch to avoid large latencies. diff --git a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch index 5728decf2..94fbeb09c 100644 --- a/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches/features/all/rt/sched-might-sleep-do-not-account-rcu-depth.patch @@ -1,7 +1,7 @@ Subject: sched: Do not account rcu_preempt_depth on RT in might_sleep() From: Thomas Gleixner Date: Tue, 07 Jun 2011 09:19:06 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch index d15a7ccc3..608f32bc3 100644 --- a/debian/patches/features/all/rt/sched-mmdrop-delayed.patch +++ b/debian/patches/features/all/rt/sched-mmdrop-delayed.patch @@ -1,7 +1,7 @@ Subject: sched: Move mmdrop to RCU on RT From: Thomas Gleixner Date: Mon, 06 Jun 2011 12:20:33 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. @@ -56,7 +56,7 @@ Signed-off-by: Thomas Gleixner struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work); --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -931,6 +931,19 @@ void __mmdrop(struct mm_struct *mm) +@@ -930,6 +930,19 @@ void __mmdrop(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(__mmdrop); diff --git a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch index 63fa887be..2adae974f 100644 --- a/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches/features/all/rt/sched-rt-mutex-wakeup.patch @@ -1,7 +1,7 @@ Subject: sched: Add saved_state for tasks blocked on sleeping locks From: Thomas Gleixner Date: Sat, 25 Jun 2011 09:21:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Spinlocks are state preserving in !RT. RT changes the state when a task gets blocked on a lock. So we need to remember the state before diff --git a/debian/patches/features/all/rt/sched-swait-include-wait.h.patch b/debian/patches/features/all/rt/sched-swait-include-wait.h.patch index e6439c648..809464150 100644 --- a/debian/patches/features/all/rt/sched-swait-include-wait.h.patch +++ b/debian/patches/features/all/rt/sched-swait-include-wait.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 4 Dec 2017 13:11:10 +0100 Subject: [PATCH] sched/swait: include wait.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz kbuild bot reported against an intermediate RT patch that the build fails with: diff --git a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch index bb83016c1..76dd91613 100644 --- a/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch +++ b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch @@ -1,7 +1,7 @@ Subject: sched: ttwu: Return success when only changing the saved_state value From: Thomas Gleixner Date: Tue, 13 Dec 2011 21:42:19 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When a task blocks on a rt lock, it saves the current state in p->saved_state, so a lock related wake up will not destroy the diff --git a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch index 4ef1c75d5..e1b52e2d2 100644 --- a/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch +++ b/debian/patches/features/all/rt/sched-workqueue-Only-wake-up-idle-workers-if-not-blo.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 18 Mar 2013 15:12:49 -0400 Subject: sched/workqueue: Only wake up idle workers if not blocked on sleeping spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz In -rt, most spin_locks() turn into mutexes. One of these spin_lock conversions is performed on the workqueue gcwq->lock. When the idle diff --git a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch index 6517caed0..1dde1d6de 100644 --- a/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches/features/all/rt/scsi-fcoe-rt-aware.patch @@ -1,7 +1,7 @@ Subject: scsi/fcoe: Make RT aware. From: Thomas Gleixner Date: Sat, 12 Nov 2011 14:00:48 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch index 306afb973..ccb4cb298 100644 --- a/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch +++ b/debian/patches/features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch @@ -1,7 +1,7 @@ Subject: scsi: qla2xxx: Use local_irq_save_nort() in qla2x00_poll From: John Kacur Date: Fri, 27 Apr 2012 12:48:46 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz RT triggers the following: diff --git a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch index 9880a104a..d6f2026d6 100644 --- a/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches/features/all/rt/seqlock-prevent-rt-starvation.patch @@ -1,7 +1,7 @@ Subject: seqlock: Prevent rt starvation From: Thomas Gleixner Date: Wed, 22 Feb 2012 12:03:30 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz If a low prio writer gets preempted while holding the seqlock write locked, a high prio reader spins forever on RT. diff --git a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch index 844f84db2..8d3d07e69 100644 --- a/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch +++ b/debian/patches/features/all/rt/signal-fix-up-rcu-wreckage.patch @@ -1,7 +1,7 @@ Subject: signal: Make __lock_task_sighand() RT aware From: Thomas Gleixner Date: Fri, 22 Jul 2011 08:07:08 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz local_irq_save() + spin_lock(&sighand->siglock) does not work on -RT. Use the nort variants. @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1300,12 +1300,12 @@ struct sighand_struct *__lock_task_sigha +@@ -1302,12 +1302,12 @@ struct sighand_struct *__lock_task_sigha * Disable interrupts early to avoid deadlocks. * See rcu_read_unlock() comment header for details. */ @@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner break; } /* -@@ -1326,7 +1326,7 @@ struct sighand_struct *__lock_task_sigha +@@ -1328,7 +1328,7 @@ struct sighand_struct *__lock_task_sigha } spin_unlock(&sighand->siglock); rcu_read_unlock(); diff --git a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch index f41ba58a3..8437bf9b0 100644 --- a/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches/features/all/rt/signal-revert-ptrace-preempt-magic.patch @@ -1,7 +1,7 @@ Subject: signal: Revert ptrace preempt magic From: Thomas Gleixner Date: Wed, 21 Sep 2011 19:57:12 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1874,15 +1874,7 @@ static void ptrace_stop(int exit_code, i +@@ -1876,15 +1876,7 @@ static void ptrace_stop(int exit_code, i if (gstop_done && ptrace_reparented(current)) do_notify_parent_cldstop(current, false, why); diff --git a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 1d063006a..22488bb2f 100644 --- a/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches/features/all/rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:56 -0500 Subject: signals: Allow rt tasks to cache one sigqueue struct -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. @@ -50,7 +50,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1649,6 +1649,7 @@ static __latent_entropy struct task_stru +@@ -1648,6 +1648,7 @@ static __latent_entropy struct task_stru spin_lock_init(&p->alloc_lock); init_sigpending(&p->pending); @@ -68,7 +68,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -358,13 +359,30 @@ static bool task_participate_group_stop( +@@ -360,13 +361,30 @@ static bool task_participate_group_stop( return false; } @@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner { struct sigqueue *q = NULL; struct user_struct *user; -@@ -381,7 +399,10 @@ static struct sigqueue * +@@ -383,7 +401,10 @@ static struct sigqueue * if (override_rlimit || atomic_read(&user->sigpending) <= task_rlimit(t, RLIMIT_SIGPENDING)) { @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner } else { print_dropped_signal(sig); } -@@ -398,6 +419,13 @@ static struct sigqueue * +@@ -400,6 +421,13 @@ static struct sigqueue * return q; } @@ -126,7 +126,7 @@ Signed-off-by: Thomas Gleixner static void __sigqueue_free(struct sigqueue *q) { if (q->flags & SIGQUEUE_PREALLOC) -@@ -407,6 +435,21 @@ static void __sigqueue_free(struct sigqu +@@ -409,6 +437,21 @@ static void __sigqueue_free(struct sigqu kmem_cache_free(sigqueue_cachep, q); } @@ -148,7 +148,7 @@ Signed-off-by: Thomas Gleixner void flush_sigqueue(struct sigpending *queue) { struct sigqueue *q; -@@ -420,6 +463,21 @@ void flush_sigqueue(struct sigpending *q +@@ -422,6 +465,21 @@ void flush_sigqueue(struct sigpending *q } /* @@ -170,7 +170,7 @@ Signed-off-by: Thomas Gleixner * Flush all pending signals for this kthread. */ void flush_signals(struct task_struct *t) -@@ -540,7 +598,7 @@ static void collect_signal(int sig, stru +@@ -542,7 +600,7 @@ static void collect_signal(int sig, stru (info->si_code == SI_TIMER) && (info->si_sys_private); @@ -179,7 +179,7 @@ Signed-off-by: Thomas Gleixner } else { /* * Ok, it wasn't in the queue. This must be -@@ -576,6 +634,8 @@ int dequeue_signal(struct task_struct *t +@@ -578,6 +636,8 @@ int dequeue_signal(struct task_struct *t bool resched_timer = false; int signr; @@ -188,7 +188,7 @@ Signed-off-by: Thomas Gleixner /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ -@@ -1513,7 +1573,8 @@ EXPORT_SYMBOL(kill_pid); +@@ -1515,7 +1575,8 @@ EXPORT_SYMBOL(kill_pid); */ struct sigqueue *sigqueue_alloc(void) { diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock.patch b/debian/patches/features/all/rt/skbufhead-raw-lock.patch index 5a4fe54c7..64e031ea4 100644 --- a/debian/patches/features/all/rt/skbufhead-raw-lock.patch +++ b/debian/patches/features/all/rt/skbufhead-raw-lock.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 12 Jul 2011 15:38:34 +0200 Subject: net: Use skbufhead with raw lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the rps lock as rawlock so we can keep irq-off regions. It looks low latency. However we can't kfree() from this context therefore we defer this @@ -34,7 +34,7 @@ Signed-off-by: Thomas Gleixner }; struct sk_buff; -@@ -1668,6 +1669,12 @@ static inline void skb_queue_head_init(s +@@ -1670,6 +1671,12 @@ static inline void skb_queue_head_init(s __skb_queue_head_init(list); } @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner #endif } -@@ -4581,7 +4581,7 @@ static void flush_backlog(struct work_st +@@ -4582,7 +4582,7 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner input_queue_head_incr(sd); } } -@@ -4591,11 +4591,14 @@ static void flush_backlog(struct work_st +@@ -4592,11 +4592,14 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); @@ -91,7 +91,7 @@ Signed-off-by: Thomas Gleixner } static void flush_all_backlogs(void) -@@ -5142,7 +5145,9 @@ static int process_backlog(struct napi_s +@@ -5143,7 +5146,9 @@ static int process_backlog(struct napi_s while (again) { struct sk_buff *skb; @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5150,9 +5155,9 @@ static int process_backlog(struct napi_s +@@ -5151,9 +5156,9 @@ static int process_backlog(struct napi_s if (++work >= quota) return work; @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -5592,13 +5597,21 @@ static __latent_entropy void net_rx_acti +@@ -5593,13 +5598,21 @@ static __latent_entropy void net_rx_acti unsigned long time_limit = jiffies + usecs_to_jiffies(netdev_budget_usecs); int budget = netdev_budget; @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner for (;;) { struct napi_struct *n; -@@ -8413,6 +8426,9 @@ static int dev_cpu_dead(unsigned int old +@@ -8414,6 +8427,9 @@ static int dev_cpu_dead(unsigned int old netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -144,7 +144,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -8716,8 +8732,9 @@ static int __init net_dev_init(void) +@@ -8717,8 +8733,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); diff --git a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch index 51a77bd03..0779d0d72 100644 --- a/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches/features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Apr 2015 19:00:47 +0200 Subject: slub: Disable SLUB_CPU_PARTIAL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 87, name: rcuop/7 diff --git a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch index bddbbe239..9c88127a4 100644 --- a/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches/features/all/rt/slub-enable-irqs-for-no-wait.patch @@ -1,7 +1,7 @@ Subject: slub: Enable irqs for __GFP_WAIT From: Thomas Gleixner Date: Wed, 09 Jan 2013 12:08:15 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz SYSTEM_RUNNING might be too late for enabling interrupts. Allocations with GFP_WAIT can happen before that. So use this as an indicator. diff --git a/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch index d8eb04ddf..9baf5f73b 100644 --- a/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch +++ b/debian/patches/features/all/rt/snd-pcm-fix-snd_pcm_stream_lock-irqs_disabled-splats.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Wed, 18 Feb 2015 15:09:23 +0100 Subject: snd/pcm: fix snd_pcm_stream_lock*() irqs_disabled() splats -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Locking functions previously using read_lock_irq()/read_lock_irqsave() were changed to local_irq_disable/save(), leading to gripes. Use nort variants. diff --git a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch index 5b5a498b1..b15ad836b 100644 --- a/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches/features/all/rt/softirq-disable-softirq-stacks-for-rt.patch @@ -1,7 +1,7 @@ Subject: softirq: Disable softirq stacks for RT From: Thomas Gleixner Date: Mon, 18 Jul 2011 13:59:17 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. @@ -110,7 +110,7 @@ Signed-off-by: Thomas Gleixner void fixup_irqs(void) --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -950,6 +950,7 @@ EXPORT_SYMBOL(native_load_gs_index) +@@ -1136,6 +1136,7 @@ EXPORT_SYMBOL(native_load_gs_index) jmp 2b .previous @@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner /* Call softirq on interrupt stack. Interrupts are off. */ ENTRY(do_softirq_own_stack) pushq %rbp -@@ -960,6 +961,7 @@ ENTRY(do_softirq_own_stack) +@@ -1146,6 +1147,7 @@ ENTRY(do_softirq_own_stack) leaveq ret ENDPROC(do_softirq_own_stack) @@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner idtentry hypervisor_callback xen_do_hypervisor_callback has_error_code=0 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c -@@ -128,6 +128,7 @@ void irq_ctx_init(int cpu) +@@ -129,6 +129,7 @@ void irq_ctx_init(int cpu) cpu, per_cpu(hardirq_stack, cpu), per_cpu(softirq_stack, cpu)); } @@ -136,7 +136,7 @@ Signed-off-by: Thomas Gleixner void do_softirq_own_stack(void) { struct irq_stack *irqstk; -@@ -144,6 +145,7 @@ void do_softirq_own_stack(void) +@@ -145,6 +146,7 @@ void do_softirq_own_stack(void) call_on_stack(__do_softirq, isp); } diff --git a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch index e2d861923..07625d309 100644 --- a/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches/features/all/rt/softirq-preempt-fix-3-re.patch @@ -1,7 +1,7 @@ Subject: softirq: Check preemption after reenabling interrupts From: Thomas Gleixner Date: Sun, 13 Nov 2011 17:17:09 +0100 (CET) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -128,7 +128,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__dev_kfree_skb_irq); -@@ -3855,6 +3857,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -3856,6 +3858,7 @@ static int enqueue_to_backlog(struct sk_ rps_unlock(sd); local_irq_restore(flags); @@ -136,7 +136,7 @@ Signed-off-by: Thomas Gleixner atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5104,12 +5107,14 @@ static void net_rps_action_and_irq_enabl +@@ -5105,12 +5108,14 @@ static void net_rps_action_and_irq_enabl sd->rps_ipi_list = NULL; local_irq_enable(); @@ -151,7 +151,7 @@ Signed-off-by: Thomas Gleixner } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5187,6 +5192,7 @@ void __napi_schedule(struct napi_struct +@@ -5188,6 +5193,7 @@ void __napi_schedule(struct napi_struct local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -159,7 +159,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__napi_schedule); -@@ -8391,6 +8397,7 @@ static int dev_cpu_dead(unsigned int old +@@ -8392,6 +8398,7 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); diff --git a/debian/patches/features/all/rt/softirq-split-locks.patch b/debian/patches/features/all/rt/softirq-split-locks.patch index 67b511d83..299ac94f4 100644 --- a/debian/patches/features/all/rt/softirq-split-locks.patch +++ b/debian/patches/features/all/rt/softirq-split-locks.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 04 Oct 2012 14:20:47 +0100 Subject: softirq: Split softirq locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The 3.x RT series removed the split softirq implementation in favour of pushing softirq processing into the context of the thread which @@ -192,7 +192,7 @@ Signed-off-by: Thomas Gleixner #define PF_EXITPIDONE 0x00000008 /* PI exit done on shut down */ --- a/init/main.c +++ b/init/main.c -@@ -539,6 +539,7 @@ asmlinkage __visible void __init start_k +@@ -544,6 +544,7 @@ asmlinkage __visible void __init start_k setup_command_line(command_line); setup_nr_cpu_ids(); setup_per_cpu_areas(); @@ -723,7 +723,7 @@ Signed-off-by: Thomas Gleixner } static inline void tick_irq_exit(void) -@@ -410,26 +786,6 @@ void irq_exit(void) +@@ -416,26 +792,6 @@ void irq_exit(void) trace_hardirq_exit(); /* must be last! */ } @@ -750,7 +750,7 @@ Signed-off-by: Thomas Gleixner void raise_softirq(unsigned int nr) { unsigned long flags; -@@ -439,12 +795,6 @@ void raise_softirq(unsigned int nr) +@@ -445,12 +801,6 @@ void raise_softirq(unsigned int nr) local_irq_restore(flags); } @@ -763,7 +763,7 @@ Signed-off-by: Thomas Gleixner void open_softirq(int nr, void (*action)(struct softirq_action *)) { softirq_vec[nr].action = action; -@@ -696,23 +1046,7 @@ EXPORT_SYMBOL(tasklet_unlock_wait); +@@ -702,23 +1052,7 @@ EXPORT_SYMBOL(tasklet_unlock_wait); static int ksoftirqd_should_run(unsigned int cpu) { @@ -788,7 +788,7 @@ Signed-off-by: Thomas Gleixner } #ifdef CONFIG_HOTPLUG_CPU -@@ -779,6 +1113,8 @@ static int takeover_tasklets(unsigned in +@@ -785,6 +1119,8 @@ static int takeover_tasklets(unsigned in static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, @@ -799,7 +799,7 @@ Signed-off-by: Thomas Gleixner .thread_comm = "ksoftirqd/%u", --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c -@@ -895,14 +895,7 @@ static bool can_stop_idle_tick(int cpu, +@@ -910,14 +910,7 @@ static bool can_stop_idle_tick(int cpu, return false; if (unlikely(local_softirq_pending() && cpu_online(cpu))) { @@ -817,7 +817,7 @@ Signed-off-by: Thomas Gleixner --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4061,11 +4061,9 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -4062,11 +4062,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); diff --git a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch index b2d139917..a7175b21a 100644 --- a/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch +++ b/debian/patches/features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 16:34:17 +0100 Subject: softirq: split timer softirqs out of ksoftirqd -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The softirqd runs in -RT with SCHED_FIFO (prio 1) and deals mostly with timer wakeup which can not happen in hardirq context. The prio has been @@ -173,7 +173,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_irq_restore(flags); #endif } -@@ -1125,18 +1174,30 @@ static int takeover_tasklets(unsigned in +@@ -1131,18 +1180,30 @@ static int takeover_tasklets(unsigned in static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, .setup = ksoftirqd_set_sched_params, diff --git a/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch b/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch index fbe6b0c9b..85fd1cbe6 100644 --- a/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch +++ b/debian/patches/features/all/rt/softirq-wake-the-timer-softirq-if-needed.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 20 Jan 2017 18:10:20 +0100 Subject: [PATCH] softirq: wake the timer softirq if needed -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The irq-exit path only checks the "normal"-softirq thread if it is running and ignores the state of the "timer"-softirq thread. It is possible diff --git a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch index e347d0b09..2b6619752 100644 --- a/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch +++ b/debian/patches/features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Allen Pais Date: Fri, 13 Dec 2013 09:44:41 +0530 Subject: sparc64: use generic rwsem spinlocks rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Signed-off-by: Allen Pais Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch index 3e797bf4e..624373226 100644 --- a/debian/patches/features/all/rt/spinlock-types-separate-raw.patch +++ b/debian/patches/features/all/rt/spinlock-types-separate-raw.patch @@ -1,7 +1,7 @@ Subject: spinlock: Split the lock types header From: Thomas Gleixner Date: Wed, 29 Jun 2011 19:34:01 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Split raw_spinlock into its own file and the remaining spinlock_t into its own non-RT header. The non-RT header will be replaced later by sleeping @@ -12,8 +12,8 @@ Signed-off-by: Thomas Gleixner include/linux/rwlock_types.h | 4 + include/linux/spinlock_types.h | 74 ------------------------------------ include/linux/spinlock_types_nort.h | 33 ++++++++++++++++ - include/linux/spinlock_types_raw.h | 56 +++++++++++++++++++++++++++ - 4 files changed, 95 insertions(+), 72 deletions(-) + include/linux/spinlock_types_raw.h | 58 ++++++++++++++++++++++++++++ + 4 files changed, 97 insertions(+), 72 deletions(-) --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h @@ -150,10 +150,12 @@ Signed-off-by: Thomas Gleixner +#endif --- /dev/null +++ b/include/linux/spinlock_types_raw.h -@@ -0,0 +1,56 @@ +@@ -0,0 +1,58 @@ +#ifndef __LINUX_SPINLOCK_TYPES_RAW_H +#define __LINUX_SPINLOCK_TYPES_RAW_H + ++#include ++ +#if defined(CONFIG_SMP) +# include +#else diff --git a/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch b/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch index 019fd8acd..6bb987a84 100644 --- a/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch +++ b/debian/patches/features/all/rt/srcu-Prohibit-call_srcu-use-under-raw-spinlocks.patch @@ -1,7 +1,7 @@ From: "Paul E. McKenney" Date: Tue, 10 Oct 2017 13:52:30 -0700 Subject: srcu: Prohibit call_srcu() use under raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Upstream commit 08265b8f1a139c1cff052b35ab7cf929528f88bb diff --git a/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch index d0a2c9d9a..42292ad9b 100644 --- a/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches/features/all/rt/srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 Subject: [PATCH] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with diff --git a/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch b/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch index e4f905993..920484a26 100644 --- a/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch +++ b/debian/patches/features/all/rt/srcu-use-cpu_online-instead-custom-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 14:43:41 +0200 Subject: [PATCH] srcu: use cpu_online() instead custom check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The current check via srcu_online is slightly racy because after looking at srcu_online there could be an interrupt that interrupted us long diff --git a/debian/patches/features/all/rt/stop-machine-raw-lock.patch b/debian/patches/features/all/rt/stop-machine-raw-lock.patch index 3bef5a86c..5e95d8eaa 100644 --- a/debian/patches/features/all/rt/stop-machine-raw-lock.patch +++ b/debian/patches/features/all/rt/stop-machine-raw-lock.patch @@ -1,7 +1,7 @@ Subject: stop_machine: Use raw spinlocks From: Thomas Gleixner Date: Wed, 29 Jun 2011 11:01:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use raw-locks in stomp_machine() to allow locking in irq-off regions. diff --git a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch index 588aca92d..24479d188 100644 --- a/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch +++ b/debian/patches/features/all/rt/stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:27 -0500 Subject: stop_machine: convert stop_machine_run() to PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Instead of playing with non-preemption, introduce explicit startup serialization. This is more robust and cleaner as diff --git a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index c8877d2f0..956a022bb 100644 --- a/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches/features/all/rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Wed, 18 Feb 2015 16:05:28 +0100 Subject: sunrpc: Make svc_xprt_do_enqueue() use get_cpu_light() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 |in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd diff --git a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch index 55cccc6d5..2ee248e07 100644 --- a/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch +++ b/debian/patches/features/all/rt/suspend-prevernt-might-sleep-splats.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 15 Jul 2010 10:29:00 +0200 Subject: suspend: Prevent might sleep splats -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz timekeeping suspend/resume calls read_persistant_clock() which takes rtc_lock. That results in might sleep warnings because at that point @@ -96,7 +96,7 @@ Signed-off-by: Thomas Gleixner error = syscore_suspend(); if (!error) { *wakeup = pm_wakeup_pending(); -@@ -444,6 +446,8 @@ static int suspend_enter(suspend_state_t +@@ -443,6 +445,8 @@ static int suspend_enter(suspend_state_t syscore_resume(); } diff --git a/debian/patches/features/all/rt/sysfs-realtime-entry.patch b/debian/patches/features/all/rt/sysfs-realtime-entry.patch index c462d1d29..73f50be88 100644 --- a/debian/patches/features/all/rt/sysfs-realtime-entry.patch +++ b/debian/patches/features/all/rt/sysfs-realtime-entry.patch @@ -1,7 +1,7 @@ Subject: sysfs: Add /sys/kernel/realtime entry From: Clark Williams Date: Sat Jul 30 21:55:53 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch index 528af9d59..6295b6e6b 100644 --- a/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch +++ b/debian/patches/features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt.patch @@ -1,7 +1,7 @@ Subject: tasklet: Prevent tasklets from going into infinite spin in RT From: Ingo Molnar Date: Tue Nov 29 20:18:22 2011 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with @@ -123,7 +123,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -460,15 +461,45 @@ struct tasklet_head { +@@ -466,15 +467,45 @@ struct tasklet_head { static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec); static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec); @@ -173,7 +173,7 @@ Signed-off-by: Thomas Gleixner local_irq_restore(flags); } EXPORT_SYMBOL(__tasklet_schedule); -@@ -478,10 +509,7 @@ void __tasklet_hi_schedule(struct taskle +@@ -484,10 +515,7 @@ void __tasklet_hi_schedule(struct taskle unsigned long flags; local_irq_save(flags); @@ -185,7 +185,7 @@ Signed-off-by: Thomas Gleixner local_irq_restore(flags); } EXPORT_SYMBOL(__tasklet_hi_schedule); -@@ -490,82 +518,122 @@ void __tasklet_hi_schedule_first(struct +@@ -496,82 +524,122 @@ void __tasklet_hi_schedule_first(struct { BUG_ON(!irqs_disabled()); @@ -357,7 +357,7 @@ Signed-off-by: Thomas Gleixner } void tasklet_init(struct tasklet_struct *t, -@@ -586,7 +654,7 @@ void tasklet_kill(struct tasklet_struct +@@ -592,7 +660,7 @@ void tasklet_kill(struct tasklet_struct while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { do { @@ -366,7 +366,7 @@ Signed-off-by: Thomas Gleixner } while (test_bit(TASKLET_STATE_SCHED, &t->state)); } tasklet_unlock_wait(t); -@@ -609,6 +677,23 @@ void __init softirq_init(void) +@@ -615,6 +683,23 @@ void __init softirq_init(void) open_softirq(HI_SOFTIRQ, tasklet_hi_action); } diff --git a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch index f0976634c..b27c95a32 100644 --- a/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch +++ b/debian/patches/features/all/rt/thermal-Defer-thermal-wakups-to-threads.patch @@ -1,7 +1,7 @@ From: Daniel Wagner Date: Tue, 17 Feb 2015 09:37:44 +0100 Subject: thermal: Defer thermal wakups to threads -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz On RT the spin lock in pkg_temp_thermal_platfrom_thermal_notify will call schedule while we run in irq context. diff --git a/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch b/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch index cd8b17c9f..3ec2e89b8 100644 --- a/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch +++ b/debian/patches/features/all/rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 15 Nov 2017 17:29:51 +0100 Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The NOHZ code tries to schedule a workqueue with interrupts disabled. Since this does not work -RT I am switching it to swork instead. diff --git a/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch index 52e246ce8..3ef045fff 100644 --- a/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch @@ -1,7 +1,7 @@ Subject: timekeeping: Split jiffies seqlock From: Thomas Gleixner Date: Thu, 14 Feb 2013 22:36:59 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Replace jiffies_lock seqlock with a simple seqcounter and a rawlock so it can be taken in atomic context on RT. diff --git a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch index fbf4ef928..cef55c29e 100644 --- a/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch +++ b/debian/patches/features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch @@ -1,7 +1,7 @@ From: Peter Zijlstra Date: Fri, 21 Aug 2009 11:56:45 +0200 Subject: timer: delay waking softirqs from the jiffy tick -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz People were complaining about broken balancing with the recent -rt series. @@ -59,7 +59,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/time/timer.c +++ b/kernel/time/timer.c -@@ -1630,13 +1630,13 @@ void update_process_times(int user_tick) +@@ -1628,13 +1628,13 @@ void update_process_times(int user_tick) /* Note: this timer irq context must be accounted for as well. */ account_process_tick(p, user_tick); diff --git a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch index 4b6ad9669..bd50bd00b 100644 --- a/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch +++ b/debian/patches/features/all/rt/timer-fd-avoid-live-lock.patch @@ -1,7 +1,7 @@ Subject: timer-fd: Prevent live lock From: Thomas Gleixner Date: Wed, 25 Jan 2012 11:08:40 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz If hrtimer_try_to_cancel() requires a retry, then depending on the priority setting te retry loop might prevent timer callback completion diff --git a/debian/patches/features/all/rt/timerqueue-Document-return-values-of-timerqueue_add-.patch b/debian/patches/features/all/rt/timerqueue-Document-return-values-of-timerqueue_add-.patch new file mode 100644 index 000000000..73db4ca2b --- /dev/null +++ b/debian/patches/features/all/rt/timerqueue-Document-return-values-of-timerqueue_add-.patch @@ -0,0 +1,40 @@ +From: Thomas Gleixner +Date: Fri, 22 Dec 2017 15:51:15 +0100 +Subject: [PATCH 4/4] timerqueue: Document return values of + timerqueue_add/del() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz + +The return values of timerqueue_add/del() are not documented in the kernel doc +comment. Add proper documentation. + +Signed-off-by: Thomas Gleixner +Cc: rt@linutronix.de +Signed-off-by: Sebastian Andrzej Siewior +--- + lib/timerqueue.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/lib/timerqueue.c ++++ b/lib/timerqueue.c +@@ -33,8 +33,9 @@ + * @head: head of timerqueue + * @node: timer node to be added + * +- * Adds the timer node to the timerqueue, sorted by the +- * node's expires value. ++ * Adds the timer node to the timerqueue, sorted by the node's expires ++ * value. Returns true if the newly added timer is the first expiring timer in ++ * the queue. + */ + bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node) + { +@@ -70,7 +71,8 @@ EXPORT_SYMBOL_GPL(timerqueue_add); + * @head: head of timerqueue + * @node: timer node to be removed + * +- * Removes the timer node from the timerqueue. ++ * Removes the timer node from the timerqueue. Returns true if the queue is ++ * not empty after the remove. + */ + bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node) + { diff --git a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch index bd65581d8..db60d7883 100644 --- a/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches/features/all/rt/timers-prepare-for-full-preemption.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:34 -0500 Subject: timers: Prepare for full preemption -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When softirqs can be preempted we need to make sure that cancelling the timer from the active thread can not deadlock vs. a running timer @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner unsigned long clk; unsigned long next_expiry; unsigned int cpu; -@@ -1142,6 +1146,33 @@ void add_timer_on(struct timer_list *tim +@@ -1140,6 +1144,33 @@ void add_timer_on(struct timer_list *tim } EXPORT_SYMBOL_GPL(add_timer_on); @@ -109,7 +109,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer - deactivate a timer. * @timer: the timer to be deactivated -@@ -1197,7 +1228,7 @@ int try_to_del_timer_sync(struct timer_l +@@ -1195,7 +1226,7 @@ int try_to_del_timer_sync(struct timer_l } EXPORT_SYMBOL(try_to_del_timer_sync); @@ -118,7 +118,7 @@ Signed-off-by: Thomas Gleixner /** * del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated -@@ -1257,7 +1288,7 @@ int del_timer_sync(struct timer_list *ti +@@ -1255,7 +1286,7 @@ int del_timer_sync(struct timer_list *ti int ret = try_to_del_timer_sync(timer); if (ret >= 0) return ret; @@ -127,7 +127,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL(del_timer_sync); -@@ -1321,13 +1352,16 @@ static void expire_timers(struct timer_b +@@ -1319,13 +1350,16 @@ static void expire_timers(struct timer_b fn = timer->function; data = timer->data; @@ -145,7 +145,7 @@ Signed-off-by: Thomas Gleixner raw_spin_lock_irq(&base->lock); } } -@@ -1629,8 +1663,8 @@ static inline void __run_timers(struct t +@@ -1627,8 +1661,8 @@ static inline void __run_timers(struct t while (levels--) expire_timers(base, heads + levels); } @@ -155,7 +155,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1855,6 +1889,9 @@ static void __init init_timer_cpu(int cp +@@ -1868,6 +1902,9 @@ static void __init init_timer_cpu(int cp base->cpu = cpu; raw_spin_lock_init(&base->lock); base->clk = jiffies; diff --git a/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch index ba4bb6d37..557afa55c 100644 --- a/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches/features/all/rt/tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch index 9a1aaa1b8..fff0b6a93 100644 --- a/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch +++ b/debian/patches/features/all/rt/tracing-account-for-preempt-off-in-preempt_schedule.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Thu, 29 Sep 2011 12:24:30 -0500 Subject: tracing: Account for preempt off in preempt_schedule() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz The preempt_schedule() uses the preempt_disable_notrace() version because it can cause infinite recursion by the function tracer as diff --git a/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch b/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch index b7f87ce6b..cb52d91a4 100644 --- a/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch +++ b/debian/patches/features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 29 Nov 2017 16:32:20 +0100 Subject: [PATCH] tty: goldfish: Enable 'earlycon' only if built-in -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Commit 3840ed9548f7 ("tty: goldfish: Implement support for kernel 'earlycon' parameter") breaks an allmodconfig config on x86: diff --git a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch index 533436998..b71a70279 100644 --- a/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch +++ b/debian/patches/features/all/rt/tty-serial-8250-don-t-take-the-trylock-during-oops.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Apr 2016 16:55:02 +0200 Subject: [PATCH] tty: serial: 8250: don't take the trylock during oops -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz An oops with irqs off (panic() from irqsafe hrtimer like the watchdog timer) will lead to a lockdep warning on each invocation and as such diff --git a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index 2f184a6f9..f91e6e422 100644 --- a/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches/features/all/rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch @@ -1,7 +1,7 @@ Subject: net: Remove preemption disabling in netif_rx() From: Priyanka Jain Date: Thu, 17 May 2012 09:35:11 +0530 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4015,7 +4015,7 @@ static int netif_rx_internal(struct sk_b +@@ -4016,7 +4016,7 @@ static int netif_rx_internal(struct sk_b struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4025,14 +4025,14 @@ static int netif_rx_internal(struct sk_b +@@ -4026,14 +4026,14 @@ static int netif_rx_internal(struct sk_b ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); diff --git a/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch index 8f7b9eed5..ff2ab32b8 100644 --- a/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch +++ b/debian/patches/features/all/rt/usb-use-_nort-in-giveback.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 8 Nov 2013 17:34:54 +0100 Subject: usb: Use _nort in giveback function -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Since commit 94dfd7ed ("USB: HCD: support giveback of URB in tasklet context") I see diff --git a/debian/patches/features/all/rt/user-use-local-irq-nort.patch b/debian/patches/features/all/rt/user-use-local-irq-nort.patch index aa873daf4..f6806021d 100644 --- a/debian/patches/features/all/rt/user-use-local-irq-nort.patch +++ b/debian/patches/features/all/rt/user-use-local-irq-nort.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 21 Jul 2009 23:06:05 +0200 Subject: core: Do not disable interrupts on RT in kernel/users.c -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use the local_irq_*_nort variants to reduce latencies in RT. The code is serialized by the locks. No need to disable interrupts. diff --git a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch index 99b3482e7..aa76b2b04 100644 --- a/debian/patches/features/all/rt/wait.h-include-atomic.h.patch +++ b/debian/patches/features/all/rt/wait.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 12:19:57 +0100 Subject: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch index e0cd4d7c2..85b36a7ae 100644 --- a/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch +++ b/debian/patches/features/all/rt/work-queue-work-around-irqsafe-timer-optimization.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 01 Jul 2013 11:02:42 +0200 Subject: workqueue: Prevent workqueue versus ata-piix livelock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz An Intel i7 system regularly detected rcu_preempt stalls after the kernel was upgraded from 3.6-rt to 3.8-rt. When the stall happened, disk I/O was no @@ -114,15 +114,15 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -49,6 +49,7 @@ - #include +@@ -50,6 +50,7 @@ #include + #include #include +#include #include "workqueue_internal.h" -@@ -1282,7 +1283,7 @@ static int try_to_grab_pending(struct wo +@@ -1283,7 +1284,7 @@ static int try_to_grab_pending(struct wo local_unlock_irqrestore(pendingb_lock, *flags); if (work_is_canceling(work)) return -ENOENT; diff --git a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch index 38acf9b18..9f605acdc 100644 --- a/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch +++ b/debian/patches/features/all/rt/work-simple-Simple-work-queue-implemenation.patch @@ -1,7 +1,7 @@ From: Daniel Wagner Date: Fri, 11 Jul 2014 15:26:11 +0200 Subject: work-simple: Simple work queue implemenation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Provides a framework for enqueuing callbacks from irq context PREEMPT_RT_FULL safe. The callbacks are executed in kthread context. diff --git a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch index a9023d9b0..7602e52dc 100644 --- a/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch +++ b/debian/patches/features/all/rt/workqueue-distangle-from-rq-lock.patch @@ -22,7 +22,7 @@ Cc: Jens Axboe Cc: Linus Torvalds Link: http://lkml.kernel.org/r/20110622174919.135236139@linutronix.de Signed-off-by: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz --- kernel/sched/core.c | 84 +++++++------------------------------------- @@ -84,7 +84,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 - - if (!task_on_rq_queued(p)) { - if (p->in_iowait) { -- delayacct_blkio_end(); +- delayacct_blkio_end(p); - atomic_dec(&rq->nr_iowait); - } - ttwu_activate(rq, p, ENQUEUE_WAKEUP | ENQUEUE_NOCLOCK); @@ -160,7 +160,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -844,43 +844,32 @@ static void wake_up_worker(struct worker +@@ -845,43 +845,32 @@ static void wake_up_worker(struct worker } /** @@ -215,7 +215,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 struct worker_pool *pool; /* -@@ -889,13 +878,15 @@ struct task_struct *wq_worker_sleeping(s +@@ -890,13 +879,15 @@ struct task_struct *wq_worker_sleeping(s * checking NOT_RUNNING. */ if (worker->flags & WORKER_NOT_RUNNING) @@ -235,7 +235,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4 /* * The counterpart of the following dec_and_test, implied mb, -@@ -909,9 +900,12 @@ struct task_struct *wq_worker_sleeping(s +@@ -910,9 +901,12 @@ struct task_struct *wq_worker_sleeping(s * lock is safe. */ if (atomic_dec_and_test(&pool->nr_running) && diff --git a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch index b86226d7f..d762f0d57 100644 --- a/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch +++ b/debian/patches/features/all/rt/workqueue-prevent-deadlock-stall.patch @@ -1,7 +1,7 @@ Subject: workqueue: Prevent deadlock/stall on RT From: Thomas Gleixner Date: Fri, 27 Jun 2014 16:24:52 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Austin reported a XFS deadlock/stall on RT where scheduled work gets never exececuted and tasks are waiting for each other for ever. @@ -68,7 +68,7 @@ Cc: Steven Rostedt * make sure to submit it to avoid deadlocks. --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -124,6 +124,11 @@ enum { +@@ -125,6 +125,11 @@ enum { * cpu or grabbing pool->lock is enough for read access. If * POOL_DISASSOCIATED is set, it's identical to L. * @@ -80,7 +80,7 @@ Cc: Steven Rostedt * A: pool->attach_mutex protected. * * PL: wq_pool_mutex protected. -@@ -431,6 +436,31 @@ static void workqueue_sysfs_unregister(s +@@ -432,6 +437,31 @@ static void workqueue_sysfs_unregister(s if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ else @@ -112,7 +112,7 @@ Cc: Steven Rostedt #ifdef CONFIG_DEBUG_OBJECTS_WORK static struct debug_obj_descr work_debug_descr; -@@ -837,10 +867,16 @@ static struct worker *first_idle_worker( +@@ -838,10 +868,16 @@ static struct worker *first_idle_worker( */ static void wake_up_worker(struct worker_pool *pool) { @@ -130,7 +130,7 @@ Cc: Steven Rostedt } /** -@@ -869,7 +905,7 @@ void wq_worker_running(struct task_struc +@@ -870,7 +906,7 @@ void wq_worker_running(struct task_struc */ void wq_worker_sleeping(struct task_struct *task) { @@ -139,7 +139,7 @@ Cc: Steven Rostedt struct worker_pool *pool; /* -@@ -886,26 +922,18 @@ void wq_worker_sleeping(struct task_stru +@@ -887,26 +923,18 @@ void wq_worker_sleeping(struct task_stru return; worker->sleeping = 1; @@ -169,7 +169,7 @@ Cc: Steven Rostedt } /** -@@ -1636,7 +1664,9 @@ static void worker_enter_idle(struct wor +@@ -1637,7 +1665,9 @@ static void worker_enter_idle(struct wor worker->last_active = jiffies; /* idle_list is LIFO */ @@ -179,7 +179,7 @@ Cc: Steven Rostedt if (too_many_workers(pool) && !timer_pending(&pool->idle_timer)) mod_timer(&pool->idle_timer, jiffies + IDLE_WORKER_TIMEOUT); -@@ -1669,7 +1699,9 @@ static void worker_leave_idle(struct wor +@@ -1670,7 +1700,9 @@ static void worker_leave_idle(struct wor return; worker_clr_flags(worker, WORKER_IDLE); pool->nr_idle--; @@ -189,7 +189,7 @@ Cc: Steven Rostedt } static struct worker *alloc_worker(int node) -@@ -1835,7 +1867,9 @@ static void destroy_worker(struct worker +@@ -1836,7 +1868,9 @@ static void destroy_worker(struct worker pool->nr_workers--; pool->nr_idle--; diff --git a/debian/patches/features/all/rt/workqueue-use-locallock.patch b/debian/patches/features/all/rt/workqueue-use-locallock.patch index b0bcd6696..6a7f46100 100644 --- a/debian/patches/features/all/rt/workqueue-use-locallock.patch +++ b/debian/patches/features/all/rt/workqueue-use-locallock.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use local irq lock instead of irq disable regions From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:42:26 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Use a local_irq_lock as a replacement for irq off regions. We keep the semantic of irq-off in regard to the pool->lock and remain preemptible. @@ -13,15 +13,15 @@ Signed-off-by: Thomas Gleixner --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -48,6 +48,7 @@ - #include +@@ -49,6 +49,7 @@ #include #include + #include +#include #include "workqueue_internal.h" -@@ -351,6 +352,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient +@@ -352,6 +353,8 @@ EXPORT_SYMBOL_GPL(system_power_efficient struct workqueue_struct *system_freezable_power_efficient_wq __read_mostly; EXPORT_SYMBOL_GPL(system_freezable_power_efficient_wq); @@ -30,7 +30,7 @@ Signed-off-by: Thomas Gleixner static int worker_thread(void *__worker); static void workqueue_sysfs_unregister(struct workqueue_struct *wq); -@@ -1104,9 +1107,11 @@ static void put_pwq_unlocked(struct pool +@@ -1105,9 +1108,11 @@ static void put_pwq_unlocked(struct pool * As both pwqs and pools are RCU protected, the * following lock operations are safe. */ @@ -44,7 +44,7 @@ Signed-off-by: Thomas Gleixner } } -@@ -1210,7 +1215,7 @@ static int try_to_grab_pending(struct wo +@@ -1211,7 +1216,7 @@ static int try_to_grab_pending(struct wo struct worker_pool *pool; struct pool_workqueue *pwq; @@ -53,7 +53,7 @@ Signed-off-by: Thomas Gleixner /* try to steal the timer if it exists */ if (is_dwork) { -@@ -1274,7 +1279,7 @@ static int try_to_grab_pending(struct wo +@@ -1275,7 +1280,7 @@ static int try_to_grab_pending(struct wo spin_unlock(&pool->lock); fail: rcu_read_unlock(); @@ -62,7 +62,7 @@ Signed-off-by: Thomas Gleixner if (work_is_canceling(work)) return -ENOENT; cpu_relax(); -@@ -1379,7 +1384,7 @@ static void __queue_work(int cpu, struct +@@ -1380,7 +1385,7 @@ static void __queue_work(int cpu, struct * queued or lose PENDING. Grabbing PENDING and queueing should * happen with IRQ disabled. */ @@ -71,7 +71,7 @@ Signed-off-by: Thomas Gleixner debug_work_activate(work); -@@ -1485,14 +1490,14 @@ bool queue_work_on(int cpu, struct workq +@@ -1486,14 +1491,14 @@ bool queue_work_on(int cpu, struct workq bool ret = false; unsigned long flags; @@ -88,7 +88,7 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(queue_work_on); -@@ -1501,8 +1506,11 @@ void delayed_work_timer_fn(unsigned long +@@ -1502,8 +1507,11 @@ void delayed_work_timer_fn(unsigned long { struct delayed_work *dwork = (struct delayed_work *)__data; @@ -100,7 +100,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(delayed_work_timer_fn); -@@ -1558,14 +1566,14 @@ bool queue_delayed_work_on(int cpu, stru +@@ -1559,14 +1567,14 @@ bool queue_delayed_work_on(int cpu, stru unsigned long flags; /* read the comment in __queue_work() */ @@ -117,7 +117,7 @@ Signed-off-by: Thomas Gleixner return ret; } EXPORT_SYMBOL(queue_delayed_work_on); -@@ -1600,7 +1608,7 @@ bool mod_delayed_work_on(int cpu, struct +@@ -1601,7 +1609,7 @@ bool mod_delayed_work_on(int cpu, struct if (likely(ret >= 0)) { __queue_delayed_work(cpu, wq, dwork, delay); @@ -126,7 +126,7 @@ Signed-off-by: Thomas Gleixner } /* -ENOENT from try_to_grab_pending() becomes %true */ -@@ -2950,7 +2958,7 @@ static bool __cancel_work_timer(struct w +@@ -2951,7 +2959,7 @@ static bool __cancel_work_timer(struct w /* tell other tasks trying to grab @work to back off */ mark_work_canceling(work); @@ -135,7 +135,7 @@ Signed-off-by: Thomas Gleixner /* * This allows canceling during early boot. We know that @work -@@ -3011,10 +3019,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); +@@ -3012,10 +3020,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); */ bool flush_delayed_work(struct delayed_work *dwork) { @@ -148,7 +148,7 @@ Signed-off-by: Thomas Gleixner return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3032,7 +3040,7 @@ static bool __cancel_work(struct work_st +@@ -3033,7 +3041,7 @@ static bool __cancel_work(struct work_st return false; set_work_pool_and_clear_pending(work, get_work_pool_id(work)); diff --git a/debian/patches/features/all/rt/workqueue-use-rcu.patch b/debian/patches/features/all/rt/workqueue-use-rcu.patch index ef8e02580..4e1d7d99a 100644 --- a/debian/patches/features/all/rt/workqueue-use-rcu.patch +++ b/debian/patches/features/all/rt/workqueue-use-rcu.patch @@ -1,7 +1,7 @@ Subject: workqueue: Use normal rcu From: Thomas Gleixner Date: Wed, 24 Jul 2013 15:26:54 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz There is no need for sched_rcu. The undocumented reason why sched_rcu is used is to avoid a few explicit rcu_read_lock()/unlock() pairs by @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/workqueue.c +++ b/kernel/workqueue.c -@@ -126,7 +126,7 @@ enum { +@@ -127,7 +127,7 @@ enum { * * PL: wq_pool_mutex protected. * @@ -24,7 +24,7 @@ Signed-off-by: Thomas Gleixner * * PW: wq_pool_mutex and wq->mutex protected for writes. Either for reads. * -@@ -135,7 +135,7 @@ enum { +@@ -136,7 +136,7 @@ enum { * * WQ: wq->mutex protected. * @@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner * * MD: wq_mayday_lock protected. */ -@@ -185,7 +185,7 @@ struct worker_pool { +@@ -186,7 +186,7 @@ struct worker_pool { atomic_t nr_running ____cacheline_aligned_in_smp; /* @@ -42,7 +42,7 @@ Signed-off-by: Thomas Gleixner * from get_work_pool(). */ struct rcu_head rcu; -@@ -214,7 +214,7 @@ struct pool_workqueue { +@@ -215,7 +215,7 @@ struct pool_workqueue { /* * Release of unbound pwq is punted to system_wq. See put_pwq() * and pwq_unbound_release_workfn() for details. pool_workqueue @@ -51,7 +51,7 @@ Signed-off-by: Thomas Gleixner * determined without grabbing wq->mutex. */ struct work_struct unbound_release_work; -@@ -358,20 +358,20 @@ static void workqueue_sysfs_unregister(s +@@ -359,20 +359,20 @@ static void workqueue_sysfs_unregister(s #include #define assert_rcu_or_pool_mutex() \ @@ -78,7 +78,7 @@ Signed-off-by: Thomas Gleixner #define for_each_cpu_worker_pool(pool, cpu) \ for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0]; \ -@@ -383,7 +383,7 @@ static void workqueue_sysfs_unregister(s +@@ -384,7 +384,7 @@ static void workqueue_sysfs_unregister(s * @pool: iteration cursor * @pi: integer used for iteration * @@ -87,7 +87,7 @@ Signed-off-by: Thomas Gleixner * locked. If the pool needs to be used beyond the locking in effect, the * caller is responsible for guaranteeing that the pool stays online. * -@@ -415,7 +415,7 @@ static void workqueue_sysfs_unregister(s +@@ -416,7 +416,7 @@ static void workqueue_sysfs_unregister(s * @pwq: iteration cursor * @wq: the target workqueue * @@ -96,7 +96,7 @@ Signed-off-by: Thomas Gleixner * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. * -@@ -551,7 +551,7 @@ static int worker_pool_assign_id(struct +@@ -552,7 +552,7 @@ static int worker_pool_assign_id(struct * @wq: the target workqueue * @node: the node ID * @@ -105,7 +105,7 @@ Signed-off-by: Thomas Gleixner * read locked. * If the pwq needs to be used beyond the locking in effect, the caller is * responsible for guaranteeing that the pwq stays online. -@@ -695,8 +695,8 @@ static struct pool_workqueue *get_work_p +@@ -696,8 +696,8 @@ static struct pool_workqueue *get_work_p * @work: the work item of interest * * Pools are created and destroyed under wq_pool_mutex, and allows read @@ -116,7 +116,7 @@ Signed-off-by: Thomas Gleixner * * All fields of the returned pool are accessible as long as the above * mentioned locking is in effect. If the returned pool needs to be used -@@ -1101,7 +1101,7 @@ static void put_pwq_unlocked(struct pool +@@ -1102,7 +1102,7 @@ static void put_pwq_unlocked(struct pool { if (pwq) { /* @@ -125,7 +125,7 @@ Signed-off-by: Thomas Gleixner * following lock operations are safe. */ spin_lock_irq(&pwq->pool->lock); -@@ -1229,6 +1229,7 @@ static int try_to_grab_pending(struct wo +@@ -1230,6 +1230,7 @@ static int try_to_grab_pending(struct wo if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) return 0; @@ -133,7 +133,7 @@ Signed-off-by: Thomas Gleixner /* * The queueing is in progress, or it is already queued. Try to * steal it from ->worklist without clearing WORK_STRUCT_PENDING. -@@ -1267,10 +1268,12 @@ static int try_to_grab_pending(struct wo +@@ -1268,10 +1269,12 @@ static int try_to_grab_pending(struct wo set_work_pool_and_keep_pending(work, pool->id); spin_unlock(&pool->lock); @@ -146,7 +146,7 @@ Signed-off-by: Thomas Gleixner local_irq_restore(*flags); if (work_is_canceling(work)) return -ENOENT; -@@ -1384,6 +1387,7 @@ static void __queue_work(int cpu, struct +@@ -1385,6 +1388,7 @@ static void __queue_work(int cpu, struct if (unlikely(wq->flags & __WQ_DRAINING) && WARN_ON_ONCE(!is_chained_work(wq))) return; @@ -154,7 +154,7 @@ Signed-off-by: Thomas Gleixner retry: if (req_cpu == WORK_CPU_UNBOUND) cpu = wq_select_unbound_cpu(raw_smp_processor_id()); -@@ -1440,10 +1444,8 @@ static void __queue_work(int cpu, struct +@@ -1441,10 +1445,8 @@ static void __queue_work(int cpu, struct /* pwq determined, queue */ trace_workqueue_queue_work(req_cpu, pwq, work); @@ -167,7 +167,7 @@ Signed-off-by: Thomas Gleixner pwq->nr_in_flight[pwq->work_color]++; work_flags = work_color_to_flags(pwq->work_color); -@@ -1461,7 +1463,9 @@ static void __queue_work(int cpu, struct +@@ -1462,7 +1464,9 @@ static void __queue_work(int cpu, struct insert_work(pwq, work, worklist, work_flags); @@ -177,7 +177,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -2814,14 +2818,14 @@ static bool start_flush_work(struct work +@@ -2815,14 +2819,14 @@ static bool start_flush_work(struct work might_sleep(); @@ -195,7 +195,7 @@ Signed-off-by: Thomas Gleixner /* see the comment in try_to_grab_pending() with the same code */ pwq = get_work_pwq(work); if (pwq) { -@@ -2852,10 +2856,11 @@ static bool start_flush_work(struct work +@@ -2853,10 +2857,11 @@ static bool start_flush_work(struct work lock_map_acquire(&pwq->wq->lockdep_map); lock_map_release(&pwq->wq->lockdep_map); } @@ -208,7 +208,7 @@ Signed-off-by: Thomas Gleixner return false; } -@@ -3283,7 +3288,7 @@ static void rcu_free_pool(struct rcu_hea +@@ -3284,7 +3289,7 @@ static void rcu_free_pool(struct rcu_hea * put_unbound_pool - put a worker_pool * @pool: worker_pool to put * @@ -217,7 +217,7 @@ Signed-off-by: Thomas Gleixner * safe manner. get_unbound_pool() calls this function on its failure path * and this function should be able to release pools which went through, * successfully or not, init_worker_pool(). -@@ -3337,8 +3342,8 @@ static void put_unbound_pool(struct work +@@ -3338,8 +3343,8 @@ static void put_unbound_pool(struct work del_timer_sync(&pool->idle_timer); del_timer_sync(&pool->mayday_timer); @@ -228,7 +228,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -3445,14 +3450,14 @@ static void pwq_unbound_release_workfn(s +@@ -3446,14 +3451,14 @@ static void pwq_unbound_release_workfn(s put_unbound_pool(pool); mutex_unlock(&wq_pool_mutex); @@ -245,7 +245,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -4127,7 +4132,7 @@ void destroy_workqueue(struct workqueue_ +@@ -4128,7 +4133,7 @@ void destroy_workqueue(struct workqueue_ * The base ref is never dropped on per-cpu pwqs. Directly * schedule RCU free. */ @@ -254,7 +254,7 @@ Signed-off-by: Thomas Gleixner } else { /* * We're the sole accessor of @wq at this point. Directly -@@ -4221,7 +4226,8 @@ bool workqueue_congested(int cpu, struct +@@ -4222,7 +4227,8 @@ bool workqueue_congested(int cpu, struct struct pool_workqueue *pwq; bool ret; @@ -264,7 +264,7 @@ Signed-off-by: Thomas Gleixner if (cpu == WORK_CPU_UNBOUND) cpu = smp_processor_id(); -@@ -4232,7 +4238,8 @@ bool workqueue_congested(int cpu, struct +@@ -4233,7 +4239,8 @@ bool workqueue_congested(int cpu, struct pwq = unbound_pwq_by_node(wq, cpu_to_node(cpu)); ret = !list_empty(&pwq->delayed_works); @@ -274,7 +274,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -4258,15 +4265,15 @@ unsigned int work_busy(struct work_struc +@@ -4259,15 +4266,15 @@ unsigned int work_busy(struct work_struc if (work_pending(work)) ret |= WORK_BUSY_PENDING; @@ -294,7 +294,7 @@ Signed-off-by: Thomas Gleixner return ret; } -@@ -4455,7 +4462,7 @@ void show_workqueue_state(void) +@@ -4456,7 +4463,7 @@ void show_workqueue_state(void) unsigned long flags; int pi; @@ -303,8 +303,8 @@ Signed-off-by: Thomas Gleixner pr_info("Showing busy workqueues and worker pools:\n"); -@@ -4508,7 +4515,7 @@ void show_workqueue_state(void) - spin_unlock_irqrestore(&pool->lock, flags); +@@ -4521,7 +4528,7 @@ void show_workqueue_state(void) + touch_nmi_watchdog(); } - rcu_read_unlock_sched(); @@ -312,7 +312,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -4869,16 +4876,16 @@ bool freeze_workqueues_busy(void) +@@ -4882,16 +4889,16 @@ bool freeze_workqueues_busy(void) * nr_active is monotonically decreasing. It's safe * to peek without lock. */ @@ -332,7 +332,7 @@ Signed-off-by: Thomas Gleixner } out_unlock: mutex_unlock(&wq_pool_mutex); -@@ -5068,7 +5075,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5081,7 +5088,8 @@ static ssize_t wq_pool_ids_show(struct d const char *delim = ""; int node, written = 0; @@ -342,7 +342,7 @@ Signed-off-by: Thomas Gleixner for_each_node(node) { written += scnprintf(buf + written, PAGE_SIZE - written, "%s%d:%d", delim, node, -@@ -5076,7 +5084,8 @@ static ssize_t wq_pool_ids_show(struct d +@@ -5089,7 +5097,8 @@ static ssize_t wq_pool_ids_show(struct d delim = " "; } written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); diff --git a/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch index 371207c30..c49fb55d5 100644 --- a/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch +++ b/debian/patches/features/all/rt/x86-UV-raw_spinlock-conversion.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 2 Nov 2014 08:31:37 +0100 Subject: x86: UV: raw_spinlock conversion -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Shrug. Lots of hobbyists have a beast in their basement, right? diff --git a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch index d197e32b6..0c0b5a4d5 100644 --- a/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches/features/all/rt/x86-crypto-reduce-preempt-disabled-regions.patch @@ -1,7 +1,7 @@ Subject: x86: crypto: Reduce preempt disabled regions From: Peter Zijlstra Date: Mon, 14 Nov 2011 18:19:27 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Restrict the preempt disabled regions to the actual floating point operations and enable preemption for the administrative actions. diff --git a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch index 8ef0846cf..6471cba81 100644 --- a/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches/features/all/rt/x86-highmem-add-a-already-used-pte-check.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Mar 2013 17:09:55 +0100 Subject: x86/highmem: Add a "already used pte" check -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch index 69a87af8a..20263ac40 100644 --- a/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch +++ b/debian/patches/features/all/rt/x86-io-apic-migra-no-unmask.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:29:27 -0500 Subject: x86/ioapic: Do not unmask io_apic when interrupt is in progress -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz With threaded interrupts we might see an interrupt in progress on migration. Do not unmask it when this is the case. diff --git a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch index 7edc34b36..074a3cb3f 100644 --- a/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches/features/all/rt/x86-kvm-require-const-tsc-for-rt.patch @@ -1,7 +1,7 @@ Subject: x86: kvm Require const tsc for RT From: Thomas Gleixner Date: Sun, 06 Nov 2011 12:26:18 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds diff --git a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch index 51efec51f..4187a8939 100644 --- a/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch +++ b/debian/patches/features/all/rt/x86-mce-timer-hrtimer.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 13 Dec 2010 16:33:39 +0100 Subject: x86: Convert mce timer to hrtimer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz mce_timer is started in atomic contexts of cpu bringup. This results in might_sleep() warnings on RT. Convert mce_timer to a hrtimer to @@ -144,7 +144,7 @@ fold in: mce_start_timer(t); } -@@ -2270,7 +2268,7 @@ static int mce_cpu_dead(unsigned int cpu +@@ -2275,7 +2273,7 @@ static int mce_cpu_dead(unsigned int cpu static int mce_cpu_online(unsigned int cpu) { @@ -153,7 +153,7 @@ fold in: int ret; mce_device_create(cpu); -@@ -2287,10 +2285,10 @@ static int mce_cpu_online(unsigned int c +@@ -2292,10 +2290,10 @@ static int mce_cpu_online(unsigned int c static int mce_cpu_pre_down(unsigned int cpu) { diff --git a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch index 6217505f3..d8b4b1b9a 100644 --- a/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch +++ b/debian/patches/features/all/rt/x86-mce-use-swait-queue-for-mce-wakeups.patch @@ -1,7 +1,7 @@ Subject: x86/mce: use swait queue for mce wakeups From: Steven Rostedt Date: Fri, 27 Feb 2015 15:20:37 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz We had a customer report a lockup on a 3.0-rt kernel that had the following backtrace: diff --git a/debian/patches/features/all/rt/x86-preempt-lazy.patch b/debian/patches/features/all/rt/x86-preempt-lazy.patch index cd1c7ee71..1ec18b5de 100644 --- a/debian/patches/features/all/rt/x86-preempt-lazy.patch +++ b/debian/patches/features/all/rt/x86-preempt-lazy.patch @@ -1,7 +1,7 @@ Subject: x86: Support for lazy preemption From: Thomas Gleixner Date: Thu, 01 Nov 2012 11:03:47 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Implement the x86 pieces for lazy preempt. @@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -169,6 +169,7 @@ config X86 +@@ -170,6 +170,7 @@ config X86 select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP @@ -48,7 +48,7 @@ Signed-off-by: Thomas Gleixner #ifdef ARCH_RT_DELAYS_SIGNAL_SEND --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S -@@ -338,8 +338,25 @@ END(ret_from_exception) +@@ -350,8 +350,25 @@ END(ret_from_exception) ENTRY(resume_kernel) DISABLE_INTERRUPTS(CLBR_ANY) .Lneed_resched: @@ -76,7 +76,7 @@ Signed-off-by: Thomas Gleixner call preempt_schedule_irq --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -761,7 +761,23 @@ retint_kernel: +@@ -778,7 +778,23 @@ GLOBAL(swapgs_restore_regs_and_return_to bt $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f 0: cmpl $0, PER_CPU_VAR(__preempt_count) diff --git a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch index 90f602472..b83929b78 100644 --- a/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches/features/all/rt/x86-signal-delay-calling-signals-on-32bit.patch @@ -1,7 +1,7 @@ From: Yang Shi Date: Thu, 10 Dec 2015 10:58:51 -0800 Subject: x86/signal: delay calling signals on 32bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch index bcef17d2b..32b2f850e 100644 --- a/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches/features/all/rt/x86-stackprot-no-random-on-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 16 Dec 2010 14:25:18 +0100 Subject: x86: stackprotector: Avoid random pool on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz CPU bringup calls into the random pool to initialize the stack canary. During boot that works nicely even on RT as the might sleep diff --git a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch index bd1f6cbb0..8ecda02a4 100644 --- a/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch +++ b/debian/patches/features/all/rt/x86-use-gen-rwsem-spinlocks-rt.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 26 Jul 2009 02:21:32 +0200 Subject: x86: Use generic rwsem_spinlocks on -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -255,8 +255,11 @@ config ARCH_MAY_HAVE_PC_FDC +@@ -256,8 +256,11 @@ config ARCH_MAY_HAVE_PC_FDC def_bool y depends on ISA_DMA_API diff --git a/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch b/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch index ee91ae42f..e90baa5b4 100644 --- a/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch +++ b/debian/patches/features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Oct 2017 14:38:52 +0200 Subject: [PATCH] xen/9pfs: don't inclide rwlock.h directly. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.15-rt11.tar.xz rwlock.h should not be included directly. Instead linux/splinlock.h should be included. One thing it does is to break the RT build. diff --git a/debian/patches/series-rt b/debian/patches/series-rt index 31c5232fb..aea1b2e45 100644 --- a/debian/patches/series-rt +++ b/debian/patches/series-rt @@ -15,10 +15,6 @@ features/all/rt/rcu-Suppress-lockdep-false-positive-boost_mtx-compla.patch # Stuff broken upstream, patches submitted ############################################################ -# Timer/NOHZ fixups -features/all/rt/0002-nohz-Prevent-erroneous-tick-stop-invocations.patch -features/all/rt/0004-timerqueue-Document-return-values-of-timerqueue_add-.patch - # soft hrtimer patches (v4) features/all/rt/0001-timers-Use-static-keys-for-migrate_enable-nohz_activ.patch features/all/rt/0002-hrtimer-Correct-blantanly-wrong-comment.patch @@ -87,6 +83,7 @@ features/all/rt/greybus-audio-don-t-inclide-rwlock.h-directly.patch features/all/rt/xen-9pfs-don-t-inclide-rwlock.h-directly.patch features/all/rt/tty-goldfish-Enable-earlycon-only-if-built-in.patch features/all/rt/drm-i915-properly-init-lockdep-class.patch +features/all/rt/timerqueue-Document-return-values-of-timerqueue_add-.patch # SPARC part of erly printk consolidation features/all/rt/sparc64-use-generic-rwsem-spinlocks-rt.patch @@ -339,6 +336,7 @@ features/all/rt/panic-disable-random-on-rt.patch # TIMERS features/all/rt/timers-prepare-for-full-preemption.patch features/all/rt/timer-delay-waking-softirqs-from-the-jiffy-tick.patch +features/all/rt/nohz-Prevent-erroneous-tick-stop-invocations.patch # KVM require constant freq TSC (smp function call -> cpufreq) features/all/rt/x86-kvm-require-const-tsc-for-rt.patch From 4fae92a1d551197505db8ea730093cb0b755bbde Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 28 Jan 2018 19:37:24 +0100 Subject: [PATCH 10/11] nfsd: auth: Fix gid sorting when rootsquash enabled (CVE-2018-1000028) --- debian/changelog | 1 + ...-gid-sorting-when-rootsquash-enabled.patch | 46 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 48 insertions(+) create mode 100644 debian/patches/bugfix/all/nfsd-auth-Fix-gid-sorting-when-rootsquash-enabled.patch diff --git a/debian/changelog b/debian/changelog index 6004cb1da..b3c7fdd37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -201,6 +201,7 @@ linux (4.14.15-1) UNRELEASED; urgency=medium * loop: fix concurrent lo_open/lo_release (CVE-2018-5344) * Revert "module: Add retpoline tag to VERMAGIC" * [rt] Update to 4.14.15-rt11 + * nfsd: auth: Fix gid sorting when rootsquash enabled (CVE-2018-1000028) [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 diff --git a/debian/patches/bugfix/all/nfsd-auth-Fix-gid-sorting-when-rootsquash-enabled.patch b/debian/patches/bugfix/all/nfsd-auth-Fix-gid-sorting-when-rootsquash-enabled.patch new file mode 100644 index 000000000..c2e3cc858 --- /dev/null +++ b/debian/patches/bugfix/all/nfsd-auth-Fix-gid-sorting-when-rootsquash-enabled.patch @@ -0,0 +1,46 @@ +From: Ben Hutchings +Date: Mon, 22 Jan 2018 20:11:06 +0000 +Subject: nfsd: auth: Fix gid sorting when rootsquash enabled +Origin: https://git.kernel.org/linus/1995266727fa8143897e89b55f5d3c79aa828420 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-1000028 + +Commit bdcf0a423ea1 ("kernel: make groups_sort calling a responsibility +group_info allocators") appears to break nfsd rootsquash in a pretty +major way. + +It adds a call to groups_sort() inside the loop that copies/squashes +gids, which means the valid gids are sorted along with the following +garbage. The net result is that the highest numbered valid gids are +replaced with any lower-valued garbage gids, possibly including 0. + +We should sort only once, after filling in all the gids. + +Fixes: bdcf0a423ea1 ("kernel: make groups_sort calling a responsibility ...") +Signed-off-by: Ben Hutchings +Acked-by: J. Bruce Fields +Signed-off-by: Linus Torvalds +--- + fs/nfsd/auth.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c +index f650e475d8f0..fdf2aad73470 100644 +--- a/fs/nfsd/auth.c ++++ b/fs/nfsd/auth.c +@@ -60,10 +60,10 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp) + gi->gid[i] = exp->ex_anon_gid; + else + gi->gid[i] = rqgi->gid[i]; +- +- /* Each thread allocates its own gi, no race */ +- groups_sort(gi); + } ++ ++ /* Each thread allocates its own gi, no race */ ++ groups_sort(gi); + } else { + gi = get_group_info(rqgi); + } +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index dc77794c0..beda545ab 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -124,6 +124,7 @@ bugfix/all/media-dvb-usb-v2-lmedm04-Improve-logic-checking-of-w.patch bugfix/all/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_.patch bugfix/all/media-hdpvr-fix-an-error-handling-path-in-hdpvr_prob.patch bugfix/all/loop-fix-concurrent-lo_open-lo_release.patch +bugfix/all/nfsd-auth-Fix-gid-sorting-when-rootsquash-enabled.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch From f01c4e1f91b0d0ac9993a72cc5b035ac7f1f05d5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 28 Jan 2018 18:53:45 +0000 Subject: [PATCH 11/11] usbip: Reduce USBIP_VHCI_HC_PORTS to 15, the maximum allowed for SuperSpeed hubs Closes: #878866 The limits in Kconfig are simply wrong. --- debian/changelog | 2 ++ debian/config/kernelarch-x86/config | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b3c7fdd37..829967e4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -205,6 +205,8 @@ linux (4.14.15-1) UNRELEASED; urgency=medium [ Ben Hutchings ] * bpf: Avoid ABI change in 4.14.14 + * usbip: Reduce USBIP_VHCI_HC_PORTS to 15, the maximum allowed for SuperSpeed + hubs (Closes: #878866) [ Riku Voipio ] * [arm64] build in reset drivers diff --git a/debian/config/kernelarch-x86/config b/debian/config/kernelarch-x86/config index 94215d3df..ad810bc6a 100644 --- a/debian/config/kernelarch-x86/config +++ b/debian/config/kernelarch-x86/config @@ -1728,7 +1728,7 @@ CONFIG_USB_SL811_CS=m ## CONFIG_USBIP_CORE=m CONFIG_USBIP_VHCI_HCD=m -CONFIG_USBIP_VHCI_HC_PORTS=31 +CONFIG_USBIP_VHCI_HC_PORTS=15 CONFIG_USBIP_VHCI_NR_HCS=8 CONFIG_USBIP_HOST=m # CONFIG_USBIP_DEBUG is not set