diff --git a/debian/changelog b/debian/changelog index eedd63bac50e..f0017980d068 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,244 @@ linux (5.3~rc5-1~exp1) UNRELEASED; urgency=medium -- Ben Hutchings Mon, 05 Aug 2019 12:40:36 +0100 +linux (5.2.9-2) unstable; urgency=medium + + [ Ben Hutchings ] + * Partially revert "net: socket: implement 64-bit timestamps" + (fixes build/test regressions for glibc, qemu, suricata) + * [x86] intel-iommu: Exclude integrated GPUs by default (Closes: #935270): + - intel-iommu: Add option to exclude integrated GPU only + - intel-iommu: Add Kconfig option to exclude iGPU by default + - Enable INTEL_IOMMU_DEFAULT_ON_INTGPU_OFF instead of + INTEL_IOMMU_DEFAULT_ON + + [ Thomas W ] + * [x86] Add various laptop modules. (Closes: #932086) + CONFIG_ACER_WIRELESS + CONFIG_LG_LAPTOP + CONFIG_SURFACE3_WMI + CONFIG_INTEL_WMI_THUNDERBOLT + CONFIG_PEAQ_WMI + CONFIG_TOSHIBA_WMI + CONFIG_SURFACE_3_BUTTON + + -- Ben Hutchings Wed, 21 Aug 2019 13:48:11 +0100 + +linux (5.2.9-1) unstable; urgency=medium + + * New upstream stable update: + https://www.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.2.8 + - scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure + - libnvdimm/bus: Prepare the nd_ioctl() path to be re-entrant + - libnvdimm/bus: Fix wait_nvdimm_bus_probe_idle() ABBA deadlock + - ALSA: usb-audio: Sanity checks for each pipe and EP types + - ALSA: usb-audio: Fix gpf in snd_usb_pipe_sanity_check + - HID: wacom: fix bit shift for Cintiq Companion 2 + - HID: Add quirk for HP X1200 PIXART OEM mouse + - atm: iphase: Fix Spectre v1 vulnerability (CVE-2017-5753) + - bnx2x: Disable multi-cos feature. + - drivers/net/ethernet/marvell/mvmdio.c: Fix non OF case (Closes: #908712) + - ife: error out when nla attributes are empty + - ip6_gre: reload ipv6h in prepare_ip6gre_xmit_ipv6 + - ip6_tunnel: fix possible use-after-free on xmit + - ipip: validate header length in ipip_tunnel_xmit + - [armhf,arm64] mvpp2: fix panic on module removal + - [armhf,arm64] mvpp2: refactor MTU change code + - net: bridge: delete local fdb on device init failure + - net: bridge: mcast: don't delete permanent entries when fast leave is + enabled + - net: bridge: move default pvid init/deinit to NETDEV_REGISTER/UNREGISTER + - net: fix ifindex collision during namespace removal + - net/mlx5e: always initialize frag->last_in_page + - net/mlx5: Use reversed order when unregister devices + - net: phy: fixed_phy: print gpio error only if gpio node is present + - net: phy: mscc: initialize stats array + - net: sched: Fix a possible null-pointer dereference in dequeue_func() + - net sched: update vlan action for batched events operations + - net: sched: use temporary variable for actions indexes + - net/smc: do not schedule tx_work in SMC_CLOSED state + - [armhf,arm64] net: stmmac: Use netif_tx_napi_add() for TX polling + function + - tipc: compat: allow tipc commands without arguments + - tipc: fix unitilized skb list crash + - tun: mark small packets as owned by the tap sock + - net/mlx5: Fix modify_cq_in alignment + - net/mlx5e: Prevent encap flow counter update async to user query + - r8169: don't use MSI before RTL8168d + - net: fix bpf_xdp_adjust_head regression for generic-XDP + - [x86] hv_sock: Fix hang when a connection is closed + - net: phy: fix race in genphy_update_link + - net/smc: avoid fallback in case of non-blocking connect + - rocker: fix memory leaks of fib_work on two error return paths + - net/mlx5: Add missing RDMA_RX capabilities + - net/mlx5e: Fix matching of speed to PRM link modes + - compat_ioctl: pppoe: fix PPPOEIOCSFWD handling + - [x86] drm/i915/vbt: Fix VBT parsing for the PSR section + - Revert "mac80211: set NETIF_F_LLTX when using intermediate tx queues" + - [armhf,arm64] spi: bcm2835: Fix 3-wire mode if DMA is enabled + https://www.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.2.9 + - Revert "PCI: Add missing link delays required by the PCIe spec" + - [arm64] iio: cros_ec_accel_legacy: Fix incorrect channel setting + - [x86] iio: imu: mpu6050: add missing available scan masks + - [x86] crypto: ccp - Fix oops by properly managing allocated structures + - [x86] crypto: ccp - Add support for valid authsize values less than 16 + - [x86] crypto: ccp - Ignore tag length when decrypting GCM ciphertext + - driver core: platform: return -ENXIO for missing GpioInt + - usb: usbfs: fix double-free of usb memory upon submiturb error + - Revert "USB: rio500: simplify locking" + - usb: iowarrior: fix deadlock on disconnect + - sound: fix a memory leak bug + - [arm64,mips/octeon] mmc: cavium: Set the correct dma max segment size for + mmc_host + - [arm64,mips/octeon] mmc: cavium: Add the missing dma unmap when the dma + has finished. + - loop: set PF_MEMALLOC_NOIO for the worker thread + - bdev: Fixup error handling in blkdev_get() (Closes: #934378) + - Input: usbtouchscreen - initialize PM mutex before using it + - Input: elantech - enable SMBus on new (2018+) systems + - [x86] Input: synaptics - enable RMI mode for HP Spectre X360 + - [x86] mm: Check for pfn instead of page in vmalloc_sync_one() + - [x86] mm: Sync also unmappings in vmalloc_sync_all() + - mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy() + - [s390x] perf annotate: Fix s390 gap between kernel end and module start + - perf db-export: Fix thread__exec_comm() + - [s390x] perf record: Fix module size on s390 + - [x86] purgatory: Do not use __builtin_memcpy and __builtin_memset + - [x86] purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS + - genirq/affinity: Create affinity mask for single vector + - gfs2: gfs2_walk_metadata fix + - usb: yurex: Fix use-after-free in yurex_delete + - usb: typec: ucsi: ccg: Fix uninitilized symbol error + - usb: typec: tcpm: free log buf memory when remove debug file + - usb: typec: tcpm: remove tcpm dir if no children + - usb: typec: tcpm: Add NULL check before dereferencing config + - usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests + - [armhf] can: flexcan: fix stop mode acknowledgment + - [armhf] can: flexcan: fix an use-after-free in flexcan_setup_stop_mode() + - can: peak_usb: fix potential double kfree_skb() + - [powerpc*] fix off by one in max_zone_pfn initialization for ZONE_DMA + - netfilter: nfnetlink: avoid deadlock due to synchronous request_module + - netfilter: Fix rpfilter dropping vrf packets by mistake + - netfilter: nf_tables: fix module autoload for redir + - netfilter: conntrack: always store window size un-scaled + - netfilter: nft_hash: fix symhash with modulus one + - rq-qos: don't reset has_sleepers on spurious wakeups + - rq-qos: set ourself TASK_UNINTERRUPTIBLE after we schedule + - rq-qos: use a mb for got_token + - netfilter: nf_tables: Support auto-loading for inet nat + - drm/amd/display: No audio endpoint for Dell MST display + - drm/amd/display: Clock does not lower in Updateplanes + - drm/amd/display: Wait for backlight programming completion in set + backlight level + - drm/amd/display: fix DMCU hang when going into Modern Standby + - drm/amd/display: use encoder's engine id to find matched free audio + device + - drm/amd/display: put back front end initialization sequence + - drm/amd/display: allocate 4 ddc engines for RV2 + - drm/amd/display: Fix dc_create failure handling and 666 color depths + - drm/amd/display: Only enable audio if speaker allocation exists + - drm/amd/display: Increase size of audios array + - nl80211: fix NL80211_HE_MAX_CAPABILITY_LEN + - mac80211: fix possible memory leak in ieee80211_assign_beacon + - mac80211: don't warn about CW params when not using them + - allocate_flower_entry: should check for null deref + - hwmon: (nct6775) Fix register address and added missed tolerance for + nct6106 + - [armhf] dts: imx6ul: fix clock frequency property name of I2C buses + - [powerpc*] papr_scm: Force a scm-unbind if initial scm-bind fails + - [arm64] Force SSBS on context switch + - [arm64] entry: SP Alignment Fault doesn't write to FAR_EL1 + - [x86] iommu/vt-d: Check if domain->pgd was allocated + - [arm64] drm/msm/dpu: Correct dpu encoder spinlock initialization + - [ppc64] cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init() + - [s390x] qdio: add sanity checks to the fast-requeue path + - ALSA: compress: Fix regression on compressed capture streams + - ALSA: compress: Prevent bypasses of set_params + - ALSA: compress: Don't allow paritial drain operations on capture streams + - ALSA: compress: Be more restrictive about when a drain is allowed + - perf script: Fix off by one in brstackinsn IPC computation + - perf tools: Fix proper buffer size for feature processing + - perf stat: Fix segfault for event group in repeat mode + - perf session: Fix loading of compressed data split across adjacent + records + - perf probe: Avoid calling freeing routine multiple times for same pointer + - drbd: dynamically allocate shash descriptor + - ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id() + - nvme: ignore subnqn for ADATA SX6000LNP + - nvme: fix memory leak caused by incorrect subsystem free + - scsi: megaraid_sas: fix panic on loading firmware crashdump + - scsi: ibmvfc: fix WARN_ON during event pool release + - scsi: scsi_dh_alua: always use a 2 second delay before retrying RTPG + - test_firmware: fix a memory leak bug + - tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop + - [x86] perf/intel: Fix SLOTS PEBS event constraint + - [x86] perf/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x + register + - [x86] perf: Apply more accurate check on hypervisor platform + - perf/core: Fix creating kernel counters for PMUs that override event->cpu + - [s390x] dma: provide proper ARCH_ZONE_DMA_BITS value + - HID: sony: Fix race condition between rumble and device remove. + - ALSA: usb-audio: fix a memory leak bug + - [x86] KVM/nSVM: properly map nested VMCB + - can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices + - can: peak_usb: pcan_usb_fd: Fix info-leaks to USB devices + - hwmon: (nct7802) Fix wrong detection of in4 presence + - hwmon: (lm75) Fixup tmp75b clr_mask + - [x86] drm/i915: Fix wrong escape clock divisor init for GLK + - ALSA: firewire: fix a memory leak bug + - ALSA: hiface: fix multiple memory leak bugs + - ALSA: hda - Don't override global PCM hw info flag + - [x86] ALSA: hda - Workaround for crackled sound on AMD controller + (1022:1457) + - mac80211: don't WARN on short WMM parameters from AP + - dax: dax_layout_busy_page() should not unmap cow pages + - SMB3: Fix deadlock in validate negotiate hits reconnect + - smb3: send CAP_DFS capability during session setup + - NFSv4: Fix delegation state recovery + - NFSv4: Check the return value of update_open_stateid() + - NFSv4: Fix an Oops in nfs4_do_setattr + - [x86] KVM: Fix leak vCPU's VMCS value into other pCPU + - [armhf,arm64] KVM: Sync ICH_VMCR_EL2 back when about to block + - mwifiex: fix 802.11n/WPA detection + - iwlwifi: don't unmap as page memory that was mapped as single + - iwlwifi: mvm: fix an out-of-bound access + - iwlwifi: mvm: fix a use-after-free bug in iwl_mvm_tx_tso_segment + - iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT on version < 41 + - iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support + + [ Salvatore Bonaccorso ] + * Enable Realtek 802.11ac wireless chips support (Closes: #933963) + + [ Ben Hutchings ] + * [armel] fb-modules: Remove xgifb, which was removed upstream (fixes FTBFS) + * tracefs: Fix potential null dereference in default_file_open() + (Closes: #934304) + * [arm64] hwrandom: Re-enable HW_RANDOM_OMAP as module (Closes: #931707) + * ptp: Change CAVIUM_PTP from built-in to modular (Closes: #934848) + * bug script: Check whether /e/n/interfaces exists (Closes: #934824) + * bug script: Include network configuration from /e/n/interfaces.d + * bug script: Check for unreadable /e/n/interfaces files + * [x86] iommu: Enable INTEL_IOMMU_DEFAULT_ON (Closes: #934309) + * HID: Enable HID_BIGBEN_FF, HID_MACALLY, HID_GFRM, HID_GT683R, + HID_VIEWSONIC, HID_MALTRON, HID_U2FZERO as modules (Closes: #934091) + * usbip: network: Fix unaligned member access (Closes: #925766) + * libbpf: Fix cross-build + * [rt] Update to 5.2.9-rt3: + - i2c: exynos5: Remove IRQF_ONESHOT + - i2c: hix5hd2: Remove IRQF_ONESHOT + - sched/deadline: Ensure inactive_timer runs in hardirq context + - thermal/x86_pkg_temp: make pkg_temp_lock a raw spinlock + - dma-buf: Use seqlock_t instread disabling preemption + - KVM: arm/arm64: Let the timer expire in hardirq context on RT + - x86: preempt: Check preemption level before looking at lazy-preempt + - arm64: preempt: Fixup lazy preempt + - arm64: preempt: Check preemption level before looking at lazy-preempt + + [ Alper Nebi Yasak ] + * [arm64] udeb: Add pl330 to kernel-image + + -- Ben Hutchings Sun, 18 Aug 2019 22:54:21 +0100 + linux (5.2.7-1) unstable; urgency=medium * New upstream stable update: diff --git a/debian/config/arm64/config b/debian/config/arm64/config index 30c7f2ffd996..30abd7498e02 100644 --- a/debian/config/arm64/config +++ b/debian/config/arm64/config @@ -114,7 +114,7 @@ CONFIG_TEGRA_ACONNECT=y ## file: drivers/char/hw_random/Kconfig ## CONFIG_HW_RANDOM_BCM2835=m -# CONFIG_HW_RANDOM_OMAP is not set +CONFIG_HW_RANDOM_OMAP=m CONFIG_HW_RANDOM_HISI=m CONFIG_HW_RANDOM_XGENE=m CONFIG_HW_RANDOM_MESON=m diff --git a/debian/config/config b/debian/config/config index 2c12e67c14b5..7f5265ee0c26 100644 --- a/debian/config/config +++ b/debian/config/config @@ -831,10 +831,12 @@ CONFIG_HID_ASUS=m CONFIG_HID_AUREAL=m CONFIG_HID_BELKIN=y CONFIG_HID_BETOP_FF=m +CONFIG_HID_BIGBEN_FF=m CONFIG_HID_CHERRY=y CONFIG_HID_CHICONY=y CONFIG_HID_CORSAIR=m CONFIG_HID_COUGAR=m +CONFIG_HID_MACALLY=m CONFIG_HID_PRODIKEYS=m CONFIG_HID_CMEDIA=m CONFIG_HID_CP2112=m @@ -847,14 +849,15 @@ CONFIG_HID_ELECOM=m CONFIG_HID_ELO=m CONFIG_HID_EZKEY=y CONFIG_HID_GEMBIRD=m -# CONFIG_HID_GFRM is not set +CONFIG_HID_GFRM=m CONFIG_HID_HOLTEK=m CONFIG_HOLTEK_FF=y -# CONFIG_HID_GT683R is not set +CONFIG_HID_GT683R=m CONFIG_HID_KEYTOUCH=m CONFIG_HID_KYE=m CONFIG_HID_UCLOGIC=m CONFIG_HID_WALTOP=m +CONFIG_HID_VIEWSONIC=m CONFIG_HID_GYRATION=m CONFIG_HID_ICADE=m CONFIG_HID_ITE=m @@ -871,6 +874,7 @@ CONFIG_LOGIRUMBLEPAD2_FF=y CONFIG_LOGIG940_FF=y CONFIG_LOGIWHEELS_FF=y CONFIG_HID_MAGICMOUSE=m +CONFIG_HID_MALTRON=m CONFIG_HID_MAYFLASH=m CONFIG_HID_REDRAGON=m CONFIG_HID_MICROSOFT=y @@ -912,6 +916,7 @@ CONFIG_HID_THINGM=m CONFIG_HID_THRUSTMASTER=m CONFIG_THRUSTMASTER_FF=y CONFIG_HID_UDRAW_PS3=m +CONFIG_HID_U2FZERO=m CONFIG_HID_WACOM=m CONFIG_HID_WIIMOTE=m CONFIG_HID_XINMO=m @@ -3224,7 +3229,7 @@ CONFIG_NET_VENDOR_CAVIUM=y # CONFIG_THUNDER_NIC_VF is not set # CONFIG_THUNDER_NIC_BGX is not set # CONFIG_THUNDER_NIC_RGX is not set -CONFIG_CAVIUM_PTP=y +CONFIG_CAVIUM_PTP=m CONFIG_LIQUIDIO=m CONFIG_LIQUIDIO_VF=m @@ -4119,6 +4124,13 @@ CONFIG_RTL8821AE=m CONFIG_RTL8192CU=m # CONFIG_RTLWIFI_DEBUG is not set +## +## file: drivers/net/wireless/realtek/rtw88/Kconfig +## +CONFIG_RTW88=m +CONFIG_RTW88_8822BE=y +CONFIG_RTW88_8822CE=y + ## ## file: drivers/net/wireless/rsi/Kconfig ## @@ -4350,14 +4362,21 @@ CONFIG_YENTA_TOSHIBA=y ## ## file: drivers/platform/x86/Kconfig ## +CONFIG_ACER_WIRELESS=m CONFIG_ASUS_LAPTOP=m CONFIG_FUJITSU_LAPTOP=m CONFIG_HP_WMI=m +CONFIG_LG_LAPTOP=m CONFIG_MSI_LAPTOP=m CONFIG_PANASONIC_LAPTOP=m CONFIG_COMPAL_LAPTOP=m CONFIG_SONY_LAPTOP=m +CONFIG_SURFACE3_WMI=m +CONFIG_INTEL_WMI_THUNDERBOLT=m +CONFIG_PEAQ_WMI=m +CONFIG_TOSHIBA_WMI=m # CONFIG_SAMSUNG_LAPTOP is not set +CONFIG_SURFACE_3_BUTTON=m ## ## file: drivers/pnp/Kconfig diff --git a/debian/config/kernelarch-x86/config b/debian/config/kernelarch-x86/config index 64f7abbcbe98..23b943b52c45 100644 --- a/debian/config/kernelarch-x86/config +++ b/debian/config/kernelarch-x86/config @@ -832,7 +832,7 @@ CONFIG_TOUCHSCREEN_SURFACE3_SPI=m ## CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y -# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_DEFAULT_ON_INTGPU_OFF=y CONFIG_IRQ_REMAP=y ## diff --git a/debian/installer/modules/arm64/kernel-image b/debian/installer/modules/arm64/kernel-image index e9971cc90bd9..47eb77d55a01 100644 --- a/debian/installer/modules/arm64/kernel-image +++ b/debian/installer/modules/arm64/kernel-image @@ -23,3 +23,6 @@ cros_ec_spi ? # PCIe PHYs phy-rockchip-pcie ? + +# For spi-rockchip +pl330 ? diff --git a/debian/installer/modules/armel-marvell/fb-modules b/debian/installer/modules/armel-marvell/fb-modules index c860f18783b9..701ee42c5ff7 100644 --- a/debian/installer/modules/armel-marvell/fb-modules +++ b/debian/installer/modules/armel-marvell/fb-modules @@ -1,2 +1 @@ udlfb -xgifb diff --git a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 8e6103b42a1a..8d254cbef9db 100644 --- a/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0001-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:20 +0200 Subject: [PATCH 1/4] Split IRQ-off and zone->lock while freeing pages from PCP list #1 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch b/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch index d7558c7c4bd2..9f320a70cefd 100644 --- a/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch +++ b/debian/patches-rt/0001-printk-rb-add-printk-ring-buffer-documentation.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:39 +0100 Subject: [PATCH 01/25] printk-rb: add printk ring buffer documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The full documentation file for the printk ring buffer. diff --git a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch index 6319096772a4..7c56dbed6250 100644 --- a/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch +++ b/debian/patches-rt/0002-Split-IRQ-off-and-zone-lock-while-freeing-pages-from.patch @@ -2,7 +2,7 @@ From: Peter Zijlstra Date: Mon, 28 May 2018 15:24:21 +0200 Subject: [PATCH 2/4] Split IRQ-off and zone->lock while freeing pages from PCP list #2 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Split the IRQ-off section while accessing the PCP list from zone->lock while freeing pages. diff --git a/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch b/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch index 59867251691b..5840e86d3c0f 100644 --- a/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch +++ b/debian/patches-rt/0002-printk-rb-add-prb-locking-functions.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:40 +0100 Subject: [PATCH 02/25] printk-rb: add prb locking functions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add processor-reentrant spin locking functions. These allow restricting the number of possible contexts to 2, which can simplify diff --git a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch index 6196f2b88e03..1d279deeec81 100644 --- a/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/0003-mm-SLxB-change-list_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Mon, 28 May 2018 15:24:22 +0200 Subject: [PATCH 3/4] mm/SLxB: change list_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The list_lock is used with used with IRQs off on RT. Make it a raw_spinlock_t otherwise the interrupts won't be disabled on -RT. The locking rules remain diff --git a/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch b/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch index 4b182c1a1785..32be121d3493 100644 --- a/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch +++ b/debian/patches-rt/0003-printk-rb-define-ring-buffer-struct-and-initializer.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:41 +0100 Subject: [PATCH 03/25] printk-rb: define ring buffer struct and initializer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz See Documentation/printk-ringbuffer.txt for details about the initializer arguments. diff --git a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch index a6d731fb1796..9c9699020222 100644 --- a/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch +++ b/debian/patches-rt/0004-mm-SLUB-delay-giving-back-empty-slubs-to-IRQ-enabled.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 21 Jun 2018 17:29:19 +0200 Subject: [PATCH 4/4] mm/SLUB: delay giving back empty slubs to IRQ enabled regions -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz __free_slab() is invoked with disabled interrupts which increases the irq-off time while __free_pages() is doing the work. diff --git a/debian/patches-rt/0004-printk-rb-add-writer-interface.patch b/debian/patches-rt/0004-printk-rb-add-writer-interface.patch index c203e72f969e..0af078ac7d0e 100644 --- a/debian/patches-rt/0004-printk-rb-add-writer-interface.patch +++ b/debian/patches-rt/0004-printk-rb-add-writer-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:42 +0100 Subject: [PATCH 04/25] printk-rb: add writer interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add the writer functions prb_reserve() and prb_commit(). These make use of processor-reentrant spin locks to limit the number of possible diff --git a/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch b/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch index 3cfed83e24bc..8b8f72fa5891 100644 --- a/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch +++ b/debian/patches-rt/0005-printk-rb-add-basic-non-blocking-reading-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:43 +0100 Subject: [PATCH 05/25] printk-rb: add basic non-blocking reading interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add reader iterator static declaration/initializer, dynamic initializer, and functions to iterate and retrieve ring buffer data. diff --git a/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch b/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch index 68f4ae27c764..519f095da7e8 100644 --- a/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch +++ b/debian/patches-rt/0006-printk-rb-add-blocking-reader-support.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:44 +0100 Subject: [PATCH 06/25] printk-rb: add blocking reader support -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add a blocking read function for readers. An irq_work function is used to signal the wait queue so that write notification can diff --git a/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch b/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch index 51bf2cccf3c4..370206c600e3 100644 --- a/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch +++ b/debian/patches-rt/0007-printk-rb-add-functionality-required-by-printk.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:45 +0100 Subject: [PATCH 07/25] printk-rb: add functionality required by printk -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The printk subsystem needs to be able to query the size of the ring buffer, seek to specific entries within the ring buffer, and track diff --git a/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch b/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch index 60e3313b9eba..45697051efdc 100644 --- a/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch +++ b/debian/patches-rt/0008-printk-add-ring-buffer-and-kthread.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:46 +0100 Subject: [PATCH 08/25] printk: add ring buffer and kthread -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The printk ring buffer provides an NMI-safe interface for writing messages to a ring buffer. Using such a buffer for alleviates printk diff --git a/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch b/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch index 343222ac695a..59a2cff98b22 100644 --- a/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch +++ b/debian/patches-rt/0009-printk-remove-exclusive-console-hack.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:47 +0100 Subject: [PATCH 09/25] printk: remove exclusive console hack -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In order to support printing the printk log history when new consoles are registered, a global exclusive_console variable is diff --git a/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch b/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch index ff1998c2c259..c035f6e3a28e 100644 --- a/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch +++ b/debian/patches-rt/0010-printk-redirect-emit-store-to-new-ringbuffer.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:48 +0100 Subject: [PATCH 10/25] printk: redirect emit/store to new ringbuffer -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz vprintk_emit and vprintk_store are the main functions that all printk variants eventually go through. Change these to store the message in diff --git a/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch b/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch index 5c3719fd32ca..e2012bee295a 100644 --- a/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch +++ b/debian/patches-rt/0011-printk_safe-remove-printk-safe-code.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:49 +0100 Subject: [PATCH 11/25] printk_safe: remove printk safe code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz vprintk variants are now NMI-safe so there is no longer a need for the "safe" calls. diff --git a/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch b/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch index e94a9c46832e..d090ed40964f 100644 --- a/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch +++ b/debian/patches-rt/0012-printk-minimize-console-locking-implementation.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:50 +0100 Subject: [PATCH 12/25] printk: minimize console locking implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since printing of the printk buffer is now handled by the printk kthread, minimize the console locking functions to just handle diff --git a/debian/patches-rt/0013-printk-track-seq-per-console.patch b/debian/patches-rt/0013-printk-track-seq-per-console.patch index fed77ce4c236..a297ab873a62 100644 --- a/debian/patches-rt/0013-printk-track-seq-per-console.patch +++ b/debian/patches-rt/0013-printk-track-seq-per-console.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:51 +0100 Subject: [PATCH 13/25] printk: track seq per console -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Allow each console to track which seq record was last printed. This simplifies identifying dropped records. diff --git a/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch b/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch index f6e138816970..9cf1ba69bb65 100644 --- a/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch +++ b/debian/patches-rt/0014-printk-do-boot_delay_msec-inside-printk_delay.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:52 +0100 Subject: [PATCH 14/25] printk: do boot_delay_msec inside printk_delay -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Both functions needed to be called one after the other, so just integrate boot_delay_msec into printk_delay for simplification. diff --git a/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch b/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch index 7036f3c32e84..9d446e8876b5 100644 --- a/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch +++ b/debian/patches-rt/0015-printk-print-history-for-new-consoles.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:53 +0100 Subject: [PATCH 15/25] printk: print history for new consoles -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When new consoles register, they currently print how many messages they have missed. However, many (or all) of those messages may still diff --git a/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch b/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch index 513e89c5e7b1..4a513f24efbe 100644 --- a/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch +++ b/debian/patches-rt/0016-printk-implement-CON_PRINTBUFFER.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:54 +0100 Subject: [PATCH 16/25] printk: implement CON_PRINTBUFFER -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz If the CON_PRINTBUFFER flag is not set, do not replay the history for that console. diff --git a/debian/patches-rt/0017-printk-add-processor-number-to-output.patch b/debian/patches-rt/0017-printk-add-processor-number-to-output.patch index 805335aca0a6..cbb0e5968950 100644 --- a/debian/patches-rt/0017-printk-add-processor-number-to-output.patch +++ b/debian/patches-rt/0017-printk-add-processor-number-to-output.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:55 +0100 Subject: [PATCH 17/25] printk: add processor number to output -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz It can be difficult to sort printk out if multiple processors are printing simultaneously. Add the processor number to the printk diff --git a/debian/patches-rt/0018-console-add-write_atomic-interface.patch b/debian/patches-rt/0018-console-add-write_atomic-interface.patch index 529d5f7546b6..04c83c950864 100644 --- a/debian/patches-rt/0018-console-add-write_atomic-interface.patch +++ b/debian/patches-rt/0018-console-add-write_atomic-interface.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:56 +0100 Subject: [PATCH 18/25] console: add write_atomic interface -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add a write_atomic callback to the console. This is an optional function for console drivers. The function must be atomic (including diff --git a/debian/patches-rt/0019-printk-introduce-emergency-messages.patch b/debian/patches-rt/0019-printk-introduce-emergency-messages.patch index c151b9128831..aaab289e28b9 100644 --- a/debian/patches-rt/0019-printk-introduce-emergency-messages.patch +++ b/debian/patches-rt/0019-printk-introduce-emergency-messages.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:57 +0100 Subject: [PATCH 19/25] printk: introduce emergency messages -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Console messages are generally either critical or non-critical. Critical messages are messages such as crashes or sysrq output. diff --git a/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch index 92ae5adda110..4ef08abf2aaa 100644 --- a/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch +++ b/debian/patches-rt/0020-serial-8250-implement-write_atomic.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:58 +0100 Subject: [PATCH 20/25] serial: 8250: implement write_atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Implement a non-sleeping NMI-safe write_atomic console function in order to support emergency printk messages. diff --git a/debian/patches-rt/0021-printk-implement-KERN_CONT.patch b/debian/patches-rt/0021-printk-implement-KERN_CONT.patch index 6aa65353241e..48a0abd4a773 100644 --- a/debian/patches-rt/0021-printk-implement-KERN_CONT.patch +++ b/debian/patches-rt/0021-printk-implement-KERN_CONT.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:29:59 +0100 Subject: [PATCH 21/25] printk: implement KERN_CONT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Implement KERN_CONT based on the printing CPU rather than on the printing task. As long as the KERN_CONT messages are coming from the diff --git a/debian/patches-rt/0022-printk-implement-dev-kmsg.patch b/debian/patches-rt/0022-printk-implement-dev-kmsg.patch index 145ac922e2e9..8d9ad4d475d3 100644 --- a/debian/patches-rt/0022-printk-implement-dev-kmsg.patch +++ b/debian/patches-rt/0022-printk-implement-dev-kmsg.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:00 +0100 Subject: [PATCH 22/25] printk: implement /dev/kmsg -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since printk messages are now logged to a new ring buffer, update the /dev/kmsg functions to pull the messages from there. diff --git a/debian/patches-rt/0023-printk-implement-syslog.patch b/debian/patches-rt/0023-printk-implement-syslog.patch index f639e063a6ef..4ad7c750d958 100644 --- a/debian/patches-rt/0023-printk-implement-syslog.patch +++ b/debian/patches-rt/0023-printk-implement-syslog.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:01 +0100 Subject: [PATCH 23/25] printk: implement syslog -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since printk messages are now logged to a new ring buffer, update the syslog functions to pull the messages from there. diff --git a/debian/patches-rt/0024-printk-implement-kmsg_dump.patch b/debian/patches-rt/0024-printk-implement-kmsg_dump.patch index 4adf20447fad..675535630f4d 100644 --- a/debian/patches-rt/0024-printk-implement-kmsg_dump.patch +++ b/debian/patches-rt/0024-printk-implement-kmsg_dump.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:02 +0100 Subject: [PATCH 24/25] printk: implement kmsg_dump -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since printk messages are now logged to a new ring buffer, update the kmsg_dump functions to pull the messages from there. diff --git a/debian/patches-rt/0025-printk-remove-unused-code.patch b/debian/patches-rt/0025-printk-remove-unused-code.patch index ae60cb65905b..466191505d9f 100644 --- a/debian/patches-rt/0025-printk-remove-unused-code.patch +++ b/debian/patches-rt/0025-printk-remove-unused-code.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Tue, 12 Feb 2019 15:30:03 +0100 Subject: [PATCH 25/25] printk: remove unused code -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Code relating to the safe context and anything dealing with the previous log buffer implementation is no longer in use. Remove it. diff --git a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch index 21e83543c5ce..3f7277dd8c68 100644 --- a/debian/patches-rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Probably happens on all ARM, with CONFIG_PREEMPT_RT_FULL diff --git a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch index d0dddfd42bba..60c87c1f3dd0 100644 --- a/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch +++ b/debian/patches-rt/Drivers-hv-vmbus-include-header-for-get_irq_regs.patch @@ -4,7 +4,7 @@ Subject: [PATCH] Drivers: hv: vmbus: include header for get_irq_regs() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz On !RT the header file get_irq_regs() gets pulled in via other header files. On RT it does not and the build fails: diff --git a/debian/patches-rt/KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch b/debian/patches-rt/KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch new file mode 100644 index 000000000000..dd2bd6fbcb93 --- /dev/null +++ b/debian/patches-rt/KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch @@ -0,0 +1,47 @@ +From: Thomas Gleixner +Date: Tue, 13 Aug 2019 14:29:41 +0200 +Subject: [PATCH] KVM: arm/arm64: Let the timer expire in hardirq context + on RT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +The timers are canceled from an preempt-notifier which is invoked with +disabled preemption which is not allowed on PREEMPT_RT. +The timer callback is short so in could be invoked in hard-IRQ context +on -RT. + +Let the timer expire on hard-IRQ context even on -RT. + +Signed-off-by: Thomas Gleixner +Acked-by: Marc Zyngier +Tested-by: Julien Grall +Signed-off-by: Sebastian Andrzej Siewior +--- + virt/kvm/arm/arch_timer.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/virt/kvm/arm/arch_timer.c ++++ b/virt/kvm/arm/arch_timer.c +@@ -80,7 +80,7 @@ static inline bool userspace_irqchip(str + static void soft_timer_start(struct hrtimer *hrt, u64 ns) + { + hrtimer_start(hrt, ktime_add_ns(ktime_get(), ns), +- HRTIMER_MODE_ABS); ++ HRTIMER_MODE_ABS_HARD); + } + + static void soft_timer_cancel(struct hrtimer *hrt) +@@ -697,11 +697,11 @@ void kvm_timer_vcpu_init(struct kvm_vcpu + update_vtimer_cntvoff(vcpu, kvm_phys_timer_read()); + ptimer->cntvoff = 0; + +- hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ++ hrtimer_init(&timer->bg_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); + timer->bg_timer.function = kvm_bg_timer_expire; + +- hrtimer_init(&vtimer->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); +- hrtimer_init(&ptimer->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ++ hrtimer_init(&vtimer->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); ++ hrtimer_init(&ptimer->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD); + vtimer->hrtimer.function = kvm_hrtimer_expire; + ptimer->hrtimer.function = kvm_hrtimer_expire; + diff --git a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch index 3ab78b247ea4..b45afee3ba87 100644 --- a/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ b/debian/patches-rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:01 -0600 Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c -@@ -691,7 +691,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -702,7 +702,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v * involves poking the GIC, which must be done in a * non-preemptible context. */ @@ -32,7 +32,7 @@ Signed-off-by: Sebastian Andrzej Siewior kvm_pmu_flush_hwstate(vcpu); -@@ -740,7 +740,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -751,7 +751,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v kvm_timer_sync_hwstate(vcpu); kvm_vgic_sync_hwstate(vcpu); local_irq_enable(); @@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; } -@@ -818,7 +818,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v +@@ -829,7 +829,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v /* Exit types that need handling before we can be preempted */ handle_exit_early(vcpu, run, ret); diff --git a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch index 1e9de1c1dea2..862fdf7aa8ac 100644 --- a/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch +++ b/debian/patches-rt/NFSv4-replace-seqcount_t-with-a-seqlock_t.patch @@ -5,7 +5,7 @@ Cc: Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: NFSv4: replace seqcount_t with a seqlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me because it maps to preempt_disable() in -RT which I can't have at this @@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior mutex_lock(&sp->so_delegreturn_mutex); - seq = raw_seqcount_begin(&sp->so_reclaim_seqcount); + seq = read_seqbegin(&sp->so_reclaim_seqlock); - err = nfs4_open_delegation_recall(ctx, state, stateid, type); + err = nfs4_open_delegation_recall(ctx, state, stateid); if (!err) err = nfs_delegation_claim_locks(state, stateid); - if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c -@@ -2911,7 +2911,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2914,7 +2914,7 @@ static int _nfs4_open_and_get_state(stru unsigned int seq; int ret; @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior ret = _nfs4_proc_open(opendata, ctx); if (ret != 0) -@@ -2952,7 +2952,7 @@ static int _nfs4_open_and_get_state(stru +@@ -2955,7 +2955,7 @@ static int _nfs4_open_and_get_state(stru if (d_inode(dentry) == state->inode) { nfs_inode_attach_open_context(ctx); diff --git a/debian/patches-rt/add_migrate_disable.patch b/debian/patches-rt/add_migrate_disable.patch index 95f94a163487..5d24f97651c1 100644 --- a/debian/patches-rt/add_migrate_disable.patch +++ b/debian/patches-rt/add_migrate_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: kernel/sched/core: add migrate_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz --- include/linux/preempt.h | 23 ++++++++ diff --git a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch index ab68ef862f0e..0fb9d175171c 100644 --- a/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch +++ b/debian/patches-rt/apparmor-use-a-locallock-instead-preempt_disable.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 11 Oct 2017 17:43:49 +0200 Subject: apparmor: use a locallock instead preempt_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz get_buffers() disables preemption which acts as a lock for the per-CPU variable. Since we can't disable preemption here on RT, a local_lock is diff --git a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch b/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch index 2ad54777e43a..55ef17535c64 100644 --- a/debian/patches-rt/arch-arm64-Add-lazy-preempt-support.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/arm-disable-NEON-in-kernel-mode.patch b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch index d3d61c4a40c1..4fa55ff58c05 100644 --- a/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch +++ b/debian/patches-rt/arm-disable-NEON-in-kernel-mode.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 1 Dec 2017 10:42:03 +0100 Subject: [PATCH] arm*: disable NEON in kernel mode -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz NEON in kernel mode is used by the crypto algorithms and raid6 code. While the raid6 code looks okay, the crypto algorithms do not: NEON diff --git a/debian/patches-rt/arm-enable-highmem-for-rt.patch b/debian/patches-rt/arm-enable-highmem-for-rt.patch index 6d550033e925..42a349688ed0 100644 --- a/debian/patches-rt/arm-enable-highmem-for-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz fixup highmem for ARM. diff --git a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch b/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch index da856345befe..026c52cd9ad3 100644 --- a/debian/patches-rt/arm-highmem-flush-tlb-on-unmap.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/arm-imx6-cpuidle-Use-raw_spinlock_t.patch b/debian/patches-rt/arm-imx6-cpuidle-Use-raw_spinlock_t.patch index 9c6a75209939..88565d8b4233 100644 --- a/debian/patches-rt/arm-imx6-cpuidle-Use-raw_spinlock_t.patch +++ b/debian/patches-rt/arm-imx6-cpuidle-Use-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 14 May 2019 17:07:44 +0200 Subject: [PATCH] arm: imx6: cpuidle: Use raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The idle call back is invoked with disabled interrupts and requires raw_spinlock_t locks to work. diff --git a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch index aff9365507e8..2a19064b6c5b 100644 --- a/debian/patches-rt/arm-include-definition-for-cpumask_t.patch +++ b/debian/patches-rt/arm-include-definition-for-cpumask_t.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 22 Dec 2016 17:28:33 +0100 Subject: [PATCH] arm: include definition for cpumask_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This definition gets pulled in by other files. With the (later) split of RCU and spinlock.h it won't compile anymore. diff --git a/debian/patches-rt/arm-preempt-lazy-support.patch b/debian/patches-rt/arm-preempt-lazy-support.patch index 3ecbcf0f3396..d7cffa0bcd0d 100644 --- a/debian/patches-rt/arm-preempt-lazy-support.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Implement the arm pieces for lazy preempt. diff --git a/debian/patches-rt/arm-remove-printk_nmi_.patch b/debian/patches-rt/arm-remove-printk_nmi_.patch index 70e32c8c1c3b..11757f7dbf4a 100644 --- a/debian/patches-rt/arm-remove-printk_nmi_.patch +++ b/debian/patches-rt/arm-remove-printk_nmi_.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 15 Feb 2019 14:34:20 +0100 Subject: [PATCH] arm: remove printk_nmi_.*() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz It is no longer provided by the printk core code. diff --git a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch index 7ccd9109178a..215f8af55cad 100644 --- a/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch +++ b/debian/patches-rt/arm64-KVM-compute_layout-before-altenates-are-applie.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 09:13:42 +0200 Subject: [PATCH] arm64: KVM: compute_layout before altenates are applied -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz compute_layout() is invoked as part of an alternative fixup under stop_machine() and needs a sleeping lock as part of get_random_long(). diff --git a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch index b4574fcb8c36..78cc49a8ae25 100644 --- a/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch +++ b/debian/patches-rt/arm64-fpsimd-use-preemp_disable-in-addition-to-local.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jul 2018 14:02:38 +0200 Subject: [PATCH] arm64: fpsimd: use preemp_disable in addition to local_bh_disable() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the diff --git a/debian/patches-rt/arm64-preempt-Check-preemption-level-before-looking-.patch b/debian/patches-rt/arm64-preempt-Check-preemption-level-before-looking-.patch new file mode 100644 index 000000000000..865accf838a5 --- /dev/null +++ b/debian/patches-rt/arm64-preempt-Check-preemption-level-before-looking-.patch @@ -0,0 +1,25 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 14 Aug 2019 17:08:58 +0200 +Subject: [PATCH] arm64: preempt: Check preemption level before looking at + lazy-preempt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +Before evaluating the lazy-preempt state it must be ensure that the +preempt-count is zero. + +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm64/include/asm/preempt.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm64/include/asm/preempt.h ++++ b/arch/arm64/include/asm/preempt.h +@@ -73,6 +73,8 @@ static inline bool __preempt_count_dec_a + if (!pc || !READ_ONCE(ti->preempt_count)) + return true; + #ifdef CONFIG_PREEMPT_LAZY ++ if ((pc & ~PREEMPT_NEED_RESCHED)) ++ return false; + if (current_thread_info()->preempt_lazy_count) + return false; + return test_thread_flag(TIF_NEED_RESCHED_LAZY); diff --git a/debian/patches-rt/arm64-preempt-Fixup-lazy-preempt.patch b/debian/patches-rt/arm64-preempt-Fixup-lazy-preempt.patch new file mode 100644 index 000000000000..a76b67794587 --- /dev/null +++ b/debian/patches-rt/arm64-preempt-Fixup-lazy-preempt.patch @@ -0,0 +1,27 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 13 Aug 2019 11:53:23 +0200 +Subject: [PATCH] arm64: preempt: Fixup lazy preempt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +The irq-exit assmebly checks preempt count and need-resched flag +followed by lazy-preempt status. This is a bug. It should schedule if +preempt-count is zero _and_ need_resched is set _or_ preempt-count is +zero and check the lazy-preempt status. + +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/arm64/kernel/entry.S | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm64/kernel/entry.S ++++ b/arch/arm64/kernel/entry.S +@@ -680,7 +680,8 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKIN + orr x24, x24, x0 + alternative_else_nop_endif + +- cbnz x24, 2f // preempt count != 0 ++ cbz x24, 1f // (need_resched + count) == 0 ++ cbnz w24, 2f // count != 0 + + ldr w24, [tsk, #TSK_TI_PREEMPT_LAZY] // get preempt lazy count + cbnz w24, 2f // preempt lazy count != 0 diff --git a/debian/patches-rt/at91_dont_enable_disable_clock.patch b/debian/patches-rt/at91_dont_enable_disable_clock.patch index ffc78bd48a6b..b3d4c78dd54b 100644 --- a/debian/patches-rt/at91_dont_enable_disable_clock.patch +++ b/debian/patches-rt/at91_dont_enable_disable_clock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 09 Mar 2016 10:51:06 +0100 Subject: arm: at91: do not disable/enable clocks in a row -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Currently the driver will disable the clock and enable it one line later if it is switching from periodic mode into one shot. diff --git a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch index ca85ddeb2acc..f9d4d17f02e4 100644 --- a/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch +++ b/debian/patches-rt/block-blk-mq-move-blk_queue_usage_counter_release-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 13 Mar 2018 13:49:16 +0100 Subject: [PATCH] block: blk-mq: move blk_queue_usage_counter_release() into process context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/block/blk-core.c +++ b/block/blk-core.c -@@ -403,12 +403,21 @@ void blk_queue_exit(struct request_queue +@@ -404,12 +404,21 @@ void blk_queue_exit(struct request_queue percpu_ref_put(&q->q_usage_counter); } @@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior } static void blk_rq_timed_out_timer(struct timer_list *t) -@@ -479,6 +488,7 @@ struct request_queue *blk_alloc_queue_no +@@ -480,6 +489,7 @@ struct request_queue *blk_alloc_queue_no spin_lock_init(&q->queue_lock); init_waitqueue_head(&q->mq_freeze_wq); @@ -93,7 +93,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include -@@ -554,6 +555,7 @@ struct request_queue { +@@ -559,6 +560,7 @@ struct request_queue { #endif struct rcu_head rcu_head; wait_queue_head_t mq_freeze_wq; diff --git a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch b/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch index d4bde258b7f3..5694ad597453 100644 --- a/debian/patches-rt/block-mq-don-t-complete-requests-via-IPI.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The IPI runs in hardirq context and there are sleeping locks. Assume caches are shared and complete them on the local CPU. diff --git a/debian/patches-rt/block-mq-drop-preempt-disable.patch b/debian/patches-rt/block-mq-drop-preempt-disable.patch index 95eba526ecb6..7dcd706acf0f 100644 --- a/debian/patches-rt/block-mq-drop-preempt-disable.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/block-mq-use-cpu_light.patch b/debian/patches-rt/block-mq-use-cpu_light.patch index e1dc211e9928..6fc750bcc9bc 100644 --- a/debian/patches-rt/block-mq-use-cpu_light.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/block-use-cpu-chill.patch b/debian/patches-rt/block-use-cpu-chill.patch index 5d7ec38a03d4..1b5c5a3aa6ad 100644 --- a/debian/patches-rt/block-use-cpu-chill.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch index 98e6e4404cd6..0f3a7e8725d8 100644 --- a/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ b/debian/patches-rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 18:19:48 +0200 Subject: [PATCH] cgroup: use irqsave in cgroup_rstat_flush_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). diff --git a/debian/patches-rt/clocksource-tclib-add-proper-depend.patch b/debian/patches-rt/clocksource-tclib-add-proper-depend.patch index d3b3fe786499..18252aff14c3 100644 --- a/debian/patches-rt/clocksource-tclib-add-proper-depend.patch +++ b/debian/patches-rt/clocksource-tclib-add-proper-depend.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 29 May 2019 15:50:36 +0200 Subject: clocksource: TCLIB: Add proper depend -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add a depends statement on ATMEL_TCLIB to ensure that it is not built on !ATMEL if COMPILE_TEST is enabled. The build will fail because the driver depends on diff --git a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch b/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch index 2fc247601529..d90652c3b745 100644 --- a/debian/patches-rt/clocksource-tclib-allow-higher-clockrates.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/completion-use-simple-wait-queues.patch b/debian/patches-rt/completion-use-simple-wait-queues.patch index 0078d128bb2e..acfd6ce364ad 100644 --- a/debian/patches-rt/completion-use-simple-wait-queues.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Completions have no long lasting callbacks and therefor do not need the complex waitqueue variant. Use simple waitqueues which reduces the @@ -51,7 +51,7 @@ Signed-off-by: Thomas Gleixner default: --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c -@@ -1705,7 +1705,7 @@ static void ffs_data_put(struct ffs_data +@@ -1708,7 +1708,7 @@ static void ffs_data_put(struct ffs_data pr_info("%s(): freeing\n", __func__); ffs_data_clear(ffs); BUG_ON(waitqueue_active(&ffs->ev.waitq) || diff --git a/debian/patches-rt/cond-resched-lock-rt-tweak.patch b/debian/patches-rt/cond-resched-lock-rt-tweak.patch index c3000e546326..cb0f08af2b27 100644 --- a/debian/patches-rt/cond-resched-lock-rt-tweak.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch index 0d58debbbe7f..cc5c3034b662 100644 --- a/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch +++ b/debian/patches-rt/connector-cn_proc-Protect-send_msg-with-a-local-lock.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:11:54 +0200 Subject: [PATCH] connector/cn_proc: Protect send_msg() with a local lock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931 |in_atomic(): 1, irqs_disabled(): 0, pid: 31807, name: sleep diff --git a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch index c24e8c904c78..d79fae5b555e 100644 --- a/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch +++ b/debian/patches-rt/cpu-hotplug--Implement-CPU-pinning.patch @@ -1,7 +1,7 @@ Subject: cpu/hotplug: Implement CPU pinning From: Thomas Gleixner Date: Wed, 19 Jul 2017 17:31:20 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch b/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch index 4716458ed1e2..b4cd0396e847 100644 --- a/debian/patches-rt/cpufreq-drop-K8-s-driver-from-beeing-selected.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Ralf posted a picture of a backtrace from diff --git a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch b/debian/patches-rt/cpumask-disable-offstack-on-rt.patch index 15093882a9fd..ae5a19128dc6 100644 --- a/debian/patches-rt/cpumask-disable-offstack-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There are "valid" GFP_ATOMIC allocations such as diff --git a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch index d0802ea6cc1f..4c9344b5187d 100644 --- a/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ b/debian/patches-rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 8 Jan 2017 09:32:25 +0100 Subject: [PATCH] cpuset: Convert callback_lock to raw_spinlock_t -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The two commits below add up to a cpuset might_sleep() splat for RT: diff --git a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch b/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch index 79d371f666a1..3f0c2f508d17 100644 --- a/debian/patches-rt/crypto-Reduce-preempt-disabled-regions-more-algos.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch index ce929ef6fff6..0ef897b2aca8 100644 --- a/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ b/debian/patches-rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 18:52:00 +0200 Subject: [PATCH] crypto: cryptd - add a lock instead preempt_disable/local_bh_disable -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz cryptd has a per-CPU lock which protected with local_bh_disable() and preempt_disable(). diff --git a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch index 85c675bf526c..d74c2867811c 100644 --- a/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch +++ b/debian/patches-rt/crypto-limit-more-FPU-enabled-sections.patch @@ -4,7 +4,7 @@ Subject: [PATCH] crypto: limit more FPU-enabled sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Those crypto drivers use SSE/AVX/… for their crypto work and in order to do so in kernel they need to enable the "FPU" in kernel mode which diff --git a/debian/patches-rt/debugobjects-rt.patch b/debian/patches-rt/debugobjects-rt.patch index a2f74c00e386..18664822b9eb 100644 --- a/debian/patches-rt/debugobjects-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Avoid filling the pool / allocating memory with irqs off(). diff --git a/debian/patches-rt/dma-buf-Use-seqlock_t-instread-disabling-preemption.patch b/debian/patches-rt/dma-buf-Use-seqlock_t-instread-disabling-preemption.patch new file mode 100644 index 000000000000..f15661c8f6ea --- /dev/null +++ b/debian/patches-rt/dma-buf-Use-seqlock_t-instread-disabling-preemption.patch @@ -0,0 +1,269 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 14 Aug 2019 16:38:43 +0200 +Subject: [PATCH] dma-buf: Use seqlock_t instread disabling preemption +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +"dma reservation" disables preemption while acquiring the write access +for "seqcount" and then may acquire a spinlock_t. + +Replace the seqcount with a seqlock_t which provides seqcount like +semantic and lock for writer. + +Link: https://lkml.kernel.org/r/f410b429-db86-f81c-7c67-f563fa808b62@free.fr +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/dma-buf/dma-buf.c | 8 ++-- + drivers/dma-buf/reservation.c | 40 ++++++++--------------- + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 6 +-- + drivers/gpu/drm/i915/i915_gem.c | 10 ++--- + include/linux/reservation.h | 4 +- + 5 files changed, 28 insertions(+), 40 deletions(-) + +--- a/drivers/dma-buf/dma-buf.c ++++ b/drivers/dma-buf/dma-buf.c +@@ -168,7 +168,7 @@ static __poll_t dma_buf_poll(struct file + return 0; + + retry: +- seq = read_seqcount_begin(&resv->seq); ++ seq = read_seqbegin(&resv->seq); + rcu_read_lock(); + + fobj = rcu_dereference(resv->fence); +@@ -177,7 +177,7 @@ static __poll_t dma_buf_poll(struct file + else + shared_count = 0; + fence_excl = rcu_dereference(resv->fence_excl); +- if (read_seqcount_retry(&resv->seq, seq)) { ++ if (read_seqretry(&resv->seq, seq)) { + rcu_read_unlock(); + goto retry; + } +@@ -1034,12 +1034,12 @@ static int dma_buf_debug_show(struct seq + + robj = buf_obj->resv; + while (true) { +- seq = read_seqcount_begin(&robj->seq); ++ seq = read_seqbegin(&robj->seq); + rcu_read_lock(); + fobj = rcu_dereference(robj->fence); + shared_count = fobj ? fobj->shared_count : 0; + fence = rcu_dereference(robj->fence_excl); +- if (!read_seqcount_retry(&robj->seq, seq)) ++ if (!read_seqretry(&robj->seq, seq)) + break; + rcu_read_unlock(); + } +--- a/drivers/dma-buf/reservation.c ++++ b/drivers/dma-buf/reservation.c +@@ -110,15 +110,13 @@ int reservation_object_reserve_shared(st + new->shared_count = j; + new->shared_max = max; + +- preempt_disable(); +- write_seqcount_begin(&obj->seq); ++ write_seqlock(&obj->seq); + /* + * RCU_INIT_POINTER can be used here, + * seqcount provides the necessary barriers + */ + RCU_INIT_POINTER(obj->fence, new); +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + if (!old) + return 0; +@@ -158,8 +156,7 @@ void reservation_object_add_shared_fence + fobj = reservation_object_get_list(obj); + count = fobj->shared_count; + +- preempt_disable(); +- write_seqcount_begin(&obj->seq); ++ write_seqlock(&obj->seq); + + for (i = 0; i < count; ++i) { + struct dma_fence *old_fence; +@@ -181,8 +178,7 @@ void reservation_object_add_shared_fence + /* pointer update must be visible before we extend the shared_count */ + smp_store_mb(fobj->shared_count, count); + +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + } + EXPORT_SYMBOL(reservation_object_add_shared_fence); + +@@ -209,14 +205,11 @@ void reservation_object_add_excl_fence(s + if (fence) + dma_fence_get(fence); + +- preempt_disable(); +- write_seqcount_begin(&obj->seq); +- /* write_seqcount_begin provides the necessary memory barrier */ ++ write_seqlock(&obj->seq); + RCU_INIT_POINTER(obj->fence_excl, fence); + if (old) + old->shared_count = 0; +- write_seqcount_end(&obj->seq); +- preempt_enable(); ++ write_sequnlock(&obj->seq); + + /* inplace update, no shared fences */ + while (i--) +@@ -298,13 +291,10 @@ int reservation_object_copy_fences(struc + src_list = reservation_object_get_list(dst); + old = reservation_object_get_excl(dst); + +- preempt_disable(); +- write_seqcount_begin(&dst->seq); +- /* write_seqcount_begin provides the necessary memory barrier */ ++ write_seqlock(&dst->seq); + RCU_INIT_POINTER(dst->fence_excl, new); + RCU_INIT_POINTER(dst->fence, dst_list); +- write_seqcount_end(&dst->seq); +- preempt_enable(); ++ write_sequnlock(&dst->seq); + + if (src_list) + kfree_rcu(src_list, rcu); +@@ -345,7 +335,7 @@ int reservation_object_get_fences_rcu(st + shared_count = i = 0; + + rcu_read_lock(); +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + + fence_excl = rcu_dereference(obj->fence_excl); + if (fence_excl && !dma_fence_get_rcu(fence_excl)) +@@ -394,7 +384,7 @@ int reservation_object_get_fences_rcu(st + } + } + +- if (i != shared_count || read_seqcount_retry(&obj->seq, seq)) { ++ if (i != shared_count || read_seqretry(&obj->seq, seq)) { + while (i--) + dma_fence_put(shared[i]); + dma_fence_put(fence_excl); +@@ -443,7 +433,7 @@ long reservation_object_wait_timeout_rcu + + retry: + shared_count = 0; +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + rcu_read_lock(); + i = -1; + +@@ -490,7 +480,7 @@ long reservation_object_wait_timeout_rcu + + rcu_read_unlock(); + if (fence) { +- if (read_seqcount_retry(&obj->seq, seq)) { ++ if (read_seqretry(&obj->seq, seq)) { + dma_fence_put(fence); + goto retry; + } +@@ -546,7 +536,7 @@ bool reservation_object_test_signaled_rc + retry: + ret = true; + shared_count = 0; +- seq = read_seqcount_begin(&obj->seq); ++ seq = read_seqbegin(&obj->seq); + + if (test_all) { + unsigned i; +@@ -567,7 +557,7 @@ bool reservation_object_test_signaled_rc + break; + } + +- if (read_seqcount_retry(&obj->seq, seq)) ++ if (read_seqretry(&obj->seq, seq)) + goto retry; + } + +@@ -580,7 +570,7 @@ bool reservation_object_test_signaled_rc + if (ret < 0) + goto retry; + +- if (read_seqcount_retry(&obj->seq, seq)) ++ if (read_seqretry(&obj->seq, seq)) + goto retry; + } + } +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +@@ -250,11 +250,9 @@ static int amdgpu_amdkfd_remove_eviction + new->shared_count = k; + + /* Install the new fence list, seqcount provides the barriers */ +- preempt_disable(); +- write_seqcount_begin(&resv->seq); ++ write_seqlock(&resv->seq); + RCU_INIT_POINTER(resv->fence, new); +- write_seqcount_end(&resv->seq); +- preempt_enable(); ++ write_sequnlock(&resv->seq); + + /* Drop the references to the removed fences or move them to ef_list */ + for (i = j, k = 0; i < old->shared_count; ++i) { +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -449,7 +449,7 @@ i915_gem_object_wait_reservation(struct + unsigned int flags, + long timeout) + { +- unsigned int seq = __read_seqcount_begin(&resv->seq); ++ unsigned int seq = read_seqbegin(&resv->seq); + struct dma_fence *excl; + bool prune_fences = false; + +@@ -500,9 +500,9 @@ i915_gem_object_wait_reservation(struct + * signaled and that the reservation object has not been changed (i.e. + * no new fences have been added). + */ +- if (prune_fences && !__read_seqcount_retry(&resv->seq, seq)) { ++ if (prune_fences && !read_seqretry(&resv->seq, seq)) { + if (reservation_object_trylock(resv)) { +- if (!__read_seqcount_retry(&resv->seq, seq)) ++ if (!read_seqretry(&resv->seq, seq)) + reservation_object_add_excl_fence(resv, NULL); + reservation_object_unlock(resv); + } +@@ -3943,7 +3943,7 @@ i915_gem_busy_ioctl(struct drm_device *d + * + */ + retry: +- seq = raw_read_seqcount(&obj->resv->seq); ++ seq = read_seqbegin(&obj->resv->seq); + + /* Translate the exclusive fence to the READ *and* WRITE engine */ + args->busy = busy_check_writer(rcu_dereference(obj->resv->fence_excl)); +@@ -3961,7 +3961,7 @@ i915_gem_busy_ioctl(struct drm_device *d + } + } + +- if (args->busy && read_seqcount_retry(&obj->resv->seq, seq)) ++ if (args->busy && read_seqretry(&obj->resv->seq, seq)) + goto retry; + + err = 0; +--- a/include/linux/reservation.h ++++ b/include/linux/reservation.h +@@ -71,7 +71,7 @@ struct reservation_object_list { + */ + struct reservation_object { + struct ww_mutex lock; +- seqcount_t seq; ++ seqlock_t seq; + + struct dma_fence __rcu *fence_excl; + struct reservation_object_list __rcu *fence; +@@ -90,7 +90,7 @@ reservation_object_init(struct reservati + { + ww_mutex_init(&obj->lock, &reservation_ww_class); + +- __seqcount_init(&obj->seq, reservation_seqcount_string, &reservation_seqcount_class); ++ seqlock_init(&obj->seq); + RCU_INIT_POINTER(obj->fence, NULL); + RCU_INIT_POINTER(obj->fence_excl, NULL); + } diff --git a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch index 95dfd0c1cf5f..df1ddedb5326 100644 --- a/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ b/debian/patches-rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 31 Mar 2016 04:08:28 +0200 Subject: [PATCH] drivers/block/zram: Replace bit spinlocks with rtmutex for -rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz They're nondeterministic, and lead to ___might_sleep() splats in -rt. OTOH, they're a lot less wasteful than an rtmutex per page. diff --git a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch b/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch index f32227b9ae08..41716d5c6533 100644 --- a/debian/patches-rt/drivers-tty-fix-omap-lock-crap.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/drivers-tty-pl011-irq-disable-madness.patch b/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch index cf8f7a7e7250..de383d749a6d 100644 --- a/debian/patches-rt/drivers-tty-pl011-irq-disable-madness.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch index 687e74fe9061..436a0635bc85 100644 --- a/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch +++ b/debian/patches-rt/drivers-zram-Don-t-disable-preemption-in-zcomp_strea.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Thu, 20 Oct 2016 11:15:22 +0200 Subject: [PATCH] drivers/zram: Don't disable preemption in zcomp_stream_get/put() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In v4.7, the driver switched to percpu compression streams, disabling preemption via get/put_cpu_ptr(). Use a per-zcomp_strm lock here. We diff --git a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch index eabf6e19d065..351ce3a2fac3 100644 --- a/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch +++ b/debian/patches-rt/drm-i915-Don-t-disable-interrupts-independently-of-t.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 10 Apr 2019 11:01:37 +0200 Subject: [PATCH] drm/i915: Don't disable interrupts independently of the lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The locks (timeline->lock and rq->lock) need to be taken with disabled interrupts. This is done in __retire_engine_request() by disabling the diff --git a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch index 25859565d6b4..d040f50f30b1 100644 --- a/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch +++ b/debian/patches-rt/drm-i915-disable-tracing-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 09:52:20 +0100 Subject: [PATCH] drm/i915: disable tracing on -RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Luca Abeni reported this: | BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 diff --git a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch index 4440eae99dd5..1e0a616d16a9 100644 --- a/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ b/debian/patches-rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 19 Dec 2018 10:47:02 +0100 Subject: [PATCH] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with NOTRACE -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The order of the header files is important. If this header file is included after tracepoint.h was included then the NOTRACE here becomes a diff --git a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch b/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch index 22f55a09bd37..c9e1473a8ad9 100644 --- a/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch +++ b/debian/patches-rt/drmi915_Use_local_lockunlock_irq()_in_intel_pipe_update_startend().patch @@ -1,7 +1,7 @@ Subject: drm,i915: Use local_lock/unlock_irq() in intel_pipe_update_start/end() From: Mike Galbraith Date: Sat, 27 Feb 2016 09:01:42 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz [ 8.014039] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:918 diff --git a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch index 0a7a0c02f93e..27f78b75277f 100644 --- a/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch +++ b/debian/patches-rt/drmradeoni915_Use_preempt_disableenable_rt()_where_recommended.patch @@ -1,7 +1,7 @@ Subject: drm,radeon,i915: Use preempt_disable/enable_rt() where recommended From: Mike Galbraith Date: Sat, 27 Feb 2016 08:09:11 +0100 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz DRM folks identified the spots, so use them. diff --git a/debian/patches-rt/efi-Allow-efi-runtime.patch b/debian/patches-rt/efi-Allow-efi-runtime.patch index a066773ba219..08296348ae36 100644 --- a/debian/patches-rt/efi-Allow-efi-runtime.patch +++ b/debian/patches-rt/efi-Allow-efi-runtime.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:06:10 +0200 Subject: [PATCH] efi: Allow efi=runtime -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In case the option "efi=noruntime" is default at built-time, the user could overwrite its sate by `efi=runtime' and allow it again. diff --git a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch index 6f0abe735351..bccd6b518036 100644 --- a/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch +++ b/debian/patches-rt/efi-Disable-runtime-services-on-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 26 Jul 2018 15:03:16 +0200 Subject: [PATCH] efi: Disable runtime services on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Based on meassurements the EFI functions get_variable / get_next_variable take up to 2us which looks okay. diff --git a/debian/patches-rt/epoll-use-get-cpu-light.patch b/debian/patches-rt/epoll-use-get-cpu-light.patch index 9ae66f90ec62..aeb3cb34e689 100644 --- a/debian/patches-rt/epoll-use-get-cpu-light.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/fs-aio-simple-simple-work.patch b/debian/patches-rt/fs-aio-simple-simple-work.patch index a5ca639b3103..88658be6ee8c 100644 --- a/debian/patches-rt/fs-aio-simple-simple-work.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch index aef4fc92902a..4febf10ce5dd 100644 --- a/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch +++ b/debian/patches-rt/fs-dcache-bring-back-explicit-INIT_HLIST_BL_HEAD-in.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 13 Sep 2017 12:32:34 +0200 Subject: [PATCH] fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However diff --git a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch index e3cf0e934627..0acbcb595ff8 100644 --- a/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ b/debian/patches-rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 20 Oct 2017 11:29:53 +0200 Subject: [PATCH] fs/dcache: disable preemption on i_dir_seq's write side -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz i_dir_seq is an opencoded seqcounter. Based on the code it looks like we could have two writers in parallel despite the fact that the d_lock is diff --git a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch b/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch index 03a0c73c3e2d..5bffa97fa413 100644 --- a/debian/patches-rt/fs-dcache-use-cpu-chill-in-trylock-loops.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch index 9e49e32f0ac0..488113109912 100644 --- a/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ b/debian/patches-rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 14:35:49 +0200 Subject: [PATCH] fs/dcache: use swait_queue instead of waitqueue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz __d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() which disables preemption. As a workaround convert it to swait. @@ -124,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior return -ENOENT; --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -448,7 +448,7 @@ static +@@ -441,7 +441,7 @@ static void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry) { struct qstr filename = QSTR_INIT(entry->name, entry->len); @@ -133,7 +133,7 @@ Signed-off-by: Sebastian Andrzej Siewior struct dentry *dentry; struct dentry *alias; struct inode *dir = d_inode(parent); -@@ -1570,7 +1570,7 @@ int nfs_atomic_open(struct inode *dir, s +@@ -1492,7 +1492,7 @@ int nfs_atomic_open(struct inode *dir, s struct file *file, unsigned open_flags, umode_t mode) { @@ -164,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior spin_lock(&dentry->d_lock); --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -1874,7 +1874,7 @@ bool proc_fill_cache(struct file *file, +@@ -1892,7 +1892,7 @@ bool proc_fill_cache(struct file *file, child = d_hash_and_lookup(dir, &qname); if (!child) { @@ -175,7 +175,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto end_instantiate; --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c -@@ -694,7 +694,7 @@ static bool proc_sys_fill_cache(struct f +@@ -698,7 +698,7 @@ static bool proc_sys_fill_cache(struct f child = d_lookup(dir, &qname); if (!child) { diff --git a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch b/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch index 23810ab9d1af..8588e968c520 100644 --- a/debian/patches-rt/fs-jbd-replace-bh_state-lock.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz bit_spin_locks break under RT. diff --git a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch index 116866c8d80f..20ed85e0e0a9 100644 --- a/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch +++ b/debian/patches-rt/fs-nfs-turn-rmdir_sem-into-a-semaphore.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 15 Sep 2016 10:51:27 +0200 Subject: [PATCH] fs/nfs: turn rmdir_sem into a semaphore -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The RW semaphore had a reader side which used the _non_owner version because it most likely took the reader lock in one thread and released it @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c -@@ -1890,7 +1890,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1812,7 +1812,11 @@ int nfs_rmdir(struct inode *dir, struct trace_nfs_rmdir_enter(dir, dentry); if (d_really_is_positive(dentry)) { @@ -34,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); /* Ensure the VFS deletes this inode */ switch (error) { -@@ -1900,7 +1904,11 @@ int nfs_rmdir(struct inode *dir, struct +@@ -1822,7 +1826,11 @@ int nfs_rmdir(struct inode *dir, struct case -ENOENT: nfs_dentry_handle_enoent(dentry); } @@ -48,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior trace_nfs_rmdir_exit(dir, dentry, error); --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c -@@ -2089,7 +2089,11 @@ static void init_once(void *foo) +@@ -2090,7 +2090,11 @@ static void init_once(void *foo) atomic_long_set(&nfsi->nrequests, 0); atomic_long_set(&nfsi->commit_info.ncommit, 0); atomic_set(&nfsi->commit_info.rpcs_out, 0); diff --git a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch b/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch index 74f23ccd9983..4c7345abbe96 100644 --- a/debian/patches-rt/fs-replace-bh_uptodate_lock-for-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch index c5937c5ae29d..a8beb0a080cd 100644 --- a/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch +++ b/debian/patches-rt/fscache-initialize-cookie-hash-table-raw-spinlocks.patch @@ -1,7 +1,7 @@ From: Clark Williams Date: Tue, 3 Jul 2018 13:34:30 -0500 Subject: [PATCH] fscache: initialize cookie hash table raw spinlocks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The fscache cookie mechanism uses a hash table of hlist_bl_head structures. The PREEMPT_RT patcheset adds a raw spinlock to this structure and so on PREEMPT_RT diff --git a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch index 75ea8bd18bbb..d2eb966dd474 100644 --- a/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch +++ b/debian/patches-rt/ftrace-Fix-trace-header-alignment.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Sun, 16 Oct 2016 05:08:30 +0200 Subject: [PATCH] ftrace: Fix trace header alignment -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Line up helper arrows to the right column. diff --git a/debian/patches-rt/ftrace-migrate-disable-tracing.patch b/debian/patches-rt/ftrace-migrate-disable-tracing.patch index a381e4e86cd2..7b481300d0f3 100644 --- a/debian/patches-rt/ftrace-migrate-disable-tracing.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner --- diff --git a/debian/patches-rt/futex-Delay-deallocation-of-pi_state.patch b/debian/patches-rt/futex-Delay-deallocation-of-pi_state.patch index cf2ba612040f..dfb695aafa10 100644 --- a/debian/patches-rt/futex-Delay-deallocation-of-pi_state.patch +++ b/debian/patches-rt/futex-Delay-deallocation-of-pi_state.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Wed, 26 Jun 2019 13:35:36 +0200 Subject: [PATCH] futex: Delay deallocation of pi_state -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz On -RT we can't invoke kfree() in a non-preemptible context. diff --git a/debian/patches-rt/futex-Make-the-futex_hash_bucket-lock-raw.patch b/debian/patches-rt/futex-Make-the-futex_hash_bucket-lock-raw.patch index 93b023d46e3b..e6692192bd06 100644 --- a/debian/patches-rt/futex-Make-the-futex_hash_bucket-lock-raw.patch +++ b/debian/patches-rt/futex-Make-the-futex_hash_bucket-lock-raw.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 26 Jun 2019 11:59:44 +0200 Subject: [PATCH] futex: Make the futex_hash_bucket lock raw -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since commit 1a1fb985f2e2b ("futex: Handle early deadlock return correctly") we can deadlock while we attempt to acquire the HB lock if diff --git a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch b/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch index 0297124ec097..6fa90ef620f2 100644 --- a/debian/patches-rt/genirq-disable-irqpoll-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Creates long latencies for no value diff --git a/debian/patches-rt/genirq-force-threading.patch b/debian/patches-rt/genirq-force-threading.patch index dd6d5d57b35f..1877134d689f 100644 --- a/debian/patches-rt/genirq-force-threading.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Force threaded_irqs and optimize the code (force_irqthreads) in regard to this. diff --git a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch index e58d81191f8b..27c52c473c44 100644 --- a/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ b/debian/patches-rt/genirq-update-irq_set_irqchip_state-documentation.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 11 Feb 2016 11:54:00 -0600 Subject: genirq: update irq_set_irqchip_state documentation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -15,7 +15,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -2636,7 +2636,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) +@@ -2684,7 +2684,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state) * This call sets the internal irqchip state of an interrupt, * depending on the value of @which. * diff --git a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch index c91df1f64865..8f501a0797da 100644 --- a/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch +++ b/debian/patches-rt/hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 18:31:00 +0200 Subject: [PATCH] hotplug: duct-tape RT-rwlock usage for non-RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This type is only available on -RT. We need to craft something for non-RT. Since the only migrate_disable() user is -RT only, there is no diff --git a/debian/patches-rt/hotplug-light-get-online-cpus.patch b/debian/patches-rt/hotplug-light-get-online-cpus.patch index d516a47cfe38..715b3c5fecb9 100644 --- a/debian/patches-rt/hotplug-light-get-online-cpus.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/hrtimer-Introduce-expiry-spin-lock.patch b/debian/patches-rt/hrtimer-Introduce-expiry-spin-lock.patch index ad9478dc6c9b..08e0bef1f9d1 100644 --- a/debian/patches-rt/hrtimer-Introduce-expiry-spin-lock.patch +++ b/debian/patches-rt/hrtimer-Introduce-expiry-spin-lock.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Mon, 27 May 2019 16:54:04 +0200 Subject: [PATCH] hrtimer: Introduce expiry spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When deleting a hrtimer, it is possible, that the CPU has to spin, because the hrtimer is marked as running. This is done via cpu_relax() and repeating trying to diff --git a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch index e7322219c947..8a12b1a60f27 100644 --- a/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch +++ b/debian/patches-rt/hrtimer-by-timers-by-default-into-the-softirq-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 3 Jul 2009 08:44:31 -0500 Subject: hrtimer: by timers by default into the softirq context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz We can't have hrtimers callbacks running in hardirq context on RT. Therefore the timers are deferred to the softirq context by default. @@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior timer->function = perf_mux_hrtimer_handler; } -@@ -9488,7 +9488,7 @@ static void perf_swevent_init_hrtimer(st +@@ -9511,7 +9511,7 @@ static void perf_swevent_init_hrtimer(st if (!is_sampling_event(event)) return; @@ -103,7 +103,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4945,9 +4945,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4999,9 +4999,9 @@ void init_cfs_bandwidth(struct cfs_bandw cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); diff --git a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch index dd5f959477fc..e4ec21ccb0cf 100644 --- a/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch +++ b/debian/patches-rt/hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 3 Jul 2018 11:25:41 +0200 Subject: [PATCH v2] hrtimer: consolidate hrtimer_init() + hrtimer_init_sleeper() calls -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz hrtimer_init_sleeper() calls require a prior initialisation of the hrtimer object with hrtimer_init(). Lets make the initialisation of diff --git a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch index f82416a5dfc3..acd445846dff 100644 --- a/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +++ b/debian/patches-rt/hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 6 Dec 2018 10:15:13 +0100 Subject: [PATCH] hrtimer: move state change before hrtimer_cancel in do_nanosleep() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There is a small window between setting t->task to NULL and waking the task up (which would set TASK_RUNNING). So the timer would fire, run and diff --git a/debian/patches-rt/i2c-exynos5-Remove-IRQF_ONESHOT.patch b/debian/patches-rt/i2c-exynos5-Remove-IRQF_ONESHOT.patch new file mode 100644 index 000000000000..2d090313328f --- /dev/null +++ b/debian/patches-rt/i2c-exynos5-Remove-IRQF_ONESHOT.patch @@ -0,0 +1,39 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 13 Aug 2019 12:30:12 +0200 +Subject: [PATCH] i2c: exynos5: Remove IRQF_ONESHOT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ +is masked while the primary is handler is invoked independently of +IRQF_ONESHOT. +With IRQF_ONESHOT the core code will not force-thread the interrupt and +this is probably not intended. I *assume* that the original author copied +the IRQ registration from another driver which passed a primary and +secondary handler and removed the secondary handler but keeping the +ONESHOT flag. + +Remove IRQF_ONESHOT. + +Reported-by: Benjamin Rouxel +Tested-by: Benjamin Rouxel +Cc: Kukjin Kim +Cc: Krzysztof Kozlowski +Cc: linux-samsung-soc@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/i2c/busses/i2c-exynos5.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/i2c/busses/i2c-exynos5.c ++++ b/drivers/i2c/busses/i2c-exynos5.c +@@ -791,9 +791,7 @@ static int exynos5_i2c_probe(struct plat + } + + ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq, +- IRQF_NO_SUSPEND | IRQF_ONESHOT, +- dev_name(&pdev->dev), i2c); +- ++ IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c); + if (ret != 0) { + dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", i2c->irq); + goto err_clk; diff --git a/debian/patches-rt/i2c-hix5hd2-Remove-IRQF_ONESHOT.patch b/debian/patches-rt/i2c-hix5hd2-Remove-IRQF_ONESHOT.patch new file mode 100644 index 000000000000..646f8aebdf72 --- /dev/null +++ b/debian/patches-rt/i2c-hix5hd2-Remove-IRQF_ONESHOT.patch @@ -0,0 +1,33 @@ +From: Sebastian Andrzej Siewior +Date: Tue, 13 Aug 2019 12:30:37 +0200 +Subject: [PATCH] i2c: hix5hd2: Remove IRQF_ONESHOT +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +The drivers sets IRQF_ONESHOT and passes only a primary handler. The IRQ +is masked while the primary is handler is invoked independently of +IRQF_ONESHOT. +With IRQF_ONESHOT the core code will not force-thread the interrupt and +this is probably not intended. I *assume* that the original author copied +the IRQ registration from another driver which passed a primary and +secondary handler and removed the secondary handler but keeping the +ONESHOT flag. + +Remove IRQF_ONESHOT. + +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/i2c/busses/i2c-hix5hd2.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/i2c/busses/i2c-hix5hd2.c ++++ b/drivers/i2c/busses/i2c-hix5hd2.c +@@ -445,8 +445,7 @@ static int hix5hd2_i2c_probe(struct plat + hix5hd2_i2c_init(priv); + + ret = devm_request_irq(&pdev->dev, irq, hix5hd2_i2c_irq, +- IRQF_NO_SUSPEND | IRQF_ONESHOT, +- dev_name(&pdev->dev), priv); ++ IRQF_NO_SUSPEND, dev_name(&pdev->dev), priv); + if (ret != 0) { + dev_err(&pdev->dev, "cannot request HS-I2C IRQ %d\n", irq); + goto err_clk; diff --git a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch b/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch index e7ebb59a69b5..3348fc868cd5 100644 --- a/debian/patches-rt/irqwork-push_most_work_into_softirq_context.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/jump-label-rt.patch b/debian/patches-rt/jump-label-rt.patch index 74f63c2b3cd5..a89559fcccd3 100644 --- a/debian/patches-rt/jump-label-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Some architectures are using stop_machine() while switching the opcode which leads to latency spikes. diff --git a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch b/debian/patches-rt/kconfig-disable-a-few-options-rt.patch index 3a2cb35599f8..1655e61ccfdc 100644 --- a/debian/patches-rt/kconfig-disable-a-few-options-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Disable stuff which is known to have issues on RT diff --git a/debian/patches-rt/kconfig-preempt-rt-full.patch b/debian/patches-rt/kconfig-preempt-rt-full.patch index 6bbb5a64e430..3da78cfa51d7 100644 --- a/debian/patches-rt/kconfig-preempt-rt-full.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Introduce the final symbol for PREEMPT_RT_FULL. diff --git a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch index 3847d2c88f46..9db2963c8d91 100644 --- a/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch +++ b/debian/patches-rt/kernel-sched-Provide-a-pointer-to-the-valid-CPU-mask.patch @@ -4,7 +4,7 @@ Subject: [PATCH] kernel: sched: Provide a pointer to the valid CPU mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In commit 4b53a3412d66 ("sched/core: Remove the tsk_nr_cpus_allowed() wrapper") the tsk_nr_cpus_allowed() wrapper was removed. There was not @@ -260,7 +260,7 @@ Signed-off-by: Sebastian Andrzej Siewior #ifdef CONFIG_PREEMPT_RCU int rcu_read_lock_nesting; -@@ -1402,7 +1403,7 @@ extern struct pid *cad_pid; +@@ -1410,7 +1411,7 @@ extern struct pid *cad_pid; #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ #define PF_MEMSTALL 0x01000000 /* Stalled due to lack of memory */ #define PF_UMH 0x02000000 /* I'm an Usermodehelper process */ @@ -536,7 +536,7 @@ Signed-off-by: Sebastian Andrzej Siewior !task_on_rq_queued(task))) { --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1621,7 +1621,7 @@ static void task_numa_compare(struct tas +@@ -1653,7 +1653,7 @@ static void task_numa_compare(struct tas * be incurred if the tasks were swapped. */ /* Skip this swap candidate if cannot move to the source cpu */ @@ -545,7 +545,7 @@ Signed-off-by: Sebastian Andrzej Siewior goto unlock; /* -@@ -1718,7 +1718,7 @@ static void task_numa_find_cpu(struct ta +@@ -1751,7 +1751,7 @@ static void task_numa_find_cpu(struct ta for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { /* Skip this CPU if the source task cannot migrate */ @@ -554,7 +554,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; env->dst_cpu = cpu; -@@ -5831,7 +5831,7 @@ find_idlest_group(struct sched_domain *s +@@ -5885,7 +5885,7 @@ find_idlest_group(struct sched_domain *s /* Skip over this group if it has no CPUs allowed */ if (!cpumask_intersects(sched_group_span(group), @@ -563,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; local_group = cpumask_test_cpu(this_cpu, -@@ -5963,7 +5963,7 @@ find_idlest_group_cpu(struct sched_group +@@ -6017,7 +6017,7 @@ find_idlest_group_cpu(struct sched_group return cpumask_first(sched_group_span(group)); /* Traverse only the allowed CPUs */ @@ -572,7 +572,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (available_idle_cpu(i)) { struct rq *rq = cpu_rq(i); struct cpuidle_state *idle = idle_get_state(rq); -@@ -6003,7 +6003,7 @@ static inline int find_idlest_cpu(struct +@@ -6057,7 +6057,7 @@ static inline int find_idlest_cpu(struct { int new_cpu = cpu; @@ -581,7 +581,7 @@ Signed-off-by: Sebastian Andrzej Siewior return prev_cpu; /* -@@ -6120,7 +6120,7 @@ static int select_idle_core(struct task_ +@@ -6174,7 +6174,7 @@ static int select_idle_core(struct task_ if (!test_idle_cores(target, false)) return -1; @@ -590,7 +590,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_cpu_wrap(core, cpus, target) { bool idle = true; -@@ -6154,7 +6154,7 @@ static int select_idle_smt(struct task_s +@@ -6208,7 +6208,7 @@ static int select_idle_smt(struct task_s return -1; for_each_cpu(cpu, cpu_smt_mask(target)) { @@ -599,7 +599,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) return cpu; -@@ -6217,7 +6217,7 @@ static int select_idle_cpu(struct task_s +@@ -6271,7 +6271,7 @@ static int select_idle_cpu(struct task_s for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { if (!--nr) return -1; @@ -608,7 +608,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; if (available_idle_cpu(cpu)) break; -@@ -6254,7 +6254,7 @@ static int select_idle_sibling(struct ta +@@ -6308,7 +6308,7 @@ static int select_idle_sibling(struct ta recent_used_cpu != target && cpus_share_cache(recent_used_cpu, target) && available_idle_cpu(recent_used_cpu) && @@ -617,7 +617,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* * Replace recent_used_cpu with prev as it is a potential * candidate for the next wake: -@@ -6600,7 +6600,7 @@ static int find_energy_efficient_cpu(str +@@ -6654,7 +6654,7 @@ static int find_energy_efficient_cpu(str int max_spare_cap_cpu = -1; for_each_cpu_and(cpu, perf_domain_span(pd), sched_domain_span(sd)) { @@ -626,7 +626,7 @@ Signed-off-by: Sebastian Andrzej Siewior continue; /* Skip CPUs that will be overutilized. */ -@@ -6689,7 +6689,7 @@ select_task_rq_fair(struct task_struct * +@@ -6743,7 +6743,7 @@ select_task_rq_fair(struct task_struct * } want_affine = !wake_wide(p) && !wake_cap(p, cpu, prev_cpu) && @@ -635,7 +635,7 @@ Signed-off-by: Sebastian Andrzej Siewior } rcu_read_lock(); -@@ -7445,14 +7445,14 @@ int can_migrate_task(struct task_struct +@@ -7499,14 +7499,14 @@ int can_migrate_task(struct task_struct /* * We do not migrate tasks that are: * 1) throttled_lb_pair, or @@ -652,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior int cpu; schedstat_inc(p->se.statistics.nr_failed_migrations_affine); -@@ -7472,7 +7472,7 @@ int can_migrate_task(struct task_struct +@@ -7526,7 +7526,7 @@ int can_migrate_task(struct task_struct /* Prevent to re-select dst_cpu via env's CPUs: */ for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { @@ -661,7 +661,7 @@ Signed-off-by: Sebastian Andrzej Siewior env->flags |= LBF_DST_PINNED; env->new_dst_cpu = cpu; break; -@@ -8099,7 +8099,7 @@ static inline int check_misfit_status(st +@@ -8153,7 +8153,7 @@ static inline int check_misfit_status(st /* * Group imbalance indicates (and tries to solve) the problem where balancing @@ -670,7 +670,7 @@ Signed-off-by: Sebastian Andrzej Siewior * * Imagine a situation of two groups of 4 CPUs each and 4 tasks each with a * cpumask covering 1 CPU of the first group and 3 CPUs of the second group. -@@ -8768,7 +8768,7 @@ static struct sched_group *find_busiest_ +@@ -8822,7 +8822,7 @@ static struct sched_group *find_busiest_ /* * If the busiest group is imbalanced the below checks don't * work because they assume all things are equal, which typically @@ -679,7 +679,7 @@ Signed-off-by: Sebastian Andrzej Siewior */ if (busiest->group_type == group_imbalanced) goto force_balance; -@@ -9210,7 +9210,7 @@ static int load_balance(int this_cpu, st +@@ -9264,7 +9264,7 @@ static int load_balance(int this_cpu, st * if the curr task on busiest CPU can't be * moved to this_cpu: */ diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index fc22eeea2c12..2c2a5e586def 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 21 Nov 2016 19:31:08 +0100 Subject: [PATCH] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if @@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior #include #include #include -@@ -747,6 +748,15 @@ void __put_task_struct(struct task_struc +@@ -742,6 +743,15 @@ void __put_task_struct(struct task_struc WARN_ON(refcount_read(&tsk->usage)); WARN_ON(tsk == current); diff --git a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch index 509dfc7ad52c..2464ed6b1e1b 100644 --- a/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch +++ b/debian/patches-rt/kmemleak-Turn-kmemleak_lock-to-raw-spinlock-on-RT.patch @@ -1,7 +1,7 @@ From: He Zhe Date: Wed, 19 Dec 2018 16:30:57 +0100 Subject: [PATCH] kmemleak: Turn kmemleak_lock to raw spinlock on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz kmemleak_lock, as a rwlock on RT, can possibly be held in atomic context and causes the follow BUG. diff --git a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch index 1dcebb988900..1420b6736c8a 100644 --- a/debian/patches-rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz as it triggers: |CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 diff --git a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch index d6e1fb9e5d82..0dc9f08cdc7b 100644 --- a/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch +++ b/debian/patches-rt/list_bl-fixup-bogus-lockdep-warning.patch @@ -1,7 +1,7 @@ From: Josh Cartwright Date: Thu, 31 Mar 2016 00:04:25 -0500 Subject: [PATCH] list_bl: fixup bogus lockdep warning -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz At first glance, the use of 'static inline' seems appropriate for INIT_HLIST_BL_HEAD(). diff --git a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch b/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch index cb33707f377e..e5f2d64631ca 100644 --- a/debian/patches-rt/list_bl.h-make-list-head-locking-RT-safe.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/locallock-provide-get-put-_locked_ptr-variants.patch b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch index a9f191bbd04c..fe5d7a2eb5c8 100644 --- a/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch +++ b/debian/patches-rt/locallock-provide-get-put-_locked_ptr-variants.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:56 -0500 Subject: [PATCH] locallock: provide {get,put}_locked_ptr() variants -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Provide a set of locallocked accessors for pointers to per-CPU data; this is useful for dynamically-allocated per-CPU regions, for example. diff --git a/debian/patches-rt/localversion.patch b/debian/patches-rt/localversion.patch index 79f1c5f21ed7..a83cbcb319f5 100644 --- a/debian/patches-rt/localversion.patch +++ b/debian/patches-rt/localversion.patch @@ -1,7 +1,7 @@ Subject: Add localversion for -RT release From: Thomas Gleixner Date: Fri, 08 Jul 2011 20:25:16 +0200 -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner --- @@ -11,4 +11,4 @@ Signed-off-by: Thomas Gleixner --- /dev/null +++ b/localversion-rt @@ -0,0 +1 @@ -+-rt1 ++-rt3 diff --git a/debian/patches-rt/lockdep-disable-self-test.patch b/debian/patches-rt/lockdep-disable-self-test.patch index 608ec38a00cd..361641d74b35 100644 --- a/debian/patches-rt/lockdep-disable-self-test.patch +++ b/debian/patches-rt/lockdep-disable-self-test.patch @@ -4,7 +4,7 @@ Subject: [PATCH] lockdep: disable self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The self-test wasn't always 100% accurate for RT. We disabled a few tests which failed because they had a different semantic for RT. Some diff --git a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch b/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch index a7e7bb547b45..70f7c159e9f5 100644 --- a/debian/patches-rt/lockdep-no-softirq-accounting-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz teach lockdep that we don't really do softirqs on -RT. @@ -52,7 +52,7 @@ Signed-off-by: Thomas Gleixner defined(CONFIG_PREEMPT_TRACER) --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -4227,6 +4227,7 @@ static void check_flags(unsigned long fl +@@ -4244,6 +4244,7 @@ static void check_flags(unsigned long fl } } @@ -60,7 +60,7 @@ Signed-off-by: Thomas Gleixner /* * We dont accurately track softirq state in e.g. * hardirq contexts (such as on 4KSTACKS), so only -@@ -4241,6 +4242,7 @@ static void check_flags(unsigned long fl +@@ -4258,6 +4259,7 @@ static void check_flags(unsigned long fl DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); } } diff --git a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch index c33d0e30e7f0..125c74e349d6 100644 --- a/debian/patches-rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch b/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch index f215fee53404..c501af2f7746 100644 --- a/debian/patches-rt/lockdep-selftest-only-do-hardirq-context-test-for-raw-spinlock.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz From: Yong Zhang diff --git a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch index 734262630c0b..bfc2ed68c941 100644 --- a/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ b/debian/patches-rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 4 Aug 2017 17:40:42 +0200 Subject: [PATCH 1/2] locking: don't check for __LINUX_SPINLOCK_TYPES_H on -RT archs -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Upstream uses arch_spinlock_t within spinlock_t and requests that spinlock_types.h header file is included first. diff --git a/debian/patches-rt/locking-lockdep-Don-t-complain-about-incorrect-name-.patch b/debian/patches-rt/locking-lockdep-Don-t-complain-about-incorrect-name-.patch index 4ee609fa9474..f82000a222e7 100644 --- a/debian/patches-rt/locking-lockdep-Don-t-complain-about-incorrect-name-.patch +++ b/debian/patches-rt/locking-lockdep-Don-t-complain-about-incorrect-name-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 17 May 2019 23:22:34 +0200 Subject: [PATCH] locking/lockdep: Don't complain about incorrect name for no validate class -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz [ Upstream commit 978315462d3ea3cf6cfacd34c563ec1eb02a3aa5 ] diff --git a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch b/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch index f1405f220ecb..64f7bac129c9 100644 --- a/debian/patches-rt/locking-locktorture-Do-NOT-include-rwlock.h-directly.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch index fee6a50f951a..bfbb8d5eb829 100644 --- a/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch +++ b/debian/patches-rt/locking-rt-mutex-Flush-block-plug-on-__down_read.patch @@ -1,7 +1,7 @@ From: Scott Wood Date: Fri, 4 Jan 2019 15:33:21 -0500 Subject: [PATCH] locking/rt-mutex: Flush block plug on __down_read() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz __down_read() bypasses the rtmutex frontend to call rt_mutex_slowlock_locked() directly, and thus it needs to call diff --git a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch index 4ef80a2f9d90..879c966aa157 100644 --- a/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch +++ b/debian/patches-rt/locking-rt-mutex-fix-deadlock-in-device-mapper-block.patch @@ -1,7 +1,7 @@ From: Mikulas Patocka Date: Mon, 13 Nov 2017 12:56:53 -0500 Subject: [PATCH] locking/rt-mutex: fix deadlock in device mapper / block-IO -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When some block device driver creates a bio and submits it to another block device driver, the bio is added to current->bio_list (in order to diff --git a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch index 4f496311e543..6d6e11745b40 100644 --- a/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch +++ b/debian/patches-rt/locking-rtmutex-re-init-the-wait_lock-in-rt_mutex_in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 16 Nov 2017 16:48:48 +0100 Subject: [PATCH] locking/rtmutex: re-init the wait_lock in rt_mutex_init_proxy_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz We could provide a key-class for the lockdep (and fixup all callers) or move the init to all callers (like it was) in order to avoid lockdep diff --git a/debian/patches-rt/md-disable-bcache.patch b/debian/patches-rt/md-disable-bcache.patch index 127496bc394c..8b2b819adc91 100644 --- a/debian/patches-rt/md-disable-bcache.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz It uses anon semaphores |drivers/md/bcache/request.c: In function ‘cached_dev_write_complete’: diff --git a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch b/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch index bb5a0416457d..48741eb8a0be 100644 --- a/debian/patches-rt/md-raid5-percpu-handling-rt-aware.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/mips-disable-highmem-on-rt.patch b/debian/patches-rt/mips-disable-highmem-on-rt.patch index 262a364815b3..1a1f684c3f8a 100644 --- a/debian/patches-rt/mips-disable-highmem-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The current highmem handling on -RT is not compatible and needs fixups. diff --git a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch b/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch index a07f861abe68..7b8bdc945d65 100644 --- a/debian/patches-rt/mm-convert-swap-to-percpu-locked.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Replace global locks (get_cpu + local_irq_save) with "local_locks()". Currently there is one of for "rotate" and one for "swap". @@ -26,7 +26,7 @@ Signed-off-by: Thomas Gleixner #include struct notifier_block; -@@ -328,6 +329,7 @@ extern unsigned long nr_free_pagecache_p +@@ -329,6 +330,7 @@ extern unsigned long nr_free_pagecache_p /* linux/mm/swap.c */ @@ -36,7 +36,7 @@ Signed-off-by: Thomas Gleixner extern void lru_cache_add_file(struct page *page); --- a/mm/compaction.c +++ b/mm/compaction.c -@@ -2226,10 +2226,12 @@ compact_zone(struct compact_control *cc, +@@ -2229,10 +2229,12 @@ compact_zone(struct compact_control *cc, block_start_pfn(cc->migrate_pfn, cc->order); if (last_migrated_pfn < current_block_start) { diff --git a/debian/patches-rt/mm-disable-sloub-rt.patch b/debian/patches-rt/mm-disable-sloub-rt.patch index 3efcd2ccb9a5..5d526988d5fb 100644 --- a/debian/patches-rt/mm-disable-sloub-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. diff --git a/debian/patches-rt/mm-enable-slub.patch b/debian/patches-rt/mm-enable-slub.patch index 5f3133f741ba..717ebc58ec9a 100644 --- a/debian/patches-rt/mm-enable-slub.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Avoid the memory allocation in IRQ section diff --git a/debian/patches-rt/mm-make-vmstat-rt-aware.patch b/debian/patches-rt/mm-make-vmstat-rt-aware.patch index 51b1998fb612..2751838a9a91 100644 --- a/debian/patches-rt/mm-make-vmstat-rt-aware.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch index 919e6b7c56ce..aba99c66da4c 100644 --- a/debian/patches-rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The following trace is triggered when running ltp oom test cases: @@ -49,7 +49,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -2159,7 +2159,7 @@ static void drain_all_stock(struct mem_c +@@ -2167,7 +2167,7 @@ static void drain_all_stock(struct mem_c * as well as workers from this path always operate on the local * per-cpu data. CPU up doesn't touch memcg_stock at all. */ @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior for_each_online_cpu(cpu) { struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); struct mem_cgroup *memcg; -@@ -2179,7 +2179,7 @@ static void drain_all_stock(struct mem_c +@@ -2187,7 +2187,7 @@ static void drain_all_stock(struct mem_c } css_put(&memcg->css); } diff --git a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch b/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch index d9dabbcca989..87ad6c93437e 100644 --- a/debian/patches-rt/mm-memcontrol-do_not_disable_irq.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. @@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior /* Whether legacy memory+swap accounting is active */ static bool do_memsw_account(void) { -@@ -4967,12 +4970,12 @@ static int mem_cgroup_move_account(struc +@@ -4976,12 +4979,12 @@ static int mem_cgroup_move_account(struc ret = 0; @@ -45,7 +45,7 @@ Signed-off-by: Sebastian Andrzej Siewior out_unlock: unlock_page(page); out: -@@ -6086,10 +6089,10 @@ void mem_cgroup_commit_charge(struct pag +@@ -6095,10 +6098,10 @@ void mem_cgroup_commit_charge(struct pag commit_charge(page, memcg, lrucare); @@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (do_memsw_account() && PageSwapCache(page)) { swp_entry_t entry = { .val = page_private(page) }; -@@ -6158,7 +6161,7 @@ static void uncharge_batch(const struct +@@ -6167,7 +6170,7 @@ static void uncharge_batch(const struct memcg_oom_recover(ug->memcg); } @@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior __mod_memcg_state(ug->memcg, MEMCG_RSS, -ug->nr_anon); __mod_memcg_state(ug->memcg, MEMCG_CACHE, -ug->nr_file); __mod_memcg_state(ug->memcg, MEMCG_RSS_HUGE, -ug->nr_huge); -@@ -6166,7 +6169,7 @@ static void uncharge_batch(const struct +@@ -6175,7 +6178,7 @@ static void uncharge_batch(const struct __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); __this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, nr_pages); memcg_check_events(ug->memcg, ug->dummy_page); @@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior if (!mem_cgroup_is_root(ug->memcg)) css_put_many(&ug->memcg->css, nr_pages); -@@ -6329,10 +6332,10 @@ void mem_cgroup_migrate(struct page *old +@@ -6338,10 +6341,10 @@ void mem_cgroup_migrate(struct page *old commit_charge(newpage, memcg, false); @@ -89,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior } DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -6524,6 +6527,7 @@ void mem_cgroup_swapout(struct page *pag +@@ -6533,6 +6536,7 @@ void mem_cgroup_swapout(struct page *pag struct mem_cgroup *memcg, *swap_memcg; unsigned int nr_entries; unsigned short oldid; @@ -97,7 +97,7 @@ Signed-off-by: Sebastian Andrzej Siewior VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); -@@ -6569,13 +6573,17 @@ void mem_cgroup_swapout(struct page *pag +@@ -6578,13 +6582,17 @@ void mem_cgroup_swapout(struct page *pag * important here to have the interrupts disabled because it is the * only synchronisation we have for updating the per-CPU variables. */ diff --git a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch b/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch index b10cc35d6e35..f6a94a526f44 100644 --- a/debian/patches-rt/mm-page_alloc-rt-friendly-per-cpu-pages.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/mm-perform-lru_add_drain_all-remotely.patch b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch index 6940fc7e56a0..3fe420275d42 100644 --- a/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch +++ b/debian/patches-rt/mm-perform-lru_add_drain_all-remotely.patch @@ -1,7 +1,7 @@ From: Luiz Capitulino Date: Fri, 27 May 2016 15:03:28 +0200 Subject: [PATCH] mm: perform lru_add_drain_all() remotely -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz lru_add_drain_all() works by scheduling lru_add_drain_cpu() to run on all CPUs that have non-empty LRU pagevecs and then waiting for diff --git a/debian/patches-rt/mm-protect-activate-switch-mm.patch b/debian/patches-rt/mm-protect-activate-switch-mm.patch index 80266170d1a9..be92dbc7e839 100644 --- a/debian/patches-rt/mm-protect-activate-switch-mm.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/mm-rt-kmap-atomic-scheduling.patch b/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch index f882f9d16074..602dec75d69d 100644 --- a/debian/patches-rt/mm-rt-kmap-atomic-scheduling.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -248,7 +248,7 @@ Link: http://lkml.kernel.org/r/1311842631.5890.208.camel@twins /* task_struct member predeclarations (sorted alphabetically): */ struct audit_context; -@@ -1209,6 +1210,12 @@ struct task_struct { +@@ -1217,6 +1218,12 @@ struct task_struct { #ifdef CONFIG_PREEMPT_RT_BASE struct rcu_head put_rcu; #endif diff --git a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch b/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch index c1c023b632f7..9db07f375000 100644 --- a/debian/patches-rt/mm-scatterlist-dont-disable-irqs-on-RT.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz For -RT it is enough to keep pagefault disabled (which is currently handled by kmap_atomic()). @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner --- a/lib/scatterlist.c +++ b/lib/scatterlist.c -@@ -800,7 +800,7 @@ void sg_miter_stop(struct sg_mapping_ite +@@ -801,7 +801,7 @@ void sg_miter_stop(struct sg_mapping_ite flush_kernel_dcache_page(miter->page); if (miter->__flags & SG_MITER_ATOMIC) { diff --git a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch b/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch index d37a6eee6d21..28e68db60724 100644 --- a/debian/patches-rt/mm-vmalloc-use-get-cpu-light.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Avoid the preempt disable version of get_cpu_var(). The inner-lock should provide enough serialisation. @@ -13,7 +13,7 @@ Signed-off-by: Thomas Gleixner --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -1400,7 +1400,7 @@ static void *new_vmap_block(unsigned int +@@ -1406,7 +1406,7 @@ static void *new_vmap_block(unsigned int struct vmap_block *vb; struct vmap_area *va; unsigned long vb_idx; @@ -22,7 +22,7 @@ Signed-off-by: Thomas Gleixner void *vaddr; node = numa_node_id(); -@@ -1443,11 +1443,12 @@ static void *new_vmap_block(unsigned int +@@ -1449,11 +1449,12 @@ static void *new_vmap_block(unsigned int BUG_ON(err); radix_tree_preload_end(); @@ -37,7 +37,7 @@ Signed-off-by: Thomas Gleixner return vaddr; } -@@ -1516,6 +1517,7 @@ static void *vb_alloc(unsigned long size +@@ -1522,6 +1523,7 @@ static void *vb_alloc(unsigned long size struct vmap_block *vb; void *vaddr = NULL; unsigned int order; @@ -45,7 +45,7 @@ Signed-off-by: Thomas Gleixner BUG_ON(offset_in_page(size)); BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); -@@ -1530,7 +1532,8 @@ static void *vb_alloc(unsigned long size +@@ -1536,7 +1538,8 @@ static void *vb_alloc(unsigned long size order = get_order(size); rcu_read_lock(); @@ -55,7 +55,7 @@ Signed-off-by: Thomas Gleixner list_for_each_entry_rcu(vb, &vbq->free, free_list) { unsigned long pages_off; -@@ -1553,7 +1556,7 @@ static void *vb_alloc(unsigned long size +@@ -1559,7 +1562,7 @@ static void *vb_alloc(unsigned long size break; } diff --git a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch index b64e29581766..bf2925c4949d 100644 --- a/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch +++ b/debian/patches-rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 10:40:46 +0100 Subject: [PATCH] mm: workingset: replace IRQ-off check with a lockdep assert. -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Commit diff --git a/debian/patches-rt/mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch b/debian/patches-rt/mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch index a7811bfd23aa..2e6db06aa923 100644 --- a/debian/patches-rt/mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch +++ b/debian/patches-rt/mm-zswap-Do-not-disable-preemption-in-zswap_frontswa.patch @@ -2,7 +2,7 @@ From: "Luis Claudio R. Goncalves" Date: Tue, 25 Jun 2019 11:28:04 -0300 Subject: [PATCH] mm/zswap: Do not disable preemption in zswap_frontswap_store() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Zswap causes "BUG: scheduling while atomic" by blocking on a rt_spin_lock() with preemption disabled. The preemption is disabled by get_cpu_var() in diff --git a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch index 44f0447bf2b1..6f19e6eea242 100644 --- a/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch +++ b/debian/patches-rt/mm_zsmalloc_copy_with_get_cpu_var_and_locking.patch @@ -1,7 +1,7 @@ From: Mike Galbraith Date: Tue, 22 Mar 2016 11:16:09 +0100 Subject: [PATCH] mm/zsmalloc: copy with get_cpu_var() and locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz get_cpu_var() disables preemption and triggers a might_sleep() splat later. This is replaced with get_locked_var(). diff --git a/debian/patches-rt/mutex-no-spin-on-rt.patch b/debian/patches-rt/mutex-no-spin-on-rt.patch index fd50f8ad20a2..c4354ade15dd 100644 --- a/debian/patches-rt/mutex-no-spin-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Drop spin on owner for mutex / rwsem. We are most likely not using it but… diff --git a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch index b1aa46eb1dab..a45f08616993 100644 --- a/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch +++ b/debian/patches-rt/net-Have-__napi_schedule_irqoff-disable-interrupts-o.patch @@ -2,7 +2,7 @@ From: Steven Rostedt Date: Tue, 6 Dec 2016 17:50:30 -0500 Subject: [PATCH] net: Have __napi_schedule_irqoff() disable interrupts on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a @@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6026,6 +6026,7 @@ bool napi_schedule_prep(struct napi_stru +@@ -6031,6 +6031,7 @@ bool napi_schedule_prep(struct napi_stru } EXPORT_SYMBOL(napi_schedule_prep); @@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior /** * __napi_schedule_irqoff - schedule for receive * @n: entry to schedule -@@ -6037,6 +6038,7 @@ void __napi_schedule_irqoff(struct napi_ +@@ -6042,6 +6043,7 @@ void __napi_schedule_irqoff(struct napi_ ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); diff --git a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch index 93d98da5dfb9..ef6a03447957 100644 --- a/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ b/debian/patches-rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 14 Sep 2016 17:36:35 +0200 Subject: [PATCH] net/Qdisc: use a seqlock instead seqcount -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The seqcount disables preemption on -RT while it is held which can't remove. Also we don't want the reader to spin for ages if the writer is diff --git a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch b/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch index 6a550152191a..08c37cb01f69 100644 --- a/debian/patches-rt/net-another-local-irq-disable-alloc-atomic-headache.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Replace it by a local lock. Though that's pretty inefficient :( diff --git a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch b/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch index a221150a9a7f..5a97a2b2aba8 100644 --- a/debian/patches-rt/net-core-protect-users-of-napi_alloc_cache-against-r.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch index dd5c8676cb95..97af9eb0c5fb 100644 --- a/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ b/debian/patches-rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 16 Jun 2017 19:03:16 +0200 Subject: [PATCH] net/core: use local_bh_disable() in netif_rx_ni() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz In 2004 netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part @@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4562,11 +4562,9 @@ int netif_rx_ni(struct sk_buff *skb) +@@ -4567,11 +4567,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); diff --git a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch index 7c4ed6eb5e4e..2d8eff2728ae 100644 --- a/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ b/debian/patches-rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 30 Mar 2016 13:36:29 +0200 Subject: [PATCH] net: dev: always take qdisc's busylock in __dev_xmit_skb() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If this task is now pushed away diff --git a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch b/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch index 184755253d83..53ea35febb0b 100644 --- a/debian/patches-rt/net-fix-iptable-xt-write-recseq-begin-rt-fallout.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/net-make-devnet_rename_seq-a-mutex.patch b/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch index 0f3efdf0bf2f..6d62a8cc74f5 100644 --- a/debian/patches-rt/net-make-devnet_rename_seq-a-mutex.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch b/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch index 6da0c6f47b2d..085ffaacb131 100644 --- a/debian/patches-rt/net-sched-dev_deactivate_many-use-msleep-1-instead-o.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/net-use-cpu-chill.patch b/debian/patches-rt/net-use-cpu-chill.patch index a10d946fe0fc..dea8cc0cd1b9 100644 --- a/debian/patches-rt/net-use-cpu-chill.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/net_disable_NET_RX_BUSY_POLL.patch b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch index 89b0c59a26e5..4c3ef9c70af5 100644 --- a/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch +++ b/debian/patches-rt/net_disable_NET_RX_BUSY_POLL.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 27 May 2017 19:02:06 +0200 Subject: net/core: disable NET_RX_BUSY_POLL -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz sk_busy_loop() does preempt_disable() followed by a few operations which can take sleeping locks and may get long. diff --git a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch index aa30e86c3bcb..3ccba56f01cf 100644 --- a/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch +++ b/debian/patches-rt/of-allocate-free-phandle-cache-outside-of-the-devtre.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 31 Aug 2018 14:16:30 +0200 Subject: [PATCH] of: allocate / free phandle cache outside of the devtree_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The phandle cache code allocates memory while holding devtree_lock which is a raw_spinlock_t. Memory allocation (and free()) is not possible on diff --git a/debian/patches-rt/oleg-signal-rt-fix.patch b/debian/patches-rt/oleg-signal-rt-fix.patch index d70e34f26b20..0300cadddb8c 100644 --- a/debian/patches-rt/oleg-signal-rt-fix.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using @@ -90,7 +90,7 @@ Signed-off-by: Thomas Gleixner unsigned int sas_ss_flags; --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -1274,8 +1274,8 @@ int do_send_sig_info(int sig, struct ker +@@ -1287,8 +1287,8 @@ int do_send_sig_info(int sig, struct ker * We don't want to have recursive SIGSEGV's etc, for example, * that is why we also clear SIGNAL_UNKILLABLE. */ @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner { unsigned long int flags; int ret, blocked, ignored; -@@ -1304,6 +1304,39 @@ force_sig_info(int sig, struct kernel_si +@@ -1317,6 +1317,39 @@ force_sig_info(int sig, struct kernel_si return ret; } diff --git a/debian/patches-rt/panic-disable-random-on-rt.patch b/debian/patches-rt/panic-disable-random-on-rt.patch index 49096c5300e3..0228b8109b41 100644 --- a/debian/patches-rt/panic-disable-random-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch index 40481fc3682e..498a7ed2f0f4 100644 --- a/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch +++ b/debian/patches-rt/pci-switchtec-Don-t-use-completion-s-wait-queue.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 4 Oct 2017 10:24:23 +0200 Subject: [PATCH] pci/switchtec: Don't use completion's wait queue -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The poll callback is using completion's wait_queue_head_t member and puts it in poll_wait() so the poll() caller gets a wakeup after command diff --git a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch index bc88df67e514..78a59c85c803 100644 --- a/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch +++ b/debian/patches-rt/percpu-include-irqflags.h-for-raw_local_irq_save.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 11 Oct 2018 16:39:59 +0200 Subject: [PATCH] percpu: include irqflags.h for raw_local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The header percpu.h header file is using raw_local_irq_save() but does not include irqflags.h for its definition. It compiles because the diff --git a/debian/patches-rt/pid.h-include-atomic.h.patch b/debian/patches-rt/pid.h-include-atomic.h.patch index 3d34cf3370f1..b545e6f58745 100644 --- a/debian/patches-rt/pid.h-include-atomic.h.patch +++ b/debian/patches-rt/pid.h-include-atomic.h.patch @@ -1,7 +1,7 @@ From: Grygorii Strashko Date: Tue, 21 Jul 2015 19:43:56 +0300 Subject: pid.h: include atomic.h -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This patch fixes build error: CC kernel/pid_namespace.o diff --git a/debian/patches-rt/posix-timers-expiry-lock.patch b/debian/patches-rt/posix-timers-expiry-lock.patch index 9a37dc334255..74176e061119 100644 --- a/debian/patches-rt/posix-timers-expiry-lock.patch +++ b/debian/patches-rt/posix-timers-expiry-lock.patch @@ -4,7 +4,7 @@ Subject: [PATCH] posix-timers: Add expiry lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz If a about to be removed posix timer is active then the code will retry the delete operation until it succeeds / the timer callback completes. diff --git a/debian/patches-rt/posix-timers-move-rcu-out-of-union.patch b/debian/patches-rt/posix-timers-move-rcu-out-of-union.patch index 80bdc22d74ca..fdc7434f1a2e 100644 --- a/debian/patches-rt/posix-timers-move-rcu-out-of-union.patch +++ b/debian/patches-rt/posix-timers-move-rcu-out-of-union.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 27 May 2019 16:54:05 +0200 Subject: [PATCH] posix-timers: move rcu out of union -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz On RT the timer can be preempted while running and therefore we wait with timer_wait_for_callback() for the timer to complete (instead of diff --git a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch b/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch index 28171cf98f41..1604b858d04d 100644 --- a/debian/patches-rt/posix-timers-thread-posix-cpu-timers-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/power-disable-highmem-on-rt.patch b/debian/patches-rt/power-disable-highmem-on-rt.patch index 6d02e4933d3c..7ee9e6a4da15 100644 --- a/debian/patches-rt/power-disable-highmem-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The current highmem handling on -RT is not compatible and needs fixups. @@ -12,7 +12,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -386,7 +386,7 @@ menu "Kernel options" +@@ -387,7 +387,7 @@ menu "Kernel options" config HIGHMEM bool "High memory support" diff --git a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch index e9deff223935..2433f334bc6e 100644 --- a/debian/patches-rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/powerpc-preempt-lazy-support.patch b/debian/patches-rt/powerpc-preempt-lazy-support.patch index 0890cb3ddab5..0979c79cad1f 100644 --- a/debian/patches-rt/powerpc-preempt-lazy-support.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Implement the powerpc pieces for lazy preempt. @@ -16,7 +16,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -213,6 +213,7 @@ config PPC +@@ -214,6 +214,7 @@ config PPC select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !HAVE_HARDLOCKUP_DETECTOR_ARCH select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP diff --git a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch index 7d99de126bd9..430b67dd7844 100644 --- a/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch +++ b/debian/patches-rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_ir.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:54 +0100 Subject: [PATCH] powerpc/pseries/iommu: Use a locallock instead local_irq_save() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The locallock protects the per-CPU variable tce_page. The function attempts to allocate memory while tce_page is protected (by disabling diff --git a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch index fe9c479d6df6..d8c38b62463d 100644 --- a/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch +++ b/debian/patches-rt/powerpc-stackprotector-work-around-stack-guard-init-.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 26 Mar 2019 18:31:29 +0100 Subject: [PATCH ] powerpc/stackprotector: work around stack-guard init from atomic -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This is invoked from the secondary CPU in atomic context. On x86 we use tsc instead. On Power we XOR it against mftb() so lets use stack address diff --git a/debian/patches-rt/preempt-lazy-support.patch b/debian/patches-rt/preempt-lazy-support.patch index ac8a9e0b844c..342c2bb41c9a 100644 --- a/debian/patches-rt/preempt-lazy-support.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz It has become an obsession to mitigate the determinism vs. throughput loss of RT. Looking at the mainline semantics of preemption points @@ -142,7 +142,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1736,6 +1736,44 @@ static inline int test_tsk_need_resched( +@@ -1744,6 +1744,44 @@ static inline int test_tsk_need_resched( return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } @@ -405,7 +405,7 @@ Signed-off-by: Thomas Gleixner EXPORT_SYMBOL(migrate_enable); --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4050,7 +4050,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -4104,7 +4104,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq ideal_runtime = sched_slice(cfs_rq, curr); delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; if (delta_exec > ideal_runtime) { @@ -414,7 +414,7 @@ Signed-off-by: Thomas Gleixner /* * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. -@@ -4074,7 +4074,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq +@@ -4128,7 +4128,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq return; if (delta > ideal_runtime) @@ -423,7 +423,7 @@ Signed-off-by: Thomas Gleixner } static void -@@ -4216,7 +4216,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc +@@ -4270,7 +4270,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc * validating it and just reschedule. */ if (queued) { @@ -432,7 +432,7 @@ Signed-off-by: Thomas Gleixner return; } /* -@@ -4400,7 +4400,7 @@ static void __account_cfs_rq_runtime(str +@@ -4454,7 +4454,7 @@ static void __account_cfs_rq_runtime(str * hierarchy can be throttled */ if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) @@ -441,7 +441,7 @@ Signed-off-by: Thomas Gleixner } static __always_inline -@@ -5110,7 +5110,7 @@ static void hrtick_start_fair(struct rq +@@ -5164,7 +5164,7 @@ static void hrtick_start_fair(struct rq if (delta < 0) { if (rq->curr == p) @@ -450,7 +450,7 @@ Signed-off-by: Thomas Gleixner return; } hrtick_start(rq, delta); -@@ -6950,7 +6950,7 @@ static void check_preempt_wakeup(struct +@@ -7004,7 +7004,7 @@ static void check_preempt_wakeup(struct return; preempt: @@ -459,7 +459,7 @@ Signed-off-by: Thomas Gleixner /* * Only set the backward buddy when the current task is still * on the rq. This can happen when a wakeup gets interleaved -@@ -10222,7 +10222,7 @@ static void task_fork_fair(struct task_s +@@ -10276,7 +10276,7 @@ static void task_fork_fair(struct task_s * 'current' within the tree based on its new key value. */ swap(curr->vruntime, se->vruntime); @@ -468,7 +468,7 @@ Signed-off-by: Thomas Gleixner } se->vruntime -= cfs_rq->min_vruntime; -@@ -10246,7 +10246,7 @@ prio_changed_fair(struct rq *rq, struct +@@ -10300,7 +10300,7 @@ prio_changed_fair(struct rq *rq, struct */ if (rq->curr == p) { if (p->prio > oldprio) diff --git a/debian/patches-rt/preempt-nort-rt-variants.patch b/debian/patches-rt/preempt-nort-rt-variants.patch index a168f5e7c3dd..bbcd988f2340 100644 --- a/debian/patches-rt/preempt-nort-rt-variants.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch b/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch index 8d336a2c1a03..7f49a5d1f1d4 100644 --- a/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch +++ b/debian/patches-rt/printk-devkmsg-llseek-reset-clear-if-it-is-lost.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Fri, 22 Feb 2019 23:02:44 +0100 Subject: [PATCH] printk: devkmsg: llseek: reset clear if it is lost -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz SEEK_DATA will seek to the last clear record. If this clear record is no longer in the ring buffer, devkmsg_llseek() will go into an diff --git a/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch b/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch index edc96b0c1b66..d8b5ee16859b 100644 --- a/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch +++ b/debian/patches-rt/printk-kmsg_dump-remove-mutex-usage.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Wed, 24 Apr 2019 16:36:04 +0200 Subject: [PATCH] printk: kmsg_dump: remove mutex usage -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The kmsg dumper can be called from any context, but the dumping helpers were using a mutex to synchronize the iterator against diff --git a/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch b/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch index 59827900960d..6d68b5abdc32 100644 --- a/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch +++ b/debian/patches-rt/printk-only-allow-kernel-to-emergency-message.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Sun, 17 Feb 2019 03:11:20 +0100 Subject: [PATCH] printk: only allow kernel to emergency message -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Emergency messages exist as a mechanism for the kernel to communicate critical information to users. It is not meant for diff --git a/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch b/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch index 2d3c109b13c3..87b085763d28 100644 --- a/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch +++ b/debian/patches-rt/printk-print-rate-limitted-message-as-info.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Fri, 22 Feb 2019 12:47:13 +0100 Subject: [PATCH] printk: print "rate-limitted" message as info -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz If messages which are injected via kmsg are dropped then they don't need to be printed as warnings. This is to avoid latency spikes if the diff --git a/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch b/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch index 882b48e8636d..f639da902b59 100644 --- a/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch +++ b/debian/patches-rt/printk-set-deferred-to-default-loglevel-enforce-mask.patch @@ -1,7 +1,7 @@ From: John Ogness Date: Thu, 14 Feb 2019 23:13:30 +0100 Subject: [PATCH] printk: set deferred to default loglevel, enforce mask -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz All messages printed via vpritnk_deferred() were being automatically treated as emergency messages. diff --git a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch index 4eed4533b55b..87b40aa8badc 100644 --- a/debian/patches-rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz As explained by Alexander Fyodorov : @@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior #define task_contributes_to_load(task) ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ (task->flags & PF_FROZEN) == 0 && \ (task->state & TASK_NOLOAD) == 0) -@@ -1723,6 +1719,51 @@ static inline int test_tsk_need_resched( +@@ -1731,6 +1727,51 @@ static inline int test_tsk_need_resched( return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } diff --git a/debian/patches-rt/radix-tree-use-local-locks.patch b/debian/patches-rt/radix-tree-use-local-locks.patch index ca0a61c277e3..de91e55253e5 100644 --- a/debian/patches-rt/radix-tree-use-local-locks.patch +++ b/debian/patches-rt/radix-tree-use-local-locks.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 25 Jan 2017 16:34:27 +0100 Subject: [PATCH] radix-tree: use local locks -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The preload functionality uses per-CPU variables and preempt-disable to ensure that it does not switch CPUs during its usage. This patch adds diff --git a/debian/patches-rt/random-make-it-work-on-rt.patch b/debian/patches-rt/random-make-it-work-on-rt.patch index d1340e149cee..f1ad974bce18 100644 --- a/debian/patches-rt/random-make-it-work-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Delegate the random insertion to the forced threaded interrupt handler. Store the return IP of the hard interrupt handler in the irq @@ -135,7 +135,7 @@ Signed-off-by: Thomas Gleixner note_interrupt(desc, retval); --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c -@@ -1075,6 +1075,12 @@ static int irq_thread(void *data) +@@ -1101,6 +1101,12 @@ static int irq_thread(void *data) if (action_ret == IRQ_WAKE_THREAD) irq_wake_secondary(desc, action); diff --git a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch index 334c368356a3..f9e01d21fd66 100644 --- a/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch +++ b/debian/patches-rt/rcu-Eliminate-softirq-processing-from-rcutree.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 20 Mar 2019 22:13:33 +0100 Subject: [PATCH] rcu: Enable elimination of Tree-RCU softirq processing -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Some workloads need to change kthread priority for RCU core processing without affecting other softirq work. This commit therefore introduces diff --git a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch index a507f67d751d..be6937283d56 100644 --- a/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch +++ b/debian/patches-rt/rcu-enable-rcu_normal_after_boot-by-default-for-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Wed, 12 Oct 2016 11:21:14 -0500 Subject: [PATCH] rcu: enable rcu_normal_after_boot by default for RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The forcing of an expedited grace period is an expensive and very RT-application unfriendly operation, as it forcibly preempts all running diff --git a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch b/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch index 901c10c9ea4d..266ce619e605 100644 --- a/debian/patches-rt/rcu-make-RCU_BOOST-default-on-RT.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch b/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch index cd8e77b0fc5b..8dae2138c531 100644 --- a/debian/patches-rt/re-preempt_rt_full-arm-coredump-fails-for-cpu-3e-3d-4.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch index e83e0c109f7a..f21f86e6d4a6 100644 --- a/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch +++ b/debian/patches-rt/rt-Increase-decrease-the-nr-of-migratory-tasks-when-.patch @@ -1,7 +1,7 @@ From: Daniel Bristot de Oliveira Date: Mon, 26 Jun 2017 17:07:15 +0200 Subject: rt: Increase/decrease the nr of migratory tasks when enabling/disabling migration -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There is a problem in the migrate_disable()/enable() implementation regarding the number of migratory tasks in the rt/dl RQs. The problem diff --git a/debian/patches-rt/rt-introduce-cpu-chill.patch b/debian/patches-rt/rt-introduce-cpu-chill.patch index da068632a0b4..5ac8b106297d 100644 --- a/debian/patches-rt/rt-introduce-cpu-chill.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/rt-local-irq-lock.patch b/debian/patches-rt/rt-local-irq-lock.patch index 051a7127ff86..300bf10f0266 100644 --- a/debian/patches-rt/rt-local-irq-lock.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/rt-preempt-base-config.patch b/debian/patches-rt/rt-preempt-base-config.patch index 92c85fe8e845..84f26c6c443c 100644 --- a/debian/patches-rt/rt-preempt-base-config.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/rt-serial-warn-fix.patch b/debian/patches-rt/rt-serial-warn-fix.patch index bed20a78a941..11404e90e9d7 100644 --- a/debian/patches-rt/rt-serial-warn-fix.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Beyond the warning: diff --git a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch index ad565b75b581..1afe46c42443 100644 --- a/debian/patches-rt/rtmutex-Make-lock_killable-work.patch +++ b/debian/patches-rt/rtmutex-Make-lock_killable-work.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Sat, 1 Apr 2017 12:50:59 +0200 Subject: [PATCH] rtmutex: Make lock_killable work -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Locking an rt mutex killable does not work because signal handling is restricted to TASK_INTERRUPTIBLE. diff --git a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch index 4882c42b526a..1f95581b5866 100644 --- a/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ b/debian/patches-rt/rtmutex-Provide-rt_mutex_slowlock_locked.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:14:22 +0200 Subject: rtmutex: Provide rt_mutex_slowlock_locked() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. diff --git a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch index 9024f2f4abd4..783e0e7ff4d1 100644 --- a/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-mutex-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:17:03 +0200 Subject: rtmutex: add mutex implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch index 4b69ca09b7eb..9019d5a14933 100644 --- a/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwlock-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:18:06 +0200 Subject: rtmutex: add rwlock implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The implementation is bias-based, similar to the rwsem implementation. diff --git a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch index 353d49d084ff..4df2885bc316 100644 --- a/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch +++ b/debian/patches-rt/rtmutex-add-rwsem-implementation-based-on-rtmutex.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:28:34 +0200 Subject: rtmutex: add rwsem implementation based on rtmutex -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The RT specific R/W semaphore implementation restricts the number of readers to one because a writer cannot block on multiple readers and inherit its diff --git a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch index 669bf815393a..da6e6ca7ff61 100644 --- a/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch +++ b/debian/patches-rt/rtmutex-add-sleeping-lock-implementation.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:11:19 +0200 Subject: rtmutex: add sleeping lock implementation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch index b1b34921168b..04ce58d7b3d9 100644 --- a/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ b/debian/patches-rt/rtmutex-add-ww_mutex-addon-for-mutex-rt.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 17:34:38 +0200 Subject: rtmutex: add ww_mutex addon for mutex-rt -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch index 38ccb16c292f..2317bdd810bd 100644 --- a/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch +++ b/debian/patches-rt/rtmutex-annotate-sleeping-lock-context.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 21 Sep 2017 14:25:13 +0200 Subject: [PATCH] rtmutex: annotate sleeping lock context -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The RCU code complains on schedule() within a rcu_readlock() section. The valid scenario on -RT is if a sleeping is held. In order to suppress @@ -68,7 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior #endif #ifdef CONFIG_PREEMPT_RCU -@@ -1816,6 +1825,23 @@ static __always_inline bool need_resched +@@ -1824,6 +1833,23 @@ static __always_inline bool need_resched return unlikely(tif_need_resched()); } diff --git a/debian/patches-rt/rtmutex-avoid-include-hell.patch b/debian/patches-rt/rtmutex-avoid-include-hell.patch index 773f7c90f7e5..c663c35ca01c 100644 --- a/debian/patches-rt/rtmutex-avoid-include-hell.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch index d18093da32f3..c20d061a6e8e 100644 --- a/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch +++ b/debian/patches-rt/rtmutex-export-lockdep-less-version-of-rt_mutex-s-lo.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 16:36:39 +0200 Subject: rtmutex: export lockdep-less version of rt_mutex's lock, trylock and unlock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Required for lock implementation ontop of rtmutex. diff --git a/debian/patches-rt/rtmutex-lock-killable.patch b/debian/patches-rt/rtmutex-lock-killable.patch index bf7e820245a9..2c54daf1efe6 100644 --- a/debian/patches-rt/rtmutex-lock-killable.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add "killable" type to rtmutex. We need this since rtmutex are used as "normal" mutexes which do use this type. diff --git a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch index 95826189926f..cee16a152b36 100644 --- a/debian/patches-rt/rtmutex-trylock-is-okay-on-RT.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 diff --git a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch index debc6c08a747..e354187a0349 100644 --- a/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch +++ b/debian/patches-rt/rtmutex-wire-up-RT-s-locking.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Thu, 12 Oct 2017 17:31:14 +0200 Subject: rtmutex: wire up RT's locking -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior diff --git a/debian/patches-rt/rtmutex_dont_include_rcu.patch b/debian/patches-rt/rtmutex_dont_include_rcu.patch index ba20eb8922f7..f44a6c97a8ac 100644 --- a/debian/patches-rt/rtmutex_dont_include_rcu.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The RCU header pulls in spinlock.h and fails due not yet defined types: diff --git a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch index 942304260510..2d3e962e1129 100644 --- a/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch +++ b/debian/patches-rt/sched-Allow-pinned-user-tasks-to-be-awakened-to-the-.patch @@ -2,7 +2,7 @@ From: Mike Galbraith Date: Sun, 19 Aug 2018 08:28:35 +0200 Subject: [PATCH] sched: Allow pinned user tasks to be awakened to the CPU they pinned -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since commit 7af443ee16976 ("sched/core: Require cpu_active() in select_task_rq(), for user tasks") select_fallback_rq() will BUG() if diff --git a/debian/patches-rt/sched-completion-Fix-a-lockup-in-wait_for_completion.patch b/debian/patches-rt/sched-completion-Fix-a-lockup-in-wait_for_completion.patch index feb678305ea0..7d8ded350ae8 100644 --- a/debian/patches-rt/sched-completion-Fix-a-lockup-in-wait_for_completion.patch +++ b/debian/patches-rt/sched-completion-Fix-a-lockup-in-wait_for_completion.patch @@ -1,7 +1,7 @@ From: Corey Minyard Date: Thu, 9 May 2019 14:33:20 -0500 Subject: [PATCH] sched/completion: Fix a lockup in wait_for_completion() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Consider following race: diff --git a/debian/patches-rt/sched-core-Schedule-new-worker-even-if-PI-blocked.patch b/debian/patches-rt/sched-core-Schedule-new-worker-even-if-PI-blocked.patch index c385d58896c1..59baf9907562 100644 --- a/debian/patches-rt/sched-core-Schedule-new-worker-even-if-PI-blocked.patch +++ b/debian/patches-rt/sched-core-Schedule-new-worker-even-if-PI-blocked.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 29 May 2019 17:52:17 +0200 Subject: [PATCH] sched/core: Schedule new worker even if PI-blocked -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz If a task is PI-blocked (blocking on sleeping spinlock) then we don't schedule a new kworker if we schedule out due to lock contention because diff --git a/debian/patches-rt/sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch b/debian/patches-rt/sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch new file mode 100644 index 000000000000..592b2bc0705c --- /dev/null +++ b/debian/patches-rt/sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch @@ -0,0 +1,41 @@ +From: Juri Lelli +Date: Wed, 31 Jul 2019 12:37:15 +0200 +Subject: [PATCH] sched/deadline: Ensure inactive_timer runs in hardirq + context +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +SCHED_DEADLINE inactive timer needs to run in hardirq context (as +dl_task_timer already does) on PREEMPT_RT + +Change the mode to HRTIMER_MODE_REL_HARD. + +[ tglx: Fixed up the start site, so mode debugging works ] + +Signed-off-by: Juri Lelli +Signed-off-by: Thomas Gleixner +Link: https://lkml.kernel.org/r/20190731103715.4047-1-juri.lelli@redhat.com +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/sched/deadline.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/sched/deadline.c ++++ b/kernel/sched/deadline.c +@@ -287,7 +287,7 @@ static void task_non_contending(struct t + + dl_se->dl_non_contending = 1; + get_task_struct(p); +- hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL); ++ hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL_HARD); + } + + static void task_contending(struct sched_dl_entity *dl_se, int flags) +@@ -1292,7 +1292,7 @@ void init_dl_inactive_task_timer(struct + { + struct hrtimer *timer = &dl_se->inactive_timer; + +- hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); ++ hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); + timer->function = inactive_task_timer; + } + diff --git a/debian/patches-rt/sched-delay-put-task.patch b/debian/patches-rt/sched-delay-put-task.patch index 0a77e8676ffa..aebc8f03b346 100644 --- a/debian/patches-rt/sched-delay-put-task.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz __put_task_struct() does quite some expensive work. We don't want to burden random tasks with that. @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -1191,6 +1191,9 @@ struct task_struct { +@@ -1199,6 +1199,9 @@ struct task_struct { unsigned int sequential_io; unsigned int sequential_io_avg; #endif diff --git a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch b/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch index af28c7f19d3a..36894e206caf 100644 --- a/debian/patches-rt/sched-disable-rt-group-sched-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Carsten reported problems when running: diff --git a/debian/patches-rt/sched-disable-ttwu-queue.patch b/debian/patches-rt/sched-disable-ttwu-queue.patch index bd8a6cc7985d..154f934f066e 100644 --- a/debian/patches-rt/sched-disable-ttwu-queue.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch index 8d476c34342e..cd3e3d901b41 100644 --- a/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch +++ b/debian/patches-rt/sched-fair-Make-the-hrtimers-non-hard-again.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 8 Jan 2019 12:31:06 +0100 Subject: [PATCH] sched/fair: Make the hrtimers non-hard again -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Since commit "sched/fair: Robustify CFS-bandwidth timer locking" both hrtimer can run in softirq context because now interrupts are disabled @@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -4945,9 +4945,9 @@ void init_cfs_bandwidth(struct cfs_bandw +@@ -4999,9 +4999,9 @@ void init_cfs_bandwidth(struct cfs_bandw cfs_b->period = ns_to_ktime(default_cfs_period()); INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); diff --git a/debian/patches-rt/sched-limit-nr-migrate.patch b/debian/patches-rt/sched-limit-nr-migrate.patch index 0754b8f7e658..668afdf665bd 100644 --- a/debian/patches-rt/sched-limit-nr-migrate.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/sched-might-sleep-do-not-account-rcu-depth.patch b/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch index 6e1649b362c0..e5f8c22d10a1 100644 --- a/debian/patches-rt/sched-might-sleep-do-not-account-rcu-depth.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). diff --git a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch index f74680441bde..6ebbf22e3078 100644 --- a/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch +++ b/debian/patches-rt/sched-migrate_disable-Add-export_symbol_gpl-for-__mi.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Tue, 9 Oct 2018 17:34:50 +0200 Subject: [PATCH] sched/migrate_disable: Add export_symbol_gpl for __migrate_disabled -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Jonathan reported that lttng/modules can't use __migrate_disabled(). This function is only used by sched/core itself and the tracing diff --git a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch index da425e4c581e..4a7c39052153 100644 --- a/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch +++ b/debian/patches-rt/sched-migrate_disable-fallback-to-preempt_disable-in.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 5 Jul 2018 14:44:51 +0200 Subject: [PATCH] sched/migrate_disable: fallback to preempt_disable() instead barrier() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz On SMP + !RT migrate_disable() is still around. It is not part of spin_lock() anymore so it has almost no users. However the futex code has a workaround for diff --git a/debian/patches-rt/sched-mmdrop-delayed.patch b/debian/patches-rt/sched-mmdrop-delayed.patch index e359c813604f..4fc8271d2a47 100644 --- a/debian/patches-rt/sched-mmdrop-delayed.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/sched-rt-mutex-wakeup.patch b/debian/patches-rt/sched-rt-mutex-wakeup.patch index 7fb62d6d74cf..e240c08872da 100644 --- a/debian/patches-rt/sched-rt-mutex-wakeup.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -27,7 +27,7 @@ Signed-off-by: Thomas Gleixner /* * This begins the randomizable portion of task_struct. Only -@@ -1630,6 +1632,7 @@ extern struct task_struct *find_get_task +@@ -1638,6 +1640,7 @@ extern struct task_struct *find_get_task extern int wake_up_state(struct task_struct *tsk, unsigned int state); extern int wake_up_process(struct task_struct *tsk); diff --git a/debian/patches-rt/sched-swait-Add-swait_event_lock_irq.patch b/debian/patches-rt/sched-swait-Add-swait_event_lock_irq.patch index e4687503ed0a..2ac10e88b322 100644 --- a/debian/patches-rt/sched-swait-Add-swait_event_lock_irq.patch +++ b/debian/patches-rt/sched-swait-Add-swait_event_lock_irq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 22 May 2019 12:42:26 +0200 Subject: [PATCH] sched/swait: Add swait_event_lock_irq() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The swait_event_lock_irq() is inspired by wait_event_lock_irq(). diff --git a/debian/patches-rt/scsi-fcoe-rt-aware.patch b/debian/patches-rt/scsi-fcoe-rt-aware.patch index 2cfe5e3acbf8..3e873151aad8 100644 --- a/debian/patches-rt/scsi-fcoe-rt-aware.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Do not disable preemption while taking sleeping locks. All user look safe for migrate_diable() only. diff --git a/debian/patches-rt/seqlock-prevent-rt-starvation.patch b/debian/patches-rt/seqlock-prevent-rt-starvation.patch index 74c0e816c4f1..23cd78d283dd 100644 --- a/debian/patches-rt/seqlock-prevent-rt-starvation.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch b/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch index 7b8d74810cb5..64ac963e5693 100644 --- a/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch +++ b/debian/patches-rt/serial-8250-export-symbols-which-are-used-by-symbols.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 16 Feb 2019 09:02:00 +0100 Subject: [PATCH] serial: 8250: export symbols which are used by symbols -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Signed-off-by: Sebastian Andrzej Siewior --- diff --git a/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch b/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch index 52386d39a154..30e9a633d487 100644 --- a/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch +++ b/debian/patches-rt/serial-8250-remove-that-trylock-in-serial8250_consol.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 14 Feb 2019 17:38:24 +0100 Subject: [PATCH] serial: 8250: remove that trylock in serial8250_console_write_atomic() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This does not work as rtmutex in NMI context. As per John, it is not needed. diff --git a/debian/patches-rt/series b/debian/patches-rt/series index b7f09d5e9f21..e37bc72e4497 100644 --- a/debian/patches-rt/series +++ b/debian/patches-rt/series @@ -62,11 +62,16 @@ drm-i915-Don-t-disable-interrupts-independently-of-t.patch locking-lockdep-Don-t-complain-about-incorrect-name-.patch arm-imx6-cpuidle-Use-raw_spinlock_t.patch x86-ldt-Initialize-the-context-lock-for-init_mm.patch +i2c-exynos5-Remove-IRQF_ONESHOT.patch +i2c-hix5hd2-Remove-IRQF_ONESHOT.patch +sched-deadline-Ensure-inactive_timer-runs-in-hardirq.patch +thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch ############################################################ # Ready for posting ############################################################ efi-Allow-efi-runtime.patch +dma-buf-Use-seqlock_t-instread-disabling-preemption.patch softirq-Add-preemptible-softirq.patch sched-swait-Add-swait_event_lock_irq.patch @@ -218,6 +223,7 @@ hrtimer-consolidate-hrtimer_init-hrtimer_init_sleepe.patch hrtimer-by-timers-by-default-into-the-softirq-context.patch sched-fair-Make-the-hrtimers-non-hard-again.patch hrtimer-move-state-change-before-hrtimer_cancel-in-d.patch +KVM-arm-arm64-Let-the-timer-expire-in-hardirq-contex.patch # POSIX-CPU-TIMERS posix-timers-thread-posix-cpu-timers-on-rt.patch @@ -383,9 +389,12 @@ lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch preempt-lazy-support.patch ftrace-Fix-trace-header-alignment.patch x86-preempt-lazy.patch +x86-preempt-Check-preemption-level-before-looking-at.patch arm-preempt-lazy-support.patch powerpc-preempt-lazy-support.patch arch-arm64-Add-lazy-preempt-support.patch +arm64-preempt-Fixup-lazy-preempt.patch +arm64-preempt-Check-preemption-level-before-looking-.patch # DRIVERS connector-cn_proc-Protect-send_msg-with-a-local-lock.patch diff --git a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch b/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch index 4c84819d8590..b16b68245b2f 100644 --- a/debian/patches-rt/signal-revert-ptrace-preempt-magic.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more than a bandaid around the ptrace design trainwreck. It's not a @@ -14,7 +14,7 @@ Signed-off-by: Thomas Gleixner --- a/kernel/signal.c +++ b/kernel/signal.c -@@ -2103,15 +2103,7 @@ static void ptrace_stop(int exit_code, i +@@ -2147,15 +2147,7 @@ static void ptrace_stop(int exit_code, i if (gstop_done && ptrace_reparented(current)) do_notify_parent_cldstop(current, false, why); diff --git a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch b/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch index 9a7346d4e1ad..92fc1622d1de 100644 --- a/debian/patches-rt/signals-allow-rt-tasks-to-cache-one-sigqueue-struct.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz To avoid allocation allow rt tasks to cache one sigqueue struct in task struct. @@ -188,7 +188,7 @@ Signed-off-by: Thomas Gleixner /* We only dequeue private signals from ourselves, we don't let * signalfd steal them */ -@@ -1756,7 +1816,8 @@ EXPORT_SYMBOL(kill_pid); +@@ -1800,7 +1860,8 @@ EXPORT_SYMBOL(kill_pid); */ struct sigqueue *sigqueue_alloc(void) { diff --git a/debian/patches-rt/skbufhead-raw-lock.patch b/debian/patches-rt/skbufhead-raw-lock.patch index dc09b39c4423..821ff219e155 100644 --- a/debian/patches-rt/skbufhead-raw-lock.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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 @@ -66,7 +66,7 @@ Signed-off-by: Thomas Gleixner #endif } -@@ -5318,7 +5318,7 @@ static void flush_backlog(struct work_st +@@ -5323,7 +5323,7 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); @@ -75,7 +75,7 @@ Signed-off-by: Thomas Gleixner input_queue_head_incr(sd); } } -@@ -5328,11 +5328,14 @@ static void flush_backlog(struct work_st +@@ -5333,11 +5333,14 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); @@ -91,7 +91,7 @@ Signed-off-by: Thomas Gleixner } static void flush_all_backlogs(void) -@@ -5932,7 +5935,9 @@ static int process_backlog(struct napi_s +@@ -5937,7 +5940,9 @@ static int process_backlog(struct napi_s while (again) { struct sk_buff *skb; @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); __netif_receive_skb(skb); rcu_read_unlock(); -@@ -5940,9 +5945,9 @@ static int process_backlog(struct napi_s +@@ -5945,9 +5950,9 @@ static int process_backlog(struct napi_s if (++work >= quota) return work; @@ -112,7 +112,7 @@ Signed-off-by: Thomas Gleixner rps_lock(sd); if (skb_queue_empty(&sd->input_pkt_queue)) { /* -@@ -6407,13 +6412,21 @@ static __latent_entropy void net_rx_acti +@@ -6412,13 +6417,21 @@ static __latent_entropy void net_rx_acti unsigned long time_limit = jiffies + usecs_to_jiffies(netdev_budget_usecs); int budget = netdev_budget; @@ -134,7 +134,7 @@ Signed-off-by: Thomas Gleixner for (;;) { struct napi_struct *n; -@@ -9524,10 +9537,13 @@ static int dev_cpu_dead(unsigned int old +@@ -9529,10 +9542,13 @@ static int dev_cpu_dead(unsigned int old netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -149,7 +149,7 @@ Signed-off-by: Thomas Gleixner return 0; } -@@ -9836,8 +9852,9 @@ static int __init net_dev_init(void) +@@ -9843,8 +9859,9 @@ static int __init net_dev_init(void) INIT_WORK(flush, flush_backlog); diff --git a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch b/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch index 69ff444ca1a3..6a59ae774132 100644 --- a/debian/patches-rt/slub-disable-SLUB_CPU_PARTIAL.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/slub-enable-irqs-for-no-wait.patch b/debian/patches-rt/slub-enable-irqs-for-no-wait.patch index 3ef056b384f3..d7831c5accf6 100644 --- a/debian/patches-rt/slub-enable-irqs-for-no-wait.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/softirq-Add-preemptible-softirq.patch b/debian/patches-rt/softirq-Add-preemptible-softirq.patch index c355f62837ee..accb20aa3e35 100644 --- a/debian/patches-rt/softirq-Add-preemptible-softirq.patch +++ b/debian/patches-rt/softirq-Add-preemptible-softirq.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 20 May 2019 13:09:08 +0200 Subject: [PATCH] softirq: Add preemptible softirq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add preemptible softirq for RT's needs. By removing the softirq count from the preempt counter, the softirq becomes preemptible. A per-CPU diff --git a/debian/patches-rt/softirq-Avoid-a-cancel-dead-lock-in-tasklet-handling.patch b/debian/patches-rt/softirq-Avoid-a-cancel-dead-lock-in-tasklet-handling.patch index aa132bcfa7fe..4dcc50238f9c 100644 --- a/debian/patches-rt/softirq-Avoid-a-cancel-dead-lock-in-tasklet-handling.patch +++ b/debian/patches-rt/softirq-Avoid-a-cancel-dead-lock-in-tasklet-handling.patch @@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior Date: Sat, 22 Jun 2019 00:09:22 +0200 Subject: [PATCH] softirq: Avoid a cancel dead-lock in tasklet handling due to preemptible-softirq -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz A pending / active tasklet which is preempted by a task on the same CPU will spin indefinitely becauase the tasklet makes no progress. diff --git a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch b/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch index 05fc60f5036f..d0de27c6bfa6 100644 --- a/debian/patches-rt/softirq-disable-softirq-stacks-for-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Disable extra stacks for softirqs. We want to preempt softirqs and having them on special IRQ-stack does not make this easier. @@ -107,7 +107,7 @@ Signed-off-by: Thomas Gleixner void fixup_irqs(void) --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -1032,6 +1032,7 @@ EXPORT_SYMBOL(native_load_gs_index) +@@ -1056,6 +1056,7 @@ EXPORT_SYMBOL(native_load_gs_index) jmp 2b .previous @@ -115,7 +115,7 @@ Signed-off-by: Thomas Gleixner /* Call softirq on interrupt stack. Interrupts are off. */ ENTRY(do_softirq_own_stack) pushq %rbp -@@ -1042,6 +1043,7 @@ ENTRY(do_softirq_own_stack) +@@ -1066,6 +1067,7 @@ ENTRY(do_softirq_own_stack) leaveq ret ENDPROC(do_softirq_own_stack) diff --git a/debian/patches-rt/softirq-preempt-fix-3-re.patch b/debian/patches-rt/softirq-preempt-fix-3-re.patch index 23e1a746ad4e..2da59139505b 100644 --- a/debian/patches-rt/softirq-preempt-fix-3-re.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz raise_softirq_irqoff() disables interrupts and wakes the softirq daemon, but after reenabling interrupts there is no preemption check, @@ -136,7 +136,7 @@ Signed-off-by: Thomas Gleixner atomic_long_inc(&skb->dev->rx_dropped); kfree_skb(skb); -@@ -5894,12 +5897,14 @@ static void net_rps_action_and_irq_enabl +@@ -5899,12 +5902,14 @@ static void net_rps_action_and_irq_enabl sd->rps_ipi_list = NULL; local_irq_enable(); @@ -151,7 +151,7 @@ Signed-off-by: Thomas Gleixner } static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -5977,6 +5982,7 @@ void __napi_schedule(struct napi_struct +@@ -5982,6 +5987,7 @@ void __napi_schedule(struct napi_struct local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); @@ -159,7 +159,7 @@ Signed-off-by: Thomas Gleixner } EXPORT_SYMBOL(__napi_schedule); -@@ -9506,6 +9512,7 @@ static int dev_cpu_dead(unsigned int old +@@ -9511,6 +9517,7 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); diff --git a/debian/patches-rt/spinlock-types-separate-raw.patch b/debian/patches-rt/spinlock-types-separate-raw.patch index bf0500d5e6d0..6c4fdb279245 100644 --- a/debian/patches-rt/spinlock-types-separate-raw.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch index a1d6bc08802f..13135817b734 100644 --- a/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch +++ b/debian/patches-rt/squashfs-make-use-of-local-lock-in-multi_cpu-decompr.patch @@ -2,7 +2,7 @@ From: Julia Cartwright Date: Mon, 7 May 2018 08:58:57 -0500 Subject: [PATCH] squashfs: make use of local lock in multi_cpu decompressor -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Currently, the squashfs multi_cpu decompressor makes use of get_cpu_ptr()/put_cpu_ptr(), which unconditionally disable preemption diff --git a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch index b7ed5ae773f0..adc5b6c09237 100644 --- a/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch +++ b/debian/patches-rt/srcu-replace-local_irqsave-with-a-locallock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Thu, 12 Oct 2017 18:37:12 +0200 Subject: [PATCH] srcu: replace local_irqsave() with a locallock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There are two instances which disable interrupts in order to become a stable this_cpu_ptr() pointer. The restore part is coupled with diff --git a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch index 6f68688b50d6..f5584dec512b 100644 --- a/debian/patches-rt/sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/sysfs-realtime-entry.patch b/debian/patches-rt/sysfs-realtime-entry.patch index 5d02bca74b91..1462a7e77b6b 100644 --- a/debian/patches-rt/sysfs-realtime-entry.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Add a /sys/kernel entry to indicate that the kernel is a realtime kernel. diff --git a/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch b/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch new file mode 100644 index 000000000000..e01323378c8c --- /dev/null +++ b/debian/patches-rt/thermal-x86_pkg_temp-make-pkg_temp_lock-a-raw-spinlo.patch @@ -0,0 +1,110 @@ +From: Clark Williams +Date: Mon, 15 Jul 2019 15:25:00 -0500 +Subject: [PATCH] thermal/x86_pkg_temp: make pkg_temp_lock a raw spinlock +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +The spinlock pkg_temp_lock has the potential of being taken in atomic +context on v5.2-rt PREEMPT_RT. It's static and limited scope so +go ahead and make it a raw spinlock. + +Signed-off-by: Clark Williams +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/thermal/intel/x86_pkg_temp_thermal.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c ++++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c +@@ -63,7 +63,7 @@ static int max_packages __read_mostly; + /* Array of package pointers */ + static struct pkg_device **packages; + /* Serializes interrupt notification, work and hotplug */ +-static DEFINE_SPINLOCK(pkg_temp_lock); ++static DEFINE_RAW_SPINLOCK(pkg_temp_lock); + /* Protects zone operation in the work function against hotplug removal */ + static DEFINE_MUTEX(thermal_zone_mutex); + +@@ -279,12 +279,12 @@ static void pkg_temp_thermal_threshold_w + u64 msr_val, wr_val; + + mutex_lock(&thermal_zone_mutex); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + ++pkg_work_cnt; + + pkgdev = pkg_temp_thermal_get_dev(cpu); + if (!pkgdev) { +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + mutex_unlock(&thermal_zone_mutex); + return; + } +@@ -298,7 +298,7 @@ static void pkg_temp_thermal_threshold_w + } + + enable_pkg_thres_interrupt(); +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + + /* + * If tzone is not NULL, then thermal_zone_mutex will prevent the +@@ -323,7 +323,7 @@ static int pkg_thermal_notify(u64 msr_va + struct pkg_device *pkgdev; + unsigned long flags; + +- spin_lock_irqsave(&pkg_temp_lock, flags); ++ raw_spin_lock_irqsave(&pkg_temp_lock, flags); + ++pkg_interrupt_cnt; + + disable_pkg_thres_interrupt(); +@@ -335,7 +335,7 @@ static int pkg_thermal_notify(u64 msr_va + pkg_thermal_schedule_work(pkgdev->cpu, &pkgdev->work); + } + +- spin_unlock_irqrestore(&pkg_temp_lock, flags); ++ raw_spin_unlock_irqrestore(&pkg_temp_lock, flags); + return 0; + } + +@@ -381,9 +381,9 @@ static int pkg_temp_thermal_device_add(u + pkgdev->msr_pkg_therm_high); + + cpumask_set_cpu(cpu, &pkgdev->cpumask); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + packages[pkgid] = pkgdev; +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + return 0; + } + +@@ -420,7 +420,7 @@ static int pkg_thermal_cpu_offline(unsig + } + + /* Protect against work and interrupts */ +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + + /* + * Check whether this cpu was the current target and store the new +@@ -452,9 +452,9 @@ static int pkg_thermal_cpu_offline(unsig + * To cancel the work we need to drop the lock, otherwise + * we might deadlock if the work needs to be flushed. + */ +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + cancel_delayed_work_sync(&pkgdev->work); +- spin_lock_irq(&pkg_temp_lock); ++ raw_spin_lock_irq(&pkg_temp_lock); + /* + * If this is not the last cpu in the package and the work + * did not run after we dropped the lock above, then we +@@ -465,7 +465,7 @@ static int pkg_thermal_cpu_offline(unsig + pkg_thermal_schedule_work(target, &pkgdev->work); + } + +- spin_unlock_irq(&pkg_temp_lock); ++ raw_spin_unlock_irq(&pkg_temp_lock); + + /* Final cleanup if this is the last cpu */ + if (lastcpu) diff --git a/debian/patches-rt/timekeeping-split-jiffies-lock.patch b/debian/patches-rt/timekeeping-split-jiffies-lock.patch index 62174a1d13ba..64733088ac96 100644 --- a/debian/patches-rt/timekeeping-split-jiffies-lock.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/timers-Drop-expiry-lock-after-each-timer-invocation.patch b/debian/patches-rt/timers-Drop-expiry-lock-after-each-timer-invocation.patch index e62590a2bea6..43aba7246c9a 100644 --- a/debian/patches-rt/timers-Drop-expiry-lock-after-each-timer-invocation.patch +++ b/debian/patches-rt/timers-Drop-expiry-lock-after-each-timer-invocation.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Thu, 10 Jan 2019 13:00:07 +0100 Subject: [PATCH] timers: Drop expiry lock after each timer invocation -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The ->expiry_lock lock is held until every timer is expired. So if a __del_timer_sync() caller blocks on the lock then it has to wait until diff --git a/debian/patches-rt/timers-Introduce-expiry-spin-lock.patch b/debian/patches-rt/timers-Introduce-expiry-spin-lock.patch index 69dc03c5ff1b..ff404c780554 100644 --- a/debian/patches-rt/timers-Introduce-expiry-spin-lock.patch +++ b/debian/patches-rt/timers-Introduce-expiry-spin-lock.patch @@ -1,7 +1,7 @@ From: Anna-Maria Gleixner Date: Thu, 10 Jan 2019 13:00:06 +0100 Subject: [PATCH] timers: Introduce expiry spin lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When del_timer_sync() is called, it is possible, that the CPU has to spin, because the timer is marked as running. The function will diff --git a/debian/patches-rt/timers-prepare-for-full-preemption.patch b/debian/patches-rt/timers-prepare-for-full-preemption.patch index c03a2ffa1d1e..d86a6d856c83 100644 --- a/debian/patches-rt/timers-prepare-for-full-preemption.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/tpm-remove-tpm_dev_wq_lock.patch b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch index 746459e0d4b3..9ef6d50f78f6 100644 --- a/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch +++ b/debian/patches-rt/tpm-remove-tpm_dev_wq_lock.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 11 Feb 2019 11:33:11 +0100 Subject: [PATCH] tpm: remove tpm_dev_wq_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Added in commit diff --git a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch index 584aceb792e7..2944d5c31a22 100644 --- a/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ b/debian/patches-rt/tpm_tis-fix-stall-after-iowrite-s.patch @@ -1,7 +1,7 @@ From: Haris Okanovic Date: Tue, 15 Aug 2017 15:13:08 -0500 Subject: [PATCH] tpm_tis: fix stall after iowrite*()s -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz ioread8() operations to TPM MMIO addresses can stall the cpu when immediately following a sequence of iowrite*()'s to the same region. diff --git a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch index d5a64d21c910..8bbd86289eb7 100644 --- a/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch +++ b/debian/patches-rt/tty-serial-pl011-warning-about-uninitialized.patch @@ -4,7 +4,7 @@ Subject: [PATCH] tty: serial: pl011: explicitly initialize the flags variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Silence the following gcc warning: diff --git a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch b/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch index 3bbc836f7f0a..6bcfec78a839 100644 --- a/debian/patches-rt/upstream-net-rt-remove-preemption-disabling-in-netif_rx.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz 1)enqueue_to_backlog() (called from netif_rx) should be bind to a particluar CPU. This can be achieved by @@ -38,7 +38,7 @@ Signed-off-by: Thomas Gleixner --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4510,7 +4510,7 @@ static int netif_rx_internal(struct sk_b +@@ -4515,7 +4515,7 @@ static int netif_rx_internal(struct sk_b struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; @@ -47,7 +47,7 @@ Signed-off-by: Thomas Gleixner rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4520,14 +4520,14 @@ static int netif_rx_internal(struct sk_b +@@ -4525,14 +4525,14 @@ static int netif_rx_internal(struct sk_b ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); diff --git a/debian/patches-rt/wait.h-include-atomic.h.patch b/debian/patches-rt/wait.h-include-atomic.h.patch index 43245c61bef4..90c199a46f7b 100644 --- a/debian/patches-rt/wait.h-include-atomic.h.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz | CC init/main.o |In file included from include/linux/mmzone.h:9:0, diff --git a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch index 3de28f9252bb..e3c4aa2e0c91 100644 --- a/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch +++ b/debian/patches-rt/watchdog-prevent-deferral-of-watchdogd-wakeup-on-RT.patch @@ -1,7 +1,7 @@ From: Julia Cartwright Date: Fri, 28 Sep 2018 21:03:51 +0000 Subject: [PATCH] watchdog: prevent deferral of watchdogd wakeup on RT -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When PREEMPT_RT_FULL is enabled, all hrtimer expiry functions are deferred for execution into the context of ktimersoftd unless otherwise diff --git a/debian/patches-rt/workqueue-Convert-the-locks-to-raw-type.patch b/debian/patches-rt/workqueue-Convert-the-locks-to-raw-type.patch index 2aad94b11732..28b63775e918 100644 --- a/debian/patches-rt/workqueue-Convert-the-locks-to-raw-type.patch +++ b/debian/patches-rt/workqueue-Convert-the-locks-to-raw-type.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Wed, 22 May 2019 12:43:56 +0200 Subject: [PATCH] workqueue: Convert the locks to raw type -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz After all the workqueue and the timer rework, we can finally make the worker_pool lock raw. diff --git a/debian/patches-rt/workqueue-Make-alloc-apply-free_workqueue_attrs-stat.patch b/debian/patches-rt/workqueue-Make-alloc-apply-free_workqueue_attrs-stat.patch index 8d674f12032b..16b792015f02 100644 --- a/debian/patches-rt/workqueue-Make-alloc-apply-free_workqueue_attrs-stat.patch +++ b/debian/patches-rt/workqueue-Make-alloc-apply-free_workqueue_attrs-stat.patch @@ -1,7 +1,7 @@ From: Thomas Gleixner Date: Tue, 21 May 2019 16:35:12 +0200 Subject: [PATCH] workqueue: Make alloc/apply/free_workqueue_attrs() static -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz None of those functions have any users outside of workqueue.c. Confine them. diff --git a/debian/patches-rt/workqueue-Remove-GPF-argument-from-alloc_workqueue_a.patch b/debian/patches-rt/workqueue-Remove-GPF-argument-from-alloc_workqueue_a.patch index 9a8f23ba66e5..c6a48712601d 100644 --- a/debian/patches-rt/workqueue-Remove-GPF-argument-from-alloc_workqueue_a.patch +++ b/debian/patches-rt/workqueue-Remove-GPF-argument-from-alloc_workqueue_a.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Tue, 21 May 2019 16:39:56 +0200 Subject: [PATCH] workqueue: Remove GPF argument from alloc_workqueue_attrs() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz All callers use GFP_KERNEL. No point in having that argument. diff --git a/debian/patches-rt/x86-Disable-HAVE_ARCH_JUMP_LABEL.patch b/debian/patches-rt/x86-Disable-HAVE_ARCH_JUMP_LABEL.patch index cd7830853242..86e9c37be02d 100644 --- a/debian/patches-rt/x86-Disable-HAVE_ARCH_JUMP_LABEL.patch +++ b/debian/patches-rt/x86-Disable-HAVE_ARCH_JUMP_LABEL.patch @@ -4,7 +4,7 @@ Subject: [PATCH] x86: Disable HAVE_ARCH_JUMP_LABEL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz __text_poke() does: | local_irq_save(flags); diff --git a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch b/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch index b8175fd74ad5..f0746dfaf135 100644 --- a/debian/patches-rt/x86-crypto-reduce-preempt-disabled-regions.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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-rt/x86-highmem-add-a-already-used-pte-check.patch b/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch index a973a4234a84..78e0ef0ef8f7 100644 --- a/debian/patches-rt/x86-highmem-add-a-already-used-pte-check.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz This is a copy from kmap_atomic_prot(). diff --git a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch index f12e13b95e40..5c43c2f6d7f9 100644 --- a/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch +++ b/debian/patches-rt/x86-ioapic-Don-t-let-setaffinity-unmask-threaded-EOI.patch @@ -2,7 +2,7 @@ From: Thomas Gleixner Date: Tue, 17 Jul 2018 18:25:31 +0200 Subject: [PATCH] x86/ioapic: Don't let setaffinity unmask threaded EOI interrupt too early -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler. diff --git a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch b/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch index 3b3c6d308331..a410c600ba21 100644 --- a/debian/patches-rt/x86-kvm-require-const-tsc-for-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds @@ -15,7 +15,7 @@ Signed-off-by: Thomas Gleixner --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -7013,6 +7013,14 @@ int kvm_arch_init(void *opaque) +@@ -7017,6 +7017,14 @@ int kvm_arch_init(void *opaque) goto out; } diff --git a/debian/patches-rt/x86-ldt-Initialize-the-context-lock-for-init_mm.patch b/debian/patches-rt/x86-ldt-Initialize-the-context-lock-for-init_mm.patch index eb9fe1a41f06..fa8cf903736b 100644 --- a/debian/patches-rt/x86-ldt-Initialize-the-context-lock-for-init_mm.patch +++ b/debian/patches-rt/x86-ldt-Initialize-the-context-lock-for-init_mm.patch @@ -1,7 +1,7 @@ From: Sebastian Andrzej Siewior Date: Mon, 1 Jul 2019 17:53:13 +0200 Subject: [PATCH] x86/ldt: Initialize the context lock for init_mm -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz The mutex mm->context->lock for init_mm is not initialized for init_mm. This wasn't a problem because it remained unused. This changed however diff --git a/debian/patches-rt/x86-preempt-Check-preemption-level-before-looking-at.patch b/debian/patches-rt/x86-preempt-Check-preemption-level-before-looking-at.patch new file mode 100644 index 000000000000..2130529ed0f2 --- /dev/null +++ b/debian/patches-rt/x86-preempt-Check-preemption-level-before-looking-at.patch @@ -0,0 +1,25 @@ +From: Sebastian Andrzej Siewior +Date: Wed, 14 Aug 2019 17:08:58 +0200 +Subject: [PATCH] x86: preempt: Check preemption level before looking at + lazy-preempt +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz + +Before evaluating the lazy-preempt state it must be ensure that the +preempt-count is zero. + +Signed-off-by: Sebastian Andrzej Siewior +--- + arch/x86/include/asm/preempt.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/x86/include/asm/preempt.h ++++ b/arch/x86/include/asm/preempt.h +@@ -99,6 +99,8 @@ static __always_inline bool __preempt_co + if (____preempt_count_dec_and_test()) + return true; + #ifdef CONFIG_PREEMPT_LAZY ++ if (preempt_count()) ++ return false; + if (current_thread_info()->preempt_lazy_count) + return false; + return test_thread_flag(TIF_NEED_RESCHED_LAZY); diff --git a/debian/patches-rt/x86-preempt-lazy.patch b/debian/patches-rt/x86-preempt-lazy.patch index e15fbf9b2b31..d50547617663 100644 --- a/debian/patches-rt/x86-preempt-lazy.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz Implement the x86 pieces for lazy preempt. @@ -76,7 +76,7 @@ Signed-off-by: Thomas Gleixner call preempt_schedule_irq --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S -@@ -646,7 +646,23 @@ GLOBAL(swapgs_restore_regs_and_return_to +@@ -670,7 +670,23 @@ GLOBAL(swapgs_restore_regs_and_return_to btl $9, EFLAGS(%rsp) /* were interrupts off? */ jnc 1f cmpl $0, PER_CPU_VAR(__preempt_count) diff --git a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch b/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch index d0842728fcc5..d32c4b547d0d 100644 --- a/debian/patches-rt/x86-signal-delay-calling-signals-on-32bit.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.tar.xz When running some ptrace single step tests on x86-32 machine, the below problem is triggered: diff --git a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch b/debian/patches-rt/x86-stackprot-no-random-on-rt.patch index c715b5af9fce..2efd764d77b1 100644 --- a/debian/patches-rt/x86-stackprot-no-random-on-rt.patch +++ b/debian/patches-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/5.2/older/patches-5.2-rt1.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.9-rt3.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/bugfix/all/partially-revert-net-socket-implement-64-bit-timestamps.patch b/debian/patches/bugfix/all/partially-revert-net-socket-implement-64-bit-timestamps.patch new file mode 100644 index 000000000000..0cd066e73896 --- /dev/null +++ b/debian/patches/bugfix/all/partially-revert-net-socket-implement-64-bit-timestamps.patch @@ -0,0 +1,140 @@ +From: Ben Hutchings +Date: Tue, 20 Aug 2019 18:12:35 +0100 +Subject: Partially revert "net: socket: implement 64-bit timestamps" + +The introduction of SIOCGSTAMP{,NS}_OLD and move of SICOGSTAMP{,NS} to +a different header has caused build failures for various user-space +programs including qemu and suricata. It also causes a test failure +for glibc. + +For now, remove the _OLD suffix on the old ioctl numbers and require +programs using 64-bit timestamps to explicitly use SIOCGSTAMP{,NS}_NEW. + +References: https://lore.kernel.org/lkml/af0eb47a-5b98-1bd9-3e8d-652e7f28b01f@de.ibm.com/ +References: https://bugs.debian.org/934316 +References: https://ci.debian.net/data/autopkgtest/testing/amd64/g/glibc/2772289/log.gz +Signed-off-by: Ben Hutchings +--- +--- a/arch/alpha/include/uapi/asm/sockios.h ++++ b/arch/alpha/include/uapi/asm/sockios.h +@@ -11,7 +11,7 @@ + #define SIOCSPGRP _IOW('s', 8, pid_t) + #define SIOCGPGRP _IOR('s', 9, pid_t) + +-#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */ +-#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */ ++#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ ++#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ + + #endif /* _ASM_ALPHA_SOCKIOS_H */ +--- a/arch/mips/include/uapi/asm/sockios.h ++++ b/arch/mips/include/uapi/asm/sockios.h +@@ -21,7 +21,7 @@ + #define SIOCSPGRP _IOW('s', 8, pid_t) + #define SIOCGPGRP _IOR('s', 9, pid_t) + +-#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */ +-#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */ ++#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ ++#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ + + #endif /* _ASM_SOCKIOS_H */ +--- a/arch/sh/include/uapi/asm/sockios.h ++++ b/arch/sh/include/uapi/asm/sockios.h +@@ -10,7 +10,6 @@ + #define SIOCSPGRP _IOW('s', 8, pid_t) + #define SIOCGPGRP _IOR('s', 9, pid_t) + +-#define SIOCGSTAMP_OLD _IOR('s', 100, struct timeval) /* Get stamp (timeval) */ +-#define SIOCGSTAMPNS_OLD _IOR('s', 101, struct timespec) /* Get stamp (timespec) */ +- ++#define SIOCGSTAMP _IOR('s', 100, struct timeval) /* Get stamp (timeval) */ ++#define SIOCGSTAMPNS _IOR('s', 101, struct timespec) /* Get stamp (timespec) */ + #endif /* __ASM_SH_SOCKIOS_H */ +--- a/arch/xtensa/include/uapi/asm/sockios.h ++++ b/arch/xtensa/include/uapi/asm/sockios.h +@@ -26,7 +26,7 @@ + #define SIOCSPGRP _IOW('s', 8, pid_t) + #define SIOCGPGRP _IOR('s', 9, pid_t) + +-#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */ +-#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */ ++#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ ++#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ + + #endif /* _XTENSA_SOCKIOS_H */ +--- a/include/uapi/asm-generic/sockios.h ++++ b/include/uapi/asm-generic/sockios.h +@@ -8,7 +8,7 @@ + #define FIOGETOWN 0x8903 + #define SIOCGPGRP 0x8904 + #define SIOCATMARK 0x8905 +-#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */ +-#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */ ++#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ ++#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ + + #endif /* __ASM_GENERIC_SOCKIOS_H */ +--- a/include/uapi/linux/sockios.h ++++ b/include/uapi/linux/sockios.h +@@ -19,7 +19,6 @@ + #ifndef _LINUX_SOCKIOS_H + #define _LINUX_SOCKIOS_H + +-#include + #include + + /* Linux-specific socket ioctls */ +@@ -37,17 +36,6 @@ + /* Get stamp (timespec) */ + #define SIOCGSTAMPNS_NEW _IOR(SOCK_IOC_TYPE, 0x07, long long[2]) + +-#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__)) +-/* on 64-bit and x32, avoid the ?: operator */ +-#define SIOCGSTAMP SIOCGSTAMP_OLD +-#define SIOCGSTAMPNS SIOCGSTAMPNS_OLD +-#else +-#define SIOCGSTAMP ((sizeof(struct timeval)) == 8 ? \ +- SIOCGSTAMP_OLD : SIOCGSTAMP_NEW) +-#define SIOCGSTAMPNS ((sizeof(struct timespec)) == 8 ? \ +- SIOCGSTAMPNS_OLD : SIOCGSTAMPNS_NEW) +-#endif +- + /* Routing table calls. */ + #define SIOCADDRT 0x890B /* add routing table entry */ + #define SIOCDELRT 0x890C /* delete routing table entry */ +--- a/net/socket.c ++++ b/net/socket.c +@@ -1170,14 +1170,14 @@ static long sock_ioctl(struct file *file + + err = open_related_ns(&net->ns, get_net_ns); + break; +- case SIOCGSTAMP_OLD: +- case SIOCGSTAMPNS_OLD: ++ case SIOCGSTAMP: ++ case SIOCGSTAMPNS: + if (!sock->ops->gettstamp) { + err = -ENOIOCTLCMD; + break; + } + err = sock->ops->gettstamp(sock, argp, +- cmd == SIOCGSTAMP_OLD, ++ cmd == SIOCGSTAMP, + !IS_ENABLED(CONFIG_64BIT)); + break; + case SIOCGSTAMP_NEW: +@@ -3341,11 +3341,11 @@ static int compat_sock_ioctl_trans(struc + case SIOCADDRT: + case SIOCDELRT: + return routing_ioctl(net, sock, cmd, argp); +- case SIOCGSTAMP_OLD: +- case SIOCGSTAMPNS_OLD: ++ case SIOCGSTAMP: ++ case SIOCGSTAMPNS: + if (!sock->ops->gettstamp) + return -ENOIOCTLCMD; +- return sock->ops->gettstamp(sock, argp, cmd == SIOCGSTAMP_OLD, ++ return sock->ops->gettstamp(sock, argp, cmd == SIOCGSTAMP, + !COMPAT_USE_64BIT_TIME); + + case SIOCBONDSLAVEINFOQUERY: diff --git a/debian/patches/bugfix/all/usbip-network-fix-unaligned-member-access.patch b/debian/patches/bugfix/all/usbip-network-fix-unaligned-member-access.patch new file mode 100644 index 000000000000..059eba8c92c4 --- /dev/null +++ b/debian/patches/bugfix/all/usbip-network-fix-unaligned-member-access.patch @@ -0,0 +1,79 @@ +From: Ben Hutchings +Date: Sun, 18 Aug 2019 16:15:26 +0100 +Subject: usbip: network: Fix unaligned member access +Bug-Debian: https://bugs.debian.org/925766 + +gcc 9 warns: + +usbip_network.c: In function ‘usbip_net_pack_usb_device’: +usbip_network.c:79:32: error: taking address of packed member of ‘struct usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-of-packed-member] + 79 | usbip_net_pack_uint32_t(pack, &udev->busnum); + | ^~~~~~~~~~~~~ + +and similarly for other calls to usbip_net_pack_uint{16,32}_t(). + +These fields are unaligned because they are declared as part of a +packed structure. Functions operating on the structure will use the +appropriate accessors for unaligned data if necessary, but there +doesn't seem to be a way to declare functions as taking a pointer +to a unaligned scalar. + +Instead, change these functions to take a pointer of type void * and +to memcpy() the unaligned value in and out of a local variable. + +Signed-off-by: Ben Hutchings +--- +--- a/tools/usb/usbip/src/usbip_network.c ++++ b/tools/usb/usbip/src/usbip_network.c +@@ -50,28 +50,30 @@ void usbip_setup_port_number(char *arg) + info("using port %d (\"%s\")", usbip_port, usbip_port_string); + } + +-void usbip_net_pack_uint32_t(int pack, uint32_t *num) ++void usbip_net_pack_uint32_t(int pack, void *num) + { + uint32_t i; + ++ memcpy(&i, num, sizeof(i)); + if (pack) +- i = htonl(*num); ++ i = htonl(i); + else +- i = ntohl(*num); ++ i = ntohl(i); + +- *num = i; ++ memcpy(num, &i, sizeof(i)); + } + +-void usbip_net_pack_uint16_t(int pack, uint16_t *num) ++void usbip_net_pack_uint16_t(int pack, void *num) + { + uint16_t i; + ++ memcpy(&i, num, sizeof(i)); + if (pack) +- i = htons(*num); ++ i = htons(i); + else +- i = ntohs(*num); ++ i = ntohs(i); + +- *num = i; ++ memcpy(num, &i, sizeof(i)); + } + + void usbip_net_pack_usb_device(int pack, struct usbip_usb_device *udev) +--- a/tools/usb/usbip/src/usbip_network.h ++++ b/tools/usb/usbip/src/usbip_network.h +@@ -166,8 +166,8 @@ struct op_devlist_reply_extra { + usbip_net_pack_uint32_t(pack, &(reply)->ndev);\ + } while (0) + +-void usbip_net_pack_uint32_t(int pack, uint32_t *num); +-void usbip_net_pack_uint16_t(int pack, uint16_t *num); ++void usbip_net_pack_uint32_t(int pack, void *num); ++void usbip_net_pack_uint16_t(int pack, void *num); + void usbip_net_pack_usb_device(int pack, struct usbip_usb_device *udev); + void usbip_net_pack_usb_interface(int pack, struct usbip_usb_interface *uinf); + diff --git a/debian/patches/features/all/lockdown/tracefs-fix-potential-null-dereference-in-default_fi.patch b/debian/patches/features/all/lockdown/tracefs-fix-potential-null-dereference-in-default_fi.patch new file mode 100644 index 000000000000..b9fa05fc0f4f --- /dev/null +++ b/debian/patches/features/all/lockdown/tracefs-fix-potential-null-dereference-in-default_fi.patch @@ -0,0 +1,29 @@ +From: Ben Hutchings +Date: Mon, 12 Aug 2019 01:17:32 +0100 +Subject: tracefs: Fix potential null dereference in default_file_open() +Bug-Debian: https://bugs.debian.org/934304 +Forwarded: https://lore.kernel.org/linux-security-module/20190812002833.2zij7tfsqtpvqu3a@decadent.org.uk/ + +The "open" operation in struct file_operations is optional, and +ftrace_event_id_fops does not set it. In default_file_open(), after +all other checks have passed, return 0 if the underlying struct +file_operations does not implement open. + +Fixes: 757ff7244358 ("tracefs: Restrict tracefs when the kernel is …") +References: https://bugs.debian.org/934304 +Signed-off-by: Ben Hutchings +--- + fs/tracefs/inode.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/tracefs/inode.c ++++ b/fs/tracefs/inode.c +@@ -41,6 +41,8 @@ static int default_open_file(struct inod + return -EPERM; + + real_fops = dentry->d_fsdata; ++ if (!real_fops->open) ++ return 0; + return real_fops->open(inode, filp); + } + diff --git a/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch b/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch new file mode 100644 index 000000000000..26ec7fa3e031 --- /dev/null +++ b/debian/patches/features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch @@ -0,0 +1,84 @@ +From: Ben Hutchings +Date: Wed, 21 Aug 2019 00:32:16 +0100 +Subject: intel-iommu: Add Kconfig option to exclude iGPU by default +Bug-Debian: https://bugs.debian.org/935270 +Bug-Kali: https://bugs.kali.org/view.php?id=5644 + +There is still laptop firmware that touches the integrated GPU behind +the operating system's back, and doesn't say so in the RMRR table. +Enabling the IOMMU for all devices causes breakage. + +Replace CONFIG_INTEL_IOMMU_DEFAULT_ON with a 3-way choice +corresponding to "on", "off", and "on,intgpu_off". + +Signed-off-by: Ben Hutchings +--- +--- a/drivers/iommu/Kconfig ++++ b/drivers/iommu/Kconfig +@@ -212,14 +212,28 @@ config INTEL_IOMMU_SVM + to access DMA resources through process address space by + means of a Process Address Space ID (PASID). + +-config INTEL_IOMMU_DEFAULT_ON +- def_bool y +- prompt "Enable Intel DMA Remapping Devices by default" +- depends on INTEL_IOMMU ++if INTEL_IOMMU ++ ++choice ++ prompt "Default state of Intel DMA Remapping Devices" ++ default INTEL_IOMMU_DEFAULT_ON + help +- Selecting this option will enable a DMAR device at boot time if +- one is found. If this option is not selected, DMAR support can +- be enabled by passing intel_iommu=on to the kernel. ++ Choose whether Intel DMA Remapping Devices should be enabled ++ by default. This can be overridden at boot time using the ++ intel_iommu= kernel parameter. ++ ++config INTEL_IOMMU_DEFAULT_ON ++ bool "Enable" ++ ++config INTEL_IOMMU_DEFAULT_ON_INTGPU_OFF ++ bool "Enable, excluding integrated GPU" ++ ++config INTEL_IOMMU_DEFAULT_OFF ++ bool "Disable" ++ ++endchoice ++ ++endif + + config INTEL_IOMMU_BROKEN_GFX_WA + bool "Workaround broken graphics drivers (going away soon)" +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -348,18 +348,14 @@ static bool device_is_rmrr_locked(struct + static int intel_iommu_attach_device(struct iommu_domain *domain, + struct device *dev); + +-#ifdef CONFIG_INTEL_IOMMU_DEFAULT_ON +-int dmar_disabled = 0; +-#else +-int dmar_disabled = 1; +-#endif /*CONFIG_INTEL_IOMMU_DEFAULT_ON*/ ++int dmar_disabled = IS_ENABLED(CONFIG_INTEL_IOMMU_DEFAULT_OFF); + + int intel_iommu_sm; + int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + + static int dmar_map_gfx = 1; +-static int dmar_map_intgpu = 1; ++static int dmar_map_intgpu = IS_ENABLED(CONFIG_INTEL_IOMMU_DEFAULT_ON); + static int dmar_forcedac; + static int intel_iommu_strict; + static int intel_iommu_superpage = 1; +@@ -436,6 +432,7 @@ static int __init intel_iommu_setup(char + while (*str) { + if (!strncmp(str, "on", 2)) { + dmar_disabled = 0; ++ dmar_map_intgpu = 1; + pr_info("IOMMU enabled\n"); + } else if (!strncmp(str, "off", 3)) { + dmar_disabled = 1; diff --git a/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch b/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch new file mode 100644 index 000000000000..c947c53f6586 --- /dev/null +++ b/debian/patches/features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch @@ -0,0 +1,87 @@ +From: Ben Hutchings +Date: Wed, 21 Aug 2019 00:05:30 +0100 +Subject: intel-iommu: Add option to exclude integrated GPU only +Bug-Debian: https://bugs.debian.org/935270 +Bug-Kali: https://bugs.kali.org/view.php?id=5644 + +There is still laptop firmware that touches the integrated GPU behind +the operating system's back, and doesn't say so in the RMRR table. +Enabling the IOMMU for all devices causes breakage, but turning it off +for all graphics devices seems like a major weakness. + +Add an option, intel_iommu=igpu_off, to exclude only integrated GPUs +from remapping. This is a narrower exclusion than igfx_off: it only +affects Intel devices on the root bus. Devices attached through an +external port (Thunderbolt or ExpressCard) won't be on the root bus. + +Signed-off-by: Ben Hutchings +--- +--- a/drivers/iommu/intel-iommu.c ++++ b/drivers/iommu/intel-iommu.c +@@ -52,6 +52,9 @@ + #define CONTEXT_SIZE VTD_PAGE_SIZE + + #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) ++#define IS_INTGPU_DEVICE(pdev) (IS_GFX_DEVICE(pdev) && \ ++ (pdev)->vendor == 0x8086 && \ ++ pci_is_root_bus((pdev)->bus)) + #define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB) + #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) + #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e) +@@ -356,6 +359,7 @@ int intel_iommu_enabled = 0; + EXPORT_SYMBOL_GPL(intel_iommu_enabled); + + static int dmar_map_gfx = 1; ++static int dmar_map_intgpu = 1; + static int dmar_forcedac; + static int intel_iommu_strict; + static int intel_iommu_superpage = 1; +@@ -364,6 +368,7 @@ static int iommu_identity_mapping; + #define IDENTMAP_ALL 1 + #define IDENTMAP_GFX 2 + #define IDENTMAP_AZALIA 4 ++#define IDENTMAP_INTGPU 8 + + int intel_iommu_gfx_mapped; + EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped); +@@ -439,6 +444,9 @@ static int __init intel_iommu_setup(char + } else if (!strncmp(str, "igfx_off", 8)) { + dmar_map_gfx = 0; + pr_info("Disable GFX device mapping\n"); ++ } else if (!strncmp(str, "intgpu_off", 8)) { ++ dmar_map_intgpu = 0; ++ pr_info("Disable integrated GPU device mapping\n"); + } else if (!strncmp(str, "forcedac", 8)) { + pr_info("Forcing DAC for PCI devices\n"); + dmar_forcedac = 1; +@@ -2890,6 +2898,9 @@ static int device_def_domain_type(struct + if ((iommu_identity_mapping & IDENTMAP_GFX) && IS_GFX_DEVICE(pdev)) + return IOMMU_DOMAIN_IDENTITY; + ++ if ((iommu_identity_mapping & IDENTMAP_INTGPU) && IS_INTGPU_DEVICE(pdev)) ++ return IOMMU_DOMAIN_IDENTITY; ++ + /* + * We want to start off with all devices in the 1:1 domain, and + * take them out later if we find they can't access all of memory. +@@ -3277,6 +3288,9 @@ static int __init init_dmars(void) + if (!dmar_map_gfx) + iommu_identity_mapping |= IDENTMAP_GFX; + ++ if (!dmar_map_intgpu) ++ iommu_identity_mapping |= IDENTMAP_INTGPU; ++ + check_tylersburg_isoch(); + + ret = si_domain_init(hw_pass_through); +--- a/Documentation/admin-guide/kernel-parameters.txt ++++ b/Documentation/admin-guide/kernel-parameters.txt +@@ -1703,6 +1703,8 @@ + bypassed by not enabling DMAR with this option. In + this case, gfx device will use physical address for + DMA. ++ intgpu_off [Default Off] ++ Bypass the DMAR unit for an integrated GPU only. + forcedac [x86_64] + With this option iommu will not optimize to look + for io virtual address below 32-bit forcing dual diff --git a/debian/patches/series b/debian/patches/series index 7cfa487756d1..81f39e976dd5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -47,6 +47,8 @@ debian/sched-autogroup-disabled.patch debian/yama-disable-by-default.patch debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch features/all/security-perf-allow-further-restriction-of-perf_event_open.patch +features/x86/intel-iommu-add-option-to-exclude-integrated-gpu-only.patch +features/x86/intel-iommu-add-kconfig-option-to-exclude-igpu-by-default.patch # Disable autoloading/probing of various drivers by default debian/cdc_ncm-cdc_mbim-use-ncm-by-default.patch @@ -79,6 +81,7 @@ bugfix/all/disable-some-marvell-phys.patch bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch debian/revert-objtool-fix-config_stack_validation-y-warning.patch +bugfix/all/partially-revert-net-socket-implement-64-bit-timestamps.patch # Miscellaneous features @@ -114,6 +117,7 @@ features/all/lockdown/0028-efi-Add-an-EFI_SECURE_BOOT-flag-to-indicate-secure-b. features/all/lockdown/0029-efi-Lock-down-the-kernel-if-booted-in-secure-boot-mo.patch features/all/lockdown/0030-lockdown-Print-current-comm-in-restriction-messages.patch features/all/lockdown/0031-tracefs-Restrict-tracefs-when-the-kernel-is-locked-d.patch +features/all/lockdown/tracefs-fix-potential-null-dereference-in-default_fi.patch features/all/lockdown/0032-efi-Restrict-efivar_ssdt_load-when-the-kernel-is-loc.patch # some missing pieces features/all/lockdown/enable-cold-boot-attack-mitigation.patch @@ -150,6 +154,7 @@ bugfix/all/cpupower-fix-checks-for-cpu-existence.patch bugfix/all/tools-lib-api-fs-fs.c-fix-misuse-of-strncpy.patch bugfix/all/usbip-fix-misuse-of-strncpy.patch bugfix/x86/tools-x86_energy_perf_policy-fix-uninitialized-varia.patch +bugfix/all/usbip-network-fix-unaligned-member-access.patch # wireless: Disable regulatory.db direct loading (until we sort out signing) debian/wireless-disable-regulatory.db-direct-loading.patch diff --git a/debian/rules.d/tools/lib/bpf/Makefile b/debian/rules.d/tools/lib/bpf/Makefile index a14cfc14c4fc..c7d93ca0d38c 100644 --- a/debian/rules.d/tools/lib/bpf/Makefile +++ b/debian/rules.d/tools/lib/bpf/Makefile @@ -12,6 +12,7 @@ MAKE_BPF := +$(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR) MAKE_BPF += prefix=/usr MAKE_BPF += libdir_relative=lib/$(DEB_HOST_MULTIARCH) MAKE_BPF += V=$(KBUILD_VERBOSE) +MAKE_BPF += ARCH=$(KERNEL_ARCH) all: $(MAKE_BPF) diff --git a/debian/templates/image.bug/include-network b/debian/templates/image.bug/include-network index bd12defe6217..89d9cb9de4b0 100644 --- a/debian/templates/image.bug/include-network +++ b/debian/templates/image.bug/include-network @@ -1,11 +1,39 @@ +_list_etc_network_interfaces() { + local file + + for file in /etc/network/interfaces /etc/network/interfaces.d/*; do + if ! [ -f "$file" ]; then + continue + fi + case "${file##*/}" in + *[^-a-zA-Z0-9_]*) + continue + ;; + esac + echo "$file" + done +} + _add_etc_network_interfaces() { + local file + test -f /etc/network/interfaces || return 0 + echo '** Network interface configuration:' >&3 - # Hide passwords/keys - awk '$1 ~ /key|pass|^wpa-(anonymous|identity|phase|pin|private|psk)/ { gsub(".", "*", $2); } - $1 == "ethtool-wol" { gsub(".", "*", $3); } - !/^[[:space:]]*\#/ { print; } - ' &3 - echo >&3 + + while read file; do + if ! [ -r "$file" ]; then + echo "*** $file: unreadable" >&3 + echo >&3 + continue + fi + echo "*** $file:" >&3 + # Hide passwords/keys + awk '$1 ~ /key|pass|^wpa-(anonymous|identity|phase|pin|private|psk)/ { gsub(".", "*", $2); } + $1 == "ethtool-wol" { gsub(".", "*", $3); } + !/^[[:space:]]*\#/ { print; } + ' <"$file" >&3 + echo >&3 + done < <(_list_etc_network_interfaces) } add_network() { @@ -32,6 +60,8 @@ add_network() { ask_network() { test $same_system = yep || return 0 + test -f /etc/network/interfaces || return 0 + yesno "Include network configuration from this computer? " nop test $REPLY = yep || return 0