From 41c5be2e735124082c56ff5ee14c876dc8f5099a Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 9 Feb 2016 20:49:04 +0000 Subject: [PATCH 01/35] SCSI: Fix NULL pointer dereference in runtime PM (really closes: #801925) --- debian/changelog | 6 ++ ...ll-pointer-dereference-in-runtime-pm.patch | 82 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 89 insertions(+) create mode 100644 debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch diff --git a/debian/changelog b/debian/changelog index 745df9ed1..5cdd88713 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linux (4.3.5-2) UNRELEASED; urgency=medium + + * SCSI: Fix NULL pointer dereference in runtime PM (really closes: #801925) + + -- Ben Hutchings Tue, 09 Feb 2016 20:48:32 +0000 + linux (4.3.5-1) unstable; urgency=medium * New upstream stable update: diff --git a/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch b/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch new file mode 100644 index 000000000..640e8545b --- /dev/null +++ b/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch @@ -0,0 +1,82 @@ +From: Ken Xue +Date: Tue, 1 Dec 2015 14:45:46 +0800 +Subject: SCSI: Fix NULL pointer dereference in runtime PM +Origin: https://git.kernel.org/linus/4fd41a8552afc01054d9d9fc7f1a63c324867d27 +Bug: https://bugzilla.kernel.org/show_bug.cgi?id=101371 +Bug-Debian: https://bugs.debian.org/801925 + +The routines in scsi_pm.c assume that if a runtime-PM callback is +invoked for a SCSI device, it can only mean that the device's driver +has asked the block layer to handle the runtime power management (by +calling blk_pm_runtime_init(), which among other things sets q->dev). + +However, this assumption turns out to be wrong for things like the ses +driver. Normally ses devices are not allowed to do runtime PM, but +userspace can override this setting. If this happens, the kernel gets +a NULL pointer dereference when blk_post_runtime_resume() tries to use +the uninitialized q->dev pointer. + +This patch fixes the problem by checking q->dev in block layer before +handle runtime PM. Since ses doesn't define any PM callbacks and call +blk_pm_runtime_init(), the crash won't occur. + +This fixes Bugzilla #101371. +https://bugzilla.kernel.org/show_bug.cgi?id=101371 + +More discussion can be found from below link. +http://marc.info/?l=linux-scsi&m=144163730531875&w=2 + +Signed-off-by: Ken Xue +Acked-by: Alan Stern +Cc: Xiangliang Yu +Cc: James E.J. Bottomley +Cc: Jens Axboe +Cc: Michael Terry +Cc: stable@vger.kernel.org +Signed-off-by: Jens Axboe +--- + block/blk-core.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/block/blk-core.c ++++ b/block/blk-core.c +@@ -3280,6 +3280,9 @@ int blk_pre_runtime_suspend(struct reque + { + int ret = 0; + ++ if (!q->dev) ++ return ret; ++ + spin_lock_irq(q->queue_lock); + if (q->nr_pending) { + ret = -EBUSY; +@@ -3307,6 +3310,9 @@ EXPORT_SYMBOL(blk_pre_runtime_suspend); + */ + void blk_post_runtime_suspend(struct request_queue *q, int err) + { ++ if (!q->dev) ++ return; ++ + spin_lock_irq(q->queue_lock); + if (!err) { + q->rpm_status = RPM_SUSPENDED; +@@ -3331,6 +3337,9 @@ EXPORT_SYMBOL(blk_post_runtime_suspend); + */ + void blk_pre_runtime_resume(struct request_queue *q) + { ++ if (!q->dev) ++ return; ++ + spin_lock_irq(q->queue_lock); + q->rpm_status = RPM_RESUMING; + spin_unlock_irq(q->queue_lock); +@@ -3353,6 +3362,9 @@ EXPORT_SYMBOL(blk_pre_runtime_resume); + */ + void blk_post_runtime_resume(struct request_queue *q, int err) + { ++ if (!q->dev) ++ return; ++ + spin_lock_irq(q->queue_lock); + if (!err) { + q->rpm_status = RPM_ACTIVE; diff --git a/debian/patches/series b/debian/patches/series index 48392ef06..8d529f836 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -142,3 +142,4 @@ bugfix/all/rt2x00-fix-monitor-mode-regression.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/fix-abi-changes-for-cve-2013-4312-fix.patch features/sparc/hwrng-n2-attach-on-t5-m5-t7-m7-sparc-cpus.patch +bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch From 301363c2d3525bda79e51d342a17183e5c411209 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 12 Feb 2016 23:32:49 +0000 Subject: [PATCH 02/35] Revert "SCSI: Fix NULL pointer dereference in runtime PM (really closes: #801925)" This reverts commit 41c5be2e735124082c56ff5ee14c876dc8f5099a. The patch it adds is already in 4.4 and this will allow for a clean merge from master. --- debian/changelog | 6 -- ...ll-pointer-dereference-in-runtime-pm.patch | 82 ------------------- debian/patches/series | 1 - 3 files changed, 89 deletions(-) delete mode 100644 debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch diff --git a/debian/changelog b/debian/changelog index 5cdd88713..745df9ed1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -linux (4.3.5-2) UNRELEASED; urgency=medium - - * SCSI: Fix NULL pointer dereference in runtime PM (really closes: #801925) - - -- Ben Hutchings Tue, 09 Feb 2016 20:48:32 +0000 - linux (4.3.5-1) unstable; urgency=medium * New upstream stable update: diff --git a/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch b/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch deleted file mode 100644 index 640e8545b..000000000 --- a/debian/patches/bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Ken Xue -Date: Tue, 1 Dec 2015 14:45:46 +0800 -Subject: SCSI: Fix NULL pointer dereference in runtime PM -Origin: https://git.kernel.org/linus/4fd41a8552afc01054d9d9fc7f1a63c324867d27 -Bug: https://bugzilla.kernel.org/show_bug.cgi?id=101371 -Bug-Debian: https://bugs.debian.org/801925 - -The routines in scsi_pm.c assume that if a runtime-PM callback is -invoked for a SCSI device, it can only mean that the device's driver -has asked the block layer to handle the runtime power management (by -calling blk_pm_runtime_init(), which among other things sets q->dev). - -However, this assumption turns out to be wrong for things like the ses -driver. Normally ses devices are not allowed to do runtime PM, but -userspace can override this setting. If this happens, the kernel gets -a NULL pointer dereference when blk_post_runtime_resume() tries to use -the uninitialized q->dev pointer. - -This patch fixes the problem by checking q->dev in block layer before -handle runtime PM. Since ses doesn't define any PM callbacks and call -blk_pm_runtime_init(), the crash won't occur. - -This fixes Bugzilla #101371. -https://bugzilla.kernel.org/show_bug.cgi?id=101371 - -More discussion can be found from below link. -http://marc.info/?l=linux-scsi&m=144163730531875&w=2 - -Signed-off-by: Ken Xue -Acked-by: Alan Stern -Cc: Xiangliang Yu -Cc: James E.J. Bottomley -Cc: Jens Axboe -Cc: Michael Terry -Cc: stable@vger.kernel.org -Signed-off-by: Jens Axboe ---- - block/blk-core.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/block/blk-core.c -+++ b/block/blk-core.c -@@ -3280,6 +3280,9 @@ int blk_pre_runtime_suspend(struct reque - { - int ret = 0; - -+ if (!q->dev) -+ return ret; -+ - spin_lock_irq(q->queue_lock); - if (q->nr_pending) { - ret = -EBUSY; -@@ -3307,6 +3310,9 @@ EXPORT_SYMBOL(blk_pre_runtime_suspend); - */ - void blk_post_runtime_suspend(struct request_queue *q, int err) - { -+ if (!q->dev) -+ return; -+ - spin_lock_irq(q->queue_lock); - if (!err) { - q->rpm_status = RPM_SUSPENDED; -@@ -3331,6 +3337,9 @@ EXPORT_SYMBOL(blk_post_runtime_suspend); - */ - void blk_pre_runtime_resume(struct request_queue *q) - { -+ if (!q->dev) -+ return; -+ - spin_lock_irq(q->queue_lock); - q->rpm_status = RPM_RESUMING; - spin_unlock_irq(q->queue_lock); -@@ -3353,6 +3362,9 @@ EXPORT_SYMBOL(blk_pre_runtime_resume); - */ - void blk_post_runtime_resume(struct request_queue *q, int err) - { -+ if (!q->dev) -+ return; -+ - spin_lock_irq(q->queue_lock); - if (!err) { - q->rpm_status = RPM_ACTIVE; diff --git a/debian/patches/series b/debian/patches/series index 8d529f836..48392ef06 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -142,4 +142,3 @@ bugfix/all/rt2x00-fix-monitor-mode-regression.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/fix-abi-changes-for-cve-2013-4312-fix.patch features/sparc/hwrng-n2-attach-on-t5-m5-t7-m7-sparc-cpus.patch -bugfix/all/scsi-fix-null-pointer-dereference-in-runtime-pm.patch From 95ece6ebc636fc253a4996642421e22a52988e0e Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 12 Feb 2016 23:34:37 +0000 Subject: [PATCH 03/35] iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) --- debian/changelog | 6 +++ ...correctly-returning-error-on-success.patch | 38 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 45 insertions(+) create mode 100644 debian/patches/bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch diff --git a/debian/changelog b/debian/changelog index af24749ae..1fbd1b883 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +linux (4.4.1-1) UNRELEASED; urgency=medium + + * iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) + + -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 + linux (4.4.1-1~exp1) experimental; urgency=medium * New upstream stable update: diff --git a/debian/patches/bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch b/debian/patches/bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch new file mode 100644 index 000000000..002fb6052 --- /dev/null +++ b/debian/patches/bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch @@ -0,0 +1,38 @@ +From: Hariprasad S +Date: Fri, 11 Dec 2015 13:59:17 +0530 +Subject: iw_cxgb3: Fix incorrectly returning error on success +Origin: https://git.kernel.org/linus/67f1aee6f45059fd6b0f5b0ecb2c97ad0451f6b3 + +The cxgb3_*_send() functions return NET_XMIT_ values, which are +positive integers values. So don't treat positive return values +as an error. + +Signed-off-by: Steve Wise +Signed-off-by: Hariprasad Shenai +Signed-off-by: Doug Ledford +--- + drivers/infiniband/hw/cxgb3/iwch_cm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c +index cb78b1e9bcd9..f504ba73e5dc 100644 +--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c ++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c +@@ -149,7 +149,7 @@ static int iwch_l2t_send(struct t3cdev *tdev, struct sk_buff *skb, struct l2t_en + error = l2t_send(tdev, skb, l2e); + if (error < 0) + kfree_skb(skb); +- return error; ++ return error < 0 ? error : 0; + } + + int iwch_cxgb3_ofld_send(struct t3cdev *tdev, struct sk_buff *skb) +@@ -165,7 +165,7 @@ int iwch_cxgb3_ofld_send(struct t3cdev *tdev, struct sk_buff *skb) + error = cxgb3_ofld_send(tdev, skb); + if (error < 0) + kfree_skb(skb); +- return error; ++ return error < 0 ? error : 0; + } + + static void release_tid(struct t3cdev *tdev, u32 hwtid, struct sk_buff *skb) diff --git a/debian/patches/series b/debian/patches/series index d6a5a28f4..854d9ace2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -117,3 +117,4 @@ bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch +bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch From 1c28b9c3ed679bb8f46bd9ff0449bee8fafe0869 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 12 Feb 2016 23:43:07 +0000 Subject: [PATCH 04/35] fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() (CVE-2016-0617) Fixes a regression in 4.3. --- debian/changelog | 2 + ...de.c-fix-bugs-in-hugetlb_vmtruncate_.patch | 83 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 86 insertions(+) create mode 100644 debian/patches/bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch diff --git a/debian/changelog b/debian/changelog index 1fbd1b883..592e06bcc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) + * fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() (CVE-2016-0617) + (regression in 4.3) -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 diff --git a/debian/patches/bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch b/debian/patches/bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch new file mode 100644 index 000000000..c900df8b9 --- /dev/null +++ b/debian/patches/bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch @@ -0,0 +1,83 @@ +From: Mike Kravetz +Date: Fri, 15 Jan 2016 16:57:37 -0800 +Subject: fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() +Origin: https://git.kernel.org/linus/9aacdd354d197ad64685941b36d28ea20ab88757 + +Hillf Danton noticed bugs in the hugetlb_vmtruncate_list routine. The +argument end is of type pgoff_t. It was being converted to a vaddr +offset and passed to unmap_hugepage_range. However, end was also being +used as an argument to the vma_interval_tree_foreach controlling loop. +In addition, the conversion of end to vaddr offset was incorrect. + +hugetlb_vmtruncate_list is called as part of a file truncate or +fallocate hole punch operation. + +When truncating a hugetlbfs file, this bug could prevent some pages from +being unmapped. This is possible if there are multiple vmas mapping the +file, and there is a sufficiently sized hole between the mappings. The +size of the hole between two vmas (A,B) must be such that the starting +virtual address of B is greater than (ending virtual address of A << +PAGE_SHIFT). In this case, the pages in B would not be unmapped. If +pages are not properly unmapped during truncate, the following BUG is +hit: + + kernel BUG at fs/hugetlbfs/inode.c:428! + +In the fallocate hole punch case, this bug could prevent pages from +being unmapped as in the truncate case. However, for hole punch the +result is that unmapped pages will not be removed during the operation. +For hole punch, it is also possible that more pages than desired will be +unmapped. This unnecessary unmapping will cause page faults to +reestablish the mappings on subsequent page access. + +Fixes: 1bfad99ab (" hugetlbfs: hugetlb_vmtruncate_list() needs to take a range")Reported-by: Hillf Danton +Signed-off-by: Mike Kravetz +Cc: Hugh Dickins +Cc: Naoya Horiguchi +Cc: Davidlohr Bueso +Cc: Dave Hansen +Cc: [4.3] +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + fs/hugetlbfs/inode.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c +index bbc333b01ca3..9c07d2d754c9 100644 +--- a/fs/hugetlbfs/inode.c ++++ b/fs/hugetlbfs/inode.c +@@ -463,6 +463,7 @@ hugetlb_vmdelete_list(struct rb_root *root, pgoff_t start, pgoff_t end) + */ + vma_interval_tree_foreach(vma, root, start, end ? end : ULONG_MAX) { + unsigned long v_offset; ++ unsigned long v_end; + + /* + * Can the expression below overflow on 32-bit arches? +@@ -475,15 +476,17 @@ hugetlb_vmdelete_list(struct rb_root *root, pgoff_t start, pgoff_t end) + else + v_offset = 0; + +- if (end) { +- end = ((end - start) << PAGE_SHIFT) + +- vma->vm_start + v_offset; +- if (end > vma->vm_end) +- end = vma->vm_end; +- } else +- end = vma->vm_end; ++ if (!end) ++ v_end = vma->vm_end; ++ else { ++ v_end = ((end - vma->vm_pgoff) << PAGE_SHIFT) ++ + vma->vm_start; ++ if (v_end > vma->vm_end) ++ v_end = vma->vm_end; ++ } + +- unmap_hugepage_range(vma, vma->vm_start + v_offset, end, NULL); ++ unmap_hugepage_range(vma, vma->vm_start + v_offset, v_end, ++ NULL); + } + } + diff --git a/debian/patches/series b/debian/patches/series index 854d9ace2..67785b41d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -118,3 +118,4 @@ bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.pat bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch +bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch From 83fd76229dc4858d38336f994a032a2f317dc86d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 13 Feb 2016 00:03:31 +0000 Subject: [PATCH 05/35] af_unix: Guard against other == sk in unix_dgram_sendmsg (regression in 4.2.6-2) --- debian/changelog | 2 + ...ainst-other-sk-in-unix_dgram_sendmsg.patch | 40 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 43 insertions(+) create mode 100644 debian/patches/bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch diff --git a/debian/changelog b/debian/changelog index 592e06bcc..18a50f865 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) * fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() (CVE-2016-0617) (regression in 4.3) + * af_unix: Guard against other == sk in unix_dgram_sendmsg + (regression in 4.2.6-2) -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 diff --git a/debian/patches/bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch b/debian/patches/bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch new file mode 100644 index 000000000..c61eaf6be --- /dev/null +++ b/debian/patches/bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch @@ -0,0 +1,40 @@ +From: Rainer Weikusat +Date: Thu, 11 Feb 2016 19:37:27 +0000 +Subject: af_unix: Guard against other == sk in unix_dgram_sendmsg +Origin: http://mid.gmane.org/87r3gj11jc.fsf_-_@doppelsaurus.mobileactivedefense.com + +The unix_dgram_sendmsg routine use the following test + +if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { + +to determine if sk and other are in an n:1 association (either +established via connect or by using sendto to send messages to an +unrelated socket identified by address). This isn't correct as the +specified address could have been bound to the sending socket itself or +because this socket could have been connected to itself by the time of +the unix_peer_get but disconnected before the unix_state_lock(other). In +both cases, the if-block would be entered despite other == sk which +might either block the sender unintentionally or lead to trying to unlock +the same spin lock twice for a non-blocking send. Add a other != sk +check to guard against this. + +Fixes: 7d267278a9ec ("unix: avoid use-after-free in ep_remove_wait_queue") +Reported-By: Philipp Hahn +Signed-off-by: Rainer Weikusat +--- +--- a/net/unix/af_unix.c ++++ b/net/unix/af_unix.c +@@ -1781,7 +1781,12 @@ restart_locked: + goto out_unlock; + } + +- if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { ++ /* other == sk && unix_peer(other) != sk if ++ * - unix_peer(sk) == NULL, destination address bound to sk ++ * - unix_peer(sk) == sk by time of get but disconnected before lock ++ */ ++ if (other != sk && ++ unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { + if (timeo) { + timeo = unix_wait_for_peer(other, timeo); + diff --git a/debian/patches/series b/debian/patches/series index 67785b41d..499c27d1f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -119,3 +119,4 @@ bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch +bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch From 2d5f78b62a713126e119a3078c3ed0efad65d917 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 13 Feb 2016 00:03:31 +0000 Subject: [PATCH 06/35] Revert "workqueue: make sure delayed work run in local cpu" This caused a regression in 4.3 --- debian/changelog | 2 + ...e-sure-delayed-work-run-in-local-cpu.patch | 70 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 73 insertions(+) create mode 100644 debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch diff --git a/debian/changelog b/debian/changelog index 18a50f865..53349da57 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.3) * af_unix: Guard against other == sk in unix_dgram_sendmsg (regression in 4.2.6-2) + * Revert "workqueue: make sure delayed work run in local cpu" + (regression in 4.3) -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 diff --git a/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch b/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch new file mode 100644 index 000000000..55090c624 --- /dev/null +++ b/debian/patches/bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch @@ -0,0 +1,70 @@ +From: Tejun Heo +Date: Tue, 9 Feb 2016 18:14:48 -0500 +Subject: Revert "workqueue: make sure delayed work run in local cpu" +Origin: http://mid.gmane.org/1455059690-18765-2-git-send-email-tj@kernel.org + +This reverts commit 874bbfe600a660cba9c776b3957b1ce393151b76. + +Workqueue used to implicity guarantee that work items queued without +explicit CPU specified are put on the local CPU. Recent changes in +timer broke the guarantee and led to vmstat breakage which was fixed +by 176bed1de5bf ("vmstat: explicitly schedule per-cpu work on the CPU +we need it to run on"). + +vmstat is the most likely to expose the issue and it's quite possible +that there are other similar problems which are a lot more difficult +to trigger. As a preventive measure, 874bbfe600a6 ("workqueue: make +sure delayed work run in local cpu") was applied to restore the local +CPU guarnatee. Unfortunately, the change exposed a bug in timer code +which got fixed by 22b886dd1018 ("timers: Use proper base migration in +add_timer_on()"). Due to code restructuring, the commit couldn't be +backported beyond certain point and stable kernels which only had +874bbfe600a6 started crashing. + +The local CPU guarantee was accidental more than anything else and we +want to get rid of it anyway. As, with the vmstat case fixed, +874bbfe600a6 is causing more problems than it's fixing, it has been +decided to take the chance and officially break the guarantee by +reverting the commit. A debug feature will be added to force foreign +CPU assignment to expose cases relying on the guarantee and fixes for +the individual cases will be backported to stable as necessary. + +Signed-off-by: Tejun Heo +Fixes: 874bbfe600a6 ("workqueue: make sure delayed work run in local cpu") +Link: http://lkml.kernel.org/g/20160120211926.GJ10810@quack.suse.cz +Cc: stable@vger.kernel.org +Cc: Mike Galbraith +Cc: Henrique de Moraes Holschuh +Cc: Daniel Bilik +Cc: Jan Kara +Cc: Shaohua Li +Cc: Sasha Levin +Cc: Ben Hutchings +Cc: Thomas Gleixner +Cc: Daniel Bilik +Cc: Jiri Slaby +Cc: Michal Hocko +--- + kernel/workqueue.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1458,13 +1458,13 @@ static void __queue_delayed_work(int cpu + timer_stats_timer_set_start_info(&dwork->timer); + + dwork->wq = wq; +- /* timer isn't guaranteed to run in this cpu, record earlier */ +- if (cpu == WORK_CPU_UNBOUND) +- cpu = raw_smp_processor_id(); + dwork->cpu = cpu; + timer->expires = jiffies + delay; + +- add_timer_on(timer, cpu); ++ if (unlikely(cpu != WORK_CPU_UNBOUND)) ++ add_timer_on(timer, cpu); ++ else ++ add_timer(timer); + } + + /** diff --git a/debian/patches/series b/debian/patches/series index 499c27d1f..ae6e0cc30 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -120,3 +120,4 @@ bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch +bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch From 3c25ed439a2e6bd08c606c3a24c60805aa98e08b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 13 Feb 2016 00:55:52 +0000 Subject: [PATCH 07/35] af_unix: Don't set err in unix_stream_read_generic unless there was an error This fixes a regression in 4.4, also introduced in 4.3.4 and various other stable updates. --- debian/changelog | 2 + ...ad_generic-unless-there-was-an-error.patch | 65 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 68 insertions(+) create mode 100644 debian/patches/bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch diff --git a/debian/changelog b/debian/changelog index 53349da57..617cac962 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.2.6-2) * Revert "workqueue: make sure delayed work run in local cpu" (regression in 4.3) + * af_unix: Don't set err in unix_stream_read_generic unless there was an error + (regression in 4.4, 4.3.4) -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 diff --git a/debian/patches/bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch b/debian/patches/bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch new file mode 100644 index 000000000..3eec17f72 --- /dev/null +++ b/debian/patches/bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch @@ -0,0 +1,65 @@ +From: Rainer Weikusat +Date: Mon, 08 Feb 2016 18:47:19 +0000 +Subject: af_unix: Don't set err in unix_stream_read_generic unless there was an error +Origin: http://mid.gmane.org/87bn7rrqdk.fsf@doppelsaurus.mobileactivedefense.com + +The present unix_stream_read_generic contains various code sequences of +the form + +err = -EDISASTER; +if () + goto out; + +This has the unfortunate side effect of possibly causing the error code +to bleed through to the final + +out: + return copied ? : err; + +and then to be wrongly returned if no data was copied because the caller +didn't supply a data buffer, as demonstrated by the program available at + +http://pad.lv/1540731 + +Change it such that err is only set if an error condition was detected. + +Fixes: 3822b5c2fc62 ("af_unix: Revert 'lock_interruptible' in stream receive code") +Reported-by: Joseph Salisbury +Signed-off-by: Rainer Weikusat +--- +--- a/net/unix/af_unix.c ++++ b/net/unix/af_unix.c +@@ -2275,13 +2275,15 @@ static int unix_stream_read_generic(stru + size_t size = state->size; + unsigned int last_len; + +- err = -EINVAL; +- if (sk->sk_state != TCP_ESTABLISHED) ++ if (unlikely(sk->sk_state != TCP_ESTABLISHED)) { ++ err = -EINVAL; + goto out; ++ } + +- err = -EOPNOTSUPP; +- if (flags & MSG_OOB) ++ if (unlikely(flags & MSG_OOB)) { ++ err = -EOPNOTSUPP; + goto out; ++ } + + target = sock_rcvlowat(sk, flags & MSG_WAITALL, size); + timeo = sock_rcvtimeo(sk, noblock); +@@ -2327,9 +2329,11 @@ again: + goto unlock; + + unix_state_unlock(sk); +- err = -EAGAIN; +- if (!timeo) ++ if (!timeo) { ++ err = -EAGAIN; + break; ++ } ++ + mutex_unlock(&u->readlock); + + timeo = unix_stream_data_wait(sk, timeo, last, diff --git a/debian/patches/series b/debian/patches/series index ae6e0cc30..f2c331957 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -121,3 +121,4 @@ bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch +bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch From 86ea7ce8a02cceda9befc0303a736132170e5246 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Sun, 14 Feb 2016 00:37:52 +0900 Subject: [PATCH 08/35] Enable TTY_PRINTK as module (Closes: #814540). --- debian/changelog | 4 ++++ debian/config/config | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 617cac962..584776a16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ linux (4.4.1-1) UNRELEASED; urgency=medium + [ Ben Hutchings ] * iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) * fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() (CVE-2016-0617) (regression in 4.3) @@ -10,6 +11,9 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * af_unix: Don't set err in unix_stream_read_generic unless there was an error (regression in 4.4, 4.3.4) + [ Roger Shimizu ] + * Enable TTY_PRINTK as module (Closes: #814540). + -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 linux (4.4.1-1~exp1) experimental; urgency=medium diff --git a/debian/config/config b/debian/config/config index 27e3cbf5a..c6ec239ac 100644 --- a/debian/config/config +++ b/debian/config/config @@ -363,7 +363,7 @@ CONFIG_BT_WILINK=m ## CONFIG_DEVMEM=y # CONFIG_DEVKMEM is not set -# CONFIG_TTY_PRINTK is not set +CONFIG_TTY_PRINTK=m CONFIG_VIRTIO_CONSOLE=m # CONFIG_R3964 is not set CONFIG_PC8736x_GPIO=m From 29ef5032ac9172e77799001bb285e6b6f76c8d77 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 04:54:42 +0000 Subject: [PATCH 09/35] bpf: fix branch offset adjustment on backjumps after patching ctx expansion CVE ID to be assigned. --- debian/changelog | 2 + ...ffset-adjustment-on-backjumps-after-.patch | 89 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 92 insertions(+) create mode 100644 debian/patches/bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch diff --git a/debian/changelog b/debian/changelog index 584776a16..845650d9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.3) * af_unix: Don't set err in unix_stream_read_generic unless there was an error (regression in 4.4, 4.3.4) + * bpf: fix branch offset adjustment on backjumps after patching ctx expansion + (CVE-2016-XXXX) [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch b/debian/patches/bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch new file mode 100644 index 000000000..c67376d95 --- /dev/null +++ b/debian/patches/bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch @@ -0,0 +1,89 @@ +From: Daniel Borkmann +Date: Wed, 10 Feb 2016 16:47:11 +0100 +Subject: bpf: fix branch offset adjustment on backjumps after patching ctx + expansion +Origin: https://git.kernel.org/linus/a1b14d27ed0965838350f1377ff97c93ee383492 + +When ctx access is used, the kernel often needs to expand/rewrite +instructions, so after that patching, branch offsets have to be +adjusted for both forward and backward jumps in the new eBPF program, +but for backward jumps it fails to account the delta. Meaning, for +example, if the expansion happens exactly on the insn that sits at +the jump target, it doesn't fix up the back jump offset. + +Analysis on what the check in adjust_branches() is currently doing: + + /* adjust offset of jmps if necessary */ + if (i < pos && i + insn->off + 1 > pos) + insn->off += delta; + else if (i > pos && i + insn->off + 1 < pos) + insn->off -= delta; + +First condition (forward jumps): + + Before: After: + + insns[0] insns[0] + insns[1] <--- i/insn insns[1] <--- i/insn + insns[2] <--- pos insns[P] <--- pos + insns[3] insns[P] `------| delta + insns[4] <--- target_X insns[P] `-----| + insns[5] insns[3] + insns[4] <--- target_X + insns[5] + +First case is if we cross pos-boundary and the jump instruction was +before pos. This is handeled correctly. I.e. if i == pos, then this +would mean our jump that we currently check was the patchlet itself +that we just injected. Since such patchlets are self-contained and +have no awareness of any insns before or after the patched one, the +delta is correctly not adjusted. Also, for the second condition in +case of i + insn->off + 1 == pos, means we jump to that newly patched +instruction, so no offset adjustment are needed. That part is correct. + +Second condition (backward jumps): + + Before: After: + + insns[0] insns[0] + insns[1] <--- target_X insns[1] <--- target_X + insns[2] <--- pos <-- target_Y insns[P] <--- pos <-- target_Y + insns[3] insns[P] `------| delta + insns[4] <--- i/insn insns[P] `-----| + insns[5] insns[3] + insns[4] <--- i/insn + insns[5] + +Second interesting case is where we cross pos-boundary and the jump +instruction was after pos. Backward jump with i == pos would be +impossible and pose a bug somewhere in the patchlet, so the first +condition checking i > pos is okay only by itself. However, i + +insn->off + 1 < pos does not always work as intended to trigger the +adjustment. It works when jump targets would be far off where the +delta wouldn't matter. But, for example, where the fixed insn->off +before pointed to pos (target_Y), it now points to pos + delta, so +that additional room needs to be taken into account for the check. +This means that i) both tests here need to be adjusted into pos + delta, +and ii) for the second condition, the test needs to be <= as pos +itself can be a target in the backjump, too. + +Fixes: 9bac3d6d548e ("bpf: allow extended BPF programs access skb fields") +Signed-off-by: Daniel Borkmann +Signed-off-by: David S. Miller +--- + kernel/bpf/verifier.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c +index d1d3e8f57de9..2e7f7ab739e4 100644 +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -2082,7 +2082,7 @@ static void adjust_branches(struct bpf_prog *prog, int pos, int delta) + /* adjust offset of jmps if necessary */ + if (i < pos && i + insn->off + 1 > pos) + insn->off += delta; +- else if (i > pos && i + insn->off + 1 < pos) ++ else if (i > pos + delta && i + insn->off + 1 <= pos + delta) + insn->off -= delta; + } + } diff --git a/debian/patches/series b/debian/patches/series index f2c331957..9c5fc07af 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -122,3 +122,4 @@ bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch +bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch From b84086545ea4a1a49d0eab4ef7044837a889b254 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 04:55:59 +0000 Subject: [PATCH 10/35] ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-XXXX) --- debian/changelog | 1 + ...dio-avoid-freeing-umidi-object-twice.patch | 31 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 33 insertions(+) create mode 100644 debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch diff --git a/debian/changelog b/debian/changelog index 845650d9c..1160aa014 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.4, 4.3.4) * bpf: fix branch offset adjustment on backjumps after patching ctx expansion (CVE-2016-XXXX) + * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-XXXX) [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch b/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch new file mode 100644 index 000000000..72c57bf01 --- /dev/null +++ b/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch @@ -0,0 +1,31 @@ +From: Andrey Konovalov +Date: Sat, 13 Feb 2016 11:08:06 +0300 +Subject: ALSA: usb-audio: avoid freeing umidi object twice +Origin: https://git.kernel.org/linus/07d86ca93db7e5cdf4743564d98292042ec21af7 + +The 'umidi' object will be free'd on the error path by snd_usbmidi_free() +when tearing down the rawmidi interface. So we shouldn't try to free it +in snd_usbmidi_create() after having registered the rawmidi interface. + +Found by KASAN. + +Signed-off-by: Andrey Konovalov +Acked-by: Clemens Ladisch +Cc: +Signed-off-by: Takashi Iwai +--- + sound/usb/midi.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sound/usb/midi.c b/sound/usb/midi.c +index cc39f63299ef..007cf5831121 100644 +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -2455,7 +2455,6 @@ int snd_usbmidi_create(struct snd_card *card, + else + err = snd_usbmidi_create_endpoints(umidi, endpoints); + if (err < 0) { +- snd_usbmidi_free(umidi); + return err; + } + diff --git a/debian/patches/series b/debian/patches/series index 9c5fc07af..136807678 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -123,3 +123,4 @@ bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch +bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch From 1ad5c45be8dba76a43f21d04fd1b2d4242f558b7 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 16:14:05 +0000 Subject: [PATCH 11/35] Set ABI to 1 --- debian/changelog | 1 + debian/config/defines | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1160aa014..5ec3a6c16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium [ Ben Hutchings ] + * Set ABI to 1 * iw_cxgb3: Fix incorrectly returning error on success (CVE-2015-8812) * fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list() (CVE-2016-0617) (regression in 4.3) diff --git a/debian/config/defines b/debian/config/defines index fb8a712be..809d82b13 100644 --- a/debian/config/defines +++ b/debian/config/defines @@ -1,5 +1,5 @@ [abi] -abiname: trunk +abiname: 1 [base] arches: From 3684b6ebadc1e8e9cf7f0327ac2d17081aea71e0 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 14 Feb 2016 19:17:39 +0100 Subject: [PATCH 12/35] CVE-2016-2383 assigned --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5ec3a6c16..31eb36633 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,7 +12,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * af_unix: Don't set err in unix_stream_read_generic unless there was an error (regression in 4.4, 4.3.4) * bpf: fix branch offset adjustment on backjumps after patching ctx expansion - (CVE-2016-XXXX) + (CVE-2016-2383) * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-XXXX) [ Roger Shimizu ] From 02bda7119fca136f644dbfaec556c1ffd5938af5 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Sun, 14 Feb 2016 19:18:04 +0100 Subject: [PATCH 13/35] CVE-2016-2384 assigned --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 31eb36633..b13ddc249 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.4, 4.3.4) * bpf: fix branch offset adjustment on backjumps after patching ctx expansion (CVE-2016-2383) - * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-XXXX) + * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-2384) [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). From b8c3eeca7f2c453354abaf0ada5deea5a1aefc92 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 01:31:37 +0000 Subject: [PATCH 14/35] udeb: Combine scsi-{common,extra}-modules with scsi-modules --- debian/changelog | 1 + .../modules/alpha-generic/scsi-common-modules | 1 - .../modules/alpha-generic/scsi-extra-modules | 1 - .../amd64/modules/amd64/scsi-common-modules | 1 - .../amd64/modules/amd64/scsi-extra-modules | 1 - debian/installer/amd64/package-list | 2 +- .../{scsi-common-modules => scsi-modules} | 0 .../hppa-parisc64-smp/scsi-common-modules | 1 - .../hppa/modules/hppa/scsi-common-modules | 2 - .../installer/hppa/modules/hppa/scsi-modules | 5 ++ .../i386/modules/i386/scsi-common-modules | 2 - .../i386/modules/i386/scsi-extra-modules | 1 - .../mips-4kc-malta/scsi-common-modules | 1 - .../modules/mips-4kc-malta/scsi-extra-modules | 1 - .../modules/mips-octeon/scsi-common-modules | 2 - .../modules/mips-octeon/scsi-extra-modules | 4 - .../mips/modules/mips-octeon/scsi-modules | 4 + .../mipsel-loongson-2e/scsi-common-modules | 2 - .../mipsel-loongson-2e/scsi-extra-modules | 4 - .../modules/mipsel-loongson-2e/scsi-modules | 4 + .../mipsel-loongson-2f/scsi-common-modules | 2 - .../mipsel-loongson-2f/scsi-extra-modules | 4 - .../modules/mipsel-loongson-2f/scsi-modules | 4 + .../mipsel-loongson-3/scsi-common-modules | 2 - .../mipsel-loongson-3/scsi-extra-modules | 4 - .../modules/mipsel-loongson-3/scsi-modules | 4 + debian/installer/modules/scsi-common-modules | 6 -- debian/installer/modules/scsi-extra-modules | 47 ---------- debian/installer/modules/scsi-modules | 86 +++++++++++++++---- debian/installer/package-list | 14 --- .../scsi-common-modules | 1 - .../powerpc-powerpc-miboot/scsi-extra-modules | 1 - .../powerpc-powerpc64/scsi-common-modules | 1 - .../powerpc-powerpc64/scsi-extra-modules | 3 - .../modules/powerpc-powerpc64/scsi-modules | 1 + .../modules/powerpc/scsi-common-modules | 2 - .../modules/powerpc/scsi-extra-modules | 1 - .../modules/ppc64el/scsi-common-modules | 1 - .../modules/ppc64el/scsi-extra-modules | 1 - .../modules/sparc64/scsi-common-modules | 8 -- .../sparc64/modules/sparc64/scsi-modules | 12 ++- 41 files changed, 104 insertions(+), 141 deletions(-) delete mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-common-modules delete mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-extra-modules delete mode 100644 debian/installer/amd64/modules/amd64/scsi-common-modules delete mode 100644 debian/installer/amd64/modules/amd64/scsi-extra-modules rename debian/installer/armel/modules/armel-versatile/{scsi-common-modules => scsi-modules} (100%) delete mode 100644 debian/installer/hppa/modules/hppa-parisc64-smp/scsi-common-modules delete mode 100644 debian/installer/hppa/modules/hppa/scsi-common-modules delete mode 100644 debian/installer/i386/modules/i386/scsi-common-modules delete mode 100644 debian/installer/i386/modules/i386/scsi-extra-modules delete mode 100644 debian/installer/mips/modules/mips-4kc-malta/scsi-common-modules delete mode 100644 debian/installer/mips/modules/mips-4kc-malta/scsi-extra-modules delete mode 100644 debian/installer/mips/modules/mips-octeon/scsi-common-modules delete mode 100644 debian/installer/mips/modules/mips-octeon/scsi-extra-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-common-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-extra-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-common-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-extra-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-3/scsi-common-modules delete mode 100644 debian/installer/mipsel/modules/mipsel-loongson-3/scsi-extra-modules delete mode 100644 debian/installer/modules/scsi-common-modules delete mode 100644 debian/installer/modules/scsi-extra-modules delete mode 100644 debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-common-modules delete mode 100644 debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-extra-modules delete mode 100644 debian/installer/powerpc/modules/powerpc-powerpc64/scsi-common-modules delete mode 100644 debian/installer/powerpc/modules/powerpc-powerpc64/scsi-extra-modules delete mode 100644 debian/installer/powerpc/modules/powerpc/scsi-common-modules delete mode 100644 debian/installer/powerpc/modules/powerpc/scsi-extra-modules delete mode 100644 debian/installer/ppc64el/modules/ppc64el/scsi-common-modules delete mode 100644 debian/installer/ppc64el/modules/ppc64el/scsi-extra-modules delete mode 100644 debian/installer/sparc64/modules/sparc64/scsi-common-modules diff --git a/debian/changelog b/debian/changelog index b13ddc249..6fffa4840 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * bpf: fix branch offset adjustment on backjumps after patching ctx expansion (CVE-2016-2383) * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-2384) + * udeb: Combine scsi-{common,extra}-modules with scsi-modules [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-common-modules b/debian/installer/alpha/modules/alpha-generic/scsi-common-modules deleted file mode 100644 index 71103dd60..000000000 --- a/debian/installer/alpha/modules/alpha-generic/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules b/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules deleted file mode 100644 index cd13edec5..000000000 --- a/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/amd64/modules/amd64/scsi-common-modules b/debian/installer/amd64/modules/amd64/scsi-common-modules deleted file mode 100644 index 71103dd60..000000000 --- a/debian/installer/amd64/modules/amd64/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/amd64/modules/amd64/scsi-extra-modules b/debian/installer/amd64/modules/amd64/scsi-extra-modules deleted file mode 100644 index cd13edec5..000000000 --- a/debian/installer/amd64/modules/amd64/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/amd64/package-list b/debian/installer/amd64/package-list index 322f816dc..e55a71031 100644 --- a/debian/installer/amd64/package-list +++ b/debian/installer/amd64/package-list @@ -8,7 +8,7 @@ Package: fat-modules Priority: standard Package: scsi-modules -Depends: kernel-image, scsi-core-modules, scsi-common-modules, cdrom-core-modules, core-modules, ata-modules +Depends: kernel-image, scsi-core-modules, cdrom-core-modules, core-modules, ata-modules Package: kernel-image Provides: zlib-modules diff --git a/debian/installer/armel/modules/armel-versatile/scsi-common-modules b/debian/installer/armel/modules/armel-versatile/scsi-modules similarity index 100% rename from debian/installer/armel/modules/armel-versatile/scsi-common-modules rename to debian/installer/armel/modules/armel-versatile/scsi-modules diff --git a/debian/installer/hppa/modules/hppa-parisc64-smp/scsi-common-modules b/debian/installer/hppa/modules/hppa-parisc64-smp/scsi-common-modules deleted file mode 100644 index 933392840..000000000 --- a/debian/installer/hppa/modules/hppa-parisc64-smp/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../hppa/scsi-common-modules" diff --git a/debian/installer/hppa/modules/hppa/scsi-common-modules b/debian/installer/hppa/modules/hppa/scsi-common-modules deleted file mode 100644 index 49739018c..000000000 --- a/debian/installer/hppa/modules/hppa/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include - diff --git a/debian/installer/hppa/modules/hppa/scsi-modules b/debian/installer/hppa/modules/hppa/scsi-modules index 284481edf..43d9b0397 100644 --- a/debian/installer/hppa/modules/hppa/scsi-modules +++ b/debian/installer/hppa/modules/hppa/scsi-modules @@ -1,3 +1,8 @@ +aic79xx +aic7xxx +BusLogic ? +sym53c8xx +sym53c8xx_2 ? 53c700 ch lasi700 diff --git a/debian/installer/i386/modules/i386/scsi-common-modules b/debian/installer/i386/modules/i386/scsi-common-modules deleted file mode 100644 index 49739018c..000000000 --- a/debian/installer/i386/modules/i386/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include - diff --git a/debian/installer/i386/modules/i386/scsi-extra-modules b/debian/installer/i386/modules/i386/scsi-extra-modules deleted file mode 100644 index cd13edec5..000000000 --- a/debian/installer/i386/modules/i386/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/mips/modules/mips-4kc-malta/scsi-common-modules b/debian/installer/mips/modules/mips-4kc-malta/scsi-common-modules deleted file mode 100644 index 71103dd60..000000000 --- a/debian/installer/mips/modules/mips-4kc-malta/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/mips/modules/mips-4kc-malta/scsi-extra-modules b/debian/installer/mips/modules/mips-4kc-malta/scsi-extra-modules deleted file mode 100644 index cd13edec5..000000000 --- a/debian/installer/mips/modules/mips-4kc-malta/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/mips/modules/mips-octeon/scsi-common-modules b/debian/installer/mips/modules/mips-octeon/scsi-common-modules deleted file mode 100644 index 748049f2e..000000000 --- a/debian/installer/mips/modules/mips-octeon/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include -sym53c8xx - diff --git a/debian/installer/mips/modules/mips-octeon/scsi-extra-modules b/debian/installer/mips/modules/mips-octeon/scsi-extra-modules deleted file mode 100644 index 3a9aad711..000000000 --- a/debian/installer/mips/modules/mips-octeon/scsi-extra-modules +++ /dev/null @@ -1,4 +0,0 @@ -#include -cciss - -DAC960 - -ips - diff --git a/debian/installer/mips/modules/mips-octeon/scsi-modules b/debian/installer/mips/modules/mips-octeon/scsi-modules index 4662eb416..44a9049bd 100644 --- a/debian/installer/mips/modules/mips-octeon/scsi-modules +++ b/debian/installer/mips/modules/mips-octeon/scsi-modules @@ -1,2 +1,6 @@ #include +DAC960 - +cciss - dmx3191d - +ips - +sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-common-modules b/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-common-modules deleted file mode 100644 index 748049f2e..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include -sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-extra-modules b/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-extra-modules deleted file mode 100644 index 3a9aad711..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-extra-modules +++ /dev/null @@ -1,4 +0,0 @@ -#include -cciss - -DAC960 - -ips - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-modules b/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-modules index 4662eb416..44a9049bd 100644 --- a/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-modules +++ b/debian/installer/mipsel/modules/mipsel-loongson-2e/scsi-modules @@ -1,2 +1,6 @@ #include +DAC960 - +cciss - dmx3191d - +ips - +sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-common-modules b/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-common-modules deleted file mode 100644 index 748049f2e..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include -sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-extra-modules b/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-extra-modules deleted file mode 100644 index 3a9aad711..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-extra-modules +++ /dev/null @@ -1,4 +0,0 @@ -#include -cciss - -DAC960 - -ips - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-modules b/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-modules index 4662eb416..44a9049bd 100644 --- a/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-modules +++ b/debian/installer/mipsel/modules/mipsel-loongson-2f/scsi-modules @@ -1,2 +1,6 @@ #include +DAC960 - +cciss - dmx3191d - +ips - +sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-common-modules b/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-common-modules deleted file mode 100644 index 748049f2e..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include -sym53c8xx - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-extra-modules b/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-extra-modules deleted file mode 100644 index 3a9aad711..000000000 --- a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-extra-modules +++ /dev/null @@ -1,4 +0,0 @@ -#include -cciss - -DAC960 - -ips - diff --git a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-modules b/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-modules index 4662eb416..44a9049bd 100644 --- a/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-modules +++ b/debian/installer/mipsel/modules/mipsel-loongson-3/scsi-modules @@ -1,2 +1,6 @@ #include +DAC960 - +cciss - dmx3191d - +ips - +sym53c8xx - diff --git a/debian/installer/modules/scsi-common-modules b/debian/installer/modules/scsi-common-modules deleted file mode 100644 index 736afe116..000000000 --- a/debian/installer/modules/scsi-common-modules +++ /dev/null @@ -1,6 +0,0 @@ -# Some historically common SCSI drivers -aic79xx -aic7xxx -BusLogic ? -sym53c8xx -sym53c8xx_2 ? diff --git a/debian/installer/modules/scsi-extra-modules b/debian/installer/modules/scsi-extra-modules deleted file mode 100644 index 6d4548a59..000000000 --- a/debian/installer/modules/scsi-extra-modules +++ /dev/null @@ -1,47 +0,0 @@ -# tape -osst -st - -# host adapters -3w-9xxx ? -3w-sas ? -3w-xxxx -aacraid -aha152x ? -arcmsr ? -bnx2fc ? -cciss -cpqarray ? -csiostor ? -DAC960 -dtc ? -eata ? -fdomain ? -fnic ? -gdth ? -hpsa ? -hptiop ? -ibmmca ? -ips -isci ? -lpfc ? -megaraid ? -megaraid_mbox ? -megaraid_mm ? -megaraid_sas ? -mpt3sas ? -mptbase -mptfc ? -mptsas ? -mptscsih -mptspi ? -mvsas -pm80xx ? -pmcraid ? -qla2xxx ? -qla4xxx ? -sym53c416 ? -ufshcd ? -ufshcd-pci ? -vmw_pvscsi ? -wd719x ? diff --git a/debian/installer/modules/scsi-modules b/debian/installer/modules/scsi-modules index 987b88be9..67df41ae2 100644 --- a/debian/installer/modules/scsi-modules +++ b/debian/installer/modules/scsi-modules @@ -1,29 +1,83 @@ +# host adapters +3w-9xxx ? +3w-sas ? +3w-xxxx +BusLogic ? +DAC960 NCR53c406a ? +aacraid advansys ? +aha152x ? aha1542 ? aha1740 ? +aic79xx +aic7xxx +aic94xx ? +arcmsr ? atp870u ? +bnx2fc ? +cciss +cpqarray ? +csiostor ? +dc395x ? dmx3191d +dtc ? +eata ? esas2r ? fd_mcs ? +fdomain ? +fnic ? g_NCR5380 ? +gdth ? +hpsa ? +hptiop ? +ibmmca ? in2000 ? -pas16 ? -qla1280 ? -qlogicfas ? -sg -sim710 ? -snic ? -t128 ? -u14-34f ? -ultrastor ? -wd7000 ? initio ? ipr ? -qlogicfas408 ? -dc395x ? -aic94xx ? -stex ? -xen-blkfront ? -iscsi_tcp ? +ips +isci ? iscsi_ibft ? +iscsi_tcp ? +lpfc ? +megaraid ? +megaraid_mbox ? +megaraid_mm ? +megaraid_sas ? +mpt3sas ? +mptbase +mptfc ? +mptsas ? +mptscsih +mptspi ? +mvsas +pas16 ? +pm80xx ? +pmcraid ? +qla1280 ? +qla2xxx ? +qla4xxx ? +qlogicfas ? +qlogicfas408 ? +sim710 ? +snic ? +stex ? +sym53c416 ? +sym53c8xx +sym53c8xx_2 ? +t128 ? +u14-34f ? +ufshcd ? +ufshcd-pci ? +ultrastor ? +vmw_pvscsi ? +wd7000 ? +wd719x ? +xen-blkfront ? + +# generic +sg + +# tape +osst +st diff --git a/debian/installer/package-list b/debian/installer/package-list index 9d42bf445..74dfeb162 100644 --- a/debian/installer/package-list +++ b/debian/installer/package-list @@ -79,20 +79,6 @@ Priority: standard Description: SCSI drivers This package contains SCSI drivers for the kernel. -Package: scsi-common-modules -Depends: kernel-image, scsi-core-modules, cdrom-core-modules -Priority: standard -Description: Very common SCSI drivers - This package contains very common SCSI drivers for the kernel. - -Package: scsi-extra-modules -Depends: scsi-modules, scsi-core-modules, core-modules -Priority: standard -Description: Uncommon SCSI drivers - This package contains uncommon SCSI drivers for the kernel. - This includes SCSI RAID drivers, and some of the less common SCSI - controllers. - Package: loop-modules Depends: kernel-image Priority: standard diff --git a/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-common-modules b/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-common-modules deleted file mode 100644 index 17ad4c4c9..000000000 --- a/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../powerpc/scsi-common-modules" diff --git a/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-extra-modules b/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-extra-modules deleted file mode 100644 index 2b98d8b2e..000000000 --- a/debian/installer/powerpc/modules/powerpc-powerpc-miboot/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../powerpc/scsi-extra-modules" diff --git a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-common-modules b/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-common-modules deleted file mode 100644 index 17ad4c4c9..000000000 --- a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../powerpc/scsi-common-modules" diff --git a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-extra-modules b/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-extra-modules deleted file mode 100644 index f37aaaa3d..000000000 --- a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-extra-modules +++ /dev/null @@ -1,3 +0,0 @@ -#include - -ps3disk ? diff --git a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-modules b/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-modules index da80e9026..62f9ed24d 100644 --- a/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-modules +++ b/debian/installer/powerpc/modules/powerpc-powerpc64/scsi-modules @@ -1,4 +1,5 @@ #include ibmvscsi +ps3disk ? ps3rom diff --git a/debian/installer/powerpc/modules/powerpc/scsi-common-modules b/debian/installer/powerpc/modules/powerpc/scsi-common-modules deleted file mode 100644 index 49739018c..000000000 --- a/debian/installer/powerpc/modules/powerpc/scsi-common-modules +++ /dev/null @@ -1,2 +0,0 @@ -#include - diff --git a/debian/installer/powerpc/modules/powerpc/scsi-extra-modules b/debian/installer/powerpc/modules/powerpc/scsi-extra-modules deleted file mode 100644 index cd13edec5..000000000 --- a/debian/installer/powerpc/modules/powerpc/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/debian/installer/ppc64el/modules/ppc64el/scsi-common-modules b/debian/installer/ppc64el/modules/ppc64el/scsi-common-modules deleted file mode 100644 index a52a3c900..000000000 --- a/debian/installer/ppc64el/modules/ppc64el/scsi-common-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../../../ppc64/modules/ppc64/scsi-common-modules" diff --git a/debian/installer/ppc64el/modules/ppc64el/scsi-extra-modules b/debian/installer/ppc64el/modules/ppc64el/scsi-extra-modules deleted file mode 100644 index ccfa60b5a..000000000 --- a/debian/installer/ppc64el/modules/ppc64el/scsi-extra-modules +++ /dev/null @@ -1 +0,0 @@ -#include "../../../ppc64/modules/ppc64/scsi-extra-modules" diff --git a/debian/installer/sparc64/modules/sparc64/scsi-common-modules b/debian/installer/sparc64/modules/sparc64/scsi-common-modules deleted file mode 100644 index 068043ca2..000000000 --- a/debian/installer/sparc64/modules/sparc64/scsi-common-modules +++ /dev/null @@ -1,8 +0,0 @@ -sun_esp -aic79xx -aic7xxx -qlogicpti ? -sym53c8xx -mptsas -mptspi -mpt3sas diff --git a/debian/installer/sparc64/modules/sparc64/scsi-modules b/debian/installer/sparc64/modules/sparc64/scsi-modules index e2f1eb89a..afceaf8ec 100644 --- a/debian/installer/sparc64/modules/sparc64/scsi-modules +++ b/debian/installer/sparc64/modules/sparc64/scsi-modules @@ -1,6 +1,8 @@ 3w-9xxx 3w-xxxx aacraid +aic79xx +aic7xxx aic94xx arcmsr atp870u ? @@ -8,12 +10,18 @@ dc395x dmx3191d hptiop initio +ipr lpfc megaraid megaraid_sas +mpt3sas +mptsas +mptspi osst -ipr -stex qla1280 ? qla2xxx ? qla4xxx ? +qlogicpti ? +stex +sun_esp +sym53c8xx From d1a2d68dab274ffd3bdde32e399aa9c71064e32c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 23:46:11 +0000 Subject: [PATCH 15/35] udeb: input-modules: Include HID drivers by default --- debian/changelog | 2 + debian/installer/modules/input-modules | 66 ++++++++++++++------------ debian/templates/control.source.in | 2 +- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6fffa4840..8efa0b173 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (CVE-2016-2383) * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-2384) * udeb: Combine scsi-{common,extra}-modules with scsi-modules + * udeb: Use wildcards to include entire classes of drivers: + - input-modules: Include HID drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/input-modules b/debian/installer/modules/input-modules index aeac6491b..f2ce5ed13 100644 --- a/debian/installer/modules/input-modules +++ b/debian/installer/modules/input-modules @@ -1,36 +1,40 @@ -hid -hid-generic -usbhid -hid-a4tech ? -hid-apple ? -hid-belkin ? -hid-cherry ? -hid-chicony ? -hid-cypress ? -hid-ezkey ? -hid-holtek-kbd ? -hid-kensington ? -hid-keytouch ? -hid-kye ? -hid-lenovo-tpkbd ? -hid-logitech ? -hid-logitech-dj -hid-logitech-hidpp ? -hid-microsoft ? -hid-monterey ? -hid-multitouch ? -hid-ortek ? -hid-primax ? -hid-roccat-isku ? -hid-roccat-lua ? -hid-roccat-savu ? -hid-samsung ? -hid-speedlink ? -hid-sunplus ? -hid-topseed ? +# Include HID drivers by default +drivers/hid/** + +# Exclude hid-hyperv, packaged in hyperv-modules +hid-hyperv - + +# Exclude drivers for anything but keyboard and mouse/trackball/touchpad +drivers/hid/hid-*ff - +hid-dr - +hid-elecom - +hid-gyration - +hid-icade - +hid-lcpower - +hid-ntrig - +hid-petalynx - +hid-picolcd - +hid-pl - +hid-prodikeys - +hid-ps3remote - +hid-quanta - +drivers/hid/hid-roccat-ko* - +hid-roccat-pyra - +hid-saitek - +hid-sensor-hub - +hid-sony - +hid-tivo - +hid-twinhan - +hid-uclogic - +hid-wacom - +hid-waltop - +hid-wiimote - +hid-zydacron - +wacom - + +# Miscellaneous input drivers synaptics_usb ? wistron_btns ? -i2c-hid ? virtio-input ? gpio_keys ? soc_button_array ? diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index e4c5ab4c4..8f3bd2b8d 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -4,7 +4,7 @@ Maintainer: Debian Kernel Team Uploaders: Bastian Blank , maximilian attems , Ben Hutchings Standards-Version: 3.9.5 Build-Depends: debhelper, python3:any, quilt, - cpio , kmod , xz-utils , kernel-wedge , bc + cpio , kmod , xz-utils , kernel-wedge (>= 2.92~) , bc Build-Depends-Indep: patchutils , xmlto Vcs-Git: https://anonscm.debian.org/git/kernel/linux.git Vcs-Browser: https://anonscm.debian.org/cgit/kernel/linux.git From f7cbcdd5191a944310986a97d9eebfd52fdab2c9 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 23:47:25 +0000 Subject: [PATCH 16/35] udeb: nic{,-pcmcia,-usb,-wireless}-modules: Include Ethernet, USB and wireless drivers by default --- debian/changelog | 2 + debian/installer/modules/nic-modules | 135 +++--------------- debian/installer/modules/nic-pcmcia-modules | 28 ++-- debian/installer/modules/nic-usb-modules | 42 +++--- debian/installer/modules/nic-wireless-modules | 91 +++--------- 5 files changed, 80 insertions(+), 218 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8efa0b173..509fba1cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * udeb: Combine scsi-{common,extra}-modules with scsi-modules * udeb: Use wildcards to include entire classes of drivers: - input-modules: Include HID drivers by default + - nic{,-pcmcia,-usb,-wireless}-modules: Include Ethernet, USB and wireless + drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/nic-modules b/debian/installer/modules/nic-modules index 8d35548b2..94d0125c2 100644 --- a/debian/installer/modules/nic-modules +++ b/debian/installer/modules/nic-modules @@ -1,118 +1,29 @@ -3c509 ? -3c515 ? -3c523 ? -3c527 ? -3c59x ? -8139cp -8139too -acenic ? -alx ? -amd8111e ? -arlan ? -atl1 ? -atl1c ? -atl1e ? -atl2 ? -be2net ? -bna ? -bnx2 ? -bnx2x ? -cassini ? -cs89x0 ? -cxgb ? -cxgb3 ? -cxgb4 ? -cxgb4vf ? -de2104x ? -defxx ? -dl2k -dmfe -e100 -e1000 ? -e1000e ? -enic ? -epic100 -et131x ? -fealnx -forcedeth ? -hamachi -i40e ? -igb -igbvf ? -ipg ? -ixgb ? -ixgbe ? -ixgbevf ? -jme ? -lance ? -liquidio ? -mlx4_en ? -mlx5_core ? -myri10ge ? -natsemi -ne ? -ne2 ? -ne2k-pci -netxen_nic ? -ni65 ? -niu ? -ns83820 -pch_gbe ? -pcnet32 ? -qla3xxx ? -qlcnic ? -qlge ? -r6040 -r8169 -rrunner ? -s2io ? -sc92031 ? -sfc -sis190 ? -sis900 ? -skfp -skge -sky2 -smc-ultra ? -smc9194 ? -smsc9420 ? -starfire -sundance -tehuti ? -tg3 ? -tlan ? -tulip -typhoon -uli526x ? -via-rhine ? -via-velocity ? +# Include Ethernet controller and PHY drivers by default +drivers/net/ethernet/** +drivers/net/phy/* + +# Include paravirtual network drivers with minimal dependencies vmxnet3 ? -vxge ? -wd ? -winbond-840 xen-netfront ? -yellowfin -# inet_lro is shared but now only used by myri10ge (and the iw_nes IB driver) -inet_lro ? +# Include some more obscure network driver types +drivers/net/fddi/** +drivers/net/hippi/** -# phy drivers -broadcom ? -cicada ? -davicom ? -dp83867 ? -et1011c ? -icplus ? -lxt ? -marvell ? -mdio-bitbang ? -micrel ? -national ? -qsemi ? -realtek ? -smsc ? -ste10Xp ? -vitesse ? +# Include LRO library (obsolete) +inet_lro -# VLAN +# Include VLAN driver 8021q + +# Exclude drivers packaged in nic-pcmcia-modules +drivers/net/**_cs - +b44 - +xircom_cb - + +# Exclude libraries packaged in nic-{common,shared} modules +8390 - +libphy - + +# Exclude iSCSI drivers packaged in scsi-modules +cnic - diff --git a/debian/installer/modules/nic-pcmcia-modules b/debian/installer/modules/nic-pcmcia-modules index 50334744d..03088c331 100644 --- a/debian/installer/modules/nic-pcmcia-modules +++ b/debian/installer/modules/nic-pcmcia-modules @@ -1,19 +1,13 @@ -# Common pcmcia nic modules. -3c574_cs -3c589_cs -airo_cs ? -axnet_cs +# Include PCMCIA Ethernet and wireless drivers by default +drivers/net/ethernet/**_cs +drivers/net/wireless/**_cs b44 ? -com20020_cs ? -fmvj18x_cs ? -netwave_cs ? -nmclan_cs -orinoco_cs -pcnet_cs -ray_cs -smc91c92_cs -wavelan_cs ? -xirc2ps_cs +hostap_plx ? xircom_cb -atmel_cs ? -wl3501_cs ? + +# Exclude drivers packaged in nic-wireless-modules +libertas_cs - +spectrum_cs - + +# Include some more obscure network driver types +drivers/net/arcnet/**_cs diff --git a/debian/installer/modules/nic-usb-modules b/debian/installer/modules/nic-usb-modules index 109aaae85..56226e3e5 100644 --- a/debian/installer/modules/nic-usb-modules +++ b/debian/installer/modules/nic-usb-modules @@ -1,21 +1,21 @@ -# USB wired network modules (USB wireless goes in nic-wireless-modules) -asix ? -ax88179_178a ? -catc -cdc_ether ? -dm9601 ? -g_ether ? -int51x1 ? -kaweth -mcs7830 ? -pegasus -r8152 ? -r815x ? -rndis_wlan ? -rtl8150 -rtl8187 ? -smsc75xx ? -smsc95xx ? -usbnet -zd1201 ? -zd1211rw ? +# Include USB wired drivers by default +drivers/net/usb/* + +# Include rndis_wlan, which depends on rndis_host +rndis_wlan + +# Include some other wireless drivers (for no discernable reason) +rtl8187 +zd1201 +zd1211rw + +# Exclude wireless modem drivers which need extra configuration +cdc_mbim - +cdc_ncm - +cdc-phonet - +hso - +huawei_cdc_ncm - +kalmia - +lg-vl600 - +qmi_wwan - +sierra_net - diff --git a/debian/installer/modules/nic-wireless-modules b/debian/installer/modules/nic-wireless-modules index f3100d686..b03324f7c 100644 --- a/debian/installer/modules/nic-wireless-modules +++ b/debian/installer/modules/nic-wireless-modules @@ -1,73 +1,28 @@ -adm8211 ? -ar5523 ? -at76c50x-usb ? -ath5k ? -ath6kl_sdio ? -ath6kl_usb ? -ath9k ? -ath9k_htc ? -ath10k_core ? -ath10k_pci ? -atmel_pci ? -b43 ? -b43legacy ? -brcmfmac ? -brcmsmac ? -carl9170 ? -hermes ? -hostap_pci ? -ipw2100 ? -ipw2200 ? -iwl3945 ? -iwl4965 ? -iwldvm ? -iwlmvm ? -iwlwifi ? +# Include wireless drivers by default +drivers/net/wireless/** + +# Include staging wireless drivers +prism2_usb +drivers/staging/rtl8** +vt6656_stage + +# Exclude drivers packaged in nic-pcmcia-modules +drivers/net/wireless/**_cs - +airo - +hostap_plx - + +# Don't separate these from their driver families libertas_cs ? -libertas_sdio ? -libertas_tf_usb ? -mwifiex_pcie ? -mwifiex_sdio ? -mwifiex_usb ? -mwl8k ? -orinoco ? -orinoco_nortel ? -orinoco_plx ? -orinoco_tmd ? -orinoco_usb ? -p54pci ? -p54usb -prism2_usb ? -prism54 ? -r8187se ? -r8192e_pci ? -r8192u_usb ? -r8712u ? -r8723au ? -rsi_usb ? -rt2400pci ? -rt2500pci ? -rt2500usb ? -rt2800pci ? -rt2800usb ? -rt61pci ? -rt73usb ? -rtl8180 ? -rtl8188ee ? -rtl8188eu ? -rtl818x_pci ? -rtl8192ce ? -rtl8192cu ? -rtl8192de ? -rtl8192se ? -rtl8723ae ? -rtl8723be ? -rtl8821ae ? spectrum_cs ? -usb8xxx ? -vt6656_stage ? -wavelan ? -wil6210 ? + +# Exclude drivers packaged in nic-usb-modules +rndis_wlan - +rtl8187 - +zd1201 - +zd1211rw - + +# Exclude debug driver +mac80211_hwsim - # lib80211 encryption algorithms lib80211_crypt_wep ? From d5d980eb63430b3797db7f0439214a9306a842b7 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 14 Feb 2016 23:47:57 +0000 Subject: [PATCH 17/35] udeb: {pata,sata}-modules: Include ATA drivers by default --- debian/changelog | 1 + debian/installer/modules/pata-modules | 49 +++++---------------------- debian/installer/modules/sata-modules | 21 ++++-------- 3 files changed, 17 insertions(+), 54 deletions(-) diff --git a/debian/changelog b/debian/changelog index 509fba1cf..a1e897308 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - input-modules: Include HID drivers by default - nic{,-pcmcia,-usb,-wireless}-modules: Include Ethernet, USB and wireless drivers by default + - {pata,sata}-modules: Include ATA drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/pata-modules b/debian/installer/modules/pata-modules index dd8450d65..1d963a18e 100644 --- a/debian/installer/modules/pata-modules +++ b/debian/installer/modules/pata-modules @@ -1,40 +1,9 @@ -pata_ali ? -pata_amd ? -pata_artop ? -pata_atiixp ? -pata_cmd64x ? -pata_cs5520 ? -pata_cs5530 ? -pata_cs5535 ? -pata_cypress ? -pata_efar ? -pata_hpt366 ? -pata_hpt37x ? -pata_hpt3x2n ? -pata_hpt3x3 ? -pata_isapnp ? -pata_it821x ? -pata_jmicron ? -pata_legacy ? -pata_marvell ? -pata_mpiix ? -pata_netcell ? -pata_ns87410 ? -pata_oldpiix ? -pata_opti ? -pata_optidma ? -pata_pdc2027x ? -pata_pdc202xx_old ? -pata_piccolo ? -pata_qdi ? -pata_radisys ? -pata_rdc ? -pata_rz1000 ? -pata_sc1200 ? -pata_serverworks ? -pata_sil680 ? -pata_sch ? -pata_sl82c105 ? -pata_triflex ? -pata_via ? -pata_winbond ? +# Include PATA drivers by default +drivers/ata/pata_* + +# Exclude pata_sis, which goes in sata-modules as a dependency of sata_sis +pata_sis - + +# Exclude drivers packaged in pcmcia-storage-modules +pata_ninja32 - +pata_pcmcia - diff --git a/debian/installer/modules/sata-modules b/debian/installer/modules/sata-modules index e1a90ee42..e5043ad74 100644 --- a/debian/installer/modules/sata-modules +++ b/debian/installer/modules/sata-modules @@ -1,22 +1,15 @@ -ata_piix ? -sata_nv ? -sata_promise ? -sata_sil ? -sata_sis ? +# Include SATA drivers by default +drivers/ata/sata_* + # sata-sis depends on pata-sis; avoid a dependency pata_sis ? -sata_sil24 ? -sata_svw ? -sata_sx4 ? -sata_via ? -sata_vsc ? -sata_qstor ? -sata_uli ? + +# Include more SATA drivers with unusual names +ata_piix ? ahci ? sx8 ? -sata_sx4 ? -sata_mv ? pdc_adma ? mtip32xx ? + # XXX not actually SATA nvme ? From 301a9401801d18ca78ab7f5475a1cb58f61676f6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 01:03:23 +0000 Subject: [PATCH 18/35] sound-modules: Include sound drivers by defaults --- debian/changelog | 1 + debian/installer/modules/sound-modules | 179 +++---------------------- 2 files changed, 16 insertions(+), 164 deletions(-) diff --git a/debian/changelog b/debian/changelog index a1e897308..4946e4e54 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - nic{,-pcmcia,-usb,-wireless}-modules: Include Ethernet, USB and wireless drivers by default - {pata,sata}-modules: Include ATA drivers by default + - sound-modules: Include sound drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/sound-modules b/debian/installer/modules/sound-modules index 58e15a0fc..7bd30ee8e 100644 --- a/debian/installer/modules/sound-modules +++ b/debian/installer/modules/sound-modules @@ -1,164 +1,15 @@ -snd-aaci ? -snd-ad1816a ? -snd-ad1848 ? -snd-ad1889 ? -snd-aica ? -snd-ak4113 ? -snd-ak4114 ? -snd-ak4117 ? -snd-ak4xxx-adda ? -snd-ali5451 ? -snd-als100 ? -snd-als300 ? -snd-als4000 ? -snd-aoa-codec-onyx ? -snd-aoa-codec-tas ? -snd-aoa-codec-toonie ? -snd-aoa-fabric-layout ? -snd-aoa-i2sbus ? -snd-aoa ? -snd-asihpi ? -snd-at73c213 ? -snd-atiixp ? -snd-atmel-abdac ? -snd-atmel-ac97c ? -snd-au1x00 ? -snd-au8810 ? -snd-au8820 ? -snd-au8830 ? -snd-aw2 ? -snd-azt1605 ? -snd-azt2316 ? -snd-azt2320 ? -snd-azt3328 ? -snd-bebob ? -snd-bt87x ? -snd-ca0106 ? -snd-cmi8328 ? -snd-cmi8330 ? -snd-cmipci ? -snd-cs4231 ? -snd-cs4236 ? -snd-cs4281 ? -snd-cs46xx ? -snd-cs5530 ? -snd-cs5535audio ? -snd-cs8427 ? -snd-ctxfi ? -snd-darla20 ? -snd-darla24 ? -snd-dice ? -snd-echo3g ? -snd-emu10k1 ? -snd-emu10k1x ? -snd-ens1370 ? -snd-ens1371 ? -snd-es1688 ? -snd-es18xx ? -snd-es1938 ? -snd-es1968 ? -snd-firewire-speakers ? -snd-fireworks ? -snd-fm801 ? -snd-gina20 ? -snd-gina24 ? -snd-gusclassic ? -snd-gusextreme ? -snd-gusmax ? -snd-harmony ? -snd-hda-codec-analog ? -snd-hda-codec-ca0110 ? -snd-hda-codec-ca0132 ? -snd-hda-codec-cirrus ? -snd-hda-codec-cmedia ? -snd-hda-codec-conexant ? -snd-hda-codec-generic ? -snd-hda-codec-hdmi ? -snd-hda-codec-idt ? -snd-hda-codec-realtek ? -snd-hda-codec-si3054 ? -snd-hda-codec-via ? -snd-hda-codec ? -snd-hda-intel ? -snd-hda-tegra ? -snd-hdsp ? -snd-hdspm ? -snd-ice1712 ? -snd-ice1724 ? -snd-ice17xx-ak4xxx ? -snd-indigo ? -snd-indigodj ? -snd-indigodjx ? -snd-indigoio ? -snd-indigoiox ? -snd-intel8x0 ? -snd-interwave ? -snd-interwave-stb ? -snd-interwave ? -snd-isight ? -snd-jazz16 ? -snd-korg1212 ? -snd-layla20 ? -snd-layla24 ? -snd-lola ? -snd-lx6464es ? -snd-maestro3 ? -snd-mia ? -snd-miro ? -snd-mixart ? -snd-ml403-ac97cr ? -snd-mona ? -snd-msnd-classic ? -snd-msnd-pinnacle ? -snd-nm256 ? -snd-opl3sa2 ? -snd-opti92x-ad1848 ? -snd-opti92x-cs4231 ? -snd-opti93x ? -snd-oxfw ? -snd-oxygen ? -snd-pcsp ? -snd-pcxhr ? -snd-pdaudiocf ? -snd-powermac ? -snd-pt2258 ? -snd-pxa2xx-ac97 ? -snd-pxa2xx-pcm ? -snd-riptide ? -snd-rme32 ? -snd-rme96 ? -snd-rme9652 ? -snd-sb16 ? -snd-sb8 ? -snd-sbawe ? -snd-sc6000 ? -snd-scs1x ? -snd-sgi-hal2 ? -snd-sgi-o2 ? -snd-sh_dac_audio ? -snd-sis7019 ? -snd-sonicvibes ? -snd-sscape ? -snd-sun-amd7930 ? -snd-sun-cs4231 ? -snd-sun-dbri ? -snd-trident ? -snd-ua101 ? -snd-usb-6fire ? -snd-usb-audio ? -snd-usb-caiaq ? -snd-usb-hiface ? -snd-usb-line6 ? -snd-usb-pod ? -snd-usb-podhd ? -snd-usb-toneport ? -snd-usb-us122l ? -snd-usb-usx2y ? -snd-usb-variax ? -snd-via82xx ? -snd-virtuoso ? -snd-vx222 ? -snd-vxpocket ? -snd-wavefront ? -snd-ymfpci ? -snd_ps3 ? +# Include sound drivers by default +sound/** + +# Exclude any core/shared modules that aren't pulled in by dependencies +sound/core/** - +sound/drivers/** - +sound/i2c/** - + +# Exclude synthesiser drivers +snd-adlib - +sound/**-synth - + +# Exclude soft-modem drivers +sound/**-modem - +snd-intel8x0m - From 9264d0947e8db34b49661273139bd369760c3207 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 02:39:05 +0000 Subject: [PATCH 19/35] udeb: scsi-modules: Include SCSI drivers by default --- debian/changelog | 1 + debian/installer/modules/scsi-modules | 121 ++++++++++---------------- 2 files changed, 45 insertions(+), 77 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4946e4e54..f8763a5bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium drivers by default - {pata,sata}-modules: Include ATA drivers by default - sound-modules: Include sound drivers by default + - scsi-modules: Include SCSI drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/scsi-modules b/debian/installer/modules/scsi-modules index 67df41ae2..4a5a3dbc6 100644 --- a/debian/installer/modules/scsi-modules +++ b/debian/installer/modules/scsi-modules @@ -1,83 +1,50 @@ -# host adapters -3w-9xxx ? -3w-sas ? -3w-xxxx -BusLogic ? +# Include SCSI controller drivers by default +drivers/scsi/** DAC960 -NCR53c406a ? -aacraid -advansys ? -aha152x ? -aha1542 ? -aha1740 ? -aic79xx -aic7xxx -aic94xx ? -arcmsr ? -atp870u ? -bnx2fc ? cciss -cpqarray ? -csiostor ? -dc395x ? -dmx3191d -dtc ? -eata ? -esas2r ? -fd_mcs ? -fdomain ? -fnic ? -g_NCR5380 ? -gdth ? -hpsa ? -hptiop ? -ibmmca ? -in2000 ? -initio ? -ipr ? -ips -isci ? +mptfc +mptsas +mptspi + +# Include iSCSI boot support iscsi_ibft ? -iscsi_tcp ? -lpfc ? -megaraid ? -megaraid_mbox ? -megaraid_mm ? -megaraid_sas ? -mpt3sas ? -mptbase -mptfc ? -mptsas ? -mptscsih -mptspi ? -mvsas -pas16 ? -pm80xx ? -pmcraid ? -qla1280 ? -qla2xxx ? -qla4xxx ? -qlogicfas ? -qlogicfas408 ? -sim710 ? -snic ? -stex ? -sym53c416 ? -sym53c8xx -sym53c8xx_2 ? -t128 ? -u14-34f ? -ufshcd ? -ufshcd-pci ? -ultrastor ? -vmw_pvscsi ? -wd7000 ? -wd719x ? + +# Include Xen block driver even though it's not SCSI xen-blkfront ? -# generic -sg +# Exclude hv_storvsc, packaged in hyperv-modules +hv_storvsc - -# tape -osst -st +# Exclude virtio_scsi, packaged in virtio-modules +virtio_scsi - + +# Exclude PCMCIA drivers, which depend on pcmcia-modules (FIXME) +drivers/scsi/pcmcia/* - + +# Exclude Chelsio iSCSI drivers, which depend on the corresponding Ethernet +# drivers in nic-modules (FIXME) +drivers/scsi/cxgbi/* - +cxgb3i - +cxgb4i - + +# Exclude enclosure driver +ses - + +# Exclude target drivers +tcm_qla2xxx - + +# Exclude common code packaged in {cdrom,scsi}-core-modules +scsi_mod - +sd_mod - +sr_mod - +scsi_transport_sas - +scsi_transport_spi - + +# Exclude any other common code that isn't pulled in by dependencies +drivers/scsi/device_handler/* - +drivers/scsi/lib** - +drivers/scsi/osd/* - +drivers/scsi/scsi_transport_* - +fcoe - +raid_class - +scsi_debug - From acd4224ce8f6f413c7d1d72f1f918ad72771b5f6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 02:46:49 +0000 Subject: [PATCH 20/35] usb-modules: Include USB host drivers by default --- debian/changelog | 1 + debian/installer/modules/usb-modules | 22 +++++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index f8763a5bd..17a505f5a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - {pata,sata}-modules: Include ATA drivers by default - sound-modules: Include sound drivers by default - scsi-modules: Include SCSI drivers by default + - usb-modules: Include USB host drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/usb-modules b/debian/installer/modules/usb-modules index 025008c9d..3198f1039 100644 --- a/debian/installer/modules/usb-modules +++ b/debian/installer/modules/usb-modules @@ -1,13 +1,9 @@ -ehci-hcd ? -ehci-pci ? -ehci-platform ? -ohci-hcd ? -ohci-pci ? -ohci-platform ? -uhci-hcd ? -xhci-hcd ? -xhci-pci ? -xhci-plat-hcd ? -usbcore ? -dwc3 ? -usb3503 ? +# Include USB host drivers by default +drivers/usb/host/** + +# Exclude some obscure host drivers +hwa-hc - +sl811_cs - +sl811-hcd - +u132-hcd - +whci-hcd - From 7d12e0fcef205642b207e796be1a09e3fcb20cdb Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 02:55:20 +0000 Subject: [PATCH 21/35] usb-serial-modules: Include USB serial drivers by default --- debian/changelog | 1 + debian/installer/modules/usb-serial-modules | 38 +++++++++++++++------ 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 17a505f5a..694ef8b0d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - sound-modules: Include sound drivers by default - scsi-modules: Include SCSI drivers by default - usb-modules: Include USB host drivers by default + - usb-serial-modules: Include USB serial drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/usb-serial-modules b/debian/installer/modules/usb-serial-modules index 0a4da4ab9..28f3aa760 100644 --- a/debian/installer/modules/usb-serial-modules +++ b/debian/installer/modules/usb-serial-modules @@ -1,10 +1,28 @@ -usbserial -belkin_sa ? -digi_acceleport ? -f81232 ? -ftdi_sio ? -mct_u232 ? -pl2303 ? -quatech2 ? -spcp8x5 ? -zte_ev ? +# Include USB serial drivers by default +drivers/usb/serial/* + +# Exclude drivers that are useless for serial consoles +aircable - +cyberjack - +cypress_m8 - +empeg - +garmin_gps - +ipaq - +ipw - +ir-usb - +iuu_phoenix - +kobil_sct - +metro-usb - +navman - +omninet - +opticon - +option - +qcaux - +qcserial - +sierra - +symbolserial - +usb_debug - +usb_wwan - +visor - +wishbone-serial - +xsens_mt - From b01f6d01feed1282c60f877612c98a9e85242b3a Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 02:56:11 +0000 Subject: [PATCH 22/35] usb-storage-modules: Include USB storage drivers by default --- debian/changelog | 1 + debian/installer/modules/usb-storage-modules | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 694ef8b0d..0d5754e0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - scsi-modules: Include SCSI drivers by default - usb-modules: Include USB host drivers by default - usb-serial-modules: Include USB serial drivers by default + - usb-storage-modules: Include USB storage drivers by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/usb-storage-modules b/debian/installer/modules/usb-storage-modules index b567b94d4..013c58cfc 100644 --- a/debian/installer/modules/usb-storage-modules +++ b/debian/installer/modules/usb-storage-modules @@ -1,14 +1,2 @@ -usb-storage -ums-alauda -ums-cypress -ums-datafab -ums-eneub6250 -ums-freecom -ums-isd200 -ums-jumpshot -ums-karma -ums-onetouch -ums-realtek -ums-sddr09 -ums-sddr55 -ums-usbat +# Include USB storage drivers by default +drivers/usb/storage/* From 740fbe327ec4d685328bce2b98340dc06bc30bb9 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 03:29:32 +0000 Subject: [PATCH 23/35] udeb: nic-modules: Remove FDDI and HIPPI drivers, and inet_lro module --- debian/changelog | 2 ++ debian/installer/modules/nic-modules | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0d5754e0c..bbfa245aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - usb-modules: Include USB host drivers by default - usb-serial-modules: Include USB serial drivers by default - usb-storage-modules: Include USB storage drivers by default + * udeb: Remove some obsolete drivers: + - nic-modules: Remove FDDI and HIPPI drivers, and inet_lro module [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/nic-modules b/debian/installer/modules/nic-modules index 94d0125c2..276d35a81 100644 --- a/debian/installer/modules/nic-modules +++ b/debian/installer/modules/nic-modules @@ -6,13 +6,6 @@ drivers/net/phy/* vmxnet3 ? xen-netfront ? -# Include some more obscure network driver types -drivers/net/fddi/** -drivers/net/hippi/** - -# Include LRO library (obsolete) -inet_lro - # Include VLAN driver 8021q From c66e31d10c64c15bb21d584f20087c121a30b4b5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 03:29:43 +0000 Subject: [PATCH 24/35] udeb: nic-pcmcia-modules: Remove Arcnet drivers --- debian/changelog | 1 + debian/installer/modules/nic-pcmcia-modules | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index bbfa245aa..6a9f0b794 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - usb-storage-modules: Include USB storage drivers by default * udeb: Remove some obsolete drivers: - nic-modules: Remove FDDI and HIPPI drivers, and inet_lro module + - nic-pcmcia-modules: Remove Arcnet drivers [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/nic-pcmcia-modules b/debian/installer/modules/nic-pcmcia-modules index 03088c331..31c360d5a 100644 --- a/debian/installer/modules/nic-pcmcia-modules +++ b/debian/installer/modules/nic-pcmcia-modules @@ -8,6 +8,3 @@ xircom_cb # Exclude drivers packaged in nic-wireless-modules libertas_cs - spectrum_cs - - -# Include some more obscure network driver types -drivers/net/arcnet/**_cs From 306abaa161196d4903405181cf80b84daa9064d0 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 03:31:59 +0000 Subject: [PATCH 25/35] udeb: Move most USB wireless drivers from nic-usb-modules to nic-wireless-modules --- debian/changelog | 2 ++ debian/installer/modules/nic-usb-modules | 5 ----- debian/installer/modules/nic-wireless-modules | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a9f0b794..ba1468cb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * udeb: Remove some obsolete drivers: - nic-modules: Remove FDDI and HIPPI drivers, and inet_lro module - nic-pcmcia-modules: Remove Arcnet drivers + * udeb: Move most USB wireless drivers from nic-usb-modules to + nic-wireless-modules [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/nic-usb-modules b/debian/installer/modules/nic-usb-modules index 56226e3e5..61f9f361d 100644 --- a/debian/installer/modules/nic-usb-modules +++ b/debian/installer/modules/nic-usb-modules @@ -4,11 +4,6 @@ drivers/net/usb/* # Include rndis_wlan, which depends on rndis_host rndis_wlan -# Include some other wireless drivers (for no discernable reason) -rtl8187 -zd1201 -zd1211rw - # Exclude wireless modem drivers which need extra configuration cdc_mbim - cdc_ncm - diff --git a/debian/installer/modules/nic-wireless-modules b/debian/installer/modules/nic-wireless-modules index b03324f7c..ec7532b71 100644 --- a/debian/installer/modules/nic-wireless-modules +++ b/debian/installer/modules/nic-wireless-modules @@ -17,9 +17,6 @@ spectrum_cs ? # Exclude drivers packaged in nic-usb-modules rndis_wlan - -rtl8187 - -zd1201 - -zd1211rw - # Exclude debug driver mac80211_hwsim - From a5a866d11296e831fe5a719d9c6db676ecbfb9bc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 15:22:31 +0000 Subject: [PATCH 26/35] udeb: Really add virtio_input to virtio-modules (not input-modules) kernel-wedge is sensitive to the difference between '-' and '_' so adding 'virtio-input ?' to input-modules had no effect. If we really added virtio_input to input-modules then we would end up with virtio and virtio_ring duplicated. Instead, add it to virtio-modules like all the other virtio drivers. --- debian/changelog | 1 + debian/installer/modules/input-modules | 1 - debian/installer/modules/virtio-modules | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ba1468cb3..dd26cde3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - nic-pcmcia-modules: Remove Arcnet drivers * udeb: Move most USB wireless drivers from nic-usb-modules to nic-wireless-modules + * udeb: Really add virtio_input to virtio-modules (not input-modules) [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/input-modules b/debian/installer/modules/input-modules index f2ce5ed13..3245d16ea 100644 --- a/debian/installer/modules/input-modules +++ b/debian/installer/modules/input-modules @@ -35,6 +35,5 @@ wacom - # Miscellaneous input drivers synaptics_usb ? wistron_btns ? -virtio-input ? gpio_keys ? soc_button_array ? diff --git a/debian/installer/modules/virtio-modules b/debian/installer/modules/virtio-modules index 01c6997e8..bb8947525 100644 --- a/debian/installer/modules/virtio-modules +++ b/debian/installer/modules/virtio-modules @@ -2,6 +2,7 @@ virtio_net virtio_blk virtio_balloon virtio_scsi +virtio_input # Some architectures do not have PCI bus virtio_pci ? From feb964cdac40800b0bbab4043cf9d5d457cc5923 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 19:28:32 +0000 Subject: [PATCH 27/35] [armel/marvell] udeb: Remove inet_lro from nic-modules --- debian/installer/armel/modules/armel-marvell/nic-modules | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/installer/armel/modules/armel-marvell/nic-modules b/debian/installer/armel/modules/armel-marvell/nic-modules index 9f90d9e3c..1a2cdb1fc 100644 --- a/debian/installer/armel/modules/armel-marvell/nic-modules +++ b/debian/installer/armel/modules/armel-marvell/nic-modules @@ -1,3 +1,2 @@ -inet_lro mv643xx_eth mvmdio From 5b76884dc265e8166262bc834bdad7af13f57881 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 22:56:18 +0000 Subject: [PATCH 28/35] [amd64] efi: Build our own page table structure This avoids adding W+X pages to the default page table, which is not only bad for security but also now triggers a warning on boot. --- debian/changelog | 2 + ...-build-our-own-page-table-structures.patch | 319 ++++++++++++++++++ ...ge-table-switching-code-into-efi_cal.patch | 215 ++++++++++++ ...into-the-identity-page-table-for-mix.patch | 71 ++++ ...parate-efi-page-tables-in-kexec-path.patch | 83 +++++ ...n-the-_end-symbol-to-avoid-pfn-conve.patch | 53 +++ ...e-cpa-pfn-only-contains-page-frame-n.patch | 144 ++++++++ debian/patches/series | 6 + 8 files changed, 893 insertions(+) create mode 100644 debian/patches/bugfix/x86/x86-efi-build-our-own-page-table-structures.patch create mode 100644 debian/patches/bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch create mode 100644 debian/patches/bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch create mode 100644 debian/patches/bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch create mode 100644 debian/patches/bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch create mode 100644 debian/patches/bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch diff --git a/debian/changelog b/debian/changelog index dd26cde3b..25f873941 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * udeb: Move most USB wireless drivers from nic-usb-modules to nic-wireless-modules * udeb: Really add virtio_input to virtio-modules (not input-modules) + * [x86] Fix issues resulting in W+X pages: + - [amd64] efi: Build our own page table structure [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/bugfix/x86/x86-efi-build-our-own-page-table-structures.patch b/debian/patches/bugfix/x86/x86-efi-build-our-own-page-table-structures.patch new file mode 100644 index 000000000..2c61994ef --- /dev/null +++ b/debian/patches/bugfix/x86/x86-efi-build-our-own-page-table-structures.patch @@ -0,0 +1,319 @@ +From: Matt Fleming +Date: Fri, 27 Nov 2015 21:09:34 +0000 +Subject: [5/5] x86/efi: Build our own page table structures +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=67a9108ed4313b85a9c53406d80dc1ae3f8c3e36 + +With commit e1a58320a38d ("x86/mm: Warn on W^X mappings") all +users booting on 64-bit UEFI machines see the following warning, + + ------------[ cut here ]------------ + WARNING: CPU: 7 PID: 1 at arch/x86/mm/dump_pagetables.c:225 note_page+0x5dc/0x780() + x86/mm: Found insecure W+X mapping at address ffff88000005f000/0xffff88000005f000 + ... + x86/mm: Checked W+X mappings: FAILED, 165660 W+X pages found. + ... + +This is caused by mapping EFI regions with RWX permissions. +There isn't much we can do to restrict the permissions for these +regions due to the way the firmware toolchains mix code and +data, but we can at least isolate these mappings so that they do +not appear in the regular kernel page tables. + +In commit d2f7cbe7b26a ("x86/efi: Runtime services virtual +mapping") we started using 'trampoline_pgd' to map the EFI +regions because there was an existing identity mapping there +which we use during the SetVirtualAddressMap() call and for +broken firmware that accesses those addresses. + +But 'trampoline_pgd' shares some PGD entries with +'swapper_pg_dir' and does not provide the isolation we require. +Notably the virtual address for __START_KERNEL_map and +MODULES_START are mapped by the same PGD entry so we need to be +more careful when copying changes over in +efi_sync_low_kernel_mappings(). + +This patch doesn't go the full mile, we still want to share some +PGD entries with 'swapper_pg_dir'. Having completely separate +page tables brings its own issues such as synchronising new +mappings after memory hotplug and module loading. Sharing also +keeps memory usage down. + +Signed-off-by: Matt Fleming +Reviewed-by: Borislav Petkov +Acked-by: Borislav Petkov +Cc: Andrew Morton +Cc: Andy Lutomirski +Cc: Andy Lutomirski +Cc: Ard Biesheuvel +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Jones +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Sai Praneeth Prakhya +Cc: Stephen Smalley +Cc: Thomas Gleixner +Cc: Toshi Kani +Cc: linux-efi@vger.kernel.org +Link: http://lkml.kernel.org/r/1448658575-17029-6-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/include/asm/efi.h | 1 + + arch/x86/platform/efi/efi.c | 39 ++++++----------- + arch/x86/platform/efi/efi_32.c | 5 +++ + arch/x86/platform/efi/efi_64.c | 97 +++++++++++++++++++++++++++++++++++------- + 4 files changed, 102 insertions(+), 40 deletions(-) + +diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h +index 347eeacb06a8..8fd9e637629a 100644 +--- a/arch/x86/include/asm/efi.h ++++ b/arch/x86/include/asm/efi.h +@@ -136,6 +136,7 @@ extern void __init efi_memory_uc(u64 addr, unsigned long size); + extern void __init efi_map_region(efi_memory_desc_t *md); + extern void __init efi_map_region_fixed(efi_memory_desc_t *md); + extern void efi_sync_low_kernel_mappings(void); ++extern int __init efi_alloc_page_tables(void); + extern int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages); + extern void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages); + extern void __init old_map_region(efi_memory_desc_t *md); +diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c +index ad285404ea7f..3c1f3cd7b2ba 100644 +--- a/arch/x86/platform/efi/efi.c ++++ b/arch/x86/platform/efi/efi.c +@@ -869,7 +869,7 @@ static void __init kexec_enter_virtual_mode(void) + * This function will switch the EFI runtime services to virtual mode. + * Essentially, we look through the EFI memmap and map every region that + * has the runtime attribute bit set in its memory descriptor into the +- * ->trampoline_pgd page table using a top-down VA allocation scheme. ++ * efi_pgd page table. + * + * The old method which used to update that memory descriptor with the + * virtual address obtained from ioremap() is still supported when the +@@ -879,8 +879,8 @@ static void __init kexec_enter_virtual_mode(void) + * + * The new method does a pagetable switch in a preemption-safe manner + * so that we're in a different address space when calling a runtime +- * function. For function arguments passing we do copy the PGDs of the +- * kernel page table into ->trampoline_pgd prior to each call. ++ * function. For function arguments passing we do copy the PUDs of the ++ * kernel page table into efi_pgd prior to each call. + * + * Specially for kexec boot, efi runtime maps in previous kernel should + * be passed in via setup_data. In that case runtime ranges will be mapped +@@ -895,6 +895,12 @@ static void __init __efi_enter_virtual_mode(void) + + efi.systab = NULL; + ++ if (efi_alloc_page_tables()) { ++ pr_err("Failed to allocate EFI page tables\n"); ++ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); ++ return; ++ } ++ + efi_merge_regions(); + new_memmap = efi_map_regions(&count, &pg_shift); + if (!new_memmap) { +@@ -954,28 +960,11 @@ static void __init __efi_enter_virtual_mode(void) + efi_runtime_mkexec(); + + /* +- * We mapped the descriptor array into the EFI pagetable above but we're +- * not unmapping it here. Here's why: +- * +- * We're copying select PGDs from the kernel page table to the EFI page +- * table and when we do so and make changes to those PGDs like unmapping +- * stuff from them, those changes appear in the kernel page table and we +- * go boom. +- * +- * From setup_real_mode(): +- * +- * ... +- * trampoline_pgd[0] = init_level4_pgt[pgd_index(__PAGE_OFFSET)].pgd; +- * +- * In this particular case, our allocation is in PGD 0 of the EFI page +- * table but we've copied that PGD from PGD[272] of the EFI page table: +- * +- * pgd_index(__PAGE_OFFSET = 0xffff880000000000) = 272 +- * +- * where the direct memory mapping in kernel space is. +- * +- * new_memmap's VA comes from that direct mapping and thus clearing it, +- * it would get cleared in the kernel page table too. ++ * We mapped the descriptor array into the EFI pagetable above ++ * but we're not unmapping it here because if we're running in ++ * EFI mixed mode we need all of memory to be accessible when ++ * we pass parameters to the EFI runtime services in the ++ * thunking code. + * + * efi_cleanup_page_tables(__pa(new_memmap), 1 << pg_shift); + */ +diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c +index ed5b67338294..58d669bc8250 100644 +--- a/arch/x86/platform/efi/efi_32.c ++++ b/arch/x86/platform/efi/efi_32.c +@@ -38,6 +38,11 @@ + * say 0 - 3G. + */ + ++int __init efi_alloc_page_tables(void) ++{ ++ return 0; ++} ++ + void efi_sync_low_kernel_mappings(void) {} + void __init efi_dump_pagetable(void) {} + int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index b19cdac959b2..4897f518760f 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + /* + * We allocate runtime services regions bottom-up, starting from -4G, i.e. +@@ -121,22 +122,92 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) + early_code_mapping_set_exec(0); + } + ++static pgd_t *efi_pgd; ++ ++/* ++ * We need our own copy of the higher levels of the page tables ++ * because we want to avoid inserting EFI region mappings (EFI_VA_END ++ * to EFI_VA_START) into the standard kernel page tables. Everything ++ * else can be shared, see efi_sync_low_kernel_mappings(). ++ */ ++int __init efi_alloc_page_tables(void) ++{ ++ pgd_t *pgd; ++ pud_t *pud; ++ gfp_t gfp_mask; ++ ++ if (efi_enabled(EFI_OLD_MEMMAP)) ++ return 0; ++ ++ gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO; ++ efi_pgd = (pgd_t *)__get_free_page(gfp_mask); ++ if (!efi_pgd) ++ return -ENOMEM; ++ ++ pgd = efi_pgd + pgd_index(EFI_VA_END); ++ ++ pud = pud_alloc_one(NULL, 0); ++ if (!pud) { ++ free_page((unsigned long)efi_pgd); ++ return -ENOMEM; ++ } ++ ++ pgd_populate(NULL, pgd, pud); ++ ++ return 0; ++} ++ + /* + * Add low kernel mappings for passing arguments to EFI functions. + */ + void efi_sync_low_kernel_mappings(void) + { +- unsigned num_pgds; +- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); ++ unsigned num_entries; ++ pgd_t *pgd_k, *pgd_efi; ++ pud_t *pud_k, *pud_efi; + + if (efi_enabled(EFI_OLD_MEMMAP)) + return; + +- num_pgds = pgd_index(MODULES_END - 1) - pgd_index(PAGE_OFFSET); ++ /* ++ * We can share all PGD entries apart from the one entry that ++ * covers the EFI runtime mapping space. ++ * ++ * Make sure the EFI runtime region mappings are guaranteed to ++ * only span a single PGD entry and that the entry also maps ++ * other important kernel regions. ++ */ ++ BUILD_BUG_ON(pgd_index(EFI_VA_END) != pgd_index(MODULES_END)); ++ BUILD_BUG_ON((EFI_VA_START & PGDIR_MASK) != ++ (EFI_VA_END & PGDIR_MASK)); ++ ++ pgd_efi = efi_pgd + pgd_index(PAGE_OFFSET); ++ pgd_k = pgd_offset_k(PAGE_OFFSET); ++ ++ num_entries = pgd_index(EFI_VA_END) - pgd_index(PAGE_OFFSET); ++ memcpy(pgd_efi, pgd_k, sizeof(pgd_t) * num_entries); + +- memcpy(pgd + pgd_index(PAGE_OFFSET), +- init_mm.pgd + pgd_index(PAGE_OFFSET), +- sizeof(pgd_t) * num_pgds); ++ /* ++ * We share all the PUD entries apart from those that map the ++ * EFI regions. Copy around them. ++ */ ++ BUILD_BUG_ON((EFI_VA_START & ~PUD_MASK) != 0); ++ BUILD_BUG_ON((EFI_VA_END & ~PUD_MASK) != 0); ++ ++ pgd_efi = efi_pgd + pgd_index(EFI_VA_END); ++ pud_efi = pud_offset(pgd_efi, 0); ++ ++ pgd_k = pgd_offset_k(EFI_VA_END); ++ pud_k = pud_offset(pgd_k, 0); ++ ++ num_entries = pud_index(EFI_VA_END); ++ memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries); ++ ++ pud_efi = pud_offset(pgd_efi, EFI_VA_START); ++ pud_k = pud_offset(pgd_k, EFI_VA_START); ++ ++ num_entries = PTRS_PER_PUD - pud_index(EFI_VA_START); ++ memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries); + } + + int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) +@@ -150,8 +221,8 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + if (efi_enabled(EFI_OLD_MEMMAP)) + return 0; + +- efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd; +- pgd = __va(efi_scratch.efi_pgt); ++ efi_scratch.efi_pgt = (pgd_t *)__pa(efi_pgd); ++ pgd = efi_pgd; + + /* + * It can happen that the physical address of new_memmap lands in memory +@@ -216,16 +287,14 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + + void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) + { +- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); +- +- kernel_unmap_pages_in_pgd(pgd, pa_memmap, num_pages); ++ kernel_unmap_pages_in_pgd(efi_pgd, pa_memmap, num_pages); + } + + static void __init __map_region(efi_memory_desc_t *md, u64 va) + { +- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); + unsigned long flags = 0; + unsigned long pfn; ++ pgd_t *pgd = efi_pgd; + + if (!(md->attribute & EFI_MEMORY_WB)) + flags |= _PAGE_PCD; +@@ -334,9 +403,7 @@ void __init efi_runtime_mkexec(void) + void __init efi_dump_pagetable(void) + { + #ifdef CONFIG_EFI_PGT_DUMP +- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); +- +- ptdump_walk_pgd_level(NULL, pgd); ++ ptdump_walk_pgd_level(NULL, efi_pgd); + #endif + } + diff --git a/debian/patches/bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch b/debian/patches/bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch new file mode 100644 index 000000000..4b3230ebc --- /dev/null +++ b/debian/patches/bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch @@ -0,0 +1,215 @@ +From: Matt Fleming +Date: Fri, 27 Nov 2015 21:09:33 +0000 +Subject: [4/5] x86/efi: Hoist page table switching code into efi_call_virt() +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=c9f2a9a65e4855b74d92cdad688f6ee4a1a323ff + +This change is a prerequisite for pending patches that switch to +a dedicated EFI page table, instead of using 'trampoline_pgd' +which shares PGD entries with 'swapper_pg_dir'. The pending +patches make it impossible to dereference the runtime service +function pointer without first switching %cr3. + +It's true that we now have duplicated switching code in +efi_call_virt() and efi_call_phys_{prolog,epilog}() but we are +sacrificing code duplication for a little more clarity and the +ease of writing the page table switching code in C instead of +asm. + +Signed-off-by: Matt Fleming +Reviewed-by: Borislav Petkov +Acked-by: Borislav Petkov +Cc: Andrew Morton +Cc: Andy Lutomirski +Cc: Andy Lutomirski +Cc: Ard Biesheuvel +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Jones +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Sai Praneeth Prakhya +Cc: Stephen Smalley +Cc: Thomas Gleixner +Cc: Toshi Kani +Cc: linux-efi@vger.kernel.org +Link: http://lkml.kernel.org/r/1448658575-17029-5-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/include/asm/efi.h | 25 +++++++++++++++++++++ + arch/x86/platform/efi/efi_64.c | 24 ++++++++++----------- + arch/x86/platform/efi/efi_stub_64.S | 43 ------------------------------------- + 3 files changed, 36 insertions(+), 56 deletions(-) + +diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h +index 0010c78c4998..347eeacb06a8 100644 +--- a/arch/x86/include/asm/efi.h ++++ b/arch/x86/include/asm/efi.h +@@ -3,6 +3,7 @@ + + #include + #include ++#include + + /* + * We map the EFI regions needed for runtime services non-contiguously, +@@ -64,6 +65,17 @@ extern u64 asmlinkage efi_call(void *fp, ...); + + #define efi_call_phys(f, args...) efi_call((f), args) + ++/* ++ * Scratch space used for switching the pagetable in the EFI stub ++ */ ++struct efi_scratch { ++ u64 r15; ++ u64 prev_cr3; ++ pgd_t *efi_pgt; ++ bool use_pgd; ++ u64 phys_stack; ++} __packed; ++ + #define efi_call_virt(f, ...) \ + ({ \ + efi_status_t __s; \ +@@ -71,7 +83,20 @@ extern u64 asmlinkage efi_call(void *fp, ...); + efi_sync_low_kernel_mappings(); \ + preempt_disable(); \ + __kernel_fpu_begin(); \ ++ \ ++ if (efi_scratch.use_pgd) { \ ++ efi_scratch.prev_cr3 = read_cr3(); \ ++ write_cr3((unsigned long)efi_scratch.efi_pgt); \ ++ __flush_tlb_all(); \ ++ } \ ++ \ + __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \ ++ \ ++ if (efi_scratch.use_pgd) { \ ++ write_cr3(efi_scratch.prev_cr3); \ ++ __flush_tlb_all(); \ ++ } \ ++ \ + __kernel_fpu_end(); \ + preempt_enable(); \ + __s; \ +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index 102976dda8c4..b19cdac959b2 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -47,16 +47,7 @@ + */ + static u64 efi_va = EFI_VA_START; + +-/* +- * Scratch space used for switching the pagetable in the EFI stub +- */ +-struct efi_scratch { +- u64 r15; +- u64 prev_cr3; +- pgd_t *efi_pgt; +- bool use_pgd; +- u64 phys_stack; +-} __packed; ++struct efi_scratch efi_scratch; + + static void __init early_code_mapping_set_exec(int executable) + { +@@ -83,8 +74,11 @@ pgd_t * __init efi_call_phys_prolog(void) + int pgd; + int n_pgds; + +- if (!efi_enabled(EFI_OLD_MEMMAP)) +- return NULL; ++ if (!efi_enabled(EFI_OLD_MEMMAP)) { ++ save_pgd = (pgd_t *)read_cr3(); ++ write_cr3((unsigned long)efi_scratch.efi_pgt); ++ goto out; ++ } + + early_code_mapping_set_exec(1); + +@@ -96,6 +90,7 @@ pgd_t * __init efi_call_phys_prolog(void) + vaddress = (unsigned long)__va(pgd * PGDIR_SIZE); + set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress)); + } ++out: + __flush_tlb_all(); + + return save_pgd; +@@ -109,8 +104,11 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) + int pgd_idx; + int nr_pgds; + +- if (!save_pgd) ++ if (!efi_enabled(EFI_OLD_MEMMAP)) { ++ write_cr3((unsigned long)save_pgd); ++ __flush_tlb_all(); + return; ++ } + + nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE); + +diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S +index 86d0f9e08dd9..32020cb8bb08 100644 +--- a/arch/x86/platform/efi/efi_stub_64.S ++++ b/arch/x86/platform/efi/efi_stub_64.S +@@ -38,41 +38,6 @@ + mov %rsi, %cr0; \ + mov (%rsp), %rsp + +- /* stolen from gcc */ +- .macro FLUSH_TLB_ALL +- movq %r15, efi_scratch(%rip) +- movq %r14, efi_scratch+8(%rip) +- movq %cr4, %r15 +- movq %r15, %r14 +- andb $0x7f, %r14b +- movq %r14, %cr4 +- movq %r15, %cr4 +- movq efi_scratch+8(%rip), %r14 +- movq efi_scratch(%rip), %r15 +- .endm +- +- .macro SWITCH_PGT +- cmpb $0, efi_scratch+24(%rip) +- je 1f +- movq %r15, efi_scratch(%rip) # r15 +- # save previous CR3 +- movq %cr3, %r15 +- movq %r15, efi_scratch+8(%rip) # prev_cr3 +- movq efi_scratch+16(%rip), %r15 # EFI pgt +- movq %r15, %cr3 +- 1: +- .endm +- +- .macro RESTORE_PGT +- cmpb $0, efi_scratch+24(%rip) +- je 2f +- movq efi_scratch+8(%rip), %r15 +- movq %r15, %cr3 +- movq efi_scratch(%rip), %r15 +- FLUSH_TLB_ALL +- 2: +- .endm +- + ENTRY(efi_call) + SAVE_XMM + mov (%rsp), %rax +@@ -83,16 +48,8 @@ ENTRY(efi_call) + mov %r8, %r9 + mov %rcx, %r8 + mov %rsi, %rcx +- SWITCH_PGT + call *%rdi +- RESTORE_PGT + addq $48, %rsp + RESTORE_XMM + ret + ENDPROC(efi_call) +- +- .data +-ENTRY(efi_scratch) +- .fill 3,8,0 +- .byte 0 +- .quad 0 diff --git a/debian/patches/bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch b/debian/patches/bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch new file mode 100644 index 000000000..8d2bddcdc --- /dev/null +++ b/debian/patches/bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch @@ -0,0 +1,71 @@ +From: Matt Fleming +Date: Fri, 27 Nov 2015 21:09:32 +0000 +Subject: [3/5] x86/efi: Map RAM into the identity page table for mixed mode +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=b61a76f8850d2979550abc42d7e09154ebb8d785 + +We are relying on the pre-existing mappings in 'trampoline_pgd' +when accessing function arguments in the EFI mixed mode thunking +code. + +Instead let's map memory explicitly so that things will continue +to work when we move to a separate page table in the future. + +Signed-off-by: Matt Fleming +Reviewed-by: Borislav Petkov +Acked-by: Borislav Petkov +Cc: Andy Lutomirski +Cc: Ard Biesheuvel +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Sai Praneeth Prakhya +Cc: Thomas Gleixner +Cc: Toshi Kani +Cc: linux-efi@vger.kernel.org +Link: http://lkml.kernel.org/r/1448658575-17029-4-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/platform/efi/efi_64.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index 5aa186db59e3..102976dda8c4 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -144,6 +144,7 @@ void efi_sync_low_kernel_mappings(void) + int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + { + unsigned long pfn, text; ++ efi_memory_desc_t *md; + struct page *page; + unsigned npages; + pgd_t *pgd; +@@ -177,6 +178,25 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + if (!IS_ENABLED(CONFIG_EFI_MIXED)) + return 0; + ++ /* ++ * Map all of RAM so that we can access arguments in the 1:1 ++ * mapping when making EFI runtime calls. ++ */ ++ for_each_efi_memory_desc(&memmap, md) { ++ if (md->type != EFI_CONVENTIONAL_MEMORY && ++ md->type != EFI_LOADER_DATA && ++ md->type != EFI_LOADER_CODE) ++ continue; ++ ++ pfn = md->phys_addr >> PAGE_SHIFT; ++ npages = md->num_pages; ++ ++ if (kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, npages, 0)) { ++ pr_err("Failed to map 1:1 memory\n"); ++ return 1; ++ } ++ } ++ + page = alloc_page(GFP_KERNEL|__GFP_DMA32); + if (!page) + panic("Unable to allocate EFI runtime stack < 4GB\n"); diff --git a/debian/patches/bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch b/debian/patches/bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch new file mode 100644 index 000000000..b95ee8f3a --- /dev/null +++ b/debian/patches/bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch @@ -0,0 +1,83 @@ +From: Matt Fleming +Date: Thu, 21 Jan 2016 14:11:59 +0000 +Subject: x86/efi: Setup separate EFI page tables in kexec paths +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=753b11ef8e92a1c1bbe97f2a5ec14bdd1ef2e6fe + +The switch to using a new dedicated page table for EFI runtime +calls in commit commit 67a9108ed431 ("x86/efi: Build our own +page table structures") failed to take into account changes +required for the kexec code paths, which are unfortunately +duplicated in the EFI code. + +Call the allocation and setup functions in +kexec_enter_virtual_mode() just like we do for +__efi_enter_virtual_mode() to avoid hitting NULL-pointer +dereferences when making EFI runtime calls. + +At the very least, the call to efi_setup_page_tables() should +have existed for kexec before the following commit: + + 67a9108ed431 ("x86/efi: Build our own page table structures") + +Things just magically worked because we were actually using +the kernel's page tables that contained the required mappings. + +Reported-by: Srikar Dronamraju +Tested-by: Srikar Dronamraju +Signed-off-by: Matt Fleming +Cc: Andy Lutomirski +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Young +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Raghavendra K T +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/1453385519-11477-1-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/platform/efi/efi.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c +index 3c1f3cd7b2ba..bdd9477f937c 100644 +--- a/arch/x86/platform/efi/efi.c ++++ b/arch/x86/platform/efi/efi.c +@@ -815,6 +815,7 @@ static void __init kexec_enter_virtual_mode(void) + { + #ifdef CONFIG_KEXEC_CORE + efi_memory_desc_t *md; ++ unsigned int num_pages; + void *p; + + efi.systab = NULL; +@@ -829,6 +830,12 @@ static void __init kexec_enter_virtual_mode(void) + return; + } + ++ if (efi_alloc_page_tables()) { ++ pr_err("Failed to allocate EFI page tables\n"); ++ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); ++ return; ++ } ++ + /* + * Map efi regions which were passed via setup_data. The virt_addr is a + * fixed addr which was used in first kernel of a kexec boot. +@@ -843,6 +850,14 @@ static void __init kexec_enter_virtual_mode(void) + + BUG_ON(!efi.systab); + ++ num_pages = ALIGN(memmap.nr_map * memmap.desc_size, PAGE_SIZE); ++ num_pages >>= PAGE_SHIFT; ++ ++ if (efi_setup_page_tables(memmap.phys_map, num_pages)) { ++ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); ++ return; ++ } ++ + efi_sync_low_kernel_mappings(); + + /* diff --git a/debian/patches/bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch b/debian/patches/bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch new file mode 100644 index 000000000..0fb24e077 --- /dev/null +++ b/debian/patches/bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch @@ -0,0 +1,53 @@ +From: Matt Fleming +Date: Fri, 27 Nov 2015 21:09:30 +0000 +Subject: [1/5] x86/mm: Page align the '_end' symbol to avoid pfn conversion + bugs +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=21cdb6b568435738cc0b303b2b3b82742396310c + +Ingo noted that if we can guarantee _end is aligned to PAGE_SIZE +we can automatically avoid bugs along the lines of, + + size = _end - _text >> PAGE_SHIFT + +which is missing a call to PFN_ALIGN(). The EFI mixed mode +contains this bug, for example. + +_text is already aligned to PAGE_SIZE through the use of +LOAD_PHYSICAL_ADDR, and the BSS and BRK sections are explicitly +aligned in the linker script, so it makes sense to align _end to +match. + +Reported-by: Ingo Molnar +Signed-off-by: Matt Fleming +Acked-by: Borislav Petkov +Cc: Andy Lutomirski +Cc: Ard Biesheuvel +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Hansen +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Sai Praneeth Prakhya +Cc: Thomas Gleixner +Cc: Toshi Kani +Cc: linux-efi@vger.kernel.org +Link: http://lkml.kernel.org/r/1448658575-17029-2-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/kernel/vmlinux.lds.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S +index 74e4bf11f562..4f1994257a18 100644 +--- a/arch/x86/kernel/vmlinux.lds.S ++++ b/arch/x86/kernel/vmlinux.lds.S +@@ -325,6 +325,7 @@ SECTIONS + __brk_limit = .; + } + ++ . = ALIGN(PAGE_SIZE); + _end = .; + + STABS_DEBUG diff --git a/debian/patches/bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch b/debian/patches/bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch new file mode 100644 index 000000000..b7db9a3be --- /dev/null +++ b/debian/patches/bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch @@ -0,0 +1,144 @@ +From: Matt Fleming +Date: Fri, 27 Nov 2015 21:09:31 +0000 +Subject: [2/5] x86/mm/pat: Ensure cpa->pfn only contains page frame numbers +Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=edc3b9129cecd0f0857112136f5b8b1bc1d45918 + +The x86 pageattr code is confused about the data that is stored +in cpa->pfn, sometimes it's treated as a page frame number, +sometimes it's treated as an unshifted physical address, and in +one place it's treated as a pte. + +The result of this is that the mapping functions do not map the +intended physical address. + +This isn't a problem in practice because most of the addresses +we're mapping in the EFI code paths are already mapped in +'trampoline_pgd' and so the pageattr mapping functions don't +actually do anything in this case. But when we move to using a +separate page table for the EFI runtime this will be an issue. + +Signed-off-by: Matt Fleming +Reviewed-by: Borislav Petkov +Acked-by: Borislav Petkov +Cc: Andy Lutomirski +Cc: Ard Biesheuvel +Cc: Borislav Petkov +Cc: Brian Gerst +Cc: Dave Hansen +Cc: Denys Vlasenko +Cc: H. Peter Anvin +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Sai Praneeth Prakhya +Cc: Thomas Gleixner +Cc: Toshi Kani +Cc: linux-efi@vger.kernel.org +Link: http://lkml.kernel.org/r/1448658575-17029-3-git-send-email-matt@codeblueprint.co.uk +Signed-off-by: Ingo Molnar +--- + arch/x86/mm/pageattr.c | 17 ++++++----------- + arch/x86/platform/efi/efi_64.c | 16 ++++++++++------ + 2 files changed, 16 insertions(+), 17 deletions(-) + +diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c +index a3137a4feed1..c70e42014101 100644 +--- a/arch/x86/mm/pageattr.c ++++ b/arch/x86/mm/pageattr.c +@@ -905,15 +905,10 @@ static void populate_pte(struct cpa_data *cpa, + pte = pte_offset_kernel(pmd, start); + + while (num_pages-- && start < end) { +- +- /* deal with the NX bit */ +- if (!(pgprot_val(pgprot) & _PAGE_NX)) +- cpa->pfn &= ~_PAGE_NX; +- +- set_pte(pte, pfn_pte(cpa->pfn >> PAGE_SHIFT, pgprot)); ++ set_pte(pte, pfn_pte(cpa->pfn, pgprot)); + + start += PAGE_SIZE; +- cpa->pfn += PAGE_SIZE; ++ cpa->pfn++; + pte++; + } + } +@@ -969,11 +964,11 @@ static int populate_pmd(struct cpa_data *cpa, + + pmd = pmd_offset(pud, start); + +- set_pmd(pmd, __pmd(cpa->pfn | _PAGE_PSE | ++ set_pmd(pmd, __pmd(cpa->pfn << PAGE_SHIFT | _PAGE_PSE | + massage_pgprot(pmd_pgprot))); + + start += PMD_SIZE; +- cpa->pfn += PMD_SIZE; ++ cpa->pfn += PMD_SIZE >> PAGE_SHIFT; + cur_pages += PMD_SIZE >> PAGE_SHIFT; + } + +@@ -1042,11 +1037,11 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd, + * Map everything starting from the Gb boundary, possibly with 1G pages + */ + while (end - start >= PUD_SIZE) { +- set_pud(pud, __pud(cpa->pfn | _PAGE_PSE | ++ set_pud(pud, __pud(cpa->pfn << PAGE_SHIFT | _PAGE_PSE | + massage_pgprot(pud_pgprot))); + + start += PUD_SIZE; +- cpa->pfn += PUD_SIZE; ++ cpa->pfn += PUD_SIZE >> PAGE_SHIFT; + cur_pages += PUD_SIZE >> PAGE_SHIFT; + pud++; + } +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index a0ac0f9c307f..5aa186db59e3 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -143,7 +143,7 @@ void efi_sync_low_kernel_mappings(void) + + int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + { +- unsigned long text; ++ unsigned long pfn, text; + struct page *page; + unsigned npages; + pgd_t *pgd; +@@ -160,7 +160,8 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + * and ident-map those pages containing the map before calling + * phys_efi_set_virtual_address_map(). + */ +- if (kernel_map_pages_in_pgd(pgd, pa_memmap, pa_memmap, num_pages, _PAGE_NX)) { ++ pfn = pa_memmap >> PAGE_SHIFT; ++ if (kernel_map_pages_in_pgd(pgd, pfn, pa_memmap, num_pages, _PAGE_NX)) { + pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap); + return 1; + } +@@ -185,8 +186,9 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) + + npages = (_end - _text) >> PAGE_SHIFT; + text = __pa(_text); ++ pfn = text >> PAGE_SHIFT; + +- if (kernel_map_pages_in_pgd(pgd, text >> PAGE_SHIFT, text, npages, 0)) { ++ if (kernel_map_pages_in_pgd(pgd, pfn, text, npages, 0)) { + pr_err("Failed to map kernel text 1:1\n"); + return 1; + } +@@ -204,12 +206,14 @@ void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) + static void __init __map_region(efi_memory_desc_t *md, u64 va) + { + pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); +- unsigned long pf = 0; ++ unsigned long flags = 0; ++ unsigned long pfn; + + if (!(md->attribute & EFI_MEMORY_WB)) +- pf |= _PAGE_PCD; ++ flags |= _PAGE_PCD; + +- if (kernel_map_pages_in_pgd(pgd, md->phys_addr, va, md->num_pages, pf)) ++ pfn = md->phys_addr >> PAGE_SHIFT; ++ if (kernel_map_pages_in_pgd(pgd, pfn, va, md->num_pages, flags)) + pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n", + md->phys_addr, va); + } diff --git a/debian/patches/series b/debian/patches/series index 136807678..eaf3ec4de 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -124,3 +124,9 @@ bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch +bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch +bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch +bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch +bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch +bugfix/x86/x86-efi-build-our-own-page-table-structures.patch +bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch From fcd5547ba0cae795425bf7fd601e4a2e594f4f8c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 16 Feb 2016 02:03:01 +0000 Subject: [PATCH 29/35] [i386/686-pae] mm: Fix types used in pgprot cacheability flags translations --- debian/changelog | 2 + ...-used-in-pgprot-cacheability-flags-t.patch | 45 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 48 insertions(+) create mode 100644 debian/patches/bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch diff --git a/debian/changelog b/debian/changelog index 25f873941..1d45e5391 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium * udeb: Really add virtio_input to virtio-modules (not input-modules) * [x86] Fix issues resulting in W+X pages: - [amd64] efi: Build our own page table structure + - [i386/686-pae] mm: Fix types used in pgprot cacheability flags + translations [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch b/debian/patches/bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch new file mode 100644 index 000000000..859445593 --- /dev/null +++ b/debian/patches/bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch @@ -0,0 +1,45 @@ +From: Jan Beulich +Date: Tue, 26 Jan 2016 04:15:18 -0700 +Subject: x86/mm: Fix types used in pgprot cacheability flags translations +Origin: https://git.kernel.org/linus/3625c2c234ef66acf21a72d47a5ffa94f6c5ebf2 + +For PAE kernels "unsigned long" is not suitable to hold page protection +flags, since _PAGE_NX doesn't fit there. This is the reason for quite a +few W+X pages getting reported as insecure during boot (observed namely +for the entire initrd range). + +Fixes: 281d4078be ("x86: Make page cache mode a real type") +Signed-off-by: Jan Beulich +Reviewed-by: Juergen Gross +Cc: stable@vger.kernel.org +Link: http://lkml.kernel.org/r/56A7635602000078000CAFF1@prv-mh.provo.novell.com +Signed-off-by: Thomas Gleixner +--- + arch/x86/include/asm/pgtable_types.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/arch/x86/include/asm/pgtable_types.h ++++ b/arch/x86/include/asm/pgtable_types.h +@@ -363,20 +363,18 @@ static inline enum page_cache_mode pgpro + } + static inline pgprot_t pgprot_4k_2_large(pgprot_t pgprot) + { ++ pgprotval_t val = pgprot_val(pgprot); + pgprot_t new; +- unsigned long val; + +- val = pgprot_val(pgprot); + pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) | + ((val & _PAGE_PAT) << (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT)); + return new; + } + static inline pgprot_t pgprot_large_2_4k(pgprot_t pgprot) + { ++ pgprotval_t val = pgprot_val(pgprot); + pgprot_t new; +- unsigned long val; + +- val = pgprot_val(pgprot); + pgprot_val(new) = (val & ~(_PAGE_PAT | _PAGE_PAT_LARGE)) | + ((val & _PAGE_PAT_LARGE) >> + (_PAGE_BIT_PAT_LARGE - _PAGE_BIT_PAT)); diff --git a/debian/patches/series b/debian/patches/series index eaf3ec4de..aac4e3e78 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -130,3 +130,4 @@ bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch bugfix/x86/x86-efi-build-our-own-page-table-structures.patch bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch +bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch From 5427214b64970ddf2079021a7090c2d244122498 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 16 Feb 2016 02:50:51 +0000 Subject: [PATCH 30/35] [i386/686-pae] PCI: Set pci=nobios by default --- debian/changelog | 1 + ...86-pae-pci-set-pci-nobios-by-default.patch | 27 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 29 insertions(+) create mode 100644 debian/patches/debian/i386-686-pae-pci-set-pci-nobios-by-default.patch diff --git a/debian/changelog b/debian/changelog index 1d45e5391..a1a39a270 100644 --- a/debian/changelog +++ b/debian/changelog @@ -35,6 +35,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - [amd64] efi: Build our own page table structure - [i386/686-pae] mm: Fix types used in pgprot cacheability flags translations + - [i386/686-pae] PCI: Set pci=nobios by default [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/debian/i386-686-pae-pci-set-pci-nobios-by-default.patch b/debian/patches/debian/i386-686-pae-pci-set-pci-nobios-by-default.patch new file mode 100644 index 000000000..2787c2518 --- /dev/null +++ b/debian/patches/debian/i386-686-pae-pci-set-pci-nobios-by-default.patch @@ -0,0 +1,27 @@ +From: Ben Hutchings +Date: Tue, 16 Feb 2016 02:45:42 +0000 +Subject: [i386/686-pae] PCI: Set pci=nobios by default +Forwarded: not-needed + +CONFIG_PCI_GOBIOS results in physical addresses 640KB-1MB being mapped +W+X, which is undesirable for security reasons and will result in a +warning at boot now that we enable CONFIG_DEBUG_WX. + +This can be overridden using the kernel parameter "pci=nobios", but we +want to disable W+X by default. Disable PCI BIOS probing by default; +it can still be enabled using "pci=bios". + +--- +--- a/arch/x86/pci/common.c ++++ b/arch/x86/pci/common.c +@@ -20,8 +20,8 @@ + #include + #include + +-unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | +- PCI_PROBE_MMCONF; ++unsigned int pci_probe = PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | PCI_PROBE_MMCONF | ++ (IS_ENABLED(CONFIG_X86_64) || IS_ENABLED(CONFIG_X86_PAE) ? 0 : PCI_PROBE_BIOS); + + unsigned int pci_early_dump_regs; + static int pci_bf_sort; diff --git a/debian/patches/series b/debian/patches/series index aac4e3e78..646e47c45 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -131,3 +131,4 @@ bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch bugfix/x86/x86-efi-build-our-own-page-table-structures.patch bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch +debian/i386-686-pae-pci-set-pci-nobios-by-default.patch From 91d4b9430341e2f355920fed92d9488c601cd126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 16 Feb 2016 14:23:21 +0100 Subject: [PATCH 31/35] [rt] update to 4.4.2-rt6 --- debian/changelog | 3 + ...k-unlock-symetry-versus-pi_lock-and-.patch | 2 +- ...n-translation-section-permission-fau.patch | 2 +- ...intk-drop-the-logbuf_lock-more-often.patch | 2 +- ...wngrade-preempt_disable-d-region-to-.patch | 59 ++ ...-mark-LAPIC-timer-handler-as-irqsafe.patch | 2 +- ...KVM-use-simple-waitqueue-for-vcpu-wq.patch | 2 +- ...acpi_gbl_hardware-lock-back-to-a-raw.patch | 2 +- .../arch-arm64-Add-lazy-preempt-support.patch | 2 +- ...reempt-add-TIF_NEED_RESCHED_LAZY-to-.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 +- .../all/rt/arm-enable-highmem-for-rt.patch | 2 +- .../rt/arm-highmem-flush-tlb-on-unmap.patch | 2 +- .../all/rt/arm-preempt-lazy-support.patch | 2 +- .../all/rt/arm-unwind-use_raw_lock.patch | 2 +- ...ad_lock-to-rcu-lock-in-call_step_hoo.patch | 94 +++ ...arm64-xen--Make-XEN-depend-on-non-rt.patch | 2 +- .../rt/ata-disable-interrupts-if-non-rt.patch | 2 +- ...ne-notifier-to-POST_D.patchto-POST_D.patch | 2 +- .../all/rt/block-blk-mq-use-swait.patch | 2 +- ...k-mq-don-t-complete-requests-via-IPI.patch | 2 +- .../rt/block-mq-drop-per-ctx-cpu_lock.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 | 2 +- .../features/all/rt/block-use-cpu-chill.patch | 2 +- ...-the-seq-counter-in-struct-btrfs_dev.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 | 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 +- ...ument-why-PREEMPT_RT-uses-a-spinlock.patch | 2 +- ...tplug-lock-a-sleeping-spinlock-on-rt.patch | 2 +- .../all/rt/cpu-rt-rework-cpu-down.patch | 2 +- ...-a-UNINTERRUPTIBLE-hrtimer_nanosleep.patch | 2 +- .../cpu_down_move_migrate_enable_back.patch | 2 +- ...rop-K8-s-driver-from-beeing-selected.patch | 2 +- .../rt/cpumask-disable-offstack-on-rt.patch | 2 +- ...-preempt-disabled-regions-more-algos.patch | 2 +- .../features/all/rt/debugobjects-rt.patch | 2 +- .../features/all/rt/dm-make-rt-aware.patch | 2 +- ...coupled-fix-warning-cpuidle_coupled_.patch | 2 +- ...s-media-vsp1_video-fix-compile-error.patch | 2 +- .../drivers-net-8139-disable-irq-nosync.patch | 2 +- .../rt/drivers-net-fix-livelock-issues.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 +- ...op-trace_i915_gem_ring_dispatch-onrt.patch | 2 +- ...on-t-disable-preemption-during-trace.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 +- ...cache-use-cpu-chill-in-trylock-loops.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 +- .../rt/fs-ntfs-disable-interrupt-non-rt.patch | 2 +- .../fs-replace-bh_uptodate_lock-for-rt.patch | 2 +- .../rt/ftrace-migrate-disable-tracing.patch | 2 +- .../all/rt/futex-requeue-pi-fix.patch | 12 +- ...lt-affinity-mask-command-line-option.patch | 2 +- .../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 | 32 + ...cpus_allowed_ptr-in-sync_unplug_thre.patch | 2 +- .../rt/hotplug-light-get-online-cpus.patch | 2 +- ...ync_unplug-no-27-5cn-27-in-task-name.patch | 2 +- .../all/rt/hotplug-use-migrate-disable.patch | 2 +- ...-schedule_work-call-to-helper-thread.patch | 2 +- .../rt/hrtimer-enfore-64byte-alignment.patch | 2 +- ...timer-callback-changes-for-preempt-r.patch | 2 +- .../rt/hrtimers-prepare-full-preemption.patch | 2 +- ...on-t-ignore-threshold-module-paramet.patch | 2 +- ...pdate-hwlat_detector-to-add-outer-lo.patch | 2 +- ...r-Use-thread-instead-of-stop-machine.patch | 2 +- ...r-Use-trace_clock_local-if-available.patch | 2 +- .../patches/features/all/rt/hwlatdetect.patch | 2 +- ...-omap-drop-the-lock-hard-irq-context.patch | 2 +- ...ng-from-i915-when-running-on-PREEMPT.patch | 2 +- .../features/all/rt/i915_compile_fix.patch | 2 +- .../rt/ide-use-nort-local-irq-variants.patch | 2 +- .../idr-use-local-lock-for-protection.patch | 2 +- .../infiniband-mellanox-ib-use-nort-irq.patch | 2 +- .../rt/inpt-gameport-use-local-irq-nort.patch | 2 +- .../introduce_migrate_disable_cpu_light.patch | 2 +- ...Implement-lockless-pipelined-wakeups.patch | 2 +- .../rt/ipc-sem-rework-semaphore-wakeups.patch | 2 +- ...irq-processing-in-irq-thread-context.patch | 4 +- ...rk-Move-irq-safe-work-to-irq-context.patch | 2 +- ...-push_most_work_into_softirq_context.patch | 2 +- .../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 +- ...pu-down-problem-if-kthread-s-cpu-is-.patch | 2 +- ...restore-original-cpu-mask-oncpu-down.patch | 2 +- ...isable-do-fastpath-in-atomic-irqs-of.patch | 34 + ...-perf_cpu_context-s-timer-as-irqsafe.patch | 7 +- .../kernel-softirq-unlock-with-irqs-on.patch | 28 + ...ine-partly-revert-stop_machine-Use-r.patch | 153 +++++ .../all/rt/kgb-serial-hackaround.patch | 2 +- .../features/all/rt/latency-hist.patch | 2 +- ...tency_hist-update-sched_wakeup-probe.patch | 2 +- .../rt/latencyhist-disable-jump-labels.patch | 2 +- ...ds-trigger-disable-CPU-trigger-on-RT.patch | 2 +- .../patches/features/all/rt/lglocks-rt.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 | 6 +- .../lockdep-no-softirq-accounting-on-rt.patch | 2 +- ...-fix-warnings-due-to-missing-PREEMPT.patch | 2 +- ...ardirq-context-test-for-raw-spinlock.patch | 2 +- ...ure-Do-NOT-include-rwlock.h-directly.patch | 2 +- .../features/all/rt/md-disable-bcache.patch | 2 +- .../md-raid5-percpu-handling-rt-aware.patch | 2 +- .../all/rt/mips-disable-highmem-on-rt.patch | 2 +- .../rt/mm--rt--Fix-generic-kmap_atomic-for-RT | 2 +- ...on-t-disable-IRQs-in-wb_congested_pu.patch | 42 ++ .../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 +- .../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 +- .../all/rt/mm-vmalloc-use-get-cpu-light.patch | 2 +- ...-not-protect-workingset_shadow_nodes.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 +- ...al-irq-disable-alloc-atomic-headache.patch | 2 +- ...tplug-drain-input_pkt_queue-lockless.patch | 2 +- ...-users-of-napi_alloc_cache-against-r.patch | 2 +- ...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 | 2 +- .../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 +- .../net-tx-action-avoid-livelock-on-rt.patch | 2 +- .../features/all/rt/net-use-cpu-chill.patch | 2 +- .../all/rt/net-wireless-warn-nort.patch | 2 +- ...ronize-rcu_expedited_conditional-on-non-rt | 2 +- .../features/all/rt/oleg-signal-rt-fix.patch | 2 +- .../all/rt/panic-disable-random-on-rt.patch | 2 +- ...ce-rcu-bh-qs-where-safe-from-softirq.patch | 2 +- .../pci-access-use-__wake_up_all_locked.patch | 2 +- .../all/rt/percpu_ida-use-locklocks.patch | 2 +- .../perf-make-swevent-hrtimer-irqsafe.patch | 2 +- .../all/rt/peter_zijlstra-frob-rcu.patch | 2 +- .../all/rt/peterz-srcu-crypto-chain.patch | 2 +- .../all/rt/pid.h-include-atomic.h.patch | 2 +- .../patches/features/all/rt/ping-sysrq.patch | 2 +- .../all/rt/posix-timers-no-broadcast.patch | 2 +- ...timers-thread-posix-cpu-timers-on-rt.patch | 2 +- .../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 | 2 +- ...ce-init.c-adapt-to-completions-using.patch | 2 +- .../preempt-lazy-check-preempt_schedule.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 +- ...n-IRQs-in-ptrace_freeze_traced-too-e.patch | 2 +- ...ace-fix-ptrace-vs-tasklist_lock-race.patch | 2 +- .../features/all/rt/radix-tree-rt-aware.patch | 2 +- .../all/rt/random-make-it-work-on-rt.patch | 2 +- ...nate-softirq-processing-from-rcutree.patch | 12 +- .../rt/rcu-disable-more-spots-of-rcu_bh.patch | 64 ++ .../rt/rcu-disable-rcu-fast-no-hz-on-rt.patch | 2 +- .../rt/rcu-make-RCU_BOOST-default-on-RT.patch | 2 +- ...merge-rcu-bh-into-rcu-preempt-for-rt.patch | 2 +- .../all/rt/rcu-more-swait-conversions.patch | 16 +- ...s-disable-irq-while-calling-rcu_pree.patch | 2 +- ...ate_disable-race-with-cpu-hotplug-3f.patch | 2 +- ...l-arm-coredump-fails-for-cpu-3e-3d-4.patch | 2 +- .../all/rt/relay-fix-timer-madness.patch | 2 +- ...function-called-from-invalid-context.patch | 2 +- .../features/all/rt/rt-add-rt-locks.patch | 97 ++- .../all/rt/rt-introduce-cpu-chill.patch | 2 +- .../features/all/rt/rt-local-irq-lock.patch | 2 +- ...-Reenable-migration-accross-schedule.patch | 112 ++++ .../all/rt/rt-preempt-base-config.patch | 2 +- .../features/all/rt/rt-serial-warn-fix.patch | 2 +- ...ex--Handle-non-enqueued-waiters-gracefully | 6 +- .../rt/rtmutex-Make-wait_lock-irq-safe.patch | 598 ++++++++++++++++++ ...tmutex-Use-chainwalking-control-enum.patch | 6 +- ...rtmutex-add-a-first-shot-of-ww_mutex.patch | 36 +- .../all/rt/rtmutex-avoid-include-hell.patch | 2 +- .../all/rt/rtmutex-futex-prepare-rt.patch | 26 +- .../all/rt/rtmutex-lock-killable.patch | 4 +- ...wn-migrate_disable-into-rt_spin_lock.patch | 272 ++++++++ .../rt/rtmutex-trylock-is-okay-on-RT.patch | 4 +- .../all/rt/rtmutex_dont_include_rcu.patch | 2 +- ...t-t-disable-interrupts-in-qc_issue-h.patch | 2 +- ...line-dl_task_timer-has-to-be-irqsafe.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 | 2 +- ...provide-a-tsk_nr_cpus_allowed-helper.patch | 2 +- .../all/rt/sched-rt-mutex-wakeup.patch | 2 +- ...twu-ensure-success-return-is-correct.patch | 2 +- ...us_allowed-instead-of-accessing-cpus.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 | 2 +- .../signal-revert-ptrace-preempt-magic.patch | 2 +- ...t-tasks-to-cache-one-sigqueue-struct.patch | 2 +- .../features/all/rt/skbufhead-raw-lock.patch | 2 +- .../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 | 2 +- .../all/rt/softirq-preempt-fix-3-re.patch | 2 +- .../features/all/rt/softirq-split-locks.patch | 2 +- ...plit-timer-softirqs-out-of-ksoftirqd.patch | 14 +- ...arc64-use-generic-rwsem-spinlocks-rt.patch | 2 +- .../all/rt/spinlock-types-separate-raw.patch | 2 +- ...eate-lg_global_trylock_relax-primiti.patch | 4 +- ...e-lg_global_trylock_relax-to-dead-wi.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 | 2 +- .../all/rt/sysfs-realtime-entry.patch | 2 +- ...-from-going-into-infinite-spin-in-rt.patch | 2 +- .../tasklist-lock-fix-section-conflict.patch | 2 +- ...rmal-Defer-thermal-wakups-to-threads.patch | 2 +- .../rt/timekeeping-split-jiffies-lock.patch | 2 +- ...-waking-softirqs-from-the-jiffy-tick.patch | 2 +- .../all/rt/timer-fd-avoid-live-lock.patch | 2 +- ...id-the-base-null-otptimization-on-rt.patch | 2 +- .../all/rt/timers-preempt-rt-support.patch | 2 +- .../timers-prepare-for-full-preemption.patch | 2 +- ...st-Consider-new-argument-when-probin.patch | 2 +- ...-for-preempt-off-in-preempt_schedule.patch | 2 +- ...ove-preemption-disabling-in-netif_rx.patch | 2 +- .../all/rt/usb-use-_nort-in-giveback.patch | 2 +- .../all/rt/user-use-local-irq-nort.patch | 2 +- .../rt/vtime-split-lock-and-seqcount.patch | 2 +- .../all/rt/wait-simple-implementation.patch | 2 +- .../all/rt/wait.h-include-atomic.h.patch | 2 +- ...rk-around-irqsafe-timer-optimization.patch | 2 +- ...mple-Simple-work-queue-implemenation.patch | 2 +- .../rt/workqueue-distangle-from-rq-lock.patch | 2 +- .../rt/workqueue-prevent-deadlock-stall.patch | 2 +- .../all/rt/workqueue-use-locallock.patch | 2 +- .../features/all/rt/workqueue-use-rcu.patch | 2 +- .../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 | 2 +- ...-mce-use-swait-queue-for-mce-wakeups.patch | 2 +- .../features/all/rt/x86-preempt-lazy.patch | 2 +- ...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 | 2 +- debian/patches/series-rt | 12 + 282 files changed, 1884 insertions(+), 383 deletions(-) create mode 100644 debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch create mode 100644 debian/patches/features/all/rt/arm64-replace-read_lock-to-rcu-lock-in-call_step_hoo.patch create mode 100644 debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch create mode 100644 debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch create mode 100644 debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch create mode 100644 debian/patches/features/all/rt/kernel-stop_machine-partly-revert-stop_machine-Use-r.patch create mode 100644 debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch create mode 100644 debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch create mode 100644 debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch create mode 100644 debian/patches/features/all/rt/rtmutex-Make-wait_lock-irq-safe.patch create mode 100644 debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch diff --git a/debian/changelog b/debian/changelog index 0d5754e0c..58bda1760 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,9 @@ linux (4.4.1-1) UNRELEASED; urgency=medium [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). + [ Uwe Kleine-König ] + * [rt] Update to 4.4.1-rt6 + -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 linux (4.4.1-1~exp1) experimental; urgency=medium diff --git a/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch b/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch index 9f5e33381..afb6dfaa8 100644 --- a/debian/patches/features/all/rt/0005-futex-Ensure-lock-unlock-symetry-versus-pi_lock-and-.patch +++ b/debian/patches/features/all/rt/0005-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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz In exit_pi_state_list() we have the following locking construct: 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 0f260d5ff..80164647f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL 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 89b0fbed5..b682b58c4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 new file mode 100644 index 000000000..c36ca3273 --- /dev/null +++ b/debian/patches/features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -0,0 +1,59 @@ +From bdf6fc2d467f0db2122b1010106542dbc7a8398c Mon Sep 17 00:00:00 2001 +From: Josh Cartwright +Date: Thu, 11 Feb 2016 11:54:01 -0600 +Subject: [PATCH 2/2] KVM: arm/arm64: downgrade preempt_disable()d region to + migrate_disable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 +another CPU. It does so to prevent the task from writing to the +incorrect per-CPU GIC distributor registers. + +On -rt kernels, it's possible to maintain the same guarantee with the +use of migrate_{disable,enable}(), with the added benefit that the +migrate-disabled region is preemptible. Update +kvm_arch_vcpu_ioctl_run() to do so. + +Cc: Christoffer Dall +Reported-by: Manish Jaggi +Signed-off-by: Josh Cartwright +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm/kvm/arm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c +index 4f5c42a0924c..2ce9cc2717ac 100644 +--- a/arch/arm/kvm/arm.c ++++ b/arch/arm/kvm/arm.c +@@ -568,7 +568,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + * involves poking the GIC, which must be done in a + * non-preemptible context. + */ +- preempt_disable(); ++ migrate_disable(); + kvm_timer_flush_hwstate(vcpu); + kvm_vgic_flush_hwstate(vcpu); + +@@ -587,7 +587,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + local_irq_enable(); + kvm_timer_sync_hwstate(vcpu); + kvm_vgic_sync_hwstate(vcpu); +- preempt_enable(); ++ migrate_enable(); + continue; + } + +@@ -641,7 +641,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) + + kvm_vgic_sync_hwstate(vcpu); + +- preempt_enable(); ++ migrate_enable(); + + ret = handle_exit(vcpu, run, ret); + } +-- +2.7.0 + diff --git a/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch b/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch index ec9652767..2ba156153 100644 --- a/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch +++ b/debian/patches/features/all/rt/KVM-lapic-mark-LAPIC-timer-handler-as-irqsafe.patch @@ -1,7 +1,7 @@ From: Marcelo Tosatti Date: Wed, 8 Apr 2015 20:33:25 -0300 Subject: KVM: lapic: mark LAPIC timer handler as irqsafe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Since lapic timer handler only wakes up a simple waitqueue, it can be executed from hardirq context. diff --git a/debian/patches/features/all/rt/KVM-use-simple-waitqueue-for-vcpu-wq.patch b/debian/patches/features/all/rt/KVM-use-simple-waitqueue-for-vcpu-wq.patch index f7a4bff0e..952b8a884 100644 --- a/debian/patches/features/all/rt/KVM-use-simple-waitqueue-for-vcpu-wq.patch +++ b/debian/patches/features/all/rt/KVM-use-simple-waitqueue-for-vcpu-wq.patch @@ -1,7 +1,7 @@ From: Marcelo Tosatti Date: Wed, 8 Apr 2015 20:33:24 -0300 Subject: KVM: use simple waitqueue for vcpu->wq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The problem: 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 8a9e17bed..9f7ab80d4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz We hit the following bug with 3.6-rt: 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 23c3e0a7c..96f4bab71 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch b/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch index b45f44534..7acd1e299 100644 --- a/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch +++ b/debian/patches/features/all/rt/arm-arm64-lazy-preempt-add-TIF_NEED_RESCHED_LAZY-to-.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 22 Jan 2016 21:33:39 +0100 Subject: arm+arm64: lazy-preempt: add TIF_NEED_RESCHED_LAZY to _TIF_WORK_MASK -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz _TIF_WORK_MASK is used to check for TIF_NEED_RESCHED so we need to check for TIF_NEED_RESCHED_LAZY here, too. 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 0f3ecd995..65b425c61 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a93a22a81..0b47157d6 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 34643c709..4c725c732 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-enable-highmem-for-rt.patch b/debian/patches/features/all/rt/arm-enable-highmem-for-rt.patch index b3c95d08a..2f9b5f9bf 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 402ecba37..3ff18edc2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-preempt-lazy-support.patch b/debian/patches/features/all/rt/arm-preempt-lazy-support.patch index b446f91da..d90f9c3ef 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 5c3911bdd..f6e2cf331 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-replace-read_lock-to-rcu-lock-in-call_step_hoo.patch b/debian/patches/features/all/rt/arm64-replace-read_lock-to-rcu-lock-in-call_step_hoo.patch new file mode 100644 index 000000000..1c8150174 --- /dev/null +++ b/debian/patches/features/all/rt/arm64-replace-read_lock-to-rcu-lock-in-call_step_hoo.patch @@ -0,0 +1,94 @@ +From: Yang Shi +Date: Mon, 8 Feb 2016 14:49:24 -0800 +Subject: arm64: replace read_lock to rcu lock in call_step_hook +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917 +in_atomic(): 1, irqs_disabled(): 128, pid: 383, name: sh +Preemption disabled at:[] kgdb_cpu_enter+0x158/0x6b8 + +CPU: 3 PID: 383 Comm: sh Tainted: G W 4.1.13-rt13 #2 +Hardware name: Freescale Layerscape 2085a RDB Board (DT) +Call trace: +[] dump_backtrace+0x0/0x128 +[] show_stack+0x24/0x30 +[] dump_stack+0x80/0xa0 +[] ___might_sleep+0x18c/0x1a0 +[] __rt_spin_lock+0x2c/0x40 +[] rt_read_lock+0x40/0x58 +[] single_step_handler+0x38/0xd8 +[] do_debug_exception+0x58/0xb8 +Exception stack(0xffff80834a1e7c80 to 0xffff80834a1e7da0) +7c80: ffffff9c ffffffff 92c23ba0 0000ffff 4a1e7e40 ffff8083 001bfcc4 ffff8000 +7ca0: f2000400 00000000 00000000 00000000 4a1e7d80 ffff8083 0049501c ffff8000 +7cc0: 00005402 00000000 00aaa210 ffff8000 4a1e7ea0 ffff8083 000833f4 ffff8000 +7ce0: ffffff9c ffffffff 92c23ba0 0000ffff 4a1e7ea0 ffff8083 001bfcc0 ffff8000 +7d00: 4a0fc400 ffff8083 00005402 00000000 4a1e7d40 ffff8083 00490324 ffff8000 +7d20: ffffff9c 00000000 92c23ba0 0000ffff 000a0000 00000000 00000000 00000000 +7d40: 00000008 00000000 00080000 00000000 92c23b8b 0000ffff 92c23b8e 0000ffff +7d60: 00000038 00000000 00001cb2 00000000 00000005 00000000 92d7b498 0000ffff +7d80: 01010101 01010101 92be9000 0000ffff 00000000 00000000 00000030 00000000 +[] el1_dbg+0x18/0x6c + +This issue is similar with 62c6c61("arm64: replace read_lock to rcu lock in +call_break_hook"), but comes to single_step_handler. + +This also solves kgdbts boot test silent hang issue on 4.4 -rt kernel. + +Cc: stable-rt@vger.kernel.org +Signed-off-by: Yang Shi +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm64/kernel/debug-monitors.c | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +--- a/arch/arm64/kernel/debug-monitors.c ++++ b/arch/arm64/kernel/debug-monitors.c +@@ -186,20 +186,21 @@ static void clear_regs_spsr_ss(struct pt + + /* EL1 Single Step Handler hooks */ + static LIST_HEAD(step_hook); +-static DEFINE_RWLOCK(step_hook_lock); ++static DEFINE_SPINLOCK(step_hook_lock); + + void register_step_hook(struct step_hook *hook) + { +- write_lock(&step_hook_lock); +- list_add(&hook->node, &step_hook); +- write_unlock(&step_hook_lock); ++ spin_lock(&step_hook_lock); ++ list_add_rcu(&hook->node, &step_hook); ++ spin_unlock(&step_hook_lock); + } + + void unregister_step_hook(struct step_hook *hook) + { +- write_lock(&step_hook_lock); +- list_del(&hook->node); +- write_unlock(&step_hook_lock); ++ spin_lock(&step_hook_lock); ++ list_del_rcu(&hook->node); ++ spin_unlock(&step_hook_lock); ++ synchronize_rcu(); + } + + /* +@@ -213,15 +214,15 @@ static int call_step_hook(struct pt_regs + struct step_hook *hook; + int retval = DBG_HOOK_ERROR; + +- read_lock(&step_hook_lock); ++ rcu_read_lock(); + +- list_for_each_entry(hook, &step_hook, node) { ++ list_for_each_entry_rcu(hook, &step_hook, node) { + retval = hook->fn(regs, esr); + if (retval == DBG_HOOK_HANDLED) + break; + } + +- read_unlock(&step_hook_lock); ++ rcu_read_unlock(); + + return retval; + } 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 7fdde7167..9506d13fc 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/ata-disable-interrupts-if-non-rt.patch b/debian/patches/features/all/rt/ata-disable-interrupts-if-non-rt.patch index 4ea55e626..b66c7ee5e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch b/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch index 2eeebdab7..f2df2944e 100644 --- a/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch +++ b/debian/patches/features/all/rt/blk-mq-revert-raw-locks-post-pone-notifier-to-POST_D.patchto-POST_D.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 3 May 2014 11:00:29 +0200 Subject: blk-mq: revert raw locks, post pone notifier to POST_DEAD -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The blk_mq_cpu_notify_lock should be raw because some CPU down levels are called with interrupts off. The notifier itself calls currently one 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 4b399c985..00fd2bc47 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 6b14f9846..a1e8e11a0 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-per-ctx-cpu_lock.patch b/debian/patches/features/all/rt/block-mq-drop-per-ctx-cpu_lock.patch index fc569fe40..1ec7e5fe3 100644 --- a/debian/patches/features/all/rt/block-mq-drop-per-ctx-cpu_lock.patch +++ b/debian/patches/features/all/rt/block-mq-drop-per-ctx-cpu_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 18 Feb 2015 18:37:26 +0100 Subject: block/mq: drop per ctx cpu_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz While converting the get_cpu() to get_cpu_light() I added a cpu lock to ensure the same code is not invoked twice on the same CPU. And now I run 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 ba05f75cc..fc07467ec 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 275fec6b5..522c88961 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 963e762d1..738f96259 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Moving the blk_sched_flush_plug() call out of the interrupt/preempt disabled region in the scheduler allows us to replace 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 ec52d61a4..1b606518a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/btrfs-initialize-the-seq-counter-in-struct-btrfs_dev.patch b/debian/patches/features/all/rt/btrfs-initialize-the-seq-counter-in-struct-btrfs_dev.patch index 243b5bede..c58058b5d 100644 --- a/debian/patches/features/all/rt/btrfs-initialize-the-seq-counter-in-struct-btrfs_dev.patch +++ b/debian/patches/features/all/rt/btrfs-initialize-the-seq-counter-in-struct-btrfs_dev.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 15 Jan 2016 14:28:39 +0100 Subject: btrfs: initialize the seq counter in struct btrfs_device -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz I managed to trigger this: | INFO: trying to register non-static key. 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 304b81a10..71e9f66c7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 061fedd6c..47e64c932 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 c781ba2a6..196f7a93d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz To avoid: |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:914 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 27602da08..207a616d5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 34d9ff4bc..73bae4aa9 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a04522fc8..523eaff52 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 e1095dbff..48c58badf 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch b/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch index 7754cd3e3..7f7728fb5 100644 --- a/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch +++ b/debian/patches/features/all/rt/cpu-hotplug-Document-why-PREEMPT_RT-uses-a-spinlock.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Thu, 5 Dec 2013 09:16:52 -0500 Subject: cpu hotplug: Document why PREEMPT_RT uses a spinlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The patch: diff --git a/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch b/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch index c39b5eeea..e70b5c070 100644 --- a/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch +++ b/debian/patches/features/all/rt/cpu-rt-make-hotplug-lock-a-sleeping-spinlock-on-rt.patch @@ -1,7 +1,7 @@ Subject: cpu: Make hotplug.lock a "sleeping" spinlock on RT From: Steven Rostedt Date: Fri, 02 Mar 2012 10:36:57 -0500 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Tasks can block on hotplug.lock in pin_current_cpu(), but their state might be != RUNNING. So the mutex wakeup will set the state diff --git a/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch b/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch index 775c68574..0a9d35f31 100644 --- a/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch +++ b/debian/patches/features/all/rt/cpu-rt-rework-cpu-down.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 16 Jul 2012 08:07:43 +0000 Subject: cpu/rt: Rework cpu down for PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Bringing a CPU down is a pain with the PREEMPT_RT kernel because tasks can be preempted in many more places than in non-RT. In 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 8d051116d..2fe940948 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz We hit another bug that was caused by switching cpu_chill() from msleep() to hrtimer_nanosleep(). diff --git a/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch b/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch index 11d31722b..51390c25f 100644 --- a/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch +++ b/debian/patches/features/all/rt/cpu_down_move_migrate_enable_back.patch @@ -1,7 +1,7 @@ From: Tiejun Chen Subject: cpu_down: move migrate_enable() back Date: Thu, 7 Nov 2013 10:06:07 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Commit 08c1ab68, "hotplug-use-migrate-disable.patch", intends to use migrate_enable()/migrate_disable() to replace that combination 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 b5276e649..6965bcce5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 c7cfc2a32..8832ea935 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz We can't deal with the cpumask allocations which happen in atomic context (see arch/x86/kernel/apic/io_apic.c) on RT right now. 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 1e78d9e7c..bffb28b54 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/debugobjects-rt.patch b/debian/patches/features/all/rt/debugobjects-rt.patch index 75000bfb2..647d0c209 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Avoid filling the pool / allocating memory with irqs off(). 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 5ad1d0e9a..395cbf9d8 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-cpuidle-coupled-fix-warning-cpuidle_coupled_.patch b/debian/patches/features/all/rt/drivers-cpuidle-coupled-fix-warning-cpuidle_coupled_.patch index e125a7744..f691da4aa 100644 --- a/debian/patches/features/all/rt/drivers-cpuidle-coupled-fix-warning-cpuidle_coupled_.patch +++ b/debian/patches/features/all/rt/drivers-cpuidle-coupled-fix-warning-cpuidle_coupled_.patch @@ -1,7 +1,7 @@ From: Anders Roxell Date: Fri, 15 Jan 2016 20:21:12 +0100 Subject: drivers/cpuidle: coupled: fix warning cpuidle_coupled_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Used multi_v7_defconfig+PREEMPT_RT_FULL=y and this caused a compilation warning without this fix: diff --git a/debian/patches/features/all/rt/drivers-media-vsp1_video-fix-compile-error.patch b/debian/patches/features/all/rt/drivers-media-vsp1_video-fix-compile-error.patch index 654eee795..568a7bd08 100644 --- a/debian/patches/features/all/rt/drivers-media-vsp1_video-fix-compile-error.patch +++ b/debian/patches/features/all/rt/drivers-media-vsp1_video-fix-compile-error.patch @@ -1,7 +1,7 @@ From: Anders Roxell Date: Fri, 15 Jan 2016 01:09:43 +0100 Subject: drivers/media: vsp1_video: fix compile error -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz This was found with the -RT patch enabled, but the fix should apply to non-RT also. 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 38804ec22..316100d6f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-fix-livelock-issues.patch b/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch index eea735032..07ae3cef7 100644 --- a/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch +++ b/debian/patches/features/all/rt/drivers-net-fix-livelock-issues.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 20 Jun 2009 11:36:54 +0200 Subject: drivers/net: fix livelock issues -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Preempt-RT runs into a live lock issue with the NETDEV_TX_LOCKED micro optimization. The reason is that the softirq thread is rescheduling 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 61a7e5787..2109b3331 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 ec05dc1b1..df1afe253 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 76f85f36b..cf814a60c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 64e24233c..688fdfd94 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch b/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch index 6a9cc85b5..c1dbfdd23 100644 --- a/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch +++ b/debian/patches/features/all/rt/drm-i915-drop-trace_i915_gem_ring_dispatch-onrt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 25 Apr 2013 18:12:52 +0200 Subject: drm/i915: drop trace_i915_gem_ring_dispatch on rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz This tracepoint is responsible for: diff --git a/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch b/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch index 37ad87410..c2e828683 100644 --- a/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch +++ b/debian/patches/features/all/rt/dump-stack-don-t-disable-preemption-during-trace.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sun, 16 Aug 2015 14:27:50 +0200 Subject: dump stack: don't disable preemption during trace -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz I see here large latencies during a stack dump on x86. The preempt_disable() and get_cpu() should forbid moving the task to another 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 087c4ec50..2b20c0983 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 cff591324..d20de978a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 1d2d3dd27..4112c7830 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-use-cpu-chill-in-trylock-loops.patch b/debian/patches/features/all/rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index 08688be5a..f7adc96ba 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-jbd-replace-bh_state-lock.patch b/debian/patches/features/all/rt/fs-jbd-replace-bh_state-lock.patch index 0b6b54b20..8b0b4a1c3 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 e38490252..d27618cfe 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 d7d5b3010..d472476ce 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-ntfs-disable-interrupt-non-rt.patch b/debian/patches/features/all/rt/fs-ntfs-disable-interrupt-non-rt.patch index 6b6265030..68fec2907 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 c86b24b0c..a7bcabe63 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-migrate-disable-tracing.patch b/debian/patches/features/all/rt/ftrace-migrate-disable-tracing.patch index 199e307ad..67456a8af 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Signed-off-by: Thomas Gleixner --- 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 d775677a4..b6cbc1d8b 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Requeue with timeout causes a bug with PREEMPT_RT_FULL. @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1631,6 +1632,35 @@ int rt_mutex_start_proxy_lock(struct rt_ +@@ -1640,6 +1641,35 @@ int rt_mutex_start_proxy_lock(struct rt_ return 1; } @@ -89,14 +89,14 @@ Signed-off-by: Thomas Gleixner + * PI_REQUEUE_INPROGRESS, so that if the task is waking up + * it will know that we are in the process of requeuing it. + */ -+ raw_spin_lock_irq(&task->pi_lock); ++ raw_spin_lock(&task->pi_lock); + if (task->pi_blocked_on) { -+ raw_spin_unlock_irq(&task->pi_lock); -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return -EAGAIN; + } + task->pi_blocked_on = PI_REQUEUE_INPROGRESS; -+ raw_spin_unlock_irq(&task->pi_lock); ++ raw_spin_unlock(&task->pi_lock); +#endif + /* We enforce deadlock detection for futexes */ diff --git a/debian/patches/features/all/rt/genirq-Add-default-affinity-mask-command-line-option.patch b/debian/patches/features/all/rt/genirq-Add-default-affinity-mask-command-line-option.patch index 431420477..0b70e72b7 100644 --- a/debian/patches/features/all/rt/genirq-Add-default-affinity-mask-command-line-option.patch +++ b/debian/patches/features/all/rt/genirq-Add-default-affinity-mask-command-line-option.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 25 May 2012 16:59:47 +0200 Subject: genirq: Add default affinity mask command line option -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot 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 a683d8ae7..4dba41c6f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 32d608e3b..716aabf7e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 8ad39843e..f887afdae 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 new file mode 100644 index 000000000..0f5642ffa --- /dev/null +++ b/debian/patches/features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -0,0 +1,32 @@ +From 85b7f1606fb707c9da7984e052e47cfa12e85e67 Mon Sep 17 00:00:00 2001 +From: Josh Cartwright +Date: Thu, 11 Feb 2016 11:54:00 -0600 +Subject: [PATCH 1/2] genirq: update irq_set_irqchip_state documentation +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 +irq_set_irqchip_state() documentation to reflect this. + +Signed-off-by: Josh Cartwright +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/irq/manage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c +index ba2a42a37025..8e89554aa345 100644 +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -2060,7 +2060,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); + * This call sets the internal irqchip state of an interrupt, + * depending on the value of @which. + * +- * This function should be called with preemption disabled if the ++ * This function should be called with migration disabled if the + * interrupt controller has per-cpu registers. + */ + int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, +-- +2.7.0 + diff --git a/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch b/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch index a6d192a42..a21c970e1 100644 --- a/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch +++ b/debian/patches/features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Tue, 24 Mar 2015 08:14:49 +0100 Subject: hotplug: Use set_cpus_allowed_ptr() in sync_unplug_thread() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz do_set_cpus_allowed() is not safe vs ->sched_class change. 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 686aef6a7..74d966211 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz get_online_cpus() is a heavy weight function which involves a global mutex. migrate_disable() wants a simpler construct which prevents only diff --git a/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch b/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch index cfad64c67..5ec6a2407 100644 --- a/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch +++ b/debian/patches/features/all/rt/hotplug-sync_unplug-no-27-5cn-27-in-task-name.patch @@ -1,7 +1,7 @@ Subject: hotplug: sync_unplug: No "\n" in task name From: Yong Zhang Date: Sun, 16 Oct 2011 18:56:43 +0800 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Otherwise the output will look a little odd. diff --git a/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch b/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch index ac9d1a560..6f2db0301 100644 --- a/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch +++ b/debian/patches/features/all/rt/hotplug-use-migrate-disable.patch @@ -1,7 +1,7 @@ Subject: hotplug: Use migrate disable on unplug From: Thomas Gleixner Date: Sun, 17 Jul 2011 19:35:29 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Migration needs to be disabled accross the unplug handling to make sure that the unplug thread is off the unplugged cpu. 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 e17cce4d1..2dbc28a3f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz When run ltp leapsec_timer test, the following call trace is caught: diff --git a/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch b/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch index 9ceb5ae7a..ca169677b 100644 --- a/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch +++ b/debian/patches/features/all/rt/hrtimer-enfore-64byte-alignment.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 23 Dec 2015 20:57:41 +0100 Subject: hrtimer: enfore 64byte alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The patch "hrtimer: Fixup hrtimer callback changes for preempt-rt" adds a list_head expired to struct hrtimer_clock_base and with it we run into diff --git a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch index ef2f16bff..c72f4d745 100644 --- a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch +++ b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:31 -0500 Subject: hrtimer: Fixup hrtimer callback changes for preempt-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz In preempt-rt we can not call the callbacks which take sleeping locks from the timer interrupt context. 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 92927cd61..860fcbcbd 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Make cancellation of a running callback in softirq context safe against preemption. diff --git a/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch b/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch index 73882a348..6488fe7f5 100644 --- a/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch +++ b/debian/patches/features/all/rt/hwlat-detector-Don-t-ignore-threshold-module-paramet.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 30 Aug 2013 07:57:25 +0200 Subject: hwlat-detector: Don't ignore threshold module parameter -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz If the user specified a threshold at module load time, use it. diff --git a/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch b/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch index fc309734b..e7d99ffc3 100644 --- a/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch +++ b/debian/patches/features/all/rt/hwlat-detector-Update-hwlat_detector-to-add-outer-lo.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 19 Aug 2013 17:33:25 -0400 Subject: hwlat-detector: Update hwlat_detector to add outer loop detection -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The hwlat_detector reads two timestamps in a row, then reports any gap between those calls. The problem is, it misses everything between diff --git a/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch b/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch index 3689dcb0f..d76ea7025 100644 --- a/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch +++ b/debian/patches/features/all/rt/hwlat-detector-Use-thread-instead-of-stop-machine.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 19 Aug 2013 17:33:27 -0400 Subject: hwlat-detector: Use thread instead of stop machine -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz There's no reason to use stop machine to search for hardware latency. Simply disabling interrupts while running the loop will do enough to diff --git a/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch b/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch index 7acf5e51b..47e2c3904 100644 --- a/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch +++ b/debian/patches/features/all/rt/hwlat-detector-Use-trace_clock_local-if-available.patch @@ -1,7 +1,7 @@ From: Steven Rostedt Date: Mon, 19 Aug 2013 17:33:26 -0400 Subject: hwlat-detector: Use trace_clock_local if available -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz As ktime_get() calls into the timing code which does a read_seq(), it may be affected by other CPUS that touch that lock. To remove this diff --git a/debian/patches/features/all/rt/hwlatdetect.patch b/debian/patches/features/all/rt/hwlatdetect.patch index ac3fe546c..6cb117e45 100644 --- a/debian/patches/features/all/rt/hwlatdetect.patch +++ b/debian/patches/features/all/rt/hwlatdetect.patch @@ -1,7 +1,7 @@ Subject: hwlatdetect.patch From: Carsten Emde Date: Tue, 19 Jul 2011 13:53:12 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Jon Masters developed this wonderful SMI detector. For details please consult Documentation/hwlat_detector.txt. It could be ported to Linux diff --git a/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch b/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch index 83a0348bc..797bca218 100644 --- a/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch +++ b/debian/patches/features/all/rt/i2c-omap-drop-the-lock-hard-irq-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Mar 2013 11:35:49 +0100 Subject: i2c/omap: drop the lock hard irq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The lock is taken while reading two registers. On RT the first lock is taken in hard irq where it might sleep and in the threaded irq. diff --git a/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch b/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch index cdaef85b9..0f717dbf1 100644 --- a/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch +++ b/debian/patches/features/all/rt/i915-bogus-warning-from-i915-when-running-on-PREEMPT.patch @@ -1,7 +1,7 @@ From: Clark Williams Date: Tue, 26 May 2015 10:43:43 -0500 Subject: i915: bogus warning from i915 when running on PREEMPT_RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The i915 driver has a 'WARN_ON(!in_interrupt())' in the display handler, which whines constanly on the RT kernel (since the interrupt diff --git a/debian/patches/features/all/rt/i915_compile_fix.patch b/debian/patches/features/all/rt/i915_compile_fix.patch index 2cd234aaa..75feb68c4 100644 --- a/debian/patches/features/all/rt/i915_compile_fix.patch +++ b/debian/patches/features/all/rt/i915_compile_fix.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: gpu/i915: don't open code these things -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The opencode part is gone in 1f83fee0 ("drm/i915: clear up wedged transitions") the owner check is still there. 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 bac0c1cef..8ce7dfca2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Use the local_irq_*_nort variants. diff --git a/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch b/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch index 45124b943..7cec2f742 100644 --- a/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch +++ b/debian/patches/features/all/rt/idr-use-local-lock-for-protection.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 14 Jul 2015 14:26:34 +0200 Subject: idr: Use local lock instead of preempt enable/disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz We need to protect the per cpu variable and prevent migration. 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 70eeab4b4..b62926110 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 eeac41289..0bbf739e8 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Use the _nort() primitives. diff --git a/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch b/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch index 7e4c4f4e6..890f29ae1 100644 --- a/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch +++ b/debian/patches/features/all/rt/introduce_migrate_disable_cpu_light.patch @@ -1,7 +1,7 @@ Subject: Intrduce migrate_disable() + cpu_light() From: Thomas Gleixner Date: Fri, 17 Jun 2011 15:42:38 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Introduce migrate_disable(). The task can't be pushed to another CPU but can be preempted. diff --git a/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch b/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch index ec8af0e80..334c6066c 100644 --- a/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch +++ b/debian/patches/features/all/rt/ipc-msg-Implement-lockless-pipelined-wakeups.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 30 Oct 2015 11:59:07 +0100 Subject: ipc/msg: Implement lockless pipelined wakeups -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz This patch moves the wakeup_process() invocation so it is not done under the perm->lock by making use of a lockless wake_q. With this change, the diff --git a/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch b/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch index d4db346b2..ab8a8c26e 100644 --- a/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch +++ b/debian/patches/features/all/rt/ipc-sem-rework-semaphore-wakeups.patch @@ -1,7 +1,7 @@ Subject: ipc/sem: Rework semaphore wakeups From: Peter Zijlstra Date: Wed, 14 Sep 2011 11:57:04 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Current sysv sems have a weird ass wakeup scheme that involves keeping preemption disabled over a potential O(n^2) loop and busy waiting on 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 1d0838dd3..31f1e6718 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 @@ -129,7 +129,7 @@ Signed-off-by: Thomas Gleixner return desc->status_use_accessors & _IRQ_PER_CPU; --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -576,6 +576,15 @@ void __local_bh_enable(void) +@@ -578,6 +578,15 @@ void __local_bh_enable(void) } EXPORT_SYMBOL(__local_bh_enable); 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 14720b800..d3fc73205 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 b416f2064..cbc569196 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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. diff --git a/debian/patches/features/all/rt/jump-label-rt.patch b/debian/patches/features/all/rt/jump-label-rt.patch index ca0ef11f0..b5e8638db 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a97425bad..cb6de2537 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 7c44ed138..8aa11e197 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 4a590af02..af8c01e3a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch b/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch index a95325d10..741d8c44c 100644 --- a/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch +++ b/debian/patches/features/all/rt/kernel-cpu-fix-cpu-down-problem-if-kthread-s-cpu-is-.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 7 Jun 2013 22:37:06 +0200 Subject: kernel/cpu: fix cpu down problem if kthread's cpu is going down -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz If kthread is pinned to CPUx and CPUx is going down then we get into trouble: diff --git a/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch b/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch index 3458fae52..f7e9d8b37 100644 --- a/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch +++ b/debian/patches/features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 14 Jun 2013 17:16:35 +0200 Subject: kernel/hotplug: restore original cpu mask oncpu/down -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz If a task which is allowed to run only on CPU X puts CPU Y down then it will be allowed on all CPUs but the on CPU Y after it comes back from diff --git a/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch b/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch new file mode 100644 index 000000000..7bee60523 --- /dev/null +++ b/debian/patches/features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch @@ -0,0 +1,34 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 9 Feb 2016 18:18:01 +0100 +Subject: kernel: migrate_disable() do fastpath in atomic & + irqs-off +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +With interrupts off it makes no sense to do the long path since we can't +leave the CPU anyway. Also we might end up in a recursion with lockdep. + +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/sched/core.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -3078,7 +3078,7 @@ void migrate_disable(void) + { + struct task_struct *p = current; + +- if (in_atomic()) { ++ if (in_atomic() || irqs_disabled()) { + #ifdef CONFIG_SCHED_DEBUG + p->migrate_disable_atomic++; + #endif +@@ -3105,7 +3105,7 @@ void migrate_enable(void) + { + struct task_struct *p = current; + +- if (in_atomic()) { ++ if (in_atomic() || irqs_disabled()) { + #ifdef CONFIG_SCHED_DEBUG + p->migrate_disable_atomic--; + #endif diff --git a/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch b/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch index afa8e803d..259b5b5ca 100644 --- a/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch +++ b/debian/patches/features/all/rt/kernel-perf-mark-perf_cpu_context-s-timer-as-irqsafe.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 4 Feb 2016 16:38:10 +0100 Subject: [PATCH] kernel/perf: mark perf_cpu_context's timer as irqsafe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Otherwise we get a WARN_ON() backtrace and some events are reported as "not counted". @@ -10,13 +10,12 @@ Cc: stable-rt@vger.kernel.org Reported-by: Yang Shi Signed-off-by: Sebastian Andrzej Siewior --- - kernel/events/core.c | 1 + + kernel/events/core.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/kernel/events/core.c b/kernel/events/core.c --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -802,6 +802,7 @@ static void __perf_mux_hrtimer_init(struct perf_cpu_context *cpuctx, int cpu) +@@ -802,6 +802,7 @@ static void __perf_mux_hrtimer_init(stru raw_spin_lock_init(&cpuctx->hrtimer_lock); hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED); timer->function = perf_mux_hrtimer_handler; 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 new file mode 100644 index 000000000..0fcd3371d --- /dev/null +++ b/debian/patches/features/all/rt/kernel-softirq-unlock-with-irqs-on.patch @@ -0,0 +1,28 @@ +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.4/patches-4.4.1-rt6.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 +symmetrical in regard to the status of interrupts. + +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/softirq.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -549,8 +549,10 @@ static void do_current_softirqs(void) + do_single_softirq(i); + } + softirq_clr_runner(i); +- unlock_softirq(i); + WARN_ON(current->softirq_nestcnt != 1); ++ local_irq_enable(); ++ unlock_softirq(i); ++ local_irq_disable(); + } + } + diff --git a/debian/patches/features/all/rt/kernel-stop_machine-partly-revert-stop_machine-Use-r.patch b/debian/patches/features/all/rt/kernel-stop_machine-partly-revert-stop_machine-Use-r.patch new file mode 100644 index 000000000..bc1f15fb8 --- /dev/null +++ b/debian/patches/features/all/rt/kernel-stop_machine-partly-revert-stop_machine-Use-r.patch @@ -0,0 +1,153 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 10 Feb 2016 18:25:16 +0100 +Subject: kernel/stop_machine: partly revert "stop_machine: Use raw + spinlocks" +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +With completion using swait and so rawlocks we don't need this anymore. +Further, bisect thinks this patch is responsible for: + +|BUG: unable to handle kernel NULL pointer dereference at (null) +|IP: [] sched_cpu_active+0x53/0x70 +|PGD 0 +|Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC +|Dumping ftrace buffer: +| (ftrace buffer empty) +|Modules linked in: +|CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.1+ #330 +|Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Debian-1.8.2-1 04/01/2014 +|task: ffff88013ae64b00 ti: ffff88013ae74000 task.ti: ffff88013ae74000 +|RIP: 0010:[] [] sched_cpu_active+0x53/0x70 +|RSP: 0000:ffff88013ae77eb8 EFLAGS: 00010082 +|RAX: 0000000000000001 RBX: ffffffff81c2cf20 RCX: 0000001050fb52fb +|RDX: 0000001050fb52fb RSI: 000000105117ca1e RDI: 00000000001c7723 +|RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 +|R10: 0000000000000000 R11: 0000000000000001 R12: 00000000ffffffff +|R13: ffffffff81c2cee0 R14: 0000000000000000 R15: 0000000000000001 +|FS: 0000000000000000(0000) GS:ffff88013b200000(0000) knlGS:0000000000000000 +|CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b +|CR2: 0000000000000000 CR3: 0000000001c09000 CR4: 00000000000006e0 +|Stack: +| ffffffff810c446d ffff88013ae77f00 ffffffff8107d8dd 000000000000000a +| 0000000000000001 0000000000000000 0000000000000000 0000000000000000 +| 0000000000000000 ffff88013ae77f10 ffffffff8107d90e ffff88013ae77f20 +|Call Trace: +| [] ? debug_lockdep_rcu_enabled+0x1d/0x20 +| [] ? notifier_call_chain+0x5d/0x80 +| [] ? __raw_notifier_call_chain+0xe/0x10 +| [] ? cpu_notify+0x23/0x40 +| [] ? notify_cpu_starting+0x28/0x30 + +during hotplug. The rawlocks need to remain however. + +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/stop_machine.c | 40 ++++++++-------------------------------- + 1 file changed, 8 insertions(+), 32 deletions(-) + +--- a/kernel/stop_machine.c ++++ b/kernel/stop_machine.c +@@ -30,7 +30,7 @@ struct cpu_stop_done { + atomic_t nr_todo; /* nr left to execute */ + bool executed; /* actually executed? */ + int ret; /* collected return value */ +- struct task_struct *waiter; /* woken when nr_todo reaches 0 */ ++ struct completion completion; /* fired if nr_todo reaches 0 */ + }; + + /* the actual stopper, one per every possible cpu, enabled on online cpus */ +@@ -59,7 +59,7 @@ static void cpu_stop_init_done(struct cp + { + memset(done, 0, sizeof(*done)); + atomic_set(&done->nr_todo, nr_todo); +- done->waiter = current; ++ init_completion(&done->completion); + } + + /* signal completion unless @done is NULL */ +@@ -68,10 +68,8 @@ static void cpu_stop_signal_done(struct + if (done) { + if (executed) + done->executed = true; +- if (atomic_dec_and_test(&done->nr_todo)) { +- wake_up_process(done->waiter); +- done->waiter = NULL; +- } ++ if (atomic_dec_and_test(&done->nr_todo)) ++ complete(&done->completion); + } + } + +@@ -96,22 +94,6 @@ static void cpu_stop_queue_work(unsigned + raw_spin_unlock_irqrestore(&stopper->lock, flags); + } + +-static void wait_for_stop_done(struct cpu_stop_done *done) +-{ +- set_current_state(TASK_UNINTERRUPTIBLE); +- while (atomic_read(&done->nr_todo)) { +- schedule(); +- set_current_state(TASK_UNINTERRUPTIBLE); +- } +- /* +- * We need to wait until cpu_stop_signal_done() has cleared +- * done->waiter. +- */ +- while (done->waiter) +- cpu_relax(); +- set_current_state(TASK_RUNNING); +-} +- + /** + * stop_one_cpu - stop a cpu + * @cpu: cpu to stop +@@ -143,7 +125,7 @@ int stop_one_cpu(unsigned int cpu, cpu_s + + cpu_stop_init_done(&done, 1); + cpu_stop_queue_work(cpu, &work); +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + return done.executed ? done.ret : -ENOENT; + } + +@@ -302,7 +284,7 @@ int stop_two_cpus(unsigned int cpu1, uns + + preempt_enable_nort(); + +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + + return done.executed ? done.ret : -ENOENT; + } +@@ -364,7 +346,7 @@ static int __stop_cpus(const struct cpum + + cpu_stop_init_done(&done, cpumask_weight(cpumask)); + queue_stop_cpus_work(cpumask, fn, arg, &done, false); +- wait_for_stop_done(&done); ++ wait_for_completion(&done.completion); + return done.executed ? done.ret : -ENOENT; + } + +@@ -495,13 +477,7 @@ static void cpu_stopper_thread(unsigned + kallsyms_lookup((unsigned long)fn, NULL, NULL, NULL, + ksym_buf), arg); + +- /* +- * Make sure that the wakeup and setting done->waiter +- * to NULL is atomic. +- */ +- local_irq_disable(); + cpu_stop_signal_done(done, true); +- local_irq_enable(); + goto repeat; + } + } +@@ -663,7 +639,7 @@ int stop_machine_from_inactive_cpu(cpu_s + ret = multi_cpu_stop(&msdata); + + /* Busy wait for completion. */ +- while (atomic_read(&done.nr_todo)) ++ while (!completion_done(&done.completion)) + cpu_relax(); + + mutex_unlock(&stop_cpus_mutex); diff --git a/debian/patches/features/all/rt/kgb-serial-hackaround.patch b/debian/patches/features/all/rt/kgb-serial-hackaround.patch index 7c6ae67b6..190731fe4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/latency-hist.patch b/debian/patches/features/all/rt/latency-hist.patch index 6371f8a6d..63fc4cbef 100644 --- a/debian/patches/features/all/rt/latency-hist.patch +++ b/debian/patches/features/all/rt/latency-hist.patch @@ -1,7 +1,7 @@ Subject: tracing: Add latency histograms From: Carsten Emde Date: Tue, 19 Jul 2011 14:03:41 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz This patch provides a recording mechanism to store data of potential sources of system latencies. The recordings separately determine the diff --git a/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch b/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch index 62487b805..818404f63 100644 --- a/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch +++ b/debian/patches/features/all/rt/latency_hist-update-sched_wakeup-probe.patch @@ -1,7 +1,7 @@ Subject: latency_hist: Update sched_wakeup probe From: Mathieu Desnoyers Date: Sun, 25 Oct 2015 18:06:05 -0400 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz "sched: Introduce the 'trace_sched_waking' tracepoint" introduces a prototype change for the sched_wakeup probe: the "success" argument is diff --git a/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch b/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch index b86d47a5c..0bbf8c301 100644 --- a/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch +++ b/debian/patches/features/all/rt/latencyhist-disable-jump-labels.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 4 Feb 2016 14:08:06 +0100 Subject: latencyhist: disable jump-labels -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Atleast on X86 we die a recursive death 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 f2a5b6eff..a72140064 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/lglocks-rt.patch b/debian/patches/features/all/rt/lglocks-rt.patch index 3ec66224e..0b282ce9e 100644 --- a/debian/patches/features/all/rt/lglocks-rt.patch +++ b/debian/patches/features/all/rt/lglocks-rt.patch @@ -1,7 +1,7 @@ Subject: lglocks: Provide a RT safe variant From: Thomas Gleixner Date: Wed, 15 Jun 2011 11:02:21 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz lglocks by itself will spin in order to get the lock. This will end up badly if a task with the highest priority keeps spinning while a task 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 e78a8fad1..01a6fd1f2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 9eefd2f09..3772fe404 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 9b054662f..50e24d434 100644 --- a/debian/patches/features/all/rt/localversion.patch +++ b/debian/patches/features/all/rt/localversion.patch @@ -1,7 +1,7 @@ -Subject: v4.4.1-rt5 +Subject: v4.4.1-rt6 From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt5 ++-rt6 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 57d118951..8c10237a3 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 be66315e6..6ec798af1 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 41e626c80..c4ff6921c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz From: Yong Zhang 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 698ec90d1..973673343 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/md-disable-bcache.patch b/debian/patches/features/all/rt/md-disable-bcache.patch index c5b7585e1..8e4dee2db 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-percpu-handling-rt-aware.patch b/debian/patches/features/all/rt/md-raid5-percpu-handling-rt-aware.patch index d99ce29a4..70baa1d89 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz __raid_run_ops() disables preemption with get_cpu() around the access to the raid5_percpu variables. That causes scheduling while atomic 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 c08c0ed78..094e1c2a6 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT index a43e023e6..153850767 100644 --- a/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT +++ b/debian/patches/features/all/rt/mm--rt--Fix-generic-kmap_atomic-for-RT @@ -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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 new file mode 100644 index 000000000..acadfda7a --- /dev/null +++ b/debian/patches/features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch @@ -0,0 +1,42 @@ +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.4/patches-4.4.1-rt6.tar.xz + +it triggers: +|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:930 +|in_atomic(): 0, irqs_disabled(): 1, pid: 12, name: rcuc/0 +|1 lock held by rcuc/0/12: +| #0: (rcu_callback){......}, at: [] rcu_cpu_kthread+0x376/0xb10 +|irq event stamp: 23636 +|hardirqs last enabled at (23635): [] _raw_spin_unlock_irqrestore+0x6c/0x80 +|hardirqs last disabled at (23636): [] wb_congested_put+0x18/0x90 +| [] rt_spin_lock+0x24/0x60 +| [] atomic_dec_and_spin_lock+0x52/0x90 +| [] wb_congested_put+0x28/0x90 +| [] __blkg_release_rcu+0x5e/0x1e0 +| [] ? __blkg_release_rcu+0x87/0x1e0 +| [] ? blkg_conf_finish+0x90/0x90 +| [] rcu_cpu_kthread+0x3b7/0xb10 + +due to cgwb_lock beeing taken with spin_lock_irqsave() usually. + +Signed-off-by: Sebastian Andrzej Siewior +--- + mm/backing-dev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -457,9 +457,9 @@ void wb_congested_put(struct bdi_writeba + { + unsigned long flags; + +- local_irq_save(flags); ++ local_irq_save_nort(flags); + if (!atomic_dec_and_lock(&congested->refcnt, &cgwb_lock)) { +- local_irq_restore(flags); ++ local_irq_restore_nort(flags); + return; + } + 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 6fb98cc54..4a443275c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 3e700ea7e..44712513c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 adaea51a3..15a32d446 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 00fed7e15..fedd28d6e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 23754b29c..60b4fbdf1 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 c671d67b2..db4e6bab8 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 ac84808d5..06f64fd8c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 2ce219499..c7c3b8064 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 26679507b..b446f0748 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 6af2d2868..58316fdba 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-protect-activate-switch-mm.patch b/debian/patches/features/all/rt/mm-protect-activate-switch-mm.patch index fc4cb7f67..2ed488675 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 5a953cd7a..d5e737bdd 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 eafe1fa4c..f2f463f62 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The local_irq_save() is not only used to get things done "fast" but also to ensure that in case of SG_MITER_ATOMIC we are in "atomic" 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 7a66138bf..5c1e7bb4e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 70f0361a0..1da41469e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/mmci-remove-bogus-irq-save.patch b/debian/patches/features/all/rt/mmci-remove-bogus-irq-save.patch index 3d4490cb7..d982f35f5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 764691e87..83f40f49d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a3760000c..b43ef9a96 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches/features/all/rt/net-another-local-irq-disable-alloc-atomic-headache.patch index 2bfde666a..da70941d4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 b9f4f7705..0d5dbdc49 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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: 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 aa199ab70..45f8908a2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-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 d7f0e87a3..7c6709eda 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 c0785f184..1dd653b9c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 56094064d..3de8f3937 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 7a97713bc..219f7b7db 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 24dd4358a..351a72cd4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 @@ -38,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior extern void raise_softirq(unsigned int nr); --- a/kernel/softirq.c +++ b/kernel/softirq.c -@@ -673,6 +673,27 @@ void __raise_softirq_irqoff(unsigned int +@@ -675,6 +675,27 @@ void __raise_softirq_irqoff(unsigned int } /* 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 289203405..623ad069a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-tx-action-avoid-livelock-on-rt.patch b/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch index f7587f2d5..bb1108322 100644 --- a/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch +++ b/debian/patches/features/all/rt/net-tx-action-avoid-livelock-on-rt.patch @@ -1,7 +1,7 @@ Subject: net: Avoid livelock in net_tx_action() on RT From: Steven Rostedt Date: Thu, 06 Oct 2011 10:48:39 -0400 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz qdisc_lock is taken w/o disabling interrupts or bottom halfs. So code holding a qdisc_lock() can be interrupted and softirqs can run on the 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 ca1b0bd02..79abb31e9 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-wireless-warn-nort.patch b/debian/patches/features/all/rt/net-wireless-warn-nort.patch index 76fdcf86a..7e5752c49 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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__Make_synchronize-rcu_expedited_conditional-on-non-rt b/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt index 0debdb652..7311f01c4 100644 --- a/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt +++ b/debian/patches/features/all/rt/net__Make_synchronize-rcu_expedited_conditional-on-non-rt @@ -1,7 +1,7 @@ Date: Tue, 27 Oct 2015 07:31:53 -0500 From: Josh Cartwright Subject: net: Make synchronize_rcu_expedited() conditional on !RT_FULL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz While the use of synchronize_rcu_expedited() might make synchronize_net() "faster", it does so at significant cost on RT 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 e4fb7cb73..d184214b9 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 9d700fabe..7bd2f25ef 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 2fcba0e1c..bbfeb77df 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-access-use-__wake_up_all_locked.patch b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch index fd1fe7e99..0cf4db2c1 100644 --- a/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch +++ b/debian/patches/features/all/rt/pci-access-use-__wake_up_all_locked.patch @@ -1,7 +1,7 @@ Subject: pci: Use __wake_up_all_locked in pci_unblock_user_cfg_access() From: Thomas Gleixner Date: Thu, 01 Dec 2011 00:07:16 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The waitqueue is protected by the pci_lock, so we can just avoid to lock the waitqueue lock itself. That prevents the 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 982f2b4fd..fa246000a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz the local_irq_save() + spin_lock() does not work that well on -RT diff --git a/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch b/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch index 65ae7a185..4380b0b91 100644 --- a/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch +++ b/debian/patches/features/all/rt/perf-make-swevent-hrtimer-irqsafe.patch @@ -1,7 +1,7 @@ From: Yong Zhang Date: Wed, 11 Jul 2012 22:05:21 +0000 Subject: perf: Make swevent hrtimer run in irq instead of softirq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Otherwise we get a deadlock like below: 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 4f68e88d7..0422785f4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz With RT_FULL we get the below wreckage: 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 72f8a2c65..079822ad2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The crypto notifier deadlocks on RT. Though this can be a real deadlock on mainline as well due to fifo fair rwsems. 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 e29b4c4bc..8a8a0fbd3 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: wait.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 583769219..c85a3de90 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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. 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 4c18351c6..e1d303409 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 9f6fa70e8..fa5ac3106 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz posix-cpu-timer code takes non -rt safe locks in hard irq context. Move it to a thread. 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 94da283cd..edc1d9bce 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 81e739f66..94706896c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 ec47c9697..7b75258af 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a6c2dda78..83dc81fb5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Implement the powerpc pieces for lazy preempt. 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 81fe944b4..5a71fa6e1 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz To fix: diff --git a/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch b/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch index 6e226d261..d7120a3ab 100644 --- a/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch +++ b/debian/patches/features/all/rt/preempt-lazy-check-preempt_schedule.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Jan 2016 15:13:30 +0100 Subject: preempt-lazy: Add the lazy-preemption check to preempt_schedule() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Probably in the rebase onto v4.1 this check got moved into less commonly used preempt_schedule_notrace(). This patch ensures that both functions use it. diff --git a/debian/patches/features/all/rt/preempt-lazy-support.patch b/debian/patches/features/all/rt/preempt-lazy-support.patch index 0a2ca198a..c13624bd2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 1d0b1e4cd..f415f42a7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 f873f38cf..3f605817e 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 30d9d56b3..118b3fb37 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 e8d05f30b..ff8008e64 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-don-t-open-IRQs-in-ptrace_freeze_traced-too-e.patch b/debian/patches/features/all/rt/ptrace-don-t-open-IRQs-in-ptrace_freeze_traced-too-e.patch index 491eb9468..4f3086808 100644 --- a/debian/patches/features/all/rt/ptrace-don-t-open-IRQs-in-ptrace_freeze_traced-too-e.patch +++ b/debian/patches/features/all/rt/ptrace-don-t-open-IRQs-in-ptrace_freeze_traced-too-e.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Jan 2016 14:09:05 +0100 Subject: ptrace: don't open IRQs in ptrace_freeze_traced() too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz In the non-RT case the spin_lock_irq() here disables interrupts as well as raw_spin_lock_irq(). So in the unlock case the interrupts are enabled 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 cc59021e2..954b234f4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz As explained by Alexander Fyodorov : diff --git a/debian/patches/features/all/rt/radix-tree-rt-aware.patch b/debian/patches/features/all/rt/radix-tree-rt-aware.patch index 3d66f6ce8..3e6113cf6 100644 --- a/debian/patches/features/all/rt/radix-tree-rt-aware.patch +++ b/debian/patches/features/all/rt/radix-tree-rt-aware.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 17 Jul 2011 21:33:18 +0200 Subject: radix-tree: Make RT aware -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Disable radix_tree_preload() on -RT. This functions returns with preemption disabled which may cause high latencies and breaks if the 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 567619d00..e4ca0bfc7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches/features/all/rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index 85afe3b67..5cda691cc 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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, @@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "tree.h" #include "rcu.h" -@@ -2956,18 +2961,17 @@ static void +@@ -2960,18 +2965,17 @@ static void /* * Do RCU core processing for the current CPU. */ @@ -57,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Schedule RCU callback invocation. If the specified type of RCU * does not support RCU priority boosting, just do a direct call, -@@ -2979,18 +2983,105 @@ static void invoke_rcu_callbacks(struct +@@ -2983,18 +2987,105 @@ static void invoke_rcu_callbacks(struct { if (unlikely(!READ_ONCE(rcu_scheduler_fully_active))) return; @@ -169,7 +169,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Handle any core-RCU processing required by a call_rcu() invocation. -@@ -4609,7 +4700,6 @@ void __init rcu_init(void) +@@ -4615,7 +4706,6 @@ void __init rcu_init(void) if (dump_tree) rcu_dump_rcu_node_tree(&rcu_sched_state); __rcu_init_preempt(); @@ -179,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior * We don't need protection against CPU-hotplug here because --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h -@@ -563,12 +563,10 @@ extern struct rcu_state rcu_bh_state; +@@ -565,12 +565,10 @@ extern struct rcu_state rcu_bh_state; extern struct rcu_state rcu_preempt_state; #endif /* #ifdef CONFIG_PREEMPT_RCU */ @@ -192,7 +192,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifndef RCU_TREE_NONCORE -@@ -588,10 +586,9 @@ void call_rcu(struct rcu_head *head, rcu +@@ -590,10 +588,9 @@ void call_rcu(struct rcu_head *head, rcu static void __init __rcu_init_preempt(void); static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags); static void rcu_preempt_boost_start_gp(struct rcu_node *rnp); diff --git a/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch b/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch new file mode 100644 index 000000000..9e9ae1d3e --- /dev/null +++ b/debian/patches/features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch @@ -0,0 +1,64 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 10 Feb 2016 18:30:56 +0100 +Subject: rcu: disable more spots of rcu_bh +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +We don't use ru_bh on -RT but we still fork a thread for it and keep it +as a flavour. No more. + +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/rcu/tree.c | 6 ++++++ + kernel/rcu/tree.h | 2 ++ + 2 files changed, 8 insertions(+) + +--- a/kernel/rcu/tree.c ++++ b/kernel/rcu/tree.c +@@ -449,11 +449,13 @@ EXPORT_SYMBOL_GPL(rcu_batches_started_sc + /* + * Return the number of RCU BH batches started thus far for debug & stats. + */ ++#ifndef CONFIG_PREEMPT_RT_FULL + unsigned long rcu_batches_started_bh(void) + { + return rcu_bh_state.gpnum; + } + EXPORT_SYMBOL_GPL(rcu_batches_started_bh); ++#endif + + /* + * Return the number of RCU batches completed thus far for debug & stats. +@@ -558,9 +560,11 @@ void rcutorture_get_gp_data(enum rcutort + case RCU_FLAVOR: + rsp = rcu_state_p; + break; ++#ifndef CONFIG_PREEMPT_RT_FULL + case RCU_BH_FLAVOR: + rsp = &rcu_bh_state; + break; ++#endif + case RCU_SCHED_FLAVOR: + rsp = &rcu_sched_state; + break; +@@ -4604,7 +4608,9 @@ void __init rcu_init(void) + + rcu_bootup_announce(); + rcu_init_geometry(); ++#ifndef CONFIG_PREEMPT_RT_FULL + rcu_init_one(&rcu_bh_state, &rcu_bh_data); ++#endif + rcu_init_one(&rcu_sched_state, &rcu_sched_data); + if (dump_tree) + rcu_dump_rcu_node_tree(&rcu_sched_state); +--- a/kernel/rcu/tree.h ++++ b/kernel/rcu/tree.h +@@ -556,7 +556,9 @@ extern struct list_head rcu_struct_flavo + */ + extern struct rcu_state rcu_sched_state; + ++#ifndef CONFIG_PREEMPT_RT_FULL + extern struct rcu_state rcu_bh_state; ++#endif + + #ifdef CONFIG_PREEMPT_RCU + extern struct rcu_state rcu_preempt_state; 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 ef2896666..ab549574b 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-make-RCU_BOOST-default-on-RT.patch b/debian/patches/features/all/rt/rcu-make-RCU_BOOST-default-on-RT.patch index d9deea5f7..ce006eb9c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 a6bdaab11..d00d82858 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-more-swait-conversions.patch b/debian/patches/features/all/rt/rcu-more-swait-conversions.patch index 9d8051ce1..59f31de57 100644 --- a/debian/patches/features/all/rt/rcu-more-swait-conversions.patch +++ b/debian/patches/features/all/rt/rcu-more-swait-conversions.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 31 Jul 2013 19:00:35 +0200 Subject: rcu: use simple waitqueues -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Convert RCU's wait-queues into simple waitqueues. @@ -24,7 +24,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c -@@ -1633,7 +1633,7 @@ static void rcu_gp_kthread_wake(struct r +@@ -1637,7 +1637,7 @@ static void rcu_gp_kthread_wake(struct r !READ_ONCE(rsp->gp_flags) || !rsp->gp_kthread) return; @@ -33,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -2098,7 +2098,7 @@ static int __noreturn rcu_gp_kthread(voi +@@ -2102,7 +2102,7 @@ static int __noreturn rcu_gp_kthread(voi READ_ONCE(rsp->gpnum), TPS("reqwait")); rsp->gp_state = RCU_GP_WAIT_GPS; @@ -42,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior READ_ONCE(rsp->gp_flags) & RCU_GP_FLAG_INIT); rsp->gp_state = RCU_GP_DONE_GPS; -@@ -2128,7 +2128,7 @@ static int __noreturn rcu_gp_kthread(voi +@@ -2132,7 +2132,7 @@ static int __noreturn rcu_gp_kthread(voi READ_ONCE(rsp->gpnum), TPS("fqswait")); rsp->gp_state = RCU_GP_WAIT_FQS; @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior rcu_gp_fqs_check_wake(rsp, &gf), j); rsp->gp_state = RCU_GP_DOING_FQS; /* Locking provides needed memory barriers. */ -@@ -3550,7 +3550,7 @@ static void __rcu_report_exp_rnp(struct +@@ -3554,7 +3554,7 @@ static void __rcu_report_exp_rnp(struct raw_spin_unlock_irqrestore(&rnp->lock, flags); if (wake) { smp_mb(); /* EGP done before wake_up(). */ @@ -60,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior } break; } -@@ -3807,7 +3807,7 @@ static void synchronize_sched_expedited_ +@@ -3811,7 +3811,7 @@ static void synchronize_sched_expedited_ jiffies_start = jiffies; for (;;) { @@ -69,7 +69,7 @@ Signed-off-by: Sebastian Andrzej Siewior rsp->expedited_wq, sync_rcu_preempt_exp_done(rnp_root), jiffies_stall); -@@ -3815,7 +3815,7 @@ static void synchronize_sched_expedited_ +@@ -3819,7 +3819,7 @@ static void synchronize_sched_expedited_ return; if (ret < 0) { /* Hit a signal, disable CPU stall warnings. */ @@ -78,7 +78,7 @@ Signed-off-by: Sebastian Andrzej Siewior sync_rcu_preempt_exp_done(rnp_root)); return; } -@@ -4483,8 +4483,8 @@ static void __init rcu_init_one(struct r +@@ -4487,8 +4487,8 @@ static void __init rcu_init_one(struct r } } 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 2e22c5df6..467d8345c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-migrate_disable-race-with-cpu-hotplug-3f.patch b/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch index 104c20f50..a8034b5dd 100644 --- a/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch +++ b/debian/patches/features/all/rt/re-migrate_disable-race-with-cpu-hotplug-3f.patch @@ -1,7 +1,7 @@ From: Yong Zhang Date: Thu, 28 Jul 2011 11:16:00 +0800 Subject: hotplug: Reread hotplug_pcp on pin_current_cpu() retry -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz When retry happens, it's likely that the task has been migrated to another cpu (except unplug failed), but it still derefernces the 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 377e87570..aad2292ca 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/relay-fix-timer-madness.patch b/debian/patches/features/all/rt/relay-fix-timer-madness.patch index 750dc0998..cc4a6b783 100644 --- a/debian/patches/features/all/rt/relay-fix-timer-madness.patch +++ b/debian/patches/features/all/rt/relay-fix-timer-madness.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:44:07 -0500 Subject: relay: Fix timer madness -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz remove timer calls (!!!) from deep within the tracing infrastructure. This was totally bogus code that can cause lockups and worse. Poll 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 7cb8205c9..9226861b7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-add-rt-locks.patch b/debian/patches/features/all/rt/rt-add-rt-locks.patch index 18a3d3f88..92c4bc879 100644 --- a/debian/patches/features/all/rt/rt-add-rt-locks.patch +++ b/debian/patches/features/all/rt/rt-add-rt-locks.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sun, 26 Jul 2009 19:39:56 +0200 Subject: rt: Add the preempt-rt lock replacement APIs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Map spinlocks, rwlocks, rw_semaphores and semaphores to the rt_mutex based locking functions for preempt-rt. @@ -28,12 +28,12 @@ Signed-off-by: Thomas Gleixner kernel/futex.c | 10 kernel/locking/Makefile | 9 kernel/locking/rt.c | 476 ++++++++++++++++++++++++++++++++++++++ - kernel/locking/rtmutex.c | 423 +++++++++++++++++++++++++++++++-- + kernel/locking/rtmutex.c | 422 +++++++++++++++++++++++++++++++-- kernel/locking/rtmutex_common.h | 14 + kernel/locking/spinlock.c | 7 kernel/locking/spinlock_debug.c | 5 kernel/sched/core.c | 7 - 23 files changed, 1598 insertions(+), 56 deletions(-) + 23 files changed, 1597 insertions(+), 56 deletions(-) --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -925,7 +925,7 @@ Signed-off-by: Thomas Gleixner @@ -1268,7 +1269,8 @@ static int wake_futex_pi(u32 __user *uad - raw_spin_unlock(&pi_state->pi_mutex.wait_lock); + raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); - deboost = rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q); + deboost = rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q, @@ -1478,7 +1478,7 @@ Signed-off-by: Thomas Gleixner * * See Documentation/locking/rt-mutex-design.txt for details. */ -@@ -354,6 +359,14 @@ static bool rt_mutex_cond_detect_deadloc +@@ -356,6 +361,14 @@ static bool rt_mutex_cond_detect_deadloc return debug_rt_mutex_detect_deadlock(waiter, chwalk); } @@ -1493,7 +1493,7 @@ Signed-off-by: Thomas Gleixner /* * Max number of times we'll walk the boosting chain: */ -@@ -661,13 +674,16 @@ static int rt_mutex_adjust_prio_chain(st +@@ -662,13 +675,16 @@ static int rt_mutex_adjust_prio_chain(st * follow here. This is the end of the chain we are walking. */ if (!rt_mutex_owner(lock)) { @@ -1509,10 +1509,10 @@ Signed-off-by: Thomas Gleixner + lock_top_waiter = rt_mutex_top_waiter(lock); + if (prerequeue_top_waiter != lock_top_waiter) + rt_mutex_wake_waiter(lock_top_waiter); - raw_spin_unlock(&lock->wait_lock); + raw_spin_unlock_irq(&lock->wait_lock); return 0; } -@@ -760,6 +776,25 @@ static int rt_mutex_adjust_prio_chain(st +@@ -761,6 +777,25 @@ static int rt_mutex_adjust_prio_chain(st return ret; } @@ -1538,7 +1538,7 @@ Signed-off-by: Thomas Gleixner /* * Try to take an rt-mutex * -@@ -770,8 +805,9 @@ static int rt_mutex_adjust_prio_chain(st +@@ -771,8 +806,9 @@ static int rt_mutex_adjust_prio_chain(st * @waiter: The waiter that is queued to the lock's wait tree if the * callsite called task_blocked_on_lock(), otherwise NULL */ @@ -1548,9 +1548,9 @@ Signed-off-by: Thomas Gleixner + struct task_struct *task, + struct rt_mutex_waiter *waiter, int mode) { - unsigned long flags; - -@@ -810,8 +846,10 @@ static int try_to_take_rt_mutex(struct r + /* + * Before testing whether we can acquire @lock, we set the +@@ -809,8 +845,10 @@ static int try_to_take_rt_mutex(struct r * If waiter is not the highest priority waiter of * @lock, give up. */ @@ -1562,7 +1562,7 @@ Signed-off-by: Thomas Gleixner /* * We can acquire the lock. Remove the waiter from the -@@ -829,14 +867,10 @@ static int try_to_take_rt_mutex(struct r +@@ -828,14 +866,10 @@ static int try_to_take_rt_mutex(struct r * not need to be dequeued. */ if (rt_mutex_has_waiters(lock)) { @@ -1580,7 +1580,7 @@ Signed-off-by: Thomas Gleixner /* * The current top waiter stays enqueued. We * don't have to change anything in the lock -@@ -885,6 +919,315 @@ static int try_to_take_rt_mutex(struct r +@@ -884,6 +918,314 @@ static int try_to_take_rt_mutex(struct r return 1; } @@ -1643,9 +1643,6 @@ Signed-off-by: Thomas Gleixner +} +#endif + -+# define pi_lock(lock) raw_spin_lock_irq(lock) -+# define pi_unlock(lock) raw_spin_unlock_irq(lock) -+ +static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter, + struct task_struct *task, @@ -1661,14 +1658,15 @@ Signed-off-by: Thomas Gleixner +{ + struct task_struct *lock_owner, *self = current; + struct rt_mutex_waiter waiter, *top_waiter; ++ unsigned long flags; + int ret; + + rt_mutex_init_waiter(&waiter, true); + -+ raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + if (__try_to_take_rt_mutex(lock, self, NULL, STEAL_LATERAL)) { -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + @@ -1680,10 +1678,10 @@ Signed-off-by: Thomas Gleixner + * as well. We are serialized via pi_lock against wakeups. See + * try_to_wake_up(). + */ -+ pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + self->saved_state = self->state; + __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + + ret = task_blocks_on_rt_mutex(lock, &waiter, self, 0); + BUG_ON(ret); @@ -1696,18 +1694,18 @@ Signed-off-by: Thomas Gleixner + top_waiter = rt_mutex_top_waiter(lock); + lock_owner = rt_mutex_owner(lock); + -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_print_deadlock(&waiter); + + if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) + schedule(); + -+ raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + -+ pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + } + + /* @@ -1717,10 +1715,10 @@ Signed-off-by: Thomas Gleixner + * happened while we were blocked. Clear saved_state so + * try_to_wakeup() does not get confused. + */ -+ pi_lock(&self->pi_lock); ++ raw_spin_lock(&self->pi_lock); + __set_current_state_no_track(self->saved_state); + self->saved_state = TASK_RUNNING; -+ pi_unlock(&self->pi_lock); ++ raw_spin_unlock(&self->pi_lock); + + /* + * try_to_take_rt_mutex() sets the waiter bit @@ -1731,7 +1729,7 @@ Signed-off-by: Thomas Gleixner + BUG_ON(rt_mutex_has_waiters(lock) && &waiter == rt_mutex_top_waiter(lock)); + BUG_ON(!RB_EMPTY_NODE(&waiter.tree_entry)); + -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + debug_rt_mutex_free_waiter(&waiter); +} @@ -1744,10 +1742,11 @@ Signed-off-by: Thomas Gleixner + */ +static void noinline __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) +{ ++ unsigned long flags; + WAKE_Q(wake_q); + WAKE_Q(wake_sleeper_q); + -+ raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + debug_rt_mutex_unlock(lock); + @@ -1755,13 +1754,13 @@ Signed-off-by: Thomas Gleixner + + if (!rt_mutex_has_waiters(lock)) { + lock->owner = NULL; -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return; + } + + mark_wakeup_next_waiter(&wake_q, &wake_sleeper_q, lock); + -+ raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + wake_up_q(&wake_q); + wake_up_q_sleeper(&wake_sleeper_q); + @@ -1896,17 +1895,17 @@ Signed-off-by: Thomas Gleixner /* * Task blocks on lock. * -@@ -998,6 +1341,7 @@ static int task_blocks_on_rt_mutex(struc - * Called with lock->wait_lock held. +@@ -996,6 +1338,7 @@ static int task_blocks_on_rt_mutex(struc + * Called with lock->wait_lock held and interrupts disabled. */ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + struct wake_q_head *wake_sleeper_q, struct rt_mutex *lock) { struct rt_mutex_waiter *waiter; -@@ -1027,7 +1371,10 @@ static void mark_wakeup_next_waiter(stru +@@ -1024,7 +1367,10 @@ static void mark_wakeup_next_waiter(stru - raw_spin_unlock_irqrestore(¤t->pi_lock, flags); + raw_spin_unlock(¤t->pi_lock); - wake_q_add(wake_q, waiter->task); + if (waiter->savestate) @@ -1916,7 +1915,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1109,11 +1456,11 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1105,11 +1451,11 @@ void rt_mutex_adjust_pi(struct task_stru return; } next_lock = waiter->lock; @@ -1929,8 +1928,8 @@ Signed-off-by: Thomas Gleixner rt_mutex_adjust_prio_chain(task, RT_MUTEX_MIN_CHAINWALK, NULL, next_lock, NULL, task); } -@@ -1199,9 +1546,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, - struct rt_mutex_waiter waiter; +@@ -1196,9 +1542,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, + unsigned long flags; int ret = 0; - debug_rt_mutex_init_waiter(&waiter); @@ -1938,9 +1937,9 @@ Signed-off-by: Thomas Gleixner - RB_CLEAR_NODE(&waiter.tree_entry); + rt_mutex_init_waiter(&waiter, false); - raw_spin_lock(&lock->wait_lock); - -@@ -1286,7 +1631,8 @@ static inline int rt_mutex_slowtrylock(s + /* + * Technically we could use raw_spin_[un]lock_irq() here, but this can +@@ -1292,7 +1636,8 @@ static inline int rt_mutex_slowtrylock(s * Return whether the current task needs to undo a potential priority boosting. */ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, @@ -1948,18 +1947,18 @@ Signed-off-by: Thomas Gleixner + struct wake_q_head *wake_q, + struct wake_q_head *wake_sleeper_q) { - raw_spin_lock(&lock->wait_lock); + unsigned long flags; -@@ -1339,7 +1685,7 @@ static bool __sched rt_mutex_slowunlock( +@@ -1348,7 +1693,7 @@ static bool __sched rt_mutex_slowunlock( * * Queue the next waiter for wakeup once we release the wait_lock. */ - mark_wakeup_next_waiter(wake_q, lock); + mark_wakeup_next_waiter(wake_q, wake_sleeper_q, lock); - raw_spin_unlock(&lock->wait_lock); + raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -@@ -1396,17 +1742,20 @@ rt_mutex_fasttrylock(struct rt_mutex *lo +@@ -1405,17 +1750,20 @@ rt_mutex_fasttrylock(struct rt_mutex *lo static inline void rt_mutex_fastunlock(struct rt_mutex *lock, bool (*slowfn)(struct rt_mutex *lock, @@ -1982,7 +1981,7 @@ Signed-off-by: Thomas Gleixner /* Undo pi boosting if necessary: */ if (deboost) -@@ -1543,13 +1892,14 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock); +@@ -1552,13 +1900,14 @@ EXPORT_SYMBOL_GPL(rt_mutex_unlock); * required or not. */ bool __sched rt_mutex_futex_unlock(struct rt_mutex *lock, @@ -1999,7 +1998,7 @@ Signed-off-by: Thomas Gleixner } /** -@@ -1582,13 +1932,12 @@ EXPORT_SYMBOL_GPL(rt_mutex_destroy); +@@ -1591,13 +1940,12 @@ EXPORT_SYMBOL_GPL(rt_mutex_destroy); void __rt_mutex_init(struct rt_mutex *lock, const char *name) { lock->owner = NULL; @@ -2014,7 +2013,7 @@ Signed-off-by: Thomas Gleixner /** * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1603,7 +1952,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init); +@@ -1612,7 +1960,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init); void rt_mutex_init_proxy_locked(struct rt_mutex *lock, struct task_struct *proxy_owner) { @@ -2023,7 +2022,7 @@ Signed-off-by: Thomas Gleixner debug_rt_mutex_proxy_lock(lock, proxy_owner); rt_mutex_set_owner(lock, proxy_owner); rt_mutex_deadlock_account_lock(lock, proxy_owner); -@@ -1765,3 +2114,25 @@ int rt_mutex_finish_proxy_lock(struct rt +@@ -1774,3 +2122,25 @@ int rt_mutex_finish_proxy_lock(struct rt return ret; } 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 2e87f33f8..7f390e750 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() 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 5dff93f72..1435146aa 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-locking-Reenable-migration-accross-schedule.patch b/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch new file mode 100644 index 000000000..a8f4cdbf6 --- /dev/null +++ b/debian/patches/features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch @@ -0,0 +1,112 @@ +From: Thomas Gleixner +Date: Mon, 8 Feb 2016 16:15:28 +0100 +Subject: rt/locking: Reenable migration accross schedule +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +We currently disable migration across lock acquisition. That includes the part +where we block on the lock and schedule out. We cannot disable migration after +taking the lock as that would cause a possible lock inversion. + +But we can be smart and enable migration when we block and schedule out. That +allows the scheduler to place the task freely at least if this is the first +migrate disable level. For nested locking this does not help at all. + +Signed-off-by: Thomas Gleixner +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/locking/rtmutex.c | 32 ++++++++++++++++++++------------ + 1 file changed, 20 insertions(+), 12 deletions(-) + +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -924,14 +924,19 @@ static int __try_to_take_rt_mutex(struct + * preemptible spin_lock functions: + */ + static inline void rt_spin_lock_fastlock(struct rt_mutex *lock, +- void (*slowfn)(struct rt_mutex *lock)) ++ void (*slowfn)(struct rt_mutex *lock, ++ bool mg_off), ++ bool do_mig_dis) + { + might_sleep_no_state_check(); + ++ if (do_mig_dis) ++ migrate_disable(); ++ + if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) + rt_mutex_deadlock_account_lock(lock, current); + else +- slowfn(lock); ++ slowfn(lock, do_mig_dis); + } + + static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, +@@ -989,7 +994,8 @@ static int task_blocks_on_rt_mutex(struc + * We store the current state under p->pi_lock in p->saved_state and + * the try_to_wake_up() code handles this accordingly. + */ +-static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) ++static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock, ++ bool mg_off) + { + struct task_struct *lock_owner, *self = current; + struct rt_mutex_waiter waiter, *top_waiter; +@@ -1033,8 +1039,13 @@ static void noinline __sched rt_spin_lo + + debug_rt_mutex_print_deadlock(&waiter); + +- if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) ++ if (top_waiter != &waiter || adaptive_wait(lock, lock_owner)) { ++ if (mg_off) ++ migrate_enable(); + schedule(); ++ if (mg_off) ++ migrate_disable(); ++ } + + raw_spin_lock_irqsave(&lock->wait_lock, flags); + +@@ -1105,38 +1116,35 @@ static void noinline __sched rt_spin_lo + + void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock) + { +- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, false); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); + } + EXPORT_SYMBOL(rt_spin_lock__no_mg); + + void __lockfunc rt_spin_lock(spinlock_t *lock) + { +- migrate_disable(); +- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); + } + EXPORT_SYMBOL(rt_spin_lock); + + void __lockfunc __rt_spin_lock(struct rt_mutex *lock) + { +- migrate_disable(); +- rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, true); + } + EXPORT_SYMBOL(__rt_spin_lock); + + void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock) + { +- rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); ++ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock, false); + } + EXPORT_SYMBOL(__rt_spin_lock__no_mg); + + #ifdef CONFIG_DEBUG_LOCK_ALLOC + void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) + { +- migrate_disable(); +- rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock, true); + } + EXPORT_SYMBOL(rt_spin_lock_nested); + #endif 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 7460614dc..9eb8051d2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 4af3008be..c678fe59d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Beyond the warning: diff --git a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully index 2b0b2ff2b..bb28bdb36 100644 --- a/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully +++ b/debian/patches/features/all/rt/rtmutex--Handle-non-enqueued-waiters-gracefully @@ -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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 -@@ -1617,7 +1617,7 @@ int rt_mutex_start_proxy_lock(struct rt_ +@@ -1626,7 +1626,7 @@ int rt_mutex_start_proxy_lock(struct rt_ ret = 0; } @@ -30,4 +30,4 @@ Cc: stable-rt@vger.kernel.org + if (ret && rt_mutex_has_waiters(lock)) remove_waiter(lock, waiter); - raw_spin_unlock(&lock->wait_lock); + raw_spin_unlock_irq(&lock->wait_lock); diff --git a/debian/patches/features/all/rt/rtmutex-Make-wait_lock-irq-safe.patch b/debian/patches/features/all/rt/rtmutex-Make-wait_lock-irq-safe.patch new file mode 100644 index 000000000..f2999b1d7 --- /dev/null +++ b/debian/patches/features/all/rt/rtmutex-Make-wait_lock-irq-safe.patch @@ -0,0 +1,598 @@ +From: Thomas Gleixner +Date: Wed, 13 Jan 2016 11:25:38 +0100 +Subject: rtmutex: Make wait_lock irq safe +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +Sasha reported a lockdep splat about a potential deadlock between RCU boosting +rtmutex and the posix timer it_lock. + +CPU0 CPU1 + +rtmutex_lock(&rcu->rt_mutex) + spin_lock(&rcu->rt_mutex.wait_lock) + local_irq_disable() + spin_lock(&timer->it_lock) + spin_lock(&rcu->mutex.wait_lock) +--> Interrupt + spin_lock(&timer->it_lock) + +This is caused by the following code sequence on CPU1 + + rcu_read_lock() + x = lookup(); + if (x) + spin_lock_irqsave(&x->it_lock); + rcu_read_unlock(); + return x; + +We could fix that in the posix timer code by keeping rcu read locked across +the spinlocked and irq disabled section, but the above sequence is common and +there is no reason not to support it. + +Taking rt_mutex.wait_lock irq safe prevents the deadlock. + +Reported-by: Sasha Levin +Signed-off-by: Thomas Gleixner +Cc: Peter Zijlstra +Cc: Paul McKenney +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/futex.c | 18 +++--- + kernel/locking/rtmutex.c | 135 +++++++++++++++++++++++++---------------------- + 2 files changed, 81 insertions(+), 72 deletions(-) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -1223,7 +1223,7 @@ static int wake_futex_pi(u32 __user *uad + if (pi_state->owner != current) + return -EINVAL; + +- raw_spin_lock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); + new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); + + /* +@@ -1249,22 +1249,22 @@ static int wake_futex_pi(u32 __user *uad + else if (curval != uval) + ret = -EINVAL; + if (ret) { +- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + return ret; + } + +- raw_spin_lock_irq(&pi_state->owner->pi_lock); ++ raw_spin_lock(&pi_state->owner->pi_lock); + WARN_ON(list_empty(&pi_state->list)); + list_del_init(&pi_state->list); +- raw_spin_unlock_irq(&pi_state->owner->pi_lock); ++ raw_spin_unlock(&pi_state->owner->pi_lock); + +- raw_spin_lock_irq(&new_owner->pi_lock); ++ raw_spin_lock(&new_owner->pi_lock); + WARN_ON(!list_empty(&pi_state->list)); + list_add(&pi_state->list, &new_owner->pi_state_list); + pi_state->owner = new_owner; +- raw_spin_unlock_irq(&new_owner->pi_lock); ++ raw_spin_unlock(&new_owner->pi_lock); + +- raw_spin_unlock(&pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); + + deboost = rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q); + +@@ -2129,11 +2129,11 @@ static int fixup_owner(u32 __user *uaddr + * we returned due to timeout or signal without taking the + * rt_mutex. Too late. + */ +- raw_spin_lock(&q->pi_state->pi_mutex.wait_lock); ++ raw_spin_lock_irq(&q->pi_state->pi_mutex.wait_lock); + owner = rt_mutex_owner(&q->pi_state->pi_mutex); + if (!owner) + owner = rt_mutex_next_owner(&q->pi_state->pi_mutex); +- raw_spin_unlock(&q->pi_state->pi_mutex.wait_lock); ++ raw_spin_unlock_irq(&q->pi_state->pi_mutex.wait_lock); + ret = fixup_pi_state_owner(uaddr, q, owner); + goto out; + } +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -99,13 +99,14 @@ static inline void mark_rt_mutex_waiters + * 2) Drop lock->wait_lock + * 3) Try to unlock the lock with cmpxchg + */ +-static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) ++static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, ++ unsigned long flags) + __releases(lock->wait_lock) + { + struct task_struct *owner = rt_mutex_owner(lock); + + clear_rt_mutex_waiters(lock); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + /* + * If a new waiter comes in between the unlock and the cmpxchg + * we have two situations: +@@ -147,11 +148,12 @@ static inline void mark_rt_mutex_waiters + /* + * Simple slow path only version: lock->owner is protected by lock->wait_lock. + */ +-static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock) ++static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, ++ unsigned long flags) + __releases(lock->wait_lock) + { + lock->owner = NULL; +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return true; + } + #endif +@@ -433,7 +435,6 @@ static int rt_mutex_adjust_prio_chain(st + int ret = 0, depth = 0; + struct rt_mutex *lock; + bool detect_deadlock; +- unsigned long flags; + bool requeue = true; + + detect_deadlock = rt_mutex_cond_detect_deadlock(orig_waiter, chwalk); +@@ -476,7 +477,7 @@ static int rt_mutex_adjust_prio_chain(st + /* + * [1] Task cannot go away as we did a get_task() before ! + */ +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock_irq(&task->pi_lock); + + /* + * [2] Get the waiter on which @task is blocked on. +@@ -560,7 +561,7 @@ static int rt_mutex_adjust_prio_chain(st + * operations. + */ + if (!raw_spin_trylock(&lock->wait_lock)) { +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock_irq(&task->pi_lock); + cpu_relax(); + goto retry; + } +@@ -591,7 +592,7 @@ static int rt_mutex_adjust_prio_chain(st + /* + * No requeue[7] here. Just release @task [8] + */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + put_task_struct(task); + + /* +@@ -599,14 +600,14 @@ static int rt_mutex_adjust_prio_chain(st + * If there is no owner of the lock, end of chain. + */ + if (!rt_mutex_owner(lock)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 0; + } + + /* [10] Grab the next task, i.e. owner of @lock */ + task = rt_mutex_owner(lock); + get_task_struct(task); +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + + /* + * No requeue [11] here. We just do deadlock detection. +@@ -621,8 +622,8 @@ static int rt_mutex_adjust_prio_chain(st + top_waiter = rt_mutex_top_waiter(lock); + + /* [13] Drop locks */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + /* If owner is not blocked, end of chain. */ + if (!next_lock) +@@ -643,7 +644,7 @@ static int rt_mutex_adjust_prio_chain(st + rt_mutex_enqueue(lock, waiter); + + /* [8] Release the task */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + put_task_struct(task); + + /* +@@ -661,14 +662,14 @@ static int rt_mutex_adjust_prio_chain(st + */ + if (prerequeue_top_waiter != rt_mutex_top_waiter(lock)) + wake_up_process(rt_mutex_top_waiter(lock)->task); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 0; + } + + /* [10] Grab the next task, i.e. the owner of @lock */ + task = rt_mutex_owner(lock); + get_task_struct(task); +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + + /* [11] requeue the pi waiters if necessary */ + if (waiter == rt_mutex_top_waiter(lock)) { +@@ -722,8 +723,8 @@ static int rt_mutex_adjust_prio_chain(st + top_waiter = rt_mutex_top_waiter(lock); + + /* [13] Drop the locks */ +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock(&task->pi_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + /* + * Make the actual exit decisions [12], based on the stored +@@ -746,7 +747,7 @@ static int rt_mutex_adjust_prio_chain(st + goto again; + + out_unlock_pi: +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock_irq(&task->pi_lock); + out_put_task: + put_task_struct(task); + +@@ -756,7 +757,7 @@ static int rt_mutex_adjust_prio_chain(st + /* + * Try to take an rt-mutex + * +- * Must be called with lock->wait_lock held. ++ * Must be called with lock->wait_lock held and interrupts disabled + * + * @lock: The lock to be acquired. + * @task: The task which wants to acquire the lock +@@ -766,8 +767,6 @@ static int rt_mutex_adjust_prio_chain(st + static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, + struct rt_mutex_waiter *waiter) + { +- unsigned long flags; +- + /* + * Before testing whether we can acquire @lock, we set the + * RT_MUTEX_HAS_WAITERS bit in @lock->owner. This forces all +@@ -852,7 +851,7 @@ static int try_to_take_rt_mutex(struct r + * case, but conditionals are more expensive than a redundant + * store. + */ +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + task->pi_blocked_on = NULL; + /* + * Finish the lock acquisition. @task is the new owner. If +@@ -861,7 +860,7 @@ static int try_to_take_rt_mutex(struct r + */ + if (rt_mutex_has_waiters(lock)) + rt_mutex_enqueue_pi(task, rt_mutex_top_waiter(lock)); +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + + takeit: + /* We got the lock. */ +@@ -883,7 +882,7 @@ static int try_to_take_rt_mutex(struct r + * + * Prepare waiter and propagate pi chain + * +- * This must be called with lock->wait_lock held. ++ * This must be called with lock->wait_lock held and interrupts disabled + */ + static int task_blocks_on_rt_mutex(struct rt_mutex *lock, + struct rt_mutex_waiter *waiter, +@@ -894,7 +893,6 @@ static int task_blocks_on_rt_mutex(struc + struct rt_mutex_waiter *top_waiter = waiter; + struct rt_mutex *next_lock; + int chain_walk = 0, res; +- unsigned long flags; + + /* + * Early deadlock detection. We really don't want the task to +@@ -908,7 +906,7 @@ static int task_blocks_on_rt_mutex(struc + if (owner == task) + return -EDEADLK; + +- raw_spin_lock_irqsave(&task->pi_lock, flags); ++ raw_spin_lock(&task->pi_lock); + __rt_mutex_adjust_prio(task); + waiter->task = task; + waiter->lock = lock; +@@ -921,12 +919,12 @@ static int task_blocks_on_rt_mutex(struc + + task->pi_blocked_on = waiter; + +- raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + + if (!owner) + return 0; + +- raw_spin_lock_irqsave(&owner->pi_lock, flags); ++ raw_spin_lock(&owner->pi_lock); + if (waiter == rt_mutex_top_waiter(lock)) { + rt_mutex_dequeue_pi(owner, top_waiter); + rt_mutex_enqueue_pi(owner, waiter); +@@ -941,7 +939,7 @@ static int task_blocks_on_rt_mutex(struc + /* Store the lock on which owner is blocked or NULL */ + next_lock = task_blocked_on_lock(owner); + +- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); ++ raw_spin_unlock(&owner->pi_lock); + /* + * Even if full deadlock detection is on, if the owner is not + * blocked itself, we can avoid finding this out in the chain +@@ -957,12 +955,12 @@ static int task_blocks_on_rt_mutex(struc + */ + get_task_struct(owner); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + res = rt_mutex_adjust_prio_chain(owner, chwalk, lock, + next_lock, waiter, task); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + return res; + } +@@ -971,15 +969,14 @@ static int task_blocks_on_rt_mutex(struc + * Remove the top waiter from the current tasks pi waiter tree and + * queue it up. + * +- * Called with lock->wait_lock held. ++ * Called with lock->wait_lock held and interrupts disabled. + */ + static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, + struct rt_mutex *lock) + { + struct rt_mutex_waiter *waiter; +- unsigned long flags; + +- raw_spin_lock_irqsave(¤t->pi_lock, flags); ++ raw_spin_lock(¤t->pi_lock); + + waiter = rt_mutex_top_waiter(lock); + +@@ -1001,7 +998,7 @@ static void mark_wakeup_next_waiter(stru + */ + lock->owner = (void *) RT_MUTEX_HAS_WAITERS; + +- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); ++ raw_spin_unlock(¤t->pi_lock); + + wake_q_add(wake_q, waiter->task); + } +@@ -1009,7 +1006,7 @@ static void mark_wakeup_next_waiter(stru + /* + * Remove a waiter from a lock and give up + * +- * Must be called with lock->wait_lock held and ++ * Must be called with lock->wait_lock held and interrupts disabled. I must + * have just failed to try_to_take_rt_mutex(). + */ + static void remove_waiter(struct rt_mutex *lock, +@@ -1018,12 +1015,11 @@ static void remove_waiter(struct rt_mute + bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); + struct task_struct *owner = rt_mutex_owner(lock); + struct rt_mutex *next_lock; +- unsigned long flags; + +- raw_spin_lock_irqsave(¤t->pi_lock, flags); ++ raw_spin_lock(¤t->pi_lock); + rt_mutex_dequeue(lock, waiter); + current->pi_blocked_on = NULL; +- raw_spin_unlock_irqrestore(¤t->pi_lock, flags); ++ raw_spin_unlock(¤t->pi_lock); + + /* + * Only update priority if the waiter was the highest priority +@@ -1032,7 +1028,7 @@ static void remove_waiter(struct rt_mute + if (!owner || !is_top_waiter) + return; + +- raw_spin_lock_irqsave(&owner->pi_lock, flags); ++ raw_spin_lock(&owner->pi_lock); + + rt_mutex_dequeue_pi(owner, waiter); + +@@ -1044,7 +1040,7 @@ static void remove_waiter(struct rt_mute + /* Store the lock on which owner is blocked or NULL */ + next_lock = task_blocked_on_lock(owner); + +- raw_spin_unlock_irqrestore(&owner->pi_lock, flags); ++ raw_spin_unlock(&owner->pi_lock); + + /* + * Don't walk the chain, if the owner task is not blocked +@@ -1056,12 +1052,12 @@ static void remove_waiter(struct rt_mute + /* gets dropped in rt_mutex_adjust_prio_chain()! */ + get_task_struct(owner); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + rt_mutex_adjust_prio_chain(owner, RT_MUTEX_MIN_CHAINWALK, lock, + next_lock, NULL, current); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + } + + /* +@@ -1097,11 +1093,11 @@ void rt_mutex_adjust_pi(struct task_stru + * __rt_mutex_slowlock() - Perform the wait-wake-try-to-take loop + * @lock: the rt_mutex to take + * @state: the state the task should block in (TASK_INTERRUPTIBLE +- * or TASK_UNINTERRUPTIBLE) ++ * or TASK_UNINTERRUPTIBLE) + * @timeout: the pre-initialized and started timer, or NULL for none + * @waiter: the pre-initialized rt_mutex_waiter + * +- * lock->wait_lock must be held by the caller. ++ * Must be called with lock->wait_lock held and interrupts disabled + */ + static int __sched + __rt_mutex_slowlock(struct rt_mutex *lock, int state, +@@ -1129,13 +1125,13 @@ static int __sched + break; + } + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + debug_rt_mutex_print_deadlock(waiter); + + schedule(); + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + set_current_state(state); + } + +@@ -1172,17 +1168,26 @@ rt_mutex_slowlock(struct rt_mutex *lock, + enum rtmutex_chainwalk chwalk) + { + struct rt_mutex_waiter waiter; ++ unsigned long flags; + int ret = 0; + + debug_rt_mutex_init_waiter(&waiter); + RB_CLEAR_NODE(&waiter.pi_tree_entry); + RB_CLEAR_NODE(&waiter.tree_entry); + +- raw_spin_lock(&lock->wait_lock); ++ /* ++ * Technically we could use raw_spin_[un]lock_irq() here, but this can ++ * be called in early boot if the cmpxchg() fast path is disabled ++ * (debug, no architecture support). In this case we will acquire the ++ * rtmutex with lock->wait_lock held. But we cannot unconditionally ++ * enable interrupts in that early boot case. So we need to use the ++ * irqsave/restore variants. ++ */ ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + /* Try to acquire the lock again: */ + if (try_to_take_rt_mutex(lock, current, NULL)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + return 0; + } + +@@ -1211,7 +1216,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + /* Remove pending timer: */ + if (unlikely(timeout)) +@@ -1227,6 +1232,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, + */ + static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) + { ++ unsigned long flags; + int ret; + + /* +@@ -1238,10 +1244,10 @@ static inline int rt_mutex_slowtrylock(s + return 0; + + /* +- * The mutex has currently no owner. Lock the wait lock and +- * try to acquire the lock. ++ * The mutex has currently no owner. Lock the wait lock and try to ++ * acquire the lock. We use irqsave here to support early boot calls. + */ +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + ret = try_to_take_rt_mutex(lock, current, NULL); + +@@ -1251,7 +1257,7 @@ static inline int rt_mutex_slowtrylock(s + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + return ret; + } +@@ -1263,7 +1269,10 @@ static inline int rt_mutex_slowtrylock(s + static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, + struct wake_q_head *wake_q) + { +- raw_spin_lock(&lock->wait_lock); ++ unsigned long flags; ++ ++ /* irqsave required to support early boot calls */ ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + + debug_rt_mutex_unlock(lock); + +@@ -1302,10 +1311,10 @@ static bool __sched rt_mutex_slowunlock( + */ + while (!rt_mutex_has_waiters(lock)) { + /* Drops lock->wait_lock ! */ +- if (unlock_rt_mutex_safe(lock) == true) ++ if (unlock_rt_mutex_safe(lock, flags) == true) + return false; + /* Relock the rtmutex and try again */ +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irqsave(&lock->wait_lock, flags); + } + + /* +@@ -1316,7 +1325,7 @@ static bool __sched rt_mutex_slowunlock( + */ + mark_wakeup_next_waiter(wake_q, lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); + + /* check PI boosting */ + return true; +@@ -1596,10 +1605,10 @@ int rt_mutex_start_proxy_lock(struct rt_ + { + int ret; + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + if (try_to_take_rt_mutex(lock, task, NULL)) { +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + return 1; + } + +@@ -1620,7 +1629,7 @@ int rt_mutex_start_proxy_lock(struct rt_ + if (unlikely(ret)) + remove_waiter(lock, waiter); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + debug_rt_mutex_print_deadlock(waiter); + +@@ -1668,7 +1677,7 @@ int rt_mutex_finish_proxy_lock(struct rt + { + int ret; + +- raw_spin_lock(&lock->wait_lock); ++ raw_spin_lock_irq(&lock->wait_lock); + + set_current_state(TASK_INTERRUPTIBLE); + +@@ -1684,7 +1693,7 @@ int rt_mutex_finish_proxy_lock(struct rt + */ + fixup_rt_mutex_waiters(lock); + +- raw_spin_unlock(&lock->wait_lock); ++ raw_spin_unlock_irq(&lock->wait_lock); + + return ret; + } diff --git a/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch b/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch index 5a97e49a9..628c18709 100644 --- a/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch +++ b/debian/patches/features/all/rt/rtmutex-Use-chainwalking-control-enum.patch @@ -1,7 +1,7 @@ From: "bmouring@ni.com" Date: Tue, 15 Dec 2015 17:07:30 -0600 Subject: rtmutex: Use chainwalking control enum -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz In 8930ed80 (rtmutex: Cleanup deadlock detector debug logic), chainwalking control enums were introduced to limit the deadlock @@ -17,9 +17,9 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1020,7 +1020,7 @@ static void noinline __sched rt_spin_lo +@@ -1017,7 +1017,7 @@ static void noinline __sched rt_spin_lo __set_current_state_no_track(TASK_UNINTERRUPTIBLE); - pi_unlock(&self->pi_lock); + raw_spin_unlock(&self->pi_lock); - ret = task_blocks_on_rt_mutex(lock, &waiter, self, 0); + ret = task_blocks_on_rt_mutex(lock, &waiter, self, RT_MUTEX_MIN_CHAINWALK); diff --git a/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch b/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch index 3e5b27348..d8641431b 100644 --- a/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch +++ b/debian/patches/features/all/rt/rtmutex-add-a-first-shot-of-ww_mutex.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 28 Oct 2013 09:36:37 +0100 Subject: rtmutex: Add RT aware ww locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz lockdep says: | -------------------------------------------------------------------------- @@ -36,7 +36,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include "rtmutex_common.h" -@@ -1221,6 +1222,40 @@ EXPORT_SYMBOL(__rt_spin_lock_init); +@@ -1219,6 +1220,40 @@ EXPORT_SYMBOL(__rt_spin_lock_init); #endif /* PREEMPT_RT_FULL */ @@ -77,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior static inline int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, struct rt_mutex_waiter *waiter) -@@ -1478,7 +1513,8 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1473,7 +1508,8 @@ void rt_mutex_adjust_pi(struct task_stru static int __sched __rt_mutex_slowlock(struct rt_mutex *lock, int state, struct hrtimer_sleeper *timeout, @@ -87,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior { int ret = 0; -@@ -1501,6 +1537,12 @@ static int __sched +@@ -1496,6 +1532,12 @@ static int __sched break; } @@ -97,10 +97,10 @@ Signed-off-by: Sebastian Andrzej Siewior + break; + } + - raw_spin_unlock(&lock->wait_lock); + raw_spin_unlock_irq(&lock->wait_lock); debug_rt_mutex_print_deadlock(waiter); -@@ -1535,13 +1577,90 @@ static void rt_mutex_handle_deadlock(int +@@ -1530,13 +1572,90 @@ static void rt_mutex_handle_deadlock(int } } @@ -191,17 +191,17 @@ Signed-off-by: Sebastian Andrzej Siewior + struct ww_acquire_ctx *ww_ctx) { struct rt_mutex_waiter waiter; - int ret = 0; -@@ -1552,6 +1671,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, + unsigned long flags; +@@ -1556,6 +1675,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, /* Try to acquire the lock again: */ if (try_to_take_rt_mutex(lock, current, NULL)) { + if (ww_ctx) + ww_mutex_account_lock(lock, ww_ctx); - raw_spin_unlock(&lock->wait_lock); + raw_spin_unlock_irqrestore(&lock->wait_lock, flags); return 0; } -@@ -1566,13 +1687,23 @@ rt_mutex_slowlock(struct rt_mutex *lock, +@@ -1570,13 +1691,23 @@ rt_mutex_slowlock(struct rt_mutex *lock, if (likely(!ret)) /* sleep on the mutex */ @@ -227,7 +227,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -1701,31 +1832,36 @@ static bool __sched rt_mutex_slowunlock( +@@ -1709,31 +1840,36 @@ static bool __sched rt_mutex_slowunlock( */ static inline int rt_mutex_fastlock(struct rt_mutex *lock, int state, @@ -268,7 +268,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline int -@@ -1772,7 +1908,7 @@ void __sched rt_mutex_lock(struct rt_mut +@@ -1780,7 +1916,7 @@ void __sched rt_mutex_lock(struct rt_mut { might_sleep(); @@ -277,7 +277,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock); -@@ -1789,7 +1925,7 @@ int __sched rt_mutex_lock_interruptible( +@@ -1797,7 +1933,7 @@ int __sched rt_mutex_lock_interruptible( { might_sleep(); @@ -286,7 +286,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible); -@@ -1802,7 +1938,7 @@ int rt_mutex_timed_futex_lock(struct rt_ +@@ -1810,7 +1946,7 @@ int rt_mutex_timed_futex_lock(struct rt_ might_sleep(); return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, @@ -295,7 +295,7 @@ Signed-off-by: Sebastian Andrzej Siewior rt_mutex_slowlock); } -@@ -1821,7 +1957,7 @@ int __sched rt_mutex_lock_killable(struc +@@ -1829,7 +1965,7 @@ int __sched rt_mutex_lock_killable(struc { might_sleep(); @@ -304,7 +304,7 @@ Signed-off-by: Sebastian Andrzej Siewior } EXPORT_SYMBOL_GPL(rt_mutex_lock_killable); -@@ -1845,6 +1981,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc +@@ -1853,6 +1989,7 @@ rt_mutex_timed_lock(struct rt_mutex *loc return rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, RT_MUTEX_MIN_CHAINWALK, @@ -312,7 +312,7 @@ Signed-off-by: Sebastian Andrzej Siewior rt_mutex_slowlock); } EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); -@@ -2099,7 +2236,7 @@ int rt_mutex_finish_proxy_lock(struct rt +@@ -2107,7 +2244,7 @@ int rt_mutex_finish_proxy_lock(struct rt set_current_state(TASK_INTERRUPTIBLE); /* sleep on the mutex */ @@ -321,7 +321,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (unlikely(ret)) remove_waiter(lock, waiter); -@@ -2115,24 +2252,88 @@ int rt_mutex_finish_proxy_lock(struct rt +@@ -2123,24 +2260,88 @@ int rt_mutex_finish_proxy_lock(struct rt return ret; } 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 a55e6c0cb..c99b30268 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-futex-prepare-rt.patch b/debian/patches/features/all/rt/rtmutex-futex-prepare-rt.patch index c7e99ebf5..e20338b05 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 @@ -146,7 +146,7 @@ Signed-off-by: Thomas Gleixner /* * We can speed up the acquire/release, if there's no debugging state to be * set up. -@@ -355,7 +360,8 @@ int max_lock_depth = 1024; +@@ -357,7 +362,8 @@ int max_lock_depth = 1024; static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) { @@ -156,7 +156,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -492,7 +498,7 @@ static int rt_mutex_adjust_prio_chain(st +@@ -493,7 +499,7 @@ static int rt_mutex_adjust_prio_chain(st * reached or the state of the chain has changed while we * dropped the locks. */ @@ -165,10 +165,10 @@ Signed-off-by: Thomas Gleixner goto out_unlock_pi; /* -@@ -909,6 +915,23 @@ static int task_blocks_on_rt_mutex(struc +@@ -907,6 +913,23 @@ static int task_blocks_on_rt_mutex(struc return -EDEADLK; - raw_spin_lock_irqsave(&task->pi_lock, flags); + raw_spin_lock(&task->pi_lock); + + /* + * In the case of futex requeue PI, this will be a proxy @@ -180,7 +180,7 @@ Signed-off-by: Thomas Gleixner + * the task if PI_WAKEUP_INPROGRESS is set. + */ + if (task != current && task->pi_blocked_on == PI_WAKEUP_INPROGRESS) { -+ raw_spin_unlock_irqrestore(&task->pi_lock, flags); ++ raw_spin_unlock(&task->pi_lock); + return -EAGAIN; + } + @@ -189,7 +189,7 @@ Signed-off-by: Thomas Gleixner __rt_mutex_adjust_prio(task); waiter->task = task; waiter->lock = lock; -@@ -932,7 +955,7 @@ static int task_blocks_on_rt_mutex(struc +@@ -930,7 +953,7 @@ static int task_blocks_on_rt_mutex(struc rt_mutex_enqueue_pi(owner, waiter); __rt_mutex_adjust_prio(owner); @@ -198,16 +198,16 @@ Signed-off-by: Thomas Gleixner chain_walk = 1; } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { chain_walk = 1; -@@ -1017,7 +1040,7 @@ static void remove_waiter(struct rt_mute +@@ -1014,7 +1037,7 @@ static void remove_waiter(struct rt_mute { bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); struct task_struct *owner = rt_mutex_owner(lock); - struct rt_mutex *next_lock; + struct rt_mutex *next_lock = NULL; - unsigned long flags; - raw_spin_lock_irqsave(¤t->pi_lock, flags); -@@ -1042,7 +1065,8 @@ static void remove_waiter(struct rt_mute + raw_spin_lock(¤t->pi_lock); + rt_mutex_dequeue(lock, waiter); +@@ -1038,7 +1061,8 @@ static void remove_waiter(struct rt_mute __rt_mutex_adjust_prio(owner); /* Store the lock on which owner is blocked or NULL */ @@ -215,9 +215,9 @@ Signed-off-by: Thomas Gleixner + if (rt_mutex_real_waiter(owner->pi_blocked_on)) + next_lock = task_blocked_on_lock(owner); - raw_spin_unlock_irqrestore(&owner->pi_lock, flags); + raw_spin_unlock(&owner->pi_lock); -@@ -1078,7 +1102,7 @@ void rt_mutex_adjust_pi(struct task_stru +@@ -1074,7 +1098,7 @@ void rt_mutex_adjust_pi(struct task_stru raw_spin_lock_irqsave(&task->pi_lock, flags); waiter = task->pi_blocked_on; diff --git a/debian/patches/features/all/rt/rtmutex-lock-killable.patch b/debian/patches/features/all/rt/rtmutex-lock-killable.patch index 734f66a11..fb57d79c2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 -@@ -1458,6 +1458,25 @@ int rt_mutex_timed_futex_lock(struct rt_ +@@ -1467,6 +1467,25 @@ int rt_mutex_timed_futex_lock(struct rt_ } /** diff --git a/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch b/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch new file mode 100644 index 000000000..184e502f2 --- /dev/null +++ b/debian/patches/features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch @@ -0,0 +1,272 @@ +From: Sebastian Andrzej Siewior +Date: Fri, 5 Feb 2016 18:26:11 +0100 +Subject: rtmutex: push down migrate_disable() into rt_spin_lock() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz + +No point in having the migrate disable/enable invocations in all the +macro/inlines. That's just more code for no win as we do a function +call anyway. Move it to the core code and save quite some text size. + + text data bss dec filename +11034127 3676912 14901248 29612287 vmlinux.before +10990437 3676848 14901248 29568533 vmlinux.after + +~-40KiB + +Signed-off-by: Sebastian Andrzej Siewior +--- + include/linux/locallock.h | 6 +++--- + include/linux/spinlock_rt.h | 25 +++++++------------------ + kernel/cpu.c | 4 ++-- + kernel/locking/lglock.c | 2 +- + kernel/locking/rt.c | 2 -- + kernel/locking/rtmutex.c | 44 +++++++++++++++++++++++++++++++++++++++++--- + 6 files changed, 54 insertions(+), 29 deletions(-) + +--- a/include/linux/locallock.h ++++ b/include/linux/locallock.h +@@ -43,9 +43,9 @@ struct local_irq_lock { + * for CONFIG_PREEMPT_BASE map to the normal spin_* calls. + */ + #ifdef CONFIG_PREEMPT_RT_FULL +-# define spin_lock_local(lock) rt_spin_lock(lock) +-# define spin_trylock_local(lock) rt_spin_trylock(lock) +-# define spin_unlock_local(lock) rt_spin_unlock(lock) ++# define spin_lock_local(lock) rt_spin_lock__no_mg(lock) ++# define spin_trylock_local(lock) rt_spin_trylock__no_mg(lock) ++# define spin_unlock_local(lock) rt_spin_unlock__no_mg(lock) + #else + # define spin_lock_local(lock) spin_lock(lock) + # define spin_trylock_local(lock) spin_trylock(lock) +--- a/include/linux/spinlock_rt.h ++++ b/include/linux/spinlock_rt.h +@@ -18,6 +18,10 @@ do { \ + __rt_spin_lock_init(slock, #slock, &__key); \ + } while (0) + ++void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock); ++void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock); ++int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock); ++ + extern void __lockfunc rt_spin_lock(spinlock_t *lock); + extern unsigned long __lockfunc rt_spin_lock_trace_flags(spinlock_t *lock); + extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass); +@@ -32,20 +36,16 @@ extern int atomic_dec_and_spin_lock(atom + * lockdep-less calls, for derived types like rwlock: + * (for trylock they can use rt_mutex_trylock() directly. + */ ++extern void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock); + extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock); + extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); + extern int __lockfunc __rt_spin_trylock(struct rt_mutex *lock); + +-#define spin_lock(lock) \ +- do { \ +- migrate_disable(); \ +- rt_spin_lock(lock); \ +- } while (0) ++#define spin_lock(lock) rt_spin_lock(lock) + + #define spin_lock_bh(lock) \ + do { \ + local_bh_disable(); \ +- migrate_disable(); \ + rt_spin_lock(lock); \ + } while (0) + +@@ -56,24 +56,19 @@ extern int __lockfunc __rt_spin_trylock( + #define spin_trylock(lock) \ + ({ \ + int __locked; \ +- migrate_disable(); \ + __locked = spin_do_trylock(lock); \ +- if (!__locked) \ +- migrate_enable(); \ + __locked; \ + }) + + #ifdef CONFIG_LOCKDEP + # define spin_lock_nested(lock, subclass) \ + do { \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + + #define spin_lock_bh_nested(lock, subclass) \ + do { \ + local_bh_disable(); \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + +@@ -81,7 +76,6 @@ extern int __lockfunc __rt_spin_trylock( + do { \ + typecheck(unsigned long, flags); \ + flags = 0; \ +- migrate_disable(); \ + rt_spin_lock_nested(lock, subclass); \ + } while (0) + #else +@@ -117,16 +111,11 @@ static inline unsigned long spin_lock_tr + /* FIXME: we need rt_spin_lock_nest_lock */ + #define spin_lock_nest_lock(lock, nest_lock) spin_lock_nested(lock, 0) + +-#define spin_unlock(lock) \ +- do { \ +- rt_spin_unlock(lock); \ +- migrate_enable(); \ +- } while (0) ++#define spin_unlock(lock) rt_spin_unlock(lock) + + #define spin_unlock_bh(lock) \ + do { \ + rt_spin_unlock(lock); \ +- migrate_enable(); \ + local_bh_enable(); \ + } while (0) + +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -127,8 +127,8 @@ struct hotplug_pcp { + }; + + #ifdef CONFIG_PREEMPT_RT_FULL +-# define hotplug_lock(hp) rt_spin_lock(&(hp)->lock) +-# define hotplug_unlock(hp) rt_spin_unlock(&(hp)->lock) ++# define hotplug_lock(hp) rt_spin_lock__no_mg(&(hp)->lock) ++# define hotplug_unlock(hp) rt_spin_unlock__no_mg(&(hp)->lock) + #else + # define hotplug_lock(hp) mutex_lock(&(hp)->mutex) + # define hotplug_unlock(hp) mutex_unlock(&(hp)->mutex) +--- a/kernel/locking/lglock.c ++++ b/kernel/locking/lglock.c +@@ -10,7 +10,7 @@ + # define lg_do_unlock(l) arch_spin_unlock(l) + #else + # define lg_lock_ptr struct rt_mutex +-# define lg_do_lock(l) __rt_spin_lock(l) ++# define lg_do_lock(l) __rt_spin_lock__no_mg(l) + # define lg_do_unlock(l) __rt_spin_unlock(l) + #endif + /* +--- a/kernel/locking/rt.c ++++ b/kernel/locking/rt.c +@@ -235,7 +235,6 @@ EXPORT_SYMBOL(rt_read_trylock); + void __lockfunc rt_write_lock(rwlock_t *rwlock) + { + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); +- migrate_disable(); + __rt_spin_lock(&rwlock->lock); + } + EXPORT_SYMBOL(rt_write_lock); +@@ -249,7 +248,6 @@ void __lockfunc rt_read_lock(rwlock_t *r + * recursive read locks succeed when current owns the lock + */ + if (rt_mutex_owner(lock) != current) { +- migrate_disable(); + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); + __rt_spin_lock(lock); + } +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -1103,8 +1103,16 @@ static void noinline __sched rt_spin_lo + rt_mutex_adjust_prio(current); + } + ++void __lockfunc rt_spin_lock__no_mg(spinlock_t *lock) ++{ ++ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); ++ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); ++} ++EXPORT_SYMBOL(rt_spin_lock__no_mg); ++ + void __lockfunc rt_spin_lock(spinlock_t *lock) + { ++ migrate_disable(); + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); + } +@@ -1112,24 +1120,41 @@ EXPORT_SYMBOL(rt_spin_lock); + + void __lockfunc __rt_spin_lock(struct rt_mutex *lock) + { ++ migrate_disable(); + rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); + } + EXPORT_SYMBOL(__rt_spin_lock); + ++void __lockfunc __rt_spin_lock__no_mg(struct rt_mutex *lock) ++{ ++ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); ++} ++EXPORT_SYMBOL(__rt_spin_lock__no_mg); ++ + #ifdef CONFIG_DEBUG_LOCK_ALLOC + void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) + { ++ migrate_disable(); + rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); + spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); + } + EXPORT_SYMBOL(rt_spin_lock_nested); + #endif + ++void __lockfunc rt_spin_unlock__no_mg(spinlock_t *lock) ++{ ++ /* NOTE: we always pass in '1' for nested, for simplicity */ ++ spin_release(&lock->dep_map, 1, _RET_IP_); ++ rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); ++} ++EXPORT_SYMBOL(rt_spin_unlock__no_mg); ++ + void __lockfunc rt_spin_unlock(spinlock_t *lock) + { + /* NOTE: we always pass in '1' for nested, for simplicity */ + spin_release(&lock->dep_map, 1, _RET_IP_); + rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); ++ migrate_enable(); + } + EXPORT_SYMBOL(rt_spin_unlock); + +@@ -1156,12 +1181,27 @@ int __lockfunc __rt_spin_trylock(struct + return rt_mutex_trylock(lock); + } + ++int __lockfunc rt_spin_trylock__no_mg(spinlock_t *lock) ++{ ++ int ret; ++ ++ ret = rt_mutex_trylock(&lock->lock); ++ if (ret) ++ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ++ return ret; ++} ++EXPORT_SYMBOL(rt_spin_trylock__no_mg); ++ + int __lockfunc rt_spin_trylock(spinlock_t *lock) + { +- int ret = rt_mutex_trylock(&lock->lock); ++ int ret; + ++ migrate_disable(); ++ ret = rt_mutex_trylock(&lock->lock); + if (ret) + spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ++ else ++ migrate_enable(); + return ret; + } + EXPORT_SYMBOL(rt_spin_trylock); +@@ -1200,12 +1240,10 @@ int atomic_dec_and_spin_lock(atomic_t *a + /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */ + if (atomic_add_unless(atomic, -1, 1)) + return 0; +- migrate_disable(); + rt_spin_lock(lock); + if (atomic_dec_and_test(atomic)) + return 1; + rt_spin_unlock(lock); +- migrate_enable(); + return 0; + } + EXPORT_SYMBOL(atomic_dec_and_spin_lock); 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 dc7a4036a..b77fcaa05 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 -@@ -1469,7 +1469,11 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); +@@ -1478,7 +1478,11 @@ EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); */ int __sched rt_mutex_trylock(struct rt_mutex *lock) { 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 f7713d12a..21897c8d7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: 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 d266152ae..f41c54cc2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-deadline-dl_task_timer-has-to-be-irqsafe.patch b/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch index 8678f1cb9..5a7b61c10 100644 --- a/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch +++ b/debian/patches/features/all/rt/sched-deadline-dl_task_timer-has-to-be-irqsafe.patch @@ -1,7 +1,7 @@ From: Juri Lelli Date: Tue, 13 May 2014 15:30:20 +0200 Subject: sched/deadline: dl_task_timer has to be irqsafe -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz As for rt_period_timer, dl_task_timer has to be irqsafe. 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 520267ba6..b8686d662 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 d6e5990d4..df12407c4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 8727490a7..9a30dc889 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 9ec18bbba..fb42eaad4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 8057436c1..7f14b5846 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 92e2c8782..51d72d12f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Takes sleeping locks and calls into the memory allocator, so nothing we want to do in task switch and oder atomic contexts. diff --git a/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch b/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch index 8ee93b487..f6737d85e 100644 --- a/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch +++ b/debian/patches/features/all/rt/sched-provide-a-tsk_nr_cpus_allowed-helper.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 18 Jan 2016 17:21:59 +0100 Subject: sched: provide a tsk_nr_cpus_allowed() helper -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz tsk_nr_cpus_allowed() is an accessor for task->nr_cpus_allowed which allows us to change the representation of ->nr_cpus_allowed if required. 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 bdd8df120..3f0951052 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-ttwu-ensure-success-return-is-correct.patch b/debian/patches/features/all/rt/sched-ttwu-ensure-success-return-is-correct.patch index 45522345e..f414bdb10 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch b/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch index 76ab8733d..13d597527 100644 --- a/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch +++ b/debian/patches/features/all/rt/sched-use-tsk_cpus_allowed-instead-of-accessing-cpus.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Mon, 18 Jan 2016 17:10:39 +0100 Subject: sched: use tsk_cpus_allowed() instead of accessing ->cpus_allowed -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Use the future-safe accessor for struct task_struct's. 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 4d2905817..a43c42dee 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 4d9f12b56..f78a59076 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 38a14ae6b..9cc2a7781 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 64e8d2c2e..2faca4f6d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 272de11ed..9555fbdd6 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz local_irq_save() + spin_lock(&sighand->siglock) does not work on -RT. Use the nort variants. 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 1bd5154b0..0b2febccb 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a 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 d52e3fc95..2a19174b5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. diff --git a/debian/patches/features/all/rt/skbufhead-raw-lock.patch b/debian/patches/features/all/rt/skbufhead-raw-lock.patch index a225c852e..2265b57f2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 1acfe0e24..736a004a4 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 6c288a0dd..75e17c2d2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 2a11c0621..ae49a30e5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 21b4055c4..e7671a926 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. 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 70a3d73a5..780786a91 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, diff --git a/debian/patches/features/all/rt/softirq-split-locks.patch b/debian/patches/features/all/rt/softirq-split-locks.patch index 3c38f4f01..caff627b5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 38bb4547e..49096fc1d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 @@ -65,7 +65,7 @@ Signed-off-by: Sebastian Andrzej Siewior #else /* !PREEMPT_RT_FULL */ -@@ -618,8 +632,12 @@ void thread_do_softirq(void) +@@ -620,8 +634,12 @@ void thread_do_softirq(void) static void do_raise_softirq_irqoff(unsigned int nr) { @@ -79,7 +79,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * If we are not in a hard interrupt and inside a bh disabled -@@ -628,16 +646,30 @@ static void do_raise_softirq_irqoff(unsi +@@ -630,16 +648,30 @@ static void do_raise_softirq_irqoff(unsi * delegate it to ksoftirqd. */ if (!in_irq() && current->softirq_nestcnt) @@ -114,7 +114,7 @@ Signed-off-by: Sebastian Andrzej Siewior } /* -@@ -663,7 +695,7 @@ void raise_softirq_irqoff(unsigned int n +@@ -665,7 +697,7 @@ void raise_softirq_irqoff(unsigned int n * raise a WARN() if the condition is met. */ if (!current->softirq_nestcnt) @@ -123,7 +123,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static inline int ksoftirqd_softirq_pending(void) -@@ -676,22 +708,37 @@ static inline void _local_bh_enable_nort +@@ -678,22 +710,37 @@ static inline void _local_bh_enable_nort static inline void ksoftirqd_set_sched_params(unsigned int cpu) { @@ -164,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif /* PREEMPT_RT_FULL */ /* * Enter an interrupt context. -@@ -741,6 +788,9 @@ static inline void invoke_softirq(void) +@@ -743,6 +790,9 @@ static inline void invoke_softirq(void) if (__this_cpu_read(ksoftirqd) && __this_cpu_read(ksoftirqd)->softirqs_raised) wakeup_softirqd(); @@ -174,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior local_irq_restore(flags); #endif } -@@ -1173,17 +1223,30 @@ static struct notifier_block cpu_nfb = { +@@ -1175,17 +1225,30 @@ static struct notifier_block cpu_nfb = { static struct smp_hotplug_thread softirq_threads = { .store = &ksoftirqd, .setup = ksoftirqd_set_sched_params, 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 9377108a5..4fdbfdc50 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 38f008222..e02109f65 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 diff --git a/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch b/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch index 03813930e..1df5f4535 100644 --- a/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch +++ b/debian/patches/features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 2 May 2014 13:13:22 +0200 Subject: stomp-machine: create lg_global_trylock_relax() primitive -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Create lg_global_trylock_relax() for use by stopper thread when it cannot schedule, to deal with stop_cpus_lock, which is now an lglock. @@ -73,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior +#endif --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c -@@ -1153,6 +1153,11 @@ void __lockfunc rt_spin_unlock_wait(spin +@@ -1151,6 +1151,11 @@ void __lockfunc rt_spin_unlock_wait(spin } EXPORT_SYMBOL(rt_spin_unlock_wait); diff --git a/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch b/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch index 8f23be9fb..ee18a9b4a 100644 --- a/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch +++ b/debian/patches/features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Fri, 2 May 2014 13:13:34 +0200 Subject: stomp-machine: use lg_global_trylock_relax() to dead with stop_cpus_lock lglock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz If the stop machinery is called from inactive CPU we cannot use lg_global_lock(), because some other stomp machine invocation might be 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 fc2cc3b80..2d95fffb1 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 654adfe43..95633054f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 2aa7f5a5c..4221be911 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 d252a8a24..b419086b7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz timekeeping suspend/resume calls read_persistant_clock() which takes rtc_lock. That results in might sleep warnings because at that point diff --git a/debian/patches/features/all/rt/sysfs-realtime-entry.patch b/debian/patches/features/all/rt/sysfs-realtime-entry.patch index 7ea523acf..d1f6153a2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 baf147ddb..25eead9fb 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz When CONFIG_PREEMPT_RT_FULL is enabled, tasklets run as threads, and spinlocks turn are mutexes. But this can cause issues with diff --git a/debian/patches/features/all/rt/tasklist-lock-fix-section-conflict.patch b/debian/patches/features/all/rt/tasklist-lock-fix-section-conflict.patch index a4ef8cb8e..2d48fbce2 100644 --- a/debian/patches/features/all/rt/tasklist-lock-fix-section-conflict.patch +++ b/debian/patches/features/all/rt/tasklist-lock-fix-section-conflict.patch @@ -1,7 +1,7 @@ Subject: rwlocks: Fix section mismatch From: John Kacur Date: Mon, 19 Sep 2011 11:09:27 +0200 (CEST) -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz This fixes the following build error for the preempt-rt kernel. 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 0fbd24668..a4e3c378f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/timekeeping-split-jiffies-lock.patch b/debian/patches/features/all/rt/timekeeping-split-jiffies-lock.patch index 7aee576a4..102c9f4fa 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 61b55b073..af581fb80 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz People were complaining about broken balancing with the recent -rt series. 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 609723ab2..e807d3d95 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/timers-avoid-the-base-null-otptimization-on-rt.patch b/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch index ba23aefbd..8e50686da 100644 --- a/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch +++ b/debian/patches/features/all/rt/timers-avoid-the-base-null-otptimization-on-rt.patch @@ -1,7 +1,7 @@ Subject: timers: Avoid the switch timers base set to NULL trick on RT From: Thomas Gleixner Date: Thu, 21 Jul 2011 15:23:39 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz On RT that code is preemptible, so we cannot assign NULL to timers base as a preempter would spin forever in lock_timer_base(). diff --git a/debian/patches/features/all/rt/timers-preempt-rt-support.patch b/debian/patches/features/all/rt/timers-preempt-rt-support.patch index 631b38790..098fa5550 100644 --- a/debian/patches/features/all/rt/timers-preempt-rt-support.patch +++ b/debian/patches/features/all/rt/timers-preempt-rt-support.patch @@ -1,7 +1,7 @@ From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:20 -0500 Subject: timers: Preempt-rt support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The base->lock is a sleeping lock. Try not to workaround with a spin_trylock(). The rt-mutex lock is not irq save even the try-lock 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 61bbd0970..1471be5bb 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 diff --git a/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch b/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch index 3bc8114e6..d047953f4 100644 --- a/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch +++ b/debian/patches/features/all/rt/trace-latency-hist-Consider-new-argument-when-probin.patch @@ -2,7 +2,7 @@ From: Carsten Emde Date: Tue, 5 Jan 2016 10:21:59 +0100 Subject: trace/latency-hist: Consider new argument when probing the sched_switch tracer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz The sched_switch tracer has got a new argument. Fix the latency tracer accordingly. 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 159d8de25..3e9c8672b 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/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 70759e0e9..fadc7811d 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by 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 2f0637537..8b94a7ba0 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 df49bc921..bb459e486 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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/vtime-split-lock-and-seqcount.patch b/debian/patches/features/all/rt/vtime-split-lock-and-seqcount.patch index 66a846418..3b1d8130b 100644 --- a/debian/patches/features/all/rt/vtime-split-lock-and-seqcount.patch +++ b/debian/patches/features/all/rt/vtime-split-lock-and-seqcount.patch @@ -1,7 +1,7 @@ Subject: vtime: Split lock and seqcount From: Thomas Gleixner Date: Tue, 23 Jul 2013 15:45:51 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Replace vtime_seqlock seqlock with a simple seqcounter and a rawlock so it can taken in atomic context on RT. diff --git a/debian/patches/features/all/rt/wait-simple-implementation.patch b/debian/patches/features/all/rt/wait-simple-implementation.patch index a76cfa059..f0df47f4e 100644 --- a/debian/patches/features/all/rt/wait-simple-implementation.patch +++ b/debian/patches/features/all/rt/wait-simple-implementation.patch @@ -12,7 +12,7 @@ should go mainline as well, as it lowers memory consumption and runtime overhead. Signed-off-by: Thomas Gleixner -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz smp_mb() added by Steven Rostedt to fix a race condition with swait wakeups vs adding items to the list. 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 210d36f3f..c70d59a55 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 ab57e9b36..696e4f1a7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 a95ba0d27..418d8b8a5 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 73ad7141f..2477db040 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz --- kernel/sched/core.c | 80 ++++++++------------------------------------ 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 57aae7d27..d6d8a7146 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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. diff --git a/debian/patches/features/all/rt/workqueue-use-locallock.patch b/debian/patches/features/all/rt/workqueue-use-locallock.patch index 82de7e49d..342461321 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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. diff --git a/debian/patches/features/all/rt/workqueue-use-rcu.patch b/debian/patches/features/all/rt/workqueue-use-rcu.patch index 78978a8ae..7044fe5ac 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 0fc2e0f49..c899e5bb8 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 3668ff270..218f833a2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 66afc7f50..254714ead 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 260e51444..ca146bb45 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 8f92f2ff8..68af0dbd7 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 4b20e54b2..687ce88e2 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 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 334cf9a2e..f5707e01c 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 e1774d3dd..ad00fe405 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Implement the x86 pieces for lazy preempt. 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 5f24b4b2d..781d3c71a 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 38c03841c..6881c97cc 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.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 db15c84fe..265a4544f 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.4/patches-4.4.1-rt5.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patches-4.4.1-rt6.tar.xz Simplifies the separation of anon_rw_semaphores and rw_semaphores for -rt. diff --git a/debian/patches/series-rt b/debian/patches/series-rt index ab3429f6b..eda31f7d6 100644 --- a/debian/patches/series-rt +++ b/debian/patches/series-rt @@ -5,6 +5,8 @@ ############################################################ # UPSTREAM changes queued ############################################################ +features/all/rt/rtmutex-Make-wait_lock-irq-safe.patch +features/all/rt/arm64-replace-read_lock-to-rcu-lock-in-call_step_hoo.patch ############################################################ # UPSTREAM FIXES, patches pending @@ -234,6 +236,7 @@ features/all/rt/slub-disable-SLUB_CPU_PARTIAL.patch features/all/rt/mm-page-alloc-use-local-lock-on-target-cpu.patch features/all/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch features/all/rt/mm-memcontrol-do_not_disable_irq.patch +features/all/rt/mm-backing-dev-don-t-disable-IRQs-in-wb_congested_pu.patch # RADIX TREE features/all/rt/radix-tree-rt-aware.patch @@ -299,6 +302,8 @@ features/all/rt/tasklet-rt-prevent-tasklets-from-going-into-infinite-spin-in-rt. features/all/rt/softirq-preempt-fix-3-re.patch features/all/rt/softirq-disable-softirq-stacks-for-rt.patch features/all/rt/softirq-split-locks.patch +features/all/rt/kernel-softirq-unlock-with-irqs-on.patch +features/all/rt/kernel-migrate_disable-do-fastpath-in-atomic-irqs-of.patch features/all/rt/irq-allow-disabling-of-softirq-processing-in-irq-thread-context.patch features/all/rt/softirq-split-timer-softirqs-out-of-ksoftirqd.patch features/all/rt/rtmutex-trylock-is-okay-on-RT.patch @@ -334,6 +339,7 @@ features/all/rt/peter_zijlstra-frob-rcu.patch features/all/rt/rcu-merge-rcu-bh-into-rcu-preempt-for-rt.patch features/all/rt/patch-to-introduce-rcu-bh-qs-where-safe-from-softirq.patch features/all/rt/rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch +features/all/rt/rcu-disable-more-spots-of-rcu_bh.patch # LGLOCKS - lovely features/all/rt/lglocks-rt.patch @@ -341,6 +347,7 @@ features/all/rt/lglocks-rt.patch # STOP machine (depend on lglock & rtmutex) features/all/rt/stomp-machine-create-lg_global_trylock_relax-primiti.patch features/all/rt/stomp-machine-use-lg_global_trylock_relax-to-dead-wi.patch +features/all/rt/kernel-stop_machine-partly-revert-stop_machine-Use-r.patch # DRIVERS SERIAL features/all/rt/drivers-tty-fix-omap-lock-crap.patch @@ -445,6 +452,8 @@ features/all/rt/powerpc-ps3-device-init.c-adapt-to-completions-using.patch features/all/rt/arm-at91-tclib-default-to-tclib-timer-for-rt.patch features/all/rt/arm-unwind-use_raw_lock.patch features/all/rt/ARM-enable-irq-in-translation-section-permission-fau.patch +features/all/rt/genirq-update-irq_set_irqchip_state-documentation.patch +features/all/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch # ARM64 features/all/rt/arm64-xen--Make-XEN-depend-on-non-rt.patch @@ -506,6 +515,9 @@ features/all/rt/kernel-hotplug-restore-original-cpu-mask-oncpu-down.patch features/all/rt/cpu_down_move_migrate_enable_back.patch features/all/rt/hotplug-Use-set_cpus_allowed_ptr-in-sync_unplug_thre.patch +features/all/rt/rtmutex-push-down-migrate_disable-into-rt_spin_lock.patch +features/all/rt/rt-locking-Reenable-migration-accross-schedule.patch + # SCSCI QLA2xxx features/all/rt/scsi-qla2xxx-fix-bug-sleeping-function-called-from-invalid-context.patch From 96504c28700902aa296085e6ccbfa8f18fd22d68 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 17 Feb 2016 16:05:10 +0000 Subject: [PATCH 32/35] IFF_NO_QUEUE: Fix for drivers not calling ether_setup() (regression in 4.3) --- debian/changelog | 1 + ...-for-drivers-not-calling-ether_setup.patch | 41 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 43 insertions(+) create mode 100644 debian/patches/bugfix/all/iff_no_queue-fix-for-drivers-not-calling-ether_setup.patch diff --git a/debian/changelog b/debian/changelog index 5befcf223..c6bf41457 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,7 @@ linux (4.4.1-1) UNRELEASED; urgency=medium - [i386/686-pae] mm: Fix types used in pgprot cacheability flags translations - [i386/686-pae] PCI: Set pci=nobios by default + * IFF_NO_QUEUE: Fix for drivers not calling ether_setup() (regression in 4.3) [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/patches/bugfix/all/iff_no_queue-fix-for-drivers-not-calling-ether_setup.patch b/debian/patches/bugfix/all/iff_no_queue-fix-for-drivers-not-calling-ether_setup.patch new file mode 100644 index 000000000..defcd9602 --- /dev/null +++ b/debian/patches/bugfix/all/iff_no_queue-fix-for-drivers-not-calling-ether_setup.patch @@ -0,0 +1,41 @@ +From: Phil Sutter +Date: Wed, 17 Feb 2016 15:37:43 +0100 +Subject: IFF_NO_QUEUE: Fix for drivers not calling ether_setup() +Origin: http://mid.gmane.org/1455719863-25730-1-git-send-email-phil@nwl.cc + +My implementation around IFF_NO_QUEUE driver flag assumed that leaving +tx_queue_len untouched (specifically: not setting it to zero) by drivers +would make it possible to assign a regular qdisc to them without having +to worry about setting tx_queue_len to a useful value. This was only +partially true: I overlooked that some drivers don't call ether_setup() +and therefore not initialize tx_queue_len to the default value of 1000. +Consequently, removing the workarounds in place for that case in qdisc +implementations which cared about it (namely, pfifo, bfifo, gred, htb, +plug and sfb) leads to problems with these specific interface types and +qdiscs. + +Luckily, there's already a sanitization point for drivers setting +tx_queue_len to zero, which can be reused to assign the fallback value +most qdisc implementations used, which is 1. + +Fixes: 348e3435cbefa ("net: sched: drop all special handling of tx_queue_len == 0") +Tested-by: Mathieu Desnoyers +Signed-off-by: Phil Sutter +--- + net/core/dev.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -7125,8 +7125,10 @@ struct net_device *alloc_netdev_mqs(int + dev->priv_flags = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; + setup(dev); + +- if (!dev->tx_queue_len) ++ if (!dev->tx_queue_len) { + dev->priv_flags |= IFF_NO_QUEUE; ++ dev->tx_queue_len = 1; ++ } + + dev->num_tx_queues = txqs; + dev->real_num_tx_queues = txqs; diff --git a/debian/patches/series b/debian/patches/series index 646e47c45..379f50e23 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -132,3 +132,4 @@ bugfix/x86/x86-efi-build-our-own-page-table-structures.patch bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch bugfix/x86/x86-mm-fix-types-used-in-pgprot-cacheability-flags-t.patch debian/i386-686-pae-pci-set-pci-nobios-by-default.patch +bugfix/all/iff_no_queue-fix-for-drivers-not-calling-ether_setup.patch From b0ddcef1a9d3cbbdc90406da3444af3c8aa0ab11 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 17 Feb 2016 17:55:58 +0000 Subject: [PATCH 33/35] udeb: Fix issues with wildcards that caused FTBFS on armhf, thanks to Karsten Merker Karsten did a test-build on armhf and found failures due to missing modules and directories. * The wireless drivers from staging need to be optional; this requires support for wildcards in optional-inclusion lines * The check for a containing directory must only be done for non-optional inclusion lines Bump the kernel-wedge version requirement and add the optional-include suffixes. --- debian/changelog | 2 ++ debian/installer/modules/nic-wireless-modules | 6 +++--- debian/templates/control.source.in | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index c6bf41457..a9491a436 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,8 @@ linux (4.4.1-1) UNRELEASED; urgency=medium translations - [i386/686-pae] PCI: Set pci=nobios by default * IFF_NO_QUEUE: Fix for drivers not calling ether_setup() (regression in 4.3) + * udeb: Fix issues with wildcards that caused FTBFS on armhf, thanks to + Karsten Merker [ Roger Shimizu ] * Enable TTY_PRINTK as module (Closes: #814540). diff --git a/debian/installer/modules/nic-wireless-modules b/debian/installer/modules/nic-wireless-modules index ec7532b71..104a3a113 100644 --- a/debian/installer/modules/nic-wireless-modules +++ b/debian/installer/modules/nic-wireless-modules @@ -2,9 +2,9 @@ drivers/net/wireless/** # Include staging wireless drivers -prism2_usb -drivers/staging/rtl8** -vt6656_stage +prism2_usb ? +drivers/staging/rtl8** ? +vt6656_stage ? # Exclude drivers packaged in nic-pcmcia-modules drivers/net/wireless/**_cs - diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in index 8f3bd2b8d..c2d944bf2 100644 --- a/debian/templates/control.source.in +++ b/debian/templates/control.source.in @@ -4,7 +4,7 @@ Maintainer: Debian Kernel Team Uploaders: Bastian Blank , maximilian attems , Ben Hutchings Standards-Version: 3.9.5 Build-Depends: debhelper, python3:any, quilt, - cpio , kmod , xz-utils , kernel-wedge (>= 2.92~) , bc + cpio , kmod , xz-utils , kernel-wedge (>= 2.93~) , bc Build-Depends-Indep: patchutils , xmlto Vcs-Git: https://anonscm.debian.org/git/kernel/linux.git Vcs-Browser: https://anonscm.debian.org/cgit/kernel/linux.git From edd433b85fd78f99af080c50f6e20f4d3185a550 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 15 Feb 2016 15:31:33 +0000 Subject: [PATCH 34/35] Update to 4.4.2 Drop patches included in it. Refresh rt patches with textual conflicts. --- debian/changelog | 7 ++- ...dio-avoid-freeing-umidi-object-twice.patch | 31 --------- ...e-ldisc-reference-via-ioctl-tiocgetd.patch | 63 ------------------- ...-detecting-device-without-write_urbs.patch | 31 --------- ...rypto-sun4i-ss-add-missing-statesize.patch | 40 ------------ ...timer-callback-changes-for-preempt-r.patch | 34 +++++----- .../rt/hrtimers-prepare-full-preemption.patch | 22 +++---- .../features/all/rt/latency-hist.patch | 22 +++---- .../features/all/rt/printk-rt-aware.patch | 21 ++++--- debian/patches/series | 4 -- 10 files changed, 55 insertions(+), 220 deletions(-) delete mode 100644 debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch delete mode 100644 debian/patches/bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch delete mode 100644 debian/patches/bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch delete mode 100644 debian/patches/bugfix/arm/crypto-sun4i-ss-add-missing-statesize.patch diff --git a/debian/changelog b/debian/changelog index a9491a436..02bfb3982 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,8 @@ -linux (4.4.1-1) UNRELEASED; urgency=medium +linux (4.4.2-1) UNRELEASED; urgency=medium + + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.2 + - ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-2384) [ Ben Hutchings ] * Set ABI to 1 @@ -13,7 +17,6 @@ linux (4.4.1-1) UNRELEASED; urgency=medium (regression in 4.4, 4.3.4) * bpf: fix branch offset adjustment on backjumps after patching ctx expansion (CVE-2016-2383) - * ALSA: usb-audio: avoid freeing umidi object twice (CVE-2016-2384) * udeb: Combine scsi-{common,extra}-modules with scsi-modules * udeb: Use wildcards to include entire classes of drivers: - input-modules: Include HID drivers by default diff --git a/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch b/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch deleted file mode 100644 index 72c57bf01..000000000 --- a/debian/patches/bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Andrey Konovalov -Date: Sat, 13 Feb 2016 11:08:06 +0300 -Subject: ALSA: usb-audio: avoid freeing umidi object twice -Origin: https://git.kernel.org/linus/07d86ca93db7e5cdf4743564d98292042ec21af7 - -The 'umidi' object will be free'd on the error path by snd_usbmidi_free() -when tearing down the rawmidi interface. So we shouldn't try to free it -in snd_usbmidi_create() after having registered the rawmidi interface. - -Found by KASAN. - -Signed-off-by: Andrey Konovalov -Acked-by: Clemens Ladisch -Cc: -Signed-off-by: Takashi Iwai ---- - sound/usb/midi.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/sound/usb/midi.c b/sound/usb/midi.c -index cc39f63299ef..007cf5831121 100644 ---- a/sound/usb/midi.c -+++ b/sound/usb/midi.c -@@ -2455,7 +2455,6 @@ int snd_usbmidi_create(struct snd_card *card, - else - err = snd_usbmidi_create_endpoints(umidi, endpoints); - if (err < 0) { -- snd_usbmidi_free(umidi); - return err; - } - diff --git a/debian/patches/bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch b/debian/patches/bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch deleted file mode 100644 index 02fe5e74b..000000000 --- a/debian/patches/bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Peter Hurley -Subject: tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) -Date: Sun, 10 Jan 2016 22:40:55 -0800 -Origin: http://article.gmane.org/gmane.linux.kernel/2123249 - -ioctl(TIOCGETD) retrieves the line discipline id directly from the -ldisc because the line discipline id (c_line) in termios is untrustworthy; -userspace may have set termios via ioctl(TCSETS*) without actually -changing the line discipline via ioctl(TIOCSETD). - -However, directly accessing the current ldisc via tty->ldisc is -unsafe; the ldisc ptr dereferenced may be stale if the line discipline -is changing via ioctl(TIOCSETD) or hangup. - -Wait for the line discipline reference (just like read() or write()) -to retrieve the "current" line discipline id. - -Cc: -Signed-off-by: Peter Hurley ---- - drivers/tty/tty_io.c | 24 +++++++++++++++++++++++- - 1 file changed, 23 insertions(+), 1 deletion(-) - ---- a/drivers/tty/tty_io.c -+++ b/drivers/tty/tty_io.c -@@ -2654,6 +2654,28 @@ static int tiocsetd(struct tty_struct *t - } - - /** -+ * tiocgetd - get line discipline -+ * @tty: tty device -+ * @p: pointer to user data -+ * -+ * Retrieves the line discipline id directly from the ldisc. -+ * -+ * Locking: waits for ldisc reference (in case the line discipline -+ * is changing or the tty is being hungup) -+ */ -+ -+static int tiocgetd(struct tty_struct *tty, int __user *p) -+{ -+ struct tty_ldisc *ld; -+ int ret; -+ -+ ld = tty_ldisc_ref_wait(tty); -+ ret = put_user(ld->ops->num, p); -+ tty_ldisc_deref(ld); -+ return ret; -+} -+ -+/** - * send_break - performed time break - * @tty: device to break on - * @duration: timeout in mS -@@ -2879,7 +2901,7 @@ long tty_ioctl(struct file *file, unsign - case TIOCGSID: - return tiocgsid(tty, real_tty, p); - case TIOCGETD: -- return put_user(tty->ldisc->ops->num, (int __user *)p); -+ return tiocgetd(tty, p); - case TIOCSETD: - return tiocsetd(tty, p); - case TIOCVHANGUP: diff --git a/debian/patches/bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch b/debian/patches/bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch deleted file mode 100644 index 4b6a5d63c..000000000 --- a/debian/patches/bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Vladis Dronov -Subject: usb: serial: visor: fix crash on detecting device without write_urbs -Date: Tue, 12 Jan 2016 15:10:50 +0100 -Origin: http://article.gmane.org/gmane.linux.usb.general/136045 -Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1296466 - -The visor driver crashes in clie_5_attach() when a specially crafted USB -device without bulk-out endpoint is detected. This fix adds a check that -the device has proper configuration expected by the driver. - -Reported-by: Ralf Spenneberg -Signed-off-by: Vladis Dronov ---- - drivers/usb/serial/visor.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/drivers/usb/serial/visor.c -+++ b/drivers/usb/serial/visor.c -@@ -597,8 +597,10 @@ static int clie_5_attach(struct usb_seri - */ - - /* some sanity check */ -- if (serial->num_ports < 2) -- return -1; -+ if (serial->num_bulk_out < 2) { -+ dev_err(&serial->interface->dev, "missing bulk out endpoints\n"); -+ return -ENODEV; -+ } - - /* port 0 now uses the modified endpoint Address */ - port = serial->port[0]; diff --git a/debian/patches/bugfix/arm/crypto-sun4i-ss-add-missing-statesize.patch b/debian/patches/bugfix/arm/crypto-sun4i-ss-add-missing-statesize.patch deleted file mode 100644 index 7aace658e..000000000 --- a/debian/patches/bugfix/arm/crypto-sun4i-ss-add-missing-statesize.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: LABBE Corentin -Date: Mon, 16 Nov 2015 09:35:54 +0100 -Subject: crypto: sun4i-ss - add missing statesize -Origin: https://git.kernel.org/cgit/linux/kernel/git/herbert/cryptodev-2.6.git/commit?id=4f9ea86604e3ba64edd2817795798168fbb3c1a6 -Bug-Debian: https://bugs.debian.org/808625 - -sun4i-ss implementaton of md5/sha1 is via ahash algorithms. -Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") -made impossible to load them without giving statesize. This patch -specifiy statesize for sha1 and md5. - -Fixes: 6298e948215f ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") -Cc: # v4.3+ -Tested-by: Chen-Yu Tsai -Signed-off-by: LABBE Corentin -Signed-off-by: Herbert Xu ---- - drivers/crypto/sunxi-ss/sun4i-ss-core.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c -index eab6fe2..107cd2a 100644 ---- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c -+++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c -@@ -39,6 +39,7 @@ static struct sun4i_ss_alg_template ss_algs[] = { - .import = sun4i_hash_import_md5, - .halg = { - .digestsize = MD5_DIGEST_SIZE, -+ .statesize = sizeof(struct md5_state), - .base = { - .cra_name = "md5", - .cra_driver_name = "md5-sun4i-ss", -@@ -66,6 +67,7 @@ static struct sun4i_ss_alg_template ss_algs[] = { - .import = sun4i_hash_import_sha1, - .halg = { - .digestsize = SHA1_DIGEST_SIZE, -+ .statesize = sizeof(struct sha1_state), - .base = { - .cra_name = "sha1", - .cra_driver_name = "sha1-sun4i-ss", diff --git a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch index c72f4d745..f96144243 100644 --- a/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch +++ b/debian/patches/features/all/rt/hrtimer-fixup-hrtimer-callback-changes-for-preempt-r.patch @@ -23,25 +23,25 @@ Signed-off-by: Ingo Molnar --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -87,6 +87,8 @@ enum hrtimer_restart { - * @function: timer expiry callback function +@@ -88,6 +88,8 @@ enum hrtimer_restart { * @base: pointer to the timer base (per cpu and per clock) * @state: state information (See bit values above) + * @is_rel: Set if the timer was armed relative + * @cb_entry: list entry to defer timers from hardirq context + * @irqsafe: timer can run in hardirq context * @praecox: timer expiry time if expired at the time of programming - * @start_pid: timer statistics field to store the pid of the task which + * @start_pid: timer statistics field to store the pid of the task which * started the timer -@@ -103,6 +105,8 @@ struct hrtimer { - enum hrtimer_restart (*function)(struct hrtimer *); +@@ -105,6 +107,8 @@ struct hrtimer { struct hrtimer_clock_base *base; - unsigned long state; + u8 state; + u8 is_rel; + struct list_head cb_entry; + int irqsafe; #ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST ktime_t praecox; #endif -@@ -134,6 +138,7 @@ struct hrtimer_sleeper { +@@ -136,6 +140,7 @@ struct hrtimer_sleeper { * timer to a base on another cpu. * @clockid: clock id for per_cpu support * @active: red black tree root node for the active timers @@ -49,7 +49,7 @@ Signed-off-by: Ingo Molnar * @get_time: function to retrieve the current time of the clock * @offset: offset of this clock to the monotonic base */ -@@ -142,6 +147,7 @@ struct hrtimer_clock_base { +@@ -144,6 +149,7 @@ struct hrtimer_clock_base { int index; clockid_t clockid; struct timerqueue_head active; @@ -57,7 +57,7 @@ Signed-off-by: Ingo Molnar ktime_t (*get_time)(void); ktime_t offset; } __attribute__((__aligned__(HRTIMER_CLOCK_BASE_ALIGN))); -@@ -185,6 +191,7 @@ struct hrtimer_cpu_base { +@@ -187,6 +193,7 @@ struct hrtimer_cpu_base { raw_spinlock_t lock; seqcount_t seq; struct hrtimer *running; @@ -122,7 +122,7 @@ Signed-off-by: Ingo Molnar if (!timerqueue_del(&base->active, &timer->node)) cpu_base->active_bases &= ~(1 << base->index); -@@ -1162,6 +1164,7 @@ static void __hrtimer_init(struct hrtime +@@ -1173,6 +1175,7 @@ static void __hrtimer_init(struct hrtime base = hrtimer_clockid_to_base(clock_id); timer->base = &cpu_base->clock_base[base]; @@ -130,7 +130,7 @@ Signed-off-by: Ingo Molnar timerqueue_init(&timer->node); #ifdef CONFIG_TIMER_STATS -@@ -1202,6 +1205,7 @@ bool hrtimer_active(const struct hrtimer +@@ -1213,6 +1216,7 @@ bool hrtimer_active(const struct hrtimer seq = raw_read_seqcount_begin(&cpu_base->seq); if (timer->state != HRTIMER_STATE_INACTIVE || @@ -138,7 +138,7 @@ Signed-off-by: Ingo Molnar cpu_base->running == timer) return true; -@@ -1292,12 +1296,112 @@ static void __run_hrtimer(struct hrtimer +@@ -1311,12 +1315,112 @@ static void __run_hrtimer(struct hrtimer cpu_base->running = NULL; } @@ -251,7 +251,7 @@ Signed-off-by: Ingo Molnar for (; active; base++, active >>= 1) { struct timerqueue_node *node; -@@ -1337,9 +1441,14 @@ static void __hrtimer_run_queues(struct +@@ -1356,9 +1460,14 @@ static void __hrtimer_run_queues(struct if (basenow.tv64 < hrtimer_get_softexpires_tv64(timer)) break; @@ -267,7 +267,7 @@ Signed-off-by: Ingo Molnar } #ifdef CONFIG_HIGH_RES_TIMERS -@@ -1481,8 +1590,6 @@ void hrtimer_run_queues(void) +@@ -1500,8 +1609,6 @@ void hrtimer_run_queues(void) now = hrtimer_update_base(cpu_base); __hrtimer_run_queues(cpu_base, now); raw_spin_unlock(&cpu_base->lock); @@ -276,7 +276,7 @@ Signed-off-by: Ingo Molnar } /* -@@ -1504,6 +1611,7 @@ static enum hrtimer_restart hrtimer_wake +@@ -1523,6 +1630,7 @@ static enum hrtimer_restart hrtimer_wake void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task) { sl->timer.function = hrtimer_wakeup; @@ -284,7 +284,7 @@ Signed-off-by: Ingo Molnar sl->task = task; } EXPORT_SYMBOL_GPL(hrtimer_init_sleeper); -@@ -1638,6 +1746,7 @@ static void init_hrtimers_cpu(int cpu) +@@ -1657,6 +1765,7 @@ static void init_hrtimers_cpu(int cpu) for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { cpu_base->clock_base[i].cpu_base = cpu_base; timerqueue_init_head(&cpu_base->clock_base[i].active); @@ -292,7 +292,7 @@ Signed-off-by: Ingo Molnar } cpu_base->cpu = cpu; -@@ -1742,11 +1851,21 @@ static struct notifier_block hrtimers_nb +@@ -1761,11 +1870,21 @@ static struct notifier_block hrtimers_nb .notifier_call = hrtimer_cpu_notify, }; 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 860fcbcbd..77b457da7 100644 --- a/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch +++ b/debian/patches/features/all/rt/hrtimers-prepare-full-preemption.patch @@ -18,7 +18,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -205,6 +205,9 @@ struct hrtimer_cpu_base { +@@ -207,6 +207,9 @@ struct hrtimer_cpu_base { unsigned int nr_hangs; unsigned int max_hang_time; #endif @@ -28,7 +28,7 @@ Signed-off-by: Thomas Gleixner struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; } ____cacheline_aligned; -@@ -393,6 +396,13 @@ static inline void hrtimer_restart(struc +@@ -416,6 +419,13 @@ static inline void hrtimer_restart(struc hrtimer_start_expires(timer, HRTIMER_MODE_ABS); } @@ -40,9 +40,9 @@ Signed-off-by: Thomas Gleixner +#endif + /* Query timers: */ - extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); + extern ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust); -@@ -412,7 +422,7 @@ static inline int hrtimer_is_queued(stru +@@ -440,7 +450,7 @@ static inline int hrtimer_is_queued(stru * Helper function to check, whether the timer is running the callback * function */ @@ -86,7 +86,7 @@ Signed-off-by: Thomas Gleixner /* * enqueue_hrtimer - internal function to (re)start a timer * -@@ -1076,7 +1102,7 @@ int hrtimer_cancel(struct hrtimer *timer +@@ -1083,7 +1109,7 @@ int hrtimer_cancel(struct hrtimer *timer if (ret >= 0) return ret; @@ -95,7 +95,7 @@ Signed-off-by: Thomas Gleixner } } EXPORT_SYMBOL_GPL(hrtimer_cancel); -@@ -1455,6 +1481,8 @@ void hrtimer_run_queues(void) +@@ -1474,6 +1500,8 @@ void hrtimer_run_queues(void) now = hrtimer_update_base(cpu_base); __hrtimer_run_queues(cpu_base, now); raw_spin_unlock(&cpu_base->lock); @@ -104,7 +104,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1614,6 +1642,9 @@ static void init_hrtimers_cpu(int cpu) +@@ -1633,6 +1661,9 @@ static void init_hrtimers_cpu(int cpu) cpu_base->cpu = cpu; hrtimer_init_hres(cpu_base); @@ -116,7 +116,7 @@ Signed-off-by: Thomas Gleixner #ifdef CONFIG_HOTPLUG_CPU --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c -@@ -213,6 +213,7 @@ int do_setitimer(int which, struct itime +@@ -213,6 +213,7 @@ again: /* We are sharing ->siglock with it_real_fn() */ if (hrtimer_try_to_cancel(timer) < 0) { spin_unlock_irq(&tsk->sighand->siglock); @@ -147,7 +147,7 @@ Signed-off-by: Thomas Gleixner /* Set a POSIX.1b interval timer. */ /* timr->it_lock is taken. */ static int -@@ -905,6 +919,7 @@ SYSCALL_DEFINE4(timer_settime, timer_t, +@@ -905,6 +919,7 @@ retry: if (!timr) return -EINVAL; @@ -155,7 +155,7 @@ Signed-off-by: Thomas Gleixner kc = clockid_to_kclock(timr->it_clock); if (WARN_ON_ONCE(!kc || !kc->timer_set)) error = -EINVAL; -@@ -913,9 +928,12 @@ SYSCALL_DEFINE4(timer_settime, timer_t, +@@ -913,9 +928,12 @@ retry: unlock_timer(timr, flag); if (error == TIMER_RETRY) { @@ -168,7 +168,7 @@ Signed-off-by: Thomas Gleixner if (old_setting && !error && copy_to_user(old_setting, &old_spec, sizeof (old_spec))) -@@ -953,10 +971,15 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t +@@ -953,10 +971,15 @@ retry_delete: if (!timer) return -EINVAL; diff --git a/debian/patches/features/all/rt/latency-hist.patch b/debian/patches/features/all/rt/latency-hist.patch index 63fc4cbef..ff53bb026 100644 --- a/debian/patches/features/all/rt/latency-hist.patch +++ b/debian/patches/features/all/rt/latency-hist.patch @@ -217,18 +217,18 @@ Signed-off-by: Thomas Gleixner +These data are also reset when the wakeup histogram is reset. --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h -@@ -87,6 +87,7 @@ enum hrtimer_restart { - * @function: timer expiry callback function +@@ -88,6 +88,7 @@ enum hrtimer_restart { * @base: pointer to the timer base (per cpu and per clock) * @state: state information (See bit values above) + * @is_rel: Set if the timer was armed relative + * @praecox: timer expiry time if expired at the time of programming - * @start_pid: timer statistics field to store the pid of the task which + * @start_pid: timer statistics field to store the pid of the task which * started the timer * @start_site: timer statistics field to store the site where the timer -@@ -102,6 +103,9 @@ struct hrtimer { - enum hrtimer_restart (*function)(struct hrtimer *); +@@ -104,6 +105,9 @@ struct hrtimer { struct hrtimer_clock_base *base; - unsigned long state; + u8 state; + u8 is_rel; +#ifdef CONFIG_MISSED_TIMER_OFFSETS_HIST + ktime_t praecox; +#endif @@ -237,7 +237,7 @@ Signed-off-by: Thomas Gleixner void *start_site; --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1796,6 +1796,12 @@ struct task_struct { +@@ -1797,6 +1797,12 @@ struct task_struct { unsigned long trace; /* bitmask and counter of trace recursion */ unsigned long trace_recursion; @@ -367,7 +367,7 @@ Signed-off-by: Thomas Gleixner #include "tick-internal.h" -@@ -994,7 +995,16 @@ void hrtimer_start_range_ns(struct hrtim +@@ -1001,7 +1002,16 @@ void hrtimer_start_range_ns(struct hrtim new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); timer_stats_hrtimer_set_start_info(timer); @@ -384,7 +384,7 @@ Signed-off-by: Thomas Gleixner leftmost = enqueue_hrtimer(timer, new_base); if (!leftmost) goto unlock; -@@ -1256,6 +1266,8 @@ static void __run_hrtimer(struct hrtimer +@@ -1275,6 +1285,8 @@ static void __run_hrtimer(struct hrtimer cpu_base->running = NULL; } @@ -393,7 +393,7 @@ Signed-off-by: Thomas Gleixner static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now) { struct hrtimer_clock_base *base = cpu_base->clock_base; -@@ -1275,6 +1287,15 @@ static void __hrtimer_run_queues(struct +@@ -1294,6 +1306,15 @@ static void __hrtimer_run_queues(struct timer = container_of(node, struct hrtimer, node); @@ -1792,7 +1792,7 @@ Signed-off-by: Thomas Gleixner if (!preempt_trace() && irq_trace()) stop_critical_timing(CALLER_ADDR0, caller_addr); } -@@ -490,6 +498,7 @@ EXPORT_SYMBOL(trace_hardirqs_on_caller); +@@ -490,6 +498,7 @@ __visible void trace_hardirqs_off_caller { if (!preempt_trace() && irq_trace()) start_critical_timing(CALLER_ADDR0, caller_addr); diff --git a/debian/patches/features/all/rt/printk-rt-aware.patch b/debian/patches/features/all/rt/printk-rt-aware.patch index ff8008e64..994d0cd78 100644 --- a/debian/patches/features/all/rt/printk-rt-aware.patch +++ b/debian/patches/features/all/rt/printk-rt-aware.patch @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -1502,6 +1502,7 @@ static void call_console_drivers(int lev +@@ -1503,6 +1503,7 @@ static void call_console_drivers(int lev if (!console_drivers) return; @@ -21,7 +21,7 @@ Signed-off-by: Thomas Gleixner for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; -@@ -1517,6 +1518,7 @@ static void call_console_drivers(int lev +@@ -1518,6 +1519,7 @@ static void call_console_drivers(int lev else con->write(con, text, len); } @@ -29,7 +29,7 @@ Signed-off-by: Thomas Gleixner } /* -@@ -1577,6 +1579,15 @@ static inline int can_use_console(unsign +@@ -1578,6 +1580,15 @@ static inline int can_use_console(unsign static int console_trylock_for_printk(void) { unsigned int cpu = smp_processor_id(); @@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner if (!console_trylock()) return 0; -@@ -1879,8 +1890,7 @@ asmlinkage int vprintk_emit(int facility +@@ -1880,8 +1891,7 @@ asmlinkage int vprintk_emit(int facility * console_sem which would prevent anyone from printing to * console */ @@ -55,7 +55,7 @@ Signed-off-by: Thomas Gleixner /* * Try to acquire and then immediately release the console * semaphore. The release will print out buffers and wake up -@@ -1888,7 +1898,7 @@ asmlinkage int vprintk_emit(int facility +@@ -1889,7 +1899,7 @@ asmlinkage int vprintk_emit(int facility */ if (console_trylock_for_printk()) console_unlock(); @@ -64,7 +64,7 @@ Signed-off-by: Thomas Gleixner lockdep_on(); } -@@ -2248,11 +2258,16 @@ static void console_cont_flush(char *tex +@@ -2249,11 +2259,16 @@ static void console_cont_flush(char *tex goto out; len = cont_print_text(text, size); @@ -81,7 +81,7 @@ Signed-off-by: Thomas Gleixner return; out: raw_spin_unlock_irqrestore(&logbuf_lock, flags); -@@ -2351,12 +2366,17 @@ void console_unlock(void) +@@ -2363,6 +2378,10 @@ skip: console_idx = log_next(console_idx); console_seq++; console_prev = msg->flags; @@ -92,9 +92,10 @@ Signed-off-by: Thomas Gleixner raw_spin_unlock(&logbuf_lock); stop_critical_timings(); /* don't trace print latency */ - call_console_drivers(level, ext_text, ext_len, text, len); - start_critical_timings(); - local_irq_restore(flags); +@@ -2372,6 +2391,7 @@ skip: + + if (do_cond_resched) + cond_resched(); +#endif } console_locked = 0; diff --git a/debian/patches/series b/debian/patches/series index 379f50e23..6d47798f4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -43,7 +43,6 @@ bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch # Arch bug fixes bugfix/x86/drm-i915-shut-up-gen8-sde-irq-dmesg-noise.patch -bugfix/arm/crypto-sun4i-ss-add-missing-statesize.patch bugfix/x86/drm-vmwgfx-fix-a-width-pitch-mismatch-on-framebuffer.patch bugfix/mips/mips-math-emu-correctly-handle-nop-emulation.patch @@ -114,8 +113,6 @@ features/all/grsecurity/grkernsec_perf_harden.patch bugfix/all/usbvision-fix-overflow-of-interfaces-array.patch bugfix/all/media-usbvision-fix-crash-on-detecting-device-with-i.patch bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch -bugfix/all/usb-serial-visor-fix-crash-on-detecting-device-without-write_urbs.patch -bugfix/all/tty-fix-unsafe-ldisc-reference-via-ioctl-tiocgetd.patch bugfix/all/pipe-limit-the-per-user-amount-of-pages-allocated-in.patch bugfix/all/iw_cxgb3-Fix-incorrectly-returning-error-on-success.patch bugfix/all/fs-hugetlbfs-inode.c-fix-bugs-in-hugetlb_vmtruncate_.patch @@ -123,7 +120,6 @@ bugfix/all/af_unix-guard-against-other-sk-in-unix_dgram_sendmsg.patch bugfix/all/revert-workqueue-make-sure-delayed-work-run-in-local-cpu.patch bugfix/all/af_unix-don-t-set-err-in-unix_stream_read_generic-unless-there-was-an-error.patch bugfix/all/bpf-fix-branch-offset-adjustment-on-backjumps-after-.patch -bugfix/all/alsa-usb-audio-avoid-freeing-umidi-object-twice.patch bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch From 42d36aac277a9765facf2fe94dee5559f5aad8af Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 17 Feb 2016 21:20:12 +0000 Subject: [PATCH 35/35] Prepare to release linux (4.4.2-1). --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 02bfb3982..d479467ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.4.2-1) UNRELEASED; urgency=medium +linux (4.4.2-1) unstable; urgency=medium * New upstream stable update: https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.2 @@ -49,7 +49,7 @@ linux (4.4.2-1) UNRELEASED; urgency=medium [ Uwe Kleine-König ] * [rt] Update to 4.4.1-rt6 - -- Ben Hutchings Fri, 12 Feb 2016 23:34:23 +0000 + -- Ben Hutchings Wed, 17 Feb 2016 21:20:12 +0000 linux (4.4.1-1~exp1) experimental; urgency=medium