diff options
595 files changed, 8989 insertions, 31208 deletions
@@ -4,12 +4,12 @@ Patches to the kernel meta data should be submitted to the linux-yocto mailing list (subscripion only) and should cc' the maintainer. - list: https://lists.yoctoproject.org/listinfo/linux-yocto + list: https://lists.yoctoproject.org/g/linux-yocto Maintainers: Bruce Ashfield <bruce.ashfield@gmail.com> When sending single patches, please using something like: - $ git send-email -1 --to linux-yocto@yoctoproject.org --subject-prefix='kernel-cache][PATCH' + $ git send-email -1 --to=linux-yocto@lists.yoctoproject.org --subject-prefix='kernel-cache][PATCH' 1.0 Overview ============ diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..7d2ce1f6 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,24 @@ +How to Report a Potential Vulnerability? +======================================== + +If you would like to report a public issue (for example, one with a released +CVE number), please report it using the +[https://bugzilla.yoctoproject.org/enter_bug.cgi?product=Security Security Bugzilla]. +If you have a patch ready, submit it following the same procedure as any other +patch as described in README.md. + +If you are dealing with a not-yet released or urgent issue, please send a +message to security AT yoctoproject DOT org, including as many details as +possible: the layer or software module affected, the recipe and its version, +and any example code, if available. + +Branches maintained with security fixes +--------------------------------------- + +See [https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS Stable release and LTS] +for detailed info regarding the policies and maintenance of Stable branches. + +The [https://wiki.yoctoproject.org/wiki/Releases Release page] contains a list of all +releases of the Yocto Project. Versions in grey are no longer actively maintained with +security patches, but well-tested patches may still be accepted for them for +significant issues. diff --git a/arch/arm/0001-drm-fb-helper-move-zeroing-code-to-drm_fb_helper_fil.patch b/arch/arm/0001-drm-fb-helper-move-zeroing-code-to-drm_fb_helper_fil.patch new file mode 100644 index 00000000..8282d25d --- /dev/null +++ b/arch/arm/0001-drm-fb-helper-move-zeroing-code-to-drm_fb_helper_fil.patch @@ -0,0 +1,98 @@ +From 72bad8cd7540f07ab54e08b83ad106dec0df123c Mon Sep 17 00:00:00 2001 +From: Jon Mason <jon.mason@arm.com> +Date: Tue, 8 Aug 2023 16:38:37 -0400 +Subject: [PATCH] drm/fb-helper: move zeroing code to drm_fb_helper_fill_var + +__fill_var is used by both drm_fb_helper_check_var and +drm_fb_helper_fill_var. In drm_fb_helper_check_var, it is possible that +some of the variables in fb_info-> var which are currently being zero'ed +have pre-existing values. Zeroing these causes some fb tests to fail +with (from the Xorg.log): + +[ 9.897] (II) Module fbdevhw: vendor="X.Org Foundation" +[ 9.897] compiled for 1.21.1.8, module version = 0.0.2 +[ 9.897] ABI class: X.Org Video Driver, version 25.2 +[ 9.898] (II) FBDEV(0): using default device +[ 9.901] (==) FBDEV(0): Depth 24, (==) framebuffer bpp 32 +[ 9.902] (==) FBDEV(0): RGB weight 888 +[ 9.902] (==) FBDEV(0): Default visual is TrueColor +[ 9.902] (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0) +[ 9.902] (II) FBDEV(0): hardware: virtio_gpudrmfb (video memory: +4000kB) +[ 9.902] (DB) xf86MergeOutputClassOptions unsupported bus type 0 +[ 9.903] (II) FBDEV(0): checking modes against framebuffer device... +[ 9.904] (II) FBDEV(0): mode "640x480" test failed +[ 9.904] (II) FBDEV(0): mode "640x480" test failed +[ 9.904] (II) FBDEV(0): mode "640x480" test failed +[ 9.904] (II) FBDEV(0): mode "640x480" test failed +[ 9.904] (II) FBDEV(0): mode "640x480" not found +[ 9.904] (II) FBDEV(0): checking modes against monitor... +[ 9.905] (II) FBDEV(0): Virtual size is 1280x800 (pitch 1280) +[ 9.905] (**) FBDEV(0): Built-in mode "current" +[ 9.905] (==) FBDEV(0): DPI set to (96, 96) + +Previously, these values were not modified. Moving the zero'ing of the +variables to drm_fb_helper_fill_var resolves the issue. + +Fixes: ee4cce0a8f03 ("drm/fb-helper: fix input validation gaps in check_var") +Signed-off-by: Jon Mason <jon.mason@arm.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + drivers/gpu/drm/drm_fb_helper.c | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c +index fd27f1978635..ddc12c080dcc 100644 +--- a/drivers/gpu/drm/drm_fb_helper.c ++++ b/drivers/gpu/drm/drm_fb_helper.c +@@ -1548,8 +1548,6 @@ static void drm_fb_helper_fill_pixel_fmt(struct fb_var_screeninfo *var, + static void __fill_var(struct fb_var_screeninfo *var, struct fb_info *info, + struct drm_framebuffer *fb) + { +- int i; +- + var->xres_virtual = fb->width; + var->yres_virtual = fb->height; + var->accel_flags = 0; +@@ -1557,15 +1555,6 @@ static void __fill_var(struct fb_var_screeninfo *var, struct fb_info *info, + + var->height = info->var.height; + var->width = info->var.width; +- +- var->left_margin = var->right_margin = 0; +- var->upper_margin = var->lower_margin = 0; +- var->hsync_len = var->vsync_len = 0; +- var->sync = var->vmode = 0; +- var->rotate = 0; +- var->colorspace = 0; +- for (i = 0; i < 4; i++) +- var->reserved[i] = 0; + } + + /** +@@ -2059,6 +2048,7 @@ static void drm_fb_helper_fill_var(struct fb_info *info, + { + struct drm_framebuffer *fb = fb_helper->fb; + const struct drm_format_info *format = fb->format; ++ int i; + + switch (format->format) { + case DRM_FORMAT_C1: +@@ -2076,6 +2066,14 @@ static void drm_fb_helper_fill_var(struct fb_info *info, + info->pseudo_palette = fb_helper->pseudo_palette; + info->var.xoffset = 0; + info->var.yoffset = 0; ++ info->var.left_margin = info->var.right_margin = 0; ++ info->var.upper_margin = info->var.lower_margin = 0; ++ info->var.hsync_len = info->var.vsync_len = 0; ++ info->var.sync = info->var.vmode = 0; ++ info->var.rotate = 0; ++ info->var.colorspace = 0; ++ for (i = 0; i < 4; i++) ++ info->var.reserved[i] = 0; + __fill_var(&info->var, info, fb); + info->var.activate = FB_ACTIVATE_NOW; + +-- +2.34.1 + diff --git a/arch/arm/arm-ARM-EABI-socketcall.patch b/arch/arm/arm-ARM-EABI-socketcall.patch index a24b8767..53173c96 100644 --- a/arch/arm/arm-ARM-EABI-socketcall.patch +++ b/arch/arm/arm-ARM-EABI-socketcall.patch @@ -1,4 +1,4 @@ -From 1f05ef36493eb57d2b7bc4201b6bc105869ea702 Mon Sep 17 00:00:00 2001 +From 3502bc5ce0d25aae81727455869af362099c15bf Mon Sep 17 00:00:00 2001 From: Mark Asselstine <mark.asselstine@windriver.com> Date: Tue, 15 Jul 2008 15:49:27 -0400 Subject: [PATCH] arm: ARM EABI socketcall @@ -14,13 +14,13 @@ Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com> 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S -index eb5cd77bf1d8..41021ceedca4 100644 +index 7f0b7aba1498..49719a7d721c 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S -@@ -316,7 +316,8 @@ ENTRY(\sym) +@@ -352,7 +352,8 @@ ENTRY(\sym) + * With EABI a couple syscalls are obsolete and defined as sys_ni_syscall. */ syscall_table_start sys_call_table - #define COMPAT(nr, native, compat) syscall nr, native -#ifdef CONFIG_AEABI + +#if defined(CONFIG_AEABI) && !defined(CONFIG_OABI_COMPAT) @@ -28,5 +28,5 @@ index eb5cd77bf1d8..41021ceedca4 100644 #else #include <calls-oabi.S> -- -2.5.0 +2.19.1 diff --git a/arch/arm/arm-Makefile-Fix-systemtap.patch b/arch/arm/arm-Makefile-Fix-systemtap.patch deleted file mode 100644 index 163f12cb..00000000 --- a/arch/arm/arm-Makefile-Fix-systemtap.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 37c8f2a3df1e3154087538a27228fad0c6e172c5 Mon Sep 17 00:00:00 2001 -From: Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Sun, 10 Mar 2019 06:43:15 +0000 -Subject: [PATCH] arm/Makefile: Fix systemtap - -Currently systemtap fails to operate correctly on armv7 systems such as beaglebone and -soon, qemuarm. - -root@qemuarm:/usr/src/kernel# env -uARCH -uKBUILD_EXTMOD -uCROSS_COMPILE -uKBUILD_IMAGE -uKCONFIG_CONFIG -uINSTALL_PATH -uLD_LIBRARY_PATH PATH=/usr/bin:/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin make -C /lib/modules/4.19.19-yocto-standard/build M=/tmp/staptcNU6M modules CONFIG_DEBUG_INFO= CONFIG_STACK_VALIDATION= ARCH=arm stap_4321_src.i --no-print-directory -j2 V=1 -test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ -echo >&2; \ -echo >&2 " ERROR: Kernel configuration is invalid."; \ -echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ -echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ -echo >&2 ; \ -/bin/false) -mkdir -p /tmp/staptcNU6M/.tmp_versions ; rm -f /tmp/staptcNU6M/.tmp_versions/* -make -f ./scripts/Makefile.build obj=/tmp/staptcNU6M -(cat /dev/null; echo kernel//tmp/staptcNU6M/stap_4321.ko;) > /tmp/staptcNU6M/modules.order - gcc -Wp,-MD,/tmp/staptcNU6M/.stap_4321_src.o.d -nostdinc -isystem /usr/lib/gcc/arm-poky-linux-gnueabi/8.3.0/include -I./arch/arm/include -I./arch/arm/include/generated -I./include -I./arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mfpu=vfp -funwind-tables -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -Os -Wno-maybe-uninitialized --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -Iinclude2/asm/mach-default -I/lib/modules/4.19.19-yocto-standard/build -include /tmp/staptcNU6M/stapconf_4321.h -D "STP_NO_VELREL_CHECK" -freorder-blocks -fasynchronous-unwind-tables -Wframe-larger-than=512 -fno-ipa-icf -Wno-unused -Wno-tautological-compare -Werror -I/usr/share/systemtap/runtime -DMODULE -DKBUILD_BASENAME='"stap_4321_src"' -DKBUILD_MODNAME='"stap_4321"' -c -o /tmp/staptcNU6M/stap_4321_src.o /tmp/staptcNU6M/stap_4321_src.c -/tmp/ccaE9CMG.s: Assembler messages: -/tmp/ccaE9CMG.s:49: Error: selected processor does not support `dmb ish' in ARM mode -/tmp/ccaE9CMG.s:52: Error: architectural extension `mp' is not allowed for the current b - -(which was from running the stap command with -v -v -v -k and then being able to run the command individually) - -Note that it says armv5t above. - -That comes from the code this patch changes - -root@qemuarm:/usr/src/kernel# gcc -march=armv7-a /tmp/staptcNU6M/stap_4321_aux_0.c -cc1: error: -mfloat-abi=hard: selected processor lacks an FPU - -which makes me wonder if cc-option fails unless -mfpu-vfp is on the commandline too. - -Since we have a gcc which accepts the armv7-a arch, just remove the cc-option -wrapper unconditionally here. - -Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - arch/arm/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/Makefile b/arch/arm/Makefile -index 1f95ede8063f..9253b7533cb1 100644 ---- a/arch/arm/Makefile -+++ b/arch/arm/Makefile -@@ -64,7 +64,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) - # macro, but instead defines a whole series of macros which makes - # testing for a specific architecture or later rather impossible. - arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m --arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) -+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -march=armv7-a -Wa$(comma)-march=armv7-a - arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) - # Only override the compiler option if ARMv6. The ARMv6K extensions are - # always available in ARMv7 --- -2.19.1 - diff --git a/arch/arm/arm.cfg b/arch/arm/arm.cfg index d5380436..f2b36dca 100644 --- a/arch/arm/arm.cfg +++ b/arch/arm/arm.cfg @@ -2,8 +2,6 @@ # Build EABI kernels that support EABI system calls. CONFIG_AEABI=y -# Provide support for the old ABI's system calls. -CONFIG_OABI_COMPAT=y CONFIG_ARM_THUMB=y # Failure to use this on ARM results in lots of interesting runtime bugs. @@ -11,4 +9,4 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_UNWINDER_ARM=y -# CONFIG_FUNCTION_GRAPH_TRACER is not set +CONFIG_FUNCTION_GRAPH_TRACER=n diff --git a/arch/arm/arm.scc b/arch/arm/arm.scc index cfac7f13..39e0e6d7 100644 --- a/arch/arm/arm.scc +++ b/arch/arm/arm.scc @@ -10,4 +10,6 @@ include v7-A15/v7-A15.scc patch arm-ARM-EABI-socketcall.patch patch vexpress-Pass-LOADADDR-to-Makefile.patch -patch arm-Makefile-Fix-systemtap.patch +patch arm64-defconfig-cleanup-config-options.patch +patch 0001-drm-fb-helper-move-zeroing-code-to-drm_fb_helper_fil.patch +patch arm64-defconfig-remove-CONFIG_IPQ_APSS_5018.patch diff --git a/arch/arm/arm64-16kb-pages.cfg b/arch/arm/arm64-16kb-pages.cfg new file mode 100644 index 00000000..a83e1a50 --- /dev/null +++ b/arch/arm/arm64-16kb-pages.cfg @@ -0,0 +1 @@ +CONFIG_ARM64_16K_PAGES=y diff --git a/arch/arm/arm64-16kb-pages.scc b/arch/arm/arm64-16kb-pages.scc new file mode 100644 index 00000000..d2706c08 --- /dev/null +++ b/arch/arm/arm64-16kb-pages.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Use 16KB pages" +define KFEATURE_COMPATIBILITY arch + +kconf hardware arm64-16kb-pages.cfg diff --git a/arch/arm/arm64-4kb-pages.cfg b/arch/arm/arm64-4kb-pages.cfg new file mode 100644 index 00000000..5df91df1 --- /dev/null +++ b/arch/arm/arm64-4kb-pages.cfg @@ -0,0 +1 @@ +CONFIG_ARM64_4K_PAGES=y diff --git a/arch/arm/arm64-4kb-pages.scc b/arch/arm/arm64-4kb-pages.scc new file mode 100644 index 00000000..4ee7cac2 --- /dev/null +++ b/arch/arm/arm64-4kb-pages.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Use 4KB pages" +define KFEATURE_COMPATIBILITY arch + +kconf hardware arm64-4kb-pages.cfg diff --git a/arch/arm/arm64-64kb-pages.cfg b/arch/arm/arm64-64kb-pages.cfg new file mode 100644 index 00000000..bda5426d --- /dev/null +++ b/arch/arm/arm64-64kb-pages.cfg @@ -0,0 +1 @@ +CONFIG_ARM64_64K_PAGES=y diff --git a/arch/arm/arm64-64kb-pages.scc b/arch/arm/arm64-64kb-pages.scc new file mode 100644 index 00000000..efe60dae --- /dev/null +++ b/arch/arm/arm64-64kb-pages.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Use 64KB pages" +define KFEATURE_COMPATIBILITY arch + +kconf hardware arm64-64kb-pages.cfg diff --git a/arch/arm/arm64-defconfig-cleanup-config-options.patch b/arch/arm/arm64-defconfig-cleanup-config-options.patch new file mode 100644 index 00000000..46023e3c --- /dev/null +++ b/arch/arm/arm64-defconfig-cleanup-config-options.patch @@ -0,0 +1,49 @@ +From 14e71de7e9d610c2ce6d2cfa064e6c392304bd38 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross@burtonini.com> +Date: Tue, 11 Jan 2022 12:02:36 +0000 +Subject: [PATCH] arm64: defconfig: cleanup config options + +arm64: defconfig: drop unused POWER_AVS option +Commit 785b5bb41b0a ("PM: AVS: Drop the avs directory and the +corresponding Kconfig") moved AVS code to SOC-specific folders, and +removed corresponding Kconfig from drivers/power, leaving original +POWER_AVS config option enabled in some defconfigs. +Remove the options, which have no references in the tree anymore. + +arm64: defconfig: set CONFIG_USB_CONN_GPIO=y +Since 10a7b37b5b ("arm64: Update default configuration") PHY_TEGRA_XUSB +is set to y. That option needs USB_CONN_GPIO to also be y not m, so +set USB_CONN_GPIO explicitly to y to reflect reality. + +arm64: defconfig: remove obsolete CONFIG_ARCH_AGILEX and CONFIG_ARCH_N5X +These config options were removed in 4a9a1a5602 ("arm64: socfpga: merge +Agilex and N5X into ARCH_INTEL_SOCFPGA"), so remove them from the +defconfig. + +arm64: defconfig: don't set CONFIG_ACPI_APEI_PCIEAER +Since 8c8ff55 ("PCI/AER: Don't select CONFIG_PCIEAER by default"), PCIe +Advanced Error Reporting isn't enabled by default.. As this means just +enabling CONFIG_CPI_APEI_PCIEAR does not have an effect, remove it from +the defconfig for clarity. + +Signed-off-by: Ross Burton <ross.burton@arm.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + arch/arm64/configs/defconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig +index 50aa3d75ab4f..cd1b2d865baf 100644 +--- a/arch/arm64/configs/defconfig ++++ b/arch/arm64/configs/defconfig +@@ -103,7 +103,6 @@ CONFIG_QORIQ_CPUFREQ=y + CONFIG_ACPI=y + CONFIG_ACPI_APEI=y + CONFIG_ACPI_APEI_GHES=y +-CONFIG_ACPI_APEI_PCIEAER=y + CONFIG_ACPI_APEI_MEMORY_FAILURE=y + CONFIG_ACPI_APEI_EINJ=y + CONFIG_VIRTUALIZATION=y +-- +2.19.1 + diff --git a/arch/arm/arm64-defconfig-remove-CONFIG_IPQ_APSS_5018.patch b/arch/arm/arm64-defconfig-remove-CONFIG_IPQ_APSS_5018.patch new file mode 100644 index 00000000..e36c20ff --- /dev/null +++ b/arch/arm/arm64-defconfig-remove-CONFIG_IPQ_APSS_5018.patch @@ -0,0 +1,29 @@ +From b0dbb1ddc539b556ac1920ff704ec4099f8ca392 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@arm.com> +Date: Thu, 4 Jan 2024 13:32:41 +0000 +Subject: [PATCH] arm64: defconfig: remove CONFIG_IPQ_APSS_5018 + +This was added in 7f0c873 ("Enable IPQ5018 SoC base configs"), but there +is no IPQ_APSS_5018 config defined in the kconfig at present. + +Signed-off-by: Ross Burton <ross.burton@arm.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + arch/arm64/configs/defconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig +index 88c0cfdd5581..bd6b6be68d3f 100644 +--- a/arch/arm64/configs/defconfig ++++ b/arch/arm64/configs/defconfig +@@ -1248,7 +1248,6 @@ CONFIG_QCOM_CLK_APCC_MSM8996=y + CONFIG_QCOM_CLK_SMD_RPM=y + CONFIG_QCOM_CLK_RPMH=y + CONFIG_IPQ_APSS_6018=y +-CONFIG_IPQ_APSS_5018=y + CONFIG_IPQ_GCC_5018=y + CONFIG_IPQ_GCC_5332=y + CONFIG_IPQ_GCC_6018=y +-- +2.39.2 + diff --git a/arch/microblaze/microblaze.cfg b/arch/microblaze/microblaze.cfg index ba4773ba..db506551 100644 --- a/arch/microblaze/microblaze.cfg +++ b/arch/microblaze/microblaze.cfg @@ -15,5 +15,5 @@ CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=0 CONFIG_XILINX_MICROBLAZE0_USE_FPU=0 # Disable FTRACE, does not work with MicroBlaze -# CONFIG_FTRACE is not set +CONFIG_FTRACE=n diff --git a/arch/mips/mips-make-current_cpu_data-preempt-safe.patch b/arch/mips/mips-make-current_cpu_data-preempt-safe.patch new file mode 100644 index 00000000..c68b5f46 --- /dev/null +++ b/arch/mips/mips-make-current_cpu_data-preempt-safe.patch @@ -0,0 +1,68 @@ +From 5b2595c3e0dce2912b32ef69aaaacd52cd0e720c Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Fri, 29 Sep 2023 00:11:41 +0000 +Subject: [PATCH] mips: make current_cpu_data preempt safe + +When DEBUG_PREEMPT is enabled, mips/mips64 boots are filled with +backtraces similar to: + + [ 130.730686] BUG: using smp_processor_id() in preemptible [00000000] code: systemd/1 + [ 130.738542] caller is blast_dcache32+0x40/0x190 + [ 130.745908] CPU: 0 PID: 1 Comm: systemd Not tainted 6.4.11-yocto-standard #1 + [ 130.753928] Stack : 0000000000000001 0000000000000000 0000000000000018 9000000004937798 + [ 130.762192] 9000000004937798 90000000049378c8 0000000000000000 0000000000000000 + [ 130.770458] 008fac6060240fea 0000000000014f20 9000000004937728 0000000000000000 + [ 130.778826] 00000000000b61b4 0000000000000030 ffffffff80e8eed0 0000000000000004 + [ 130.787111] 9000000084937577 0000000000000000 0000000000000000 ffffffff810c3b18 + [ 130.795440] ffffffff811f0000 0000000000000000 ffffffff81440000 0000000000000000 + [ 130.803830] 0000000000000000 0000000000000000 ffffffff809842e8 0000000000175097 + [ 130.812272] 0000000000000001 9000000004934000 9000000004937790 c0000000005d9000 + [ 130.820722] ffffffff8010b6fc 0000000000000000 0000000000000000 0000000000000000 + [ 130.829134] 0000000000000000 0000000000000000 ffffffff8010b71c 008fac6060240fea + [ 130.837649] ... + [ 130.845556] Call Trace: + [ 130.853432] [<ffffffff8010b71c>] show_stack+0x64/0x158 + [ 130.861534] [<ffffffff80ea1790>] dump_stack_lvl+0x5c/0x7c + [ 130.869565] [<ffffffff80ea29c4>] check_preemption_disabled+0x10c/0x118 + [ 130.877605] [<ffffffff8012d7c8>] blast_dcache32+0x40/0x190 + [ 130.885585] [<ffffffff8039f648>] __vmalloc_node_range+0x3e0/0x780 + [ 130.893527] [<ffffffff8039fbbc>] vzalloc+0x6c/0x78 + [ 130.901378] [<ffffffff8095d6c4>] n_tty_open+0x1c/0xb8 + [ 130.909252] [<ffffffff8095f5a8>] tty_ldisc_open+0x50/0xd0 + [ 130.917053] [<ffffffff80960150>] tty_ldisc_setup+0x20/0x70 + [ 130.924927] [<ffffffff80958694>] tty_init_dev.part.0+0xbc/0x2c0 + [ 130.932742] [<ffffffff80958da8>] tty_open+0x4b8/0x730 + [ 130.940486] [<ffffffff803e6960>] chrdev_open+0xe0/0x250 + [ 130.948211] [<ffffffff803da7f4>] do_dentry_open+0x274/0x520 + [ 130.955960] [<ffffffff803f642c>] path_openat+0xbc4/0x10d8 + [ 130.963718] [<ffffffff803f7460>] do_filp_open+0x148/0x190 + [ 130.971482] [<ffffffff803dc264>] do_sys_openat2+0xcc/0x1b0 + [ 130.979288] [<ffffffff803dc710>] sys_openat+0x50/0xa8 + [ 130.987077] [<ffffffff80119490>] syscall_common+0x34/0x58 + +We don't control the locking around current_cpu_data, so it cannot use +smp_processor_id() as the cpu index. + +To make ourselves safe in any context, we must use raw_smp_processor_id() + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + arch/mips/include/asm/cpu-info.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h +index a600670d00e9..07f9cddd6c77 100644 +--- a/arch/mips/include/asm/cpu-info.h ++++ b/arch/mips/include/asm/cpu-info.h +@@ -117,7 +117,7 @@ struct cpuinfo_mips { + } __attribute__((aligned(SMP_CACHE_BYTES))); + + extern struct cpuinfo_mips cpu_data[]; +-#define current_cpu_data cpu_data[smp_processor_id()] ++#define current_cpu_data cpu_data[raw_smp_processor_id()] + #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] + #define boot_cpu_data cpu_data[0] + +-- +2.34.1 + diff --git a/arch/mips/mips.scc b/arch/mips/mips.scc index 299c3c74..088a934b 100644 --- a/arch/mips/mips.scc +++ b/arch/mips/mips.scc @@ -9,3 +9,4 @@ patch malta-uhci-quirks-make-allowance-for-slow-4k-e-c.patch patch 4kc-cache-tlb-hazard-tlbp-cache-coherency.patch patch mips-Kconfig-add-QEMUMIPS64-option.patch patch mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch +patch mips-make-current_cpu_data-preempt-safe.patch diff --git a/arch/powerpc/crtsavres-fixups-for-5.4.patch b/arch/powerpc/crtsavres-fixups-for-5.4.patch deleted file mode 100644 index e3f09715..00000000 --- a/arch/powerpc/crtsavres-fixups-for-5.4.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f103dbd2b479057481bef2bc21060e05304be15e Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Tue, 15 Oct 2019 22:55:17 -0400 -Subject: [PATCH] crtsavres: fixups for 5.4+ - -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - arch/powerpc/Makefile | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile -index c76c406faa59..7471b0160e84 100644 ---- a/arch/powerpc/Makefile -+++ b/arch/powerpc/Makefile -@@ -416,6 +416,9 @@ endif - archclean: - $(Q)$(MAKE) $(clean)=$(boot) - -+arch/powerpc/lib/crtsavres.o: arch/powerpc/lib/crtsavres.S -+ $(Q)$(MAKE) $(build)=arch/powerpc/lib arch/powerpc/lib/crtsavres.o -+ - archprepare: checkbin arch/powerpc/lib/crtsavres.o - - archheaders: --- -2.19.1 - diff --git a/arch/powerpc/powerpc-Add-unwind-information-for-SPE-registers-of-.patch b/arch/powerpc/powerpc-Add-unwind-information-for-SPE-registers-of-.patch deleted file mode 100644 index a6b43fd4..00000000 --- a/arch/powerpc/powerpc-Add-unwind-information-for-SPE-registers-of-.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 87398e3c68b21d06817c44ca39449ef382d2ce31 Mon Sep 17 00:00:00 2001 -From: Liming Wang <liming.wang@windriver.com> -Date: Fri, 19 Dec 2008 11:16:39 +0800 -Subject: [PATCH 1/3] powerpc: Add unwind information for SPE registers of E500 core - -SPE registers use the high part bit0~bit31 of E500 GPR0~GPR31. -The unwind information in "eh_frame" section is used during exception -handling and describes register information in the signal frame. But -current unwind information doesn't cover SPE registers, which have -been saved in the signal frame. This patch adds this unwind information -to "eh_frame" section. - -SPE registers use register number 1200+N to identify register 'N', but -they start from 113 in unwind column, which is computed from gcc -source code, macro DWARF_REG_TO_UNWIND_COLUMN: - - #define FIRST_PSEUDO_REGISTER 114 - #define DWARF_REG_TO_UNWIND_COLUMN(r) \ - ((r) > 1200 ? ((r) - 1200 + FIRST_PSEUDO_REGISTER - 1) : (r)) - -Signed-off-by: Liming Wang <liming.wang@windriver.com> ---- - arch/powerpc/kernel/vdso32/sigtramp.S | 34 +++++++++++++++++++++++++++++++++ - 1 files changed, 34 insertions(+), 0 deletions(-) - -diff --git a/arch/powerpc/kernel/vdso32/sigtramp.S b/arch/powerpc/kernel/vdso32/sigtramp.S -index 68d49dd..789a343 100644 ---- a/arch/powerpc/kernel/vdso32/sigtramp.S -+++ b/arch/powerpc/kernel/vdso32/sigtramp.S -@@ -251,6 +251,40 @@ V_FUNCTION_END(__kernel_sigtramp_rt32) - vsave_msr1 (31); \ - vsave_msr2 (33, 32*16+12); \ - vsave (32, 32*16) -+#elif defined(CONFIG_SPE) -+#define EH_FRAME_VMX \ -+ rsave (113, VREGS); \ -+ rsave (114, VREGS + 1*4); \ -+ rsave (115, VREGS + 2*4); \ -+ rsave (116, VREGS + 3*4); \ -+ rsave (117, VREGS + 4*4); \ -+ rsave (118, VREGS + 5*4); \ -+ rsave (119, VREGS + 6*4); \ -+ rsave (120, VREGS + 7*4); \ -+ rsave (121, VREGS + 8*4); \ -+ rsave (122, VREGS + 9*4); \ -+ rsave (123, VREGS + 10*4); \ -+ rsave (124, VREGS + 11*4); \ -+ rsave (125, VREGS + 12*4); \ -+ rsave (126, VREGS + 13*4); \ -+ rsave (127, VREGS + 14*4); \ -+ rsave (128, VREGS + 15*4); \ -+ rsave (129, VREGS + 16*4); \ -+ rsave (130, VREGS + 17*4); \ -+ rsave (131, VREGS + 18*4); \ -+ rsave (132, VREGS + 19*4); \ -+ rsave (133, VREGS + 20*4); \ -+ rsave (134, VREGS + 21*4); \ -+ rsave (135, VREGS + 22*4); \ -+ rsave (136, VREGS + 23*4); \ -+ rsave (137, VREGS + 24*4); \ -+ rsave (138, VREGS + 25*4); \ -+ rsave (139, VREGS + 26*4); \ -+ rsave (140, VREGS + 27*4); \ -+ rsave (141, VREGS + 28*4); \ -+ rsave (142, VREGS + 29*4); \ -+ rsave (143, VREGS + 30*4); \ -+ rsave (144, VREGS + 31*4); - #else - #define EH_FRAME_VMX - #endif --- -1.6.5.2 - diff --git a/arch/powerpc/powerpc-Disable-attribute-alias-warnings-from-gcc8.patch b/arch/powerpc/powerpc-Disable-attribute-alias-warnings-from-gcc8.patch deleted file mode 100644 index 758cdc24..00000000 --- a/arch/powerpc/powerpc-Disable-attribute-alias-warnings-from-gcc8.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 12b9bbf23f1962446491244ab2379cf47abe09be Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 4 May 2018 09:46:42 -0700 -Subject: [PATCH] powerpc: Disable attribute-alias warnings from gcc8 - -Fixes -alias between functions of incompatible types warnings -which are new with gcc8 - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - arch/powerpc/kernel/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile -index 1c4385852d3d..7c1ad95b1859 100644 ---- a/arch/powerpc/kernel/Makefile -+++ b/arch/powerpc/kernel/Makefile -@@ -4,7 +4,8 @@ - # - - ifdef CONFIG_PPC64 --CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) -+CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) $(call cc-disable-warning, attribute-alias) -+CFLAGS_syscalls.o += $(call cc-disable-warning, attribute-alias) - endif - ifdef CONFIG_PPC32 - CFLAGS_prom_init.o += -fPIC --- -2.19.1 - diff --git a/arch/powerpc/powerpc-add-crtsavres.o-to-archprepare-for-kbuild.patch b/arch/powerpc/powerpc-add-crtsavres.o-to-archprepare-for-kbuild.patch deleted file mode 100644 index 27119879..00000000 --- a/arch/powerpc/powerpc-add-crtsavres.o-to-archprepare-for-kbuild.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f13fd6af4120b8b42d77377c9989457cda41899f Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@windriver.com> -Date: Sun, 15 Feb 2009 16:57:14 -0500 -Subject: [PATCH 3/3] powerpc: add crtsavres.o to archprepare for kbuild - -upstream commit da3de6df33f5f42ff9dc40093fbc884f524c9a49 adds -a dependency to all kernel modules to crtsavres. This -ensures that out-of-line register saves/restores work when -CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled. - -What it didn't do was ensure that it was built when -modules_prepare was run and hence out of tree powerpc kernel -modules can't properly link. - -The fix is to add crtsavres.o to the archprepare rule in -the arch/powerpc/Makefile - -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - arch/powerpc/Makefile | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile -index c3811ab..ad16ff3 100644 ---- a/arch/powerpc/Makefile -+++ b/arch/powerpc/Makefile -@@ -218,7 +218,7 @@ endif - archclean: - $(Q)$(MAKE) $(clean)=$(boot) - --archprepare: checkbin -+archprepare: checkbin arch/powerpc/lib/crtsavres.o - - # Use the file '.tmp_gas_check' for binutils tests, as gas won't output - # to stdout and these checks are run even on install targets. --- -1.6.5.2 - diff --git a/arch/powerpc/powerpc-debug.cfg b/arch/powerpc/powerpc-debug.cfg new file mode 100644 index 00000000..6ea12a12 --- /dev/null +++ b/arch/powerpc/powerpc-debug.cfg @@ -0,0 +1 @@ +CONFIG_PPC_DISABLE_WERROR=y diff --git a/arch/powerpc/powerpc-debug.scc b/arch/powerpc/powerpc-debug.scc new file mode 100644 index 00000000..aedb597c --- /dev/null +++ b/arch/powerpc/powerpc-debug.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT + +kconf non-hardware powerpc-debug.cfg diff --git a/arch/powerpc/powerpc-kexec-fix-for-powerpc64.patch b/arch/powerpc/powerpc-kexec-fix-for-powerpc64.patch deleted file mode 100644 index d979885a..00000000 --- a/arch/powerpc/powerpc-kexec-fix-for-powerpc64.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 85388aad8ca15fcc28f5d0989265217351bada19 Mon Sep 17 00:00:00 2001 -From: Benjamin Walsh <benjamin.walsh@windriver.com> -Date: Mon, 9 Feb 2009 14:25:47 -0500 -Subject: [PATCH] powerpc: kexec fix for powerpc64 - -slbia instruction invalidates the SLB, but there was a hang on the first -instruction that caused an SLB miss exception. Doing a full sync after -the slbia causes the SLB to be in a consistent state for the handling of -the SLB exception. - -Signed-off by: Benjamin Walsh <benjamin.walsh@windriver.com> ---- - arch/powerpc/mm/book3s64/slb.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/powerpc/mm/book3s64/slb.c b/arch/powerpc/mm/book3s64/slb.c -index 515730e499fe..7a8b335003b6 100644 ---- a/arch/powerpc/mm/book3s64/slb.c -+++ b/arch/powerpc/mm/book3s64/slb.c -@@ -331,6 +331,7 @@ void slb_initialize(void) - asm volatile("isync":::"memory"); - asm volatile("slbmte %0,%0"::"r" (0) : "memory"); - asm volatile("isync; slbia; isync":::"memory"); -+ mb(); - create_shadowed_slbe(PAGE_OFFSET, mmu_kernel_ssize, lflags, LINEAR_INDEX); - create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, VMALLOC_INDEX); - --- -2.1.0 - diff --git a/arch/powerpc/powerpc-ptrace-Disable-array-bounds-warning-with-gcc.patch b/arch/powerpc/powerpc-ptrace-Disable-array-bounds-warning-with-gcc.patch deleted file mode 100644 index 2f671515..00000000 --- a/arch/powerpc/powerpc-ptrace-Disable-array-bounds-warning-with-gcc.patch +++ /dev/null @@ -1,29 +0,0 @@ -From f394300b4bbeb66370ca730d070769d84caece4a Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 4 May 2018 09:50:05 -0700 -Subject: [PATCH] powerpc/ptrace: Disable array-bounds warning with gcc8 - -This masks the new gcc8 warning -include/linux/regset.h:270:4: error: 'memcpy' offset [-527, -529] is out of the bounds [0, 16] of object 'vrsave' with type 'union <anonymous>' - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - arch/powerpc/kernel/Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile -index 7c1ad95b1859..b3f73e686662 100644 ---- a/arch/powerpc/kernel/Makefile -+++ b/arch/powerpc/kernel/Makefile -@@ -5,6 +5,7 @@ - - ifdef CONFIG_PPC64 - CFLAGS_prom_init.o += $(NO_MINIMAL_TOC) $(call cc-disable-warning, attribute-alias) -+CFLAGS_ptrace.o += $(call cc-disable-warning, array-bounds) - CFLAGS_syscalls.o += $(call cc-disable-warning, attribute-alias) - endif - ifdef CONFIG_PPC32 --- -2.19.1 - diff --git a/arch/powerpc/powerpc.scc b/arch/powerpc/powerpc.scc index d3f7e2fb..548d2d44 100644 --- a/arch/powerpc/powerpc.scc +++ b/arch/powerpc/powerpc.scc @@ -1,7 +1 @@ # SPDX-License-Identifier: MIT -patch powerpc-Add-unwind-information-for-SPE-registers-of-.patch -patch powerpc-kexec-fix-for-powerpc64.patch -patch powerpc-add-crtsavres.o-to-archprepare-for-kbuild.patch -patch powerpc-Disable-attribute-alias-warnings-from-gcc8.patch -patch powerpc-ptrace-Disable-array-bounds-warning-with-gcc.patch -patch crtsavres-fixups-for-5.4.patch diff --git a/arch/x86/x86.scc b/arch/x86/x86.scc index 548d2d44..a055f389 100644 --- a/arch/x86/x86.scc +++ b/arch/x86/x86.scc @@ -1 +1,2 @@ # SPDX-License-Identifier: MIT +patch x86_64_defconfig-Fix-warnings.patch diff --git a/arch/x86/x86_64_defconfig-Fix-warnings.patch b/arch/x86/x86_64_defconfig-Fix-warnings.patch new file mode 100644 index 00000000..163effb2 --- /dev/null +++ b/arch/x86/x86_64_defconfig-Fix-warnings.patch @@ -0,0 +1,109 @@ +From a9590c3b985938a5882f4b6f83deb0b108cceabd Mon Sep 17 00:00:00 2001 +From: Naveen Saini <naveen.kumar.saini@intel.com> +Date: Fri, 21 Jan 2022 16:46:21 +0800 +Subject: [PATCH] x86_64_defconfig: Fix warnings + +Configure CONFIG_EEEPC_LAPTOP & CONFIG_SND_SEQ_DUMMY as modules, because +dependencies are configured as modules. + [NOTE]: 'CONFIG_EEEPC_LAPTOP' last val (y) and .config val (m) do not match + [NOTE]: 'CONFIG_SND_SEQ_DUMMY' last val (y) and .config val (m) do not match + +Added dependency configurations: + CONFIG_HID_LOGITECH for CONFIG_LOGITECH_FF + CONFIG_NET_VENDOR_DEC for CONFIG_NET_TULIP + CONFIG_IOMMU_SUPPORT for CONFIG_AMD_IOOMU & CONFIG_INTEL_IOMMU + CONFIG_NET_VENDOR_NVIDIA for CONFIG_FORCEDETH + + Config 'LOGITECH_FF' has the following Direct dependencies (LOGITECH_FF=n): + HID_LOGITECH(=n) && HID(=y) && INPUT(=y) + Parent dependencies are: + HID_LOGITECH [n] HID [y] INPUT [y] + [INFO]: config 'CONFIG_LOGITECH_FF' was set, but it wasn't assignable, check (parent) dependencies + + Config 'NET_TULIP' has the following Direct dependencies (NET_TULIP=n): + PCI(=y) || EISA(=n) || CARDBUS(=y) (=y) && NET_VENDOR_DEC(=n) && ETHERNET(=y) && NETDEVICES(=y) + Parent dependencies are: + NET_VENDOR_DEC [n] ETHERNET [y] EISA [n] PCI [y] CARDBUS [y] NETDEVICES [y] + [INFO]: config 'CONFIG_NET_TULIP' was set, but it wasn't assignable, check (parent) dependencies + + Config 'FORCEDETH' has the following Direct dependencies (FORCEDETH=n): + PCI(=y) && NET_VENDOR_NVIDIA(=n) && ETHERNET(=y) && NETDEVICES(=y) + Parent dependencies are: + NETDEVICES [y] PCI [y] NET_VENDOR_NVIDIA [n] ETHERNET [y] + [INFO]: config 'CONFIG_FORCEDETH' was set, but it wasn't assignable, check (parent) dependencies + +Tested with qemux86-64 machine: +$ oe-selftest --run-tests kerneldevelopment.KernelConfigs + +Disabled debug configurations. Yocto-kernel-cahce have seperate debug configurations. + +Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + arch/x86/configs/x86_64_defconfig | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig +index 27759236fd60..a3d260605161 100644 +--- a/arch/x86/configs/x86_64_defconfig ++++ b/arch/x86/configs/x86_64_defconfig +@@ -132,7 +132,7 @@ CONFIG_PCCARD=y + CONFIG_YENTA=y + CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y +-CONFIG_DEBUG_DEVRES=y ++CONFIG_DEBUG_DEVRES=n + CONFIG_CONNECTOR=y + CONFIG_BLK_DEV_LOOP=y + CONFIG_VIRTIO_BLK=y +@@ -160,11 +160,13 @@ CONFIG_NETCONSOLE=y + CONFIG_VIRTIO_NET=y + CONFIG_TIGON3=y + CONFIG_NET_TULIP=y ++CONFIG_NET_VENDOR_DEC=y + CONFIG_E100=y + CONFIG_E1000=y + CONFIG_E1000E=y + CONFIG_SKY2=y + CONFIG_FORCEDETH=y ++CONFIG_NET_VENDOR_NVIDIA=y + CONFIG_8139TOO=y + CONFIG_R8169=y + CONFIG_INPUT_EVDEV=y +@@ -201,12 +203,13 @@ CONFIG_SOUND=y + CONFIG_SND=y + CONFIG_SND_HRTIMER=y + CONFIG_SND_SEQUENCER=y +-CONFIG_SND_SEQ_DUMMY=y ++CONFIG_SND_SEQ_DUMMY=m + CONFIG_SND_HDA_INTEL=y + CONFIG_SND_HDA_HWDEP=y + CONFIG_HIDRAW=y + CONFIG_HID_GYRATION=y + CONFIG_LOGITECH_FF=y ++CONFIG_HID_LOGITECH=y + CONFIG_HID_NTRIG=y + CONFIG_HID_PANTHERLORD=y + CONFIG_PANTHERLORD_FF=y +@@ -231,10 +234,11 @@ CONFIG_RTC_CLASS=y + CONFIG_DMADEVICES=y + CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO_INPUT=y +-CONFIG_EEEPC_LAPTOP=y ++CONFIG_EEEPC_LAPTOP=m + CONFIG_AMD_IOMMU=y + CONFIG_INTEL_IOMMU=y + # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set ++CONFIG_IOMMU_SUPPORT=y + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y + CONFIG_EXT4_FS_SECURITY=y +@@ -276,4 +280,4 @@ CONFIG_SCHEDSTATS=y + CONFIG_BLK_DEV_IO_TRACE=y + CONFIG_PROVIDE_OHCI1394_DMA_INIT=y + CONFIG_EARLY_PRINTK_DBGP=y +-CONFIG_DEBUG_BOOT_PARAMS=y ++CONFIG_DEBUG_BOOT_PARAMS=n +-- +2.34.1 + diff --git a/bsp/amd-x86/amd-x86-64-preempt-rt.scc b/bsp/amd-x86/amd-x86-64-preempt-rt.scc new file mode 100644 index 00000000..2e503bbe --- /dev/null +++ b/bsp/amd-x86/amd-x86-64-preempt-rt.scc @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +define KMACHINE amd-x86-64 +define KTYPE preempt-rt +define KARCH x86-64 + +include ktypes/preempt-rt/preempt-rt.scc + +include amd-x86-64.scc diff --git a/bsp/amd-x86/amd-x86-64-standard.scc b/bsp/amd-x86/amd-x86-64-standard.scc new file mode 100644 index 00000000..d5a2a788 --- /dev/null +++ b/bsp/amd-x86/amd-x86-64-standard.scc @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +define KMACHINE amd-x86-64 +define KTYPE standard +define KARCH x86-64 + +include ktypes/standard/standard.scc +include features/transparent-hugepage/transparent-hugepage.scc +include amd-x86-64.scc diff --git a/bsp/amd-x86/amd-x86-64.scc b/bsp/amd-x86/amd-x86-64.scc new file mode 100644 index 00000000..87f23b51 --- /dev/null +++ b/bsp/amd-x86/amd-x86-64.scc @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: MIT +# Core configuration settings for x86_64 +include cfg/x86_64.scc + +include cfg/vesafb.scc +include cfg/8250.scc +include cfg/sound.scc +include cfg/efi-ext.scc +include cfg/virtio.scc +include cfg/boot-live.scc +include cfg/usb-mass-storage.scc +include features/profiling/profiling.scc + +include features/netfilter/netfilter.scc +include features/scsi/cdrom.scc +include features/usb/ehci-hcd.scc +include features/usb/uhci-hcd.scc +include features/usb/ohci-hcd.scc +include features/usb/xhci-hcd.scc +include features/usb/touchscreen-composite.scc +include features/scsi/cdrom.scc +include features/spi/spi.scc +include features/spi/spidev.scc +include features/sound/snd_hda_intel.scc +include features/igb/igb.scc + +kconf hardware bsp/common-pc/common-pc-drivers.cfg +kconf hardware bsp/common-pc/common-pc-eth.cfg +kconf hardware bsp/common-pc/common-pc-gfx.cfg +kconf hardware bsp/common-pc/common-pc-wifi.cfg + +kconf hardware amd-x86.cfg diff --git a/bsp/amd-x86/amd-x86.cfg b/bsp/amd-x86/amd-x86.cfg new file mode 100644 index 00000000..45fa2b92 --- /dev/null +++ b/bsp/amd-x86/amd-x86.cfg @@ -0,0 +1,96 @@ +# SPDX-License-Identifier: MIT + +# +# Processor type and features +# +CONFIG_X86_AMD_PLATFORM_DEVICE=y +CONFIG_MICROCODE=y +CONFIG_PERF_EVENTS_AMD_POWER=y +CONFIG_PERF_EVENTS_AMD_UNCORE=y +CONFIG_AMD_MEM_ENCRYPT=y + +# +# Device Drivers +# +CONFIG_PCI_IOV=y +CONFIG_AMD_PMC=y +CONFIG_AMD_IOMMU=y +CONFIG_AMD_IOMMU_V2=y +CONFIG_E1000E=y +CONFIG_AMD_XGBE=y + +# +# DMA engine configuration +# +CONFIG_DMADEVICES=y + +# +# Serial drivers +# +CONFIG_SERIAL_8250_DMA=y +CONFIG_SERIAL_8250_NR_UARTS=16 +CONFIG_SERIAL_8250_RUNTIME_UARTS=16 +CONFIG_SERIAL_8250_DW=y + +# +# Graphics support +# +CONFIG_DRM_RADEON=m +CONFIG_DRM_RADEON_USERPTR=y + +# +# PPS generators support +# +CONFIG_PINCTRL_AMD=y + +# +# Native drivers +# +CONFIG_SENSORS_K10TEMP=m + +# +# Watchdog Device Drivers +# +CONFIG_SP5100_TCO=m + +# +#Miscellaneous filesystems +# +CONFIG_PSTORE=m + +# +# EFI (Extensible Firmware Interface) Support +# +CONFIG_EFI_VARS_PSTORE=m + +# +# I2C support +# +CONFIG_I2C_CHARDEV=m + +# +# I2C Hardware Bus support +# +CONFIG_I2C_PIIX4=m + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +CONFIG_I2C_DESIGNWARE_CORE=m +CONFIG_I2C_DESIGNWARE_PLATFORM=m +CONFIG_I2C_DESIGNWARE_PCI=m + +# +# CPU frequency scaling drivers +# +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_ACPI_CPUFREQ_CPB=y +CONFIG_X86_AMD_FREQ_SENSITIVITY=m + +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +CONFIG_CPU_FREQ_GOV_USERSPACE=m +CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-gfx.cfg b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-gfx.cfg index 5e7519e0..83c71ae6 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-gfx.cfg +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-gfx.cfg @@ -1,8 +1,16 @@ # SPDX-License-Identifier: MIT +CONFIG_INPUT=y +CONFIG_USB_HID=y + +CONFIG_INPUT_MISC=y +CONFIG_INPUT_UINPUT=y + +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_ARM_VERSATILE=y +CONFIG_DRM_PL111=y + CONFIG_FB=y CONFIG_FB_ARMCLCD=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_INPUT_TABLET=y -CONFIG_HID_WACOM=y -CONFIG_INPUT_MISC=y +CONFIG_AUXDISPLAY=y +CONFIG_ARM_CHARLCD=y diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.cfg b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.cfg new file mode 100644 index 00000000..90b54382 --- /dev/null +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_LEDS_TRIGGER_CPU=n +CONFIG_FUNCTION_GRAPH_TRACER=n diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.scc b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.scc index 8dbe0e86..c1a9d34e 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.scc +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt.scc @@ -1,10 +1,14 @@ # SPDX-License-Identifier: MIT define KMACHINE arm-versatile-926ejs define KMACHINE qemuarmv5 -define KMACHINE qemuarm define KTYPE preempt-rt define KARCH arm # no new branch required, re-use the ktypes/preempt-rt/preempt-rt.scc branch include ktypes/preempt-rt/preempt-rt.scc +branch arm-versatile-926ejs + include arm-versatile-926ejs.scc +kconf hardware arm-versatile-926ejs-preempt-rt.cfg + +patch arm_versatile_926ejs-kick-off-PrimeCell-RTC-PL031.patch diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard.scc b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard.scc index 6edfe67b..a88f385d 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard.scc +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard.scc @@ -1,7 +1,6 @@ # SPDX-License-Identifier: MIT define KMACHINE arm-versatile-926ejs define KMACHINE qemuarmv5 -define KMACHINE qemuarm define KTYPE standard define KARCH arm diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-tiny.scc b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-tiny.scc index d22969f0..51d59703 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs-tiny.scc +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs-tiny.scc @@ -1,13 +1,13 @@ # SPDX-License-Identifier: MIT define KMACHINE arm-versatile-926ejs define KMACHINE qemuarmv5 -define KMACHINE qemuarm define KTYPE tiny define KARCH arm include ktypes/tiny/tiny.scc branch arm-versatile-926ejs +include features/hid/hid.scc include arm-versatile-926ejs.scc patch arm_versatile_926ejs-kick-off-PrimeCell-RTC-PL031.patch diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs.cfg b/bsp/arm-versatile-926ejs/arm-versatile-926ejs.cfg index 1f41220f..c1964054 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs.cfg +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs.cfg @@ -1,78 +1,78 @@ # SPDX-License-Identifier: MIT -#......................................................................... -# WARNING -# -# This file is a kernel configuration fragment, and not a full kernel -# configuration file. The final kernel configuration is made up of -# an assembly of processed fragments, each of which is designed to -# capture a specific part of the final configuration (e.g. platform -# configuration, feature configuration, and board specific hardware -# configuration). For more information on kernel configuration, please -# consult the product documentation. -# -#......................................................................... CONFIG_ARM=y -CONFIG_ARM_AMBA=y -CONFIG_CPU_ARM926T=y -CONFIG_CPU_32v5=y +CONFIG_MMU=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V7=n +CONFIG_ARCH_MULTI_V6=n CONFIG_ARCH_MULTI_V5=y -# CONFIG_ARCH_MULTI_V7 is not set -CONFIG_PCI_VERSATILE=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_TLB_V4WBI=y -CONFIG_CPU_COPY_V4WB=y -CONFIG_CPU_ABRT_EV5TJ=y CONFIG_ARCH_VERSATILE=y +CONFIG_PLAT_VERSATILE=y +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +CONFIG_FPE_NWFPE=y CONFIG_VFP=y - -# CONFIG_PHYLIB is not set - +CONFIG_CMA=y CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y -CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_INTELEXT=y CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_PHYSMAP_VERSATILE=y +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_VERSATILE=y +CONFIG_SPI=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_PL061=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_PL031=y +CONFIG_RTC_DRV_DS1307=y -# CONFIG_SERIAL_8250 is not set -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_TTY=y +CONFIG_NULL_TTY=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_8250_RSA=y CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y CONFIG_MMC=y -CONFIG_MMC_BLOCK=y CONFIG_MMC_ARMMMCI=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_SYSCON=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_ARM_VIC=y +CONFIG_ARM_TIMER_SP804=y +CONFIG_ARM_MODULE_PLTS=y +CONFIG_CLKSRC_VERSATILE=y +CONFIG_POWER_RESET_VERSATILE=y +CONFIG_VERSATILE_FPGA_IRQ=y +CONFIG_VERSATILE_FPGA_IRQ_NR=4 -CONFIG_JFFS2_FS=y -CONFIG_CRAMFS=y +CONFIG_NET_VENDOR_SMSC=y +CONFIG_SMC91X=y CONFIG_PCI=y +CONFIG_PCI_VERSATILE=y -CONFIG_SCSI=y -CONFIG_BLK_DEV_SD=y -CONFIG_SCSI_SYM53C8XX_2=y -CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 -CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 -CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 -CONFIG_SCSI_SYM53C8XX_MMIO=y - +CONFIG_SOUND=y +CONFIG_SND=y +CONFIG_SND_ARM=y +CONFIG_SND_ARMAACI=y CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set CONFIG_SERIO_AMBAKMI=y - -CONFIG_USB_MON=y -CONFIG_USB_OHCI_HCD=y -CONFIG_INPUT_EVDEV=y - -CONFIG_FRAME_POINTER=y - -# CONFIG_NO_HZ is not set -# CONFIG_HIGH_RES_TIMERS is not set - -CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set diff --git a/bsp/arm-versatile-926ejs/arm-versatile-926ejs.scc b/bsp/arm-versatile-926ejs/arm-versatile-926ejs.scc index 9b1ea4b4..ca7b9682 100644 --- a/bsp/arm-versatile-926ejs/arm-versatile-926ejs.scc +++ b/bsp/arm-versatile-926ejs/arm-versatile-926ejs.scc @@ -2,11 +2,8 @@ kconf hardware arm-versatile-926ejs.cfg kconf hardware arm-versatile-926ejs-gfx.cfg -include features/profiling/profiling.scc -include features/latencytop/latencytop.scc - -include features/usb/ehci-hcd.scc -include features/usb/uhci-hcd.scc include features/usb/ohci-hcd.scc -include features/usb/xhci-hcd.scc +include features/net/net.scc +include features/pci/pci.scc +include cfg/virtio.scc diff --git a/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.cfg b/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.cfg index 44e984fc..5df913c9 100644 --- a/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.cfg +++ b/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.cfg @@ -17,6 +17,7 @@ CONFIG_MMU=y CONFIG_ARM64=y # CPU Core family selection +CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM2835=y CONFIG_MAILBOX=y CONFIG_BCM2835_MBOX=y @@ -29,7 +30,8 @@ CONFIG_SMP=y CONFIG_NR_CPUS=4 # CPU Idle -# CONFIG_ATAGS is not set +CONFIG_ARM_PSCI_CPUIDLE=y +CONFIG_ATAGS=n CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y @@ -41,7 +43,6 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=y CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_ARM_CPUIDLE=y # # CPU frequency @@ -76,6 +77,7 @@ CONFIG_SERIAL_DEV_BUS=y # I2C device CONFIG_I2C=y +CONFIG_I2C_MUX=y CONFIG_I2C_CHARDEV=m CONFIG_I2C_BCM2708=m CONFIG_I2C_BCM2835=m @@ -145,8 +147,9 @@ CONFIG_MEDIA_SUPPORT=m CONFIG_MEDIA_PLATFORM_SUPPORT=y CONFIG_MEDIA_USB_SUPPORT=y CONFIG_MEDIA_CEC_RC=y +CONFIG_RC_CORE=y CONFIG_USB_VIDEO_CLASS=m -CONFIG_VIDEO_V4L2=m +CONFIG_VIDEO_DEV=m CONFIG_VIDEO_EM28XX=m CONFIG_VIDEO_EM28XX_V4L2=m CONFIG_VIDEO_EM28XX_ALSA=m @@ -252,10 +255,8 @@ CONFIG_SND_SOC_MAX98357A=m # GPIO Support CONFIG_MFD_CORE=y CONFIG_MFD_STMPE=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_BCM_VIRT=y CONFIG_MFD_ARIZONA_I2C=m -CONFIG_MFD_ARIZONA=y CONFIG_GPIO_ARIZONA=m CONFIG_GPIO_STMPE=y @@ -276,10 +277,8 @@ CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m CONFIG_HOSTAP=y -CONFIG_WIMAX=m CONFIG_MWIFIEX=m CONFIG_MWIFIEX_SDIO=m -CONFIG_WIMAX_I2400M_USB=m # Regulator configuration CONFIG_REGULATOR=y @@ -322,12 +321,11 @@ CONFIG_BCM_VIDEOCORE=y CONFIG_CRC_ITU_T=y CONFIG_LIBCRC32C=y CONFIG_HW_RANDOM=y -CONFIG_RAW_DRIVER=y CONFIG_HID_LOGITECH=m CONFIG_LOGITECH_FF=y CONFIG_LOGIRUMBLEPAD2_FF=y CONFIG_LOGIG940_FF=y -CONFIG_SENSORS_RPI_POE_FAN=m CONFIG_LEDS_CLASS=y CONFIG_NEW_LEDS=y CONFIG_OF_OVERLAY=y +CONFIG_EXPERT=y diff --git a/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.scc b/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.scc index 42b9c691..8c654b99 100755 --- a/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.scc +++ b/bsp/bcm-2xxx-rpi/bcm-2xxx-rpi.scc @@ -3,7 +3,6 @@ kconf hardware bcm-2xxx-rpi.cfg include cfg/usb-mass-storage.scc include features/profiling/profiling.scc -include features/latencytop/latencytop.scc include features/hostapd/hostapd.scc include features/mac80211/mac80211.scc diff --git a/bsp/beaglebone/beaglebone-non_hardware.cfg b/bsp/beaglebone/beaglebone-non_hardware.cfg index 3fffd627..1e355515 100644 --- a/bsp/beaglebone/beaglebone-non_hardware.cfg +++ b/bsp/beaglebone/beaglebone-non_hardware.cfg @@ -7,7 +7,7 @@ CONFIG_NFS_DEF_FILE_IO_SIZE=1024 # # Multiple Device Support # -# CONFIG_MD is not set +CONFIG_MD=n # Kernel Features # diff --git a/bsp/beaglebone/beaglebone.cfg b/bsp/beaglebone/beaglebone.cfg index 7841dddb..6e29ca3f 100644 --- a/bsp/beaglebone/beaglebone.cfg +++ b/bsp/beaglebone/beaglebone.cfg @@ -7,9 +7,7 @@ CONFIG_ARCH_OMAP3=y CONFIG_SOC_AM33XX=y CONFIG_ARCH_OMAP2PLUS=y -CONFIG_OMAP_32K_TIMER=y CONFIG_OMAP_DM_TIMER=y -CONFIG_OMAP_RESET_CLOCKS=y # # Processor Features @@ -93,6 +91,8 @@ CONFIG_SMSC911X=y CONFIG_TI_CPSW_PHY_SEL=y CONFIG_TI_CPSW=y CONFIG_TI_DAVINCI_MDIO=y +CONFIG_NET_SWITCHDEV=y +CONFIG_TI_CPSW_SWITCHDEV=y # # MII PHY device drivers @@ -148,7 +148,6 @@ CONFIG_PINMUX=y CONFIG_PINCONF=y CONFIG_GENERIC_PINCONF=y CONFIG_PINCTRL_SINGLE=y -CONFIG_GPIO_SYSFS=y # # I2C GPIO expanders: @@ -194,15 +193,11 @@ CONFIG_DRM=y CONFIG_DRM_I2C_NXP_TDA998X=y CONFIG_DRM_TILCDC=y CONFIG_DRM_OMAP=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y # # Frame buffer hardware drivers -CONFIG_OMAP2_DSS=y CONFIG_OMAP2_DSS_DPI=y CONFIG_OMAP2_DSS_VENC=y CONFIG_OMAP2_DSS_DSI=y diff --git a/bsp/common-pc-64/common-pc-64-tiny.scc b/bsp/common-pc-64/common-pc-64-tiny.scc index 7fcac7fd..0d083b0d 100644 --- a/bsp/common-pc-64/common-pc-64-tiny.scc +++ b/bsp/common-pc-64/common-pc-64-tiny.scc @@ -6,4 +6,5 @@ define KARCH i386 include ktypes/tiny/tiny.scc +include features/hid/hid.scc include bsp/common-pc-64/common-pc-64.scc diff --git a/bsp/common-pc-64/common-pc-64.scc b/bsp/common-pc-64/common-pc-64.scc index d01e9e92..82b5e2e7 100644 --- a/bsp/common-pc-64/common-pc-64.scc +++ b/bsp/common-pc-64/common-pc-64.scc @@ -23,7 +23,7 @@ include features/intel-e1xxxx/intel-e100.scc include features/intel-e1xxxx/intel-e1xxxx.scc include features/igb/igb.scc include features/scsi/cdrom.scc - +include features/igc/igc.scc include features/x2apic/x2apic.scc # generic Bluetooth support diff --git a/bsp/common-pc/common-pc-cpu.cfg b/bsp/common-pc/common-pc-cpu.cfg index 34888cf7..dfe3f9a1 100644 --- a/bsp/common-pc/common-pc-cpu.cfg +++ b/bsp/common-pc/common-pc-cpu.cfg @@ -16,4 +16,4 @@ CONFIG_X86_GENERIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y CONFIG_PM=y -# CONFIG_64BIT is not set +CONFIG_64BIT=n diff --git a/bsp/common-pc/common-pc-drivers.cfg b/bsp/common-pc/common-pc-drivers.cfg index 4965d442..5e2018d6 100644 --- a/bsp/common-pc/common-pc-drivers.cfg +++ b/bsp/common-pc/common-pc-drivers.cfg @@ -4,7 +4,7 @@ CONFIG_ATA=y CONFIG_ATA_ACPI=y CONFIG_ATA_SFF=y CONFIG_ATA_BMDMA=y -CONFIG_ATA_PIIX=m +CONFIG_ATA_PIIX=y CONFIG_PATA_SCH=y CONFIG_INPUT=y @@ -51,15 +51,12 @@ CONFIG_USB_SERIAL_PL2303=y CONFIG_I2C=y CONFIG_I2C_I801=y -CONFIG_IDE=y -CONFIG_IDE_GD=y -CONFIG_IDE_GD_ATA=y -CONFIG_BLK_DEV_PIIX=y CONFIG_SATA_AHCI=y -CONFIG_BLK_DEV_IDECD=y +CONFIG_ISA_DMA_API=y CONFIG_BLK_DEV_FD=m +CONFIG_BLK_DEV=y CONFIG_EEPROM_AT24=m diff --git a/bsp/common-pc/common-pc-preempt-rt.scc b/bsp/common-pc/common-pc-preempt-rt.scc index cdba3bd0..7044022d 100644 --- a/bsp/common-pc/common-pc-preempt-rt.scc +++ b/bsp/common-pc/common-pc-preempt-rt.scc @@ -12,6 +12,5 @@ include bsp/common-pc/common-pc.scc # default policy for preempt-rt kernels include cfg/boot-live.scc include cfg/usb-mass-storage.scc -include features/latencytop/latencytop.scc include features/profiling/profiling.scc include cfg/virtio.scc diff --git a/bsp/common-pc/common-pc-tiny.scc b/bsp/common-pc/common-pc-tiny.scc index 687414ae..9fe725ac 100644 --- a/bsp/common-pc/common-pc-tiny.scc +++ b/bsp/common-pc/common-pc-tiny.scc @@ -7,5 +7,5 @@ define KARCH i386 include ktypes/tiny/tiny.scc branch common-pc +include features/hid/hid.scc include common-pc.scc - diff --git a/bsp/common-pc/common-pc.cfg b/bsp/common-pc/common-pc.cfg index be09ed6a..f58d7b33 100644 --- a/bsp/common-pc/common-pc.cfg +++ b/bsp/common-pc/common-pc.cfg @@ -9,5 +9,5 @@ # value CONFIG_NR_CPUS=8 -# CONFIG_IRQ_REMAP is not set -# CONFIG_X86_X2APIC is not set +CONFIG_IRQ_REMAP=n +CONFIG_X86_X2APIC=n diff --git a/bsp/common-pc/common-pc.scc b/bsp/common-pc/common-pc.scc index f7184f4d..f5d782ff 100644 --- a/bsp/common-pc/common-pc.scc +++ b/bsp/common-pc/common-pc.scc @@ -34,7 +34,6 @@ include features/drm-gma500/drm-gma500.scc # generic Bluetooth support include features/bluetooth/bluetooth.scc -patch 0001-qemux86-add-configuration-symbol-to-select-values.patch if [ "$KMACHINE" = "qemux86" ]; then kconf hardware qemux86.cfg fi diff --git a/bsp/common-pc/non-hardware.cfg b/bsp/common-pc/non-hardware.cfg index 84cd8954..b3202f6c 100644 --- a/bsp/common-pc/non-hardware.cfg +++ b/bsp/common-pc/non-hardware.cfg @@ -20,5 +20,4 @@ CONFIG_IWLMVM CONFIG_IWLEGACY CONFIG_IWL3945 CONFIG_IWL4965 -CONFIG_DRM_KMS_FB_HELPER CONFIG_DRM_KMS_HELPER diff --git a/bsp/edgerouter/edgerouter.cfg b/bsp/edgerouter/edgerouter.cfg index c8a11962..1fc7604b 100644 --- a/bsp/edgerouter/edgerouter.cfg +++ b/bsp/edgerouter/edgerouter.cfg @@ -48,7 +48,7 @@ CONFIG_BCM87XX_PHY=y #USB CONFIG_USB=y -CONFIG_OCTEON_USB=y +CONFIG_USB_OCTEON_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_OCTEON_EHCI=y CONFIG_USB_OHCI_HCD=y diff --git a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-preempt-rt.scc b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-preempt-rt.scc index 4f8bcf25..231d5654 100644 --- a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-preempt-rt.scc +++ b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-preempt-rt.scc @@ -9,5 +9,4 @@ include ktypes/preempt-rt/preempt-rt.scc include fsl-mpc8315e-rdb.scc # default policy for preempt-rt kernels -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-standard.scc b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-standard.scc index 0f00d23e..fa797bad 100644 --- a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-standard.scc +++ b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb-standard.scc @@ -10,5 +10,4 @@ branch fsl-mpc8315e-rdb include fsl-mpc8315e-rdb.scc # default policy for standard kernels -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb.cfg b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb.cfg index d202a1d6..f5d2ede4 100644 --- a/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb.cfg +++ b/bsp/fsl-mpc8315e-rdb/fsl-mpc8315e-rdb.cfg @@ -23,8 +23,8 @@ CONFIG_PPC_83xx=y # Platform support # CONFIG_MPC831x_RDB=y -# CONFIG_PPC_CHRP is not set -# CONFIG_PPC_PMAC is not set +CONFIG_PPC_CHRP=n +CONFIG_PPC_PMAC=n # # Bus options @@ -101,7 +101,7 @@ CONFIG_EEPROM_AT24=y # SPI support # CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_DEBUG=n CONFIG_SPI_MASTER=y # diff --git a/bsp/genericarm64/genericarm64-arch.cfg b/bsp/genericarm64/genericarm64-arch.cfg new file mode 100644 index 00000000..6f341ed7 --- /dev/null +++ b/bsp/genericarm64/genericarm64-arch.cfg @@ -0,0 +1,131 @@ +# Actions Semi Platforms +CONFIG_ARCH_ACTIONS=y +# Allwinner sunxi 64-bit SoC Family +CONFIG_ARCH_SUNXI=y +# Annapurna Labs Alpine platform +CONFIG_ARCH_ALPINE=y +# Apple Silicon SoC family +CONFIG_ARCH_APPLE=y +# Broadcom SoC Support +CONFIG_ARCH_BCM=y +# Broadcom BCM2835 family +CONFIG_ARCH_BCM2835=y +# Broadcom iProc SoC Family +CONFIG_ARCH_BCM_IPROC=y +# Broadcom Broadband Carrier Access (BCA) origin SoC +CONFIG_ARCH_BCMBCA=y +# Broadcom Set-Top-Box SoCs +CONFIG_ARCH_BRCMSTB=y +# Marvell Berlin SoC Family +CONFIG_ARCH_BERLIN=y +# Samsung Exynos SoC family +CONFIG_ARCH_EXYNOS=y +# Microchip Sparx5 SoC family +CONFIG_ARCH_SPARX5=y +# Texas Instruments Inc. K3 multicore SoC architecture +CONFIG_ARCH_K3=y +# LG Electronics LG1K SoC Family +CONFIG_ARCH_LG1K=y +# Hisilicon SoC Family +CONFIG_ARCH_HISI=y +# Keem Bay SoC +CONFIG_ARCH_KEEMBAY=y +# MediaTek SoC Family +CONFIG_ARCH_MEDIATEK=y +# Amlogic Platforms +CONFIG_ARCH_MESON=y +# Marvell EBU SoC Family +CONFIG_ARCH_MVEBU=y +# NXP SoC support +CONFIG_ARCH_NXP=y +# Freescale Layerscape SoC family +CONFIG_ARCH_LAYERSCAPE=y +# NXP i.MX SoC family +CONFIG_ARCH_MXC=y +# NXP S32 SoC Family +CONFIG_ARCH_S32=y +# Nuvoton MA35 Architecture +CONFIG_ARCH_MA35=y +# Nuvoton NPCM Architecture +CONFIG_ARCH_NPCM=y +# Qualcomm Platforms +CONFIG_ARCH_QCOM=y +# Realtek Platforms +CONFIG_ARCH_REALTEK=y +# Renesas SoC Platforms +CONFIG_ARCH_RENESAS=y +# Rockchip Platforms +CONFIG_ARCH_ROCKCHIP=y +# AMD Seattle SoC Family +CONFIG_ARCH_SEATTLE=y +# Intel's SoCFPGA ARMv8 Families +CONFIG_ARCH_INTEL_SOCFPGA=y +# STMicroelectronics STM32 SoC Family +CONFIG_ARCH_STM32=y +# Socionext SynQuacer SoC Family +CONFIG_ARCH_SYNQUACER=y +# NVIDIA Tegra SoC Family +CONFIG_ARCH_TEGRA=y +# Tesla platform +CONFIG_ARCH_TESLA_FSD=y +# Spreadtrum SoC platform +CONFIG_ARCH_SPRD=y +# Cavium Inc. Thunder SoC Family +CONFIG_ARCH_THUNDER=y +# Cavium ThunderX2 Server Processors +CONFIG_ARCH_THUNDER2=y +# Socionext UniPhier SoC Family +CONFIG_ARCH_UNIPHIER=y +# ARMv8 software model (Versatile Express) +CONFIG_ARCH_VEXPRESS=y +# Toshiba Visconti SoC Family +CONFIG_ARCH_VISCONTI=y +# AppliedMicro X-Gene SOC Family +CONFIG_ARCH_XGENE=y +# Xilinx ZynqMP Family +CONFIG_ARCH_ZYNQMP=y + + +# Qualcomm SoC drivers +# Qualcomm AOSS Driver +CONFIG_QCOM_AOSS_QMP=y +# Qualcomm Command DB +CONFIG_QCOM_COMMAND_DB=y +# QCOM Core Power Reduction (CPR) support +CONFIG_QCOM_CPR=y +# QCOM GENI Serial Engine Driver +CONFIG_QCOM_GENI_SE=y +# Qualcomm Technologies, Inc. LLCC driver +CONFIG_QCOM_LLCC=m +# Qualcomm On Chip Memory (OCMEM) driver +CONFIG_QCOM_OCMEM=m +# Qualcomm PMIC GLINK driver +CONFIG_QCOM_PMIC_GLINK=m +# Qualcomm Remote Filesystem memory driver +CONFIG_QCOM_RMTFS_MEM=m +# Qualcomm RPM-Hardened (RPMH) Communication +CONFIG_QCOM_RPMH=y +# Qualcomm RPMh Power domain driver +CONFIG_QCOM_RPMHPD=y +# Qualcomm RPM Power domain driver +CONFIG_QCOM_RPMPD=y +# Qualcomm Shared Memory Manager (SMEM) +CONFIG_QCOM_SMEM=y +# Qualcomm Resource Power Manager (RPM) over SMD +CONFIG_QCOM_SMD_RPM=y +# Qualcomm Shared Memory Point to Point support +CONFIG_QCOM_SMP2P=y +# Qualcomm Shared Memory State Machine +CONFIG_QCOM_SMSM=y +# Qualcomm socinfo driver +CONFIG_QCOM_SOCINFO=m +# Qualcomm Subsystem Power Manager (SPM) +CONFIG_QCOM_SPM=m +# Qualcomm Technologies, Inc. (QTI) Sleep stats driver +CONFIG_QCOM_STATS=m +# Qualcomm WCNSS control driver +CONFIG_QCOM_WCNSS_CTRL=m +# Qualcomm APR/GPR Bus (Asynchronous/Generic Packet Router) +CONFIG_QCOM_APR=m +# QCOM Interconnect Bandwidth Monitor driver +CONFIG_QCOM_ICC_BWMON=m diff --git a/bsp/genericarm64/genericarm64-clock.cfg b/bsp/genericarm64/genericarm64-clock.cfg new file mode 100644 index 00000000..d3850278 --- /dev/null +++ b/bsp/genericarm64/genericarm64-clock.cfg @@ -0,0 +1,173 @@ +# Common Clock Framework +CONFIG_COMMON_CLK=y + +# Clock driver for RK805/RK808/RK809/RK817/RK818 +CONFIG_COMMON_CLK_RK808=m +# Clock driver controlled via SCMI interface +CONFIG_COMMON_CLK_SCMI=y +# Clock driver controlled via SCPI interface +CONFIG_COMMON_CLK_SCPI=m +# Clock driver for CS2000 Fractional-N Clock Synthesizer & Clock Multiplier +CONFIG_COMMON_CLK_CS2000_CP=m +# Clock driver for BCLK of Freescale SAI cores +CONFIG_COMMON_CLK_FSL_SAI=y +# Clock driver for S2MPS1X/S5M8767 MFD +CONFIG_COMMON_CLK_S2MPS11=m +# Clock driver for PWMs used as clock outputs +CONFIG_COMMON_CLK_PWM=m +# Clock driver for Renesas 9-series PCIe clock generators +CONFIG_COMMON_CLK_RS9_PCIE=m +# Clock driver for IDT VersaClock 5,6 devices +CONFIG_COMMON_CLK_VC5=m +# Clock driver for 32K clk gates on ROHM PMICs +CONFIG_COMMON_CLK_BD718XX=m +# Raspberry Pi firmware based clock support +CONFIG_CLK_RASPBERRYPI=m +# IMX8MM CCM Clock Driver +CONFIG_CLK_IMX8MM=y +# IMX8MN CCM Clock Driver +CONFIG_CLK_IMX8MN=y +# IMX8MP CCM Clock Driver +CONFIG_CLK_IMX8MP=y +# IMX8MQ CCM Clock Driver +CONFIG_CLK_IMX8MQ=y +# IMX8QXP SCU Clock +CONFIG_CLK_IMX8QXP=y +# IMX8ULP CCM Clock Driver +CONFIG_CLK_IMX8ULP=y +# IMX93 CCM Clock Driver +CONFIG_CLK_IMX93=y +# TI System Control Interface clock drivers +CONFIG_TI_SCI_CLK=m + +# Clock driver for MediaTek SoC +# Clock driver for MediaTek MT8192 audsys +CONFIG_COMMON_CLK_MT8192_AUDSYS=m +# Clock driver for MediaTek MT8192 camsys +CONFIG_COMMON_CLK_MT8192_CAMSYS=m +# Clock driver for MediaTek MT8192 imgsys +CONFIG_COMMON_CLK_MT8192_IMGSYS=m +# Clock driver for MediaTek MT8192 imp_iic_wrap +CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP=m +# Clock driver for MediaTek MT8192 ipesys +CONFIG_COMMON_CLK_MT8192_IPESYS=m +# Clock driver for MediaTek MT8192 mdpsys +CONFIG_COMMON_CLK_MT8192_MDPSYS=m +# Clock driver for MediaTek MT8192 mfgcfg +CONFIG_COMMON_CLK_MT8192_MFGCFG=m +# Clock driver for MediaTek MT8192 mmsys +CONFIG_COMMON_CLK_MT8192_MMSYS=m +# Clock driver for MediaTek MT8192 msdc +CONFIG_COMMON_CLK_MT8192_MSDC=m +# Clock driver for MediaTek MT8192 scp_adsp +CONFIG_COMMON_CLK_MT8192_SCP_ADSP=m +# Clock driver for MediaTek MT8192 vdecsys +CONFIG_COMMON_CLK_MT8192_VDECSYS=m +# Clock driver for MediaTek MT8192 vencsys +CONFIG_COMMON_CLK_MT8192_VENCSYS=m +# Support for Qualcomm's clock controllers +CONFIG_COMMON_CLK_QCOM=m +# MSM8916 A53 PLL +CONFIG_QCOM_A53PLL=m +# MSM8916 APCS Clock Controller +CONFIG_QCOM_CLK_APCS_MSM8916=m +# MSM8996 CPU Clock Controller +CONFIG_QCOM_CLK_APCC_MSM8996=m +# RPM over SMD based Clock Controller +CONFIG_QCOM_CLK_SMD_RPM=m +# RPMh Clock Driver +CONFIG_QCOM_CLK_RPMH=m +# IPQ APSS Clock Controller +CONFIG_IPQ_APSS_6018=m +# IPQ5018 Global Clock Controller +CONFIG_IPQ_GCC_5018=m +# IPQ5332 Global Clock Controller +CONFIG_IPQ_GCC_5332=m +# IPQ6018 Global Clock Controller +CONFIG_IPQ_GCC_6018=m +# IPQ8074 Global Clock Controller +CONFIG_IPQ_GCC_8074=m +# IPQ9574 Global Clock Controller +CONFIG_IPQ_GCC_9574=m +# MSM8916 Global Clock Controller +CONFIG_MSM_GCC_8916=m +# MSM8994 Multimedia Clock Controller +CONFIG_MSM_MMCC_8994=m +# MSM8994 Global Clock Controller +CONFIG_MSM_GCC_8994=m +# MSM8996 Global Clock Controller +CONFIG_MSM_GCC_8996=m +# MSM8996 Multimedia Clock Controller +CONFIG_MSM_MMCC_8996=m +# MSM8998 Global Clock Controller +CONFIG_MSM_GCC_8998=m +# MSM8998 Multimedia Clock Controller +CONFIG_MSM_MMCC_8998=m +# QCM2290 Global Clock Controller +CONFIG_QCM_GCC_2290=m +# QCM2290 Display Clock Controller +CONFIG_QCM_DISPCC_2290=m +# QCS404 Global Clock Controller +CONFIG_QCS_GCC_404=m +# SC8280XP Display Clock Controller +CONFIG_SC_DISPCC_8280XP=m +# SA8775 Global Clock Controller +CONFIG_SA_GCC_8775P=m +# SA8775P Graphics clock controller +CONFIG_SA_GPUCC_8775P=m +# SC7180 Global Clock Controller +CONFIG_SC_GCC_7180=m +# SC7280 Global Clock Controller +CONFIG_SC_GCC_7280=m +# SC8180X Global Clock Controller +CONFIG_SC_GCC_8180X=m +# SC8280XP Global Clock Controller +CONFIG_SC_GCC_8280XP=m +# SC8280XP Graphics Clock Controller +CONFIG_SC_GPUCC_8280XP=m +# SC8280 Low Power Audio Subsystem (LPASS) Clock Controller +CONFIG_SC_LPASSCC_8280XP=m +# SDM845 Camera Clock Controller +CONFIG_SDM_CAMCC_845=m +# SDM845 Graphics Clock Controller +CONFIG_SDM_GPUCC_845=m +# SDM845 Video Clock Controller +CONFIG_SDM_VIDEOCC_845=m +# SDM845 Display Clock Controller +CONFIG_SDM_DISPCC_845=m +# SDM845 Low Power Audio Subsystem (LPAAS) Clock Controller +CONFIG_SDM_LPASSCC_845=m +# SM8250 Camera Clock Controller +CONFIG_SM_CAMCC_8250=m +# SM6115 Display Clock Controller +CONFIG_SM_DISPCC_6115=m +# SM8150/SM8250/SM8350 Display Clock Controller +CONFIG_SM_DISPCC_8250=m +# SM8450 Display Clock Controller +CONFIG_SM_DISPCC_8450=m +# SM8550 Display Clock Controller +CONFIG_SM_DISPCC_8550=m +# SM6115 and SM4250 Global Clock Controller +CONFIG_SM_GCC_6115=m +# SM8350 Global Clock Controller +CONFIG_SM_GCC_8350=m +# SM8450 Global Clock Controller +CONFIG_SM_GCC_8450=m +# SM8550 Global Clock Controller +CONFIG_SM_GCC_8550=m +# SM6115 Graphics Clock Controller +CONFIG_SM_GPUCC_6115=m +# SM8150 Graphics Clock Controller +CONFIG_SM_GPUCC_8150=m +# SM8250 Graphics Clock Controller +CONFIG_SM_GPUCC_8250=m +# SM8550 TCSR Clock Controller +CONFIG_SM_TCSRCC_8550=m +# SM8250 Video Clock Controller +CONFIG_SM_VIDEOCC_8250=m +# High-Frequency PLL (HFPLL) Clock Controller +CONFIG_QCOM_HFPLL=m +# SM8250 GFM LPASS Clocks +CONFIG_CLK_GFM_LPASS_SM8250=m +# Renesas R-Car USB2 clock selector support +CONFIG_CLK_RCAR_USB2_CLOCK_SEL=y diff --git a/bsp/genericarm64/genericarm64-gpio.cfg b/bsp/genericarm64/genericarm64-gpio.cfg new file mode 100644 index 00000000..126b193f --- /dev/null +++ b/bsp/genericarm64/genericarm64-gpio.cfg @@ -0,0 +1,54 @@ +# GPIO Support +# Memory mapped GPIO drivers +# Altera GPIO +CONFIG_GPIO_ALTERA=m +# Cadence GPIO support +CONFIG_GPIO_CADENCE=m +# TI Davinci/Keystone GPIO support +CONFIG_GPIO_DAVINCI=m +# Synopsys DesignWare APB GPIO driver +CONFIG_GPIO_DWAPB=m +# GPIO support for Fujitsu MB86S7x Platforms +CONFIG_GPIO_MB86S7X=m +# MPC512x/MPC8xxx/QorIQ GPIO support +CONFIG_GPIO_MPC8XXX=y +# i.MX GPIO support +CONFIG_GPIO_MXC=m +# PrimeCell PL061 GPIO support +CONFIG_GPIO_PL061=m +# Renesas R-Car and RZ/G GPIO support +CONFIG_GPIO_RCAR=m +# GPIO based on SYSCON +CONFIG_GPIO_SYSCON=m +# Cavium ThunderX/OCTEON-TX GPIO +CONFIG_GPIO_THUNDERX=m +# UniPhier GPIO support +CONFIG_GPIO_UNIPHIER=m +# Toshiba Visconti GPIO support +CONFIG_GPIO_VISCONTI=m +# APM X-Gene GPIO controller support +CONFIG_GPIO_XGENE=y +# APM X-Gene GPIO standby controller support +CONFIG_GPIO_XGENE_SB=m +# Xilinx GPIO support +CONFIG_GPIO_XILINX=m +# Xilinx Zynq GPIO support +CONFIG_GPIO_ZYNQ=m + +# I2C GPIO expanders +# MAX7319, MAX7320-7327 I2C Port Expanders +CONFIG_GPIO_MAX732X=m +# PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports +CONFIG_GPIO_PCA953X=m +# Interrupt controller support for PCA953x +CONFIG_GPIO_PCA953X_IRQ=y + +# MFD GPIO expanders +# ROHM BD9571 GPIO support +CONFIG_GPIO_BD9571MWV=m +# GPIO support for PMIC MAX77620 and MAX20024 +CONFIG_GPIO_MAX77620=m +# Kontron sl28cpld GPIO support +CONFIG_GPIO_SL28CPLD=m +# TI TPS65086 GPO +CONFIG_GPIO_TPS65086=m diff --git a/bsp/genericarm64/genericarm64-i2c.cfg b/bsp/genericarm64/genericarm64-i2c.cfg new file mode 100644 index 00000000..46777402 --- /dev/null +++ b/bsp/genericarm64/genericarm64-i2c.cfg @@ -0,0 +1,63 @@ +# I2C support +CONFIG_I2C=y + +# I2C device interface +CONFIG_I2C_CHARDEV=y +# I2C bus multiplexing support +CONFIG_I2C_MUX=m + +# Multiplexer I2C Chip support +# NXP PCA954x/PCA984x and Maxim MAX735x/MAX736x I2C Mux/switches +CONFIG_I2C_MUX_PCA954x=m + +# I2C Hardware Bus support +# Broadcom BCM2835 I2C controller +CONFIG_I2C_BCM2835=m +# Cadence I2C Controller +CONFIG_I2C_CADENCE=m +# Synopsys DesignWare Platform +CONFIG_I2C_DESIGNWARE_PLATFORM=m +# GPIO-based bitbanging I2C +CONFIG_I2C_GPIO=m +# IMX I2C interface +CONFIG_I2C_IMX=m +# IMX Low Power I2C interface +CONFIG_I2C_IMX_LPI2C=m +# Amlogic Meson I2C controller +CONFIG_I2C_MESON=m +# MediaTek I2C adapter +CONFIG_I2C_MT65XX=m +# Marvell mv64xxx I2C Controller +CONFIG_I2C_MV64XXX=m +# OMAP I2C adapter +CONFIG_I2C_OMAP=m +# Actions Semiconductor Owl I2C Controller +CONFIG_I2C_OWL=m +# Intel PXA2XX I2C adapter +CONFIG_I2C_PXA=m +# Qualcomm Camera Control Interface +CONFIG_I2C_QCOM_CCI=m +# Qualcomm Technologies Inc.'s GENI based I2C controller +CONFIG_I2C_QCOM_GENI=m +# Qualcomm QUP based I2C controller +CONFIG_I2C_QUP=m +# Renesas RIIC adapter +CONFIG_I2C_RIIC=m +# Rockchip RK3xxx I2C adapter +CONFIG_I2C_RK3X=m +# Renesas RZ/V2M adapter +CONFIG_I2C_RZV2M=m +# S3C/Exynos I2C Driver +CONFIG_I2C_S3C2410=m +# SuperH Mobile I2C Controller +CONFIG_I2C_SH_MOBILE=m +# NVIDIA Tegra internal I2C controller +CONFIG_I2C_TEGRA=m +# UniPhier FIFO-builtin I2C controller +CONFIG_I2C_UNIPHIER_F=m +# Cavium ThunderX I2C bus support +CONFIG_I2C_THUNDERX=m +# Xilinx I2C Controller +CONFIG_I2C_XILINX=m +# Renesas R-Car I2C Controller +CONFIG_I2C_RCAR=m diff --git a/bsp/genericarm64/genericarm64-mmc.cfg b/bsp/genericarm64/genericarm64-mmc.cfg new file mode 100644 index 00000000..7e0489eb --- /dev/null +++ b/bsp/genericarm64/genericarm64-mmc.cfg @@ -0,0 +1,62 @@ +# MMC/SD/SDIO card support +CONFIG_MMC=m +# MMC block device driver +CONFIG_MMC_BLOCK=m +# Number of minors per block device +CONFIG_MMC_BLOCK_MINORS=32 +# ARM AMBA Multimedia Card Interface support +CONFIG_MMC_ARMMMCI=m +# Secure Digital Host Controller Interface support +CONFIG_MMC_SDHCI=m +# SDHCI support for ACPI enumerated SDHCI controllers +CONFIG_MMC_SDHCI_ACPI=m +# SDHCI platform and OF driver helper +CONFIG_MMC_SDHCI_PLTFM=m +# SDHCI OF support for the Arasan SDHCI controllers +CONFIG_MMC_SDHCI_OF_ARASAN=m +# SDHCI OF support for the Freescale eSDHC controller +CONFIG_MMC_SDHCI_OF_ESDHC=m +# SDHCI OF support for the Synopsys DWC MSHC +CONFIG_MMC_SDHCI_OF_DWCMSHC=m +# SDHCI OF support for the MCHP Sparx5 SoC +CONFIG_MMC_SDHCI_OF_SPARX5=m +# SDHCI support for the Cadence SD/SDIO/eMMC controller +CONFIG_MMC_SDHCI_CADENCE=m +# SDHCI support for the Freescale eSDHC/uSDHC i.MX controller +CONFIG_MMC_SDHCI_ESDHC_IMX=m +# SDHCI platform support for the Tegra SD/MMC Controller +CONFIG_MMC_SDHCI_TEGRA=m +# SDHCI support for Fujitsu Semiconductor F_SDH30 +CONFIG_MMC_SDHCI_F_SDH30=m +# Amlogic S905/GX*/AXG SD/MMC Host Controller support +CONFIG_MMC_MESON_GX=m +# Qualcomm SDHCI Controller Support +CONFIG_MMC_SDHCI_MSM=m +# MMC/SD/SDIO over SPI +CONFIG_MMC_SPI=m +# Renesas SDHI SD/SDIO controller support +CONFIG_MMC_SDHI=m +# UniPhier SD/eMMC Host Controller support +CONFIG_MMC_UNIPHIER=m +# Synopsys DesignWare Memory Card Interface +CONFIG_MMC_DW=m +# Exynos specific extensions for Synopsys DW Memory Card Interface +CONFIG_MMC_DW_EXYNOS=m +# Hi3798CV200 specific extensions for Synopsys DW Memory Card Interface +CONFIG_MMC_DW_HI3798CV200=m +# Rockchip specific extensions for Synopsys DW Memory Card Interface +CONFIG_MMC_DW_ROCKCHIP=m +# Allwinner sunxi SD/MMC Host Controller support +CONFIG_MMC_SUNXI=m +# Broadcom BCM2835 SDHOST MMC Controller support +CONFIG_MMC_BCM2835=m +# MediaTek SD/MMC Card Interface support +CONFIG_MMC_MTK=m +# Marvell Xenon eMMC/SD/SDIO SDHCI driver +CONFIG_MMC_SDHCI_XENON=m +# Support for the SDHCI Controller in TI's AM654 SOCs +CONFIG_MMC_SDHCI_AM654=m +# Actions Semi Owl SD/MMC Host Controller support +CONFIG_MMC_OWL=m +# Cavium ThunderX SD/MMC Card Interface support +CONFIG_MMC_CAVIUM_THUNDERX=m diff --git a/bsp/genericarm64/genericarm64-pinctrl.cfg b/bsp/genericarm64/genericarm64-pinctrl.cfg new file mode 100644 index 00000000..89f968e5 --- /dev/null +++ b/bsp/genericarm64/genericarm64-pinctrl.cfg @@ -0,0 +1,110 @@ +# MAX77620/MAX20024 Pincontrol support +CONFIG_PINCTRL_MAX77620=m +# Pinctrl and GPIO driver for RK805 PMIC +CONFIG_PINCTRL_RK805=m +# One-register-per-pin type device tree based pinctrl driver +CONFIG_PINCTRL_SINGLE=m +# Actions Semi OWL pinctrl driver +CONFIG_PINCTRL_OWL=y +# Actions Semi S700 pinctrl driver +CONFIG_PINCTRL_S700=y +# Actions Semi S900 pinctrl driver +CONFIG_PINCTRL_S900=y +# IMX8MM pinctrl driver +CONFIG_PINCTRL_IMX8MM=m +# IMX8MN pinctrl driver +CONFIG_PINCTRL_IMX8MN=m +# IMX8MP pinctrl driver +CONFIG_PINCTRL_IMX8MP=m +# IMX8MQ pinctrl driver +CONFIG_PINCTRL_IMX8MQ=m +# IMX8QM pinctrl driver +CONFIG_PINCTRL_IMX8QM=m +# IMX8QXP pinctrl driver +CONFIG_PINCTRL_IMX8QXP=m +# IMX8DXL pinctrl driver +CONFIG_PINCTRL_IMX8DXL=m +# IMX8ULP pinctrl driver +CONFIG_PINCTRL_IMX8ULP=m +# IMX93 pinctrl driver +CONFIG_PINCTRL_IMX93=m +# Qualcomm core pin controller driver +CONFIG_PINCTRL_MSM=m +# Qualcomm Technologies, Inc. IPQ5018 pin controller driver +CONFIG_PINCTRL_IPQ5018=m +# Qualcomm Technologies Inc IPQ5332 pin controller driver +CONFIG_PINCTRL_IPQ5332=m +# Qualcomm Technologies, Inc. IPQ8074 pin controller driver +CONFIG_PINCTRL_IPQ8074=m +# Qualcomm Technologies, Inc. IPQ6018 pin controller driver +CONFIG_PINCTRL_IPQ6018=m +# Qualcomm Technologies, Inc. IPQ9574 pin controller driver +CONFIG_PINCTRL_IPQ9574=m +# Qualcomm 8916 pin controller driver +CONFIG_PINCTRL_MSM8916=m +# Qualcomm 8953 pin controller driver +CONFIG_PINCTRL_MSM8953=m +# Qualcomm 8976 pin controller driver +CONFIG_PINCTRL_MSM8976=m +# Qualcomm 8994 pin controller driver +CONFIG_PINCTRL_MSM8994=m +# Qualcomm MSM8996 pin controller driver +CONFIG_PINCTRL_MSM8996=m +# Qualcomm MSM8998 pin controller driver +CONFIG_PINCTRL_MSM8998=m +# Qualcomm QCM2290 pin controller driver +CONFIG_PINCTRL_QCM2290=m +# Qualcomm QCS404 pin controller driver +CONFIG_PINCTRL_QCS404=m +# Qualcomm Technologies QDF2xxx pin controller driver +CONFIG_PINCTRL_QDF2XXX=m +# Qualcomm Technologies Inc QDU1000/QRU1000 pin controller driver +CONFIG_PINCTRL_QDU1000=m +# Qualcomm Technologies Inc SA8775P pin controller driver +CONFIG_PINCTRL_SA8775P=m +# Qualcomm Technologies Inc SC7180 pin controller driver +CONFIG_PINCTRL_SC7180=m +# Qualcomm Technologies Inc SC7280 pin controller driver +CONFIG_PINCTRL_SC7280=m +# Qualcomm Technologies Inc SC8180x pin controller driver +CONFIG_PINCTRL_SC8180X=m +# Qualcomm Technologies Inc SC8280xp pin controller driver +CONFIG_PINCTRL_SC8280XP=m +# Qualcomm Technologies Inc SDM660 pin controller driver +CONFIG_PINCTRL_SDM660=m +# Qualcomm Technologies Inc SDM670 pin controller driver +CONFIG_PINCTRL_SDM670=m +# Qualcomm Technologies Inc SDM845 pin controller driver +CONFIG_PINCTRL_SDM845=m +# Qualcomm Technologies Inc SM6115,SM4250 pin controller driver +CONFIG_PINCTRL_SM6115=m +# Qualcomm Technologies Inc SM6125 pin controller driver +CONFIG_PINCTRL_SM6125=m +# Qualcomm Technologies Inc SM6350 pin controller driver +CONFIG_PINCTRL_SM6350=m +# Qualcomm Technologies Inc SM6375 pin controller driver +CONFIG_PINCTRL_SM6375=m +# Qualcomm Technologies Inc SM8150 pin controller driver +CONFIG_PINCTRL_SM8150=m +# Qualcomm Technologies Inc SM8250 pin controller driver +CONFIG_PINCTRL_SM8250=m +# Qualcomm Technologies Inc SM8350 pin controller driver +CONFIG_PINCTRL_SM8350=m +# Qualcomm Technologies Inc SM8450 pin controller driver +CONFIG_PINCTRL_SM8450=m +# Qualcomm Technologies Inc SM8550 pin controller driver +CONFIG_PINCTRL_SM8550=m +# Qualcomm SPMI PMIC pin controller driver +CONFIG_PINCTRL_QCOM_SPMI_PMIC=m +# Qualcomm Technologies Inc LPASS LPI pin controller driver +CONFIG_PINCTRL_LPASS_LPI=m +# Qualcomm Technologies Inc SC7280 LPASS LPI pin controller driver +CONFIG_PINCTRL_SC7280_LPASS_LPI=m +# Qualcomm Technologies Inc SM8250 LPASS LPI pin controller driver +CONFIG_PINCTRL_SM8250_LPASS_LPI=m +# Qualcomm Technologies Inc SM8450 LPASS LPI pin controller driver +CONFIG_PINCTRL_SM8450_LPASS_LPI=m +# Qualcomm Technologies Inc SC8280XP LPASS LPI pin controller driver +CONFIG_PINCTRL_SC8280XP_LPASS_LPI=m +# Qualcomm Technologies Inc SM8550 LPASS LPI pin controller driver +CONFIG_PINCTRL_SM8550_LPASS_LPI=m diff --git a/bsp/genericarm64/genericarm64-regulator.cfg b/bsp/genericarm64/genericarm64-regulator.cfg new file mode 100644 index 00000000..d6102c60 --- /dev/null +++ b/bsp/genericarm64/genericarm64-regulator.cfg @@ -0,0 +1,64 @@ +# Voltage and Current Regulator Support +CONFIG_REGULATOR=y +# Fixed voltage regulator support +CONFIG_REGULATOR_FIXED_VOLTAGE=m +# X-POWERS AXP20X PMIC Regulators +CONFIG_REGULATOR_AXP20X=m +# ROHM BD71837 Power Regulator +CONFIG_REGULATOR_BD718XX=m +# ROHM BD9571MWV Regulators +CONFIG_REGULATOR_BD9571MWV=m +# Fairchild FAN53555 Regulator +CONFIG_REGULATOR_FAN53555=m +# GPIO regulator support +CONFIG_REGULATOR_GPIO=m +# HiSilicon Hi6421v530 PMIC voltage regulator support +CONFIG_REGULATOR_HI6421V530=m +# Hisilicon HI655X PMIC regulators support +CONFIG_REGULATOR_HI655X=m +# Maxim 77620/MAX20024 voltage regulator +CONFIG_REGULATOR_MAX77620=m +# Maxim MAX8973A voltage regulator +CONFIG_REGULATOR_MAX8973=m +# MPS MP8859 regulator driver +CONFIG_REGULATOR_MP8859=m +# MediaTek MT6315 PMIC +CONFIG_REGULATOR_MT6315=m +# MediaTek MT6357 PMIC +CONFIG_REGULATOR_MT6357=m +# MediaTek MT6358 PMIC +CONFIG_REGULATOR_MT6358=m +# MediaTek MT6359 PMIC +CONFIG_REGULATOR_MT6359=m +# MT6360 SubPMIC Regulator +CONFIG_REGULATOR_MT6360=m +# MediaTek MT6397 PMIC +CONFIG_REGULATOR_MT6397=m +# NXP PCA9450A/PCA9450B/PCA9450C regulator driver +CONFIG_REGULATOR_PCA9450=m +# NXP PF8100/PF8121A/PF8200 regulator driver +CONFIG_REGULATOR_PF8X00=m +# Freescale PFUZE100/200/3000/3001 regulator driver +CONFIG_REGULATOR_PFUZE100=m +# PWM voltage regulator +CONFIG_REGULATOR_PWM=m +# Qualcomm Technologies, Inc. RPMh regulator driver +CONFIG_REGULATOR_QCOM_RPMH=m +# Qualcomm SMD based RPM regulator driver +CONFIG_REGULATOR_QCOM_SMD_RPM=m +# Qualcomm SPMI regulator driver +CONFIG_REGULATOR_QCOM_SPMI=m +# Renesas RAA215300 driver +CONFIG_REGULATOR_RAA215300=m +# Rockchip RK805/RK808/RK809/RK817/RK818 Power regulators +CONFIG_REGULATOR_RK808=m +# Samsung S2MPS11/13/14/15/S2MPU02 voltage regulator +CONFIG_REGULATOR_S2MPS11=m +# TI TPS65132 Dual Output Power regulators +CONFIG_REGULATOR_TPS65132=m +# TI TPS65219 Power regulators +CONFIG_REGULATOR_TPS65219=m +# TI TPS6594 Power regulators +CONFIG_REGULATOR_TPS6594=m +# Voltage controlled regulators +CONFIG_REGULATOR_VCTRL=m diff --git a/bsp/genericarm64/genericarm64-remoteproc.cfg b/bsp/genericarm64/genericarm64-remoteproc.cfg new file mode 100644 index 00000000..aba5fba4 --- /dev/null +++ b/bsp/genericarm64/genericarm64-remoteproc.cfg @@ -0,0 +1,35 @@ +# Remoteproc drivers +# Support for Remote Processor subsystem +CONFIG_REMOTEPROC=y +# i.MX remoteproc support +CONFIG_IMX_REMOTEPROC=m +# Mediatek SCP support +CONFIG_MTK_SCP=m +# Qualcomm Technology Inc ADSP Peripheral Image Loader +CONFIG_QCOM_Q6V5_ADSP=m +# Qualcomm Hexagon V5 self-authenticating modem subsystem support +CONFIG_QCOM_Q6V5_MSS=m +# Qualcomm Hexagon v5 Peripheral Authentication Service support +CONFIG_QCOM_Q6V5_PAS=m +# Qualcomm sysmon driver +CONFIG_QCOM_SYSMON=m +# Qualcomm WCNSS Peripheral Image Loader +CONFIG_QCOM_WCNSS_PIL=m +# TI K3 DSP remoteproc support +CONFIG_TI_K3_DSP_REMOTEPROC=m +# TI K3 R5 remoteproc support +CONFIG_TI_K3_R5_REMOTEPROC=m +# TI PRU remoteproc support +CONFIG_PRU_REMOTEPROC=m + +# Rpmsg drivers +# RPMSG device interface +CONFIG_RPMSG_CHAR=m +# RPMSG control interface +CONFIG_RPMSG_CTRL=m +# Qualcomm RPM Glink driver +CONFIG_RPMSG_QCOM_GLINK_RPM=y +# Qualcomm SMEM Glink driver +CONFIG_RPMSG_QCOM_GLINK_SMEM=m +# Qualcomm Shared Memory Driver (SMD) +CONFIG_RPMSG_QCOM_SMD=y diff --git a/bsp/genericarm64/genericarm64-serial.cfg b/bsp/genericarm64/genericarm64-serial.cfg new file mode 100644 index 00000000..4d565dbc --- /dev/null +++ b/bsp/genericarm64/genericarm64-serial.cfg @@ -0,0 +1,72 @@ +# Serial drivers + +# 8250/16550 and compatible serial support +CONFIG_SERIAL_8250=m +# Console on 8250/16550 and compatible serial port +CONFIG_SERIAL_8250_CONSOLE=m +# Extended 8250/16550 serial driver options +CONFIG_SERIAL_8250_EXTENDED=y +# Support for sharing serial interrupts +CONFIG_SERIAL_8250_SHARE_IRQ=y +# BCM2835 auxiliar mini UART support +CONFIG_SERIAL_8250_BCM2835AUX=y +# Support for Synopsys DesignWare 8250 quirks +CONFIG_SERIAL_8250_DW=m +# Support for Emma Mobile integrated serial port +CONFIG_SERIAL_8250_EM=m +# Support for OMAP internal UART (8250 based driver) +CONFIG_SERIAL_8250_OMAP=m +# Mediatek serial port support +CONFIG_SERIAL_8250_MT6577=m +# Support for UniPhier on-chip UART +CONFIG_SERIAL_8250_UNIPHIER=m +# Devicetree based probing for 8250 ports +CONFIG_SERIAL_OF_PLATFORM=m +# ARM AMBA PL011 serial port support +CONFIG_SERIAL_AMBA_PL011=y +# Support for console on AMBA serial port +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +# Meson serial port support +CONFIG_SERIAL_MESON=m +# Support for console on meson +CONFIG_SERIAL_MESON_CONSOLE=y +# Samsung SoC serial support +CONFIG_SERIAL_SAMSUNG=m +# Support for console on Samsung SoC serial port +CONFIG_SERIAL_SAMSUNG_CONSOLE=y +# IMX serial port support +CONFIG_SERIAL_IMX=m +# Console on IMX serial port +CONFIG_SERIAL_IMX_CONSOLE=m +# SuperH SCI(F) serial port support +CONFIG_SERIAL_SH_SCI=m +# MSM on-chip serial port support +CONFIG_SERIAL_MSM=y +# MSM serial console support +CONFIG_SERIAL_MSM_CONSOLE=y +# QCOM on-chip GENI based serial port support +CONFIG_SERIAL_QCOM_GENI=m +# QCOM GENI Serial Console support +CONFIG_SERIAL_QCOM_GENI_CONSOLE=y +# Cadence (Xilinx Zynq) UART support +CONFIG_SERIAL_XILINX_PS_UART=y +# Cadence UART console support +CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y +# Freescale lpuart serial port support +CONFIG_SERIAL_FSL_LPUART=y +# Console on Freescale lpuart serial port +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +# Freescale LINFlexD UART serial port support +CONFIG_SERIAL_FSL_LINFLEXUART=y +# Console on Freescale LINFlexD UART serial port +CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE=y +# STMicroelectronics STM32 serial port support +CONFIG_SERIAL_STM32=y +# Support for console on STM32 +CONFIG_SERIAL_STM32_CONSOLE=y +# Marvell EBU serial port support +CONFIG_SERIAL_MVEBU_UART=y +# Actions Semi Owl serial port support +CONFIG_SERIAL_OWL=m +# Serial device bus +CONFIG_SERIAL_DEV_BUS=m diff --git a/bsp/genericarm64/genericarm64-standard.scc b/bsp/genericarm64/genericarm64-standard.scc new file mode 100644 index 00000000..25598192 --- /dev/null +++ b/bsp/genericarm64/genericarm64-standard.scc @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +define KMACHINE genericarm64 +define KTYPE standard +define KARCH arm64 + +include ktypes/standard/standard.scc + +include genericarm64.scc + +# default policy for standard kernels +include features/profiling/profiling.scc diff --git a/bsp/genericarm64/genericarm64.cfg b/bsp/genericarm64/genericarm64.cfg new file mode 100644 index 00000000..a782dac5 --- /dev/null +++ b/bsp/genericarm64/genericarm64.cfg @@ -0,0 +1,994 @@ +CONFIG_ARM64=y + +# Kernel Features +# Virtual address space size +# 48-bit +CONFIG_ARM64_VA_BITS_48=y +# Multi-core scheduler support +CONFIG_SCHED_MC=y +# SMT scheduler support +CONFIG_SCHED_SMT=y +# Enable the tagged user addresses syscall ABI +CONFIG_ARM64_TAGGED_ADDR_ABI=y + +# ARMv8.1 architectural features +# Support for hardware updates of the Access and Dirty page flags +CONFIG_ARM64_HW_AFDBM=y +# Enable support for Privileged Access Never (PAN) +CONFIG_ARM64_PAN=y +CONFIG_ARM64_LSE_ATOMICS=y +# Atomic instructions +CONFIG_ARM64_USE_LSE_ATOMICS=y + +# ARMv8.2 architectural features +# Enable support for RAS CPU Extensions +CONFIG_ARM64_RAS_EXTN=y +# Enable support for Common Not Private (CNP) translations +CONFIG_ARM64_CNP=y +# ARM Scalable Vector Extension support +CONFIG_ARM64_SVE=y +# ARM Scalable Matrix Extension support +CONFIG_ARM64_SME=y + +# Boot options +# UEFI runtime support +CONFIG_EFI=y +# Enable support for SMBIOS (DMI) tables +CONFIG_DMI=y + +# Power management options +# Enable workqueue power-efficient mode by default +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +# Energy Model for devices with DVFS (CPUs, GPUs, etc) +CONFIG_ENERGY_MODEL=y + +# CPU Power Management +# CPU Idle +# ARM CPU Idle Drivers +# PSCI CPU idle Driver +CONFIG_ARM_PSCI_CPUIDLE=y + +# CPU Frequency scaling +# 'powersave' governor +CONFIG_CPU_FREQ_GOV_POWERSAVE=m +# 'userspace' governor for userspace frequency scaling +CONFIG_CPU_FREQ_GOV_USERSPACE=m +# 'ondemand' cpufreq policy governor +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +# 'conservative' cpufreq governor +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m +# Generic DT based cpufreq driver +CONFIG_CPUFREQ_DT=m +# CPUFreq driver based on the ACPI CPPC spec +CONFIG_ACPI_CPPC_CPUFREQ=m +# Allwinner nvmem based SUN50I CPUFreq driver +CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m +# Armada 37xx CPUFreq support +CONFIG_ARM_ARMADA_37XX_CPUFREQ=m +# SCPI based CPUfreq driver +CONFIG_ARM_SCPI_CPUFREQ=m +# Freescale i.MX8M cpufreq support +CONFIG_ARM_IMX_CPUFREQ_DT=m +# CPU Frequency scaling support for MediaTek SoCs +CONFIG_ARM_MEDIATEK_CPUFREQ=m +# Qualcomm nvmem based CPUFreq +CONFIG_ARM_QCOM_CPUFREQ_NVMEM=m +# QCOM CPUFreq HW driver +CONFIG_ARM_QCOM_CPUFREQ_HW=m +# Raspberry Pi cpufreq support +CONFIG_ARM_RASPBERRYPI_CPUFREQ=m +# SCMI based CPUfreq driver +CONFIG_ARM_SCMI_CPUFREQ=m +# Texas Instruments CPUFreq support +CONFIG_ARM_TI_CPUFREQ=y +# CPU frequency scaling driver for Freescale QorIQ SoCs +CONFIG_QORIQ_CPUFREQ=m + +# ACPI (Advanced Configuration and Power Interface) Support +CONFIG_ACPI=y + +# Memory Management options +# Contiguous Memory Allocator +CONFIG_CMA=y + +# Networking support +# CAN bus subsystem support +CONFIG_CAN=m + +# Device Drivers +# PCI support +# PCI controller drivers +# Cavium Thunder PCIe controller to off-chip devices +CONFIG_PCI_HOST_THUNDER_PEM=y +# Cavium Thunder ECAM controller to on-chip devices on pass-1.x silicon +CONFIG_PCI_HOST_THUNDER_ECAM=y +# Generic PCI host controller +CONFIG_PCI_HOST_GENERIC=m +# Xilinx AXI PCIe controller +CONFIG_PCIE_XILINX=y +# Xilinx NWL PCIe controller +CONFIG_PCIE_XILINX_NWL=y + +# DesignWare-based PCIe controllers +# Freescale i.MX6/7/8 PCIe controller (host mode) +CONFIG_PCI_IMX6_HOST=y +# Freescale Layerscape PCIe controller (host mode) +CONFIG_PCI_LAYERSCAPE=y + +# Bus devices + +CONFIG_ARM_CCI=y +CONFIG_ARM_CCI400_COMMON=y +# TI sysc interconnect target module driver +CONFIG_TI_SYSC=y +# QorIQ DPAA2 fsl-mc bus driver +CONFIG_FSL_MC_BUS=y + +# Firmware Drivers +# ARM System Control and Management Interface Protocol +# ARM System Control and Management Interface (SCMI) Message Protocol +CONFIG_ARM_SCMI_PROTOCOL=y +# ARM System Control and Power Interface (SCPI) Message Protocol +CONFIG_ARM_SCPI_PROTOCOL=y +# Raspberry Pi Firmware Driver +CONFIG_RASPBERRYPI_FIRMWARE=y +# IMX SCU Protocol driver +CONFIG_IMX_SCU=y +# IMX SCU Power Domain driver +CONFIG_IMX_SCU_PD=y + +# Memory Technology Device (MTD) support +# RAM/ROM/Flash chip drivers +# Detect flash chips by Common Flash Interface (CFI) probe +CONFIG_MTD_CFI=m + +# NAND +# Raw/Parallel NAND Device Support +CONFIG_MTD_RAW_NAND=y +# Denali NAND controller as a DT device +CONFIG_MTD_NAND_DENALI_DT=y +# Marvell EBU NAND controller +CONFIG_MTD_NAND_MARVELL=y +# Broadcom STB NAND controller +CONFIG_MTD_NAND_BRCMNAND=m +# Freescale IFC NAND controller +CONFIG_MTD_NAND_FSL_IFC=y +# QCOM NAND controller +CONFIG_MTD_NAND_QCOM=y + +# SPI NOR device support +CONFIG_MTD_SPI_NOR=y + +# Enable UBI - Unsorted block images +CONFIG_MTD_UBI=m + +# Misc devices +# EEPROM support +# I2C EEPROMs / RAMs / ROMs from most vendors +CONFIG_EEPROM_AT24=m +# SPI EEPROMs (FRAMs) from most vendors +CONFIG_EEPROM_AT25=m + +# Serial ATA and Parallel ATA drivers (libata) +CONFIG_ATA=m +# AHCI SATA support +CONFIG_SATA_AHCI=m +# Platform AHCI SATA support +CONFIG_SATA_AHCI_PLATFORM=m + +# Network device support +# Ethernet driver support +# Cadence MACB/GEM support +CONFIG_MACB=m +# Use IEEE 1588 hwstamp +CONFIG_MACB_USE_HWSTAMP=y +# FEC ethernet controller (of ColdFire and some i.MX CPUs) +CONFIG_FEC=m +# ENETC PF driver +CONFIG_FSL_ENETC=m +# ENETC VF driver +CONFIG_FSL_ENETC_VF=m +# Intel(R) PRO/1000 Gigabit Ethernet support +CONFIG_E1000=m +# Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support +CONFIG_E1000E=m +# Marvell OcteonTX2 RVU Admin Function driver +CONFIG_OCTEONTX2_AF=m +# Marvell OcteonTX2 NIC Physical Function driver +CONFIG_OCTEONTX2_PF=m +# Marvell OcteonTX2 NIC Virtual Function driver +CONFIG_OCTEONTX2_VF=m +# STMicroelectronics Multi-Gigabit Ethernet driver +CONFIG_STMMAC_ETH=m +# TI K3 AM654x/J721E CPSW Ethernet driver +CONFIG_TI_K3_AM65_CPSW_NUSS=m +# Xilinx 10/100 Ethernet Lite support +CONFIG_XILINX_EMACLITE=m +# Xilinx 10/100/1000 AXI Ethernet support +CONFIG_XILINX_AXI_EMAC=m +# Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver +CONFIG_XILINX_LL_TEMAC=m + +# PHY Device support and infrastructure +CONFIG_PHYLINK=m +# Amlogic Meson GXL Internal PHY +CONFIG_MESON_GXL_PHY=m +# Aquantia PHYs +CONFIG_AQUANTIA_PHY=m +# Broadcom BCM54140 PHY +CONFIG_BCM54140_PHY=m +# Marvell Alaska PHYs +CONFIG_MARVELL_PHY=m +# Marvell Alaska 10Gbit PHYs +CONFIG_MARVELL_10G_PHY=m +# Micrel PHYs +CONFIG_MICREL_PHY=m +# Microsemi PHYs +CONFIG_MICROSEMI_PHY=m +# Qualcomm Atheros AR803X PHYs and QCA833x PHYs +CONFIG_AT803X_PHY=m +# Realtek PHYs +CONFIG_REALTEK_PHY=m +# Rockchip Ethernet PHYs +CONFIG_ROCKCHIP_PHY=m +# Texas Instruments DP83867 Gigabit PHY +CONFIG_DP83867_PHY=m +# Texas Instruments DP83869 Gigabit PHY +CONFIG_DP83869_PHY=m +# Texas Instruments DP83TD510 Ethernet 10Base-T1L PHY +CONFIG_DP83TD510_PHY=m +# Vitesse PHYs +CONFIG_VITESSE_PHY=m +# Xilinx GMII2RGMII converter driver +CONFIG_XILINX_GMII2RGMII=m + +# CAN Device Drivers +CONFIG_CAN_DEV=m +# CAN device drivers with Netlink support +CONFIG_CAN_NETLINK=y +# Xilinx CAN +CONFIG_CAN_XILINXCAN=m + +# MDIO bus device drivers +# GPIO lib-based bitbanged MDIO buses +CONFIG_MDIO_GPIO=m +# ThunderX SOCs MDIO buses +CONFIG_MDIO_THUNDER=m +# MDIO bus multiplexer using kernel multiplexer subsystem +CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y +# MMIO device-controlled MDIO bus multiplexers +CONFIG_MDIO_BUS_MUX_MMIOREG=y + +# Wireless LAN +# Atheros 802.11ac wireless cards support +CONFIG_ATH10K=m +# Atheros ath10k PCI support +CONFIG_ATH10K_PCI=m +# Atheros ath10k SDIO support +CONFIG_ATH10K_SDIO=m +# Qualcomm ath10k SNOC support +CONFIG_ATH10K_SNOC=m +# Qualcomm Atheros WCN3660/3680 support +CONFIG_WCN36XX=m +# Qualcomm Technologies 802.11ax chipset support +CONFIG_ATH11K=m +# Atheros ath11k AHB support +CONFIG_ATH11K_AHB=m +# Atheros ath11k PCI support +CONFIG_ATH11K_PCI=m +# Broadcom FullMAC WLAN driver +CONFIG_BRCMFMAC=m +# Marvell WiFi-Ex Driver +CONFIG_MWIFIEX=m +# Marvell WiFi-Ex Driver for SD8786/SD8787/SD8797/SD8887/SD8897/SD8977/SD8978/SD8987/SD8997 +CONFIG_MWIFIEX_SDIO=m +# Marvell WiFi-Ex Driver for PCIE 8766/8897/8997 +CONFIG_MWIFIEX_PCIE=m +# MediaTek MT7921E (PCIe) support +CONFIG_MT7921E=m +# Redpine Signals Inc 91x WLAN driver support +CONFIG_RSI_91X=m +# TI wl18xx support +CONFIG_WL18XX=m +# TI wlcore support +CONFIG_WLCORE=m +# TI wlcore SDIO support +CONFIG_WLCORE_SDIO=m + +# Input device support +# Miscellaneous devices +# TPS65219 Power button driver +CONFIG_INPUT_TPS65219_PWRBUTTON=m + +# Character devices +# TPM Hardware Support +CONFIG_TCG_TPM=m +# TPM HW Random Number Generator support +CONFIG_HW_RANDOM_TPM=y +# TPM Interface Specification 1.3 Interface / TPM 2.0 FIFO Interface - (SPI) +CONFIG_TCG_TIS_SPI=m +# Cr50 SPI Interface +CONFIG_TCG_TIS_SPI_CR50=y + +# SPI support +# Marvell Armada 3700 SPI Controller +CONFIG_SPI_ARMADA_3700=m +# BCM2835 SPI controller +CONFIG_SPI_BCM2835=m +# BCM2835 SPI auxiliary controller +CONFIG_SPI_BCM2835AUX=m +# Cadence SPI controller +CONFIG_SPI_CADENCE=m +# Cadence Quad SPI controller +CONFIG_SPI_CADENCE_QUADSPI=m +# Cadence XSPI controller +CONFIG_SPI_CADENCE_XSPI=m +# DesignWare SPI controller core support +CONFIG_SPI_DESIGNWARE=m +# DMA support for DW SPI controller +CONFIG_SPI_DW_DMA=y +# Memory-mapped io interface driver for DW SPI core +CONFIG_SPI_DW_MMIO=m +# Freescale i.MX LPSPI controller +CONFIG_SPI_FSL_LPSPI=m +# Freescale QSPI controller +CONFIG_SPI_FSL_QUADSPI=m +# NXP Flex SPI controller +CONFIG_SPI_NXP_FLEXSPI=m +# Freescale i.MX SPI controllers +CONFIG_SPI_IMX=m +# Freescale DSPI controller +CONFIG_SPI_FSL_DSPI=m +# Amlogic Meson SPICC controller +CONFIG_SPI_MESON_SPICC=m +# Amlogic Meson SPIFC controller +CONFIG_SPI_MESON_SPIFC=m +# MediaTek SPI controller +CONFIG_SPI_MT65XX=m +# MediaTek SPI NOR controller +CONFIG_SPI_MTK_NOR=m +# McSPI driver for OMAP +CONFIG_SPI_OMAP24XX=m +# Orion SPI master +CONFIG_SPI_ORION=m +# ARM AMBA PL022 SSP controller +CONFIG_SPI_PL022=m +# Rockchip SPI controller driver +CONFIG_SPI_ROCKCHIP=m +# Rockchip Serial Flash Controller (SFC) +CONFIG_SPI_ROCKCHIP_SFC=m +# Renesas RSPI/QSPI controller +CONFIG_SPI_RSPI=m +# Renesas RZ/V2M CSI controller +CONFIG_SPI_RZV2M_CSI=m +# QTI QSPI controller +CONFIG_SPI_QCOM_QSPI=m +# Qualcomm SPI controller with QUP interface +CONFIG_SPI_QUP=m +# Qualcomm GENI based SPI controller +CONFIG_SPI_QCOM_GENI=m +# Samsung S3C64XX/Exynos SoC series type SPI +CONFIG_SPI_S3C64XX=m +# SuperH MSIOF SPI controller +CONFIG_SPI_SH_MSIOF=m +# Allwinner A31 SPI controller +CONFIG_SPI_SUN6I=m +# NVIDIA Tegra QSPI Controller +CONFIG_SPI_TEGRA210_QUAD=m +# Cavium ThunderX SPI controller +CONFIG_SPI_THUNDERX=m +# Xilinx SPI controller common module +CONFIG_SPI_XILINX=m +# Xilinx ZynqMP GQSPI controller +CONFIG_SPI_ZYNQMP_GQSPI=m +# User mode SPI device driver support +CONFIG_SPI_SPIDEV=m + +# SPMI support +CONFIG_SPMI=y + +# Hardware Monitoring support +# PWM fan +CONFIG_SENSORS_PWM_FAN=m + +# Thermal drivers +# Temperature sensor driver for Freescale i.MX8MM SoC +CONFIG_IMX8MM_THERMAL=m +# Texas Instruments K3 thermal support +CONFIG_K3_THERMAL=m + +# Watchdog Timer Support +CONFIG_WATCHDOG=y +# Xilinx Watchdog timer +CONFIG_XILINX_WATCHDOG=m +# Kontron sl28cpld Watchdog +CONFIG_SL28CPLD_WATCHDOG=m +# ARM SP805 Watchdog +CONFIG_ARM_SP805_WATCHDOG=m +# ARM SBSA Generic Watchdog +CONFIG_ARM_SBSA_WATCHDOG=m +# Cadence Watchdog Timer +CONFIG_CADENCE_WATCHDOG=m +# S3C6410/S5Pv210/Exynos Watchdog +CONFIG_S3C2410_WATCHDOG=m +# Synopsys DesignWare watchdog +CONFIG_DW_WATCHDOG=m +# Texas Instruments K3 RTI watchdog +CONFIG_K3_RTI_WATCHDOG=m +# Allwinner SoCs watchdog support +CONFIG_SUNXI_WATCHDOG=m +# Nuvoton NPCM750 watchdog +CONFIG_NPCM7XX_WATCHDOG=m +# IMX2+ Watchdog +CONFIG_IMX2_WDT=m +# IMX SC Watchdog +CONFIG_IMX_SC_WDT=m +# IMX7ULP Watchdog +CONFIG_IMX7ULP_WDT=m +# QCOM watchdog +CONFIG_QCOM_WDT=m +# Amlogic Meson GXBB SoCs watchdog support +CONFIG_MESON_GXBB_WATCHDOG=m +# Amlogic Meson SoCs watchdog support +CONFIG_MESON_WATCHDOG=m +# ARM Secure Monitor Call based watchdog support +CONFIG_ARM_SMC_WATCHDOG=m +# Renesas WDT Watchdog +CONFIG_RENESAS_WDT=m +# Renesas RZ/G2L WDT Watchdog +CONFIG_RENESAS_RZG2LWDT=m +# UniPhier watchdog support +CONFIG_UNIPHIER_WATCHDOG=m +# QCOM PM8916 pmic watchdog +CONFIG_PM8916_WATCHDOG=m +# Broadcom BCM2835 hardware watchdog +CONFIG_BCM2835_WDT=m +# BCM63xx/BCM7038 Watchdog +CONFIG_BCM7038_WDT=m + +# Multifunction device drivers +# Altera SOCFPGA System Manager +CONFIG_MFD_ALTERA_SYSMGR=y +# ROHM BD9571MWV PMIC +CONFIG_MFD_BD9571MWV=m +# X-Powers AXP series PMICs with I2C +CONFIG_MFD_AXP20X_I2C=m +# X-Powers AXP series PMICs with RSB +CONFIG_MFD_AXP20X_RSB=m +# Samsung Exynos SoC Low Power Audio Subsystem +CONFIG_MFD_EXYNOS_LPASS=m +# HiSilicon Hi6421 PMU/Codec IC +CONFIG_MFD_HI6421_PMIC=m +# HiSilicon Hi655X series PMU/Codec IC +CONFIG_MFD_HI655X_PMIC=m +# Maxim Semiconductor MAX77620 and MAX20024 PMIC Support +CONFIG_MFD_MAX77620=y +# Mediatek MT6360 SubPMIC +CONFIG_MFD_MT6360=m +# MediaTek MT6397 PMIC Support +CONFIG_MFD_MT6397=m +# Qualcomm SPMI PMICs +CONFIG_MFD_SPMI_PMIC=m +# Rockchip RK805/RK808/RK809/RK817/RK818 Power Management Chip +CONFIG_MFD_RK8XX_I2C=m +# Rockchip RK806 Power Management Chip +CONFIG_MFD_RK8XX_SPI=m +# Samsung Electronics PMIC Series Support +CONFIG_MFD_SEC_CORE=m +# Kontron sl28cpld Board Management Controller +CONFIG_MFD_SL28CPLD=m +# TI ADC / Touch Screen chip support +CONFIG_MFD_TI_AM335X_TSCADC=m +# TI TPS65086 Power Management Integrated Chips (PMICs) +CONFIG_MFD_TPS65086=m +# TI TPS65219 Power Management IC +CONFIG_MFD_TPS65219=m +# TI TPS6594 Power Management chip with I2C +CONFIG_MFD_TPS6594_I2C=m +# ROHM BD71837 Power Management IC +CONFIG_MFD_ROHM_BD718XX=m + +# Graphics support +# DRM DP AUX Interface +CONFIG_DRM_DP_AUX_CHARDEV=y +# Enable DisplayPort CEC-Tunneling-over-AUX HDMI support +CONFIG_DRM_DP_CEC=y + +# Display Interface Bridges +# Display connector support +CONFIG_DRM_DISPLAY_CONNECTOR=m +# ITE IT66121 HDMI bridge +CONFIG_DRM_ITE_IT66121=m +# LIMA (DRM support for ARM Mali 400/450 GPU) +CONFIG_DRM_LIMA=m +# DRM Support for TI Keystone +CONFIG_DRM_TIDSS=m +# ZynqMP DisplayPort Controller Driver +CONFIG_DRM_ZYNQMP_DPSUB=m + +# Sound card support +# Advanced Linux Sound Architecture +# ALSA for SoC audio support +CONFIG_SND_SOC=m + +# Audio support for Texas Instruments SoCs +# Multichannel Audio Serial Port (McASP) support +CONFIG_SND_SOC_DAVINCI_MCASP=m + +# CODEC drivers +# Dialog DA7213 CODEC +CONFIG_SND_SOC_DA7213=m + +# USB support +# OTG support +CONFIG_USB_OTG=y +# DesignWare USB3 DRD Core Support +CONFIG_USB_DWC3=m +# Texas Instruments AM62 Platforms +CONFIG_USB_DWC3_AM62=m +# ChipIdea Highspeed Dual Role Controller +CONFIG_USB_CHIPIDEA=m +# ChipIdea device controller +CONFIG_USB_CHIPIDEA_UDC=y +# ChipIdea host controller +CONFIG_USB_CHIPIDEA_HOST=y +# Onboard USB hub support +CONFIG_USB_ONBOARD_HUB=m + +# USB Physical Layer drivers +# NOP USB Transceiver Driver +CONFIG_NOP_USB_XCEIV=m +# Freescale MXS USB PHY support +CONFIG_USB_MXS_PHY=m + +# USB Gadget Support +CONFIG_USB_GADGET=m + +# USB Peripheral Controller +# Xilinx USB Driver +CONFIG_USB_GADGET_XILINX=m + +# USB Type-C Support +CONFIG_TYPEC=m +# USB Type-C Port Controller Manager +CONFIG_TYPEC_TCPM=m +# Type-C Port Controller Interface driver +CONFIG_TYPEC_TCPCI=m +# Fairchild FUSB302 Type-C chip driver +CONFIG_TYPEC_FUSB302=m +# USB Type-C Connector System Software Interface driver +CONFIG_TYPEC_UCSI=m +# UCSI Interface Driver for Cypress CCGx +CONFIG_UCSI_CCG=m +# UCSI Qualcomm PMIC GLINK Interface Driver +CONFIG_UCSI_PMIC_GLINK=m +# TI TPS6598x USB Power Delivery controller driver +CONFIG_TYPEC_TPS6598X=m +# TI HD3SS3220 Type-C DRP Port controller driver +CONFIG_TYPEC_HD3SS3220=m + +# USB Type-C Multiplexer/DeMultiplexer Switch support +# ON Semi FSA4480 Analog Audio Switch driver +CONFIG_TYPEC_MUX_FSA4480=m +# Generic GPIO based SBU mux for USB Type-C applications +CONFIG_TYPEC_MUX_GPIO_SBU=m + +# LED Support +# LED Support for GPIO connected LEDs +CONFIG_LEDS_GPIO=m + +# EDAC (Error Detection And Correction) reporting +CONFIG_EDAC=m +# Cavium ThunderX EDAC +CONFIG_EDAC_THUNDERX=m +# Synopsys DDR Memory Controller +CONFIG_EDAC_SYNOPSYS=m +# Xilinx ZynqMP OCM Controller +CONFIG_EDAC_ZYNQMP=m + +# Real Time Clock +# TI BQ32000 +CONFIG_RTC_DRV_BQ32K=m +# Xilinx Zynq Ultrascale+ MPSoC RTC +CONFIG_RTC_DRV_ZYNQMP=m +# TI K3 RTC +CONFIG_RTC_DRV_TI_K3=m + +# DMA Engine support +CONFIG_DMADEVICES=y +# i.MX SDMA support +CONFIG_IMX_SDMA=m +# Xilinx AXI DMAS Engine +CONFIG_XILINX_DMA=m +# Xilinx ZynqMP DMA Engine +CONFIG_XILINX_ZYNQMP_DMA=m +# Xilinx DPDMA Engine +CONFIG_XILINX_ZYNQMP_DPDMA=m +# Texas Instruments UDMA support +CONFIG_TI_K3_UDMA=m +# Texas Instruments UDMA Glue layer for non DMAengine users +CONFIG_TI_K3_UDMA_GLUE_LAYER=m + +# Common Clock Framework +# TI System Control Interface clock drivers +CONFIG_TI_SCI_CLK=m +# Syscon based clock driver for K2/K3 SoCs +CONFIG_TI_SYSCON_CLK=m +# Xilinx VCU logicoreIP Init +CONFIG_XILINX_VCU=m +# Xilinx Clocking Wizard +CONFIG_COMMON_CLK_XLNX_CLKWZRD=m + +# Hardware Spinlock drivers +CONFIG_HWSPINLOCK=y +# OMAP Hardware Spinlock device +CONFIG_HWSPINLOCK_OMAP=y +# Qualcomm Hardware Spinlock device +CONFIG_HWSPINLOCK_QCOM=y + +# Mailbox Hardware Support +CONFIG_MAILBOX=y +# ARM MHU Mailbox +CONFIG_ARM_MHU=y +# i.MX Mailbox +CONFIG_IMX_MBOX=y +# Platform MHU Mailbox +CONFIG_PLATFORM_MHU=y +# OMAP2+ Mailbox framework support +CONFIG_OMAP2PLUS_MBOX=y +# BCM2835 Mailbox +CONFIG_BCM2835_MBOX=y +# Qualcomm APCS IPC driver +CONFIG_QCOM_APCS_IPC=y +# Qualcomm Technologies, Inc. IPCC driver +CONFIG_QCOM_IPCC=y + +# IOMMU Hardware Support +CONFIG_IOMMU_SUPPORT=y +# Rockchip IOMMU Support +CONFIG_ROCKCHIP_IOMMU=y +# NVIDIA Tegra SMMU Support +CONFIG_TEGRA_IOMMU_SMMU=y +# ARM Ltd. System MMU (SMMU) Support +CONFIG_ARM_SMMU=y +# ARM Ltd. System MMU Version 3 (SMMUv3) Support +CONFIG_ARM_SMMU_V3=y +# MediaTek IOMMU Support +CONFIG_MTK_IOMMU=y +# Qualcomm IOMMU Support +CONFIG_QCOM_IOMMU=y + +# SOC (System On Chip) specific Drivers +# TI SOC drivers support +# TI SCI PM Domains Driver +CONFIG_TI_SCI_PM_DOMAINS=m +# TI PRU-ICSS Subsystem Platform drivers +CONFIG_TI_PRUSS=m + +# Generic Dynamic Voltage and Frequency Scaling (DVFS) support +CONFIG_PM_DEVFREQ=y + +# Memory Controller drivers +# Texas Instruments OMAP SoC GPMC driver +CONFIG_OMAP_GPMC=m + +# Industrial I/O support +CONFIG_IIO=y + +# Analog to digital converters +# Texas Instruments ADC128S052/ADC122S021/ADC124S021 +CONFIG_TI_ADC128S052=m +# Xilinx XADC driver +CONFIG_XILINX_XADC=m +# Xilinx AMS driver +CONFIG_XILINX_AMS=m + +# Pulse-Width Modulation (PWM) Support +CONFIG_PWM=y +# BCM2835 PWM support +CONFIG_PWM_BCM2835=m +# Broadcom STB PWM support +CONFIG_PWM_BRCMSTB=m +# i.MX27 PWM support +CONFIG_PWM_IMX27=m +# Amlogic Meson PWM driver +CONFIG_PWM_MESON=m +# MediaTek display PWM driver +CONFIG_PWM_MTK_DISP=m +# MediaTek PWM support +CONFIG_PWM_MEDIATEK=m +# Renesas R-Car PWM support +CONFIG_PWM_RCAR=m +# Renesas TPU PWM support +CONFIG_PWM_RENESAS_TPU=m +# Rockchip PWM support +CONFIG_PWM_ROCKCHIP=y +# Samsung PWM support +CONFIG_PWM_SAMSUNG=y +# Kontron sl28cpld PWM support +CONFIG_PWM_SL28CPLD=m +# Allwinner PWM support +CONFIG_PWM_SUN4I=m +# NVIDIA Tegra PWM support +CONFIG_PWM_TEGRA=m +# ECAP PWM support +CONFIG_PWM_TIECAP=m +# EHRPWM PWM support +CONFIG_PWM_TIEHRPWM=m +# Toshiba Visconti PWM support +CONFIG_PWM_VISCONTI=m +# Xilinx AXI Timer PWM support +CONFIG_PWM_XILINX=m + +# IRQ chip support +# Xilinx Interrupt Controller IP +CONFIG_XILINX_INTC=y + +# Reset Controller Support +# i.MX7/8 Reset Driver +CONFIG_RESET_IMX7=y +# TI System Control Interface (TI-SCI) reset driver +CONFIG_RESET_TI_SCI=m + +# PHY Subsystem +# APM X-Gene 15Gbps PHY support +CONFIG_PHY_XGENE=m +# CAN transceiver PHY +CONFIG_PHY_CAN_TRANSCEIVER=m +# Allwinner sunxi SoC USB PHY driver +CONFIG_PHY_SUN4I_USB=m +# Cadence Torrent PHY driver +CONFIG_PHY_CADENCE_TORRENT=m +# Cadence Sierra PHY Driver +CONFIG_PHY_CADENCE_SIERRA=m +# Mixel MIPI DSI PHY support +CONFIG_PHY_MIXEL_MIPI_DPHY=m +# Freescale i.MX8M PCIE PHY +CONFIG_PHY_FSL_IMX8M_PCIE=m +# hi6220 USB PHY support +CONFIG_PHY_HI6220_USB=m +# HiSilicon STB SoCs COMBPHY support +CONFIG_PHY_HISTB_COMBPHY=m +# HiSilicon INNO USB2 PHY support +CONFIG_PHY_HISI_INNO_USB2=m +# Marvell CP110 comphy driver +CONFIG_PHY_MVEBU_CP110_COMPHY=m +# MediaTek T-PHY Driver +CONFIG_PHY_MTK_TPHY=m +# Qualcomm eDP PHY driver +CONFIG_PHY_QCOM_EDP=m +# Qualcomm PCIe Gen2 PHY Driver +CONFIG_PHY_QCOM_PCIE2=m +# Qualcomm QMP PHY Drivers +CONFIG_PHY_QCOM_QMP=m +# Qualcomm QUSB2 PHY Driver +CONFIG_PHY_QCOM_QUSB2=m +# Qualcomm SNPS eUSB2 PHY Driver +CONFIG_PHY_QCOM_SNPS_EUSB2=m +# Qualcomm SNPS eUSB2 Repeater Driver +CONFIG_PHY_QCOM_EUSB2_REPEATER=m +# Qualcomm SNPS FEMTO USB HS PHY V2 module +CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=m +# Qualcomm 28nm High-Speed PHY +CONFIG_PHY_QCOM_USB_HS_28NM=m +# Qualcomm USB Super-Speed PHY driver +CONFIG_PHY_QCOM_USB_SS=m +# Qualcomm DWMAC SGMII SerDes/PHY driver +CONFIG_PHY_QCOM_SGMII_ETH=m +# Renesas R-Car S4-8 Ethernet SERDES driver +CONFIG_PHY_R8A779F0_ETHERNET_SERDES=m +# Renesas R-Car generation 3 PCIe PHY driver +CONFIG_PHY_RCAR_GEN3_PCIE=m +# Renesas R-Car generation 3 USB 2.0 PHY driver +CONFIG_PHY_RCAR_GEN3_USB2=m +# Renesas R-Car generation 3 USB 3.0 PHY driver +CONFIG_PHY_RCAR_GEN3_USB3=m +# Rockchip EMMC PHY Driver +CONFIG_PHY_ROCKCHIP_EMMC=m +# Rockchip INNO HDMI PHY Driver +CONFIG_PHY_ROCKCHIP_INNO_HDMI=m +# Rockchip INNO USB2PHY Driver +CONFIG_PHY_ROCKCHIP_INNO_USB2=m +# Rockchip Innosilicon MIPI/LVDS/TTL PHY driver +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m +# Rockchip NANENG COMBO PHY Driver +CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=m +# Rockchip PCIe PHY Driver +CONFIG_PHY_ROCKCHIP_PCIE=m +# Rockchip Snps PCIe3 PHY Driver +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=m +# Rockchip TYPEC PHY Driver +CONFIG_PHY_ROCKCHIP_TYPEC=m +# Exynos SoC series UFS PHY driver +CONFIG_PHY_SAMSUNG_UFS=m +# UniPhier USB2 PHY driver +CONFIG_PHY_UNIPHIER_USB2=m +# UniPhier USB3 PHY driver +CONFIG_PHY_UNIPHIER_USB3=m +# NVIDIA Tegra XUSB pad controller driver +CONFIG_PHY_TEGRA_XUSB=m +# TI AM654 SERDES support +CONFIG_PHY_AM654_SERDES=m +# TI J721E WIZ (SERDES Wrapper) support +CONFIG_PHY_J721E_WIZ=m +# Xilinx ZynqMP PHY driver +CONFIG_PHY_XILINX_ZYNQMP=m + +# Performance monitor support +# ARM CCI PMU driver +CONFIG_ARM_CCI_PMU=m +# support CCI-400 +CONFIG_ARM_CCI400_PMU=y +# support CCI-500/CCI-550 +CONFIG_ARM_CCI5xx_PMU=y +# ARM PMUv3 support +CONFIG_ARM_PMUV3=y + +# Reliability, Availability and Serviceability (RAS) features +CONFIG_RAS=y + +# NVMEM Support +CONFIG_NVMEM=y + +# Layout Types +# Kontron sl28 VPD layout support +CONFIG_NVMEM_LAYOUT_SL28_VPD=m +# i.MX 6/7/8 On-Chip OTP Controller support +CONFIG_NVMEM_IMX_OCOTP=m +# i.MX On-Chip OTP Controller support +CONFIG_NVMEM_IMX_OCOTP_ELE=m +# i.MX8 SCU On-Chip OTP Controller support +CONFIG_NVMEM_IMX_OCOTP_SCU=m +# Layerscape SFP (Security Fuse Processor) support +CONFIG_NVMEM_LAYERSCAPE_SFP=m +# Amlogic Meson GX eFuse Support +CONFIG_NVMEM_MESON_EFUSE=m +# Mediatek SoCs EFUSE support +CONFIG_NVMEM_MTK_EFUSE=m +# QCOM QFPROM Support +CONFIG_NVMEM_QCOM_QFPROM=m +# Reserved Memory Based Driver Support +CONFIG_NVMEM_RMEM=m +# Rockchip eFuse Support +CONFIG_NVMEM_ROCKCHIP_EFUSE=m +# Rockchip OTP controller support +CONFIG_NVMEM_ROCKCHIP_OTP=m +# Support for Low Power General Purpose Register +CONFIG_NVMEM_SNVS_LPGPR=m +# SPMI SDAM Support +CONFIG_NVMEM_SPMI_SDAM=m +# Allwinner SoCs SID support +CONFIG_NVMEM_SUNXI_SID=m +# UniPhier SoCs eFuse support +CONFIG_NVMEM_UNIPHIER_EFUSE=m +# Xilinx ZYNQMP SoC nvmem firmware support +CONFIG_NVMEM_ZYNQMP=m + +# FPGA Configuration Framework +CONFIG_FPGA=m +# Xilinx Configuration over Slave Serial (SPI) +CONFIG_FPGA_MGR_XILINX_SPI=m +# FPGA Bridge Framework +CONFIG_FPGA_BRIDGE=m +# Xilinx LogiCORE PR Decoupler +CONFIG_XILINX_PR_DECOUPLER=m +# FPGA Region +CONFIG_FPGA_REGION=m +# FPGA Region Device Tree Overlay Support +CONFIG_OF_FPGA_REGION=m +# Xilinx ZynqMP FPGA +CONFIG_FPGA_MGR_ZYNQMP_FPGA=m +# Xilinx Versal FPGA +CONFIG_FPGA_MGR_VERSAL_FPGA=m + +# Multiplexer drivers +CONFIG_MULTIPLEXER=y +# GPIO-controlled Multiplexer +CONFIG_MUX_GPIO=y +# MMIO/Regmap register bitfield-controlled Multiplexer +CONFIG_MUX_MMIO=y + +# On-Chip Interconnect management support +CONFIG_INTERCONNECT=y +# i.MX interconnect drivers +CONFIG_INTERCONNECT_IMX=m +# i.MX8MM interconnect driver +CONFIG_INTERCONNECT_IMX8MM=m +# i.MX8MN interconnect driver +CONFIG_INTERCONNECT_IMX8MN=m +# i.MX8MQ interconnect driver +CONFIG_INTERCONNECT_IMX8MQ=m +# i.MX8MP interconnect driver +CONFIG_INTERCONNECT_IMX8MP=m +# Qualcomm Network-on-Chip interconnect drivers +CONFIG_INTERCONNECT_QCOM=m +# Qualcomm MSM8916 interconnect driver +CONFIG_INTERCONNECT_QCOM_MSM8916=m +# Qualcomm MSM8996 interconnect driver +CONFIG_INTERCONNECT_QCOM_MSM8996=m +# Qualcomm OSM L3 interconnect driver +CONFIG_INTERCONNECT_QCOM_OSM_L3=m +# Qualcomm QCM2290 interconnect driver +CONFIG_INTERCONNECT_QCOM_QCM2290=m +# Qualcomm QCS404 interconnect driver +CONFIG_INTERCONNECT_QCOM_QCS404=m +# Qualcomm SA8775P interconnect driver +CONFIG_INTERCONNECT_QCOM_SA8775P=m +# Qualcomm SC7180 interconnect driver +CONFIG_INTERCONNECT_QCOM_SC7180=m +# Qualcomm SC7280 interconnect driver +CONFIG_INTERCONNECT_QCOM_SC7280=m +# Qualcomm SC8180X interconnect driver +CONFIG_INTERCONNECT_QCOM_SC8180X=m +# Qualcomm SC8280XP interconnect driver +CONFIG_INTERCONNECT_QCOM_SC8280XP=m +# Qualcomm SDM845 interconnect driver +CONFIG_INTERCONNECT_QCOM_SDM845=m +# Qualcomm SM8150 interconnect driver +CONFIG_INTERCONNECT_QCOM_SM8150=m +# Qualcomm SM8250 interconnect driver +CONFIG_INTERCONNECT_QCOM_SM8250=m +# Qualcomm SM8350 interconnect driver +CONFIG_INTERCONNECT_QCOM_SM8350=m +# Qualcomm SM8450 interconnect driver +CONFIG_INTERCONNECT_QCOM_SM8450=m +# Qualcomm SM8550 interconnect driver +CONFIG_INTERCONNECT_QCOM_SM8550=m + +# File systems +# Inotify support for userspace +CONFIG_INOTIFY_USER=y +# Filesystem wide access notification +CONFIG_FANOTIFY=y +# fanotify permissions checking +CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y + +# Cryptographic API +# Accelerated Cryptographic Algorithms for CPU (arm64) +# Hash functions: GHASH (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_GHASH_ARM64_CE=m +# Hash functions: SHA-1 (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_SHA1_ARM64_CE=m +# Hash functions: SHA-224 and SHA-256 (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_SHA2_ARM64_CE=m +# Hash functions: SHA-384 and SHA-512 (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_SHA512_ARM64_CE=m +# Hash functions: SHA-3 (ARMv8.2 Crypto Extensions) +CONFIG_CRYPTO_SHA3_ARM64=m +# Hash functions: SM3 (ARMv8.2 Crypto Extensions) +CONFIG_CRYPTO_SM3_ARM64_CE=m +# Ciphers: AES, modes: ECB/CBC/CTR/XTS (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_AES_ARM64_CE_BLK=m +# Ciphers: ChaCha (NEON) +CONFIG_CRYPTO_CHACHA20_NEON=m +# Ciphers: AES, modes: ECB/CBC/CTR/XCTR/XTS modes (bit-sliced NEON) +CONFIG_CRYPTO_AES_ARM64_BS=m +# AEAD cipher: AES in CCM mode (ARMv8 Crypto Extensions) +CONFIG_CRYPTO_AES_ARM64_CE_CCM=m + +# Hardware crypto devices +CONFIG_CRYPTO_HW=y +# Support for Allwinner Crypto Engine cryptographic offloader +CONFIG_CRYPTO_DEV_SUN8I_CE=m +# Freescale CAAM-Multicore platform driver backend +CONFIG_CRYPTO_DEV_FSL_CAAM=m +# Qualcomm crypto engine accelerator +CONFIG_CRYPTO_DEV_QCE=m +# Qualcomm Random Number Generator Driver +CONFIG_CRYPTO_DEV_QCOM_RNG=m +# Support for Xilinx ZynqMP AES hw accelerator +CONFIG_CRYPTO_DEV_ZYNQMP_AES=m +# Support for Xilinx ZynqMP SHA3 hardware accelerator +CONFIG_CRYPTO_DEV_ZYNQMP_SHA3=m +# Support for ARM TrustZone CryptoCell family of security processors +CONFIG_CRYPTO_DEV_CCREE=m +# Support for HiSilicon SEC2 crypto block cipher accelerator +CONFIG_CRYPTO_DEV_HISI_SEC2=m +# Support for HiSilicon ZIP accelerator +CONFIG_CRYPTO_DEV_HISI_ZIP=m +# Support for HISI HPRE accelerator +CONFIG_CRYPTO_DEV_HISI_HPRE=m +# Support for HISI TRNG Driver +CONFIG_CRYPTO_DEV_HISI_TRNG=m +# Support for TI security accelerator +CONFIG_CRYPTO_DEV_SA2UL=m diff --git a/bsp/genericarm64/genericarm64.scc b/bsp/genericarm64/genericarm64.scc new file mode 100644 index 00000000..7856fa82 --- /dev/null +++ b/bsp/genericarm64/genericarm64.scc @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: MIT +kconf hardware genericarm64.cfg +kconf hardware genericarm64-arch.cfg +kconf hardware genericarm64-clock.cfg +kconf hardware genericarm64-i2c.cfg +kconf hardware genericarm64-gpio.cfg +kconf hardware genericarm64-mmc.cfg +kconf hardware genericarm64-pinctrl.cfg +kconf hardware genericarm64-regulator.cfg +kconf hardware genericarm64-remoteproc.cfg +kconf hardware genericarm64-serial.cfg + +include cfg/8250.scc +include cfg/boot-live.scc +include cfg/efi-ext.scc +include cfg/net/mdio.scc +include cfg/sound.scc +include cfg/timer/no_hz.scc +include cfg/timer/rtc.scc +include cfg/usb-mass-storage.scc +include cfg/virtio.scc +include cfg/fs/flash_fs.scc + +include features/bluetooth/bluetooth.scc +include features/input/input.scc +include features/input/keyboard-gpio.scc +include features/hid/hid.scc +include features/hugetlb/hugetlb.scc +include features/leds/leds.scc +include features/mmc/mmc-block.scc +include features/mmc/mmc-sdhci.scc +include features/mtd/mtd.scc +include features/net/net.scc +include features/netfilter/netfilter.scc +include features/numa/numa.scc +include features/pci-iov/pci-iov.scc +include features/pci/pci.scc +include features/power/arm.scc +include features/usb-net/usb-net.scc +include features/usb/ehci-hcd.scc +include features/usb/ohci-hcd.scc +include features/usb/uhci-hcd.scc +include features/usb/xhci-hcd.scc +include features/wifi/wifi-all.scc +include features/optee/optee.scc +include features/security/security.scc +include features/spi/spi.scc diff --git a/bsp/nsimhs/nsimhs-standard.scc b/bsp/hapshs/hapshs-standard.scc index 3201ca52..1842b00c 100644 --- a/bsp/nsimhs/nsimhs-standard.scc +++ b/bsp/hapshs/hapshs-standard.scc @@ -1,8 +1,8 @@ # SPDX-License-Identifier: MIT -define KMACHINE nsimhs +define KMACHINE hapshs define KTYPE standard define KARCH arc include ktypes/standard/standard.scc -include nsimhs.scc +include hapshs.scc diff --git a/bsp/hapshs/hapshs.cfg b/bsp/hapshs/hapshs.cfg new file mode 100644 index 00000000..adcc0531 --- /dev/null +++ b/bsp/hapshs/hapshs.cfg @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: MIT +# ARCv2 ISA +CONFIG_ISA_ARCV2=y + +# Serial port +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_OF_PLATFORM=y + +# Built-in .dtb +CONFIG_ARC_BUILTIN_DTB_NAME="haps_hs" diff --git a/bsp/nsimhs/nsimhs.scc b/bsp/hapshs/hapshs.scc index 3c1613a6..ea2b8b6c 100644 --- a/bsp/nsimhs/nsimhs.scc +++ b/bsp/hapshs/hapshs.scc @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -kconf hardware nsimhs.cfg +kconf hardware hapshs.cfg diff --git a/bsp/hsdk/hsdk.cfg b/bsp/hsdk/hsdk.cfg index 1d75fb92..ee4d8b17 100644 --- a/bsp/hsdk/hsdk.cfg +++ b/bsp/hsdk/hsdk.cfg @@ -13,7 +13,7 @@ CONFIG_ARC_BUILTIN_DTB_NAME="hsdk" CONFIG_ARC_UBOOT_SUPPORT=y # Auto-selected by U-Boot support but if it is enabled slave cores won't start -# CONFIG_ARC_SMP_HALT_ON_RESET is not set +CONFIG_ARC_SMP_HALT_ON_RESET=n # Serial port CONFIG_SERIAL_8250=y @@ -42,7 +42,6 @@ CONFIG_MICREL_PHY=y # GPIO CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_DWAPB=y # Video diff --git a/bsp/intel-common/intel-common-drivers.scc b/bsp/intel-common/intel-common-drivers.scc index c428e2f0..33451730 100644 --- a/bsp/intel-common/intel-common-drivers.scc +++ b/bsp/intel-common/intel-common-drivers.scc @@ -42,6 +42,7 @@ include features/igb/igb.scc include features/iwlwifi/iwlwifi.scc include features/iwlegacy/iwlegacy.scc include features/i40e/i40e.scc +include features/igc/igc.scc # Various RF/Wireless technologies include features/nfc/nfc.scc @@ -84,7 +85,6 @@ include features/input/keyboard-gpio.scc include features/ciphers/ciphers.scc include features/pci-iov/pci-iov.scc include features/intel-tco/intel-tco.scc -include features/random/random.scc # default policy for standard kernels include cfg/usb-mass-storage.scc diff --git a/bsp/intel-common/intel-core2-32.cfg b/bsp/intel-common/intel-core2-32.cfg index 10745035..0ecc393c 100644 --- a/bsp/intel-common/intel-core2-32.cfg +++ b/bsp/intel-common/intel-core2-32.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT # Must explicitly disable 64BIT -# CONFIG_64BIT is not set +CONFIG_64BIT=n CONFIG_MCORE2=y diff --git a/bsp/intel-common/intel-developer-drivers.scc b/bsp/intel-common/intel-developer-drivers.scc index 5bb73e3e..090d05ed 100644 --- a/bsp/intel-common/intel-developer-drivers.scc +++ b/bsp/intel-common/intel-developer-drivers.scc @@ -1,4 +1,3 @@ # SPDX-License-Identifier: MIT # Additional features for developer bsps -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/bsp/intel-common/intel-quark.cfg b/bsp/intel-common/intel-quark.cfg index b53a1a5e..13a7d6e0 100644 --- a/bsp/intel-common/intel-quark.cfg +++ b/bsp/intel-common/intel-quark.cfg @@ -5,7 +5,7 @@ CONFIG_X86_MCE=y CONFIG_PM=y # Must explicitly disable 64BIT -# CONFIG_64BIT is not set +CONFIG_64BIT=n CONFIG_X86_INTEL_QUARK=y CONFIG_MFD_INTEL_QUARK_I2C_GPIO=y diff --git a/bsp/intel-x86/intel-x86-32-preempt-rt.scc b/bsp/intel-x86/intel-x86-32-preempt-rt.scc index 1f21f316..34f76ad7 100644 --- a/bsp/intel-x86/intel-x86-32-preempt-rt.scc +++ b/bsp/intel-x86/intel-x86-32-preempt-rt.scc @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-32 define KTYPE preempt-rt -define KARCH x86 +define KARCH i386 include ktypes/preempt-rt branch x86 diff --git a/bsp/intel-x86/intel-x86-32-standard.scc b/bsp/intel-x86/intel-x86-32-standard.scc index ce6a28ec..4b038ac0 100644 --- a/bsp/intel-x86/intel-x86-32-standard.scc +++ b/bsp/intel-x86/intel-x86-32-standard.scc @@ -1,11 +1,10 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-32 define KTYPE standard -define KARCH x86 +define KARCH i386 include ktypes/standard branch x86 - +include features/transparent-hugepage/transparent-hugepage.scc include intel-x86-32.scc -kconf hardware intel-x86-hugepage.cfg kconf hardware cfs-bandwidth.cfg diff --git a/bsp/intel-x86/intel-x86-32-tiny.scc b/bsp/intel-x86/intel-x86-32-tiny.scc index 58b1c75c..2263c27f 100644 --- a/bsp/intel-x86/intel-x86-32-tiny.scc +++ b/bsp/intel-x86/intel-x86-32-tiny.scc @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-32 define KTYPE tiny -define KARCH x86 +define KARCH i386 include ktypes/tiny/tiny.scc branch x86 diff --git a/bsp/intel-x86/intel-x86-32.cfg b/bsp/intel-x86/intel-x86-32.cfg index c4340925..67f06dbc 100644 --- a/bsp/intel-x86/intel-x86-32.cfg +++ b/bsp/intel-x86/intel-x86-32.cfg @@ -14,7 +14,7 @@ # Switch back to x86-32 from x86-64 CONFIG_X86_32=y -# CONFIG_64BIT is not set +CONFIG_64BIT=n # # Processor type and features diff --git a/bsp/intel-x86/intel-x86-64-preempt-rt.scc b/bsp/intel-x86/intel-x86-64-preempt-rt.scc index e759c884..e776cfa9 100644 --- a/bsp/intel-x86/intel-x86-64-preempt-rt.scc +++ b/bsp/intel-x86/intel-x86-64-preempt-rt.scc @@ -1,9 +1,10 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-64 define KTYPE preempt-rt -define KARCH x86 +define KARCH x86_64 include ktypes/preempt-rt include intel-x86-64.scc +include features/tsn/tsn.scc kconf hardware cfs-bandwidth.cfg diff --git a/bsp/intel-x86/intel-x86-64-standard.scc b/bsp/intel-x86/intel-x86-64-standard.scc index 64d89533..ba29fa80 100644 --- a/bsp/intel-x86/intel-x86-64-standard.scc +++ b/bsp/intel-x86/intel-x86-64-standard.scc @@ -1,10 +1,9 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-64 define KTYPE standard -define KARCH x86 +define KARCH x86_64 include ktypes/standard - +include features/transparent-hugepage/transparent-hugepage.scc include intel-x86-64.scc -kconf hardware intel-x86-hugepage.cfg kconf hardware cfs-bandwidth.cfg diff --git a/bsp/intel-x86/intel-x86-64-tiny.scc b/bsp/intel-x86/intel-x86-64-tiny.scc index 798c4a1f..5eaa689c 100644 --- a/bsp/intel-x86/intel-x86-64-tiny.scc +++ b/bsp/intel-x86/intel-x86-64-tiny.scc @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT define KMACHINE intel-x86-64 define KTYPE tiny -define KARCH x86 +define KARCH x86_64 include ktypes/tiny/tiny.scc diff --git a/bsp/intel-x86/intel-x86-64.cfg b/bsp/intel-x86/intel-x86-64.cfg index 66581076..da9bc7b5 100644 --- a/bsp/intel-x86/intel-x86-64.cfg +++ b/bsp/intel-x86/intel-x86-64.cfg @@ -2,30 +2,6 @@ # # General setup # -CONFIG_NUMA_BALANCING=y -CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y - -# -# ACPI NUMA -# -CONFIG_X86_64_ACPI_NUMA=y -CONFIG_CRYPTO_CRCT10DIF_PCLMUL=m -CONFIG_CRYPTO_SHA1_SSSE3=m -CONFIG_CRYPTO_SHA256_SSSE3=m -CONFIG_CRYPTO_SHA512_SSSE3=m - -# EDAC -CONFIG_EDAC=y -CONFIG_EDAC_DEBUG=y -CONFIG_EDAC_SBRIDGE=m -CONFIG_ACPI_APEI=y -CONFIG_ACPI_APEI_EINJ=m -CONFIG_ACPI_APEI_GHES=y -CONFIG_EDAC_PND2=m -CONFIG_EDAC_SKX=m -CONFIG_EDAC_I10NM=m -CONFIG_EDAC_IGEN6=m - # ISH CONFIG_INTEL_ISH_HID=m @@ -38,6 +14,10 @@ CONFIG_PCI_IOV=y CONFIG_CRYPTO=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_CRCT10DIF_PCLMUL=m +CONFIG_CRYPTO_SHA1_SSSE3=m +CONFIG_CRYPTO_SHA256_SSSE3=m +CONFIG_CRYPTO_SHA512_SSSE3=m CONFIG_CRYPTO_AES_NI_INTEL=m # For different QAT devices @@ -45,11 +25,9 @@ CONFIG_CRYPTO_DEV_QAT_C3XXX=m CONFIG_CRYPTO_DEV_QAT_C3XXXVF=m CONFIG_CRYPTO_DEV_QAT_C62X=m CONFIG_CRYPTO_DEV_QAT_C62XVF=m +CONFIG_CRYPTO_DEV_QAT_4XXX=m CONFIG_CRYPTO_DEV_QAT_DH895xCC=m CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=m # x86 CPU resource control support CONFIG_X86_CPU_RESCTRL=y - -# Processor type and features -CONFIG_NR_CPUS=256 diff --git a/features/random/random.cfg b/bsp/intel-x86/intel-x86-dptf-overrides.cfg index bacab3cb..2c206883 100644 --- a/features/random/random.cfg +++ b/bsp/intel-x86/intel-x86-dptf-overrides.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -CONFIG_RANDOM_TRUST_CPU=y +CONFIG_ACPI_DPTF=y diff --git a/bsp/intel-x86/intel-x86-i40e-overrides.cfg b/bsp/intel-x86/intel-x86-i40e-overrides.cfg new file mode 100644 index 00000000..0e92b020 --- /dev/null +++ b/bsp/intel-x86/intel-x86-i40e-overrides.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_I40E=y diff --git a/bsp/intel-x86/intel-x86-igc-overrides.cfg b/bsp/intel-x86/intel-x86-igc-overrides.cfg new file mode 100644 index 00000000..870e9883 --- /dev/null +++ b/bsp/intel-x86/intel-x86-igc-overrides.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_IGC=y diff --git a/bsp/intel-x86/intel-x86-serial-8250-overrides.cfg b/bsp/intel-x86/intel-x86-serial-8250-overrides.cfg new file mode 100644 index 00000000..76e13ade --- /dev/null +++ b/bsp/intel-x86/intel-x86-serial-8250-overrides.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_SERIAL_8250_NR_UARTS=16 +CONFIG_SERIAL_8250_RUNTIME_UARTS=16 diff --git a/bsp/intel-x86/intel-x86.cfg b/bsp/intel-x86/intel-x86.cfg index b5c25931..8266bf8f 100644 --- a/bsp/intel-x86/intel-x86.cfg +++ b/bsp/intel-x86/intel-x86.cfg @@ -28,7 +28,6 @@ CONFIG_PROCESSOR_SELECT=y CONFIG_CPU_SUP_INTEL=y CONFIG_X86_EXTENDED_PLATFORM=y CONFIG_KSM=y -CONFIG_CLEANCACHE=y CONFIG_X86_CHECK_BIOS_CORRUPTION=y CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y @@ -72,7 +71,6 @@ CONFIG_LPC_SCH=m # GPIO drivers # CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_SCH=m CONFIG_GPIO_ICH=m CONFIG_GPIO_GENERIC_PLATFORM=m @@ -145,7 +143,7 @@ CONFIG_EEPROM_LEGACY=m # # Intel Wireless WiFi Next Gen AGN # -# CONFIG_IWLWIFI_DEBUG is not set +CONFIG_IWLWIFI_DEBUG=n CONFIG_IWLDVM=m CONFIG_IWLMVM=m CONFIG_HOSTAP=y @@ -156,11 +154,6 @@ CONFIG_HOSTAP=y CONFIG_RTL8723BE=m # -# Intel devices -# -CONFIG_IXGB=y - -# # nvram support # CONFIG_NVRAM=m @@ -257,7 +250,7 @@ CONFIG_CRYPTO_AES_NI_INTEL=m # HID # CONFIG_HID=y -CONFIG_I2C_HID=y +CONFIG_I2C_HID_ACPI=y CONFIG_HID_SENSOR_HUB=y # @@ -271,11 +264,23 @@ CONFIG_HSU_DMA_PCI=y # #SPI # +CONFIG_SPI_DESIGNWARE=m +CONFIG_SPI_DW_DMA=y +CONFIG_SPI_DW_PCI=m +CONFIG_SPI_DW_MMIO=m CONFIG_SPI_PXA2XX=y CONFIG_SPI_PXA2XX_PCI=y CONFIG_VT_HW_CONSOLE_BINDING=y +# +# MTD SPI +# +CONFIG_MTD_SPI_NOR=m +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_SPI_INTEL_PCI=m +CONFIG_SPI_INTEL_PLATFORM=m + # Bluetooth device drivers CONFIG_BT_HCIBTUSB=m @@ -308,6 +313,7 @@ CONFIG_NOP_USB_XCEIV=y # NVMe support CONFIG_BLK_DEV_NVME=y +CONFIG_NVME_HWMON=y # PMC CONFIG_MFD_INTEL_PMC_BXT=m @@ -340,6 +346,9 @@ CONFIG_TOUCHSCREEN_ZFORCE=m CONFIG_DRM_NOUVEAU=m CONFIG_DRM_NOUVEAU_BACKLIGHT=y +# AST server chips +CONFIG_DRM_AST=m + # x86 CPU resource control support CONFIG_X86_CPU_RESCTRL=y @@ -349,3 +358,7 @@ CONFIG_POWERCAP=y CONFIG_INTEL_RAPL=m CONFIG_EXTCON=y + +# MII PHY device drivers +CONFIG_MARVELL_PHY=y +CONFIG_DP83867_PHY=y diff --git a/bsp/intel-x86/intel-x86.scc b/bsp/intel-x86/intel-x86.scc index ccb22195..7825075d 100644 --- a/bsp/intel-x86/intel-x86.scc +++ b/bsp/intel-x86/intel-x86.scc @@ -23,14 +23,15 @@ include features/igc/igc.scc include features/iwlwifi/iwlwifi.scc include features/i40e/i40e.scc include features/ice/ice.scc +include features/net/stmicro/stmmac.scc include features/usb/uhci-hcd.scc include features/usb/ehci-hcd.scc include features/usb/xhci-hcd.scc include features/hostapd/hostapd.scc -include features/latencytop/latencytop.scc include features/uio/uio.scc include features/spi/spi.scc +include features/mtd/mtd.scc include features/spi/spidev.scc include features/bluetooth/bluetooth.scc include features/input/input.scc @@ -51,6 +52,8 @@ include features/intel-idxd/intel-idxd.scc include features/intel-uncore-frequency/intel-uncore-frequency.scc include features/intel-dptf/intel-dptf.scc include features/can/m_can.scc +include features/vfio/vfio.scc +include features/i3c/i3c.scc kconf hardware intel-x86.cfg kconf hardware intel-x86-mga.cfg @@ -58,3 +61,7 @@ kconf hardware intel-x86-acpi.cfg kconf hardware intel-x86-igb-overrides.cfg kconf hardware intel-x86-ixgbe-overrides.cfg kconf hardware intel-x86-i915-overrides.cfg +kconf hardware intel-x86-dptf-overrides.cfg +kconf hardware intel-x86-serial-8250-overrides.cfg +kconf hardware intel-x86-i40e-overrides.cfg +kconf hardware intel-x86-igc-overrides.cfg diff --git a/bsp/minnow/minnow-no-pch-gpio.cfg b/bsp/minnow/minnow-no-pch-gpio.cfg index d175ec96..b8548fe9 100644 --- a/bsp/minnow/minnow-no-pch-gpio.cfg +++ b/bsp/minnow/minnow-no-pch-gpio.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -# CONFIG_GPIO_PCH is not set +CONFIG_GPIO_PCH=n diff --git a/bsp/minnow/minnow-preempt-rt.scc b/bsp/minnow/minnow-preempt-rt.scc index f551544d..20710e7f 100644 --- a/bsp/minnow/minnow-preempt-rt.scc +++ b/bsp/minnow/minnow-preempt-rt.scc @@ -21,7 +21,6 @@ include cfg/efi-ext.scc # default policy for preempt-rt kernels include cfg/usb-mass-storage.scc include cfg/boot-live.scc -include features/latencytop/latencytop.scc include features/profiling/profiling.scc # Requested drivers that don't have an existing scc diff --git a/bsp/minnow/minnow-standard.scc b/bsp/minnow/minnow-standard.scc index 5591a330..46363027 100644 --- a/bsp/minnow/minnow-standard.scc +++ b/bsp/minnow/minnow-standard.scc @@ -18,7 +18,6 @@ include cfg/usb-mass-storage.scc include cfg/boot-live.scc # Basic profiling -include features/latencytop/latencytop.scc include features/profiling/profiling.scc # Requested drivers that don't have an existing scc diff --git a/bsp/minnow/minnow.cfg b/bsp/minnow/minnow.cfg index 89a86e6d..311ebcca 100644 --- a/bsp/minnow/minnow.cfg +++ b/bsp/minnow/minnow.cfg @@ -48,7 +48,6 @@ CONFIG_SERIAL_PCH_UART_CONSOLE=y ### Non-essential on-board features ### # GPIO Support -CONFIG_GPIO_SYSFS=y CONFIG_GPIOLIB=y CONFIG_GPIO_GENERIC=y @@ -63,7 +62,7 @@ CONFIG_INPUT_EVDEV=y # Ensure the performance govenor is the default for optimal boot time # (Leave it to userspace to change it after boot) -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=n CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # Enable readahead @@ -71,9 +70,9 @@ CONFIG_FANOTIFY=y CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y ### Standard configs we just do not need ### -# CONFIG_KEYBOARD_ATKBD is not set -# CONFIG_SERIO_I8042 is not set -# CONFIG_MOUSE_PS2 is not set +CONFIG_KEYBOARD_ATKBD=n +CONFIG_SERIO_I8042=n +CONFIG_MOUSE_PS2=n ### Should be specified elsewhere ### # Make sure these are on, otherwise the bootup won't be fun @@ -90,9 +89,5 @@ CONFIG_PRINTK_TIME=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TMPFS_XATTR=y -# Cleanup some warnings -# Avoid warnings with the x86.scc -# CONFIG_MICROCODE_AMD is not set - # No need to emulate an RTC, we have one, avoid the warning of it missing -# CONFIG_HPET_EMULATE_RTC is not set +CONFIG_HPET_EMULATE_RTC=n diff --git a/bsp/mti-malta32/mti-malta32-common.cfg b/bsp/mti-malta32/mti-malta32-common.cfg index ca712a1d..5786da2e 100644 --- a/bsp/mti-malta32/mti-malta32-common.cfg +++ b/bsp/mti-malta32/mti-malta32-common.cfg @@ -28,9 +28,9 @@ CONFIG_MTD_PHYSMAP=y CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_SUPERIO=y -# CONFIG_PARPORT_SERIAL is not set +CONFIG_PARPORT_SERIAL=n -# CONFIG_BLK_DEV_FD is not set +CONFIG_BLK_DEV_FD=n CONFIG_PCI=y @@ -39,13 +39,6 @@ CONFIG_BLK_DEV_SD=m CONFIG_BLK_DEV_SR=m CONFIG_CHR_DEV_SG=m -CONFIG_IDE=y -CONFIG_IDE_GENERIC=y -CONFIG_BLK_DEV_IDEPCI=y -CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_PIIX=y -CONFIG_BLK_DEV_IDEDMA=y - CONFIG_PCNET32=y CONFIG_SERIAL_CORE=y @@ -69,7 +62,7 @@ CONFIG_USB_STORAGE=m CONFIG_INPUT_EVDEV=y CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_SERPORT=n CONFIG_USB_MON=y CONFIG_USB_OHCI_HCD=y @@ -78,4 +71,4 @@ CONFIG_USB_OHCI_HCD=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_PIIX4_POWEROFF=y -# CONFIG_COMPACTION is not set +CONFIG_COMPACTION=n diff --git a/bsp/mti-malta32/mti-malta32-rt.cfg b/bsp/mti-malta32/mti-malta32-rt.cfg index c80c1b6f..0ced014d 100644 --- a/bsp/mti-malta32/mti-malta32-rt.cfg +++ b/bsp/mti-malta32/mti-malta32-rt.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -# CONFIG_HIGHMEM is not set +CONFIG_HIGHMEM=n diff --git a/bsp/mti-malta32/mti-malta32.scc b/bsp/mti-malta32/mti-malta32.scc index 25f7b68d..e1b00f58 100644 --- a/bsp/mti-malta32/mti-malta32.scc +++ b/bsp/mti-malta32/mti-malta32.scc @@ -3,7 +3,6 @@ kconf hardware mti-malta32-common.cfg kconf hardware mti-malta32-gfx.cfg include features/profiling/profiling.scc -include features/latencytop/latencytop.scc include features/usb/ehci-hcd.scc include features/usb/uhci-hcd.scc @@ -17,3 +16,5 @@ patch Revert-Input-i8042-io-fix-up-region-handling-on-MIPS.patch # v3.8+ kernels have broken mips ftrace function tracing, disable it for now include features/ftrace/ftrace-function-tracer-disable.scc + +include cfg/net/mdio.scc diff --git a/bsp/mti-malta64/mti-malta64-be-developer.scc b/bsp/mti-malta64/mti-malta64-be-developer.scc index 033c332f..f8ccdf43 100644 --- a/bsp/mti-malta64/mti-malta64-be-developer.scc +++ b/bsp/mti-malta64/mti-malta64-be-developer.scc @@ -12,6 +12,5 @@ include mti-malta64.scc kconf hardware mti-malta64-be.cfg include features/profiling/profiling.scc -include features/latencytop/latencytop.scc include cfg/tracing.scc diff --git a/bsp/mti-malta64/mti-malta64-common.cfg b/bsp/mti-malta64/mti-malta64-common.cfg index ea9a335b..d920aa8b 100644 --- a/bsp/mti-malta64/mti-malta64-common.cfg +++ b/bsp/mti-malta64/mti-malta64-common.cfg @@ -14,7 +14,7 @@ CONFIG_MIPS=y CONFIG_MIPS_MALTA=y CONFIG_CPU_MIPS64_R1=y -# CONFIG_CPU_MIPS64_R2 is not set +CONFIG_CPU_MIPS64_R2=n CONFIG_CPU_MIPS64=y CONFIG_CPU_MIPSR1=y CONFIG_64BIT=y @@ -31,9 +31,9 @@ CONFIG_MTD_PHYSMAP=y CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_SUPERIO=y -# CONFIG_PARPORT_SERIAL is not set +CONFIG_PARPORT_SERIAL=n -# CONFIG_BLK_DEV_FD is not set +CONFIG_BLK_DEV_FD=n CONFIG_PCI=y @@ -42,13 +42,6 @@ CONFIG_BLK_DEV_SD=m CONFIG_BLK_DEV_SR=m CONFIG_CHR_DEV_SG=m -CONFIG_IDE=y -CONFIG_IDE_GENERIC=y -CONFIG_BLK_DEV_IDEPCI=y -CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_PIIX=y -CONFIG_BLK_DEV_IDEDMA=y - CONFIG_PCNET32=y CONFIG_SERIAL_CORE=y @@ -72,13 +65,13 @@ CONFIG_USB_STORAGE=m CONFIG_INPUT_EVDEV=y CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_SERPORT=n CONFIG_USB_MON=y CONFIG_USB_OHCI_HCD=y -# CONFIG_VGA_CONSOLE is not set +CONFIG_VGA_CONSOLE=n # Board reset CONFIG_POWER_RESET=y diff --git a/bsp/nsimhs/nsimhs.cfg b/bsp/nsimhs/nsimhs.cfg deleted file mode 100644 index 34580a39..00000000 --- a/bsp/nsimhs/nsimhs.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: MIT -# ARCv2 ISA -CONFIG_ISA_ARCV2=y - -# Legacy ARC UART -CONFIG_SERIAL_ARC=y -CONFIG_SERIAL_ARC_CONSOLE=y - -# Built-in .dtb -CONFIG_ARC_BUILTIN_DTB_NAME="nsim_hs" diff --git a/bsp/nxp-ls20xx/nxp-ls20xx.cfg b/bsp/nxp-ls20xx/nxp-ls20xx.cfg index 5c21f211..a6850fb2 100755 --- a/bsp/nxp-ls20xx/nxp-ls20xx.cfg +++ b/bsp/nxp-ls20xx/nxp-ls20xx.cfg @@ -153,7 +153,7 @@ CONFIG_CRYPTO_SHA2_ARM64_CE=y CONFIG_CRYPTO_GHASH_ARM64_CE=y CONFIG_CRYPTO_AES_ARM64_CE_CCM=y CONFIG_CRYPTO_AES_ARM64_CE_BLK=y -# CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is not set +CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=n # EDAC CONFIG_EDAC_LAYERSCAPE=y diff --git a/bsp/qemu-ppc32/powerpc-special-load-offset-for-qemu.patch b/bsp/qemu-ppc32/powerpc-special-load-offset-for-qemu.patch deleted file mode 100644 index ae9d48d7..00000000 --- a/bsp/qemu-ppc32/powerpc-special-load-offset-for-qemu.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 9df586c4b4b112f55f1984697bfd6de663774118 Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Wed, 3 Feb 2010 13:51:19 -0500 -Subject: [PATCH 2/3] powerpc: special load offset for qemu - -Patch the load offset to work correctly with qemu_boot_loader. - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - arch/powerpc/kernel/vmlinux.lds.S | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S -index dcd01c8..4397f44 100644 ---- a/arch/powerpc/kernel/vmlinux.lds.S -+++ b/arch/powerpc/kernel/vmlinux.lds.S -@@ -8,6 +8,11 @@ - #include <asm/cache.h> - #include <asm/thread_info.h> - -+#ifdef CONFIG_PPC_QEMU -+#undef LOAD_OFFSET -+#define LOAD_OFFSET 0 -+#endif /* CONFIG_PPC_QEMU */ -+ - ENTRY(_stext) - - PHDRS { --- -1.6.5.2 - diff --git a/bsp/qemu-ppc32/qemu-platform-v2.patch b/bsp/qemu-ppc32/qemu-platform-v2.patch deleted file mode 100644 index 59b3fa3f..00000000 --- a/bsp/qemu-ppc32/qemu-platform-v2.patch +++ /dev/null @@ -1,1640 +0,0 @@ -From ed6c530bc35a3366a04dcf77ec0fd456da5ce480 Mon Sep 17 00:00:00 2001 -From: Milton Miller <miltonm@bga.com> -Date: Sat, 22 Sep 2007 09:08:31 +1000 -Subject: [PATCH 1/3] qemu platform, v2 - -Here is the second rev of patches to boot a arch powerpc kernel on -qemu with the prep architecture. - -The goal is to provide an environment for use with the existing qemu -hardware suppplied hardware, as oposed to changing the qemu -machine description. - -This patch contains only the kernel portion. While the diff was -generated against for-2.6.24, this first patch applies cleanly -to 2.6.23-rc7. With the rom image created in the next patch, -a kernel built by this patch should boot when using qemu -kernel. - -I debated putting this in the embedded6xx tree, especially when I -discovered that the bridge is suposedly a '105, but saw no advantage -in the end. - -pci config space is now working, however cirrusfb causes crashes -and ohci times out, so at least pci memory is likely still broken. - -ide and serial work, floppy and parallel are untested. - -I added a defconfig based on chrp32; hardware options still need -tweaking (eg isa ne2k). - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> -diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index c33e3ad..a0d28dc 100644 ---- a/arch/powerpc/Kconfig -+++ b/arch/powerpc/Kconfig -@@ -636,7 +636,7 @@ menu "Bus options" - - config ISA - bool "Support for ISA-bus hardware" -- depends on PPC_CHRP -+ depends on PPC_CHRP || PPC_QEMU - select PPC_I8259 - help - Find out whether you have ISA slots on your motherboard. ISA is the -diff --git a/arch/powerpc/configs/qemu_defconfig b/arch/powerpc/configs/qemu_defconfig -new file mode 100644 -index 0000000..a6d6721 ---- /dev/null -+++ b/arch/powerpc/configs/qemu_defconfig -@@ -0,0 +1,1217 @@ -+# -+# Automatically generated make config: don't edit -+# Linux kernel version: 2.6.23-rc6 -+# Tue Sep 18 15:18:32 2007 -+# -+# CONFIG_PPC64 is not set -+ -+# -+# Processor support -+# -+CONFIG_6xx=y -+# CONFIG_PPC_85xx is not set -+# CONFIG_PPC_8xx is not set -+# CONFIG_40x is not set -+# CONFIG_44x is not set -+# CONFIG_E200 is not set -+CONFIG_PPC_FPU=y -+# CONFIG_ALTIVEC is not set -+CONFIG_PPC_STD_MMU=y -+CONFIG_PPC_STD_MMU_32=y -+# CONFIG_PPC_MM_SLICES is not set -+# CONFIG_SMP is not set -+CONFIG_PPC32=y -+CONFIG_PPC_MERGE=y -+CONFIG_MMU=y -+CONFIG_GENERIC_HARDIRQS=y -+CONFIG_IRQ_PER_CPU=y -+CONFIG_RWSEM_XCHGADD_ALGORITHM=y -+CONFIG_ARCH_HAS_ILOG2_U32=y -+CONFIG_GENERIC_HWEIGHT=y -+CONFIG_GENERIC_CALIBRATE_DELAY=y -+CONFIG_GENERIC_FIND_NEXT_BIT=y -+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set -+CONFIG_PPC=y -+CONFIG_EARLY_PRINTK=y -+CONFIG_GENERIC_NVRAM=y -+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y -+CONFIG_ARCH_MAY_HAVE_PC_FDC=y -+CONFIG_PPC_OF=y -+CONFIG_OF=y -+CONFIG_PPC_UDBG_16550=y -+# CONFIG_GENERIC_TBSYNC is not set -+CONFIG_AUDIT_ARCH=y -+CONFIG_GENERIC_BUG=y -+# CONFIG_DEFAULT_UIMAGE is not set -+# CONFIG_PPC_DCR_NATIVE is not set -+# CONFIG_PPC_DCR_MMIO is not set -+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -+ -+# -+# General setup -+# -+CONFIG_EXPERIMENTAL=y -+CONFIG_BROKEN_ON_SMP=y -+CONFIG_INIT_ENV_ARG_LIMIT=32 -+CONFIG_LOCALVERSION="" -+# CONFIG_LOCALVERSION_AUTO is not set -+CONFIG_SWAP=y -+CONFIG_SYSVIPC=y -+CONFIG_SYSVIPC_SYSCTL=y -+CONFIG_POSIX_MQUEUE=y -+# CONFIG_BSD_PROCESS_ACCT is not set -+# CONFIG_TASKSTATS is not set -+# CONFIG_USER_NS is not set -+# CONFIG_AUDIT is not set -+CONFIG_IKCONFIG=y -+CONFIG_IKCONFIG_PROC=y -+CONFIG_LOG_BUF_SHIFT=15 -+CONFIG_SYSFS_DEPRECATED=y -+# CONFIG_RELAY is not set -+CONFIG_BLK_DEV_INITRD=y -+CONFIG_INITRAMFS_SOURCE="" -+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -+CONFIG_SYSCTL=y -+# CONFIG_EMBEDDED is not set -+CONFIG_SYSCTL_SYSCALL=y -+CONFIG_KALLSYMS=y -+# CONFIG_KALLSYMS_ALL is not set -+# CONFIG_KALLSYMS_EXTRA_PASS is not set -+CONFIG_HOTPLUG=y -+CONFIG_PRINTK=y -+CONFIG_BUG=y -+CONFIG_ELF_CORE=y -+CONFIG_BASE_FULL=y -+CONFIG_FUTEX=y -+CONFIG_ANON_INODES=y -+CONFIG_EPOLL=y -+CONFIG_SIGNALFD=y -+CONFIG_TIMERFD=y -+CONFIG_EVENTFD=y -+CONFIG_SHMEM=y -+CONFIG_VM_EVENT_COUNTERS=y -+CONFIG_SLAB=y -+# CONFIG_SLUB is not set -+# CONFIG_SLOB is not set -+CONFIG_RT_MUTEXES=y -+# CONFIG_TINY_SHMEM is not set -+CONFIG_BASE_SMALL=0 -+CONFIG_MODULES=y -+CONFIG_MODULE_UNLOAD=y -+CONFIG_MODULE_FORCE_UNLOAD=y -+# CONFIG_MODVERSIONS is not set -+# CONFIG_MODULE_SRCVERSION_ALL is not set -+CONFIG_KMOD=y -+CONFIG_BLOCK=y -+CONFIG_LBD=y -+# CONFIG_BLK_DEV_IO_TRACE is not set -+# CONFIG_LSF is not set -+# CONFIG_BLK_DEV_BSG is not set -+ -+# -+# IO Schedulers -+# -+CONFIG_IOSCHED_NOOP=y -+CONFIG_IOSCHED_AS=y -+CONFIG_IOSCHED_DEADLINE=y -+CONFIG_IOSCHED_CFQ=y -+CONFIG_DEFAULT_AS=y -+# CONFIG_DEFAULT_DEADLINE is not set -+# CONFIG_DEFAULT_CFQ is not set -+# CONFIG_DEFAULT_NOOP is not set -+CONFIG_DEFAULT_IOSCHED="anticipatory" -+ -+# -+# Platform support -+# -+CONFIG_PPC_MULTIPLATFORM=y -+# CONFIG_EMBEDDED6xx is not set -+# CONFIG_PPC_82xx is not set -+# CONFIG_PPC_83xx is not set -+# CONFIG_PPC_86xx is not set -+CONFIG_CLASSIC32=y -+# CONFIG_PPC_CHRP is not set -+# CONFIG_PPC_MPC52xx is not set -+# CONFIG_PPC_MPC5200 is not set -+# CONFIG_PPC_EFIKA is not set -+# CONFIG_PPC_LITE5200 is not set -+# CONFIG_PPC_PMAC is not set -+CONFIG_PPC_QEMU=y -+# CONFIG_PPC_CELL is not set -+# CONFIG_PPC_CELL_NATIVE is not set -+# CONFIG_PQ2ADS is not set -+CONFIG_PPC_NATIVE=y -+# CONFIG_MPIC is not set -+# CONFIG_MPIC_WEIRD is not set -+CONFIG_PPC_I8259=y -+# CONFIG_PPC_RTAS is not set -+# CONFIG_MMIO_NVRAM is not set -+# CONFIG_PPC_MPC106 is not set -+# CONFIG_PPC_970_NAP is not set -+# CONFIG_PPC_INDIRECT_IO is not set -+# CONFIG_GENERIC_IOMAP is not set -+# CONFIG_CPU_FREQ is not set -+# CONFIG_TAU is not set -+# CONFIG_CPM2 is not set -+# CONFIG_FSL_ULI1575 is not set -+ -+# -+# Kernel options -+# -+CONFIG_HIGHMEM=y -+# CONFIG_HZ_100 is not set -+CONFIG_HZ_250=y -+# CONFIG_HZ_300 is not set -+# CONFIG_HZ_1000 is not set -+CONFIG_HZ=250 -+CONFIG_PREEMPT_NONE=y -+# CONFIG_PREEMPT_VOLUNTARY is not set -+# CONFIG_PREEMPT is not set -+CONFIG_BINFMT_ELF=y -+CONFIG_BINFMT_MISC=y -+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -+# CONFIG_KEXEC is not set -+CONFIG_ARCH_FLATMEM_ENABLE=y -+CONFIG_ARCH_POPULATES_NODE_MAP=y -+CONFIG_SELECT_MEMORY_MODEL=y -+CONFIG_FLATMEM_MANUAL=y -+# CONFIG_DISCONTIGMEM_MANUAL is not set -+# CONFIG_SPARSEMEM_MANUAL is not set -+CONFIG_FLATMEM=y -+CONFIG_FLAT_NODE_MEM_MAP=y -+# CONFIG_SPARSEMEM_STATIC is not set -+CONFIG_SPLIT_PTLOCK_CPUS=4 -+# CONFIG_RESOURCES_64BIT is not set -+CONFIG_ZONE_DMA_FLAG=1 -+CONFIG_BOUNCE=y -+CONFIG_VIRT_TO_BUS=y -+CONFIG_PROC_DEVICETREE=y -+# CONFIG_CMDLINE_BOOL is not set -+# CONFIG_PM is not set -+CONFIG_SUSPEND_UP_POSSIBLE=y -+CONFIG_HIBERNATION_UP_POSSIBLE=y -+CONFIG_SECCOMP=y -+CONFIG_WANT_DEVICE_TREE=y -+CONFIG_DEVICE_TREE="qemu.dts" -+CONFIG_ISA_DMA_API=y -+ -+# -+# Bus options -+# -+CONFIG_ZONE_DMA=y -+CONFIG_GENERIC_ISA_DMA=y -+CONFIG_PPC_INDIRECT_PCI=y -+CONFIG_PCI=y -+CONFIG_PCI_DOMAINS=y -+CONFIG_PCI_SYSCALL=y -+# CONFIG_PCIEPORTBUS is not set -+CONFIG_ARCH_SUPPORTS_MSI=y -+# CONFIG_PCI_MSI is not set -+# CONFIG_PCI_DEBUG is not set -+ -+# -+# PCCARD (PCMCIA/CardBus) support -+# -+# CONFIG_PCCARD is not set -+# CONFIG_HOTPLUG_PCI is not set -+ -+# -+# Advanced setup -+# -+# CONFIG_ADVANCED_OPTIONS is not set -+ -+# -+# Default settings for advanced configuration options are used -+# -+CONFIG_HIGHMEM_START=0xfe000000 -+CONFIG_LOWMEM_SIZE=0x30000000 -+CONFIG_KERNEL_START=0xc0000000 -+CONFIG_TASK_SIZE=0x80000000 -+CONFIG_BOOT_LOAD=0x00800000 -+ -+# -+# Networking -+# -+CONFIG_NET=y -+ -+# -+# Networking options -+# -+CONFIG_PACKET=y -+# CONFIG_PACKET_MMAP is not set -+CONFIG_UNIX=y -+# CONFIG_NET_KEY is not set -+CONFIG_INET=y -+CONFIG_IP_MULTICAST=y -+# CONFIG_IP_ADVANCED_ROUTER is not set -+CONFIG_IP_FIB_HASH=y -+# CONFIG_IP_PNP is not set -+# CONFIG_NET_IPIP is not set -+# CONFIG_NET_IPGRE is not set -+# CONFIG_IP_MROUTE is not set -+# CONFIG_ARPD is not set -+CONFIG_SYN_COOKIES=y -+# CONFIG_INET_AH is not set -+# CONFIG_INET_ESP is not set -+# CONFIG_INET_IPCOMP is not set -+# CONFIG_INET_XFRM_TUNNEL is not set -+# CONFIG_INET_TUNNEL is not set -+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -+# CONFIG_INET_XFRM_MODE_TUNNEL is not set -+# CONFIG_INET_XFRM_MODE_BEET is not set -+CONFIG_INET_DIAG=y -+CONFIG_INET_TCP_DIAG=y -+# CONFIG_TCP_CONG_ADVANCED is not set -+CONFIG_TCP_CONG_CUBIC=y -+CONFIG_DEFAULT_TCP_CONG="cubic" -+# CONFIG_TCP_MD5SIG is not set -+# CONFIG_IP_VS is not set -+# CONFIG_IPV6 is not set -+# CONFIG_INET6_XFRM_TUNNEL is not set -+# CONFIG_INET6_TUNNEL is not set -+# CONFIG_NETWORK_SECMARK is not set -+CONFIG_NETFILTER=y -+# CONFIG_NETFILTER_DEBUG is not set -+ -+# -+# Core Netfilter Configuration -+# -+# CONFIG_NETFILTER_NETLINK is not set -+CONFIG_NF_CONNTRACK_ENABLED=m -+CONFIG_NF_CONNTRACK=m -+# CONFIG_NF_CT_ACCT is not set -+# CONFIG_NF_CONNTRACK_MARK is not set -+# CONFIG_NF_CONNTRACK_EVENTS is not set -+# CONFIG_NF_CT_PROTO_SCTP is not set -+# CONFIG_NF_CT_PROTO_UDPLITE is not set -+# CONFIG_NF_CONNTRACK_AMANDA is not set -+CONFIG_NF_CONNTRACK_FTP=m -+# CONFIG_NF_CONNTRACK_H323 is not set -+CONFIG_NF_CONNTRACK_IRC=m -+# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set -+# CONFIG_NF_CONNTRACK_PPTP is not set -+# CONFIG_NF_CONNTRACK_SANE is not set -+CONFIG_NF_CONNTRACK_SIP=m -+CONFIG_NF_CONNTRACK_TFTP=m -+CONFIG_NETFILTER_XTABLES=m -+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set -+# CONFIG_NETFILTER_XT_TARGET_MARK is not set -+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set -+# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set -+# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set -+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set -+# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set -+# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set -+# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set -+# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set -+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set -+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set -+# CONFIG_NETFILTER_XT_MATCH_ESP is not set -+# CONFIG_NETFILTER_XT_MATCH_HELPER is not set -+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set -+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set -+# CONFIG_NETFILTER_XT_MATCH_MAC is not set -+# CONFIG_NETFILTER_XT_MATCH_MARK is not set -+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set -+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set -+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set -+# CONFIG_NETFILTER_XT_MATCH_REALM is not set -+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set -+# CONFIG_NETFILTER_XT_MATCH_STATE is not set -+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set -+# CONFIG_NETFILTER_XT_MATCH_STRING is not set -+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set -+# CONFIG_NETFILTER_XT_MATCH_U32 is not set -+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set -+ -+# -+# IP: Netfilter Configuration -+# -+CONFIG_NF_CONNTRACK_IPV4=m -+CONFIG_NF_CONNTRACK_PROC_COMPAT=y -+# CONFIG_IP_NF_QUEUE is not set -+CONFIG_IP_NF_IPTABLES=m -+# CONFIG_IP_NF_MATCH_IPRANGE is not set -+# CONFIG_IP_NF_MATCH_TOS is not set -+# CONFIG_IP_NF_MATCH_RECENT is not set -+# CONFIG_IP_NF_MATCH_ECN is not set -+# CONFIG_IP_NF_MATCH_AH is not set -+# CONFIG_IP_NF_MATCH_TTL is not set -+# CONFIG_IP_NF_MATCH_OWNER is not set -+# CONFIG_IP_NF_MATCH_ADDRTYPE is not set -+CONFIG_IP_NF_FILTER=m -+CONFIG_IP_NF_TARGET_REJECT=m -+CONFIG_IP_NF_TARGET_LOG=m -+# CONFIG_IP_NF_TARGET_ULOG is not set -+CONFIG_NF_NAT=m -+CONFIG_NF_NAT_NEEDED=y -+CONFIG_IP_NF_TARGET_MASQUERADE=m -+CONFIG_IP_NF_TARGET_REDIRECT=m -+# CONFIG_IP_NF_TARGET_NETMAP is not set -+# CONFIG_IP_NF_TARGET_SAME is not set -+# CONFIG_NF_NAT_SNMP_BASIC is not set -+CONFIG_NF_NAT_FTP=m -+CONFIG_NF_NAT_IRC=m -+CONFIG_NF_NAT_TFTP=m -+# CONFIG_NF_NAT_AMANDA is not set -+# CONFIG_NF_NAT_PPTP is not set -+# CONFIG_NF_NAT_H323 is not set -+CONFIG_NF_NAT_SIP=m -+# CONFIG_IP_NF_MANGLE is not set -+# CONFIG_IP_NF_RAW is not set -+# CONFIG_IP_NF_ARPTABLES is not set -+# CONFIG_IP_DCCP is not set -+# CONFIG_IP_SCTP is not set -+# CONFIG_TIPC is not set -+# CONFIG_ATM is not set -+# CONFIG_BRIDGE is not set -+# CONFIG_VLAN_8021Q is not set -+# CONFIG_DECNET is not set -+# CONFIG_LLC2 is not set -+# CONFIG_IPX is not set -+# CONFIG_ATALK is not set -+# CONFIG_X25 is not set -+# CONFIG_LAPB is not set -+# CONFIG_ECONET is not set -+# CONFIG_WAN_ROUTER is not set -+ -+# -+# QoS and/or fair queueing -+# -+# CONFIG_NET_SCHED is not set -+ -+# -+# Network testing -+# -+# CONFIG_NET_PKTGEN is not set -+# CONFIG_HAMRADIO is not set -+# CONFIG_IRDA is not set -+# CONFIG_BT is not set -+# CONFIG_AF_RXRPC is not set -+ -+# -+# Wireless -+# -+# CONFIG_CFG80211 is not set -+# CONFIG_WIRELESS_EXT is not set -+# CONFIG_MAC80211 is not set -+# CONFIG_IEEE80211 is not set -+# CONFIG_RFKILL is not set -+# CONFIG_NET_9P is not set -+ -+# -+# Device Drivers -+# -+ -+# -+# Generic Driver Options -+# -+# CONFIG_STANDALONE is not set -+CONFIG_PREVENT_FIRMWARE_BUILD=y -+# CONFIG_FW_LOADER is not set -+# CONFIG_DEBUG_DRIVER is not set -+# CONFIG_DEBUG_DEVRES is not set -+# CONFIG_SYS_HYPERVISOR is not set -+# CONFIG_CONNECTOR is not set -+# CONFIG_MTD is not set -+CONFIG_OF_DEVICE=y -+# CONFIG_PARPORT is not set -+CONFIG_BLK_DEV=y -+CONFIG_BLK_DEV_FD=y -+# CONFIG_BLK_CPQ_DA is not set -+# CONFIG_BLK_CPQ_CISS_DA is not set -+# CONFIG_BLK_DEV_DAC960 is not set -+# CONFIG_BLK_DEV_UMEM is not set -+# CONFIG_BLK_DEV_COW_COMMON is not set -+CONFIG_BLK_DEV_LOOP=y -+# CONFIG_BLK_DEV_CRYPTOLOOP is not set -+# CONFIG_BLK_DEV_NBD is not set -+# CONFIG_BLK_DEV_SX8 is not set -+# CONFIG_BLK_DEV_UB is not set -+CONFIG_BLK_DEV_RAM=y -+CONFIG_BLK_DEV_RAM_COUNT=16 -+CONFIG_BLK_DEV_RAM_SIZE=4096 -+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 -+# CONFIG_CDROM_PKTCDVD is not set -+# CONFIG_ATA_OVER_ETH is not set -+CONFIG_MISC_DEVICES=y -+# CONFIG_PHANTOM is not set -+# CONFIG_EEPROM_93CX6 is not set -+# CONFIG_SGI_IOC4 is not set -+# CONFIG_TIFM_CORE is not set -+CONFIG_IDE=y -+CONFIG_BLK_DEV_IDE=y -+ -+# -+# Please see Documentation/ide.txt for help/info on IDE drives -+# -+# CONFIG_BLK_DEV_IDE_SATA is not set -+CONFIG_BLK_DEV_IDEDISK=y -+CONFIG_IDEDISK_MULTI_MODE=y -+CONFIG_BLK_DEV_IDECD=y -+# CONFIG_BLK_DEV_IDETAPE is not set -+# CONFIG_BLK_DEV_IDEFLOPPY is not set -+# CONFIG_IDE_TASK_IOCTL is not set -+CONFIG_IDE_PROC_FS=y -+ -+# -+# IDE chipset support/bugfixes -+# -+CONFIG_IDE_GENERIC=y -+CONFIG_BLK_DEV_IDEPCI=y -+CONFIG_IDEPCI_SHARE_IRQ=y -+CONFIG_IDEPCI_PCIBUS_ORDER=y -+# CONFIG_BLK_DEV_OFFBOARD is not set -+CONFIG_BLK_DEV_GENERIC=y -+# CONFIG_BLK_DEV_OPTI621 is not set -+CONFIG_BLK_DEV_IDEDMA_PCI=y -+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set -+# CONFIG_IDEDMA_ONLYDISK is not set -+# CONFIG_BLK_DEV_AEC62XX is not set -+# CONFIG_BLK_DEV_ALI15X3 is not set -+# CONFIG_BLK_DEV_AMD74XX is not set -+# CONFIG_BLK_DEV_CMD64X is not set -+# CONFIG_BLK_DEV_TRIFLEX is not set -+# CONFIG_BLK_DEV_CY82C693 is not set -+# CONFIG_BLK_DEV_CS5520 is not set -+# CONFIG_BLK_DEV_CS5530 is not set -+# CONFIG_BLK_DEV_HPT34X is not set -+# CONFIG_BLK_DEV_HPT366 is not set -+# CONFIG_BLK_DEV_JMICRON is not set -+# CONFIG_BLK_DEV_SC1200 is not set -+# CONFIG_BLK_DEV_PIIX is not set -+# CONFIG_BLK_DEV_IT8213 is not set -+# CONFIG_BLK_DEV_IT821X is not set -+# CONFIG_BLK_DEV_NS87415 is not set -+# CONFIG_BLK_DEV_PDC202XX_OLD is not set -+# CONFIG_BLK_DEV_PDC202XX_NEW is not set -+# CONFIG_BLK_DEV_SVWKS is not set -+# CONFIG_BLK_DEV_SIIMAGE is not set -+# CONFIG_BLK_DEV_SL82C105 is not set -+# CONFIG_BLK_DEV_SLC90E66 is not set -+# CONFIG_BLK_DEV_TRM290 is not set -+# CONFIG_BLK_DEV_VIA82CXXX is not set -+# CONFIG_BLK_DEV_TC86C001 is not set -+# CONFIG_IDE_ARM is not set -+CONFIG_BLK_DEV_IDEDMA=y -+# CONFIG_IDEDMA_IVB is not set -+# CONFIG_BLK_DEV_HD is not set -+ -+# -+# SCSI device support -+# -+# CONFIG_RAID_ATTRS is not set -+# CONFIG_SCSI is not set -+# CONFIG_SCSI_DMA is not set -+# CONFIG_SCSI_NETLINK is not set -+# CONFIG_ATA is not set -+# CONFIG_MD is not set -+ -+# -+# Fusion MPT device support -+# -+# CONFIG_FUSION is not set -+ -+# -+# IEEE 1394 (FireWire) support -+# -+# CONFIG_FIREWIRE is not set -+# CONFIG_IEEE1394 is not set -+# CONFIG_I2O is not set -+# CONFIG_MACINTOSH_DRIVERS is not set -+CONFIG_NETDEVICES=y -+# CONFIG_NETDEVICES_MULTIQUEUE is not set -+# CONFIG_DUMMY is not set -+# CONFIG_BONDING is not set -+# CONFIG_MACVLAN is not set -+# CONFIG_EQUALIZER is not set -+# CONFIG_TUN is not set -+# CONFIG_ARCNET is not set -+# CONFIG_PHYLIB is not set -+CONFIG_NET_ETHERNET=y -+CONFIG_MII=y -+# CONFIG_HAPPYMEAL is not set -+# CONFIG_SUNGEM is not set -+# CONFIG_CASSINI is not set -+# CONFIG_NET_VENDOR_3COM is not set -+# CONFIG_NET_TULIP is not set -+# CONFIG_HP100 is not set -+CONFIG_NET_PCI=y -+CONFIG_PCNET32=y -+# CONFIG_PCNET32_NAPI is not set -+# CONFIG_AMD8111_ETH is not set -+# CONFIG_ADAPTEC_STARFIRE is not set -+# CONFIG_B44 is not set -+# CONFIG_FORCEDETH is not set -+# CONFIG_DGRS is not set -+# CONFIG_EEPRO100 is not set -+# CONFIG_E100 is not set -+# CONFIG_FEALNX is not set -+# CONFIG_NATSEMI is not set -+CONFIG_NE2K_PCI=m -+CONFIG_8139CP=y -+CONFIG_8139TOO=y -+# CONFIG_8139TOO_PIO is not set -+# CONFIG_8139TOO_TUNE_TWISTER is not set -+# CONFIG_8139TOO_8129 is not set -+# CONFIG_8139_OLD_RX_RESET is not set -+# CONFIG_SIS900 is not set -+# CONFIG_EPIC100 is not set -+# CONFIG_SUNDANCE is not set -+# CONFIG_TLAN is not set -+# CONFIG_VIA_RHINE is not set -+# CONFIG_SC92031 is not set -+# CONFIG_NETDEV_1000 is not set -+# CONFIG_NETDEV_10000 is not set -+# CONFIG_TR is not set -+ -+# -+# Wireless LAN -+# -+# CONFIG_WLAN_PRE80211 is not set -+# CONFIG_WLAN_80211 is not set -+ -+# -+# USB Network Adapters -+# -+# CONFIG_USB_CATC is not set -+# CONFIG_USB_KAWETH is not set -+# CONFIG_USB_PEGASUS is not set -+# CONFIG_USB_RTL8150 is not set -+# CONFIG_USB_USBNET_MII is not set -+# CONFIG_USB_USBNET is not set -+# CONFIG_WAN is not set -+# CONFIG_FDDI is not set -+# CONFIG_HIPPI is not set -+CONFIG_PPP=m -+CONFIG_PPP_MULTILINK=y -+CONFIG_PPP_FILTER=y -+CONFIG_PPP_ASYNC=m -+CONFIG_PPP_SYNC_TTY=m -+CONFIG_PPP_DEFLATE=m -+CONFIG_PPP_BSDCOMP=m -+CONFIG_PPP_MPPE=m -+CONFIG_PPPOE=m -+# CONFIG_PPPOL2TP is not set -+# CONFIG_SLIP is not set -+CONFIG_SLHC=m -+# CONFIG_SHAPER is not set -+# CONFIG_NETCONSOLE is not set -+# CONFIG_NETPOLL is not set -+# CONFIG_NET_POLL_CONTROLLER is not set -+# CONFIG_ISDN is not set -+# CONFIG_PHONE is not set -+ -+# -+# Input device support -+# -+CONFIG_INPUT=y -+# CONFIG_INPUT_FF_MEMLESS is not set -+# CONFIG_INPUT_POLLDEV is not set -+ -+# -+# Userland interfaces -+# -+CONFIG_INPUT_MOUSEDEV=y -+CONFIG_INPUT_MOUSEDEV_PSAUX=y -+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -+# CONFIG_INPUT_JOYDEV is not set -+CONFIG_INPUT_TSDEV=m -+CONFIG_INPUT_TSDEV_SCREEN_X=240 -+CONFIG_INPUT_TSDEV_SCREEN_Y=320 -+CONFIG_INPUT_EVDEV=y -+# CONFIG_INPUT_EVBUG is not set -+ -+# -+# Input Device Drivers -+# -+CONFIG_INPUT_KEYBOARD=y -+CONFIG_KEYBOARD_ATKBD=y -+# CONFIG_KEYBOARD_SUNKBD is not set -+# CONFIG_KEYBOARD_LKKBD is not set -+# CONFIG_KEYBOARD_XTKBD is not set -+# CONFIG_KEYBOARD_NEWTON is not set -+# CONFIG_KEYBOARD_STOWAWAY is not set -+CONFIG_INPUT_MOUSE=y -+CONFIG_MOUSE_PS2=y -+CONFIG_MOUSE_PS2_ALPS=y -+CONFIG_MOUSE_PS2_LOGIPS2PP=y -+CONFIG_MOUSE_PS2_SYNAPTICS=y -+CONFIG_MOUSE_PS2_LIFEBOOK=y -+CONFIG_MOUSE_PS2_TRACKPOINT=y -+# CONFIG_MOUSE_PS2_TOUCHKIT is not set -+# CONFIG_MOUSE_SERIAL is not set -+# CONFIG_MOUSE_APPLETOUCH is not set -+# CONFIG_MOUSE_VSXXXAA is not set -+# CONFIG_INPUT_JOYSTICK is not set -+CONFIG_INPUT_TABLET=y -+# CONFIG_TABLET_USB_ACECAD is not set -+# CONFIG_TABLET_USB_AIPTEK is not set -+# CONFIG_TABLET_USB_GTCO is not set -+# CONFIG_TABLET_USB_KBTAB is not set -+# CONFIG_TABLET_USB_WACOM is not set -+# CONFIG_INPUT_TOUCHSCREEN is not set -+CONFIG_INPUT_MISC=y -+# CONFIG_INPUT_ATI_REMOTE is not set -+# CONFIG_INPUT_ATI_REMOTE2 is not set -+# CONFIG_INPUT_KEYSPAN_REMOTE is not set -+# CONFIG_INPUT_POWERMATE is not set -+# CONFIG_INPUT_YEALINK is not set -+CONFIG_INPUT_UINPUT=y -+ -+# -+# Hardware I/O ports -+# -+CONFIG_SERIO=y -+CONFIG_SERIO_I8042=y -+# CONFIG_SERIO_SERPORT is not set -+# CONFIG_SERIO_PCIPS2 is not set -+CONFIG_SERIO_LIBPS2=y -+# CONFIG_SERIO_RAW is not set -+# CONFIG_GAMEPORT is not set -+ -+# -+# Character devices -+# -+CONFIG_VT=y -+CONFIG_VT_CONSOLE=y -+CONFIG_HW_CONSOLE=y -+# CONFIG_VT_HW_CONSOLE_BINDING is not set -+# CONFIG_SERIAL_NONSTANDARD is not set -+ -+# -+# Serial drivers -+# -+CONFIG_SERIAL_8250=y -+CONFIG_SERIAL_8250_CONSOLE=y -+CONFIG_SERIAL_8250_PCI=y -+CONFIG_SERIAL_8250_NR_UARTS=4 -+CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -+# CONFIG_SERIAL_8250_EXTENDED is not set -+ -+# -+# Non-8250 serial port support -+# -+# CONFIG_SERIAL_UARTLITE is not set -+CONFIG_SERIAL_CORE=y -+CONFIG_SERIAL_CORE_CONSOLE=y -+# CONFIG_SERIAL_JSM is not set -+# CONFIG_SERIAL_OF_PLATFORM is not set -+CONFIG_UNIX98_PTYS=y -+CONFIG_LEGACY_PTYS=y -+CONFIG_LEGACY_PTY_COUNT=256 -+# CONFIG_IPMI_HANDLER is not set -+# CONFIG_WATCHDOG is not set -+CONFIG_HW_RANDOM=m -+CONFIG_NVRAM=y -+CONFIG_GEN_RTC=y -+# CONFIG_GEN_RTC_X is not set -+# CONFIG_R3964 is not set -+# CONFIG_APPLICOM is not set -+# CONFIG_AGP is not set -+# CONFIG_DRM is not set -+# CONFIG_RAW_DRIVER is not set -+# CONFIG_TCG_TPM is not set -+CONFIG_DEVPORT=y -+CONFIG_I2C=y -+CONFIG_I2C_BOARDINFO=y -+# CONFIG_I2C_CHARDEV is not set -+ -+# -+# I2C Algorithms -+# -+CONFIG_I2C_ALGOBIT=y -+# CONFIG_I2C_ALGOPCF is not set -+# CONFIG_I2C_ALGOPCA is not set -+ -+# -+# I2C Hardware Bus support -+# -+# CONFIG_I2C_ALI1535 is not set -+# CONFIG_I2C_ALI1563 is not set -+# CONFIG_I2C_ALI15X3 is not set -+# CONFIG_I2C_AMD756 is not set -+# CONFIG_I2C_AMD8111 is not set -+# CONFIG_I2C_I801 is not set -+# CONFIG_I2C_I810 is not set -+# CONFIG_I2C_PIIX4 is not set -+# CONFIG_I2C_MPC is not set -+# CONFIG_I2C_NFORCE2 is not set -+# CONFIG_I2C_OCORES is not set -+# CONFIG_I2C_PARPORT_LIGHT is not set -+# CONFIG_I2C_PROSAVAGE is not set -+# CONFIG_I2C_SAVAGE4 is not set -+# CONFIG_I2C_SIMTEC is not set -+# CONFIG_I2C_SIS5595 is not set -+# CONFIG_I2C_SIS630 is not set -+# CONFIG_I2C_SIS96X is not set -+# CONFIG_I2C_TAOS_EVM is not set -+# CONFIG_I2C_STUB is not set -+# CONFIG_I2C_TINY_USB is not set -+# CONFIG_I2C_VIA is not set -+# CONFIG_I2C_VIAPRO is not set -+# CONFIG_I2C_VOODOO3 is not set -+ -+# -+# Miscellaneous I2C Chip support -+# -+# CONFIG_SENSORS_DS1337 is not set -+# CONFIG_SENSORS_DS1374 is not set -+# CONFIG_DS1682 is not set -+# CONFIG_SENSORS_EEPROM is not set -+# CONFIG_SENSORS_PCF8574 is not set -+# CONFIG_SENSORS_PCA9539 is not set -+# CONFIG_SENSORS_PCF8591 is not set -+# CONFIG_SENSORS_M41T00 is not set -+# CONFIG_SENSORS_MAX6875 is not set -+# CONFIG_SENSORS_TSL2550 is not set -+# CONFIG_I2C_DEBUG_CORE is not set -+# CONFIG_I2C_DEBUG_ALGO is not set -+# CONFIG_I2C_DEBUG_BUS is not set -+# CONFIG_I2C_DEBUG_CHIP is not set -+ -+# -+# SPI support -+# -+# CONFIG_SPI is not set -+# CONFIG_SPI_MASTER is not set -+# CONFIG_W1 is not set -+# CONFIG_POWER_SUPPLY is not set -+# CONFIG_HWMON is not set -+ -+# -+# Multifunction device drivers -+# -+# CONFIG_MFD_SM501 is not set -+ -+# -+# Multimedia devices -+# -+# CONFIG_VIDEO_DEV is not set -+# CONFIG_DVB_CORE is not set -+# CONFIG_DAB is not set -+ -+# -+# Graphics support -+# -+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -+ -+# -+# Display device support -+# -+CONFIG_DISPLAY_SUPPORT=m -+ -+# -+# Display hardware drivers -+# -+# CONFIG_VGASTATE is not set -+# CONFIG_VIDEO_OUTPUT_CONTROL is not set -+# CONFIG_FB is not set -+# CONFIG_FB_IBM_GXT4500 is not set -+ -+# -+# Console display driver support -+# -+CONFIG_VGA_CONSOLE=y -+# CONFIG_VGACON_SOFT_SCROLLBACK is not set -+CONFIG_DUMMY_CONSOLE=y -+ -+# -+# Sound -+# -+# CONFIG_SOUND is not set -+CONFIG_HID_SUPPORT=y -+CONFIG_HID=y -+# CONFIG_HID_DEBUG is not set -+ -+# -+# USB Input Devices -+# -+CONFIG_USB_HID=y -+# CONFIG_USB_HIDINPUT_POWERBOOK is not set -+# CONFIG_HID_FF is not set -+# CONFIG_USB_HIDDEV is not set -+CONFIG_USB_SUPPORT=y -+CONFIG_USB_ARCH_HAS_HCD=y -+CONFIG_USB_ARCH_HAS_OHCI=y -+CONFIG_USB_ARCH_HAS_EHCI=y -+CONFIG_USB=y -+# CONFIG_USB_DEBUG is not set -+ -+# -+# Miscellaneous USB options -+# -+CONFIG_USB_DEVICEFS=y -+CONFIG_USB_DEVICE_CLASS=y -+# CONFIG_USB_DYNAMIC_MINORS is not set -+# CONFIG_USB_OTG is not set -+ -+# -+# USB Host Controller Drivers -+# -+# CONFIG_USB_EHCI_HCD is not set -+# CONFIG_USB_ISP116X_HCD is not set -+CONFIG_USB_OHCI_HCD=y -+# CONFIG_USB_OHCI_HCD_PPC_OF is not set -+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set -+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set -+CONFIG_USB_OHCI_LITTLE_ENDIAN=y -+# CONFIG_USB_UHCI_HCD is not set -+# CONFIG_USB_SL811_HCD is not set -+# CONFIG_USB_R8A66597_HCD is not set -+ -+# -+# USB Device Class drivers -+# -+# CONFIG_USB_ACM is not set -+# CONFIG_USB_PRINTER is not set -+ -+# -+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' -+# -+ -+# -+# may also be needed; see USB_STORAGE Help for more information -+# -+# CONFIG_USB_LIBUSUAL is not set -+ -+# -+# USB Imaging devices -+# -+# CONFIG_USB_MDC800 is not set -+CONFIG_USB_MON=y -+ -+# -+# USB port drivers -+# -+ -+# -+# USB Serial Converter support -+# -+# CONFIG_USB_SERIAL is not set -+ -+# -+# USB Miscellaneous drivers -+# -+# CONFIG_USB_EMI62 is not set -+# CONFIG_USB_EMI26 is not set -+# CONFIG_USB_ADUTUX is not set -+# CONFIG_USB_AUERSWALD is not set -+# CONFIG_USB_RIO500 is not set -+# CONFIG_USB_LEGOTOWER is not set -+# CONFIG_USB_LCD is not set -+# CONFIG_USB_BERRY_CHARGE is not set -+# CONFIG_USB_LED is not set -+# CONFIG_USB_CYPRESS_CY7C63 is not set -+# CONFIG_USB_CYTHERM is not set -+# CONFIG_USB_PHIDGET is not set -+# CONFIG_USB_IDMOUSE is not set -+# CONFIG_USB_FTDI_ELAN is not set -+# CONFIG_USB_APPLEDISPLAY is not set -+# CONFIG_USB_LD is not set -+# CONFIG_USB_TRANCEVIBRATOR is not set -+# CONFIG_USB_IOWARRIOR is not set -+# CONFIG_USB_TEST is not set -+ -+# -+# USB DSL modem support -+# -+ -+# -+# USB Gadget Support -+# -+# CONFIG_USB_GADGET is not set -+# CONFIG_MMC is not set -+# CONFIG_NEW_LEDS is not set -+# CONFIG_INFINIBAND is not set -+# CONFIG_EDAC is not set -+# CONFIG_RTC_CLASS is not set -+ -+# -+# DMA Engine support -+# -+# CONFIG_DMA_ENGINE is not set -+ -+# -+# DMA Clients -+# -+ -+# -+# DMA Devices -+# -+ -+# -+# Userspace I/O -+# -+# CONFIG_UIO is not set -+ -+# -+# File systems -+# -+CONFIG_EXT2_FS=y -+# CONFIG_EXT2_FS_XATTR is not set -+# CONFIG_EXT2_FS_XIP is not set -+CONFIG_EXT3_FS=y -+CONFIG_EXT3_FS_XATTR=y -+# CONFIG_EXT3_FS_POSIX_ACL is not set -+# CONFIG_EXT3_FS_SECURITY is not set -+# CONFIG_EXT4DEV_FS is not set -+CONFIG_JBD=y -+# CONFIG_JBD_DEBUG is not set -+CONFIG_FS_MBCACHE=y -+# CONFIG_REISERFS_FS is not set -+# CONFIG_JFS_FS is not set -+# CONFIG_FS_POSIX_ACL is not set -+# CONFIG_XFS_FS is not set -+# CONFIG_GFS2_FS is not set -+# CONFIG_OCFS2_FS is not set -+# CONFIG_MINIX_FS is not set -+# CONFIG_ROMFS_FS is not set -+CONFIG_INOTIFY=y -+CONFIG_INOTIFY_USER=y -+# CONFIG_QUOTA is not set -+CONFIG_DNOTIFY=y -+# CONFIG_AUTOFS_FS is not set -+# CONFIG_AUTOFS4_FS is not set -+# CONFIG_FUSE_FS is not set -+ -+# -+# CD-ROM/DVD Filesystems -+# -+CONFIG_ISO9660_FS=y -+# CONFIG_JOLIET is not set -+# CONFIG_ZISOFS is not set -+# CONFIG_UDF_FS is not set -+ -+# -+# DOS/FAT/NT Filesystems -+# -+CONFIG_FAT_FS=m -+CONFIG_MSDOS_FS=m -+CONFIG_VFAT_FS=m -+CONFIG_FAT_DEFAULT_CODEPAGE=437 -+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -+# CONFIG_NTFS_FS is not set -+ -+# -+# Pseudo filesystems -+# -+CONFIG_PROC_FS=y -+CONFIG_PROC_KCORE=y -+CONFIG_PROC_SYSCTL=y -+CONFIG_SYSFS=y -+CONFIG_TMPFS=y -+# CONFIG_TMPFS_POSIX_ACL is not set -+# CONFIG_HUGETLB_PAGE is not set -+CONFIG_RAMFS=y -+# CONFIG_CONFIGFS_FS is not set -+ -+# -+# Miscellaneous filesystems -+# -+# CONFIG_ADFS_FS is not set -+# CONFIG_AFFS_FS is not set -+# CONFIG_HFS_FS is not set -+# CONFIG_HFSPLUS_FS is not set -+# CONFIG_BEFS_FS is not set -+# CONFIG_BFS_FS is not set -+# CONFIG_EFS_FS is not set -+# CONFIG_CRAMFS is not set -+# CONFIG_VXFS_FS is not set -+# CONFIG_HPFS_FS is not set -+# CONFIG_QNX4FS_FS is not set -+# CONFIG_SYSV_FS is not set -+# CONFIG_UFS_FS is not set -+ -+# -+# Network File Systems -+# -+# CONFIG_NFS_FS is not set -+# CONFIG_NFSD is not set -+# CONFIG_SMB_FS is not set -+# CONFIG_CIFS is not set -+# CONFIG_NCP_FS is not set -+# CONFIG_CODA_FS is not set -+# CONFIG_AFS_FS is not set -+ -+# -+# Partition Types -+# -+CONFIG_PARTITION_ADVANCED=y -+# CONFIG_ACORN_PARTITION is not set -+# CONFIG_OSF_PARTITION is not set -+# CONFIG_AMIGA_PARTITION is not set -+# CONFIG_ATARI_PARTITION is not set -+CONFIG_MAC_PARTITION=y -+CONFIG_MSDOS_PARTITION=y -+# CONFIG_BSD_DISKLABEL is not set -+# CONFIG_MINIX_SUBPARTITION is not set -+# CONFIG_SOLARIS_X86_PARTITION is not set -+# CONFIG_UNIXWARE_DISKLABEL is not set -+# CONFIG_LDM_PARTITION is not set -+# CONFIG_SGI_PARTITION is not set -+# CONFIG_ULTRIX_PARTITION is not set -+# CONFIG_SUN_PARTITION is not set -+# CONFIG_KARMA_PARTITION is not set -+# CONFIG_EFI_PARTITION is not set -+# CONFIG_SYSV68_PARTITION is not set -+ -+# -+# Native Language Support -+# -+CONFIG_NLS=y -+CONFIG_NLS_DEFAULT="iso8859-1" -+# CONFIG_NLS_CODEPAGE_437 is not set -+# CONFIG_NLS_CODEPAGE_737 is not set -+# CONFIG_NLS_CODEPAGE_775 is not set -+# CONFIG_NLS_CODEPAGE_850 is not set -+# CONFIG_NLS_CODEPAGE_852 is not set -+# CONFIG_NLS_CODEPAGE_855 is not set -+# CONFIG_NLS_CODEPAGE_857 is not set -+# CONFIG_NLS_CODEPAGE_860 is not set -+# CONFIG_NLS_CODEPAGE_861 is not set -+# CONFIG_NLS_CODEPAGE_862 is not set -+# CONFIG_NLS_CODEPAGE_863 is not set -+# CONFIG_NLS_CODEPAGE_864 is not set -+# CONFIG_NLS_CODEPAGE_865 is not set -+# CONFIG_NLS_CODEPAGE_866 is not set -+# CONFIG_NLS_CODEPAGE_869 is not set -+# CONFIG_NLS_CODEPAGE_936 is not set -+# CONFIG_NLS_CODEPAGE_950 is not set -+# CONFIG_NLS_CODEPAGE_932 is not set -+# CONFIG_NLS_CODEPAGE_949 is not set -+# CONFIG_NLS_CODEPAGE_874 is not set -+# CONFIG_NLS_ISO8859_8 is not set -+# CONFIG_NLS_CODEPAGE_1250 is not set -+# CONFIG_NLS_CODEPAGE_1251 is not set -+CONFIG_NLS_ASCII=y -+CONFIG_NLS_ISO8859_1=m -+# CONFIG_NLS_ISO8859_2 is not set -+# CONFIG_NLS_ISO8859_3 is not set -+# CONFIG_NLS_ISO8859_4 is not set -+# CONFIG_NLS_ISO8859_5 is not set -+# CONFIG_NLS_ISO8859_6 is not set -+# CONFIG_NLS_ISO8859_7 is not set -+# CONFIG_NLS_ISO8859_9 is not set -+# CONFIG_NLS_ISO8859_13 is not set -+# CONFIG_NLS_ISO8859_14 is not set -+# CONFIG_NLS_ISO8859_15 is not set -+# CONFIG_NLS_KOI8_R is not set -+# CONFIG_NLS_KOI8_U is not set -+# CONFIG_NLS_UTF8 is not set -+ -+# -+# Distributed Lock Manager -+# -+# CONFIG_DLM is not set -+# CONFIG_UCC_SLOW is not set -+ -+# -+# Library routines -+# -+CONFIG_BITREVERSE=y -+CONFIG_CRC_CCITT=m -+# CONFIG_CRC16 is not set -+# CONFIG_CRC_ITU_T is not set -+CONFIG_CRC32=y -+# CONFIG_CRC7 is not set -+# CONFIG_LIBCRC32C is not set -+CONFIG_ZLIB_INFLATE=m -+CONFIG_ZLIB_DEFLATE=m -+CONFIG_PLIST=y -+CONFIG_HAS_IOMEM=y -+CONFIG_HAS_IOPORT=y -+CONFIG_HAS_DMA=y -+ -+# -+# Instrumentation Support -+# -+# CONFIG_PROFILING is not set -+# CONFIG_KPROBES is not set -+ -+# -+# Kernel hacking -+# -+# CONFIG_PRINTK_TIME is not set -+CONFIG_ENABLE_MUST_CHECK=y -+CONFIG_MAGIC_SYSRQ=y -+# CONFIG_UNUSED_SYMBOLS is not set -+# CONFIG_DEBUG_FS is not set -+# CONFIG_HEADERS_CHECK is not set -+CONFIG_DEBUG_KERNEL=y -+# CONFIG_DEBUG_SHIRQ is not set -+CONFIG_DETECT_SOFTLOCKUP=y -+CONFIG_SCHED_DEBUG=y -+# CONFIG_SCHEDSTATS is not set -+# CONFIG_TIMER_STATS is not set -+# CONFIG_DEBUG_SLAB is not set -+# CONFIG_DEBUG_RT_MUTEXES is not set -+# CONFIG_RT_MUTEX_TESTER is not set -+# CONFIG_DEBUG_SPINLOCK is not set -+CONFIG_DEBUG_MUTEXES=y -+CONFIG_DEBUG_SPINLOCK_SLEEP=y -+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -+# CONFIG_DEBUG_KOBJECT is not set -+# CONFIG_DEBUG_HIGHMEM is not set -+CONFIG_DEBUG_BUGVERBOSE=y -+# CONFIG_DEBUG_INFO is not set -+# CONFIG_DEBUG_VM is not set -+# CONFIG_DEBUG_LIST is not set -+CONFIG_FORCED_INLINING=y -+# CONFIG_RCU_TORTURE_TEST is not set -+# CONFIG_FAULT_INJECTION is not set -+# CONFIG_DEBUG_STACKOVERFLOW is not set -+# CONFIG_DEBUG_STACK_USAGE is not set -+# CONFIG_DEBUG_PAGEALLOC is not set -+CONFIG_DEBUGGER=y -+CONFIG_XMON=y -+CONFIG_XMON_DEFAULT=y -+CONFIG_XMON_DISASSEMBLY=y -+# CONFIG_BDI_SWITCH is not set -+# CONFIG_BOOTX_TEXT is not set -+# CONFIG_PPC_EARLY_DEBUG is not set -+ -+# -+# Security options -+# -+# CONFIG_KEYS is not set -+# CONFIG_SECURITY is not set -+CONFIG_CRYPTO=y -+CONFIG_CRYPTO_ALGAPI=m -+CONFIG_CRYPTO_BLKCIPHER=m -+CONFIG_CRYPTO_MANAGER=m -+# CONFIG_CRYPTO_HMAC is not set -+# CONFIG_CRYPTO_XCBC is not set -+# CONFIG_CRYPTO_NULL is not set -+# CONFIG_CRYPTO_MD4 is not set -+# CONFIG_CRYPTO_MD5 is not set -+CONFIG_CRYPTO_SHA1=m -+# CONFIG_CRYPTO_SHA256 is not set -+# CONFIG_CRYPTO_SHA512 is not set -+# CONFIG_CRYPTO_WP512 is not set -+# CONFIG_CRYPTO_TGR192 is not set -+# CONFIG_CRYPTO_GF128MUL is not set -+CONFIG_CRYPTO_ECB=m -+CONFIG_CRYPTO_CBC=m -+CONFIG_CRYPTO_PCBC=m -+# CONFIG_CRYPTO_LRW is not set -+# CONFIG_CRYPTO_CRYPTD is not set -+# CONFIG_CRYPTO_DES is not set -+# CONFIG_CRYPTO_FCRYPT is not set -+# CONFIG_CRYPTO_BLOWFISH is not set -+# CONFIG_CRYPTO_TWOFISH is not set -+# CONFIG_CRYPTO_SERPENT is not set -+# CONFIG_CRYPTO_AES is not set -+# CONFIG_CRYPTO_CAST5 is not set -+# CONFIG_CRYPTO_CAST6 is not set -+# CONFIG_CRYPTO_TEA is not set -+CONFIG_CRYPTO_ARC4=m -+# CONFIG_CRYPTO_KHAZAD is not set -+# CONFIG_CRYPTO_ANUBIS is not set -+# CONFIG_CRYPTO_DEFLATE is not set -+# CONFIG_CRYPTO_MICHAEL_MIC is not set -+# CONFIG_CRYPTO_CRC32C is not set -+# CONFIG_CRYPTO_CAMELLIA is not set -+# CONFIG_CRYPTO_TEST is not set -+# CONFIG_CRYPTO_HW is not set -diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig -index b62aab3..572132c 100644 ---- a/arch/powerpc/platforms/Kconfig -+++ b/arch/powerpc/platforms/Kconfig -@@ -6,6 +6,7 @@ source "arch/powerpc/platforms/chrp/Kconfig" - source "arch/powerpc/platforms/512x/Kconfig" - source "arch/powerpc/platforms/52xx/Kconfig" - source "arch/powerpc/platforms/powermac/Kconfig" -+source "arch/powerpc/platforms/qemu/Kconfig" - source "arch/powerpc/platforms/maple/Kconfig" - source "arch/powerpc/platforms/pasemi/Kconfig" - source "arch/powerpc/platforms/ps3/Kconfig" -diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile -index 879b4a4..946ba60 100644 ---- a/arch/powerpc/platforms/Makefile -+++ b/arch/powerpc/platforms/Makefile -@@ -15,6 +15,7 @@ obj-$(CONFIG_PPC_83xx) += 83xx/ - obj-$(CONFIG_FSL_SOC_BOOKE) += 85xx/ - obj-$(CONFIG_PPC_86xx) += 86xx/ - obj-$(CONFIG_PPC_POWERNV) += powernv/ -+obj-$(CONFIG_PPC_QEMU) += qemu/ - obj-$(CONFIG_PPC_PSERIES) += pseries/ - obj-$(CONFIG_PPC_MAPLE) += maple/ - obj-$(CONFIG_PPC_PASEMI) += pasemi/ -diff --git a/arch/powerpc/platforms/qemu/Kconfig b/arch/powerpc/platforms/qemu/Kconfig -new file mode 100644 -index 0000000..d64ed92 ---- /dev/null -+++ b/arch/powerpc/platforms/qemu/Kconfig -@@ -0,0 +1,10 @@ -+config PPC_QEMU -+ bool "QEMU emulated PowerPC Reference Platform (PReP) system" -+ depends on PPC_MULTIPLATFORM && PPC32 -+ select PPC_I8259 -+ select PPC_INDIRECT_PCI -+ select PPC_UDBG_16550 -+ select PPC_NATIVE -+ select WANT_DEVICE_TREE -+ default n -+ -diff --git a/arch/powerpc/platforms/qemu/Makefile b/arch/powerpc/platforms/qemu/Makefile -new file mode 100644 -index 0000000..b7288e8 ---- /dev/null -+++ b/arch/powerpc/platforms/qemu/Makefile -@@ -0,0 +1,2 @@ -+obj-y += setup.o -+obj-$(CONFIG_PCI) += pci.o -diff --git a/arch/powerpc/platforms/qemu/pci.c b/arch/powerpc/platforms/qemu/pci.c -new file mode 100644 -index 0000000..2bd3b00 ---- /dev/null -+++ b/arch/powerpc/platforms/qemu/pci.c -@@ -0,0 +1,133 @@ -+/* -+ * prep Port to arch/powerpc: -+ * Copyright 2007 David Gibson, IBM Corporation. -+ * -+ * prep Port to qemu: -+ * Copyright 2007 Milton Miller, IBM Corporation. -+ * -+ * Based on OpenHackware 0.4 -+ * Copyright (c) 2004-2005 Jocelyn Mayer -+ * -+ * pci config based on arch/powerpc/platforms/chrp/pci.c GoldenGate code -+ * -+ */ -+ -+#include <linux/init.h> -+ -+#include <asm/io.h> -+#include <asm/prom.h> -+#include <asm/pci-bridge.h> -+#include <asm/udbg.h> -+ -+static volatile void __iomem *qemu_config_addr(struct pci_bus *bus, -+ unsigned int devfn, int off) -+{ -+ int dev, fn; -+ struct pci_controller *hose = bus->sysdata; -+ -+ if (!hose->cfg_data) -+ return NULL; -+ -+ if (bus->number != 0) -+ return NULL; -+ -+ dev = devfn >> 3; -+ fn = devfn & 7; -+ -+ if (dev < 11 || dev > 21) -+ return NULL; -+ -+ return hose->cfg_data + ((1 << dev) | (fn << 8) | off); -+} -+ -+int qemu_read_config(struct pci_bus *bus, unsigned int devfn, int off, -+ int len, u32 *val) -+{ -+ volatile void __iomem *cfg_data = qemu_config_addr(bus, devfn, off); -+ -+ if (cfg_data == NULL) -+ return PCIBIOS_DEVICE_NOT_FOUND; -+ -+ /* -+ * Note: the caller has already checked that off is -+ * suitably aligned and that len is 1, 2 or 4. -+ */ -+ switch (len) { -+ case 1: -+ *val = in_8(cfg_data); -+ break; -+ case 2: -+ *val = in_le16(cfg_data); -+ break; -+ default: -+ *val = in_le32(cfg_data); -+ break; -+ } -+ return PCIBIOS_SUCCESSFUL; -+} -+ -+int qemu_write_config(struct pci_bus *bus, unsigned int devfn, int off, -+ int len, u32 val) -+{ -+ volatile void __iomem *cfg_data = qemu_config_addr(bus, devfn, off); -+ -+ if (cfg_data == NULL) -+ return PCIBIOS_DEVICE_NOT_FOUND; -+ -+ /* -+ * Note: the caller has already checked that off is -+ * suitably aligned and that len is 1, 2 or 4. -+ */ -+ switch (len) { -+ case 1: -+ out_8(cfg_data, val); -+ break; -+ case 2: -+ out_le16(cfg_data, val); -+ break; -+ default: -+ out_le32(cfg_data, val); -+ break; -+ } -+ return PCIBIOS_SUCCESSFUL; -+} -+ -+static struct pci_ops qemu_pci_ops = -+{ -+ qemu_read_config, -+ qemu_write_config -+}; -+ -+void __init qemu_find_bridges(void) -+{ -+ struct device_node *phb; -+ struct pci_controller *hose; -+ -+ phb = of_find_node_by_type(NULL, "pci"); -+ if (!phb) { -+ printk(KERN_ERR "PReP: Cannot find PCI bridge OF node\n"); -+ return; -+ } -+ -+ hose = pcibios_alloc_controller(phb); -+ if (!hose) -+ return; -+ -+ pci_process_bridge_OF_ranges(hose, phb, 1); -+ -+#define PREP_PCI_DRAM_OFFSET 0x80000000 -+ -+ pci_dram_offset = PREP_PCI_DRAM_OFFSET; -+ ISA_DMA_THRESHOLD = 0x00ffffff; -+ DMA_MODE_READ = 0x44; -+ DMA_MODE_WRITE = 0x48; -+ -+ hose->cfg_data = ioremap(0x80800000, 1 << 22); -+ -+ hose->ops = &qemu_pci_ops; -+ -+ udbg_init_uart(hose->io_base_virt + 0x3f8, 0, 0); -+ register_early_udbg_console(); -+ printk(KERN_INFO "qemu_find_bridges: config at %p\n", hose->cfg_data); -+} -+ -diff --git a/arch/powerpc/platforms/qemu/setup.c b/arch/powerpc/platforms/qemu/setup.c -new file mode 100644 -index 0000000..2d1ecf2 ---- /dev/null -+++ b/arch/powerpc/platforms/qemu/setup.c -@@ -0,0 +1,180 @@ -+/* -+ * Copyright (C) 1995 Linus Torvalds -+ * Adapted from 'alpha' version by Gary Thomas -+ * Modified by Cort Dougan (cort@cs.nmt.edu) -+ * -+ * Support for PReP (Motorola MTX/MVME) -+ * by Troy Benjegerdes (hozer@drgw.net) -+ * -+ * Port to arch/powerpc: -+ * Copyright 2007 David Gibson, IBM Corporation. -+ * -+ * Port to qemu: -+ * Copyright 2007 Milton Miller, IBM Corporation. -+ * -+ * Some information based on OpenHackware 0.4 -+ * Copyright (c) 2004-2005 Jocelyn Mayer -+ * -+ */ -+ -+#include <linux/init.h> -+#include <linux/seq_file.h> -+#include <linux/initrd.h> -+#include <linux/ide.h> -+ -+#include <asm/io.h> -+#include <asm/prom.h> -+#include <asm/pci-bridge.h> -+/* #include <asm/mpic.h> */ -+#include <asm/i8259.h> -+#include <asm/time.h> -+#include <asm/udbg.h> -+ -+static const char *qemu_model = "(unknown)"; -+ -+extern void qemu_find_bridges(void); -+ -+/* cpuinfo code common to all IBM PReP */ -+static void qemu_ibm_cpuinfo(struct seq_file *m) -+{ -+ seq_printf(m, "machine\t\t: PReP %s\n", qemu_model); -+} -+ -+#define NVRAM_AS0 0x74 -+#define NVRAM_AS1 0x75 -+#define NVRAM_DAT 0x77 -+ -+static unsigned char qemu_nvram_read_val(int addr) -+{ -+ outb(NVRAM_AS0, addr & 0xff); -+ outb(NVRAM_AS1, (addr >> 8) & 0xff); -+ return inb(NVRAM_DAT); -+} -+ -+ -+static void qemu_nvram_write_val(int addr, unsigned char val) -+{ -+ outb(NVRAM_AS0, addr & 0xff); -+ outb(NVRAM_AS1, (addr >> 8) & 0xff); -+ outb(NVRAM_DAT, val); -+} -+ -+ -+static void __init qemu_setup_arch(void) -+{ -+ struct device_node *root; -+ const char *model; -+ -+ root = of_find_node_by_path("/"); -+ model = of_get_property(root, "model", NULL); -+ of_node_put(root); -+ if (model) -+ qemu_model = model; -+ -+ /* Lookup PCI host bridges */ -+ qemu_find_bridges(); -+ -+ /* Read in NVRAM data */ -+/* init_qemu_nvram(); */ -+} -+ -+static void __init qemu_init_IRQ(void) -+{ -+ struct device_node *pic = NULL; -+ unsigned long int_ack = 0; -+ -+ pic = of_find_node_by_type(NULL, "i8259"); -+ if (!pic) { -+ printk(KERN_ERR "No interrupt controller found!\n"); -+ return; -+ } -+ -+ /* polling */ -+ i8259_init(pic, int_ack); -+ ppc_md.get_irq = i8259_irq; -+ -+ /* set default host */ -+ irq_set_default_host(i8259_get_host()); -+} -+ -+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -+/* -+ * IDE stuff. -+ */ -+static int qemu_ide_default_irq(unsigned long base) -+{ -+ switch (base) { -+ case 0x1f0: return 13; -+ case 0x170: return 13; -+ case 0x1e8: return 11; -+ case 0x168: return 10; -+ case 0xfff0: return 14; /* MCP(N)750 ide0 */ -+ case 0xffe0: return 15; /* MCP(N)750 ide1 */ -+ default: return 0; -+ } -+} -+ -+static unsigned long qemu_ide_default_io_base(int index) -+{ -+ switch (index) { -+ case 0: return 0x1f0; -+ case 1: return 0x170; -+ case 2: return 0x1e8; -+ case 3: return 0x168; -+ default: -+ return 0; -+ } -+} -+#endif -+ -+#if 0 -+static int __init prep_request_io(void) -+{ -+#ifdef CONFIG_NVRAM -+ request_region(PREP_NVRAM_AS0, 0x8, "nvram"); -+#endif -+ request_region(0x00,0x20,"dma1"); -+ request_region(0x40,0x20,"timer"); -+ request_region(0x80,0x10,"dma page reg"); -+ request_region(0xc0,0x20,"dma2"); -+ -+ return 0; -+} -+device_initcall(prep_request_io); -+#endif -+ -+ -+static int __init qemu_probe(void) -+{ -+ if (!of_flat_dt_is_compatible(of_get_flat_dt_root(), "qemu-prep")) -+ return 0; -+ -+#if 0 -+#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -+ ppc_ide_md.default_irq = qemu_ide_default_irq; -+ ppc_ide_md.default_io_base = qemu_ide_default_io_base; -+#endif -+#endif -+ -+ return 1; -+} -+ -+define_machine(qemu) { -+ .name = "QEMU", -+ .probe = qemu_probe, -+ .setup_arch = qemu_setup_arch, -+ .progress = udbg_progress, -+ .show_cpuinfo = qemu_ibm_cpuinfo, -+ .init_IRQ = qemu_init_IRQ, -+/* .pcibios_fixup = qemu_pcibios_fixup, */ -+/* .restart = qemu_restart, */ -+/* .power_off = qemu_halt, */ -+/* .halt = qemu_halt, */ -+/* .time_init = todc_time_init, */ -+/* .set_rtc_time = todc_set_rtc_time, */ -+/* .get_rtc_time = todc_get_rtc_time, */ -+ .calibrate_decr = generic_calibrate_decr, -+ .nvram_read_val = qemu_nvram_read_val, -+ .nvram_write_val = qemu_nvram_write_val, -+ .phys_mem_access_prot = pci_phys_mem_access_prot, -+}; diff --git a/bsp/qemu-ppc32/qemu-powerpc-Added-qemu_restart-function.patch b/bsp/qemu-ppc32/qemu-powerpc-Added-qemu_restart-function.patch deleted file mode 100644 index 23713f10..00000000 --- a/bsp/qemu-ppc32/qemu-powerpc-Added-qemu_restart-function.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 4ea81210af681a20d425b52d42285e8c729b6f75 Mon Sep 17 00:00:00 2001 -From: J. Aaron Gamble <john.gamble@windriver.com> -Date: Wed, 22 Sep 2010 11:20:03 -0400 -Subject: [PATCH] qemu/powerpc: Added qemu_restart() function - -qemu_restart code taken from: - - http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg03147.html - -Updated qemu machine description to use this function - -Signed-off-by: J. Aaron Gamble <john.gamble@windriver.com> ---- - arch/powerpc/platforms/qemu/setup.c | 18 +++++++++++++++++- - 1 files changed, 17 insertions(+), 1 deletions(-) - -diff --git a/arch/powerpc/platforms/qemu/setup.c b/arch/powerpc/platforms/qemu/setup.c -index 2d1ecf2..1f37f71 100644 ---- a/arch/powerpc/platforms/qemu/setup.c -+++ b/arch/powerpc/platforms/qemu/setup.c -@@ -159,6 +159,22 @@ static int __init qemu_probe(void) - return 1; - } - -+void qemu_restart(char *cmd) -+{ -+ local_irq_disable(); /* no interrupts */ -+ /* set exception prefix high - to the prom */ -+ mtmsr(mfmsr() | MSR_IP); -+ -+ /* make sure bit 0 (reset) is a 0 */ -+ outb(inb(0x92) & ~1L, 0x92); -+ /* signal a reset to system control port A - soft reset */ -+ outb(inb(0x92) | 1, 0x92); -+ -+ while(1); -+ -+ /* not reached */ -+} -+ - define_machine(qemu) { - .name = "QEMU", - .probe = qemu_probe, -@@ -167,7 +183,7 @@ define_machine(qemu) { - .show_cpuinfo = qemu_ibm_cpuinfo, - .init_IRQ = qemu_init_IRQ, - /* .pcibios_fixup = qemu_pcibios_fixup, */ --/* .restart = qemu_restart, */ -+ .restart = qemu_restart, - /* .power_off = qemu_halt, */ - /* .halt = qemu_halt, */ - /* .time_init = todc_time_init, */ --- -1.6.5.2 - diff --git a/bsp/qemu-ppc32/qemu-powerpc-work-around-for-qemu-powerpc-32-interru.patch b/bsp/qemu-ppc32/qemu-powerpc-work-around-for-qemu-powerpc-32-interru.patch deleted file mode 100644 index 313a04d7..00000000 --- a/bsp/qemu-ppc32/qemu-powerpc-work-around-for-qemu-powerpc-32-interru.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 209ea269a862451a4bed62f2930c4ba82aaf5368 Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Wed, 3 Feb 2010 13:51:19 -0500 -Subject: [PATCH] qemu, powerpc: work around for qemu powerpc 32 interrupts - -Workaround for QEMU powerpc 32 to force interrupt acknoledgement - -Signed-off-by: Jason Wessel <jason.wessel@windriver.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> -diff --git a/arch/powerpc/platforms/qemu/Kconfig b/arch/powerpc/platforms/qemu/Kconfig -index d64ed92..366e50c 100644 ---- a/arch/powerpc/platforms/qemu/Kconfig -+++ b/arch/powerpc/platforms/qemu/Kconfig -@@ -1,6 +1,6 @@ - config PPC_QEMU - bool "QEMU emulated PowerPC Reference Platform (PReP) system" -- depends on PPC_MULTIPLATFORM && PPC32 -+ depends on PPC32 - select PPC_I8259 - select PPC_INDIRECT_PCI - select PPC_UDBG_16550 -diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c -index 616ec1c..4a22fa6 100644 ---- a/kernel/irq/chip.c -+++ b/kernel/irq/chip.c -@@ -137,9 +137,18 @@ struct irq_data *irq_get_irq_data(unsigned int irq) - } - EXPORT_SYMBOL_GPL(irq_get_irq_data); - -+#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ -+ - static void irq_state_clr_disabled(struct irq_desc *desc) - { -+#ifdef CONFIG_PPC_QEMU -+ struct irq_desc *desc = irq_data_to_desc(irq); -+ -+ if (!(desc->status & IRQ_DELAYED_DISABLE)) -+ desc->chip->mask(irq); -+#else - irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED); -+#endif /* CONFIG_PPC_QEMU */ - } - - static void irq_state_set_disabled(struct irq_desc *desc) diff --git a/bsp/qemu-ppc32/qemu-ppc32-rt.cfg b/bsp/qemu-ppc32/qemu-ppc32-rt.cfg index 4946ac58..4c8775e6 100644 --- a/bsp/qemu-ppc32/qemu-ppc32-rt.cfg +++ b/bsp/qemu-ppc32/qemu-ppc32-rt.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -# CONFIG_PROFILING is not set +CONFIG_PROFILING=n diff --git a/bsp/qemu-ppc32/qemu-ppc32.cfg b/bsp/qemu-ppc32/qemu-ppc32.cfg index ed7ec330..ff770844 100644 --- a/bsp/qemu-ppc32/qemu-ppc32.cfg +++ b/bsp/qemu-ppc32/qemu-ppc32.cfg @@ -10,23 +10,13 @@ # consult the product documentation. # #......................................................................... -# CONFIG_PPC_CHRP is not set +CONFIG_PPC_CHRP=n CONFIG_PPC_PMAC=y CONFIG_PCNET32=y CONFIG_NE2K_PCI=y CONFIG_MACE=y CONFIG_BMAC=y -CONFIG_SERIAL_PMACZILOG=y -CONFIG_SERIAL_PMACZILOG_TTYS=y -CONFIG_SERIAL_PMACZILOG_CONSOLE=y - -CONFIG_IDE=y -CONFIG_BLK_DEV_IDEPCI=y -CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_IDE_PMAC=y -CONFIG_BLK_DEV_IDEDMA=y - CONFIG_ADB=y CONFIG_ADB_CUDA=y CONFIG_INPUT_ADBHID=y @@ -43,6 +33,11 @@ CONFIG_USB_STORAGE=m CONFIG_INPUT_EVDEV=y CONFIG_SERIO=y -# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_SERPORT=n CONFIG_ALTIVEC=y + + +CONFIG_SERIAL_PMACZILOG=y +CONFIG_SERIAL_PMACZILOG_TTYS=y +CONFIG_SERIAL_PMACZILOG_CONSOLE=n diff --git a/bsp/qemu-ppc32/qemu-ppc32.scc b/bsp/qemu-ppc32/qemu-ppc32.scc index 30144cf4..c4e82cd7 100644 --- a/bsp/qemu-ppc32/qemu-ppc32.scc +++ b/bsp/qemu-ppc32/qemu-ppc32.scc @@ -3,17 +3,8 @@ kconf hardware qemu-ppc32.cfg kconf hardware qemu-ppc32-gfx.cfg include features/profiling/profiling.scc -include features/latencytop/latencytop.scc include features/usb/ehci-hcd.scc include features/usb/uhci-hcd.scc include features/usb/ohci-hcd.scc include features/usb/xhci-hcd.scc - -# patch qemu-platform-v2.patch -# patch powerpc-special-load-offset-for-qemu.patch -# patch qemu-powerpc-work-around-for-qemu-powerpc-32-interru.patch -# patch qemu_ppc32-support-multiple-ethernet-interfaces.patch -# patch qemu_ppc-enable-IDE-support.patch -# patch qemu-powerpc-Added-qemu_restart-function.patch -# patch qemuppc-irq-disable-fixups.patch diff --git a/bsp/qemu-ppc32/qemu_ppc-enable-IDE-support.patch b/bsp/qemu-ppc32/qemu_ppc-enable-IDE-support.patch deleted file mode 100644 index 54b1ad46..00000000 --- a/bsp/qemu-ppc32/qemu_ppc-enable-IDE-support.patch +++ /dev/null @@ -1,41 +0,0 @@ -From e22320e51878054af4863c7b8ee1f7c76f82030f Mon Sep 17 00:00:00 2001 -From: Jason Wessel <jason.wessel@windriver.com> -Date: Thu, 24 Jun 2010 04:10:55 -0700 -Subject: [PATCH] qemu_ppc: enable IDE support - -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - drivers/ide/Kconfig | 2 +- - drivers/ide/ide-generic.c | 3 +++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig -index 8fb46aab2d87..da2d105db376 100644 ---- a/drivers/ide/Kconfig -+++ b/drivers/ide/Kconfig -@@ -197,7 +197,7 @@ comment "IDE chipset support/bugfixes" - - config IDE_GENERIC - tristate "generic/default IDE chipset support" -- depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC -+ depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC || PPC_QEMU - default ARM && ARCH_RPC - help - This is the generic IDE driver. This driver attaches to the -diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c -index 54d7c4685d23..eb74ba5423f7 100644 ---- a/drivers/ide/ide-generic.c -+++ b/drivers/ide/ide-generic.c -@@ -45,6 +45,9 @@ static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ }; - #elif defined(CONFIG_ALPHA) - static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 }; - static const int legacy_irqs[] = { 14, 15, 11, 10 }; -+#elif defined(CONFIG_PPC_QEMU) -+static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 }; -+static const int legacy_irqs[] = { 13, 13, 11, 10 }; - #else - static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; - static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 }; --- -1.8.1.2 - diff --git a/bsp/qemu-ppc32/qemu_ppc32-support-multiple-ethernet-interfaces.patch b/bsp/qemu-ppc32/qemu_ppc32-support-multiple-ethernet-interfaces.patch deleted file mode 100644 index 80b016b8..00000000 --- a/bsp/qemu-ppc32/qemu_ppc32-support-multiple-ethernet-interfaces.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 105af9c859bc4230ff68f876b63c1f36a80b0b64 Mon Sep 17 00:00:00 2001 -From: Tony Liu <Bo.Liu@windriver.com> -Date: Thu, 11 Mar 2010 14:38:49 +0800 -Subject: [PATCH] qemu_ppc32: support multiple ethernet interfaces - -Enable QEMU ppc32 to support at most 3 ethernet interfaces. - -Signed-off-by: Wessel Jason <jason.wessel@windriver.com> -Signed-off-by: Chunbo Luo <chunbo.luo@windriver.com> -diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c -index 1063093..eb63fb9 100644 ---- a/drivers/net/ethernet/8390/ne.c -+++ b/drivers/net/ethernet/8390/ne.c -@@ -482,8 +482,19 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr) - } else if (dev->irq == 2) - /* Fixup for users that don't know that IRQ 2 is really IRQ 9, - or don't know which one to set. */ -+ if (ioaddr == 0x300) - dev->irq = 9; -- -+ else if (ioaddr == 0x320) -+ dev->irq = 10; -+ else if (ioaddr == 0x340) -+ dev->irq = 11; -+ else { -+ printk(KERN_ERR "failed to probe %s, QEMU supports at most 3 interfaces.\n", -+ dev->name); -+ ret = -ENODEV; -+ goto err_out; -+ } -+#endif - if (! dev->irq) { - printk(" failed to detect IRQ line.\n"); - ret = -EAGAIN; diff --git a/bsp/qemu-ppc32/qemuppc-irq-disable-fixups.patch b/bsp/qemu-ppc32/qemuppc-irq-disable-fixups.patch deleted file mode 100644 index a8b5e05f..00000000 --- a/bsp/qemu-ppc32/qemuppc-irq-disable-fixups.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 11d9dbd47954597b215e75af246bcfeb4c0ca62e Mon Sep 17 00:00:00 2001 -From: Bruce Ashfield <bruce.ashfield@windriver.com> -Date: Wed, 15 Jun 2011 16:12:17 -0400 -Subject: [PATCH] qemuppc: irq disable fixups - -Mapping the qemuppc interupt handling to the new interrupt -routines means that we call irq_state_clr_disabled -to enable irqs, not disable them. So we should modify function -"irq_state_set_disabled" with our custom qemppc mods. - -Signed-off-by: Liming Wang <liming.wang@windriver.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> ---- - kernel/irq/chip.c | 12 +++++------- - 1 files changed, 5 insertions(+), 7 deletions(-) - -diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c -index a813b57..c997226 100644 ---- a/kernel/irq/chip.c -+++ b/kernel/irq/chip.c -@@ -141,19 +141,17 @@ EXPORT_SYMBOL_GPL(irq_get_irq_data); - - static void irq_state_clr_disabled(struct irq_desc *desc) - { --#ifdef CONFIG_PPC_QEMU -- struct irq_desc *desc = irq_data_to_desc(irq); -- -- if (!(desc->status & IRQ_DELAYED_DISABLE)) -- desc->chip->mask(irq); --#else - irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED); --#endif /* CONFIG_PPC_QEMU */ - } - - static void irq_state_set_disabled(struct irq_desc *desc) - { -+#ifdef CONFIG_PPC_QEMU -+ if (!(desc->status_use_accessors & IRQ_DELAYED_DISABLE)) -+ desc->irq_data.chip->irq_mask(&desc->irq_data); -+#else - irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED); -+#endif /* CONFIG_PPC_QEMU */ - } - - static void irq_state_clr_masked(struct irq_desc *desc) --- -1.7.4.1 - diff --git a/bsp/qemu-ppc64/qemu-ppc64-standard.scc b/bsp/qemu-ppc64/qemu-ppc64-standard.scc index 440af149..2c663cda 100644 --- a/bsp/qemu-ppc64/qemu-ppc64-standard.scc +++ b/bsp/qemu-ppc64/qemu-ppc64-standard.scc @@ -16,6 +16,3 @@ include features/scsi/cdrom.scc include cfg/virtio.scc include qemu-ppc64.scc - -# default policy for standard kernels -include features/latencytop/latencytop.scc diff --git a/bsp/qemuarm64/qemuarm64-gfx.cfg b/bsp/qemuarm64/qemuarm64-gfx.cfg index 0e1f47d7..ceae36c5 100644 --- a/bsp/qemuarm64/qemuarm64-gfx.cfg +++ b/bsp/qemuarm64/qemuarm64-gfx.cfg @@ -1,11 +1,4 @@ # SPDX-License-Identifier: MIT -CONFIG_INPUT_TABLET=y -CONFIG_USB=y -CONFIG_USB_HID=y -CONFIG_USB_XHCI_HCD=y - -CONFIG_DRM=y -CONFIG_DRM_BOCHS=y - +CONFIG_INPUT=y CONFIG_INPUT_MISC=y CONFIG_INPUT_UINPUT=y diff --git a/bsp/qemuarm64/qemuarm64-preempt-rt.scc b/bsp/qemuarm64/qemuarm64-preempt-rt.scc index f2004be0..87054501 100644 --- a/bsp/qemuarm64/qemuarm64-preempt-rt.scc +++ b/bsp/qemuarm64/qemuarm64-preempt-rt.scc @@ -6,7 +6,6 @@ define KARCH arm64 # no new branch required, re-use the ktypes/preempt-rt/preempt-rt.scc branch include ktypes/preempt-rt/preempt-rt.scc -include cfg/virtio.scc include qemuarm64.scc # enable the ability to run 32 bit apps diff --git a/bsp/qemuarm64/qemuarm64-standard.scc b/bsp/qemuarm64/qemuarm64-standard.scc index 361f4a20..e3d75080 100644 --- a/bsp/qemuarm64/qemuarm64-standard.scc +++ b/bsp/qemuarm64/qemuarm64-standard.scc @@ -6,7 +6,6 @@ define KARCH arm64 include ktypes/standard/standard.scc branch qemuarm64 -include cfg/virtio.scc include qemuarm64.scc # enable the ability to run 32 bit apps diff --git a/bsp/qemuarm64/qemuarm64-tiny.scc b/bsp/qemuarm64/qemuarm64-tiny.scc new file mode 100644 index 00000000..5fdb3416 --- /dev/null +++ b/bsp/qemuarm64/qemuarm64-tiny.scc @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: MIT +define KMACHINE qemuarm64 +define KTYPE tiny +define KARCH arm64 + +include ktypes/tiny/tiny.scc + +include qemuarm64.scc + +include features/hid/hid.scc + +# enable the ability to run 32 bit apps +include arch/arm/32bit-compat.scc diff --git a/bsp/qemuarm64/qemuarm64.cfg b/bsp/qemuarm64/qemuarm64.cfg index ef8d3ed0..759ab8e6 100644 --- a/bsp/qemuarm64/qemuarm64.cfg +++ b/bsp/qemuarm64/qemuarm64.cfg @@ -14,6 +14,7 @@ CONFIG_ARM_AMBA=y # # Non-8250 serial port support # +CONFIG_TTY=y CONFIG_SERIAL_AMBA_PL011=y CONFIG_SERIAL_AMBA_PL011_CONSOLE=y @@ -32,3 +33,4 @@ CONFIG_RTC_DRV_PL031=y # PCI configs, needed for virtio-rng (and others) CONFIG_PCI=y CONFIG_PCI_HOST_GENERIC=y + diff --git a/bsp/qemuarm64/qemuarm64.scc b/bsp/qemuarm64/qemuarm64.scc index dee5741e..f97995da 100644 --- a/bsp/qemuarm64/qemuarm64.scc +++ b/bsp/qemuarm64/qemuarm64.scc @@ -1,3 +1,9 @@ # SPDX-License-Identifier: MIT kconf hardware qemuarm64.cfg kconf hardware qemuarm64-gfx.cfg + +include features/usb/xhci-hcd.scc +include features/net/net.scc +include features/pci/pci.scc +include cfg/virtio.scc +include cfg/net/mdio.scc diff --git a/bsp/qemuarma15/qemuarma15-gfx.cfg b/bsp/qemuarma15/qemuarma15-gfx.cfg index 039bfae5..c3e36f0d 100644 --- a/bsp/qemuarma15/qemuarma15-gfx.cfg +++ b/bsp/qemuarma15/qemuarma15-gfx.cfg @@ -1,8 +1,6 @@ # SPDX-License-Identifier: MIT -CONFIG_INPUT_TABLET=y -CONFIG_USB=y +CONFIG_INPUT=y CONFIG_USB_HID=y -CONFIG_USB_XHCI_HCD=y -CONFIG_DRM=y -CONFIG_DRM_BOCHS=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_UINPUT=y diff --git a/bsp/qemuarma15/qemuarma15-preempt-rt.scc b/bsp/qemuarma15/qemuarma15-preempt-rt.scc index 216757bb..f6a2a400 100644 --- a/bsp/qemuarma15/qemuarma15-preempt-rt.scc +++ b/bsp/qemuarma15/qemuarma15-preempt-rt.scc @@ -3,11 +3,10 @@ define KMACHINE qemuarma15 define KTYPE preempt-rt define KARCH arm -# no new branch required, re-use the ktypes/preempt-rt/preempt-rt.scc branch include ktypes/preempt-rt/preempt-rt.scc -include cfg/virtio.scc -include cfg/dmaengine.scc -include cfg/timer/rtc.scc include qemuarma15.scc +include features/pci/pci.scc +# for emulated pci support +include features/pci/pci-of-generic.scc diff --git a/bsp/qemuarma15/qemuarma15-standard.scc b/bsp/qemuarma15/qemuarma15-standard.scc index cdee6332..804e89d3 100644 --- a/bsp/qemuarma15/qemuarma15-standard.scc +++ b/bsp/qemuarma15/qemuarma15-standard.scc @@ -4,12 +4,9 @@ define KTYPE standard define KARCH arm include ktypes/standard/standard.scc -# we aren't carrying patches specific to this platform, so let's -# skip the branch for now. -# branch qemuarma15 -include cfg/virtio.scc -include cfg/dmaengine.scc -include cfg/timer/rtc.scc include qemuarma15.scc +include features/pci/pci.scc +# for emulated pci support +include features/pci/pci-of-generic.scc diff --git a/bsp/qemuarma15/qemuarma15-tiny.cfg b/bsp/qemuarma15/qemuarma15-tiny.cfg deleted file mode 100644 index ed47939f..00000000 --- a/bsp/qemuarma15/qemuarma15-tiny.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: MIT -CONFIG_MMU=y -CONFIG_ARCH_MULTIPLATFORM=y -CONFIG_ARCH_MULTI_V7=y - -CONFIG_ARM_AMBA=y - -CONFIG_ARM_THUMB=y -CONFIG_KUSER_HELPERS=y -CONFIG_OABI_COMPAT=y -CONFIG_EXT4_FS=y - -# to keep things small, you really don't want these on. But to -# keep qemuarm's hvc0 console happy, we have them on for now -CONFIG_TTY=y -CONFIG_VIRTIO_MENU=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO=y -CONFIG_VIRTIO_CONSOLE=y -CONFIG_HVC_DRIVER=y diff --git a/bsp/qemuarma15/qemuarma15-tiny.scc b/bsp/qemuarma15/qemuarma15-tiny.scc index 406f8111..058f2ddc 100644 --- a/bsp/qemuarma15/qemuarma15-tiny.scc +++ b/bsp/qemuarma15/qemuarma15-tiny.scc @@ -4,14 +4,7 @@ define KTYPE tiny define KARCH arm include ktypes/tiny/tiny.scc -# we aren't carrying patches specific to this platform, so let's -# skip the branch for now. -# branch qemuarma15 - -include cfg/virtio.scc -include cfg/dmaengine.scc -include cfg/timer/rtc.scc -include qemuarma15.scc +include features/hid/hid.scc -kconf hardware qemuarma15-tiny.cfg +include qemuarma15.scc diff --git a/bsp/qemuarma15/qemuarma15.cfg b/bsp/qemuarma15/qemuarma15.cfg index 32187155..3c40bd0a 100644 --- a/bsp/qemuarma15/qemuarma15.cfg +++ b/bsp/qemuarma15/qemuarma15.cfg @@ -1,13 +1,18 @@ # SPDX-License-Identifier: MIT +CONFIG_MMU=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V7=y CONFIG_ARCH_VIRT=y CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_CPU_IDLE=y CONFIG_ARM_CPUIDLE=y +CONFIG_ARM_PATCH_PHYS_VIRT=y CONFIG_VFP=y CONFIG_VFPv3=y CONFIG_NEON=y CONFIG_KERNEL_MODE_NEON=y +CONFIG_TTY=y CONFIG_SERIAL_AMBA_PL011=y CONFIG_SERIAL_AMBA_PL011_CONSOLE=y CONFIG_HW_RANDOM=y @@ -16,7 +21,6 @@ CONFIG_SPI_PL022=y CONFIG_ARM_SP805_WATCHDOG=y CONFIG_RTC_DRV_PL031=y CONFIG_PL330_DMA=y -CONFIG_ARM_CRYPTO=y CONFIG_CRYPTO_SHA1_ARM_NEON=y CONFIG_CRYPTO_SHA1_ARM_CE=y CONFIG_CRYPTO_SHA2_ARM_CE=y @@ -28,6 +32,8 @@ CONFIG_CRYPTO_GHASH_ARM_CE=y CONFIG_CRYPTO_CRC32_ARM_CE=y CONFIG_CRYPTO_CHACHA20_NEON=y CONFIG_ARM_LPAE=y -CONFIG_PCI=y -CONFIG_PCI_HOST_GENERIC=y CONFIG_HIGHMEM=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_THUMB=y + +CONFIG_FUNCTION_GRAPH_TRACER=n diff --git a/bsp/qemuarma15/qemuarma15.scc b/bsp/qemuarma15/qemuarma15.scc index 68d9e710..db49ee54 100644 --- a/bsp/qemuarma15/qemuarma15.scc +++ b/bsp/qemuarma15/qemuarma15.scc @@ -1,3 +1,11 @@ # SPDX-License-Identifier: MIT kconf hardware qemuarma15.cfg kconf hardware qemuarma15-gfx.cfg + +include features/usb/xhci-hcd.scc +include features/net/net.scc + +include cfg/virtio.scc +include cfg/dmaengine.scc +include cfg/timer/rtc.scc +include cfg/net/mdio.scc diff --git a/bsp/qemuarma9/qemuarma9-gfx.cfg b/bsp/qemuarma9/qemuarma9-gfx.cfg index 5e7519e0..193ff985 100644 --- a/bsp/qemuarma9/qemuarma9-gfx.cfg +++ b/bsp/qemuarma9/qemuarma9-gfx.cfg @@ -1,8 +1,11 @@ # SPDX-License-Identifier: MIT -CONFIG_FB=y -CONFIG_FB_ARMCLCD=y -CONFIG_FRAMEBUFFER_CONSOLE=y - CONFIG_INPUT_TABLET=y -CONFIG_HID_WACOM=y +CONFIG_USB=y +CONFIG_USB_HID=y +CONFIG_USB_XHCI_HCD=y + +CONFIG_DRM=y +CONFIG_DRM_VIRTIO_GPU=y + CONFIG_INPUT_MISC=y +CONFIG_INPUT_UINPUT=y diff --git a/bsp/qemumicroblaze/qemumicroblazeeb-standard.scc b/bsp/qemumicroblaze/qemumicroblazeeb-standard.scc index 8cfad860..824a4e5d 100644 --- a/bsp/qemumicroblaze/qemumicroblazeeb-standard.scc +++ b/bsp/qemumicroblaze/qemumicroblazeeb-standard.scc @@ -12,5 +12,4 @@ include bsp/xilinx/soc/drivers-softip.scc include bsp/xilinx/board-common.scc # default policy for standard kernels -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/bsp/qemumicroblaze/qemumicroblazeel-standard.scc b/bsp/qemumicroblaze/qemumicroblazeel-standard.scc index 7ac1eab8..69b7bdc2 100644 --- a/bsp/qemumicroblaze/qemumicroblazeel-standard.scc +++ b/bsp/qemumicroblaze/qemumicroblazeel-standard.scc @@ -12,5 +12,4 @@ include bsp/xilinx/soc/drivers-softip.scc include bsp/xilinx/board-common.scc # default policy for standard kernels -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/bsp/qemuriscv32/qemuriscv32.cfg b/bsp/qemuriscv32/qemuriscv32.cfg index e944f964..ae1dd6f3 100644 --- a/bsp/qemuriscv32/qemuriscv32.cfg +++ b/bsp/qemuriscv32/qemuriscv32.cfg @@ -4,11 +4,11 @@ # CONFIG_ARCH_RV32I=y CONFIG_32BIT=y +CONFIG_NONPORTABLE=y # # Platform type # -CONFIG_MAXPHYSMEM_2GB=y CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_PGTABLE_LEVELS=2 CONFIG_GENERIC_ATOMIC64=y @@ -41,3 +41,9 @@ CONFIG_VIRTIO_CONSOLE=y # IRQ chip support # CONFIG_SIFIVE_PLIC=y + +# +# Enable Goldfish RTC +# +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_GOLDFISH=y diff --git a/bsp/qemuriscv32/qemuriscv32.scc b/bsp/qemuriscv32/qemuriscv32.scc index 7d368aad..2a1e3292 100644 --- a/bsp/qemuriscv32/qemuriscv32.scc +++ b/bsp/qemuriscv32/qemuriscv32.scc @@ -3,3 +3,9 @@ kconf hardware qemuriscv32.cfg # Graphics support include features/drm-bochs/drm-bochs.scc + +# XHCI USB +include features/usb/xhci-hcd.scc +include features/net/net.scc +include features/pci/pci.scc +include cfg/net/mdio.scc diff --git a/bsp/qemuriscv64/qemuriscv64.cfg b/bsp/qemuriscv64/qemuriscv64.cfg index 5e28e46e..5dcfbe63 100644 --- a/bsp/qemuriscv64/qemuriscv64.cfg +++ b/bsp/qemuriscv64/qemuriscv64.cfg @@ -8,7 +8,6 @@ CONFIG_64BIT=y # # Platform type # -CONFIG_MAXPHYSMEM_128GB=y CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_TUNE_GENERIC=y @@ -38,3 +37,9 @@ CONFIG_VIRTIO_CONSOLE=y # IRQ chip support # CONFIG_SIFIVE_PLIC=y + +# +# Enable Goldfish RTC +# +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_GOLDFISH=y diff --git a/bsp/qemuriscv64/qemuriscv64.scc b/bsp/qemuriscv64/qemuriscv64.scc index 2f012c53..f7d834f5 100644 --- a/bsp/qemuriscv64/qemuriscv64.scc +++ b/bsp/qemuriscv64/qemuriscv64.scc @@ -3,3 +3,9 @@ kconf hardware qemuriscv64.cfg # Graphics support include features/drm-bochs/drm-bochs.scc + +# XHCI USB +include features/usb/xhci-hcd.scc +include features/net/net.scc +include features/pci/pci.scc +include cfg/net/mdio.scc diff --git a/bsp/renesas-rcar/renesas-rcar.cfg b/bsp/renesas-rcar/renesas-rcar.cfg index 9d5461a2..f0325826 100644 --- a/bsp/renesas-rcar/renesas-rcar.cfg +++ b/bsp/renesas-rcar/renesas-rcar.cfg @@ -155,7 +155,6 @@ CONFIG_VIDEO_ADV7604_CEC=y # GPIO configuration CONFIG_GPIOLIB=y CONFIG_OF_GPIO=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_RCAR=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X_IRQ=y @@ -176,7 +175,7 @@ CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_PLATFORM_SUPPORT=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_CONTROLLER=y -CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_DEV=y CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEOBUF2_DMA_CONTIG=y @@ -188,7 +187,7 @@ CONFIG_VIDEO_RENESAS_VSP1=y CONFIG_VIDEO_RCAR_VIN=y CONFIG_VIDEO_RCAR_CSI2=y CONFIG_VIDEO_OV5647=y -# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +CONFIG_MEDIA_SUBDRV_AUTOSELECT=n # DMA configuration CONFIG_DMA_SHARED_BUFFER=y diff --git a/bsp/ti-am335x/ti-am335x.cfg b/bsp/ti-am335x/ti-am335x.cfg index d5b9ee63..bdf54c5d 100644 --- a/bsp/ti-am335x/ti-am335x.cfg +++ b/bsp/ti-am335x/ti-am335x.cfg @@ -135,7 +135,6 @@ CONFIG_PINCTRL_SINGLE=y CONFIG_GPIOLIB=y CONFIG_OF_GPIO=y CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_OMAP=y CONFIG_GPIO_PCA953X=m diff --git a/bsp/xilinx-zynq/xilinx-zynq.cfg b/bsp/xilinx-zynq/xilinx-zynq.cfg index 3a2319a1..c4589de2 100644 --- a/bsp/xilinx-zynq/xilinx-zynq.cfg +++ b/bsp/xilinx-zynq/xilinx-zynq.cfg @@ -22,7 +22,6 @@ CONFIG_VFP=y CONFIG_NEON=y # DMA -CONFIG_XILINX_DMA_ENGINES=y CONFIG_AXI_DMAC=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y @@ -40,7 +39,7 @@ CONFIG_CADENCE_WATCHDOG=y # GPIO CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_CDEV=y CONFIG_GPIO_XILINX=y CONFIG_GPIO_ZYNQ=y CONFIG_GPIO_PCA953X=y diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg index e37c1f73..21a7e297 100644 --- a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg +++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg @@ -22,8 +22,8 @@ CONFIG_MTD_OF_PARTS=y CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y CONFIG_MTD_SPI_NOR=y -# CONFIG_JFFS2_FS_WRITEBUFFER is not set -# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_JFFS2_FS_WRITEBUFFER=n +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=n CONFIG_BLK_DEV_SD=y CONFIG_ATA=y @@ -68,13 +68,16 @@ CONFIG_SPI_CADENCE=y CONFIG_SPI_XILINX=y CONFIG_SPI_ZYNQMP_GQSPI=y +CONFIG_PINCTRL=y + CONFIG_GPIOLIB=y CONFIG_OF_GPIO=y -CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_CDEV=y CONFIG_GPIO_XILINX=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GPIO_ZYNQ=y +CONFIG_GPIO_ZYNQMP_MODEPIN=y CONFIG_POWER_RESET=y CONFIG_SENSORS_INA2XX=y @@ -91,6 +94,10 @@ CONFIG_USB_OTG_FSM=m CONFIG_USB_GADGET=y CONFIG_USB_GADGET_XILINX=y +CONFIG_INPUT=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_EVDEV=y + CONFIG_MMC=y CONFIG_MMC_BLOCK=y CONFIG_MMC_SDHCI=y @@ -109,7 +116,6 @@ CONFIG_RTC_INTF_SYSFS=y CONFIG_RTC_DRV_ZYNQMP=y CONFIG_DMADEVICES=y -CONFIG_XILINX_DMA_ENGINES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_CMA=y @@ -168,7 +174,6 @@ CONFIG_MEDIA_CONTROLLER=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_VIDEO_DEV=y CONFIG_VIDEO_V4L2_SUBDEV_API=y -CONFIG_VIDEO_V4L2=y CONFIG_MEDIA_PLATFORM_SUPPORT=y CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEO_XILINX=y @@ -189,7 +194,6 @@ CONFIG_VIDEO_XILINX_MULTISCALER=y CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_GEM_CMA_HELPER=y CONFIG_DRM_KMS_CMA_HELPER=y @@ -242,3 +246,9 @@ CONFIG_OF_CONFIGFS=y CONFIG_FPGA_MGR_DEBUG_FS=y CONFIG_ARM_PSCI_CPUIDLE=y + +CONFIG_ZYNQMP_FIRMWARE_DEBUG=y + +CONFIG_CRYPTO_DEV_ZYNQMP_SHA3=y +CONFIG_CRYPTO_DEV_XILINX_RSA=y +CONFIG_CRYPTO_DEV_ZYNQMP_AES=y diff --git a/bsp/xilinx/board-common.cfg b/bsp/xilinx/board-common.cfg index 6ba80905..0efca4cd 100644 --- a/bsp/xilinx/board-common.cfg +++ b/bsp/xilinx/board-common.cfg @@ -39,7 +39,7 @@ CONFIG_EEPROM_AT25=y # MTD CONFIG_MTD=y CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=n CONFIG_MTD_M25P80=y CONFIG_MTD_CFI=y CONFIG_MTD_CFI_AMDSTD=y diff --git a/bsp/xilinx/soc/drivers-softip.cfg b/bsp/xilinx/soc/drivers-softip.cfg index 3d3e067c..01c29ba1 100644 --- a/bsp/xilinx/soc/drivers-softip.cfg +++ b/bsp/xilinx/soc/drivers-softip.cfg @@ -23,7 +23,6 @@ CONFIG_XILINX_AXI_EMAC=y # GPIO CONFIG_GPIOLIB=y CONFIG_OF_GPIO=y -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_XILINX=y # I2C diff --git a/bsp/xilinx/soc/drivers-zynq.cfg b/bsp/xilinx/soc/drivers-zynq.cfg index 560e0cb8..deee2b1c 100644 --- a/bsp/xilinx/soc/drivers-zynq.cfg +++ b/bsp/xilinx/soc/drivers-zynq.cfg @@ -29,11 +29,10 @@ CONFIG_WATCHDOG=y CONFIG_CADENCE_WATCHDOG=y # Ethernet -CONFIG_NET_CADENCE=y +CONFIG_NET_VENDOR_CADENCE=y CONFIG_MACB=y # GPIO -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_ZYNQ=y # I2C diff --git a/bsp/xilinx/zynq-standard.scc b/bsp/xilinx/zynq-standard.scc index 889ba997..bad94870 100644 --- a/bsp/xilinx/zynq-standard.scc +++ b/bsp/xilinx/zynq-standard.scc @@ -12,5 +12,4 @@ include features/input/input.scc include cfg/usb-mass-storage.scc # default policy for standard kernels -include features/latencytop/latencytop.scc include features/profiling/profiling.scc diff --git a/cfg/amd.cfg b/cfg/amd.cfg index 2189810a..18213328 100644 --- a/cfg/amd.cfg +++ b/cfg/amd.cfg @@ -3,7 +3,6 @@ CONFIG_X86_AMD_PLATFORM_DEVICE=y CONFIG_MICROCODE=y -CONFIG_MICROCODE_AMD=y CONFIG_CPU_SUP_AMD=y diff --git a/cfg/boot-live.cfg b/cfg/boot-live.cfg index 03705e76..e13d04b5 100644 --- a/cfg/boot-live.cfg +++ b/cfg/boot-live.cfg @@ -2,7 +2,6 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_RD_GZIP=y # Needed for booting (and using) CD images -CONFIG_BLK_DEV_IDECD=y CONFIG_ISO9660_FS=y CONFIG_BLK_DEV_SR=y CONFIG_ZISOFS=y diff --git a/cfg/cgroup-hugetlb.cfg b/cfg/cgroup-hugetlb.cfg new file mode 100644 index 00000000..417ca249 --- /dev/null +++ b/cfg/cgroup-hugetlb.cfg @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# +# This requires CONFIG_HUGETLBFS + +CONFIG_CGROUP_HUGETLB=y diff --git a/cfg/cgroup-hugetlb.scc b/cfg/cgroup-hugetlb.scc new file mode 100644 index 00000000..7d1f9997 --- /dev/null +++ b/cfg/cgroup-hugetlb.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable hugetlb cgroup" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware cgroup-hugetlb.cfg diff --git a/cfg/criu.cfg b/cfg/criu.cfg new file mode 100644 index 00000000..dc9502a6 --- /dev/null +++ b/cfg/criu.cfg @@ -0,0 +1,8 @@ +#Networking options options for sock-diag subsystem +CONFIG_UNIX_DIAG=y +CONFIG_INET_DIAG=y +CONFIG_INET_UDP_DIAG=y +CONFIG_PACKET_DIAG=y +CONFIG_NETLINK_DIAG=y +CONFIG_NETFILTER_XT_MARK=y +CONFIG_TUN=m diff --git a/cfg/criu.scc b/cfg/criu.scc new file mode 100644 index 00000000..87a88113 --- /dev/null +++ b/cfg/criu.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable Networking Features needed by criu." +define KFEATURE_COMPATIBILITY board + +kconf non-hardware criu.cfg diff --git a/cfg/crypto-obsolete-disable.cfg b/cfg/crypto-obsolete-disable.cfg new file mode 100644 index 00000000..85128c87 --- /dev/null +++ b/cfg/crypto-obsolete-disable.cfg @@ -0,0 +1 @@ +CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=n diff --git a/cfg/crypto-obsolete-disable.scc b/cfg/crypto-obsolete-disable.scc new file mode 100644 index 00000000..e7ead6a8 --- /dev/null +++ b/cfg/crypto-obsolete-disable.scc @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Disable obselete crypto options" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware crypto-obsolete-disable.cfg + diff --git a/cfg/debug/debug-info/debug-info.cfg b/cfg/debug/debug-info/debug-info.cfg index 0514cea3..1d75b16b 100644 --- a/cfg/debug/debug-info/debug-info.cfg +++ b/cfg/debug/debug-info/debug-info.cfg @@ -1,3 +1,2 @@ # SPDX-License-Identifier: MIT -# CONFIG_TEST is not set CONFIG_DEBUG_INFO=y diff --git a/cfg/debug/fault-inject/debug-fault-injection-debugfs.cfg b/cfg/debug/fault-inject/debug-fault-injection-debugfs.cfg new file mode 100644 index 00000000..7e5b692a --- /dev/null +++ b/cfg/debug/fault-inject/debug-fault-injection-debugfs.cfg @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +# dependencies +CONFIG_SYSFS=y +CONFIG_DEBUG_FS=y + +CONFIG_FAULT_INJECTION_DEBUG_FS=y diff --git a/cfg/debug/fault-inject/debug-fault-injection-debugfs.scc b/cfg/debug/fault-inject/debug-fault-injection-debugfs.scc new file mode 100644 index 00000000..d12af702 --- /dev/null +++ b/cfg/debug/fault-inject/debug-fault-injection-debugfs.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable fault injection debugfs capabilities" +define KFEATURE_COMPATIBILITY all + +include debug-fault-injection.scc + +kconf non-hardware debug-fault-injection-debugfs.cfg diff --git a/cfg/debug/kcov/debug-kcov.cfg b/cfg/debug/kcov/debug-kcov.cfg new file mode 100644 index 00000000..9cdd37ce --- /dev/null +++ b/cfg/debug/kcov/debug-kcov.cfg @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +CONFIG_KCOV=y +CONFIG_KCOV_ENABLE_COMPARISONS=y +CONFIG_KCOV_INSTRUMENT_ALL=y diff --git a/cfg/debug/kcov/debug-kcov.scc b/cfg/debug/kcov/debug-kcov.scc new file mode 100644 index 00000000..325c6f99 --- /dev/null +++ b/cfg/debug/kcov/debug-kcov.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable kernel code coverage support" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware debug-kcov.cfg diff --git a/cfg/debug/kcsan/debug-kcsan.cfg b/cfg/debug/kcsan/debug-kcsan.cfg new file mode 100644 index 00000000..57c4352e --- /dev/null +++ b/cfg/debug/kcsan/debug-kcsan.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_KCSAN=y diff --git a/cfg/debug/kcsan/debug-kcsan.scc b/cfg/debug/kcsan/debug-kcsan.scc new file mode 100644 index 00000000..b726d6b0 --- /dev/null +++ b/cfg/debug/kcsan/debug-kcsan.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable kernel concurrency sanitizer support" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware debug-kcsan.cfg diff --git a/cfg/debug/mem/debug-pagealloc.cfg b/cfg/debug/mem/debug-pagealloc.cfg index c4f1ade0..218f0756 100644 --- a/cfg/debug/mem/debug-pagealloc.cfg +++ b/cfg/debug/mem/debug-pagealloc.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT -# CONFIG_HIBERNATION is not set +CONFIG_HIBERNATION=n CONFIG_DEBUG_PAGEALLOC=y CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y diff --git a/cfg/debug/misc/debug-credentials.cfg b/cfg/debug/misc/debug-credentials.cfg index e0d09198..548d2d44 100644 --- a/cfg/debug/misc/debug-credentials.cfg +++ b/cfg/debug/misc/debug-credentials.cfg @@ -1,2 +1 @@ # SPDX-License-Identifier: MIT -CONFIG_DEBUG_CREDENTIALS=y diff --git a/cfg/debug/syzkaller/debug-syzkaller.scc b/cfg/debug/syzkaller/debug-syzkaller.scc new file mode 100644 index 00000000..ff99b281 --- /dev/null +++ b/cfg/debug/syzkaller/debug-syzkaller.scc @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable debug and emulation features needed for syzkaller fuzzing" +define KFEATURE_COMPATIBILITY all + +include cfg/debug/kcov/debug-kcov.scc +include cfg/debug/mem/debug-memleak.scc +include cfg/debug/kcsan/debug-kcsan.scc +include cfg/debug/fault-inject/debug-failslab-slab.scc +include cfg/debug/fault-inject/debug-fault-injection-debugfs.scc + +include features/tun/tun.scc +include features/usb/usb-dummy-hcd.scc +include features/usb/usb-raw-gadget.scc +include features/mac80211/mac80211-hwsim.scc +include features/bluetooth/bluetooth-vhci.scc +include features/ieee802154/ieee802154-hwsim.scc diff --git a/features/docker/docker.cfg b/cfg/docker.cfg index 659b97e0..4d8d7e04 100644 --- a/features/docker/docker.cfg +++ b/cfg/docker.cfg @@ -1,5 +1,3 @@ -# SPDX-License-Identifier: MIT -# Misc configs CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m CONFIG_IP_NF_FILTER=m CONFIG_NF_NAT=m @@ -10,5 +8,8 @@ CONFIG_DM_THIN_PROVISIONING=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_NETFILTER_XT_MATCH_IPVS=m CONFIG_OVERLAY_FS=y + +CONFIG_CGROUP_BPF=y diff --git a/cfg/docker.scc b/cfg/docker.scc new file mode 100644 index 00000000..e317456c --- /dev/null +++ b/cfg/docker.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable Features needed by docker in addition to LXC features" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware docker.cfg diff --git a/cfg/drm-cdvpvr.cfg b/cfg/drm-cdvpvr.cfg index 2ba41584..c51904cf 100644 --- a/cfg/drm-cdvpvr.cfg +++ b/cfg/drm-cdvpvr.cfg @@ -7,5 +7,5 @@ CONFIG_SND_HDA_CODEC_HDMI=y CONFIG_DRM_INTEL_CDV=y CONFIG_DRM_CDV_RELEASE=y -# CONFIG_DRM_CDV_DEBUG is not set -# CONFIG_DRM_PVR_PDUMP is not set +CONFIG_DRM_CDV_DEBUG=n +CONFIG_DRM_PVR_PDUMP=n diff --git a/cfg/ebtables.cfg b/cfg/ebtables.cfg new file mode 100644 index 00000000..a3c514e1 --- /dev/null +++ b/cfg/ebtables.cfg @@ -0,0 +1,2 @@ +CONFIG_BRIDGE_NF_EBTABLES=m +CONFIG_BRIDGE_EBT_T_NAT=m diff --git a/cfg/ebtables.scc b/cfg/ebtables.scc new file mode 100644 index 00000000..b3895e58 --- /dev/null +++ b/cfg/ebtables.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable ebtables support" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware ebtables.cfg diff --git a/cfg/efi-ext.cfg b/cfg/efi-ext.cfg index 55478ad9..b8fa0426 100644 --- a/cfg/efi-ext.cfg +++ b/cfg/efi-ext.cfg @@ -11,5 +11,4 @@ CONFIG_PARTITION_ADVANCED=y # Add support for optional EFI features CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FB_EFI=y -CONFIG_EFI_VARS=m CONFIG_EFI_PARTITION=y diff --git a/cfg/efi.cfg b/cfg/efi.cfg index d3dfd603..d729cbe9 100644 --- a/cfg/efi.cfg +++ b/cfg/efi.cfg @@ -3,7 +3,6 @@ # Dependencies CONFIG_PCI=y -CONFIG_ACPI=y # Enable basic EFI support CONFIG_EFI=y diff --git a/cfg/fs/ext2.cfg b/cfg/fs/ext2.cfg index 6a3efdf1..8bb8986c 100644 --- a/cfg/fs/ext2.cfg +++ b/cfg/fs/ext2.cfg @@ -2,4 +2,4 @@ CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y -# CONFIG_EXT2_FS_SECURITY is not set +CONFIG_EXT2_FS_SECURITY=n diff --git a/cfg/fs/squashfs.cfg b/cfg/fs/squashfs.cfg new file mode 100644 index 00000000..27906251 --- /dev/null +++ b/cfg/fs/squashfs.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_SQUASHFS=y diff --git a/cfg/fs/squashfs.scc b/cfg/fs/squashfs.scc new file mode 100644 index 00000000..bb82fe60 --- /dev/null +++ b/cfg/fs/squashfs.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable squashfs filesystem support" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware squashfs.cfg diff --git a/cfg/intel.cfg b/cfg/intel.cfg index 3096df33..01e865df 100644 --- a/cfg/intel.cfg +++ b/cfg/intel.cfg @@ -1,7 +1,6 @@ # SPDX-License-Identifier: MIT # Config settings specific to intel processors CONFIG_MICROCODE=y -CONFIG_MICROCODE_INTEL=y CONFIG_CPU_SUP_INTEL=y diff --git a/cfg/kubernetes.cfg b/cfg/kubernetes.cfg new file mode 100644 index 00000000..84fa8c57 --- /dev/null +++ b/cfg/kubernetes.cfg @@ -0,0 +1,39 @@ +CONFIG_BLK_CGROUP=y +CONFIG_BLK_DEV_THROTTLING=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_HUGETLB=y +CONFIG_NET_CLS_CGROUP=y +CONFIG_CFS_BANDWIDTH=y +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_IP_SET=m +CONFIG_IP_VS=y +CONFIG_IP_VS_NFCT=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +CONFIG_NAMESPACES=y +CONFIG_NET_NS=y +CONFIG_PID_NS=y +CONFIG_IPC_NS=y +CONFIG_UTS_NS=y +CONFIG_CGROUPS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_SCHED=y +CONFIG_SMP=y +CONFIG_CPUSETS=y +CONFIG_MEMCG=y +CONFIG_INET=y +CONFIG_EXT4_FS=y +CONFIG_PROC_FS=y diff --git a/cfg/kubernetes.scc b/cfg/kubernetes.scc new file mode 100644 index 00000000..9ec5d13a --- /dev/null +++ b/cfg/kubernetes.scc @@ -0,0 +1,5 @@ +include docker.scc +include cgl/cfg/net/ip_vs.scc +include features/hugetlb/hugetlb.scc + +kconf non-hardware kubernetes.cfg diff --git a/features/lxc/lxc.cfg b/cfg/lxc.cfg index bf6136ed..09093319 100644 --- a/features/lxc/lxc.cfg +++ b/cfg/lxc.cfg @@ -18,9 +18,6 @@ CONFIG_NET_CLS_CGROUP=m CONFIG_BLK_CGROUP=y CONFIG_CGROUP_NET_PRIO=y -# Virtual drivers -CONFIG_HVC_DRIVER=y - # Base support for live boot CONFIG_BLK_DEV_LOOP=y CONFIG_NLS_CODEPAGE_437=y diff --git a/cfg/lxc.scc b/cfg/lxc.scc new file mode 100644 index 00000000..ee518835 --- /dev/null +++ b/cfg/lxc.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable Features needed by LxC, namespaces, cgroups et.c." +define KFEATURE_COMPATIBILITY board + +kconf non-hardware lxc.cfg diff --git a/cfg/mips64.cfg b/cfg/mips64.cfg index 77857ef7..1098090f 100644 --- a/cfg/mips64.cfg +++ b/cfg/mips64.cfg @@ -15,4 +15,4 @@ CONFIG_MIPS32_N32=y # The kernel panics on boot with an unhandled page fault if we # configure the VGA_CONSOLE in. # -# CONFIG_VGA_CONSOLE is not set +CONFIG_VGA_CONSOLE=n diff --git a/cfg/mips64le.cfg b/cfg/mips64le.cfg index 8eaf305a..9ea3fa43 100644 --- a/cfg/mips64le.cfg +++ b/cfg/mips64le.cfg @@ -15,4 +15,4 @@ CONFIG_MIPS32_N32=y # The kernel panics on boot with an unhandled page fault if we # configure the VGA_CONSOLE in. # -# CONFIG_VGA_CONSOLE is not set +CONFIG_VGA_CONSOLE=n diff --git a/cfg/net/ip_nf.cfg b/cfg/net/ip_nf.cfg index cf0251fa..14f7cfad 100644 --- a/cfg/net/ip_nf.cfg +++ b/cfg/net/ip_nf.cfg @@ -12,7 +12,6 @@ CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m diff --git a/cfg/net/mdio.cfg b/cfg/net/mdio.cfg new file mode 100644 index 00000000..98a0f3e6 --- /dev/null +++ b/cfg/net/mdio.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_BUS=y diff --git a/cfg/net/mdio.scc b/cfg/net/mdio.scc new file mode 100644 index 00000000..4e99fa7d --- /dev/null +++ b/cfg/net/mdio.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable MDIO bus device options" +define KFEATURE_COMPATIBILITY all + +kconf hardware mdio.cfg diff --git a/cfg/net/y_or_m_enabled.cfg b/cfg/net/y_or_m_enabled.cfg new file mode 100644 index 00000000..2be97522 --- /dev/null +++ b/cfg/net/y_or_m_enabled.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_MDIO_BUS diff --git a/cfg/remoteproc.cfg b/cfg/remoteproc.cfg index b4f13fd7..dacb8505 100644 --- a/cfg/remoteproc.cfg +++ b/cfg/remoteproc.cfg @@ -1,3 +1,3 @@ # SPDX-License-Identifier: MIT -CONFIG_REMOTEPROC=m +CONFIG_REMOTEPROC=y CONFIG_WKUP_M3_RPROC=m diff --git a/cfg/sound.cfg b/cfg/sound.cfg index 219e9606..3e11e940 100644 --- a/cfg/sound.cfg +++ b/cfg/sound.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT CONFIG_SOUND=m -# CONFIG_SOUND_OSS_CORE is not set +CONFIG_SOUND_OSS_CORE=n CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_HRTIMER=m @@ -11,10 +11,10 @@ CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m CONFIG_SND_SEQ_MIDI=m CONFIG_SND_SEQ_MIDI_EVENT=m -# CONFIG_SND_MIXER_OSS is not set -# CONFIG_SND_PCM_OSS is not set -# CONFIG_SND_SEQUENCER_OSS is not set -# CONFIG_SND_SUPPORT_OLD_API is not set +CONFIG_SND_MIXER_OSS=n +CONFIG_SND_PCM_OSS=n +CONFIG_SND_SEQUENCER_OSS=n +CONFIG_SND_SUPPORT_OLD_API=n CONFIG_SND_OPL3_LIB_SEQ=m CONFIG_SND_EMU10K1_SEQ=m CONFIG_SND_MPU401_UART=m diff --git a/cfg/timer/hz_100.cfg b/cfg/timer/hz_100.cfg index fffd96f2..452784d8 100644 --- a/cfg/timer/hz_100.cfg +++ b/cfg/timer/hz_100.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT CONFIG_HZ_100=y -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set +CONFIG_HZ_250=n +CONFIG_HZ_300=n +CONFIG_HZ_1000=n CONFIG_HZ=100 diff --git a/cfg/timer/hz_1000.cfg b/cfg/timer/hz_1000.cfg index 13351152..c6024f73 100644 --- a/cfg/timer/hz_1000.cfg +++ b/cfg/timer/hz_1000.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT CONFIG_HZ_1000=y -# CONFIG_HZ_100 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set +CONFIG_HZ_100=n +CONFIG_HZ_250=n +CONFIG_HZ_300=n CONFIG_HZ=1000 diff --git a/cfg/timer/hz_250.cfg b/cfg/timer/hz_250.cfg index f9251bbe..42f2a1b7 100644 --- a/cfg/timer/hz_250.cfg +++ b/cfg/timer/hz_250.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT CONFIG_HZ_250=y -# CONFIG_HZ_100 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_1000 is not set +CONFIG_HZ_100=n +CONFIG_HZ_300=n +CONFIG_HZ_1000=n CONFIG_HZ=250 diff --git a/cfg/timer/no_hz.cfg b/cfg/timer/no_hz.cfg index a2275795..e17bec01 100644 --- a/cfg/timer/no_hz.cfg +++ b/cfg/timer/no_hz.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -CONFIG_NO_HZ=y +CONFIG_NO_HZ_IDLE=y diff --git a/cfg/vesafb.cfg b/cfg/vesafb.cfg index 203ba039..f39eefa7 100644 --- a/cfg/vesafb.cfg +++ b/cfg/vesafb.cfg @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT CONFIG_FB=y CONFIG_FB_VESA=y -CONFIG_FB_BOOT_VESA_SUPPORT=y +CONFIG_BOOT_VESA_SUPPORT=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y diff --git a/cfg/virtio.cfg b/cfg/virtio.cfg index 938d2da5..0ef99c6b 100644 --- a/cfg/virtio.cfg +++ b/cfg/virtio.cfg @@ -1,16 +1,23 @@ # SPDX-License-Identifier: MIT CONFIG_VIRTIO=y +CONFIG_VIRTIO_MENU=y CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_BALLOON=y +CONFIG_NET=y CONFIG_VIRTIO_NET=y CONFIG_VIRTIO_BLK=y +CONFIG_BLK_MQ_VIRTIO=y CONFIG_VIRTIO_CONSOLE=y CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_INPUT=m CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_SCSI=y +CONFIG_SCSI_LOWLEVEL=y CONFIG_SCSI_VIRTIO=y +CONFIG_CRYPTO=y CONFIG_CRYPTO_DEV_VIRTIO=y +CONFIG_DRM=y CONFIG_DRM_VIRTIO_GPU=y CONFIG_VSOCKETS=y CONFIG_VSOCKETS_DIAG=y diff --git a/cfg/vmware-guest.cfg b/cfg/vmware-guest.cfg index 00b1131d..499a02b9 100644 --- a/cfg/vmware-guest.cfg +++ b/cfg/vmware-guest.cfg @@ -15,9 +15,9 @@ CONFIG_FUSION_MAX_SGE=128 CONFIG_FUSION_CTL=y CONFIG_FUSION_LAN=y CONFIG_FUSION_LOGGING=y +CONFIG_NET_FC=y +CONFIG_SCSI_FC_ATTRS=y CONFIG_SCSI_MPT2SAS=y CONFIG_SCSI_MPT2SAS_MAX_SGE=128 -CONFIG_SCSI_MPT2SAS_LOGGING=y CONFIG_SCSI_MPT3SAS=y CONFIG_SCSI_MPT3SAS_MAX_SGE=128 -CONFIG_SCSI_MPT3SAS_LOGGING=y diff --git a/cfg/vswitch.cfg b/cfg/vswitch.cfg new file mode 100644 index 00000000..b1fefc0c --- /dev/null +++ b/cfg/vswitch.cfg @@ -0,0 +1,3 @@ +CONFIG_OPENVSWITCH=m +CONFIG_NET_SCH_INGRESS=m +CONFIG_NET_ACT_POLICE=m diff --git a/cfg/vswitch.scc b/cfg/vswitch.scc new file mode 100644 index 00000000..2790b4fe --- /dev/null +++ b/cfg/vswitch.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable in kernel OpenvSwitch module" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware vswitch.cfg diff --git a/cfg/x32.cfg b/cfg/x32.cfg index 98fd8b2d..307695dd 100644 --- a/cfg/x32.cfg +++ b/cfg/x32.cfg @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -CONFIG_X86_X32=y +CONFIG_X86_X32_ABI=y # Support running 32 bit binaries CONFIG_COMPAT=y diff --git a/cfg/x86_64.cfg b/cfg/x86_64.cfg index 1f6a2a81..c2c3193c 100644 --- a/cfg/x86_64.cfg +++ b/cfg/x86_64.cfg @@ -6,5 +6,5 @@ CONFIG_64BIT=y CONFIG_IA32_EMULATION=y CONFIG_COMPAT=y -# CONFIG_UNWINDER_ORC is not set +CONFIG_UNWINDER_ORC=n CONFIG_UNWINDER_FRAME_POINTER=y diff --git a/cfg/x86_base.cfg b/cfg/x86_base.cfg index 9dedfd09..b3cd09cd 100644 --- a/cfg/x86_base.cfg +++ b/cfg/x86_base.cfg @@ -4,5 +4,7 @@ CONFIG_X86_MSR=y CONFIG_X86_CPUID=y CONFIG_MTRR=y +CONFIG_ACPI=y + CONFIG_X86_CHECK_BIOS_CORRUPTION=y CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y diff --git a/cfg/xen.cfg b/cfg/xen.cfg new file mode 100644 index 00000000..af821d2f --- /dev/null +++ b/cfg/xen.cfg @@ -0,0 +1,49 @@ +CONFIG_HYPERVISOR_GUEST=y +CONFIG_PARAVIRT=y +CONFIG_XEN=y +CONFIG_XEN_DOM0=y +CONFIG_XEN_PVHVM=y +CONFIG_XEN_SAVE_RESTORE=y +# CONFIG_XEN_DEBUG_FS is not set +CONFIG_XEN_PVH=y +CONFIG_MMU_NOTIFIER=y +CONFIG_HIBERNATE_CALLBACKS=y +CONFIG_PCI_XEN=y +CONFIG_XEN_PCIDEV_FRONTEND=y +CONFIG_SYS_HYPERVISOR=y +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_BLKDEV_BACKEND=m +CONFIG_XEN_SCSI_FRONTEND=m +CONFIG_XEN_NETDEV_FRONTEND=y +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_INPUT_MISC=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y +CONFIG_HVC_IRQ=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_XEN_WDT=m +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_XEN_BALLOON=y +CONFIG_XEN_SCRUB_PAGES_DEFAULT=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_BACKEND=y +CONFIG_XENFS=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_XENBUS_FRONTEND=y +CONFIG_XEN_GNTDEV=m +CONFIG_XEN_GRANT_DEV_ALLOC=m +CONFIG_SWIOTLB_XEN=y +CONFIG_XEN_PCIDEV_BACKEND=m +CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_ACPI_PROCESSOR=m +CONFIG_XEN_MCE_LOG=y +CONFIG_XEN_HAVE_PVMMU=y +CONFIG_XEN_EFI=y +CONFIG_XEN_AUTO_XLATE=y +CONFIG_XEN_ACPI=y diff --git a/cfg/xen.scc b/cfg/xen.scc new file mode 100644 index 00000000..b588e5df --- /dev/null +++ b/cfg/xen.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Xen Kernel Support" +define KFEATURE_COMPATIBILITY arch + +kconf non-hardware xen.cfg diff --git a/cfg/xt-checksum.cfg b/cfg/xt-checksum.cfg new file mode 100644 index 00000000..58afbff6 --- /dev/null +++ b/cfg/xt-checksum.cfg @@ -0,0 +1 @@ +CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m diff --git a/cfg/xt-checksum.scc b/cfg/xt-checksum.scc new file mode 100644 index 00000000..d3804f0c --- /dev/null +++ b/cfg/xt-checksum.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Add extra iptables modules" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware xt-checksum.cfg diff --git a/cgl/features/audit/audit.cfg b/cgl/features/audit/audit.cfg index e9db3a50..ec3678c5 100644 --- a/cgl/features/audit/audit.cfg +++ b/cgl/features/audit/audit.cfg @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set +CONFIG_NETFILTER_XT_TARGET_AUDIT=n CONFIG_AUDIT_GENERIC=y diff --git a/cgl/features/selinux/selinux.cfg b/cgl/features/selinux/selinux.cfg index 91efe977..a73ad995 100644 --- a/cgl/features/selinux/selinux.cfg +++ b/cgl/features/selinux/selinux.cfg @@ -7,6 +7,4 @@ CONFIG_JFS_SECURITY=y CONFIG_JFFS2_FS_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_SELINUX=y -CONFIG_SECURITY_SELINUX_DISABLE=y CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 diff --git a/features/apparmor/apparmor.cfg b/features/apparmor/apparmor.cfg index 1a656fb0..0fe87377 100644 --- a/features/apparmor/apparmor.cfg +++ b/features/apparmor/apparmor.cfg @@ -5,4 +5,3 @@ CONFIG_SECURITY_PATH=y CONFIG_SECURITY_APPARMOR=y CONFIG_SECURITY_APPARMOR_HASH=y CONFIG_SECURITY_APPARMOR_HASH_DEFAULT=y -CONFIG_DEFAULT_SECURITY_APPARMOR=y diff --git a/features/aufs/aufs-adjust-for-v6.9.patch b/features/aufs/aufs-adjust-for-v6.9.patch new file mode 100644 index 00000000..82e5bfd0 --- /dev/null +++ b/features/aufs/aufs-adjust-for-v6.9.patch @@ -0,0 +1,48 @@ +From 252dbed4c82524c20b3564f560422633aa6cb369 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 3 Apr 2024 10:15:47 -0400 +Subject: [PATCH] aufs: adjust for v6.9+ + +The following commit drops SLAB_MEM_SPREAD, so we remove it +from aufs. + +commit cdeeaaba174886aa6c1ff4c0c5449c5066dbe82f +Author: Vlastimil Babka <vbabka@suse.cz> +Date: Fri Feb 23 19:27:17 2024 +0100 + + mm, slab: deprecate SLAB_MEM_SPREAD flag + + The SLAB_MEM_SPREAD flag used to be implemented in SLAB, which was + removed. SLUB instead relies on the page allocator's NUMA policies. + Change the flag's value to 0 to free up the value it had, and mark it + for full removal once all users are gone. + + Reported-by: Steven Rostedt <rostedt@goodmis.org> + Closes: https://lore.kernel.org/all/20240131172027.10f64405@gandalf.local.home/ + Reviewed-and-tested-by: Xiongwei Song <xiongwei.song@windriver.com> + Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev> + Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev> + Acked-by: David Rientjes <rientjes@google.com> + Signed-off-by: Vlastimil Babka <vbabka@suse.cz> + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/module.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/aufs/module.h b/fs/aufs/module.h +index a9d21d3e5414..784c830d084d 100644 +--- a/fs/aufs/module.h ++++ b/fs/aufs/module.h +@@ -129,7 +129,7 @@ enum { + + extern struct kmem_cache *au_cache[AuCache_Last]; + +-#define AuCacheFlags (SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD) ++#define AuCacheFlags (SLAB_RECLAIM_ACCOUNT) + #define AuCache(type) KMEM_CACHE(type, AuCacheFlags) + #define AuCacheCtor(type, ctor) \ + kmem_cache_create(#type, sizeof(struct type), \ +-- +2.39.2 + diff --git a/features/aufs/aufs-disable.cfg b/features/aufs/aufs-disable.cfg index e276863f..b58d21a8 100644 --- a/features/aufs/aufs-disable.cfg +++ b/features/aufs/aufs-disable.cfg @@ -1,5 +1,5 @@ # SPDX-License-Identifier: MIT -# CONFIG_AUFS_FS is not set -# CONFIG_AUFS_BRANCH_MAX_127 is not set -# CONFIG_AUFS_SBILIST is not set -# CONFIG_AUFS_BDEV_LOOP is not set +CONFIG_AUFS_FS=n +CONFIG_AUFS_BRANCH_MAX_127=n +CONFIG_AUFS_SBILIST=n +CONFIG_AUFS_BDEV_LOOP=n diff --git a/features/aufs/aufs-fix-v6.7-kernel-build-compilation.patch b/features/aufs/aufs-fix-v6.7-kernel-build-compilation.patch new file mode 100644 index 00000000..0ab046db --- /dev/null +++ b/features/aufs/aufs-fix-v6.7-kernel-build-compilation.patch @@ -0,0 +1,144 @@ +From 35340163fed594434a42002cc041bd29941fb985 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 22 Nov 2023 12:06:29 -0500 +Subject: [PATCH] aufs: fix v6.7 kernel build compilation + +Adapting aufs to the following upstream commits: + + commit 12cd44023651666bd44baa36a5c999698890debb + Author: Jeff Layton <jlayton@kernel.org> + Date: Fri Sep 29 09:05:52 2023 -0400 + + fs: rename inode i_atime and i_mtime fields + + Rename these two fields to discourage direct access (and to help ensure + that we mop up any leftover direct accesses). + + Signed-off-by: Jeff Layton <jlayton@kernel.org> + Signed-off-by: Christian Brauner <brauner@kernel.org> + + commit 3e15dcf77b23b8e9b9b7f3c0d4def8fe9c12c534 + Author: Amir Goldstein <amir73il@gmail.com> + Date: Fri Sep 8 16:28:59 2023 +0300 + + fs: rename __mnt_{want,drop}_write*() helpers + + Before exporting these helpers to modules, make their names more + meaningful. + + The names mnt_{get,put)_write_access*() were chosen, because they rhyme + with the inode {get,put)_write_access() helpers, which have a very close + meaning for the inode object. + + Suggested-by: Christian Brauner <brauner@kernel.org> + Link: https://lore.kernel.org/r/20230817-anfechtbar-ruhelosigkeit-8c6cca8443fc@brauner/ + Signed-off-by: Amir Goldstein <amir73il@gmail.com> + Message-Id: <20230908132900.2983519-2-amir73il@gmail.com> + Signed-off-by: Christian Brauner <brauner@kernel.org> + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/branch.c | 2 +- + fs/aufs/cpup.c | 8 ++++---- + fs/aufs/dir.c | 2 +- + fs/aufs/i_op.c | 4 ++-- + fs/aufs/vfsub.h | 2 +- + fs/namespace.c | 2 +- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c +index 2a85d744d2b5..3ecc05573cc0 100644 +--- a/fs/aufs/branch.c ++++ b/fs/aufs/branch.c +@@ -1293,7 +1293,7 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex) + if (hf->f_mode & FMODE_READ) + i_readcount_inc(h_inode); + put_write_access(h_inode); +- __mnt_drop_write(hf->f_path.mnt); ++ mnt_put_write_access(hf->f_path.mnt); + } + } + +diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c +index 8c8bd5f7b28d..3f09876a3bd5 100644 +--- a/fs/aufs/cpup.c ++++ b/fs/aufs/cpup.c +@@ -133,8 +133,8 @@ void au_dtime_store(struct au_dtime *dt, struct dentry *dentry, + dt->dt_dentry = dentry; + dt->dt_h_path = *h_path; + h_inode = d_inode(h_path->dentry); +- dt->dt_atime = h_inode->i_atime; +- dt->dt_mtime = h_inode->i_mtime; ++ dt->dt_atime = h_inode->__i_atime; ++ dt->dt_mtime = h_inode->__i_mtime; + /* smp_mb(); */ + } + +@@ -200,8 +200,8 @@ int cpup_iattr(struct dentry *dst, aufs_bindex_t bindex, struct path *h_src, + } else { + ia.ia_uid = h_isrc->i_uid; + ia.ia_gid = h_isrc->i_gid; +- ia.ia_atime = h_isrc->i_atime; +- ia.ia_mtime = h_isrc->i_mtime; ++ ia.ia_atime = h_isrc->__i_atime; ++ ia.ia_mtime = h_isrc->__i_mtime; + if (h_idst->i_mode != h_isrc->i_mode + && !S_ISLNK(h_idst->i_mode)) { + ia.ia_valid |= ATTR_MODE; +diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c +index ee900ea3264b..e986deffef5e 100644 +--- a/fs/aufs/dir.c ++++ b/fs/aufs/dir.c +@@ -145,7 +145,7 @@ static void au_do_dir_ts(void *arg) + au_hn_inode_lock_nested(hdir, AuLsc_I_PARENT); + h_dir = au_h_iptr(dir, btop); + if (h_dir->i_nlink +- && timespec64_compare(&h_dir->i_mtime, &dt.dt_mtime) < 0) { ++ && timespec64_compare(&h_dir->__i_mtime, &dt.dt_mtime) < 0) { + dt.dt_h_path = h_path; + au_dtime_revert(&dt); + } +diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c +index 993d57633393..8700b9e46b44 100644 +--- a/fs/aufs/i_op.c ++++ b/fs/aufs/i_op.c +@@ -1167,8 +1167,8 @@ static void au_refresh_iattr(struct inode *inode, struct kstat *st, + /* don't i_[ug]id_write() here */ + inode->i_uid = st->uid; + inode->i_gid = st->gid; +- inode->i_atime = st->atime; +- inode->i_mtime = st->mtime; ++ inode->__i_atime = st->atime; ++ inode->__i_mtime = st->mtime; + inode_set_ctime_to_ts( inode, st->ctime ); + + au_cpup_attr_nlink(inode, /*force*/0); +diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h +index ed218d95770d..b45603c2d651 100644 +--- a/fs/aufs/vfsub.h ++++ b/fs/aufs/vfsub.h +@@ -33,7 +33,7 @@ + + /* copied from linux/fs/internal.h */ + /* todo: BAD approach!! */ +-extern void __mnt_drop_write(struct vfsmount *); ++extern void mnt_put_write_access(struct vfsmount *); + extern struct file *alloc_empty_file(int, const struct cred *); + + /* ---------------------------------------------------------------------- */ +diff --git a/fs/namespace.c b/fs/namespace.c +index 1b942a6b72fa..e5d02ed749c4 100644 +--- a/fs/namespace.c ++++ b/fs/namespace.c +@@ -489,7 +489,7 @@ void mnt_put_write_access_file(struct file *file) + if (!(file->f_mode & FMODE_WRITER)) + mnt_put_write_access(file->f_path.mnt); + } +-EXPORT_SYMBOL_GPL(__mnt_drop_write); ++EXPORT_SYMBOL_GPL(mnt_put_write_access_file); + + void mnt_drop_write_file(struct file *file) + { +-- +2.34.1 + diff --git a/features/aufs/aufs-i_op-Add-handling-for-au_pin_hdir_set_owner-wit.patch b/features/aufs/aufs-i_op-Add-handling-for-au_pin_hdir_set_owner-wit.patch new file mode 100644 index 00000000..3cd55ace --- /dev/null +++ b/features/aufs/aufs-i_op-Add-handling-for-au_pin_hdir_set_owner-wit.patch @@ -0,0 +1,39 @@ +From 10db7ee919edbf7b6f65124e475d89864de7bb1b Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Fri, 5 Jan 2024 18:57:18 +0800 +Subject: [PATCH] aufs: i_op: Add handling for au_pin_hdir_set_owner with RT + kernel + +In RT kernel rw_semaphore uses rt_mutex whose owner should be set to the +task. Add a condition to handle both cases to avoid the following build error +for PREEMPT_RT kernel. + +fs/aufs/i_op.c: In function 'au_pin_hdir_set_owner': +fs/aufs/i_op.c:639:52: error: 'struct rw_semaphore' has no member named 'owner' +639 | atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task); + +Signed-off-by: He Zhe <zhe.he@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/i_op.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c +index 993d57633393..a1e0d0c54d23 100644 +--- a/fs/aufs/i_op.c ++++ b/fs/aufs/i_op.c +@@ -638,7 +638,11 @@ int au_pin_hdir_relock(struct au_pin *p) + + static void au_pin_hdir_set_owner(struct au_pin *p, struct task_struct *task) + { ++#if IS_ENABLED(CONFIG_PREEMPT_RT) ++ p->hdir->hi_inode->i_rwsem.rwbase.rtmutex.owner = task; ++#else + atomic_long_set(&p->hdir->hi_inode->i_rwsem.owner, (long)task); ++#endif + } + + void au_pin_hdir_acquire_nest(struct au_pin *p) +-- +2.39.2 + diff --git a/features/aufs/aufs-update-remove_page-to-remove_folio.patch b/features/aufs/aufs-update-remove_page-to-remove_folio.patch new file mode 100644 index 00000000..d874e550 --- /dev/null +++ b/features/aufs/aufs-update-remove_page-to-remove_folio.patch @@ -0,0 +1,56 @@ +From e9e335352a0815018d7db98c165d3669c3d8804f Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Tue, 23 Jan 2024 09:56:24 -0500 +Subject: [PATCH] aufs: update remove_page to remove_folio + +Commit af7628d6ec19 [fs: convert error_remove_page to +error_remove_folio] +switches remove_page to the folio equivalent. We switch +the aufs definitions to match. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/dynop.c | 2 +- + fs/aufs/file.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c +index 54fd16ecb6d3..f62b3b56291d 100644 +--- a/fs/aufs/dynop.c ++++ b/fs/aufs/dynop.c +@@ -192,7 +192,7 @@ static void dy_aop(struct au_dykey *key, const void *h_op, + DySetAop(launder_folio); + DySetAop(is_partially_uptodate); + DySetAop(is_dirty_writeback); +- DySetAop(error_remove_page); ++ DySetAop(error_remove_folio); + DySetAop(swap_activate); + DySetAop(swap_deactivate); + DySetAop(swap_rw); +diff --git a/fs/aufs/file.c b/fs/aufs/file.c +index 76ad444328db..2e3bdac4699a 100644 +--- a/fs/aufs/file.c ++++ b/fs/aufs/file.c +@@ -827,8 +827,8 @@ static bool aufs_is_partially_uptodate(struct folio *folio, size_t from, + static void aufs_is_dirty_writeback(struct folio *folio, bool *dirty, + bool *writeback) + { AuUnsupport(); } +-static int aufs_error_remove_page(struct address_space *mapping, +- struct page *page) ++static int aufs_error_remove_folio(struct address_space *mapping, ++ struct folio *folio) + { AuUnsupport(); return 0; } + static int aufs_swap_activate(struct swap_info_struct *sis, struct file *file, + sector_t *span) +@@ -857,7 +857,7 @@ const struct address_space_operations aufs_aop = { + .launder_folio = aufs_launder_folio, + .is_partially_uptodate = aufs_is_partially_uptodate, + .is_dirty_writeback = aufs_is_dirty_writeback, +- .error_remove_page = aufs_error_remove_page, ++ .error_remove_folio = aufs_error_remove_folio, + .swap_activate = aufs_swap_activate, + .swap_deactivate = aufs_swap_deactivate, + .swap_rw = aufs_swap_rw +-- +2.39.2 + diff --git a/features/aufs/aufs.scc b/features/aufs/aufs.scc index 729882df..ebb980f4 100644 --- a/features/aufs/aufs.scc +++ b/features/aufs/aufs.scc @@ -1,7 +1,16 @@ # SPDX-License-Identifier: MIT # -patch aufs5-aufs-base.patch -patch aufs5-aufs-mmap.patch -patch aufs5-aufs-standalone.patch -patch aufs5-aufs-kbuild.patch -patch aufs5-core.patch + +patch aufs6-kbuild.patch +patch aufs6-base.patch +patch aufs6-mmap.patch +patch aufs6-standalone.patch +patch aufs6-core.patch +patch aufs6-adapt-to-v6.6.patch +patch aufs6-fix-magic.mk-include-path.patch +patch aufs6-adapt-to-v6.6-i_op-ctime-changes.patch +patch aufs-fix-v6.7-kernel-build-compilation.patch +patch aufs-i_op-Add-handling-for-au_pin_hdir_set_owner-wit.patch +patch aufs-update-remove_page-to-remove_folio.patch +patch aufs6-correct-do_splice_from-prototype.patch +patch aufs-adjust-for-v6.9.patch diff --git a/features/aufs/aufs6-adapt-to-v6.6-i_op-ctime-changes.patch b/features/aufs/aufs6-adapt-to-v6.6-i_op-ctime-changes.patch new file mode 100644 index 00000000..cb727220 --- /dev/null +++ b/features/aufs/aufs6-adapt-to-v6.6-i_op-ctime-changes.patch @@ -0,0 +1,146 @@ +From 8eeb547a388fee17c1c168bbb33d95e0c19e2cb4 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 21 Sep 2023 22:18:30 -0400 +Subject: [PATCH 8/8] aufs6: adapt to v6.6 i_op->ctime changes + +The following commits in 6.6+ change the way i_nodes and ctime are +handled. We adapt the code to match: + + 541d4c798a598854fcce7326d947cbcbd35701d6 [fs: drop the timespec64 arg from generic_update_time] + 3e3271549670783be20e233a2b78a87a0b04c715 [vfs: get rid of old '->iterate' directory operation] + 0d72b92883c651a11059d93335f33d65c6eb653b [fs: pass the request_mask to generic_fillattr] + 913e99287b98fd051ac1976140a2764a8ef9dfbf [fs: drop the timespec64 argument from update_time] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/i_op.c | 9 ++++----- + fs/aufs/i_op_add.c | 2 +- + fs/aufs/i_op_del.c | 9 ++++++--- + fs/aufs/i_op_ren.c | 6 ++++-- + fs/aufs/vfsub.h | 5 ++--- + 5 files changed, 17 insertions(+), 14 deletions(-) + +diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c +index 141620c2e0bd..993d57633393 100644 +--- a/fs/aufs/i_op.c ++++ b/fs/aufs/i_op.c +@@ -1169,7 +1169,7 @@ static void au_refresh_iattr(struct inode *inode, struct kstat *st, + inode->i_gid = st->gid; + inode->i_atime = st->atime; + inode->i_mtime = st->mtime; +- inode->i_ctime = st->ctime; ++ inode_set_ctime_to_ts( inode, st->ctime ); + + au_cpup_attr_nlink(inode, /*force*/0); + if (S_ISDIR(inode->i_mode)) { +@@ -1306,7 +1306,7 @@ static int aufs_getattr(struct mnt_idmap *idmap, const struct path *path, + goto out_di; + + out_fill: +- generic_fillattr(idmap, inode, st); ++ generic_fillattr(idmap, request, inode, st); + out_di: + di_read_unlock(dentry, AuLock_IR); + out_si: +@@ -1388,8 +1388,7 @@ static int au_is_special(struct inode *inode) + return (inode->i_mode & (S_IFBLK | S_IFCHR | S_IFIFO | S_IFSOCK)); + } + +-static int aufs_update_time(struct inode *inode, struct timespec64 *ts, +- int flags) ++static int aufs_update_time(struct inode *inode, int flags) + { + int err; + aufs_bindex_t bindex; +@@ -1413,7 +1412,7 @@ static int aufs_update_time(struct inode *inode, struct timespec64 *ts, + h_mnt = au_sbr_mnt(sb, bindex); + err = vfsub_mnt_want_write(h_mnt); + if (!err) { +- err = vfsub_update_time(h_inode, ts, flags); ++ err = vfsub_update_time(h_inode, flags); + vfsub_mnt_drop_write(h_mnt); + } + } else if (au_is_special(h_inode)) { +diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c +index 2adf97d4488d..1ce4d45c8f7b 100644 +--- a/fs/aufs/i_op_add.c ++++ b/fs/aufs/i_op_add.c +@@ -824,7 +824,7 @@ int aufs_link(struct dentry *src_dentry, struct inode *dir, + au_dir_ts(dir, a->bdst); + inode_inc_iversion(dir); + inc_nlink(inode); +- inode->i_ctime = dir->i_ctime; ++ inode_set_ctime_to_ts( inode, inode_get_ctime(dir)); + d_instantiate(dentry, au_igrab(inode)); + if (d_unhashed(a->h_path.dentry)) + /* some filesystem calls d_drop() */ +diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c +index d85f47cef29f..fbbda9626f6f 100644 +--- a/fs/aufs/i_op_del.c ++++ b/fs/aufs/i_op_del.c +@@ -277,7 +277,8 @@ static void epilog(struct inode *dir, struct dentry *dentry, + + inode = d_inode(dentry); + d_drop(dentry); +- inode->i_ctime = dir->i_ctime; ++ //inode->i_ctime = dir->i_ctime; ++ inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); + + au_dir_ts(dir, bindex); + inode_inc_iversion(dir); +@@ -379,10 +380,12 @@ int aufs_unlink(struct inode *dir, struct dentry *dentry) + if (bindex == btop) { + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); + /*ignore*/ +- inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ //inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ inode_set_ctime_to_ts(inode, inode_get_ctime(d_inode(a->h_path.dentry)) ); + } else + /* todo: this timestamp may be reverted later */ +- inode->i_ctime = h_dir->i_ctime; ++ //inode->i_ctime = h_dir->i_ctime; ++ inode_set_ctime_to_ts(inode,inode_get_ctime(h_dir) ); + goto out_unpin; /* success */ + } + +diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c +index ab69a6ac9a42..f3f9d9efe6fa 100644 +--- a/fs/aufs/i_op_ren.c ++++ b/fs/aufs/i_op_ren.c +@@ -443,12 +443,14 @@ static int do_rename(struct au_ren_args *a) + AuDebugOn(au_dbtop(a->dst_dentry) != a->btgt); + a->h_path.dentry = au_h_dptr(a->dst_dentry, a->btgt); + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); /*ignore*/ +- a->dst_inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ //a->dst_inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ inode_set_ctime_to_ts( a->dst_inode, inode_get_ctime(d_inode(a->h_path.dentry)) ); + } + AuDebugOn(au_dbtop(a->src_dentry) != a->btgt); + a->h_path.dentry = au_h_dptr(a->src_dentry, a->btgt); + vfsub_update_h_iattr(&a->h_path, /*did*/NULL); /*ignore*/ +- a->src_inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ //a->src_inode->i_ctime = d_inode(a->h_path.dentry)->i_ctime; ++ inode_set_ctime_to_ts( a->src_inode, inode_get_ctime(d_inode(a->h_path.dentry)) ); + + if (!a->exchange) { + /* remove whiteout for dentry */ +diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h +index 928c463620c1..ed218d95770d 100644 +--- a/fs/aufs/vfsub.h ++++ b/fs/aufs/vfsub.h +@@ -240,10 +240,9 @@ static inline void vfsub_touch_atime(struct vfsmount *h_mnt, + } + #endif + +-static inline int vfsub_update_time(struct inode *h_inode, +- struct timespec64 *ts, int flags) ++static inline int vfsub_update_time(struct inode *h_inode, int flags) + { +- return inode_update_time(h_inode, ts, flags); ++ return inode_update_time(h_inode, flags); + /* no vfsub_update_h_iattr() since we don't have struct path */ + } + +-- +2.34.1 + diff --git a/features/aufs/aufs6-adapt-to-v6.6.patch b/features/aufs/aufs6-adapt-to-v6.6.patch new file mode 100644 index 00000000..e91fec7a --- /dev/null +++ b/features/aufs/aufs6-adapt-to-v6.6.patch @@ -0,0 +1,40 @@ +From 5d75cb88038136d82ae6bb62da3fa8f70785e662 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 21 Sep 2023 18:20:40 -0400 +Subject: [PATCH 6/8] aufs6: adapt to v6.6 + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/fcntl.c | 2 +- + mm/mmap.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/fcntl.c b/fs/fcntl.c +index fdd334fc02fb..ec0562996478 100644 +--- a/fs/fcntl.c ++++ b/fs/fcntl.c +@@ -34,7 +34,7 @@ + + #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME) + +-int setfl(int fd, struct file *filp, unsigned int arg) ++int setfl(int fd, struct file *filp, long unsigned int arg) + { + struct inode * inode = file_inode(filp); + int error = 0; +diff --git a/mm/mmap.c b/mm/mmap.c +index 0a0f3d5f558d..0bb0c5a0ad0e 100644 +--- a/mm/mmap.c ++++ b/mm/mmap.c +@@ -3004,7 +3004,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, + file = vma->vm_file; + prfile = vma->vm_prfile; + ret = do_mmap(vma->vm_file, start, size, +- prot, flags, pgoff, &populate, NULL); ++ prot, flags, 0, pgoff, &populate, NULL); + if (!IS_ERR_VALUE(ret) && file && prfile) { + struct vm_area_struct *new_vma; + +-- +2.34.1 + diff --git a/features/aufs/aufs5-aufs-base.patch b/features/aufs/aufs6-base.patch index 63652640..186a7cee 100644 --- a/features/aufs/aufs5-aufs-base.patch +++ b/features/aufs/aufs6-base.patch @@ -1,7 +1,7 @@ -From 4e2a775c46fd1a5b7b56fcbcb69c83a7284ae27f Mon Sep 17 00:00:00 2001 +From 884f46eed2730a238e0bf9c9a885f777a612e3ab Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Fri, 19 Mar 2021 12:32:07 -0400 -Subject: [PATCH 1/5] aufs5: aufs-base +Date: Thu, 21 Sep 2023 17:48:58 -0400 +Subject: [PATCH] aufs6: base Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- @@ -9,24 +9,22 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> drivers/block/loop.c | 18 ++++++++++++++++++ fs/dcache.c | 2 +- fs/fcntl.c | 4 +++- - fs/inode.c | 2 +- fs/namespace.c | 6 ++++++ - fs/splice.c | 10 +++++----- - fs/sync.c | 2 +- - include/linux/fs.h | 4 ++++ + fs/splice.c | 2 +- + include/linux/fs.h | 2 ++ include/linux/lockdep.h | 2 ++ include/linux/mnt_namespace.h | 3 +++ include/linux/splice.h | 6 ++++++ kernel/locking/lockdep.c | 3 ++- - 13 files changed, 65 insertions(+), 10 deletions(-) + 11 files changed, 57 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS -index aa84121c5611..abee7a4c47b5 100644 +index 8d1052fa6a69..39ec86cca0ff 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -2983,6 +2983,19 @@ F: include/linux/audit.h - F: include/uapi/linux/audit.h - F: kernel/audit* +@@ -3365,6 +3365,19 @@ F: kernel/audit* + F: lib/*audit.c + K: \baudit_[a-z_0-9]\+\b +AUFS (advanced multi layered unification filesystem) FILESYSTEM +M: "J. R. Okajima" <hooanon05g@gmail.com> @@ -41,15 +39,15 @@ index aa84121c5611..abee7a4c47b5 100644 +F: fs/aufs/ +F: include/uapi/linux/aufs_type.h + - AUXILIARY DISPLAY DRIVERS - M: Miguel Ojeda <ojeda@kernel.org> - S: Maintained + AUXILIARY BUS DRIVER + M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + R: Dave Ertman <david.m.ertman@intel.com> diff --git a/drivers/block/loop.c b/drivers/block/loop.c -index a370cde3ddd4..01ca256575fb 100644 +index f8145499da38..333b3915fe86 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c -@@ -761,6 +761,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, - return error; +@@ -641,6 +641,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev, + goto done; } +/* @@ -74,10 +72,10 @@ index a370cde3ddd4..01ca256575fb 100644 static ssize_t loop_attr_show(struct device *dev, char *page, diff --git a/fs/dcache.c b/fs/dcache.c -index 7d24ff7eb206..3caa7ab4b84f 100644 +index b813528fb147..78e322b59b8d 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -1318,7 +1318,7 @@ enum d_walk_ret { +@@ -1219,7 +1219,7 @@ enum d_walk_ret { * * The @enter() callbacks are called with d_lock held. */ @@ -85,21 +83,21 @@ index 7d24ff7eb206..3caa7ab4b84f 100644 +void d_walk(struct dentry *parent, void *data, enum d_walk_ret (*enter)(void *, struct dentry *)) { - struct dentry *this_parent; + struct dentry *this_parent, *dentry; diff --git a/fs/fcntl.c b/fs/fcntl.c -index dfc72f15be7f..d8a12eb63961 100644 +index c80a6acad742..d64817808e40 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c -@@ -33,7 +33,7 @@ +@@ -34,7 +34,7 @@ #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME) --static int setfl(int fd, struct file * filp, unsigned long arg) -+int setfl(int fd, struct file *filp, unsigned long arg) +-static int setfl(int fd, struct file * filp, unsigned int arg) ++int setfl(int fd, struct file *filp, unsigned int arg) { struct inode * inode = file_inode(filp); int error = 0; -@@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg) +@@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned int arg) if (filp->f_op->check_flags) error = filp->f_op->check_flags(arg); @@ -108,24 +106,11 @@ index dfc72f15be7f..d8a12eb63961 100644 if (error) return error; -diff --git a/fs/inode.c b/fs/inode.c -index a047ab306f9a..ba1df0895b69 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -1772,7 +1772,7 @@ EXPORT_SYMBOL(generic_update_time); - * This does the actual work of updating an inodes time or version. Must have - * had called mnt_want_write() before calling this. - */ --static int update_time(struct inode *inode, struct timespec64 *time, int flags) -+int update_time(struct inode *inode, struct timespec64 *time, int flags) - { - if (inode->i_op->update_time) - return inode->i_op->update_time(inode, time, flags); diff --git a/fs/namespace.c b/fs/namespace.c -index 56bb5a5fdc0d..540679d7e043 100644 +index 437f60e96d40..4c5eb92d2bef 100644 --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -807,6 +807,12 @@ static inline int check_mnt(struct mount *mnt) +@@ -860,6 +860,12 @@ static inline int check_mnt(struct mount *mnt) return mnt->mnt_ns == current->nsproxy->mnt_ns; } @@ -139,87 +124,43 @@ index 56bb5a5fdc0d..540679d7e043 100644 * vfsmount lock must be held for write */ diff --git a/fs/splice.c b/fs/splice.c -index 5dbce4dcc1a7..3e6ba363b777 100644 +index 218e24b1ac40..7210ddc5aa81 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -759,8 +759,8 @@ static int warn_unsupported(struct file *file, const char *op) +@@ -933,7 +933,7 @@ static int warn_unsupported(struct file *file, const char *op) /* * Attempt to initiate a splice from pipe to file. */ --static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, -- loff_t *ppos, size_t len, unsigned int flags) -+long do_splice_from(struct pipe_inode_info *pipe, struct file *out, -+ loff_t *ppos, size_t len, unsigned int flags) +-static ssize_t do_splice_from(struct pipe_inode_info *pipe, struct file *out, ++ssize_t do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags) { if (unlikely(!out->f_op->splice_write)) - return warn_unsupported(out, "write"); -@@ -770,9 +770,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, - /* - * Attempt to initiate a splice from a file to a pipe. - */ --static long do_splice_to(struct file *in, loff_t *ppos, -- struct pipe_inode_info *pipe, size_t len, -- unsigned int flags) -+long do_splice_to(struct file *in, loff_t *ppos, -+ struct pipe_inode_info *pipe, size_t len, -+ unsigned int flags) - { - unsigned int p_space; - int ret; -diff --git a/fs/sync.c b/fs/sync.c -index 1373a610dc78..b7b5a0a0df6f 100644 ---- a/fs/sync.c -+++ b/fs/sync.c -@@ -28,7 +28,7 @@ - * wait == 1 case since in that case write_inode() functions do - * sync_dirty_buffer() and thus effectively write one block at a time. - */ --static int __sync_filesystem(struct super_block *sb, int wait) -+int __sync_filesystem(struct super_block *sb, int wait) - { - if (wait) - sync_inodes_sb(sb); diff --git a/include/linux/fs.h b/include/linux/fs.h -index ec8f3ddf4a6a..4fa4b24535fd 100644 +index ed5966a70495..2f2919192af6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -1332,6 +1332,7 @@ extern void fasync_free(struct fasync_struct *); +@@ -1104,6 +1104,7 @@ extern void fasync_free(struct fasync_struct *); /* can be called from interrupts */ extern void kill_fasync(struct fasync_struct **, int, int); +extern int setfl(int fd, struct file *filp, unsigned long arg); extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force); - extern int f_setown(struct file *filp, unsigned long arg, int force); + extern int f_setown(struct file *filp, int who, int force); extern void f_delown(struct file *filp); -@@ -1909,6 +1910,7 @@ struct file_operations { - ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); +@@ -2001,6 +2002,7 @@ struct file_operations { + int (*lock) (struct file *, int, struct file_lock *); unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); + int (*setfl)(struct file *, unsigned long); int (*flock) (struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); -@@ -2428,6 +2430,7 @@ extern int current_umask(void); - extern void ihold(struct inode * inode); - extern void iput(struct inode *); - extern int generic_update_time(struct inode *, struct timespec64 *, int); -+extern int update_time(struct inode *, struct timespec64 *, int); - - /* /sys/fs */ - extern struct kobject *fs_kobj; -@@ -2668,6 +2671,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb) - } - - void emergency_thaw_all(void); -+extern int __sync_filesystem(struct super_block *, int); - extern int sync_filesystem(struct super_block *); - extern const struct file_operations def_blk_fops; - extern const struct file_operations def_chr_fops; diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h -index 7b7ebf2e28ec..20c46305e057 100644 +index 08b0d1d9d78b..009f69c4e09d 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h -@@ -248,6 +248,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock, +@@ -192,6 +192,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock, return lock->key == key; } @@ -249,10 +190,10 @@ index 8f882f5881e8..6b9808f09843 100644 extern const struct file_operations proc_mountinfo_operations; extern const struct file_operations proc_mountstats_operations; diff --git a/include/linux/splice.h b/include/linux/splice.h -index a55179fd60fc..8e21c53cf883 100644 +index 9dec4861d09f..8024911403e9 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h -@@ -93,4 +93,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); +@@ -108,4 +108,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); extern const struct pipe_buf_operations page_cache_pipe_buf_ops; extern const struct pipe_buf_operations default_pipe_buf_ops; @@ -264,19 +205,19 @@ index a55179fd60fc..8e21c53cf883 100644 + unsigned int flags); #endif diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index c6d0c1dc6253..0f557138af3e 100644 +index 151bd3de5936..2223ee909c10 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -188,7 +188,7 @@ static +@@ -218,7 +218,7 @@ unsigned long max_lock_class_idx; struct lock_class lock_classes[MAX_LOCKDEP_KEYS]; - static DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS); + DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS); -static inline struct lock_class *hlock_class(struct held_lock *hlock) +inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock) { unsigned int class_idx = hlock->class_idx; -@@ -209,6 +209,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock) +@@ -239,6 +239,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock) */ return lock_classes + class_idx; } @@ -285,5 +226,5 @@ index c6d0c1dc6253..0f557138af3e 100644 #ifdef CONFIG_LOCK_STAT static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats); -- -2.19.1 +2.39.2 diff --git a/features/aufs/aufs5-core.patch b/features/aufs/aufs6-core.patch index eaad8991..d9585572 100644 --- a/features/aufs/aufs5-core.patch +++ b/features/aufs/aufs6-core.patch @@ -1,24 +1,24 @@ -From 11a3b443e14a192a3ef60994a7d85f27906b3686 Mon Sep 17 00:00:00 2001 +From 88604e3862245a999b3cdc6d96e888a3edf0b0c7 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Fri, 19 Mar 2021 12:34:34 -0400 -Subject: [PATCH 5/5] aufs5: core +Date: Thu, 21 Sep 2023 17:51:24 -0400 +Subject: [PATCH 5/8] aufs6: core Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- Documentation/ABI/testing/debugfs-aufs | 55 + Documentation/ABI/testing/sysfs-aufs | 31 + - Documentation/filesystems/aufs/README | 401 ++++ + Documentation/filesystems/aufs/README | 409 ++++ .../filesystems/aufs/design/01intro.txt | 171 ++ .../filesystems/aufs/design/02struct.txt | 258 +++ .../filesystems/aufs/design/03atomic_open.txt | 85 + .../filesystems/aufs/design/03lookup.txt | 113 + .../filesystems/aufs/design/04branch.txt | 74 + .../filesystems/aufs/design/05wbr_policy.txt | 64 + - .../filesystems/aufs/design/06dirren.dot | 31 + + .../filesystems/aufs/design/06dirren.dot | 44 + .../filesystems/aufs/design/06dirren.txt | 102 + - .../filesystems/aufs/design/06fhsm.txt | 120 + + .../filesystems/aufs/design/06fhsm.txt | 118 + .../filesystems/aufs/design/06mmap.txt | 72 + - .../filesystems/aufs/design/06xattr.txt | 96 + + .../filesystems/aufs/design/06xattr.txt | 94 + .../filesystems/aufs/design/07export.txt | 58 + .../filesystems/aufs/design/08shwh.txt | 52 + .../filesystems/aufs/design/10dynop.txt | 47 + @@ -28,76 +28,77 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> fs/aufs/branch.c | 1427 ++++++++++++ fs/aufs/branch.h | 375 ++++ fs/aufs/conf.mk | 40 + - fs/aufs/cpup.c | 1457 +++++++++++++ + fs/aufs/cpup.c | 1459 +++++++++++++ fs/aufs/cpup.h | 100 + fs/aufs/dbgaufs.c | 526 +++++ fs/aufs/dbgaufs.h | 53 + fs/aufs/dcsub.c | 225 ++ fs/aufs/dcsub.h | 137 ++ - fs/aufs/debug.c | 441 ++++ + fs/aufs/debug.c | 446 ++++ fs/aufs/debug.h | 226 ++ - fs/aufs/dentry.c | 1160 ++++++++++ - fs/aufs/dentry.h | 269 +++ - fs/aufs/dinfo.c | 554 +++++ + fs/aufs/dentry.c | 1168 ++++++++++ + fs/aufs/dentry.h | 270 +++ + fs/aufs/dinfo.c | 555 +++++ fs/aufs/dir.c | 765 +++++++ fs/aufs/dir.h | 134 ++ - fs/aufs/dirren.c | 1316 +++++++++++ + fs/aufs/dirren.c | 1315 +++++++++++ fs/aufs/dirren.h | 140 ++ - fs/aufs/dynop.c | 368 ++++ + fs/aufs/dynop.c | 366 ++++ fs/aufs/dynop.h | 77 + - fs/aufs/export.c | 837 +++++++ - fs/aufs/f_op.c | 762 +++++++ - fs/aufs/fhsm.c | 427 ++++ - fs/aufs/file.c | 863 ++++++++ + fs/aufs/export.c | 830 +++++++ + fs/aufs/f_op.c | 771 +++++++ + fs/aufs/fhsm.c | 426 ++++ + fs/aufs/file.c | 865 ++++++++ fs/aufs/file.h | 342 +++ fs/aufs/finfo.c | 149 ++ + fs/aufs/fsctx.c | 1242 +++++++++++ fs/aufs/fstype.h | 401 ++++ fs/aufs/hbl.h | 65 + - fs/aufs/hfsnotify.c | 288 +++ + fs/aufs/hfsnotify.c | 290 +++ fs/aufs/hfsplus.c | 60 + fs/aufs/hnotify.c | 715 ++++++ - fs/aufs/i_op.c | 1513 +++++++++++++ - fs/aufs/i_op_add.c | 941 ++++++++ - fs/aufs/i_op_del.c | 515 +++++ - fs/aufs/i_op_ren.c | 1251 +++++++++++ + fs/aufs/i_op.c | 1517 +++++++++++++ + fs/aufs/i_op_add.c | 972 +++++++++ + fs/aufs/i_op_del.c | 522 +++++ + fs/aufs/i_op_ren.c | 1257 +++++++++++ fs/aufs/iinfo.c | 286 +++ fs/aufs/inode.c | 531 +++++ - fs/aufs/inode.h | 705 ++++++ + fs/aufs/inode.h | 707 ++++++ fs/aufs/ioctl.c | 220 ++ fs/aufs/lcnt.h | 186 ++ fs/aufs/loop.c | 148 ++ fs/aufs/loop.h | 55 + fs/aufs/magic.mk | 31 + fs/aufs/module.c | 273 +++ - fs/aufs/module.h | 166 ++ + fs/aufs/module.h | 180 ++ fs/aufs/mvdown.c | 706 ++++++ - fs/aufs/opts.c | 1880 ++++++++++++++++ - fs/aufs/opts.h | 225 ++ + fs/aufs/opts.c | 1032 +++++++++ + fs/aufs/opts.h | 263 +++ fs/aufs/plink.c | 516 +++++ fs/aufs/poll.c | 51 + - fs/aufs/posix_acl.c | 106 + + fs/aufs/posix_acl.c | 108 + fs/aufs/procfs.c | 170 ++ fs/aufs/rdu.c | 384 ++++ fs/aufs/rwsem.h | 85 + - fs/aufs/sbinfo.c | 314 +++ - fs/aufs/super.c | 1050 +++++++++ - fs/aufs/super.h | 587 +++++ - fs/aufs/sysaufs.c | 93 + + fs/aufs/sbinfo.c | 316 +++ + fs/aufs/super.c | 871 ++++++++ + fs/aufs/super.h | 592 +++++ + fs/aufs/sysaufs.c | 94 + fs/aufs/sysaufs.h | 102 + fs/aufs/sysfs.c | 374 ++++ fs/aufs/sysrq.c | 149 ++ fs/aufs/vdir.c | 896 ++++++++ - fs/aufs/vfsub.c | 916 ++++++++ - fs/aufs/vfsub.h | 358 +++ + fs/aufs/vfsub.c | 918 ++++++++ + fs/aufs/vfsub.h | 404 ++++ fs/aufs/wbr_policy.c | 830 +++++++ - fs/aufs/whout.c | 1070 +++++++++ + fs/aufs/whout.c | 1072 +++++++++ fs/aufs/whout.h | 87 + fs/aufs/wkq.c | 372 ++++ fs/aufs/wkq.h | 89 + - fs/aufs/xattr.c | 368 ++++ - fs/aufs/xino.c | 1925 +++++++++++++++++ + fs/aufs/xattr.c | 360 +++ + fs/aufs/xino.c | 1926 +++++++++++++++++ include/uapi/linux/aufs_type.h | 452 ++++ - 92 files changed, 37812 insertions(+) + 93 files changed, 38218 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-aufs create mode 100644 Documentation/ABI/testing/sysfs-aufs create mode 100644 Documentation/filesystems/aufs/README @@ -144,6 +145,7 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> create mode 100644 fs/aufs/file.c create mode 100644 fs/aufs/file.h create mode 100644 fs/aufs/finfo.c + create mode 100644 fs/aufs/fsctx.c create mode 100644 fs/aufs/fstype.h create mode 100644 fs/aufs/hbl.h create mode 100644 fs/aufs/hfsnotify.c @@ -193,7 +195,7 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs new file mode 100644 -index 000000000000..4a6694194ba6 +index 000000000000..45b739879d76 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-aufs @@ -0,0 +1,55 @@ @@ -227,7 +229,7 @@ index 000000000000..4a6694194ba6 + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. + -+What: /debug/aufs/si_<id>/xi0, xi1 ... xiN and xiN-N ++What: /debug/aufs/si_<id>/xi<branch-index> +Date: March 2009 +Contact: J. R. Okajima <hooanon05g@gmail.com> +Description: @@ -254,7 +256,7 @@ index 000000000000..4a6694194ba6 + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/ABI/testing/sysfs-aufs b/Documentation/ABI/testing/sysfs-aufs new file mode 100644 -index 000000000000..82f9518495ea +index 000000000000..48500c0569e6 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-aufs @@ -0,0 +1,31 @@ @@ -266,14 +268,14 @@ index 000000000000..82f9518495ea + per aufs mount, where <id> is a unique id generated + internally. + -+What: /sys/fs/aufs/si_<id>/br0, br1 ... brN ++What: /sys/fs/aufs/si_<id>/br<idx> +Date: March 2009 +Contact: J. R. Okajima <hooanon05g@gmail.com> +Description: + It shows the abolute path of a member directory (which + is called branch) in aufs, and its permission. + -+What: /sys/fs/aufs/si_<id>/brid0, brid1 ... bridN ++What: /sys/fs/aufs/si_<id>/brid<idx> +Date: July 2013 +Contact: J. R. Okajima <hooanon05g@gmail.com> +Description: @@ -291,12 +293,12 @@ index 000000000000..82f9518495ea + will be empty. About XINO files, see the aufs manual. diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README new file mode 100644 -index 000000000000..3e655d357134 +index 000000000000..04a4d069bb52 --- /dev/null +++ b/Documentation/filesystems/aufs/README -@@ -0,0 +1,401 @@ +@@ -0,0 +1,409 @@ + -+Aufs5 -- advanced multi layered unification filesystem version 5.x ++Aufs6 -- advanced multi layered unification filesystem version 6.x +http://aufs.sf.net +Junjiro R. Okajima + @@ -312,13 +314,19 @@ index 000000000000..3e655d357134 +Unionfs was being developed by Professor Erez Zadok at Stony Brook +University and his team. + -+Aufs5 supports linux-v5.0 and later, If you want older kernel version -+support, ++Aufs6 supports linux-v6.0 and later, try aufs6.0 branch in ++aufs-linux.git or aufs-standalone.git. ++If you want older kernel version support, ++- for linux-v5.x series, try aufs-linux.git or aufs-standalone.git +- for linux-v4.x series, try aufs4-linux.git or aufs4-standalone.git +- for linux-v3.x series, try aufs3-linux.git or aufs3-standalone.git +- for linux-v2.6.16 and later, try aufs2-2.6.git, aufs2-standalone.git + or aufs1 from CVS on SourceForge. + ++Note: the name of aufs5-linux.git and aufs5-standalone.git on github ++ were changed. Now they are aufs-linux.git and ++ aufs-standalone.git and they contain aufs5 and later branches. ++ +Note: it becomes clear that "Aufs was rejected. Let's give it up." + According to Christoph Hellwig, linux rejects all union-type + filesystems but UnionMount. @@ -377,7 +385,7 @@ index 000000000000..3e655d357134 +- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX. +- and more... + -+Currently these features are dropped temporary from aufs5. ++Currently these features are dropped temporary from aufs6. +See design/08plan.txt in detail. +- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs + (robr) @@ -395,64 +403,63 @@ index 000000000000..3e655d357134 + +2. Download +---------------------------------------- -+There are three GIT trees for aufs5, aufs5-linux.git, -+aufs5-standalone.git, and aufs-util.git. Note that there is no "5" in -+"aufs-util.git." -+While the aufs-util is always necessary, you need either of aufs5-linux -+or aufs5-standalone. ++There are three GIT trees for aufs6, aufs-linux.git, ++aufs-standalone.git, and aufs-util.git. ++While the aufs-util is always necessary, you need either of aufs-linux ++or aufs-standalone. + -+The aufs5-linux tree includes the whole linux mainline GIT tree, ++The aufs-linux tree includes the whole linux mainline GIT tree, +git://git.kernel.org/.../torvalds/linux.git. +And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot -+build aufs5 as an external kernel module. ++build aufs6 as an external kernel module. +Several extra patches are not included in this tree. Only -+aufs5-standalone tree contains them. They are described in the later ++aufs-standalone tree contains them. They are described in the later +section "Configuration and Compilation." + -+On the other hand, the aufs5-standalone tree has only aufs source files ++On the other hand, the aufs-standalone tree has only aufs source files +and necessary patches, and you can select CONFIG_AUFS_FS=m. +But you need to apply all aufs patches manually. + -+You will find GIT branches whose name is in form of "aufs5.x" where "x" -+represents the linux kernel version, "linux-5.x". For instance, -+"aufs5.0" is for linux-5.0. For latest "linux-5.x-rcN", use -+"aufs5.x-rcN" branch. ++You will find GIT branches whose name is in form of "aufs6.x" where "x" ++represents the linux kernel version, "linux-6.x". For instance, ++"aufs6.0" is for linux-6.0. For latest "linux-6.x-rcN", use ++"aufs6.x-rcN" branch. + -+o aufs5-linux tree ++o aufs-linux tree +$ git clone --reference /your/linux/git/tree \ -+ git://github.com/sfjro/aufs5-linux.git aufs5-linux.git ++ git://github.com/sfjro/aufs-linux.git aufs-linux.git +- if you don't have linux GIT tree, then remove "--reference ..." -+$ cd aufs5-linux.git -+$ git checkout origin/aufs5.0 ++$ cd aufs-linux.git ++$ git checkout origin/aufs6.0 + +Or You may want to directly git-pull aufs into your linux GIT tree, and +leave the patch-work to GIT. +$ cd /your/linux/git/tree -+$ git remote add aufs5 git://github.com/sfjro/aufs5-linux.git -+$ git fetch aufs5 -+$ git checkout -b my5.0 v5.0 ++$ git remote add aufs git://github.com/sfjro/aufs-linux.git ++$ git fetch aufs ++$ git checkout -b my6.0 v6.0 +$ (add your local change...) -+$ git pull aufs5 aufs5.0 -+- now you have v5.0 + your_changes + aufs5.0 in you my5.0 branch. ++$ git pull aufs aufs6.0 ++- now you have v6.0 + your_changes + aufs6.0 in you my6.0 branch. +- you may need to solve some conflicts between your_changes and -+ aufs5.0. in this case, git-rerere is recommended so that you can -+ solve the similar conflicts automatically when you upgrade to 5.1 or ++ aufs6.0. in this case, git-rerere is recommended so that you can ++ solve the similar conflicts automatically when you upgrade to 6.1 or + later in the future. + -+o aufs5-standalone tree -+$ git clone git://github.com/sfjro/aufs5-standalone.git aufs5-standalone.git -+$ cd aufs5-standalone.git -+$ git checkout origin/aufs5.0 ++o aufs-standalone tree ++$ git clone git://github.com/sfjro/aufs-standalone.git aufs-standalone.git ++$ cd aufs-standalone.git ++$ git checkout origin/aufs6.0 + +o aufs-util tree +$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git +- note that the public aufs-util.git is on SourceForge instead of + GitHUB. +$ cd aufs-util.git -+$ git checkout origin/aufs5.0 ++$ git checkout origin/aufs6.0 + -+Note: The 5.x-rcN branch is to be used with `rc' kernel versions ONLY. -+The minor version number, 'x' in '5.x', of aufs may not always ++Note: The 6.x-rcN branch is to be used with `rc' kernel versions ONLY. ++The minor version number, 'x' in '6.x', of aufs may not always +follow the minor version number of the kernel. +Because changes in the kernel that cause the use of a new +minor version number do not always require changes to aufs-util. @@ -464,8 +471,8 @@ index 000000000000..3e655d357134 +nearest lower number. + +For (an unreleased) example: -+If you are using "linux-5.10" and the "aufs5.10" branch -+does not exist in aufs-util repository, then "aufs5.9", "aufs5.8" ++If you are using "linux-6.10" and the "aufs6.10" branch ++does not exist in aufs-util repository, then "aufs6.9", "aufs6.8" +or something numerically smaller is the branch for your kernel. + +Also you can view all branches by @@ -476,19 +483,31 @@ index 000000000000..3e655d357134 +---------------------------------------- +Make sure you have git-checkout'ed the correct branch. + -+For aufs5-linux tree, ++For aufs-linux tree, +- enable CONFIG_AUFS_FS. +- set other aufs configurations if necessary. -+ -+For aufs5-standalone tree, ++- for aufs5.13 and later ++ Because aufs is not only an ordinary filesystem (callee of VFS), but ++ also a caller of VFS functions for branch filesystems, subclassing of ++ the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging ++ feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will ++ need to customize some LOCKDEP numbers. Here are what I use on my ++ test environment. ++ CONFIG_LOCKDEP_BITS=21 ++ CONFIG_LOCKDEP_CHAINS_BITS=21 ++ CONFIG_LOCKDEP_STACK_TRACE_BITS=24 ++ Also you will need to expand some constant values in LOCKDEP. Refer ++ to lockdep-debug.patch in aufs-standalone.git. ++ ++For aufs-standalone tree, +There are several ways to build. + +1. -+- apply ./aufs5-kbuild.patch to your kernel source files. -+- apply ./aufs5-base.patch too. -+- apply ./aufs5-mmap.patch too. -+- apply ./aufs5-standalone.patch too, if you have a plan to set -+ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs5-standalone.patch. ++- apply ./aufs6-kbuild.patch to your kernel source files. ++- apply ./aufs6-base.patch too. ++- apply ./aufs6-mmap.patch too. ++- apply ./aufs6-standalone.patch too, if you have a plan to set ++ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs-standalone.patch. +- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your + kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild. +- enable CONFIG_AUFS_FS, you can select either @@ -502,9 +521,9 @@ index 000000000000..3e655d357134 + +2. +- module only (CONFIG_AUFS_FS=m). -+- apply ./aufs5-base.patch to your kernel source files. -+- apply ./aufs5-mmap.patch too. -+- apply ./aufs5-standalone.patch too. ++- apply ./aufs6-base.patch to your kernel source files. ++- apply ./aufs6-mmap.patch too. ++- apply ./aufs6-standalone.patch too. +- build your kernel, don't forget "make headers_install", and reboot. +- edit ./config.mk and set other aufs configurations if necessary. + Note: You should read $PWD/fs/aufs/Kconfig carefully which describes @@ -520,7 +539,7 @@ index 000000000000..3e655d357134 + available in aufs standalone version's Makefile only), or copy + $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever + you like manually. By default, the target directory is $PWD/usr. -+- no need to apply aufs5-kbuild.patch, nor copying source files to your ++- no need to apply aufs6-kbuild.patch, nor copying source files to your + kernel source tree. + +Note: The header file aufs_type.h is necessary to build aufs-util @@ -540,19 +559,12 @@ index 000000000000..3e655d357134 + then run "make install_ulib" too. And refer to the aufs manual in + detail. + -+There several other patches in aufs5-standalone.git. They are all ++There several other patches in aufs-standalone.git. They are all +optional. When you meet some problems, they will help you. -+- aufs5-loopback.patch ++- aufs6-loopback.patch + Supports a nested loopback mount in a branch-fs. This patch is + unnecessary until aufs produces a message like "you may want to try + another patch for loopback file". -+- proc_mounts.patch -+ When there are many mountpoints and many mount(2)/umount(2) are -+ running, then /proc/mounts may not show the all mountpoints. This -+ patch makes /proc/mounts always show the full mountpoints list. -+ If you don't want to apply this patch and meet such problem, then you -+ need to increase the value of 'ProcMounts_Times' make-variable in -+ aufs-util.git as a second best solution. +- vfs-ino.patch + Modifies a system global kernel internal function get_next_ino() in + order to stop assigning 0 for an inode-number. Not directly related to @@ -564,13 +576,9 @@ index 000000000000..3e655d357134 + other utilities. When you find aufs XINO files for tmpfs branch + growing too much, try this patch. +- lockdep-debug.patch -+ Because aufs is not only an ordinary filesystem (callee of VFS), but -+ also a caller of VFS functions for branch filesystems, subclassing of -+ the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging -+ feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will -+ need to apply this debug patch to expand several constant values. -+ If you don't know what LOCKDEP is, then you don't have apply this -+ patch. ++ Similar to some kernel configurations for LOCKDEP (see the top of ++ this section), you will need expand some constants in LOCKDEP for ++ aufs if you enable CONFIG_LOCKDEP. + + +4. Usage @@ -671,7 +679,7 @@ index 000000000000..3e655d357134 +The Parted Magic Project made a donation (2013/9 and 11). +Pavel Barta made a donation (2013/10). +Nikolay Pertsev made a donation (2014/5). -+James B made a donation (2014/7 and 2015/7). ++James B made a donation (2014/7, 2015/7, and 2021/12). +Stefano Di Biase made a donation (2014/8). +Daniel Epellei made a donation (2015/1). +OmegaPhil made a donation (2016/1, 2018/4). @@ -679,6 +687,8 @@ index 000000000000..3e655d357134 +James Burry made a donation (2016/12). +Carsten Rose made a donation (2018/9). +Porteus Kiosk made a donation (2018/10). ++huronOS team: Enya Quetzalli made donations (2022/5, 2023/5 and 8). ++Vasily Mikhaylichenko made a donation (2023/5). + +Thank you very much. +Donations are always, including future donations, very important and @@ -698,23 +708,23 @@ index 000000000000..3e655d357134 +# End: ; diff --git a/Documentation/filesystems/aufs/design/01intro.txt b/Documentation/filesystems/aufs/design/01intro.txt new file mode 100644 -index 000000000000..47e0a01a8af2 +index 000000000000..4c468b3264b5 --- /dev/null +++ b/Documentation/filesystems/aufs/design/01intro.txt @@ -0,0 +1,171 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -875,23 +885,23 @@ index 000000000000..47e0a01a8af2 +about it. But currently I have implemented it in kernel space. diff --git a/Documentation/filesystems/aufs/design/02struct.txt b/Documentation/filesystems/aufs/design/02struct.txt new file mode 100644 -index 000000000000..0092b3dcfbe0 +index 000000000000..83be46121ae2 --- /dev/null +++ b/Documentation/filesystems/aufs/design/02struct.txt @@ -0,0 +1,258 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1139,23 +1149,23 @@ index 000000000000..0092b3dcfbe0 +For this purpose, use "aumvdown" command in aufs-util.git. diff --git a/Documentation/filesystems/aufs/design/03atomic_open.txt b/Documentation/filesystems/aufs/design/03atomic_open.txt new file mode 100644 -index 000000000000..fb8cf0bc8c72 +index 000000000000..4811f2432465 --- /dev/null +++ b/Documentation/filesystems/aufs/design/03atomic_open.txt @@ -0,0 +1,85 @@ + -+# Copyright (C) 2015-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2015-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1230,23 +1240,23 @@ index 000000000000..fb8cf0bc8c72 + be implemented in aufs, but not all I am afraid. diff --git a/Documentation/filesystems/aufs/design/03lookup.txt b/Documentation/filesystems/aufs/design/03lookup.txt new file mode 100644 -index 000000000000..5c3c97f11c57 +index 000000000000..766a28be0263 --- /dev/null +++ b/Documentation/filesystems/aufs/design/03lookup.txt @@ -0,0 +1,113 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1349,23 +1359,23 @@ index 000000000000..5c3c97f11c57 + by over-mounting something (or another method). diff --git a/Documentation/filesystems/aufs/design/04branch.txt b/Documentation/filesystems/aufs/design/04branch.txt new file mode 100644 -index 000000000000..da5200be41a9 +index 000000000000..ffeb97dcaff3 --- /dev/null +++ b/Documentation/filesystems/aufs/design/04branch.txt @@ -0,0 +1,74 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1429,23 +1439,23 @@ index 000000000000..da5200be41a9 + same named entry on the upper branch. diff --git a/Documentation/filesystems/aufs/design/05wbr_policy.txt b/Documentation/filesystems/aufs/design/05wbr_policy.txt new file mode 100644 -index 000000000000..0262084bf634 +index 000000000000..a2143bfe6efc --- /dev/null +++ b/Documentation/filesystems/aufs/design/05wbr_policy.txt @@ -0,0 +1,64 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1499,12 +1509,25 @@ index 000000000000..0262084bf634 + copyup policy. diff --git a/Documentation/filesystems/aufs/design/06dirren.dot b/Documentation/filesystems/aufs/design/06dirren.dot new file mode 100644 -index 000000000000..2d62bb6dd55f +index 000000000000..4e6c7e7c20ef --- /dev/null +++ b/Documentation/filesystems/aufs/design/06dirren.dot -@@ -0,0 +1,31 @@ +@@ -0,0 +1,44 @@ + +// to view this graph, run dot(1) command in GRAPHVIZ. ++// ++// This program is free software; you can redistribute it and/or modify ++// it under the terms of the GNU General Public License as published by ++// the Free Software Foundation; either version 2 of the License, or ++// (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License ++// along with this program. If not, see <http://www.gnu.org/licenses/>. + +digraph G { +node [shape=box]; @@ -1536,12 +1559,12 @@ index 000000000000..2d62bb6dd55f +} diff --git a/Documentation/filesystems/aufs/design/06dirren.txt b/Documentation/filesystems/aufs/design/06dirren.txt new file mode 100644 -index 000000000000..38ae77b2c842 +index 000000000000..58ec5e22fe3d --- /dev/null +++ b/Documentation/filesystems/aufs/design/06dirren.txt @@ -0,0 +1,102 @@ + -+# Copyright (C) 2017-2020 Junjiro R. Okajima ++# Copyright (C) 2017-2022 Junjiro R. Okajima +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by @@ -1619,7 +1642,7 @@ index 000000000000..38ae77b2c842 +simply the inode-numbers on the branch. The file is created or updated +in removing the branch, and loaded in adding the branch. Its lifetime is +equal to the branch. -+The list is refered in lookup, and when the current target inode is ++The list is referred in lookup, and when the current target inode is +found in the list, the aufs tries loading the "detailed info per +directory" and get the changed and valid name of the dir. + @@ -1644,27 +1667,25 @@ index 000000000000..38ae77b2c842 +equivalen to udba=reval case. diff --git a/Documentation/filesystems/aufs/design/06fhsm.txt b/Documentation/filesystems/aufs/design/06fhsm.txt new file mode 100644 -index 000000000000..df985662befb +index 000000000000..d3b56325ff87 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06fhsm.txt -@@ -0,0 +1,120 @@ +@@ -0,0 +1,118 @@ + -+# Copyright (C) 2011-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2011-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ ++# along with this program. If not, see <http://www.gnu.org/licenses/>. + +File-based Hierarchical Storage Management (FHSM) +---------------------------------------------------------------------- @@ -1770,23 +1791,23 @@ index 000000000000..df985662befb +should restore the original file state after an error happens. diff --git a/Documentation/filesystems/aufs/design/06mmap.txt b/Documentation/filesystems/aufs/design/06mmap.txt new file mode 100644 -index 000000000000..9184f6710437 +index 000000000000..ddc65ce97fa3 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06mmap.txt @@ -0,0 +1,72 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -1848,12 +1869,12 @@ index 000000000000..9184f6710437 +I have to give up this "looks-smater" approach. diff --git a/Documentation/filesystems/aufs/design/06xattr.txt b/Documentation/filesystems/aufs/design/06xattr.txt new file mode 100644 -index 000000000000..d0f6aedfe2d0 +index 000000000000..4e5ead3ad741 --- /dev/null +++ b/Documentation/filesystems/aufs/design/06xattr.txt -@@ -0,0 +1,96 @@ +@@ -0,0 +1,94 @@ + -+# Copyright (C) 2014-2020 Junjiro R. Okajima ++# Copyright (C) 2014-2022 Junjiro R. Okajima +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by @@ -1866,9 +1887,7 @@ index 000000000000..d0f6aedfe2d0 +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ ++# along with this program. If not, see <http://www.gnu.org/licenses/>. + +Listing XATTR/EA and getting the value +---------------------------------------------------------------------- @@ -1950,23 +1969,23 @@ index 000000000000..d0f6aedfe2d0 +now, aufs implements the branch attributes to ignore the error. diff --git a/Documentation/filesystems/aufs/design/07export.txt b/Documentation/filesystems/aufs/design/07export.txt new file mode 100644 -index 000000000000..6fcb00d7dbdb +index 000000000000..40b2f1f12049 --- /dev/null +++ b/Documentation/filesystems/aufs/design/07export.txt @@ -0,0 +1,58 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -2014,23 +2033,23 @@ index 000000000000..6fcb00d7dbdb + lookup_one_len(), vfs_getattr(), encode_fh() and others. diff --git a/Documentation/filesystems/aufs/design/08shwh.txt b/Documentation/filesystems/aufs/design/08shwh.txt new file mode 100644 -index 000000000000..d7e58319086b +index 000000000000..67245e98e6b4 --- /dev/null +++ b/Documentation/filesystems/aufs/design/08shwh.txt @@ -0,0 +1,52 @@ + -+# Copyright (C) 2005-2020 Junjiro R. Okajima -+# ++# Copyright (C) 2005-2022 Junjiro R. Okajima ++# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -+# ++# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -+# ++# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + @@ -2072,12 +2091,12 @@ index 000000000000..d7e58319086b +initramfs will use it to replace the old one at the next boot. diff --git a/Documentation/filesystems/aufs/design/10dynop.txt b/Documentation/filesystems/aufs/design/10dynop.txt new file mode 100644 -index 000000000000..d55cae285dff +index 000000000000..da382ec2dc05 --- /dev/null +++ b/Documentation/filesystems/aufs/design/10dynop.txt @@ -0,0 +1,47 @@ + -+# Copyright (C) 2010-2020 Junjiro R. Okajima ++# Copyright (C) 2010-2022 Junjiro R. Okajima +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by @@ -2125,7 +2144,7 @@ index 000000000000..d55cae285dff +regular files only. diff --git a/fs/aufs/Kconfig b/fs/aufs/Kconfig new file mode 100644 -index 000000000000..9f436425716a +index 000000000000..a5008b87a55f --- /dev/null +++ b/fs/aufs/Kconfig @@ -0,0 +1,199 @@ @@ -2255,7 +2274,7 @@ index 000000000000..9f436425716a + his child on the lower branch, since it is a bad idea to issue + rename(2) internally for every lower branch. But user may not + accept this behaviour. So here is a workaround to allow such -+ rename(2) and store some extra infromation on the writable ++ rename(2) and store some extra information on the writable + branch. Obviously this costs high (and I don't like it). + To use this feature, you need to enable this configuration AND + to specify the mount option `dirren.' @@ -2330,7 +2349,7 @@ index 000000000000..9f436425716a +endif diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile new file mode 100644 -index 000000000000..2c819a64935e +index 000000000000..4af8ecde3e3f --- /dev/null +++ b/fs/aufs/Makefile @@ -0,0 +1,46 @@ @@ -2353,7 +2372,7 @@ index 000000000000..2c819a64935e +endif + +obj-$(CONFIG_AUFS_FS) += aufs.o -+aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \ ++aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o fsctx.o \ + wkq.o vfsub.o dcsub.o \ + cpup.o whout.o wbr_policy.o \ + dinfo.o dentry.o \ @@ -2382,15 +2401,15 @@ index 000000000000..2c819a64935e +aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o diff --git a/fs/aufs/aufs.h b/fs/aufs/aufs.h new file mode 100644 -index 000000000000..9a573445876f +index 000000000000..20430cf79042 --- /dev/null +++ b/fs/aufs/aufs.h @@ -0,0 +1,62 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -2450,15 +2469,15 @@ index 000000000000..9a573445876f +#endif /* __AUFS_H__ */ diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c new file mode 100644 -index 000000000000..26d41e1bc0c3 +index 000000000000..2a85d744d2b5 --- /dev/null +++ b/fs/aufs/branch.c @@ -0,0 +1,1427 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -3735,7 +3754,7 @@ index 000000000000..26d41e1bc0c3 + * file_release_write() for each file, because the branch + * attribute in aufs world is totally different from the native + * fs rw/ro mode. -+ */ ++ */ + /* fi_read_lock(file); */ + hfile = &au_fi(file)->fi_htop; + hf = hfile->hf_file; @@ -3883,15 +3902,15 @@ index 000000000000..26d41e1bc0c3 +} diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h new file mode 100644 -index 000000000000..4c00b9183ad1 +index 000000000000..6818ba8df8a2 --- /dev/null +++ b/fs/aufs/branch.h @@ -0,0 +1,375 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -4035,9 +4054,9 @@ index 000000000000..4c00b9183ad1 + return br->br_path.dentry; +} + -+static inline struct user_namespace *au_br_userns(struct au_branch *br) ++static inline struct mnt_idmap *au_br_idmap(struct au_branch *br) +{ -+ return mnt_user_ns(br->br_path.mnt); ++ return mnt_idmap(br->br_path.mnt); +} + +static inline struct super_block *au_br_sb(struct au_branch *br) @@ -4199,9 +4218,9 @@ index 000000000000..4c00b9183ad1 +} + +static inline -+struct user_namespace *au_sbr_userns(struct super_block *sb, aufs_bindex_t bindex) ++struct mnt_idmap *au_sbr_idmap(struct super_block *sb, aufs_bindex_t bindex) +{ -+ return au_br_userns(au_sbr(sb, bindex)); ++ return au_br_idmap(au_sbr(sb, bindex)); +} + +static inline @@ -4310,15 +4329,15 @@ index 000000000000..12782f8e0f38 +-include ${srctree}/${src}/conf_priv.mk diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c new file mode 100644 -index 000000000000..0513764f0c89 +index 000000000000..8c8bd5f7b28d --- /dev/null +++ b/fs/aufs/cpup.c -@@ -0,0 +1,1457 @@ +@@ -0,0 +1,1459 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -4905,23 +4924,23 @@ index 000000000000..0513764f0c89 + * regardless 'acl' option, reset all ACL. + * All ACL will be copied up later from the original entry on the lower branch. + */ -+static int au_reset_acl(struct inode *h_dir, struct path *h_path, umode_t mode) ++static int au_reset_acl(struct path *h_path, umode_t mode) +{ + int err; + struct dentry *h_dentry; -+ struct inode *h_inode; -+ struct user_namespace *h_userns; ++ /* struct inode *h_inode; */ ++ struct mnt_idmap *h_idmap; + -+ h_userns = mnt_user_ns(h_path->mnt); ++ h_idmap = mnt_idmap(h_path->mnt); + h_dentry = h_path->dentry; -+ h_inode = d_inode(h_dentry); ++ /* h_inode = d_inode(h_dentry); */ + /* forget_all_cached_acls(h_inode)); */ -+ err = vfsub_removexattr(h_userns, h_dentry, XATTR_NAME_POSIX_ACL_ACCESS); ++ err = vfsub_remove_acl(h_idmap, h_dentry, XATTR_NAME_POSIX_ACL_ACCESS); + AuTraceErr(err); + if (err == -EOPNOTSUPP) + err = 0; + if (!err) -+ err = vfsub_acl_chmod(h_userns, h_inode, mode); ++ err = vfsub_acl_chmod(h_idmap, h_dentry, mode); + + AuTraceErr(err); + return err; @@ -4932,11 +4951,11 @@ index 000000000000..0513764f0c89 +{ + int err; + struct inode *dir, *inode; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + -+ h_userns = mnt_user_ns(h_path->mnt); -+ err = vfsub_removexattr(h_userns, h_path->dentry, -+ XATTR_NAME_POSIX_ACL_DEFAULT); ++ h_idmap = mnt_idmap(h_path->mnt); ++ err = vfsub_remove_acl(h_idmap, h_path->dentry, ++ XATTR_NAME_POSIX_ACL_DEFAULT); + AuTraceErr(err); + if (err == -EOPNOTSUPP) + err = 0; @@ -5027,7 +5046,7 @@ index 000000000000..0513764f0c89 + err = -EIO; + } + if (!err) -+ err = au_reset_acl(h_dir, &h_path, mode); ++ err = au_reset_acl(&h_path, mode); + + mnt_flags = au_mntflags(sb); + if (!au_opt_test(mnt_flags, UDBA_NONE) @@ -5061,11 +5080,13 @@ index 000000000000..0513764f0c89 +{ + int err; + struct dentry *dentry, *h_dentry, *h_parent, *parent; ++ struct path h_ppath; + struct inode *h_dir; + aufs_bindex_t bdst; + + dentry = cpg->dentry; + bdst = cpg->bdst; ++ h_ppath.mnt = au_sbr_mnt(dentry->d_sb, bdst); + h_dentry = au_h_dptr(dentry, bdst); + if (!au_ftest_cpup(cpg->flags, OVERWRITE)) { + dget(h_dentry); @@ -5077,9 +5098,9 @@ index 000000000000..0513764f0c89 + } else { + err = 0; + parent = dget_parent(dentry); -+ h_parent = au_h_dptr(parent, bdst); ++ h_ppath.dentry = au_h_dptr(parent, bdst); + dput(parent); -+ h_path->dentry = vfsub_lkup_one(&dentry->d_name, h_parent); ++ h_path->dentry = vfsub_lkup_one(&dentry->d_name, &h_ppath); + if (IS_ERR(h_path->dentry)) + err = PTR_ERR(h_path->dentry); + } @@ -5413,7 +5434,7 @@ index 000000000000..0513764f0c89 + struct dentry *dentry, *parent; + struct file *h_file; + struct inode *h_dir; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + dentry = cpg->dentry; + h_file = NULL; @@ -5427,8 +5448,8 @@ index 000000000000..0513764f0c89 + + parent = dget_parent(dentry); + h_dir = au_h_iptr(d_inode(parent), cpg->bdst); -+ h_userns = au_sbr_userns(dentry->d_sb, cpg->bdst); -+ if (!au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC | MAY_WRITE) ++ h_idmap = au_sbr_idmap(dentry->d_sb, cpg->bdst); ++ if (!au_test_h_perm_sio(h_idmap, h_dir, MAY_EXEC | MAY_WRITE) + && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode)) + err = au_cpup_simple(cpg); + else { @@ -5598,7 +5619,7 @@ index 000000000000..0513764f0c89 + struct inode *dir, *h_dir, *h_tmpdir; + struct au_wbr *wbr; + struct au_pin wh_pin, *pin_orig; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + dentry = cpg->dentry; + bdst = cpg->bdst; @@ -5627,8 +5648,8 @@ index 000000000000..0513764f0c89 + cpg->pin = &wh_pin; + } + -+ h_userns = au_sbr_userns(dentry->d_sb, bdst); -+ if (!au_test_h_perm_sio(h_userns, h_tmpdir, MAY_EXEC | MAY_WRITE) ++ h_idmap = au_sbr_idmap(dentry->d_sb, bdst); ++ if (!au_test_h_perm_sio(h_idmap, h_tmpdir, MAY_EXEC | MAY_WRITE) + && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode)) + err = au_cpup_wh(cpg, file); + else { @@ -5773,15 +5794,15 @@ index 000000000000..0513764f0c89 +} diff --git a/fs/aufs/cpup.h b/fs/aufs/cpup.h new file mode 100644 -index 000000000000..d02f8150fa05 +index 000000000000..decd8f01425a --- /dev/null +++ b/fs/aufs/cpup.h @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -5879,15 +5900,15 @@ index 000000000000..d02f8150fa05 +#endif /* __AUFS_CPUP_H__ */ diff --git a/fs/aufs/dbgaufs.c b/fs/aufs/dbgaufs.c new file mode 100644 -index 000000000000..80266f4fcf7d +index 000000000000..d5811df890b5 --- /dev/null +++ b/fs/aufs/dbgaufs.c @@ -0,0 +1,526 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -6049,7 +6070,7 @@ index 000000000000..80266f4fcf7d + } else { +#define str "1\n0\n0\n" + p->n = sizeof(str) - 1; -+ strcpy(p->a, str); ++ strscpy(p->a, str, sizeof(str)); +#undef str + } + si_read_unlock(sb); @@ -6411,15 +6432,15 @@ index 000000000000..80266f4fcf7d +} diff --git a/fs/aufs/dbgaufs.h b/fs/aufs/dbgaufs.h new file mode 100644 -index 000000000000..7b4ccdebb678 +index 000000000000..30f1694224e0 --- /dev/null +++ b/fs/aufs/dbgaufs.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -6470,15 +6491,15 @@ index 000000000000..7b4ccdebb678 +#endif /* __DBGAUFS_H__ */ diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c new file mode 100644 -index 000000000000..0b9b1862b563 +index 000000000000..fa2a9ad2b49b --- /dev/null +++ b/fs/aufs/dcsub.c @@ -0,0 +1,225 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -6701,15 +6722,15 @@ index 000000000000..0b9b1862b563 +} diff --git a/fs/aufs/dcsub.h b/fs/aufs/dcsub.h new file mode 100644 -index 000000000000..36f7fcdd7f23 +index 000000000000..7e4f4eba0343 --- /dev/null +++ b/fs/aufs/dcsub.h @@ -0,0 +1,137 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -6844,15 +6865,15 @@ index 000000000000..36f7fcdd7f23 +#endif /* __AUFS_DCSUB_H__ */ diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c new file mode 100644 -index 000000000000..f0c076c61252 +index 000000000000..e14075c4bccc --- /dev/null +++ b/fs/aufs/debug.c -@@ -0,0 +1,441 @@ +@@ -0,0 +1,446 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -6897,7 +6918,7 @@ index 000000000000..f0c076c61252 + return sprintf(buffer, "%d", atomic_read(a)); +} + -+static struct kernel_param_ops param_ops_atomic_t = { ++static const struct kernel_param_ops param_ops_atomic_t = { + .set = param_atomic_t_set, + .get = param_atomic_t_get + /* void (*free)(void *arg) */ @@ -6977,11 +6998,13 @@ index 000000000000..f0c076c61252 + } + + dpri("i%d: %p, i%lu, %s, cnt %d, nl %u, 0%o, sz %llu, blk %llu," ++ " acl %p, def_acl %p," + " hn %d, ct %lld, np %lu, st 0x%lx, f 0x%x, v %llu, g %x%s%.*s\n", + bindex, inode, + inode->i_ino, inode->i_sb ? au_sbtype(inode->i_sb) : "??", + atomic_read(&inode->i_count), inode->i_nlink, inode->i_mode, + i_size_read(inode), (unsigned long long)inode->i_blocks, ++ inode->i_acl, inode->i_default_acl, + hn, (long long)timespec64_to_ns(&inode->i_ctime) & 0x0ffff, + inode->i_mapping ? inode->i_mapping->nrpages : 0, + inode->i_state, inode->i_flags, inode_peek_iversion(inode), @@ -7233,7 +7256,10 @@ index 000000000000..f0c076c61252 + AuDbgDentry(dentry); + AuDbgInode(inode); + au_debug_off(); -+ BUG(); ++ if (au_test_fuse(h_inode->i_sb)) ++ WARN_ON_ONCE(1); ++ else ++ BUG(); + } + } +} @@ -7291,15 +7317,15 @@ index 000000000000..f0c076c61252 +} diff --git a/fs/aufs/debug.h b/fs/aufs/debug.h new file mode 100644 -index 000000000000..7e46953513f2 +index 000000000000..f757588e5000 --- /dev/null +++ b/fs/aufs/debug.h @@ -0,0 +1,226 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -7523,15 +7549,15 @@ index 000000000000..7e46953513f2 +#endif /* __AUFS_DEBUG_H__ */ diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c new file mode 100644 -index 000000000000..16de5b2e5d01 +index 000000000000..ed7ce8f6d1a1 --- /dev/null +++ b/fs/aufs/dentry.c -@@ -0,0 +1,1160 @@ +@@ -0,0 +1,1168 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -7550,7 +7576,6 @@ index 000000000000..16de5b2e5d01 + */ + +#include <linux/iversion.h> -+#include <linux/namei.h> +#include "aufs.h" + +/* @@ -7564,7 +7589,8 @@ index 000000000000..16de5b2e5d01 + struct dentry *h_dentry; + struct inode *h_inode; + struct au_branch *br; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; ++ struct path h_path; + int wh_found, opq; + unsigned char wh_able; + const unsigned char allow_neg = !!au_ftest_lkup(args->flags, ALLOW_NEG); @@ -7573,10 +7599,12 @@ index 000000000000..16de5b2e5d01 + + wh_found = 0; + br = au_sbr(dentry->d_sb, bindex); -+ h_userns = au_br_userns(br); ++ h_path.dentry = h_parent; ++ h_path.mnt = au_br_mnt(br); ++ h_idmap = au_br_idmap(br); + wh_able = !!au_br_whable(br->br_perm); + if (wh_able) -+ wh_found = au_wh_test(h_userns, h_parent, &args->whname, ++ wh_found = au_wh_test(h_idmap, &h_path, &args->whname, + ignore_perm); + h_dentry = ERR_PTR(wh_found); + if (!wh_found) @@ -7592,9 +7620,9 @@ index 000000000000..16de5b2e5d01 + +real_lookup: + if (!ignore_perm) -+ h_dentry = vfsub_lkup_one(args->name, h_parent); ++ h_dentry = vfsub_lkup_one(args->name, &h_path); + else -+ h_dentry = au_sio_lkup_one(h_userns, args->name, h_parent); ++ h_dentry = au_sio_lkup_one(h_idmap, args->name, &h_path); + if (IS_ERR(h_dentry)) { + if (PTR_ERR(h_dentry) == -ENAMETOOLONG + && !allow_neg) @@ -7628,8 +7656,9 @@ index 000000000000..16de5b2e5d01 + || (d_really_is_positive(dentry) && !d_is_dir(dentry))) + goto out; /* success */ + ++ h_path.dentry = h_dentry; + inode_lock_shared_nested(h_inode, AuLsc_I_CHILD); -+ opq = au_diropq_test(h_userns, h_dentry); ++ opq = au_diropq_test(h_idmap, &h_path); + inode_unlock_shared(h_inode); + if (opq > 0) + au_set_dbdiropq(dentry, bindex); @@ -7774,19 +7803,19 @@ index 000000000000..16de5b2e5d01 + return err; +} + -+struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name, -+ struct dentry *parent) ++struct dentry *au_sio_lkup_one(struct mnt_idmap *idmap, struct qstr *name, ++ struct path *ppath) +{ + struct dentry *dentry; + int wkq_err; + -+ if (!au_test_h_perm_sio(userns, d_inode(parent), MAY_EXEC)) -+ dentry = vfsub_lkup_one(name, parent); ++ if (!au_test_h_perm_sio(idmap, d_inode(ppath->dentry), MAY_EXEC)) ++ dentry = vfsub_lkup_one(name, ppath); + else { + struct vfsub_lkup_one_args args = { + .errp = &dentry, + .name = name, -+ .parent = parent ++ .ppath = ppath + }; + + wkq_err = au_wkq_wait(vfsub_call_lkup_one, &args); @@ -7803,18 +7832,20 @@ index 000000000000..16de5b2e5d01 +int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex, int wh) +{ + int err; -+ struct dentry *parent, *h_parent, *h_dentry; ++ struct dentry *parent, *h_dentry; + struct au_branch *br; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; ++ struct path h_ppath; + + parent = dget_parent(dentry); -+ h_parent = au_h_dptr(parent, bindex); + br = au_sbr(dentry->d_sb, bindex); -+ h_userns = au_br_userns(br); ++ h_ppath.dentry = au_h_dptr(parent, bindex); ++ h_ppath.mnt = au_br_mnt(br); ++ h_idmap = au_br_idmap(br); + if (wh) -+ h_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name); ++ h_dentry = au_whtmp_lkup(h_ppath.dentry, br, &dentry->d_name); + else -+ h_dentry = au_sio_lkup_one(h_userns, &dentry->d_name, h_parent); ++ h_dentry = au_sio_lkup_one(h_idmap, &dentry->d_name, &h_ppath); + err = PTR_ERR(h_dentry); + if (IS_ERR(h_dentry)) + goto out; @@ -7889,6 +7920,7 @@ index 000000000000..16de5b2e5d01 + struct inode *h_inode; + struct dentry *h_d; + struct super_block *h_sb; ++ struct path h_ppath; + + err = 0; + memset(&ia, -1, sizeof(ia)); @@ -7903,7 +7935,9 @@ index 000000000000..16de5b2e5d01 + goto out; + + /* main purpose is namei.c:cached_lookup() and d_revalidate */ -+ h_d = vfsub_lkup_one(&h_dentry->d_name, h_parent); ++ h_ppath.dentry = h_parent; ++ h_ppath.mnt = au_br_mnt(br); ++ h_d = vfsub_lkup_one(&h_dentry->d_name, &h_ppath); + err = PTR_ERR(h_d); + if (IS_ERR(h_d)) + goto out; @@ -8689,15 +8723,15 @@ index 000000000000..16de5b2e5d01 +}; diff --git a/fs/aufs/dentry.h b/fs/aufs/dentry.h new file mode 100644 -index 000000000000..7657906e4a31 +index 000000000000..da4c9063d7e1 --- /dev/null +++ b/fs/aufs/dentry.h -@@ -0,0 +1,269 @@ +@@ -0,0 +1,270 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -8736,6 +8770,7 @@ index 000000000000..7657906e4a31 + aufs_bindex_t di_btop, di_bbot, di_bwh, di_bdiropq; + unsigned char di_tmpfile; /* to allow the different name */ + struct au_hdentry *di_hdentry; ++ struct file *di_htmpfile; + struct rcu_head rcu; +} ____cacheline_aligned_in_smp; + @@ -8768,8 +8803,8 @@ index 000000000000..7657906e4a31 +/* dentry.c */ +extern const struct dentry_operations aufs_dop, aufs_dop_noreval; +struct au_branch; -+struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name, -+ struct dentry *parent); ++struct dentry *au_sio_lkup_one(struct mnt_idmap *idmap, struct qstr *name, ++ struct path *ppath); +int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, + struct dentry *h_parent, struct au_branch *br); + @@ -8964,15 +8999,15 @@ index 000000000000..7657906e4a31 +#endif /* __AUFS_DENTRY_H__ */ diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c new file mode 100644 -index 000000000000..be959106d980 +index 000000000000..bf4a94414309 --- /dev/null +++ b/fs/aufs/dinfo.c -@@ -0,0 +1,554 @@ +@@ -0,0 +1,555 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -9021,6 +9056,7 @@ index 000000000000..be959106d980 + dinfo->di_tmpfile = 0; + for (i = 0; i < nbr; i++) + dinfo->di_hdentry[i].hd_id = -1; ++ dinfo->di_htmpfile = NULL; + goto out; + } + @@ -9524,15 +9560,15 @@ index 000000000000..be959106d980 +} diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c new file mode 100644 -index 000000000000..91c31e737a7e +index 000000000000..ee900ea3264b --- /dev/null +++ b/fs/aufs/dir.c @@ -0,0 +1,765 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -10079,9 +10115,9 @@ index 000000000000..91c31e737a7e + aufs_bindex_t bindex; +}; + -+static int test_empty_cb(struct dir_context *ctx, const char *__name, -+ int namelen, loff_t offset __maybe_unused, u64 ino, -+ unsigned int d_type) ++static bool test_empty_cb(struct dir_context *ctx, const char *__name, ++ int namelen, loff_t offset __maybe_unused, u64 ino, ++ unsigned int d_type) +{ + struct test_empty_arg *arg = container_of(ctx, struct test_empty_arg, + ctx); @@ -10112,7 +10148,7 @@ index 000000000000..91c31e737a7e +out: + /* smp_mb(); */ + AuTraceErr(arg->err); -+ return arg->err; ++ return !arg->err; +} + +static int do_test_empty(struct dentry *dentry, struct test_empty_arg *arg) @@ -10167,14 +10203,14 @@ index 000000000000..91c31e737a7e + int err, wkq_err; + struct dentry *h_dentry; + struct inode *h_inode; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + -+ h_userns = au_sbr_userns(dentry->d_sb, arg->bindex); ++ h_idmap = au_sbr_idmap(dentry->d_sb, arg->bindex); + h_dentry = au_h_dptr(dentry, arg->bindex); + h_inode = d_inode(h_dentry); + /* todo: i_mode changes anytime? */ + inode_lock_shared_nested(h_inode, AuLsc_I_CHILD); -+ err = au_test_h_perm_sio(h_userns, h_inode, MAY_EXEC | MAY_READ); ++ err = au_test_h_perm_sio(h_idmap, h_inode, MAY_EXEC | MAY_READ); + inode_unlock_shared(h_inode); + if (!err) + err = do_test_empty(dentry, arg); @@ -10295,15 +10331,15 @@ index 000000000000..91c31e737a7e +}; diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h new file mode 100644 -index 000000000000..e44c2a1a849b +index 000000000000..382342bd6ecf --- /dev/null +++ b/fs/aufs/dir.h @@ -0,0 +1,134 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -10435,15 +10471,15 @@ index 000000000000..e44c2a1a849b +#endif /* __AUFS_DIR_H__ */ diff --git a/fs/aufs/dirren.c b/fs/aufs/dirren.c new file mode 100644 -index 000000000000..dd530d0188e2 +index 000000000000..2a6295ab6576 --- /dev/null +++ b/fs/aufs/dirren.c -@@ -0,0 +1,1316 @@ +@@ -0,0 +1,1315 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2017-2020 Junjiro R. Okajima ++ * Copyright (C) 2017-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -10704,11 +10740,11 @@ index 000000000000..dd530d0188e2 + dir = d_inode(path->dentry); + inode_lock_nested(dir, AuLsc_I_CHILD); + } -+ hinopath.dentry = vfsub_lkup_one(&hinoname, path->dentry); ++ hinopath.mnt = path->mnt; ++ hinopath.dentry = vfsub_lkup_one(&hinoname, (struct path *)path); + err = PTR_ERR(hinopath.dentry); + if (IS_ERR(hinopath.dentry)) + goto out_unlock; -+ hinopath.mnt = path->mnt; + + err = 0; + flags = O_RDONLY; @@ -11060,7 +11096,7 @@ index 000000000000..dd530d0188e2 + AuDebugOn(elm + && memcmp(elm, page_address(ZERO_PAGE(0)), sizeof(*elm))); + -+ infopath.dentry = vfsub_lookup_one_len(w->whname, w->h_ppath.dentry, ++ infopath.dentry = vfsub_lookup_one_len(w->whname, &w->h_ppath, + w->whnamelen); + AuTraceErrPtr(infopath.dentry); + if (IS_ERR(infopath.dentry)) { @@ -11176,7 +11212,7 @@ index 000000000000..dd530d0188e2 + + memset(w, 0, sizeof(*w)); + w->allocated = roundup_pow_of_two(sizeof(*w->fdata) + 40); -+ strcpy(w->whname, AUFS_WH_DR_INFO_PFX); ++ strscpy(w->whname, AUFS_WH_DR_INFO_PFX, sizeof(AUFS_WH_DR_INFO_PFX)); + w->infoname = w->whname + sizeof(AUFS_WH_DR_INFO_PFX) - 1; + w->infonamelen = sizeof(w->whname) - sizeof(AUFS_WH_DR_INFO_PFX); + w->btgt = btgt; @@ -11444,8 +11480,7 @@ index 000000000000..dd530d0188e2 + unlocked = 0; + h_dir = d_inode(h_ppath->dentry); + inode_lock_shared_nested(h_dir, AuLsc_I_PARENT); -+ infopath.dentry = vfsub_lookup_one_len(whname, h_ppath->dentry, -+ whnamelen); ++ infopath.dentry = vfsub_lookup_one_len(whname, h_ppath, whnamelen); + if (IS_ERR(infopath.dentry)) { + drinfo = (void *)infopath.dentry; + goto out; @@ -11757,15 +11792,15 @@ index 000000000000..dd530d0188e2 +} diff --git a/fs/aufs/dirren.h b/fs/aufs/dirren.h new file mode 100644 -index 000000000000..1fbc8fb20def +index 000000000000..d2d57d95a77e --- /dev/null +++ b/fs/aufs/dirren.h @@ -0,0 +1,140 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2017-2020 Junjiro R. Okajima ++ * Copyright (C) 2017-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -11903,15 +11938,15 @@ index 000000000000..1fbc8fb20def +#endif /* __AUFS_DIRREN_H__ */ diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c new file mode 100644 -index 000000000000..4732edb340d7 +index 000000000000..54fd16ecb6d3 --- /dev/null +++ b/fs/aufs/dynop.c -@@ -0,0 +1,368 @@ +@@ -0,0 +1,366 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2010-2020 Junjiro R. Okajima ++ * Copyright (C) 2010-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -12085,28 +12120,26 @@ index 000000000000..4732edb340d7 + AuDbg("%s\n", au_sbtype(h_sb)); + + DySetAop(writepage); -+ DySetAopForce(readpage); /* force */ ++ DySetAopForce(read_folio); /* force */ + DySetAop(writepages); -+ DySetAop(set_page_dirty); -+ DySetAop(readpages); ++ DySetAop(dirty_folio); ++ DySetAop(invalidate_folio); + DySetAop(readahead); + DySetAop(write_begin); + DySetAop(write_end); + DySetAop(bmap); -+ DySetAop(invalidatepage); -+ DySetAop(releasepage); -+ DySetAop(freepage); ++ DySetAop(release_folio); ++ DySetAop(free_folio); + /* this one will be changed according to an aufs mount option */ + DySetAop(direct_IO); -+ DySetAop(migratepage); -+ DySetAop(isolate_page); -+ DySetAop(putback_page); -+ DySetAop(launder_page); ++ DySetAop(migrate_folio); ++ DySetAop(launder_folio); + DySetAop(is_partially_uptodate); + DySetAop(is_dirty_writeback); + DySetAop(error_remove_page); + DySetAop(swap_activate); + DySetAop(swap_deactivate); ++ DySetAop(swap_rw); + + DyDbgSize(cnt, *h_aop); +} @@ -12277,15 +12310,15 @@ index 000000000000..4732edb340d7 +} diff --git a/fs/aufs/dynop.h b/fs/aufs/dynop.h new file mode 100644 -index 000000000000..c0c7a5485ad7 +index 000000000000..60d89364b676 --- /dev/null +++ b/fs/aufs/dynop.h @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2010-2020 Junjiro R. Okajima ++ * Copyright (C) 2010-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -12360,15 +12393,15 @@ index 000000000000..c0c7a5485ad7 +#endif /* __AUFS_DYNOP_H__ */ diff --git a/fs/aufs/export.c b/fs/aufs/export.c new file mode 100644 -index 000000000000..f883d2bf5325 +index 000000000000..4c639e5d40f6 --- /dev/null +++ b/fs/aufs/export.c -@@ -0,0 +1,837 @@ +@@ -0,0 +1,830 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -12388,7 +12421,6 @@ index 000000000000..f883d2bf5325 + +#include <linux/exportfs.h> +#include <linux/fs_struct.h> -+#include <linux/namei.h> +#include <linux/nsproxy.h> +#include <linux/random.h> +#include <linux/writeback.h> @@ -12713,7 +12745,7 @@ index 000000000000..f883d2bf5325 + int namelen; +}; + -+static int ++static bool +find_name_by_ino(struct dir_context *ctx, const char *name, int namelen, + loff_t offset, u64 ino, unsigned int d_type) +{ @@ -12722,12 +12754,12 @@ index 000000000000..f883d2bf5325 + + a->called++; + if (a->ino != ino) -+ return 0; ++ return true; + + memcpy(a->name, name, namelen); + a->namelen = namelen; + a->found = 1; -+ return 1; ++ return false; +} + +static struct dentry *au_lkup_by_ino(struct path *path, ino_t ino, @@ -12772,7 +12804,7 @@ index 000000000000..f883d2bf5325 + + /* do not call vfsub_lkup_one() */ + dir = d_inode(parent); -+ dentry = vfsub_lookup_one_len_unlocked(arg.name, parent, arg.namelen); ++ dentry = vfsub_lookup_one_len_unlocked(arg.name, path, arg.namelen); + AuTraceErrPtr(dentry); + if (IS_ERR(dentry)) + goto out_name; @@ -13160,14 +13192,8 @@ index 000000000000..f883d2bf5325 + f = h_inode->i_sb->s_export_op->commit_metadata; + if (f) + err = f(h_inode); -+ else { -+ struct writeback_control wbc = { -+ .sync_mode = WB_SYNC_ALL, -+ .nr_to_write = 0 /* metadata only */ -+ }; -+ -+ err = sync_inode(h_inode, &wbc); -+ } ++ else ++ err = sync_inode_metadata(h_inode, /*wait*/1); + + au_cpup_attr_timesizes(inode); + ii_write_unlock(inode); @@ -13203,15 +13229,15 @@ index 000000000000..f883d2bf5325 +} diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c new file mode 100644 -index 000000000000..37eb4f6bcc23 +index 000000000000..320ad8a9334d --- /dev/null +++ b/fs/aufs/f_op.c -@@ -0,0 +1,762 @@ +@@ -0,0 +1,771 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -13270,12 +13296,17 @@ index 000000000000..37eb4f6bcc23 + /* br ref is already inc-ed */ + } + -+ if ((flags & __O_TMPFILE) -+ && !(flags & O_EXCL)) { -+ h_inode = file_inode(h_file); -+ spin_lock(&h_inode->i_lock); -+ h_inode->i_state |= I_LINKABLE; -+ spin_unlock(&h_inode->i_lock); ++ if (flags & __O_TMPFILE) { ++ AuDebugOn(!h_file); ++ AuDebugOn(h_file != au_di(dentry)->di_htmpfile); ++ au_di(dentry)->di_htmpfile = NULL; ++ ++ if (!(flags & O_EXCL)) { ++ h_inode = file_inode(h_file); ++ spin_lock(&h_inode->i_lock); ++ h_inode->i_state |= I_LINKABLE; ++ spin_unlock(&h_inode->i_lock); ++ } + } + au_set_fbtop(file, bindex); + au_set_h_fptr(file, bindex, h_file); @@ -13427,6 +13458,7 @@ index 000000000000..37eb4f6bcc23 + if (do_ready) + au_unpin(&pin); + di_read_unlock(dentry, /*flags*/0); ++ vfsub_file_start_write(h_file); + +out_fi: + fi_write_unlock(file); @@ -13439,6 +13471,7 @@ index 000000000000..37eb4f6bcc23 +{ + struct inode *h_inode; + ++ vfsub_file_end_write(h_file); + au_cpup_attr_timesizes(inode); + AuDebugOn(au_ibtop(inode) != wpre->btop); + h_inode = file_inode(h_file); @@ -13568,6 +13601,15 @@ index 000000000000..37eb4f6bcc23 + return err; +} + ++/* ++ * We may be able to remove aufs_splice_{read,write}() since almost all FSes ++ * don't have their own .splice_{read,write} implimentations, and they use ++ * generic_file_splice_read() and iter_file_splice_write() who can act like the ++ * simple converters to f_op->iter_read() and ->iter_write(). ++ * But we keep our own implementations because some non-mainlined FSes may have ++ * their own .splice_{read,write} implimentations and aufs doesn't want to take ++ * away an opportunity to co-work with aufs from them. ++ */ +static ssize_t aufs_splice_read(struct file *file, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, + unsigned int flags) @@ -13586,7 +13628,7 @@ index 000000000000..37eb4f6bcc23 + if (IS_ERR(h_file)) + goto out; + -+ err = vfsub_splice_to(h_file, ppos, pipe, len, flags); ++ err = vfsub_splice_read(h_file, ppos, pipe, len, flags); + /* todo: necessary? */ + /* file->f_ra = h_file->f_ra; */ + au_read_post(inode, h_file); @@ -13643,6 +13685,10 @@ index 000000000000..37eb4f6bcc23 + lockdep_off(); + err = vfs_fallocate(h_file, mode, offset, len); + lockdep_on(); ++ /* ++ * we don't need to call file_modifed() here since au_write_post() ++ * is equivalent and copies-up all timestamps and permission bits. ++ */ + au_write_post(inode, h_file, &wpre, /*written*/1); + +out: @@ -13927,16 +13973,6 @@ index 000000000000..37eb4f6bcc23 + +/* ---------------------------------------------------------------------- */ + -+/* no one supports this operation, currently */ -+#if 0 /* reserved for future use */ -+static ssize_t aufs_sendpage(struct file *file, struct page *page, int offset, -+ size_t len, loff_t *pos, int more) -+{ -+} -+#endif -+ -+/* ---------------------------------------------------------------------- */ -+ +const struct file_operations aufs_file_fop = { + .owner = THIS_MODULE, + @@ -13958,7 +13994,6 @@ index 000000000000..37eb4f6bcc23 + .release = aufs_release_nondir, + .fsync = aufs_fsync_nondir, + .fasync = aufs_fasync, -+ /* .sendpage = aufs_sendpage, */ + .setfl = aufs_setfl, + .splice_write = aufs_splice_write, + .splice_read = aufs_splice_read, @@ -13971,15 +14006,15 @@ index 000000000000..37eb4f6bcc23 +}; diff --git a/fs/aufs/fhsm.c b/fs/aufs/fhsm.c new file mode 100644 -index 000000000000..9cef93b42993 +index 000000000000..91262fbbbfae --- /dev/null +++ b/fs/aufs/fhsm.c -@@ -0,0 +1,427 @@ +@@ -0,0 +1,426 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2011-2020 Junjiro R. Okajima ++ * Copyright (C) 2011-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -13990,8 +14025,7 @@ index 000000000000..9cef93b42993 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* @@ -14404,15 +14438,15 @@ index 000000000000..9cef93b42993 +} diff --git a/fs/aufs/file.c b/fs/aufs/file.c new file mode 100644 -index 000000000000..b0075b57d8bc +index 000000000000..76ad444328db --- /dev/null +++ b/fs/aufs/file.c -@@ -0,0 +1,863 @@ +@@ -0,0 +1,865 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -14496,6 +14530,11 @@ index 000000000000..b0075b57d8bc + au_lcnt_inc(&br->br_nfiles); + h_path.dentry = h_dentry; + h_path.mnt = au_br_mnt(br); ++ /* ++ * vfs::backing_file_open() looks promising since it can get rid of ++ * mm::vm_prfile approach from my mind. ++ * but I keep current approach for a while. ++ */ + h_file = vfsub_dentry_open(&h_path, flags); + if (IS_ERR(h_file)) + goto out_br; @@ -14654,18 +14693,20 @@ index 000000000000..b0075b57d8bc + AuDebugOn(IS_ERR_OR_NULL(dentry)); + di_write_lock_child(dentry); + err = au_cmoo(dentry); -+ di_downgrade_lock(dentry, AuLock_IR); + if (!err) { -+ if (!aopen) -+ err = args->open(file, vfsub_file_flags(file), NULL); -+ else { ++ if (!aopen) { ++ err = args->open(file, vfsub_file_flags(file), ++ au_di(dentry)->di_htmpfile); ++ di_write_unlock(dentry); ++ } else { ++ di_downgrade_lock(dentry, AuLock_IR); + lockdep_off(); + err = args->open(file, vfsub_file_flags(file), + args->h_file); + lockdep_on(); ++ di_read_unlock(dentry, AuLock_IR); + } + } -+ di_read_unlock(dentry, AuLock_IR); + + finfo = au_fi(file); + if (!err) { @@ -15188,9 +15229,9 @@ index 000000000000..b0075b57d8bc + +/* cf. aufs_nopage() */ +/* for madvise(2) */ -+static int aufs_readpage(struct file *file __maybe_unused, struct page *page) ++static int aufs_read_folio(struct file *file __maybe_unused, struct folio *folio) +{ -+ unlock_page(page); ++ folio_unlock(folio); + return 0; +} + @@ -15201,7 +15242,7 @@ index 000000000000..b0075b57d8bc +/* they will never be called. */ +#ifdef CONFIG_AUFS_DEBUG +static int aufs_write_begin(struct file *file, struct address_space *mapping, -+ loff_t pos, unsigned len, unsigned flags, ++ loff_t pos, unsigned len, + struct page **pagep, void **fsdata) +{ AuUnsupport(); return 0; } +static int aufs_write_end(struct file *file, struct address_space *mapping, @@ -15211,29 +15252,23 @@ index 000000000000..b0075b57d8bc +static int aufs_writepage(struct page *page, struct writeback_control *wbc) +{ AuUnsupport(); return 0; } + -+static int aufs_set_page_dirty(struct page *page) -+{ AuUnsupport(); return 0; } -+static void aufs_invalidatepage(struct page *page, unsigned int offset, -+ unsigned int length) ++static bool aufs_dirty_folio(struct address_space *mapping, struct folio *folio) ++{ AuUnsupport(); return true; } ++static void aufs_invalidate_folio(struct folio *folio, size_t offset, size_t len) +{ AuUnsupport(); } -+static int aufs_releasepage(struct page *page, gfp_t gfp) -+{ AuUnsupport(); return 0; } ++static bool aufs_release_folio(struct folio *folio, gfp_t gfp) ++{ AuUnsupport(); return true; } +#if 0 /* called by memory compaction regardless file */ -+static int aufs_migratepage(struct address_space *mapping, struct page *newpage, -+ struct page *page, enum migrate_mode mode) ++static int aufs_migrate_folio(struct address_space *mapping, struct folio *dst, ++ struct folio *src, enum migrate_mode mode) +{ AuUnsupport(); return 0; } +#endif -+static bool aufs_isolate_page(struct page *page, isolate_mode_t mode) -+{ AuUnsupport(); return true; } -+static void aufs_putback_page(struct page *page) -+{ AuUnsupport(); } -+static int aufs_launder_page(struct page *page) ++static int aufs_launder_folio(struct folio *folio) +{ AuUnsupport(); return 0; } -+static int aufs_is_partially_uptodate(struct page *page, -+ unsigned long from, -+ unsigned long count) -+{ AuUnsupport(); return 0; } -+static void aufs_is_dirty_writeback(struct page *page, bool *dirty, ++static bool aufs_is_partially_uptodate(struct folio *folio, size_t from, ++ size_t count) ++{ AuUnsupport(); return true; } ++static void aufs_is_dirty_writeback(struct folio *folio, bool *dirty, + bool *writeback) +{ AuUnsupport(); } +static int aufs_error_remove_page(struct address_space *mapping, @@ -15244,44 +15279,45 @@ index 000000000000..b0075b57d8bc +{ AuUnsupport(); return 0; } +static void aufs_swap_deactivate(struct file *file) +{ AuUnsupport(); } ++static int aufs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) ++{ AuUnsupport(); return 0; } +#endif /* CONFIG_AUFS_DEBUG */ + +const struct address_space_operations aufs_aop = { -+ .readpage = aufs_readpage, ++ .read_folio = aufs_read_folio, + .direct_IO = aufs_direct_IO, +#ifdef CONFIG_AUFS_DEBUG + .writepage = aufs_writepage, + /* no writepages, because of writepage */ -+ .set_page_dirty = aufs_set_page_dirty, ++ .dirty_folio = aufs_dirty_folio, + /* no readpages, because of readpage */ + .write_begin = aufs_write_begin, + .write_end = aufs_write_end, + /* no bmap, no block device */ -+ .invalidatepage = aufs_invalidatepage, -+ .releasepage = aufs_releasepage, ++ .invalidate_folio = aufs_invalidate_folio, ++ .release_folio = aufs_release_folio, + /* is fallback_migrate_page ok? */ -+ /* .migratepage = aufs_migratepage, */ -+ .isolate_page = aufs_isolate_page, -+ .putback_page = aufs_putback_page, -+ .launder_page = aufs_launder_page, ++ /* .migrate_folio = aufs_migrate_folio, */ ++ .launder_folio = aufs_launder_folio, + .is_partially_uptodate = aufs_is_partially_uptodate, + .is_dirty_writeback = aufs_is_dirty_writeback, + .error_remove_page = aufs_error_remove_page, + .swap_activate = aufs_swap_activate, -+ .swap_deactivate = aufs_swap_deactivate ++ .swap_deactivate = aufs_swap_deactivate, ++ .swap_rw = aufs_swap_rw +#endif /* CONFIG_AUFS_DEBUG */ +}; diff --git a/fs/aufs/file.h b/fs/aufs/file.h new file mode 100644 -index 000000000000..d124d9c8216d +index 000000000000..b16f31e364a8 --- /dev/null +++ b/fs/aufs/file.h @@ -0,0 +1,342 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -15621,15 +15657,15 @@ index 000000000000..d124d9c8216d +#endif /* __AUFS_FILE_H__ */ diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c new file mode 100644 -index 000000000000..25077670a507 +index 000000000000..7da7b286c006 --- /dev/null +++ b/fs/aufs/finfo.c @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -15774,17 +15810,1265 @@ index 000000000000..25077670a507 +out: + return err; +} +diff --git a/fs/aufs/fsctx.c b/fs/aufs/fsctx.c +new file mode 100644 +index 000000000000..e14fe4d381c5 +--- /dev/null ++++ b/fs/aufs/fsctx.c +@@ -0,0 +1,1242 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (C) 2022 Junjiro R. Okajima ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see <http://www.gnu.org/licenses/>. ++ */ ++ ++/* ++ * fs context, aka new mount api ++ */ ++ ++#include <linux/fs_context.h> ++#include "aufs.h" ++ ++struct au_fsctx_opts { ++ aufs_bindex_t bindex; ++ unsigned char skipped; ++ struct au_opt *opt, *opt_tail; ++ struct super_block *sb; ++ struct au_sbinfo *sbinfo; ++ struct au_opts opts; ++}; ++ ++/* stop extra interpretation of errno in mount(8), and strange error messages */ ++static int cvt_err(int err) ++{ ++ AuTraceErr(err); ++ ++ switch (err) { ++ case -ENOENT: ++ case -ENOTDIR: ++ case -EEXIST: ++ case -EIO: ++ err = -EINVAL; ++ } ++ return err; ++} ++ ++static int au_fsctx_reconfigure(struct fs_context *fc) ++{ ++ int err, do_dx; ++ unsigned int mntflags; ++ struct dentry *root; ++ struct super_block *sb; ++ struct inode *inode; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ AuDbg("fc %p\n", fc); ++ ++ root = fc->root; ++ sb = root->d_sb; ++ err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); ++ if (!err) { ++ di_write_lock_child(root); ++ err = au_opts_verify(sb, fc->sb_flags, /*pending*/0); ++ aufs_write_unlock(root); ++ } ++ ++ inode = d_inode(root); ++ inode_lock(inode); ++ err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); ++ if (unlikely(err)) ++ goto out; ++ di_write_lock_child(root); ++ ++ /* au_opts_remount() may return an error */ ++ err = au_opts_remount(sb, &a->opts); ++ ++ if (au_ftest_opts(a->opts.flags, REFRESH)) ++ au_remount_refresh(sb, au_ftest_opts(a->opts.flags, ++ REFRESH_IDOP)); ++ ++ if (au_ftest_opts(a->opts.flags, REFRESH_DYAOP)) { ++ mntflags = au_mntflags(sb); ++ do_dx = !!au_opt_test(mntflags, DIO); ++ au_dy_arefresh(do_dx); ++ } ++ ++ au_fhsm_wrote_all(sb, /*force*/1); /* ?? */ ++ aufs_write_unlock(root); ++ ++out: ++ inode_unlock(inode); ++ err = cvt_err(err); ++ AuTraceErr(err); ++ ++ return err; ++} ++ ++/* ---------------------------------------------------------------------- */ ++ ++static int au_fsctx_fill_super(struct super_block *sb, struct fs_context *fc) ++{ ++ int err; ++ struct au_fsctx_opts *a = fc->fs_private; ++ struct au_sbinfo *sbinfo = a->sbinfo; ++ struct dentry *root; ++ struct inode *inode; ++ ++ sbinfo->si_sb = sb; ++ sb->s_fs_info = sbinfo; ++ kobject_get(&sbinfo->si_kobj); ++ ++ __si_write_lock(sb); ++ si_pid_set(sb); ++ au_sbilist_add(sb); ++ ++ /* all timestamps always follow the ones on the branch */ ++ sb->s_flags |= SB_NOATIME | SB_NODIRATIME; ++ sb->s_flags |= SB_I_VERSION; /* do we really need this? */ ++ sb->s_op = &aufs_sop; ++ sb->s_d_op = &aufs_dop; ++ sb->s_magic = AUFS_SUPER_MAGIC; ++ sb->s_maxbytes = 0; ++ sb->s_stack_depth = 1; ++ au_export_init(sb); ++ au_xattr_init(sb); ++ ++ err = au_alloc_root(sb); ++ if (unlikely(err)) { ++ si_write_unlock(sb); ++ goto out; ++ } ++ root = sb->s_root; ++ inode = d_inode(root); ++ ii_write_lock_parent(inode); ++ aufs_write_unlock(root); ++ ++ /* lock vfs_inode first, then aufs. */ ++ inode_lock(inode); ++ aufs_write_lock(root); ++ err = au_opts_mount(sb, &a->opts); ++ AuTraceErr(err); ++ if (!err && au_ftest_si(sbinfo, NO_DREVAL)) { ++ sb->s_d_op = &aufs_dop_noreval; ++ /* infofc(fc, "%ps", sb->s_d_op); */ ++ pr_info("%ps\n", sb->s_d_op); ++ au_refresh_dop(root, /*force_reval*/0); ++ sbinfo->si_iop_array = aufs_iop_nogetattr; ++ au_refresh_iop(inode, /*force_getattr*/0); ++ } ++ aufs_write_unlock(root); ++ inode_unlock(inode); ++ if (!err) ++ goto out; /* success */ ++ ++ dput(root); ++ sb->s_root = NULL; ++ ++out: ++ if (unlikely(err)) ++ kobject_put(&sbinfo->si_kobj); ++ AuTraceErr(err); ++ err = cvt_err(err); ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_get_tree(struct fs_context *fc) ++{ ++ int err; ++ ++ AuDbg("fc %p\n", fc); ++ err = get_tree_nodev(fc, au_fsctx_fill_super); ++ ++ AuTraceErr(err); ++ return err; ++} ++ ++/* ---------------------------------------------------------------------- */ ++ ++static void au_fsctx_dump(struct au_opts *opts) ++{ ++#ifdef CONFIG_AUFS_DEBUG ++ /* reduce stack space */ ++ union { ++ struct au_opt_add *add; ++ struct au_opt_del *del; ++ struct au_opt_mod *mod; ++ struct au_opt_xino *xino; ++ struct au_opt_xino_itrunc *xino_itrunc; ++ struct au_opt_wbr_create *create; ++ } u; ++ struct au_opt *opt; ++ ++ opt = opts->opt; ++ while (opt->type != Opt_tail) { ++ switch (opt->type) { ++ case Opt_add: ++ u.add = &opt->add; ++ AuDbg("add {b%d, %s, 0x%x, %p}\n", ++ u.add->bindex, u.add->pathname, u.add->perm, ++ u.add->path.dentry); ++ break; ++ case Opt_del: ++ fallthrough; ++ case Opt_idel: ++ u.del = &opt->del; ++ AuDbg("del {%s, %p}\n", ++ u.del->pathname, u.del->h_path.dentry); ++ break; ++ case Opt_mod: ++ fallthrough; ++ case Opt_imod: ++ u.mod = &opt->mod; ++ AuDbg("mod {%s, 0x%x, %p}\n", ++ u.mod->path, u.mod->perm, u.mod->h_root); ++ break; ++ case Opt_append: ++ u.add = &opt->add; ++ AuDbg("append {b%d, %s, 0x%x, %p}\n", ++ u.add->bindex, u.add->pathname, u.add->perm, ++ u.add->path.dentry); ++ break; ++ case Opt_prepend: ++ u.add = &opt->add; ++ AuDbg("prepend {b%d, %s, 0x%x, %p}\n", ++ u.add->bindex, u.add->pathname, u.add->perm, ++ u.add->path.dentry); ++ break; ++ ++ case Opt_dirwh: ++ AuDbg("dirwh %d\n", opt->dirwh); ++ break; ++ case Opt_rdcache: ++ AuDbg("rdcache %d\n", opt->rdcache); ++ break; ++ case Opt_rdblk: ++ AuDbg("rdblk %d\n", opt->rdblk); ++ break; ++ case Opt_rdhash: ++ AuDbg("rdhash %u\n", opt->rdhash); ++ break; ++ ++ case Opt_xino: ++ u.xino = &opt->xino; ++ AuDbg("xino {%s %pD}\n", u.xino->path, u.xino->file); ++ break; ++ ++#define au_fsctx_TF(name) \ ++ case Opt_##name: \ ++ if (opt->tf) \ ++ AuLabel(name); \ ++ else \ ++ AuLabel(no##name); \ ++ break; ++ ++ /* simple true/false flag */ ++ au_fsctx_TF(trunc_xino); ++ au_fsctx_TF(trunc_xib); ++ au_fsctx_TF(dirperm1); ++ au_fsctx_TF(plink); ++ au_fsctx_TF(shwh); ++ au_fsctx_TF(dio); ++ au_fsctx_TF(warn_perm); ++ au_fsctx_TF(verbose); ++ au_fsctx_TF(sum); ++ au_fsctx_TF(dirren); ++ au_fsctx_TF(acl); ++#undef au_fsctx_TF ++ ++ case Opt_trunc_xino_path: ++ fallthrough; ++ case Opt_itrunc_xino: ++ u.xino_itrunc = &opt->xino_itrunc; ++ AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex); ++ break; ++ case Opt_noxino: ++ AuLabel(noxino); ++ break; ++ ++ case Opt_list_plink: ++ AuLabel(list_plink); ++ break; ++ case Opt_udba: ++ AuDbg("udba %d, %s\n", ++ opt->udba, au_optstr_udba(opt->udba)); ++ break; ++ case Opt_diropq_a: ++ AuLabel(diropq_a); ++ break; ++ case Opt_diropq_w: ++ AuLabel(diropq_w); ++ break; ++ case Opt_wsum: ++ AuLabel(wsum); ++ break; ++ case Opt_wbr_create: ++ u.create = &opt->wbr_create; ++ AuDbg("create %d, %s\n", u.create->wbr_create, ++ au_optstr_wbr_create(u.create->wbr_create)); ++ switch (u.create->wbr_create) { ++ case AuWbrCreate_MFSV: ++ fallthrough; ++ case AuWbrCreate_PMFSV: ++ AuDbg("%d sec\n", u.create->mfs_second); ++ break; ++ case AuWbrCreate_MFSRR: ++ fallthrough; ++ case AuWbrCreate_TDMFS: ++ AuDbg("%llu watermark\n", ++ u.create->mfsrr_watermark); ++ break; ++ case AuWbrCreate_MFSRRV: ++ fallthrough; ++ case AuWbrCreate_TDMFSV: ++ fallthrough; ++ case AuWbrCreate_PMFSRRV: ++ AuDbg("%llu watermark, %d sec\n", ++ u.create->mfsrr_watermark, ++ u.create->mfs_second); ++ break; ++ } ++ break; ++ case Opt_wbr_copyup: ++ AuDbg("copyup %d, %s\n", opt->wbr_copyup, ++ au_optstr_wbr_copyup(opt->wbr_copyup)); ++ break; ++ case Opt_fhsm_sec: ++ AuDbg("fhsm_sec %u\n", opt->fhsm_second); ++ break; ++ ++ default: ++ AuDbg("type %d\n", opt->type); ++ BUG(); ++ } ++ opt++; ++ } ++#endif ++} ++ ++/* ---------------------------------------------------------------------- */ ++ ++/* ++ * For conditionally compiled mount options. ++ * Instead of fsparam_flag_no(), use this macro to distinguish ignore_silent. ++ */ ++#define au_ignore_flag(name, action) \ ++ fsparam_flag(name, action), \ ++ fsparam_flag("no" name, Opt_ignore_silent) ++ ++const struct fs_parameter_spec aufs_fsctx_paramspec[] = { ++ fsparam_string("br", Opt_br), ++ ++ /* "add=%d:%s" or "ins=%d:%s" */ ++ fsparam_string("add", Opt_add), ++ fsparam_string("ins", Opt_add), ++ fsparam_path("append", Opt_append), ++ fsparam_path("prepend", Opt_prepend), ++ ++ fsparam_path("del", Opt_del), ++ /* fsparam_s32("idel", Opt_idel), */ ++ fsparam_path("mod", Opt_mod), ++ /* fsparam_string("imod", Opt_imod), */ ++ ++ fsparam_s32("dirwh", Opt_dirwh), ++ ++ fsparam_path("xino", Opt_xino), ++ fsparam_flag("noxino", Opt_noxino), ++ fsparam_flag_no("trunc_xino", Opt_trunc_xino), ++ /* "trunc_xino_v=%d:%d" */ ++ /* fsparam_string("trunc_xino_v", Opt_trunc_xino_v), */ ++ fsparam_path("trunc_xino", Opt_trunc_xino_path), ++ fsparam_s32("itrunc_xino", Opt_itrunc_xino), ++ /* fsparam_path("zxino", Opt_zxino), */ ++ fsparam_flag_no("trunc_xib", Opt_trunc_xib), ++ ++#ifdef CONFIG_PROC_FS ++ fsparam_flag_no("plink", Opt_plink), ++#else ++ au_ignore_flag("plink", Opt_ignore), ++#endif ++ ++#ifdef CONFIG_AUFS_DEBUG ++ fsparam_flag("list_plink", Opt_list_plink), ++#endif ++ ++ fsparam_string("udba", Opt_udba), ++ ++ fsparam_flag_no("dio", Opt_dio), ++ ++#ifdef CONFIG_AUFS_DIRREN ++ fsparam_flag_no("dirren", Opt_dirren), ++#else ++ au_ignore_flag("dirren", Opt_ignore), ++#endif ++ ++#ifdef CONFIG_AUFS_FHSM ++ fsparam_s32("fhsm_sec", Opt_fhsm_sec), ++#else ++ fsparam_s32("fhsm_sec", Opt_ignore), ++#endif ++ ++ /* always | a | whiteouted | w */ ++ fsparam_string("diropq", Opt_diropq), ++ ++ fsparam_flag_no("warn_perm", Opt_warn_perm), ++ ++#ifdef CONFIG_AUFS_SHWH ++ fsparam_flag_no("shwh", Opt_shwh), ++#else ++ au_ignore_flag("shwh", Opt_err), ++#endif ++ ++ fsparam_flag_no("dirperm1", Opt_dirperm1), ++ ++ fsparam_flag_no("verbose", Opt_verbose), ++ fsparam_flag("v", Opt_verbose), ++ fsparam_flag("quiet", Opt_noverbose), ++ fsparam_flag("q", Opt_noverbose), ++ /* user-space may handle this */ ++ fsparam_flag("silent", Opt_noverbose), ++ ++ fsparam_flag_no("sum", Opt_sum), ++ fsparam_flag("wsum", Opt_wsum), ++ ++ fsparam_s32("rdcache", Opt_rdcache), ++ /* "def" or s32 */ ++ fsparam_string("rdblk", Opt_rdblk), ++ /* "def" or s32 */ ++ fsparam_string("rdhash", Opt_rdhash), ++ ++ fsparam_string("create", Opt_wbr_create), ++ fsparam_string("create_policy", Opt_wbr_create), ++ fsparam_string("cpup", Opt_wbr_copyup), ++ fsparam_string("copyup", Opt_wbr_copyup), ++ fsparam_string("copyup_policy", Opt_wbr_copyup), ++ ++ /* generic VFS flag */ ++#ifdef CONFIG_FS_POSIX_ACL ++ fsparam_flag_no("acl", Opt_acl), ++#else ++ au_ignore_flag("acl", Opt_ignore), ++#endif ++ ++ /* internal use for the scripts */ ++ fsparam_string("si", Opt_ignore_silent), ++ ++ /* obsoleted, keep them temporary */ ++ fsparam_flag("nodlgt", Opt_ignore_silent), ++ fsparam_flag("clean_plink", Opt_ignore), ++ fsparam_string("dirs", Opt_br), ++ fsparam_u32("debug", Opt_ignore), ++ /* "whiteout" or "all" */ ++ fsparam_string("delete", Opt_ignore), ++ fsparam_string("imap", Opt_ignore), ++ ++ /* temporary workaround, due to old mount(8)? */ ++ fsparam_flag("relatime", Opt_ignore_silent), ++ ++ {} ++}; ++ ++static int au_fsctx_parse_do_add(struct fs_context *fc, struct au_opt *opt, ++ char *brspec, size_t speclen, ++ aufs_bindex_t bindex) ++{ ++ int err; ++ char *p; ++ ++ AuDbg("brspec %s\n", brspec); ++ ++ err = -ENOMEM; ++ if (!speclen) ++ speclen = strlen(brspec); ++ /* will be freed by au_fsctx_free() */ ++ p = kmemdup_nul(brspec, speclen, GFP_NOFS); ++ if (unlikely(!p)) { ++ errorfc(fc, "failed in %s", brspec); ++ goto out; ++ } ++ err = au_opt_add(opt, p, fc->sb_flags, bindex); ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_parse_br(struct fs_context *fc, char *brspec) ++{ ++ int err; ++ char *p; ++ struct au_fsctx_opts *a = fc->fs_private; ++ struct au_opt *opt = a->opt; ++ aufs_bindex_t bindex = a->bindex; ++ ++ AuDbg("brspec %s\n", brspec); ++ ++ err = -EINVAL; ++ while ((p = strsep(&brspec, ":")) && *p) { ++ err = au_fsctx_parse_do_add(fc, opt, p, /*len*/0, bindex); ++ AuTraceErr(err); ++ if (unlikely(err)) ++ break; ++ bindex++; ++ opt++; ++ if (unlikely(opt > a->opt_tail)) { ++ err = -E2BIG; ++ bindex--; ++ opt--; ++ break; ++ } ++ opt->type = Opt_tail; ++ a->skipped = 1; ++ } ++ a->bindex = bindex; ++ a->opt = opt; ++ ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_parse_add(struct fs_context *fc, char *addspec) ++{ ++ int err, n; ++ char *p; ++ struct au_fsctx_opts *a = fc->fs_private; ++ struct au_opt *opt = a->opt; ++ ++ err = -EINVAL; ++ p = strchr(addspec, ':'); ++ if (unlikely(!p)) { ++ errorfc(fc, "bad arg in %s", addspec); ++ goto out; ++ } ++ *p++ = '\0'; ++ err = kstrtoint(addspec, 0, &n); ++ if (unlikely(err)) { ++ errorfc(fc, "bad integer in %s", addspec); ++ goto out; ++ } ++ AuDbg("n %d\n", n); ++ err = au_fsctx_parse_do_add(fc, opt, p, /*len*/0, n); ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_parse_del(struct fs_context *fc, struct au_opt_del *del, ++ struct fs_parameter *param) ++{ ++ int err; ++ ++ err = -ENOMEM; ++ /* will be freed by au_fsctx_free() */ ++ del->pathname = kmemdup_nul(param->string, param->size, GFP_NOFS); ++ if (unlikely(!del->pathname)) ++ goto out; ++ AuDbg("del %s\n", del->pathname); ++ err = vfsub_kern_path(del->pathname, AuOpt_LkupDirFlags, &del->h_path); ++ if (unlikely(err)) ++ errorfc(fc, "lookup failed %s (%d)", del->pathname, err); ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++#if 0 /* reserved for future use */ ++static int au_fsctx_parse_idel(struct fs_context *fc, struct au_opt_del *del, ++ aufs_bindex_t bindex) ++{ ++ int err; ++ struct super_block *sb; ++ struct dentry *root; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ sb = a->sb; ++ AuDebugOn(!sb); ++ ++ err = -EINVAL; ++ root = sb->s_root; ++ aufs_read_lock(root, AuLock_FLUSH); ++ if (bindex < 0 || au_sbbot(sb) < bindex) { ++ errorfc(fc, "out of bounds, %d", bindex); ++ goto out; ++ } ++ ++ err = 0; ++ del->h_path.dentry = dget(au_h_dptr(root, bindex)); ++ del->h_path.mnt = mntget(au_sbr_mnt(sb, bindex)); ++ ++out: ++ aufs_read_unlock(root, !AuLock_IR); ++ AuTraceErr(err); ++ return err; ++} ++#endif ++ ++static int au_fsctx_parse_mod(struct fs_context *fc, struct au_opt_mod *mod, ++ struct fs_parameter *param) ++{ ++ int err; ++ struct path path; ++ char *p; ++ ++ err = -ENOMEM; ++ /* will be freed by au_fsctx_free() */ ++ mod->path = kmemdup_nul(param->string, param->size, GFP_NOFS); ++ if (unlikely(!mod->path)) ++ goto out; ++ ++ err = -EINVAL; ++ p = strchr(mod->path, '='); ++ if (unlikely(!p)) { ++ errorfc(fc, "no permission %s", mod->path); ++ goto out; ++ } ++ ++ *p++ = 0; ++ err = vfsub_kern_path(mod->path, AuOpt_LkupDirFlags, &path); ++ if (unlikely(err)) { ++ errorfc(fc, "lookup failed %s (%d)", mod->path, err); ++ goto out; ++ } ++ ++ mod->perm = au_br_perm_val(p); ++ AuDbg("mod path %s, perm 0x%x, %s", mod->path, mod->perm, p); ++ mod->h_root = dget(path.dentry); ++ path_put(&path); ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++#if 0 /* reserved for future use */ ++static int au_fsctx_parse_imod(struct fs_context *fc, struct au_opt_mod *mod, ++ char *ibrspec) ++{ ++ int err, n; ++ char *p; ++ struct super_block *sb; ++ struct dentry *root; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ sb = a->sb; ++ AuDebugOn(!sb); ++ ++ err = -EINVAL; ++ p = strchr(ibrspec, ':'); ++ if (unlikely(!p)) { ++ errorfc(fc, "no index, %s", ibrspec); ++ goto out; ++ } ++ *p++ = '\0'; ++ err = kstrtoint(ibrspec, 0, &n); ++ if (unlikely(err)) { ++ errorfc(fc, "bad integer in %s", ibrspec); ++ goto out; ++ } ++ AuDbg("n %d\n", n); ++ ++ root = sb->s_root; ++ aufs_read_lock(root, AuLock_FLUSH); ++ if (n < 0 || au_sbbot(sb) < n) { ++ errorfc(fc, "out of bounds, %d", bindex); ++ goto out_root; ++ } ++ ++ err = 0; ++ mod->perm = au_br_perm_val(p); ++ AuDbg("mod path %s, perm 0x%x, %s\n", ++ mod->path, mod->perm, p); ++ mod->h_root = dget(au_h_dptr(root, bindex)); ++ ++out_root: ++ aufs_read_unlock(root, !AuLock_IR); ++out: ++ AuTraceErr(err); ++ return err; ++} ++#endif ++ ++static int au_fsctx_parse_xino(struct fs_context *fc, ++ struct au_opt_xino *xino, ++ struct fs_parameter *param) ++{ ++ int err; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ err = -ENOMEM; ++ /* will be freed by au_opts_free() */ ++ xino->path = kmemdup_nul(param->string, param->size, GFP_NOFS); ++ if (unlikely(!xino->path)) ++ goto out; ++ AuDbg("path %s\n", xino->path); ++ ++ xino->file = au_xino_create(a->sb, xino->path, /*silent*/0, ++ /*wbrtop*/0); ++ err = PTR_ERR(xino->file); ++ if (IS_ERR(xino->file)) { ++ xino->file = NULL; ++ goto out; ++ } ++ ++ err = 0; ++ if (unlikely(a->sb && xino->file->f_path.dentry->d_sb == a->sb)) { ++ err = -EINVAL; ++ errorfc(fc, "%s must be outside", xino->path); ++ } ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++static ++int au_fsctx_parse_xino_itrunc_path(struct fs_context *fc, ++ struct au_opt_xino_itrunc *xino_itrunc, ++ char *pathname) ++{ ++ int err; ++ aufs_bindex_t bbot, bindex; ++ struct path path; ++ struct dentry *root; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ AuDebugOn(!a->sb); ++ ++ err = vfsub_kern_path(pathname, AuOpt_LkupDirFlags, &path); ++ if (unlikely(err)) { ++ errorfc(fc, "lookup failed %s (%d)", pathname, err); ++ goto out; ++ } ++ ++ xino_itrunc->bindex = -1; ++ root = a->sb->s_root; ++ aufs_read_lock(root, AuLock_FLUSH); ++ bbot = au_sbbot(a->sb); ++ for (bindex = 0; bindex <= bbot; bindex++) { ++ if (au_h_dptr(root, bindex) == path.dentry) { ++ xino_itrunc->bindex = bindex; ++ break; ++ } ++ } ++ aufs_read_unlock(root, !AuLock_IR); ++ path_put(&path); ++ ++ if (unlikely(xino_itrunc->bindex < 0)) { ++ err = -EINVAL; ++ errorfc(fc, "no such branch %s", pathname); ++ } ++ ++out: ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_parse_xino_itrunc(struct fs_context *fc, ++ struct au_opt_xino_itrunc *xino_itrunc, ++ unsigned int bindex) ++{ ++ int err; ++ aufs_bindex_t bbot; ++ struct super_block *sb; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ sb = a->sb; ++ AuDebugOn(!sb); ++ ++ err = 0; ++ si_noflush_read_lock(sb); ++ bbot = au_sbbot(sb); ++ si_read_unlock(sb); ++ if (bindex <= bbot) ++ xino_itrunc->bindex = bindex; ++ else { ++ err = -EINVAL; ++ errorfc(fc, "out of bounds, %u", bindex); ++ } ++ ++ AuTraceErr(err); ++ return err; ++} ++ ++static int au_fsctx_parse_param(struct fs_context *fc, struct fs_parameter *param) ++{ ++ int err, token; ++ struct fs_parse_result result; ++ struct au_fsctx_opts *a = fc->fs_private; ++ struct au_opt *opt = a->opt; ++ ++ AuDbg("fc %p, param {key %s, string %s}\n", ++ fc, param->key, param->string); ++ err = fs_parse(fc, aufs_fsctx_paramspec, param, &result); ++ if (unlikely(err < 0)) ++ goto out; ++ token = err; ++ AuDbg("token %d, res{negated %d, uint64 %llu}\n", ++ token, result.negated, result.uint_64); ++ ++ err = -EINVAL; ++ a->skipped = 0; ++ switch (token) { ++ case Opt_br: ++ err = au_fsctx_parse_br(fc, param->string); ++ break; ++ case Opt_add: ++ err = au_fsctx_parse_add(fc, param->string); ++ break; ++ case Opt_append: ++ err = au_fsctx_parse_do_add(fc, opt, param->string, param->size, ++ /*dummy bindex*/1); ++ break; ++ case Opt_prepend: ++ err = au_fsctx_parse_do_add(fc, opt, param->string, param->size, ++ /*bindex*/0); ++ break; ++ ++ case Opt_del: ++ err = au_fsctx_parse_del(fc, &opt->del, param); ++ break; ++#if 0 /* reserved for future use */ ++ case Opt_idel: ++ if (!a->sb) { ++ err = 0; ++ a->skipped = 1; ++ break; ++ } ++ del->pathname = "(indexed)"; ++ err = au_opts_parse_idel(fc, &opt->del, result.uint_32); ++ break; ++#endif ++ ++ case Opt_mod: ++ err = au_fsctx_parse_mod(fc, &opt->mod, param); ++ break; ++#ifdef IMOD /* reserved for future use */ ++ case Opt_imod: ++ if (!a->sb) { ++ err = 0; ++ a->skipped = 1; ++ break; ++ } ++ u.mod->path = "(indexed)"; ++ err = au_opts_parse_imod(fc, &opt->mod, param->string); ++ break; ++#endif ++ ++ case Opt_xino: ++ err = au_fsctx_parse_xino(fc, &opt->xino, param); ++ break; ++ case Opt_trunc_xino_path: ++ if (!a->sb) { ++ errorfc(fc, "no such branch %s", param->string); ++ break; ++ } ++ err = au_fsctx_parse_xino_itrunc_path(fc, &opt->xino_itrunc, ++ param->string); ++ break; ++#if 0 ++ case Opt_trunc_xino_v: ++ if (!a->sb) { ++ err = 0; ++ a->skipped = 1; ++ break; ++ } ++ err = au_fsctx_parse_xino_itrunc_path(fc, &opt->xino_itrunc, ++ param->string); ++ break; ++#endif ++ case Opt_itrunc_xino: ++ if (!a->sb) { ++ errorfc(fc, "out of bounds %s", param->string); ++ break; ++ } ++ err = au_fsctx_parse_xino_itrunc(fc, &opt->xino_itrunc, ++ result.int_32); ++ break; ++ ++ case Opt_dirwh: ++ err = 0; ++ opt->dirwh = result.int_32; ++ break; ++ ++ case Opt_rdcache: ++ if (unlikely(result.int_32 > AUFS_RDCACHE_MAX)) { ++ errorfc(fc, "rdcache must be smaller than %d", ++ AUFS_RDCACHE_MAX); ++ break; ++ } ++ err = 0; ++ opt->rdcache = result.int_32; ++ break; ++ ++ case Opt_rdblk: ++ err = 0; ++ opt->rdblk = AUFS_RDBLK_DEF; ++ if (!strcmp(param->string, "def")) ++ break; ++ ++ err = kstrtoint(param->string, 0, &result.int_32); ++ if (unlikely(err)) { ++ errorfc(fc, "bad value in %s", param->key); ++ break; ++ } ++ err = -EINVAL; ++ if (unlikely(result.int_32 < 0 ++ || result.int_32 > KMALLOC_MAX_SIZE)) { ++ errorfc(fc, "bad value in %s", param->key); ++ break; ++ } ++ if (unlikely(result.int_32 && result.int_32 < NAME_MAX)) { ++ errorfc(fc, "rdblk must be larger than %d", NAME_MAX); ++ break; ++ } ++ err = 0; ++ opt->rdblk = result.int_32; ++ break; ++ ++ case Opt_rdhash: ++ err = 0; ++ opt->rdhash = AUFS_RDHASH_DEF; ++ if (!strcmp(param->string, "def")) ++ break; ++ ++ err = kstrtoint(param->string, 0, &result.int_32); ++ if (unlikely(err)) { ++ errorfc(fc, "bad value in %s", param->key); ++ break; ++ } ++ /* how about zero? */ ++ if (result.int_32 < 0 ++ || result.int_32 * sizeof(struct hlist_head) ++ > KMALLOC_MAX_SIZE) { ++ err = -EINVAL; ++ errorfc(fc, "bad integer in %s", param->key); ++ break; ++ } ++ opt->rdhash = result.int_32; ++ break; ++ ++ case Opt_diropq: ++ /* ++ * As other options, fs/aufs/opts.c can handle these strings by ++ * match_token(). But "diropq=" is deprecated now and will ++ * never have other value. So simple strcmp() is enough here. ++ */ ++ if (!strcmp(param->string, "a") || ++ !strcmp(param->string, "always")) { ++ err = 0; ++ opt->type = Opt_diropq_a; ++ } else if (!strcmp(param->string, "w") || ++ !strcmp(param->string, "whiteouted")) { ++ err = 0; ++ opt->type = Opt_diropq_w; ++ } else ++ errorfc(fc, "unknown value %s", param->string); ++ break; ++ ++ case Opt_udba: ++ opt->udba = au_udba_val(param->string); ++ if (opt->udba >= 0) ++ err = 0; ++ else ++ errorf(fc, "wrong value, %s", param->string); ++ break; ++ ++ case Opt_wbr_create: ++ opt->wbr_create.wbr_create ++ = au_wbr_create_val(param->string, &opt->wbr_create); ++ if (opt->wbr_create.wbr_create >= 0) ++ err = 0; ++ else ++ errorf(fc, "wrong value, %s", param->key); ++ break; ++ ++ case Opt_wbr_copyup: ++ opt->wbr_copyup = au_wbr_copyup_val(param->string); ++ if (opt->wbr_copyup >= 0) ++ err = 0; ++ else ++ errorfc(fc, "wrong value, %s", param->key); ++ break; ++ ++ case Opt_fhsm_sec: ++ if (unlikely(result.int_32 < 0)) { ++ errorfc(fc, "bad integer in %s\n", param->key); ++ break; ++ } ++ err = 0; ++ if (sysaufs_brs) ++ opt->fhsm_second = result.int_32; ++ else ++ warnfc(fc, "ignored %s %s", param->key, param->string); ++ break; ++ ++ /* simple true/false flag */ ++#define au_fsctx_TF(name) \ ++ case Opt_##name: \ ++ err = 0; \ ++ opt->tf = !result.negated; \ ++ break ++ au_fsctx_TF(trunc_xino); ++ au_fsctx_TF(trunc_xib); ++ au_fsctx_TF(dirperm1); ++ au_fsctx_TF(plink); ++ au_fsctx_TF(shwh); ++ au_fsctx_TF(dio); ++ au_fsctx_TF(warn_perm); ++ au_fsctx_TF(verbose); ++ au_fsctx_TF(sum); ++ au_fsctx_TF(dirren); ++ au_fsctx_TF(acl); ++#undef au_fsctx_TF ++ ++ case Opt_noverbose: ++ err = 0; ++ opt->type = Opt_verbose; ++ opt->tf = false; ++ break; ++ ++ case Opt_noxino: ++ fallthrough; ++ case Opt_list_plink: ++ fallthrough; ++ case Opt_wsum: ++ err = 0; ++ break; ++ ++ case Opt_ignore: ++ warnfc(fc, "ignored %s", param->key); ++ fallthrough; ++ case Opt_ignore_silent: ++ a->skipped = 1; ++ err = 0; ++ break; ++ default: ++ a->skipped = 1; ++ err = -ENOPARAM; ++ break; ++ } ++ if (unlikely(err)) ++ goto out; ++ if (a->skipped) ++ goto out; ++ ++ switch (token) { ++ case Opt_br: ++ fallthrough; ++ case Opt_noverbose: ++ fallthrough; ++ case Opt_diropq: ++ break; ++ default: ++ opt->type = token; ++ break; ++ } ++ opt++; ++ if (unlikely(opt > a->opt_tail)) { ++ err = -E2BIG; ++ opt--; ++ } ++ opt->type = Opt_tail; ++ a->opt = opt; ++ ++out: ++ return err; ++} ++ ++/* ++ * these options accept both 'name=val' and 'name:val' form. ++ * some accept optional '=' in its value. ++ * eg. br:/br1=rw:/br2=ro and br=/br1=rw:/br2=ro ++ */ ++static inline unsigned int is_colonopt(char *str) ++{ ++#define do_test(name) \ ++ if (!strncmp(str, name ":", sizeof(name))) \ ++ return sizeof(name) - 1 ++ do_test("br"); ++ do_test("add"); ++ do_test("ins"); ++ do_test("append"); ++ do_test("prepend"); ++ do_test("del"); ++ /* do_test("idel"); */ ++ do_test("mod"); ++ /* do_test("imod"); */ ++#undef do_test ++ ++ return 0; ++} ++ ++static int au_fsctx_parse_monolithic(struct fs_context *fc, void *data) ++{ ++ int err; ++ unsigned int u; ++ char *str; ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ str = data; ++ AuDbg("str %s\n", str); ++ while (str) { ++ u = is_colonopt(str); ++ if (u) ++ str[u] = '='; ++ str = strchr(str, ','); ++ if (!str) ++ break; ++ str++; ++ } ++ str = data; ++ AuDbg("str %s\n", str); ++ ++ err = generic_parse_monolithic(fc, str); ++ AuTraceErr(err); ++ au_fsctx_dump(&a->opts); ++ ++ return err; ++} ++ ++/* ---------------------------------------------------------------------- */ ++ ++static void au_fsctx_opts_free(struct au_opts *opts) ++{ ++ struct au_opt *opt; ++ ++ opt = opts->opt; ++ while (opt->type != Opt_tail) { ++ switch (opt->type) { ++ case Opt_add: ++ fallthrough; ++ case Opt_append: ++ fallthrough; ++ case Opt_prepend: ++ kfree(opt->add.pathname); ++ path_put(&opt->add.path); ++ break; ++ case Opt_del: ++ kfree(opt->del.pathname); ++ fallthrough; ++ case Opt_idel: ++ path_put(&opt->del.h_path); ++ break; ++ case Opt_mod: ++ kfree(opt->mod.path); ++ fallthrough; ++ case Opt_imod: ++ dput(opt->mod.h_root); ++ break; ++ case Opt_xino: ++ kfree(opt->xino.path); ++ fput(opt->xino.file); ++ break; ++ } ++ opt++; ++ } ++} ++ ++static void au_fsctx_free(struct fs_context *fc) ++{ ++ struct au_fsctx_opts *a = fc->fs_private; ++ ++ /* fs_type=%p, root=%pD */ ++ AuDbg("fc %p{sb_flags 0x%x, sb_flags_mask 0x%x, purpose %u\n", ++ fc, fc->sb_flags, fc->sb_flags_mask, fc->purpose); ++ ++ kobject_put(&a->sbinfo->si_kobj); ++ au_fsctx_opts_free(&a->opts); ++ free_page((unsigned long)a->opts.opt); ++ au_kfree_rcu(a); ++} ++ ++static const struct fs_context_operations au_fsctx_ops = { ++ .free = au_fsctx_free, ++ .parse_param = au_fsctx_parse_param, ++ .parse_monolithic = au_fsctx_parse_monolithic, ++ .get_tree = au_fsctx_get_tree, ++ .reconfigure = au_fsctx_reconfigure ++ /* ++ * nfs4 requires ->dup()? No. ++ * I don't know what is this ->dup() for. ++ */ ++}; ++ ++int aufs_fsctx_init(struct fs_context *fc) ++{ ++ int err; ++ struct au_fsctx_opts *a; ++ ++ /* fs_type=%p, root=%pD */ ++ AuDbg("fc %p{sb_flags 0x%x, sb_flags_mask 0x%x, purpose %u\n", ++ fc, fc->sb_flags, fc->sb_flags_mask, fc->purpose); ++ ++ /* they will be freed by au_fsctx_free() */ ++ err = -ENOMEM; ++ a = kzalloc(sizeof(*a), GFP_NOFS); ++ if (unlikely(!a)) ++ goto out; ++ a->bindex = 0; ++ a->opts.opt = (void *)__get_free_page(GFP_NOFS); ++ if (unlikely(!a->opts.opt)) ++ goto out_a; ++ a->opt = a->opts.opt; ++ a->opt->type = Opt_tail; ++ a->opts.max_opt = PAGE_SIZE / sizeof(*a->opts.opt); ++ a->opt_tail = a->opt + a->opts.max_opt - 1; ++ a->opts.sb_flags = fc->sb_flags; ++ ++ a->sb = NULL; ++ if (fc->root) { ++ AuDebugOn(fc->purpose != FS_CONTEXT_FOR_RECONFIGURE); ++ a->opts.flags = AuOpts_REMOUNT; ++ a->sb = fc->root->d_sb; ++ a->sbinfo = au_sbi(a->sb); ++ kobject_get(&a->sbinfo->si_kobj); ++ } else { ++ a->sbinfo = au_si_alloc(a->sb); ++ AuDebugOn(!a->sbinfo); ++ err = PTR_ERR(a->sbinfo); ++ if (IS_ERR(a->sbinfo)) ++ goto out_opt; ++ au_rw_write_unlock(&a->sbinfo->si_rwsem); ++ } ++ ++ err = 0; ++ fc->fs_private = a; ++ fc->ops = &au_fsctx_ops; ++ goto out; /* success */ ++ ++out_opt: ++ free_page((unsigned long)a->opts.opt); ++out_a: ++ au_kfree_rcu(a); ++out: ++ AuTraceErr(err); ++ return err; ++} diff --git a/fs/aufs/fstype.h b/fs/aufs/fstype.h new file mode 100644 -index 000000000000..af4bc6c0dd42 +index 000000000000..24ff0d64c219 --- /dev/null +++ b/fs/aufs/fstype.h @@ -0,0 +1,401 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -16183,15 +17467,15 @@ index 000000000000..af4bc6c0dd42 +#endif /* __AUFS_FSTYPE_H__ */ diff --git a/fs/aufs/hbl.h b/fs/aufs/hbl.h new file mode 100644 -index 000000000000..4d5016bccc51 +index 000000000000..7e1e66db0264 --- /dev/null +++ b/fs/aufs/hbl.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2017-2020 Junjiro R. Okajima ++ * Copyright (C) 2017-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -16254,15 +17538,15 @@ index 000000000000..4d5016bccc51 +#endif /* __AUFS_HBL_H__ */ diff --git a/fs/aufs/hfsnotify.c b/fs/aufs/hfsnotify.c new file mode 100644 -index 000000000000..d0abe8ac783f +index 000000000000..caa900cea3a0 --- /dev/null +++ b/fs/aufs/hfsnotify.c -@@ -0,0 +1,288 @@ +@@ -0,0 +1,290 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -16430,7 +17714,8 @@ index 000000000000..d0abe8ac783f + struct inode *h_dir, *h_inode; + struct fsnotify_mark *inode_mark; + -+ AuDebugOn(data_type != FSNOTIFY_EVENT_INODE); ++ AuDebugOn(!(data_type == FSNOTIFY_EVENT_INODE ++ || data_type == FSNOTIFY_EVENT_DENTRY)); + + err = 0; + /* if FS_UNMOUNT happens, there must be another bug */ @@ -16442,11 +17727,11 @@ index 000000000000..d0abe8ac783f + h_inode = NULL; +#ifdef AuDbgHnotify + au_debug_on(); -+ if (1 || h_child_qstr.len != sizeof(AUFS_XINO_FNAME) - 1 -+ || strncmp(h_child_qstr.name, AUFS_XINO_FNAME, h_child_qstr.len)) { ++ if (1 || file_name.len != sizeof(AUFS_XINO_FNAME) - 1 ++ || strncmp(file_name.name, AUFS_XINO_FNAME, file_name.len)) { + AuDbg("i%lu, mask 0x%x %s, hcname %.*s, hi%lu\n", + h_dir->i_ino, mask, au_hfsn_name(mask), -+ AuLNPair(&h_child_qstr), h_inode ? h_inode->i_ino : 0); ++ AuLNPair(file_name), h_inode ? h_inode->i_ino : 0); + /* WARN_ON(1); */ + } + au_debug_off(); @@ -16498,7 +17783,8 @@ index 000000000000..d0abe8ac783f + goto out; + + err = 0; -+ group = fsnotify_alloc_group(&au_hfsn_ops); ++ group = fsnotify_alloc_group(&au_hfsn_ops, ++ /*flags - not for userspace*/0); + if (IS_ERR(group)) { + err = PTR_ERR(group); + pr_err("fsnotify_alloc_group() failed, %d\n", err); @@ -16548,15 +17834,15 @@ index 000000000000..d0abe8ac783f +}; diff --git a/fs/aufs/hfsplus.c b/fs/aufs/hfsplus.c new file mode 100644 -index 000000000000..d250f019bedf +index 000000000000..c626ff2128c6 --- /dev/null +++ b/fs/aufs/hfsplus.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2010-2020 Junjiro R. Okajima ++ * Copyright (C) 2010-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -16614,15 +17900,15 @@ index 000000000000..d250f019bedf +} diff --git a/fs/aufs/hnotify.c b/fs/aufs/hnotify.c new file mode 100644 -index 000000000000..ff3f8b96d4ec +index 000000000000..8ca8c98d40a3 --- /dev/null +++ b/fs/aufs/hnotify.c @@ -0,0 +1,715 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -17335,15 +18621,15 @@ index 000000000000..ff3f8b96d4ec +} diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c new file mode 100644 -index 000000000000..9826b9d58c39 +index 000000000000..141620c2e0bd --- /dev/null +++ b/fs/aufs/i_op.c -@@ -0,0 +1,1513 @@ +@@ -0,0 +1,1517 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -17362,9 +18648,9 @@ index 000000000000..9826b9d58c39 + */ + +#include <linux/device_cgroup.h> ++#include <linux/filelock.h> +#include <linux/fs_stack.h> +#include <linux/iversion.h> -+#include <linux/namei.h> +#include <linux/security.h> +#include "aufs.h" + @@ -17373,7 +18659,7 @@ index 000000000000..9826b9d58c39 +{ + int err; + const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + err = -EPERM; + if (write_mask && IS_IMMUTABLE(h_inode)) @@ -17393,21 +18679,22 @@ index 000000000000..9826b9d58c39 + * - nfs always sets SB_POSIXACL regardless its mount option 'noacl.' + * in this case, generic_permission() returns -EOPNOTSUPP. + */ -+ h_userns = mnt_user_ns(h_path->mnt); ++ h_idmap = mnt_idmap(h_path->mnt); + if ((write_mask && !au_br_writable(brperm)) + || (au_test_nfs(h_inode->i_sb) && S_ISDIR(h_inode->i_mode) + && write_mask && !(mask & MAY_READ)) + || !h_inode->i_op->permission) { + /* AuLabel(generic_permission); */ -+ /* AuDbg("get_acl %ps\n", h_inode->i_op->get_acl); */ -+ err = generic_permission(h_userns, h_inode, mask); ++ /* AuDbg("get_inode_acl %ps\n", ++ h_inode->i_op->get_inode_acl); */ ++ err = generic_permission(h_idmap, h_inode, mask); + if (err == -EOPNOTSUPP && au_test_nfs_noacl(h_inode)) -+ err = h_inode->i_op->permission(h_userns, h_inode, ++ err = h_inode->i_op->permission(h_idmap, h_inode, + mask); + AuTraceErr(err); + } else { + /* AuLabel(h_inode->permission); */ -+ err = h_inode->i_op->permission(h_userns, h_inode, mask); ++ err = h_inode->i_op->permission(h_idmap, h_inode, mask); + AuTraceErr(err); + } + @@ -17420,7 +18707,7 @@ index 000000000000..9826b9d58c39 + return err; +} + -+static int aufs_permission(struct user_namespace *userns, struct inode *inode, ++static int aufs_permission(struct mnt_idmap *idmap, struct inode *inode, + int mask) +{ + int err; @@ -18269,7 +19556,7 @@ index 000000000000..9826b9d58c39 + return err; +} + -+static int aufs_setattr(struct user_namespace *userns, struct dentry *dentry, ++static int aufs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, + struct iattr *ia) +{ + int err; @@ -18277,12 +19564,12 @@ index 000000000000..9826b9d58c39 + struct super_block *sb; + struct file *file; + struct au_icpup_args *a; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + inode = d_inode(dentry); + IMustLock(inode); + -+ err = setattr_prepare(userns, dentry, ia); ++ err = setattr_prepare(idmap, dentry, ia); + if (unlikely(err)) + goto out; + @@ -18376,8 +19663,8 @@ index 000000000000..9826b9d58c39 + * why don't all acl-aware fs call this func from their ->setattr()? + */ + if (!err && (ia->ia_valid & ATTR_MODE)) { -+ h_userns = mnt_user_ns(a->h_path.mnt); -+ err = vfsub_acl_chmod(h_userns, a->h_inode, ia->ia_mode); ++ h_idmap = mnt_idmap(a->h_path.mnt); ++ err = vfsub_acl_chmod(h_idmap, a->h_path.dentry, ia->ia_mode); + } + if (!err) + au_cpup_attr_changeable(inode); @@ -18440,7 +19727,7 @@ index 000000000000..9826b9d58c39 + struct super_block *sb; + struct au_icpup_args *a; + struct inode *h_inode; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + IMustLock(inode); + @@ -18459,13 +19746,13 @@ index 000000000000..9826b9d58c39 + err = au_h_path_to_set_attr(dentry, a, &h_path); + if (unlikely(err)) + goto out_di; -+ h_userns = mnt_user_ns(h_path.mnt); ++ h_idmap = mnt_idmap(h_path.mnt); + + inode_unlock(a->h_inode); + switch (arg->type) { + case AU_XATTR_SET: + AuDebugOn(d_is_negative(h_path.dentry)); -+ err = vfsub_setxattr(h_userns, h_path.dentry, ++ err = vfsub_setxattr(h_idmap, h_path.dentry, + arg->u.set.name, arg->u.set.value, + arg->u.set.size, arg->u.set.flags); + break; @@ -18474,7 +19761,7 @@ index 000000000000..9826b9d58c39 + h_inode = d_inode(h_path.dentry); + if (h_inode->i_op->set_acl) { + /* this will call posix_acl_update_mode */ -+ err = h_inode->i_op->set_acl(h_userns, h_inode, ++ err = h_inode->i_op->set_acl(h_idmap, h_path.dentry, + arg->u.acl_set.acl, + arg->u.acl_set.type); + } @@ -18608,7 +19895,7 @@ index 000000000000..9826b9d58c39 + return err; +} + -+static int aufs_getattr(struct user_namespace *userns, const struct path *path, ++static int aufs_getattr(struct mnt_idmap *idmap, const struct path *path, + struct kstat *st, u32 request, unsigned int query) +{ + int err; @@ -18646,7 +19933,7 @@ index 000000000000..9826b9d58c39 + goto out_di; + +out_fill: -+ generic_fillattr(userns, inode, st); ++ generic_fillattr(idmap, inode, st); +out_di: + di_read_unlock(dentry, AuLock_IR); +out_si: @@ -18792,6 +20079,7 @@ index 000000000000..9826b9d58c39 + [AuIop_SYMLINK] = { + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL ++ .get_inode_acl = aufs_get_inode_acl, + .get_acl = aufs_get_acl, + .set_acl = aufs_set_acl, /* unsupport for symlink? */ +#endif @@ -18803,7 +20091,7 @@ index 000000000000..9826b9d58c39 + .listxattr = aufs_listxattr, +#endif + -+ .get_link = aufs_get_link, ++ .get_link = aufs_get_link + + /* .update_time = aufs_update_time */ + }, @@ -18820,6 +20108,7 @@ index 000000000000..9826b9d58c39 + + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL ++ .get_inode_acl = aufs_get_inode_acl, + .get_acl = aufs_get_acl, + .set_acl = aufs_set_acl, +#endif @@ -18838,6 +20127,7 @@ index 000000000000..9826b9d58c39 + [AuIop_OTHER] = { + .permission = aufs_permission, +#ifdef CONFIG_FS_POSIX_ACL ++ .get_inode_acl = aufs_get_inode_acl, + .get_acl = aufs_get_acl, + .set_acl = aufs_set_acl, +#endif @@ -18854,15 +20144,15 @@ index 000000000000..9826b9d58c39 +}; diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c new file mode 100644 -index 000000000000..1b4992de77df +index 000000000000..2adf97d4488d --- /dev/null +++ b/fs/aufs/i_op_add.c -@@ -0,0 +1,941 @@ +@@ -0,0 +1,972 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -19226,7 +20516,7 @@ index 000000000000..1b4992de77df + return err; +} + -+int aufs_mknod(struct user_namespace *userns, struct inode *dir, ++int aufs_mknod(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode, dev_t dev) +{ + struct simple_arg arg = { @@ -19239,7 +20529,7 @@ index 000000000000..1b4992de77df + return add_simple(dir, dentry, &arg); +} + -+int aufs_symlink(struct user_namespace *userns, struct inode *dir, ++int aufs_symlink(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, const char *symname) +{ + struct simple_arg arg = { @@ -19249,7 +20539,7 @@ index 000000000000..1b4992de77df + return add_simple(dir, dentry, &arg); +} + -+int aufs_create(struct user_namespace *userns, struct inode *dir, ++int aufs_create(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode, bool want_excl) +{ + struct simple_arg arg = { @@ -19277,16 +20567,19 @@ index 000000000000..1b4992de77df + return add_simple(dir, dentry, &arg); +} + -+int aufs_tmpfile(struct user_namespace *userns, struct inode *dir, -+ struct dentry *dentry, umode_t mode) ++int aufs_tmpfile(struct mnt_idmap *idmap, struct inode *dir, ++ struct file *file, umode_t mode) +{ + int err; + aufs_bindex_t bindex; ++ struct path h_ppath; + struct super_block *sb; -+ struct dentry *parent, *h_parent, *h_dentry; ++ struct au_branch *br; ++ struct dentry *dentry, *parent, *h_parent, *h_dentry; + struct inode *h_dir, *inode; + struct vfsmount *h_mnt; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; ++ struct file *h_file; + struct au_wr_dir_args wr_dir_args = { + .force_btgt = -1, + .flags = AuWrDir_TMPFILE @@ -19295,11 +20588,13 @@ index 000000000000..1b4992de77df + /* copy-up may happen */ + inode_lock(dir); + ++ h_file = NULL; + sb = dir->i_sb; + err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); + if (unlikely(err)) + goto out; + ++ dentry = file->f_path.dentry; + err = au_di_init(dentry); + if (unlikely(err)) + goto out_si; @@ -19328,19 +20623,25 @@ index 000000000000..1b4992de77df + if (unlikely(!h_dir->i_op->tmpfile)) + goto out_parent; + -+ h_mnt = au_sbr_mnt(sb, bindex); ++ br = au_sbr(sb, bindex); ++ h_mnt = au_br_mnt(br); + err = vfsub_mnt_want_write(h_mnt); + if (unlikely(err)) + goto out_parent; + -+ h_userns = mnt_user_ns(h_mnt); ++ h_idmap = mnt_idmap(h_mnt); + h_parent = au_h_dptr(parent, bindex); -+ h_dentry = vfs_tmpfile(h_userns, h_parent, mode, /*open_flag*/0); -+ if (IS_ERR(h_dentry)) { -+ err = PTR_ERR(h_dentry); ++ h_ppath.mnt = h_mnt; ++ h_ppath.dentry = h_parent; ++ h_file = kernel_tmpfile_open(h_idmap, &h_ppath, mode, /*open_flag*/0, ++ current_cred()); ++ if (IS_ERR(h_file)) { ++ err = PTR_ERR(h_file); ++ h_file = NULL; + goto out_mnt; + } + ++ h_dentry = h_file->f_path.dentry; + au_set_dbtop(dentry, bindex); + au_set_dbbot(dentry, bindex); + au_set_h_dptr(dentry, bindex, dget(h_dentry)); @@ -19350,32 +20651,52 @@ index 000000000000..1b4992de77df + au_set_h_dptr(dentry, bindex, NULL); + au_set_dbtop(dentry, -1); + au_set_dbbot(dentry, -1); -+ } else { -+ if (!inode->i_nlink) -+ set_nlink(inode, 1); -+ d_tmpfile(dentry, inode); -+ au_di(dentry)->di_tmpfile = 1; -+ -+ /* update without i_mutex */ -+ if (au_ibtop(dir) == au_dbtop(dentry)) -+ au_cpup_attr_timesizes(dir); ++ goto out_h_file; + } -+ dput(h_dentry); + ++ if (!inode->i_nlink) ++ set_nlink(inode, 1); ++ d_tmpfile(file, inode); ++ au_di(dentry)->di_tmpfile = 1; ++ get_file(h_file); ++ au_di(dentry)->di_htmpfile = h_file; ++ ++ /* update without i_mutex */ ++ if (au_ibtop(dir) == au_dbtop(dentry)) ++ au_cpup_attr_timesizes(dir); ++ ++out_h_file: ++ fput(h_file); +out_mnt: + vfsub_mnt_drop_write(h_mnt); +out_parent: + di_write_unlock(parent); + dput(parent); + di_write_unlock(dentry); -+ if (unlikely(err)) { -+ au_di_fin(dentry); -+ dentry->d_fsdata = NULL; -+ } ++ if (!err) ++ goto out_si; ++ if (h_file) ++ fput(h_file); ++ au_di(dentry)->di_htmpfile = NULL; ++ au_di_fin(dentry); ++ dentry->d_fsdata = NULL; +out_si: + si_read_unlock(sb); ++ if (!err && h_file) { ++ /* finally... */ ++ err = finish_open_simple(file, err); ++ if (!err) ++ au_lcnt_inc(&br->br_nfiles); ++ else { ++ fput(h_file); ++ au_di(dentry)->di_htmpfile = NULL; ++ au_di_fin(dentry); ++ dentry->d_fsdata = NULL; ++ } ++ } +out: + inode_unlock(dir); ++ AuTraceErr(err); + return err; +} + @@ -19691,7 +21012,7 @@ index 000000000000..1b4992de77df + return err; +} + -+int aufs_mkdir(struct user_namespace *userns, struct inode *dir, ++int aufs_mkdir(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode) +{ + int err, rerr; @@ -19801,15 +21122,15 @@ index 000000000000..1b4992de77df +} diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c new file mode 100644 -index 000000000000..f7930a66ccfc +index 000000000000..d85f47cef29f --- /dev/null +++ b/fs/aufs/i_op_del.c -@@ -0,0 +1,515 @@ +@@ -0,0 +1,522 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -19901,7 +21222,10 @@ index 000000000000..f7930a66ccfc + umode_t h_mode; + struct dentry *h_dentry, *h_latest; + struct inode *h_inode; -+ struct user_namespace *h_userns; ++ struct path h_ppath; ++ struct super_block *sb; ++ struct au_branch *br; ++ struct mnt_idmap *h_idmap; + + h_dentry = au_h_dptr(dentry, bindex); + if (d_really_is_positive(dentry)) { @@ -19939,13 +21263,17 @@ index 000000000000..f7930a66ccfc + * let's try heavy test. + */ + err = -EACCES; -+ h_userns = au_sbr_userns(dentry->d_sb, bindex); -+ if (unlikely(!au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1) -+ && au_test_h_perm(h_userns, d_inode(h_parent), ++ sb = dentry->d_sb; ++ br = au_sbr(sb, bindex); ++ h_idmap = au_br_idmap(br); ++ if (unlikely(!au_opt_test(au_mntflags(sb), DIRPERM1) ++ && au_test_h_perm(h_idmap, d_inode(h_parent), + MAY_EXEC | MAY_WRITE))) + goto out; + -+ h_latest = au_sio_lkup_one(h_userns, &dentry->d_name, h_parent); ++ h_ppath.dentry = h_parent; ++ h_ppath.mnt = au_br_mnt(br); ++ h_latest = au_sio_lkup_one(h_idmap, &dentry->d_name, &h_ppath); + err = -EIO; + if (IS_ERR(h_latest)) + goto out; @@ -20322,15 +21650,15 @@ index 000000000000..f7930a66ccfc +} diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c new file mode 100644 -index 000000000000..7bd76f8f6119 +index 000000000000..ab69a6ac9a42 --- /dev/null +++ b/fs/aufs/i_op_ren.c -@@ -0,0 +1,1251 @@ +@@ -0,0 +1,1257 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -20478,9 +21806,12 @@ index 000000000000..7bd76f8f6119 +{ + int rerr; + struct inode *delegated; ++ struct path h_ppath = { ++ .dentry = a->src_h_parent, ++ .mnt = a->h_path.mnt ++ }; + -+ a->h_path.dentry = vfsub_lkup_one(&a->src_dentry->d_name, -+ a->src_h_parent); ++ a->h_path.dentry = vfsub_lkup_one(&a->src_dentry->d_name, &h_ppath); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { + RevertFailure("lkup one %pd", a->src_dentry); @@ -20507,9 +21838,12 @@ index 000000000000..7bd76f8f6119 +{ + int rerr; + struct inode *delegated; ++ struct path h_ppath = { ++ .dentry = a->dst_h_parent, ++ .mnt = a->h_path.mnt ++ }; + -+ a->h_path.dentry = vfsub_lkup_one(&a->dst_dentry->d_name, -+ a->dst_h_parent); ++ a->h_path.dentry = vfsub_lkup_one(&a->dst_dentry->d_name, &h_ppath); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { + RevertFailure("lkup one %pd", a->dst_dentry); @@ -21281,7 +22615,7 @@ index 000000000000..7bd76f8f6119 + +/* ---------------------------------------------------------------------- */ + -+int aufs_rename(struct user_namespace *userns, ++int aufs_rename(struct mnt_idmap *idmap, + struct inode *_src_dir, struct dentry *_src_dentry, + struct inode *_dst_dir, struct dentry *_dst_dentry, + unsigned int _flags) @@ -21579,15 +22913,15 @@ index 000000000000..7bd76f8f6119 +} diff --git a/fs/aufs/iinfo.c b/fs/aufs/iinfo.c new file mode 100644 -index 000000000000..016db39451cd +index 000000000000..0d3a2487643b --- /dev/null +++ b/fs/aufs/iinfo.c @@ -0,0 +1,286 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -21871,15 +23205,15 @@ index 000000000000..016db39451cd +} diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c new file mode 100644 -index 000000000000..e1b513aaa580 +index 000000000000..7dbf6a6f2fee --- /dev/null +++ b/fs/aufs/inode.c @@ -0,0 +1,531 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -22151,7 +23485,7 @@ index 000000000000..e1b513aaa580 + } + au_cpup_attr_all(inode, /*force*/1); + /* -+ * to force calling aufs_get_acl() every time, ++ * to force calling aufs_get_inode_acl() every time, + * do not call cache_no_acl() for aufs inode. + */ + @@ -22389,34 +23723,34 @@ index 000000000000..e1b513aaa580 + return err; +} + -+int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode, ++int au_test_h_perm(struct mnt_idmap *h_idmap, struct inode *h_inode, + int mask) +{ + if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) + return 0; -+ return inode_permission(h_userns, h_inode, mask); ++ return inode_permission(h_idmap, h_inode, mask); +} + -+int au_test_h_perm_sio(struct user_namespace *h_userns, struct inode *h_inode, ++int au_test_h_perm_sio(struct mnt_idmap *h_idmap, struct inode *h_inode, + int mask) +{ + if (au_test_nfs(h_inode->i_sb) + && (mask & MAY_WRITE) + && S_ISDIR(h_inode->i_mode)) + mask |= MAY_READ; /* force permission check */ -+ return au_test_h_perm(h_userns, h_inode, mask); ++ return au_test_h_perm(h_idmap, h_inode, mask); +} diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h new file mode 100644 -index 000000000000..8008824bf2b0 +index 000000000000..76c3bd49674a --- /dev/null +++ b/fs/aufs/inode.h -@@ -0,0 +1,705 @@ +@@ -0,0 +1,707 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -22551,9 +23885,9 @@ index 000000000000..8008824bf2b0 +struct inode *au_new_inode(struct dentry *dentry, int must_new); +int au_test_ro(struct super_block *sb, aufs_bindex_t bindex, + struct inode *inode); -+int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode, ++int au_test_h_perm(struct mnt_idmap *h_idmap, struct inode *h_inode, + int mask); -+int au_test_h_perm_sio(struct user_namespace *h_userns, struct inode *h_inode, ++int au_test_h_perm_sio(struct mnt_idmap *h_idmap, struct inode *h_inode, + int mask); + +static inline int au_wh_ino(struct super_block *sb, aufs_bindex_t bindex, @@ -22629,20 +23963,20 @@ index 000000000000..8008824bf2b0 +/* i_op_add.c */ +int au_may_add(struct dentry *dentry, aufs_bindex_t bindex, + struct dentry *h_parent, int isdir); -+int aufs_mknod(struct user_namespace *userns, struct inode *dir, ++int aufs_mknod(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode, dev_t dev); -+int aufs_symlink(struct user_namespace *userns, struct inode *dir, ++int aufs_symlink(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, const char *symname); -+int aufs_create(struct user_namespace *userns, struct inode *dir, ++int aufs_create(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode, bool want_excl); +struct vfsub_aopen_args; +int au_aopen_or_create(struct inode *dir, struct dentry *dentry, + struct vfsub_aopen_args *args); -+int aufs_tmpfile(struct user_namespace *userns, struct inode *dir, -+ struct dentry *dentry, umode_t mode); ++int aufs_tmpfile(struct mnt_idmap *idmap, struct inode *dir, ++ struct file *file, umode_t mode); +int aufs_link(struct dentry *src_dentry, struct inode *dir, + struct dentry *dentry); -+int aufs_mkdir(struct user_namespace *userns, struct inode *dir, ++int aufs_mkdir(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *dentry, umode_t mode); + +/* i_op_del.c */ @@ -22654,7 +23988,7 @@ index 000000000000..8008824bf2b0 + +/* i_op_ren.c */ +int au_wbr(struct dentry *dentry, aufs_bindex_t btgt); -+int aufs_rename(struct user_namespace *userns, ++int aufs_rename(struct mnt_idmap *idmap, + struct inode *_src_dir, struct dentry *_src_dentry, + struct inode *_dst_dir, struct dentry *_dst_dentry, + unsigned int _flags); @@ -22738,8 +24072,10 @@ index 000000000000..8008824bf2b0 +#endif + +#ifdef CONFIG_FS_POSIX_ACL -+struct posix_acl *aufs_get_acl(struct inode *inode, int type); -+int aufs_set_acl(struct user_namespace *userns, struct inode *inode, ++struct posix_acl *aufs_get_inode_acl(struct inode *inode, int type, bool rcu); ++struct posix_acl *aufs_get_acl(struct mnt_idmap *idmap, ++ struct dentry *dentry, int type); ++int aufs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, + struct posix_acl *acl, int type); +#endif + @@ -23119,15 +24455,15 @@ index 000000000000..8008824bf2b0 +#endif /* __AUFS_INODE_H__ */ diff --git a/fs/aufs/ioctl.c b/fs/aufs/ioctl.c new file mode 100644 -index 000000000000..ae4f73386b90 +index 000000000000..2d8d91084099 --- /dev/null +++ b/fs/aufs/ioctl.c @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -23345,15 +24681,15 @@ index 000000000000..ae4f73386b90 +#endif diff --git a/fs/aufs/lcnt.h b/fs/aufs/lcnt.h new file mode 100644 -index 000000000000..8afcabe55826 +index 000000000000..6dc37108565f --- /dev/null +++ b/fs/aufs/lcnt.h @@ -0,0 +1,186 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2018-2020 Junjiro R. Okajima ++ * Copyright (C) 2018-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -23537,15 +24873,15 @@ index 000000000000..8afcabe55826 +#endif /* __AUFS_LCNT_H__ */ diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c new file mode 100644 -index 000000000000..63732e938684 +index 000000000000..383190588595 --- /dev/null +++ b/fs/aufs/loop.c @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -23691,15 +25027,15 @@ index 000000000000..63732e938684 +} diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h new file mode 100644 -index 000000000000..65c38bbb5d56 +index 000000000000..9726b8354e00 --- /dev/null +++ b/fs/aufs/loop.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -23789,15 +25125,15 @@ index 000000000000..7bc9eef3ffec +endif diff --git a/fs/aufs/module.c b/fs/aufs/module.c new file mode 100644 -index 000000000000..7245197a6cbf +index 000000000000..c2815fffb5c6 --- /dev/null +++ b/fs/aufs/module.c @@ -0,0 +1,273 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -24068,15 +25404,15 @@ index 000000000000..7245197a6cbf +module_exit(aufs_exit); diff --git a/fs/aufs/module.h b/fs/aufs/module.h new file mode 100644 -index 000000000000..d6a76788d2ff +index 000000000000..a9d21d3e5414 --- /dev/null +++ b/fs/aufs/module.h -@@ -0,0 +1,166 @@ +@@ -0,0 +1,180 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -24171,7 +25507,7 @@ index 000000000000..d6a76788d2ff +static inline int au_kmidx_sub(size_t sz, size_t new_sz) +{ +#ifndef CONFIG_SLOB -+ return kmalloc_index(sz) - kmalloc_index(new_sz); ++ return __kmalloc_index(sz, false) - __kmalloc_index(new_sz, false); +#else + return -1; /* SLOB is untested */ +#endif @@ -24209,9 +25545,11 @@ index 000000000000..d6a76788d2ff + kmem_cache_create(#type, sizeof(struct type), \ + __alignof__(struct type), AuCacheFlags, ctor) + -+#define AuCacheFuncs(name, index) \ ++#define AuCacheFuncAlloc(name, index) \ + static inline struct au_##name *au_cache_alloc_##name(void) \ -+ { return kmem_cache_alloc(au_cache[AuCache_##index], GFP_NOFS); } \ ++ { return kmem_cache_alloc(au_cache[AuCache_##index], GFP_NOFS); } ++ ++#define AuCacheFuncs(name, index) \ + static inline void au_cache_free_##name##_norcu(struct au_##name *p) \ + { kmem_cache_free(au_cache[AuCache_##index], p); } \ + \ @@ -24228,27 +25566,39 @@ index 000000000000..d6a76788d2ff + au_cache_free_##name##_rcu(p); } + +AuCacheFuncs(dinfo, DINFO); ++AuCacheFuncAlloc(dinfo, DINFO); ++ +AuCacheFuncs(icntnr, ICNTNR); ++static inline struct au_icntnr *au_cache_alloc_icntnr(struct super_block *sb) ++{ return alloc_inode_sb(sb, au_cache[AuCache_ICNTNR], GFP_NOFS); } ++ +AuCacheFuncs(finfo, FINFO); ++AuCacheFuncAlloc(finfo, FINFO); ++ +AuCacheFuncs(vdir, VDIR); ++AuCacheFuncAlloc(vdir, VDIR); ++ +AuCacheFuncs(vdir_dehstr, DEHSTR); ++AuCacheFuncAlloc(vdir_dehstr, DEHSTR); ++ +#ifdef CONFIG_AUFS_HNOTIFY +AuCacheFuncs(hnotify, HNOTIFY); ++AuCacheFuncAlloc(hnotify, HNOTIFY); +#endif + +#endif /* __KERNEL__ */ +#endif /* __AUFS_MODULE_H__ */ diff --git a/fs/aufs/mvdown.c b/fs/aufs/mvdown.c new file mode 100644 -index 000000000000..c39a39e52ebc +index 000000000000..daafc27e64b0 --- /dev/null +++ b/fs/aufs/mvdown.c @@ -0,0 +1,706 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2011-2020 Junjiro R. Okajima ++ * Copyright (C) 2011-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -24952,15 +26302,15 @@ index 000000000000..c39a39e52ebc +} diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c new file mode 100644 -index 000000000000..84646345116b +index 000000000000..20421440c004 --- /dev/null +++ b/fs/aufs/opts.c -@@ -0,0 +1,1880 @@ +@@ -0,0 +1,1032 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -24978,172 +26328,12 @@ index 000000000000..84646345116b + * mount options/flags + */ + -+#include <linux/namei.h> +#include <linux/types.h> /* a distribution requires */ +#include <linux/parser.h> +#include "aufs.h" + +/* ---------------------------------------------------------------------- */ + -+enum { -+ Opt_br, -+ Opt_add, Opt_del, Opt_mod, Opt_append, Opt_prepend, -+ Opt_idel, Opt_imod, -+ Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, -+ Opt_rdblk_def, Opt_rdhash_def, -+ Opt_xino, Opt_noxino, -+ Opt_trunc_xino, Opt_trunc_xino_v, Opt_notrunc_xino, -+ Opt_trunc_xino_path, Opt_itrunc_xino, -+ Opt_trunc_xib, Opt_notrunc_xib, -+ Opt_shwh, Opt_noshwh, -+ Opt_plink, Opt_noplink, Opt_list_plink, -+ Opt_udba, -+ Opt_dio, Opt_nodio, -+ Opt_diropq_a, Opt_diropq_w, -+ Opt_warn_perm, Opt_nowarn_perm, -+ Opt_wbr_copyup, Opt_wbr_create, -+ Opt_fhsm_sec, -+ Opt_verbose, Opt_noverbose, -+ Opt_sum, Opt_nosum, Opt_wsum, -+ Opt_dirperm1, Opt_nodirperm1, -+ Opt_dirren, Opt_nodirren, -+ Opt_acl, Opt_noacl, -+ Opt_tail, Opt_ignore, Opt_ignore_silent, Opt_err -+}; -+ -+static match_table_t options = { -+ {Opt_br, "br=%s"}, -+ {Opt_br, "br:%s"}, -+ -+ {Opt_add, "add=%d:%s"}, -+ {Opt_add, "add:%d:%s"}, -+ {Opt_add, "ins=%d:%s"}, -+ {Opt_add, "ins:%d:%s"}, -+ {Opt_append, "append=%s"}, -+ {Opt_append, "append:%s"}, -+ {Opt_prepend, "prepend=%s"}, -+ {Opt_prepend, "prepend:%s"}, -+ -+ {Opt_del, "del=%s"}, -+ {Opt_del, "del:%s"}, -+ /* {Opt_idel, "idel:%d"}, */ -+ {Opt_mod, "mod=%s"}, -+ {Opt_mod, "mod:%s"}, -+ /* {Opt_imod, "imod:%d:%s"}, */ -+ -+ {Opt_dirwh, "dirwh=%d"}, -+ -+ {Opt_xino, "xino=%s"}, -+ {Opt_noxino, "noxino"}, -+ {Opt_trunc_xino, "trunc_xino"}, -+ {Opt_trunc_xino_v, "trunc_xino_v=%d:%d"}, -+ {Opt_notrunc_xino, "notrunc_xino"}, -+ {Opt_trunc_xino_path, "trunc_xino=%s"}, -+ {Opt_itrunc_xino, "itrunc_xino=%d"}, -+ /* {Opt_zxino, "zxino=%s"}, */ -+ {Opt_trunc_xib, "trunc_xib"}, -+ {Opt_notrunc_xib, "notrunc_xib"}, -+ -+#ifdef CONFIG_PROC_FS -+ {Opt_plink, "plink"}, -+#else -+ {Opt_ignore_silent, "plink"}, -+#endif -+ -+ {Opt_noplink, "noplink"}, -+ -+#ifdef CONFIG_AUFS_DEBUG -+ {Opt_list_plink, "list_plink"}, -+#endif -+ -+ {Opt_udba, "udba=%s"}, -+ -+ {Opt_dio, "dio"}, -+ {Opt_nodio, "nodio"}, -+ -+#ifdef CONFIG_AUFS_DIRREN -+ {Opt_dirren, "dirren"}, -+ {Opt_nodirren, "nodirren"}, -+#else -+ {Opt_ignore, "dirren"}, -+ {Opt_ignore_silent, "nodirren"}, -+#endif -+ -+#ifdef CONFIG_AUFS_FHSM -+ {Opt_fhsm_sec, "fhsm_sec=%d"}, -+#else -+ {Opt_ignore, "fhsm_sec=%d"}, -+#endif -+ -+ {Opt_diropq_a, "diropq=always"}, -+ {Opt_diropq_a, "diropq=a"}, -+ {Opt_diropq_w, "diropq=whiteouted"}, -+ {Opt_diropq_w, "diropq=w"}, -+ -+ {Opt_warn_perm, "warn_perm"}, -+ {Opt_nowarn_perm, "nowarn_perm"}, -+ -+ /* keep them temporary */ -+ {Opt_ignore_silent, "nodlgt"}, -+ {Opt_ignore, "clean_plink"}, -+ -+#ifdef CONFIG_AUFS_SHWH -+ {Opt_shwh, "shwh"}, -+#endif -+ {Opt_noshwh, "noshwh"}, -+ -+ {Opt_dirperm1, "dirperm1"}, -+ {Opt_nodirperm1, "nodirperm1"}, -+ -+ {Opt_verbose, "verbose"}, -+ {Opt_verbose, "v"}, -+ {Opt_noverbose, "noverbose"}, -+ {Opt_noverbose, "quiet"}, -+ {Opt_noverbose, "q"}, -+ {Opt_noverbose, "silent"}, -+ -+ {Opt_sum, "sum"}, -+ {Opt_nosum, "nosum"}, -+ {Opt_wsum, "wsum"}, -+ -+ {Opt_rdcache, "rdcache=%d"}, -+ {Opt_rdblk, "rdblk=%d"}, -+ {Opt_rdblk_def, "rdblk=def"}, -+ {Opt_rdhash, "rdhash=%d"}, -+ {Opt_rdhash_def, "rdhash=def"}, -+ -+ {Opt_wbr_create, "create=%s"}, -+ {Opt_wbr_create, "create_policy=%s"}, -+ {Opt_wbr_copyup, "cpup=%s"}, -+ {Opt_wbr_copyup, "copyup=%s"}, -+ {Opt_wbr_copyup, "copyup_policy=%s"}, -+ -+ /* generic VFS flag */ -+#ifdef CONFIG_FS_POSIX_ACL -+ {Opt_acl, "acl"}, -+ {Opt_noacl, "noacl"}, -+#else -+ {Opt_ignore, "acl"}, -+ {Opt_ignore_silent, "noacl"}, -+#endif -+ -+ /* internal use for the scripts */ -+ {Opt_ignore_silent, "si=%s"}, -+ -+ {Opt_br, "dirs=%s"}, -+ {Opt_ignore, "debug=%d"}, -+ {Opt_ignore, "delete=whiteout"}, -+ {Opt_ignore, "delete=all"}, -+ {Opt_ignore, "imap=%s"}, -+ -+ /* temporary workaround, due to old mount(8)? */ -+ {Opt_ignore_silent, "relatime"}, -+ -+ {Opt_err, NULL} -+}; -+ -+/* ---------------------------------------------------------------------- */ -+ +static const char *au_parser_pattern(int val, match_table_t tbl) +{ + struct match_token *p; @@ -25275,7 +26465,7 @@ index 000000000000..84646345116b + return q - str->a; +} + -+static int noinline_for_stack br_perm_val(char *perm) ++int au_br_perm_val(char *perm) +{ + int val, bad, sz; + char *p; @@ -25368,7 +26558,7 @@ index 000000000000..84646345116b + {-1, NULL} +}; + -+static int noinline_for_stack udba_val(char *str) ++int au_udba_val(char *str) +{ + substring_t args[MAX_OPT_ARGS]; + @@ -25439,8 +26629,7 @@ index 000000000000..84646345116b + return err; +} + -+static int noinline_for_stack -+au_wbr_create_val(char *str, struct au_opt_wbr_create *create) ++int au_wbr_create_val(char *str, struct au_opt_wbr_create *create) +{ + int err, e; + substring_t args[MAX_OPT_ARGS]; @@ -25496,7 +26685,7 @@ index 000000000000..84646345116b + {-1, NULL} +}; + -+static int noinline_for_stack au_wbr_copyup_val(char *str) ++int au_wbr_copyup_val(char *str) +{ + substring_t args[MAX_OPT_ARGS]; + @@ -25510,235 +26699,8 @@ index 000000000000..84646345116b + +/* ---------------------------------------------------------------------- */ + -+static const int lkup_dirflags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; -+ -+static void dump_opts(struct au_opts *opts) -+{ -+#ifdef CONFIG_AUFS_DEBUG -+ /* reduce stack space */ -+ union { -+ struct au_opt_add *add; -+ struct au_opt_del *del; -+ struct au_opt_mod *mod; -+ struct au_opt_xino *xino; -+ struct au_opt_xino_itrunc *xino_itrunc; -+ struct au_opt_wbr_create *create; -+ } u; -+ struct au_opt *opt; -+ -+ opt = opts->opt; -+ while (opt->type != Opt_tail) { -+ switch (opt->type) { -+ case Opt_add: -+ u.add = &opt->add; -+ AuDbg("add {b%d, %s, 0x%x, %p}\n", -+ u.add->bindex, u.add->pathname, u.add->perm, -+ u.add->path.dentry); -+ break; -+ case Opt_del: -+ case Opt_idel: -+ u.del = &opt->del; -+ AuDbg("del {%s, %p}\n", -+ u.del->pathname, u.del->h_path.dentry); -+ break; -+ case Opt_mod: -+ case Opt_imod: -+ u.mod = &opt->mod; -+ AuDbg("mod {%s, 0x%x, %p}\n", -+ u.mod->path, u.mod->perm, u.mod->h_root); -+ break; -+ case Opt_append: -+ u.add = &opt->add; -+ AuDbg("append {b%d, %s, 0x%x, %p}\n", -+ u.add->bindex, u.add->pathname, u.add->perm, -+ u.add->path.dentry); -+ break; -+ case Opt_prepend: -+ u.add = &opt->add; -+ AuDbg("prepend {b%d, %s, 0x%x, %p}\n", -+ u.add->bindex, u.add->pathname, u.add->perm, -+ u.add->path.dentry); -+ break; -+ case Opt_dirwh: -+ AuDbg("dirwh %d\n", opt->dirwh); -+ break; -+ case Opt_rdcache: -+ AuDbg("rdcache %d\n", opt->rdcache); -+ break; -+ case Opt_rdblk: -+ AuDbg("rdblk %u\n", opt->rdblk); -+ break; -+ case Opt_rdblk_def: -+ AuDbg("rdblk_def\n"); -+ break; -+ case Opt_rdhash: -+ AuDbg("rdhash %u\n", opt->rdhash); -+ break; -+ case Opt_rdhash_def: -+ AuDbg("rdhash_def\n"); -+ break; -+ case Opt_xino: -+ u.xino = &opt->xino; -+ AuDbg("xino {%s %pD}\n", u.xino->path, u.xino->file); -+ break; -+ case Opt_trunc_xino: -+ AuLabel(trunc_xino); -+ break; -+ case Opt_notrunc_xino: -+ AuLabel(notrunc_xino); -+ break; -+ case Opt_trunc_xino_path: -+ case Opt_itrunc_xino: -+ u.xino_itrunc = &opt->xino_itrunc; -+ AuDbg("trunc_xino %d\n", u.xino_itrunc->bindex); -+ break; -+ case Opt_noxino: -+ AuLabel(noxino); -+ break; -+ case Opt_trunc_xib: -+ AuLabel(trunc_xib); -+ break; -+ case Opt_notrunc_xib: -+ AuLabel(notrunc_xib); -+ break; -+ case Opt_shwh: -+ AuLabel(shwh); -+ break; -+ case Opt_noshwh: -+ AuLabel(noshwh); -+ break; -+ case Opt_dirperm1: -+ AuLabel(dirperm1); -+ break; -+ case Opt_nodirperm1: -+ AuLabel(nodirperm1); -+ break; -+ case Opt_plink: -+ AuLabel(plink); -+ break; -+ case Opt_noplink: -+ AuLabel(noplink); -+ break; -+ case Opt_list_plink: -+ AuLabel(list_plink); -+ break; -+ case Opt_udba: -+ AuDbg("udba %d, %s\n", -+ opt->udba, au_optstr_udba(opt->udba)); -+ break; -+ case Opt_dio: -+ AuLabel(dio); -+ break; -+ case Opt_nodio: -+ AuLabel(nodio); -+ break; -+ case Opt_diropq_a: -+ AuLabel(diropq_a); -+ break; -+ case Opt_diropq_w: -+ AuLabel(diropq_w); -+ break; -+ case Opt_warn_perm: -+ AuLabel(warn_perm); -+ break; -+ case Opt_nowarn_perm: -+ AuLabel(nowarn_perm); -+ break; -+ case Opt_verbose: -+ AuLabel(verbose); -+ break; -+ case Opt_noverbose: -+ AuLabel(noverbose); -+ break; -+ case Opt_sum: -+ AuLabel(sum); -+ break; -+ case Opt_nosum: -+ AuLabel(nosum); -+ break; -+ case Opt_wsum: -+ AuLabel(wsum); -+ break; -+ case Opt_wbr_create: -+ u.create = &opt->wbr_create; -+ AuDbg("create %d, %s\n", u.create->wbr_create, -+ au_optstr_wbr_create(u.create->wbr_create)); -+ switch (u.create->wbr_create) { -+ case AuWbrCreate_MFSV: -+ case AuWbrCreate_PMFSV: -+ AuDbg("%d sec\n", u.create->mfs_second); -+ break; -+ case AuWbrCreate_MFSRR: -+ case AuWbrCreate_TDMFS: -+ AuDbg("%llu watermark\n", -+ u.create->mfsrr_watermark); -+ break; -+ case AuWbrCreate_MFSRRV: -+ case AuWbrCreate_TDMFSV: -+ case AuWbrCreate_PMFSRRV: -+ AuDbg("%llu watermark, %d sec\n", -+ u.create->mfsrr_watermark, -+ u.create->mfs_second); -+ break; -+ } -+ break; -+ case Opt_wbr_copyup: -+ AuDbg("copyup %d, %s\n", opt->wbr_copyup, -+ au_optstr_wbr_copyup(opt->wbr_copyup)); -+ break; -+ case Opt_fhsm_sec: -+ AuDbg("fhsm_sec %u\n", opt->fhsm_second); -+ break; -+ case Opt_dirren: -+ AuLabel(dirren); -+ break; -+ case Opt_nodirren: -+ AuLabel(nodirren); -+ break; -+ case Opt_acl: -+ AuLabel(acl); -+ break; -+ case Opt_noacl: -+ AuLabel(noacl); -+ break; -+ default: -+ BUG(); -+ } -+ opt++; -+ } -+#endif -+} -+ -+void au_opts_free(struct au_opts *opts) -+{ -+ struct au_opt *opt; -+ -+ opt = opts->opt; -+ while (opt->type != Opt_tail) { -+ switch (opt->type) { -+ case Opt_add: -+ case Opt_append: -+ case Opt_prepend: -+ path_put(&opt->add.path); -+ break; -+ case Opt_del: -+ case Opt_idel: -+ path_put(&opt->del.h_path); -+ break; -+ case Opt_mod: -+ case Opt_imod: -+ dput(opt->mod.h_root); -+ break; -+ case Opt_xino: -+ fput(opt->xino.file); -+ break; -+ } -+ opt++; -+ } -+} -+ -+static int opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags, -+ aufs_bindex_t bindex) ++int au_opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags, ++ aufs_bindex_t bindex) +{ + int err; + struct au_opt_add *add = &opt->add; @@ -25751,10 +26713,10 @@ index 000000000000..84646345116b + if (p) { + *p++ = 0; + if (*p) -+ add->perm = br_perm_val(p); ++ add->perm = au_br_perm_val(p); + } + -+ err = vfsub_kern_path(add->pathname, lkup_dirflags, &add->path); ++ err = vfsub_kern_path(add->pathname, AuOpt_LkupDirFlags, &add->path); + if (!err) { + if (!p) { + add->perm = AuBrPerm_RO; @@ -25773,460 +26735,6 @@ index 000000000000..84646345116b + return err; +} + -+static int au_opts_parse_del(struct au_opt_del *del, substring_t args[]) -+{ -+ int err; -+ -+ del->pathname = args[0].from; -+ AuDbg("del path %s\n", del->pathname); -+ -+ err = vfsub_kern_path(del->pathname, lkup_dirflags, &del->h_path); -+ if (unlikely(err)) -+ pr_err("lookup failed %s (%d)\n", del->pathname, err); -+ -+ return err; -+} -+ -+#if 0 /* reserved for future use */ -+static int au_opts_parse_idel(struct super_block *sb, aufs_bindex_t bindex, -+ struct au_opt_del *del, substring_t args[]) -+{ -+ int err; -+ struct dentry *root; -+ -+ err = -EINVAL; -+ root = sb->s_root; -+ aufs_read_lock(root, AuLock_FLUSH); -+ if (bindex < 0 || au_sbbot(sb) < bindex) { -+ pr_err("out of bounds, %d\n", bindex); -+ goto out; -+ } -+ -+ err = 0; -+ del->h_path.dentry = dget(au_h_dptr(root, bindex)); -+ del->h_path.mnt = mntget(au_sbr_mnt(sb, bindex)); -+ -+out: -+ aufs_read_unlock(root, !AuLock_IR); -+ return err; -+} -+#endif -+ -+static int noinline_for_stack -+au_opts_parse_mod(struct au_opt_mod *mod, substring_t args[]) -+{ -+ int err; -+ struct path path; -+ char *p; -+ -+ err = -EINVAL; -+ mod->path = args[0].from; -+ p = strchr(mod->path, '='); -+ if (unlikely(!p)) { -+ pr_err("no permission %s\n", args[0].from); -+ goto out; -+ } -+ -+ *p++ = 0; -+ err = vfsub_kern_path(mod->path, lkup_dirflags, &path); -+ if (unlikely(err)) { -+ pr_err("lookup failed %s (%d)\n", mod->path, err); -+ goto out; -+ } -+ -+ mod->perm = br_perm_val(p); -+ AuDbg("mod path %s, perm 0x%x, %s\n", mod->path, mod->perm, p); -+ mod->h_root = dget(path.dentry); -+ path_put(&path); -+ -+out: -+ return err; -+} -+ -+#if 0 /* reserved for future use */ -+static int au_opts_parse_imod(struct super_block *sb, aufs_bindex_t bindex, -+ struct au_opt_mod *mod, substring_t args[]) -+{ -+ int err; -+ struct dentry *root; -+ -+ err = -EINVAL; -+ root = sb->s_root; -+ aufs_read_lock(root, AuLock_FLUSH); -+ if (bindex < 0 || au_sbbot(sb) < bindex) { -+ pr_err("out of bounds, %d\n", bindex); -+ goto out; -+ } -+ -+ err = 0; -+ mod->perm = br_perm_val(args[1].from); -+ AuDbg("mod path %s, perm 0x%x, %s\n", -+ mod->path, mod->perm, args[1].from); -+ mod->h_root = dget(au_h_dptr(root, bindex)); -+ -+out: -+ aufs_read_unlock(root, !AuLock_IR); -+ return err; -+} -+#endif -+ -+static int au_opts_parse_xino(struct super_block *sb, struct au_opt_xino *xino, -+ substring_t args[]) -+{ -+ int err; -+ struct file *file; -+ -+ file = au_xino_create(sb, args[0].from, /*silent*/0, /*wbrtop*/0); -+ err = PTR_ERR(file); -+ if (IS_ERR(file)) -+ goto out; -+ -+ err = -EINVAL; -+ if (unlikely(file->f_path.dentry->d_sb == sb)) { -+ fput(file); -+ pr_err("%s must be outside\n", args[0].from); -+ goto out; -+ } -+ -+ err = 0; -+ xino->file = file; -+ xino->path = args[0].from; -+ -+out: -+ return err; -+} -+ -+static int noinline_for_stack -+au_opts_parse_xino_itrunc_path(struct super_block *sb, -+ struct au_opt_xino_itrunc *xino_itrunc, -+ substring_t args[]) -+{ -+ int err; -+ aufs_bindex_t bbot, bindex; -+ struct path path; -+ struct dentry *root; -+ -+ err = vfsub_kern_path(args[0].from, lkup_dirflags, &path); -+ if (unlikely(err)) { -+ pr_err("lookup failed %s (%d)\n", args[0].from, err); -+ goto out; -+ } -+ -+ xino_itrunc->bindex = -1; -+ root = sb->s_root; -+ aufs_read_lock(root, AuLock_FLUSH); -+ bbot = au_sbbot(sb); -+ for (bindex = 0; bindex <= bbot; bindex++) { -+ if (au_h_dptr(root, bindex) == path.dentry) { -+ xino_itrunc->bindex = bindex; -+ break; -+ } -+ } -+ aufs_read_unlock(root, !AuLock_IR); -+ path_put(&path); -+ -+ if (unlikely(xino_itrunc->bindex < 0)) { -+ pr_err("no such branch %s\n", args[0].from); -+ err = -EINVAL; -+ } -+ -+out: -+ return err; -+} -+ -+/* called without aufs lock */ -+int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts) -+{ -+ int err, n, token; -+ aufs_bindex_t bindex; -+ unsigned char skipped; -+ struct dentry *root; -+ struct au_opt *opt, *opt_tail; -+ char *opt_str; -+ /* reduce the stack space */ -+ union { -+ struct au_opt_xino_itrunc *xino_itrunc; -+ struct au_opt_wbr_create *create; -+ } u; -+ struct { -+ substring_t args[MAX_OPT_ARGS]; -+ } *a; -+ -+ err = -ENOMEM; -+ a = kmalloc(sizeof(*a), GFP_NOFS); -+ if (unlikely(!a)) -+ goto out; -+ -+ root = sb->s_root; -+ err = 0; -+ bindex = 0; -+ opt = opts->opt; -+ opt_tail = opt + opts->max_opt - 1; -+ opt->type = Opt_tail; -+ while (!err && (opt_str = strsep(&str, ",")) && *opt_str) { -+ err = -EINVAL; -+ skipped = 0; -+ token = match_token(opt_str, options, a->args); -+ switch (token) { -+ case Opt_br: -+ err = 0; -+ while (!err && (opt_str = strsep(&a->args[0].from, ":")) -+ && *opt_str) { -+ err = opt_add(opt, opt_str, opts->sb_flags, -+ bindex++); -+ if (unlikely(!err && ++opt > opt_tail)) { -+ err = -E2BIG; -+ break; -+ } -+ opt->type = Opt_tail; -+ skipped = 1; -+ } -+ break; -+ case Opt_add: -+ if (unlikely(match_int(&a->args[0], &n))) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ bindex = n; -+ err = opt_add(opt, a->args[1].from, opts->sb_flags, -+ bindex); -+ if (!err) -+ opt->type = token; -+ break; -+ case Opt_append: -+ err = opt_add(opt, a->args[0].from, opts->sb_flags, -+ /*dummy bindex*/1); -+ if (!err) -+ opt->type = token; -+ break; -+ case Opt_prepend: -+ err = opt_add(opt, a->args[0].from, opts->sb_flags, -+ /*bindex*/0); -+ if (!err) -+ opt->type = token; -+ break; -+ case Opt_del: -+ err = au_opts_parse_del(&opt->del, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+#if 0 /* reserved for future use */ -+ case Opt_idel: -+ del->pathname = "(indexed)"; -+ if (unlikely(match_int(&args[0], &n))) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ err = au_opts_parse_idel(sb, n, &opt->del, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+#endif -+ case Opt_mod: -+ err = au_opts_parse_mod(&opt->mod, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+#ifdef IMOD /* reserved for future use */ -+ case Opt_imod: -+ u.mod->path = "(indexed)"; -+ if (unlikely(match_int(&a->args[0], &n))) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ err = au_opts_parse_imod(sb, n, &opt->mod, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+#endif -+ case Opt_xino: -+ err = au_opts_parse_xino(sb, &opt->xino, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+ -+ case Opt_trunc_xino_path: -+ err = au_opts_parse_xino_itrunc_path -+ (sb, &opt->xino_itrunc, a->args); -+ if (!err) -+ opt->type = token; -+ break; -+ -+ case Opt_itrunc_xino: -+ u.xino_itrunc = &opt->xino_itrunc; -+ if (unlikely(match_int(&a->args[0], &n))) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ u.xino_itrunc->bindex = n; -+ aufs_read_lock(root, AuLock_FLUSH); -+ if (n < 0 || au_sbbot(sb) < n) { -+ pr_err("out of bounds, %d\n", n); -+ aufs_read_unlock(root, !AuLock_IR); -+ break; -+ } -+ aufs_read_unlock(root, !AuLock_IR); -+ err = 0; -+ opt->type = token; -+ break; -+ -+ case Opt_dirwh: -+ if (unlikely(match_int(&a->args[0], &opt->dirwh))) -+ break; -+ err = 0; -+ opt->type = token; -+ break; -+ -+ case Opt_rdcache: -+ if (unlikely(match_int(&a->args[0], &n))) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ if (unlikely(n > AUFS_RDCACHE_MAX)) { -+ pr_err("rdcache must be smaller than %d\n", -+ AUFS_RDCACHE_MAX); -+ break; -+ } -+ opt->rdcache = n; -+ err = 0; -+ opt->type = token; -+ break; -+ case Opt_rdblk: -+ if (unlikely(match_int(&a->args[0], &n) -+ || n < 0 -+ || n > KMALLOC_MAX_SIZE)) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ if (unlikely(n && n < NAME_MAX)) { -+ pr_err("rdblk must be larger than %d\n", -+ NAME_MAX); -+ break; -+ } -+ opt->rdblk = n; -+ err = 0; -+ opt->type = token; -+ break; -+ case Opt_rdhash: -+ if (unlikely(match_int(&a->args[0], &n) -+ || n < 0 -+ || n * sizeof(struct hlist_head) -+ > KMALLOC_MAX_SIZE)) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ opt->rdhash = n; -+ err = 0; -+ opt->type = token; -+ break; -+ -+ case Opt_trunc_xino: -+ case Opt_notrunc_xino: -+ case Opt_noxino: -+ case Opt_trunc_xib: -+ case Opt_notrunc_xib: -+ case Opt_shwh: -+ case Opt_noshwh: -+ case Opt_dirperm1: -+ case Opt_nodirperm1: -+ case Opt_plink: -+ case Opt_noplink: -+ case Opt_list_plink: -+ case Opt_dio: -+ case Opt_nodio: -+ case Opt_diropq_a: -+ case Opt_diropq_w: -+ case Opt_warn_perm: -+ case Opt_nowarn_perm: -+ case Opt_verbose: -+ case Opt_noverbose: -+ case Opt_sum: -+ case Opt_nosum: -+ case Opt_wsum: -+ case Opt_rdblk_def: -+ case Opt_rdhash_def: -+ case Opt_dirren: -+ case Opt_nodirren: -+ case Opt_acl: -+ case Opt_noacl: -+ err = 0; -+ opt->type = token; -+ break; -+ -+ case Opt_udba: -+ opt->udba = udba_val(a->args[0].from); -+ if (opt->udba >= 0) { -+ err = 0; -+ opt->type = token; -+ } else -+ pr_err("wrong value, %s\n", opt_str); -+ break; -+ -+ case Opt_wbr_create: -+ u.create = &opt->wbr_create; -+ u.create->wbr_create -+ = au_wbr_create_val(a->args[0].from, u.create); -+ if (u.create->wbr_create >= 0) { -+ err = 0; -+ opt->type = token; -+ } else -+ pr_err("wrong value, %s\n", opt_str); -+ break; -+ case Opt_wbr_copyup: -+ opt->wbr_copyup = au_wbr_copyup_val(a->args[0].from); -+ if (opt->wbr_copyup >= 0) { -+ err = 0; -+ opt->type = token; -+ } else -+ pr_err("wrong value, %s\n", opt_str); -+ break; -+ -+ case Opt_fhsm_sec: -+ if (unlikely(match_int(&a->args[0], &n) -+ || n < 0)) { -+ pr_err("bad integer in %s\n", opt_str); -+ break; -+ } -+ if (sysaufs_brs) { -+ opt->fhsm_second = n; -+ opt->type = token; -+ } else -+ pr_warn("ignored %s\n", opt_str); -+ err = 0; -+ break; -+ -+ case Opt_ignore: -+ pr_warn("ignored %s\n", opt_str); -+ fallthrough; -+ case Opt_ignore_silent: -+ skipped = 1; -+ err = 0; -+ break; -+ case Opt_err: -+ pr_err("unknown option %s\n", opt_str); -+ break; -+ } -+ -+ if (!err && !skipped) { -+ if (unlikely(++opt > opt_tail)) { -+ err = -E2BIG; -+ opt--; -+ opt->type = Opt_tail; -+ break; -+ } -+ opt->type = Opt_tail; -+ } -+ } -+ -+ au_kfree_rcu(a); -+ dump_opts(opts); -+ if (unlikely(err)) -+ au_opts_free(opts); -+ -+out: -+ return err; -+} -+ +static int au_opt_wbr_create(struct super_block *sb, + struct au_opt_wbr_create *create) +{ @@ -26292,12 +26800,13 @@ index 000000000000..84646345116b + break; + + case Opt_plink: -+ au_opt_set(sbinfo->si_mntflags, PLINK); -+ break; -+ case Opt_noplink: -+ if (au_opt_test(sbinfo->si_mntflags, PLINK)) -+ au_plink_put(sb, /*verbose*/1); -+ au_opt_clr(sbinfo->si_mntflags, PLINK); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, PLINK); ++ else { ++ if (au_opt_test(sbinfo->si_mntflags, PLINK)) ++ au_plink_put(sb, /*verbose*/1); ++ au_opt_clr(sbinfo->si_mntflags, PLINK); ++ } + break; + case Opt_list_plink: + if (au_opt_test(sbinfo->si_mntflags, PLINK)) @@ -26305,12 +26814,13 @@ index 000000000000..84646345116b + break; + + case Opt_dio: -+ au_opt_set(sbinfo->si_mntflags, DIO); -+ au_fset_opts(opts->flags, REFRESH_DYAOP); -+ break; -+ case Opt_nodio: -+ au_opt_clr(sbinfo->si_mntflags, DIO); -+ au_fset_opts(opts->flags, REFRESH_DYAOP); ++ if (opt->tf) { ++ au_opt_set(sbinfo->si_mntflags, DIO); ++ au_fset_opts(opts->flags, REFRESH_DYAOP); ++ } else { ++ au_opt_clr(sbinfo->si_mntflags, DIO); ++ au_fset_opts(opts->flags, REFRESH_DYAOP); ++ } + break; + + case Opt_fhsm_sec: @@ -26325,30 +26835,31 @@ index 000000000000..84646345116b + break; + + case Opt_warn_perm: -+ au_opt_set(sbinfo->si_mntflags, WARN_PERM); -+ break; -+ case Opt_nowarn_perm: -+ au_opt_clr(sbinfo->si_mntflags, WARN_PERM); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, WARN_PERM); ++ else ++ au_opt_clr(sbinfo->si_mntflags, WARN_PERM); + break; + + case Opt_verbose: -+ au_opt_set(sbinfo->si_mntflags, VERBOSE); -+ break; -+ case Opt_noverbose: -+ au_opt_clr(sbinfo->si_mntflags, VERBOSE); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, VERBOSE); ++ else ++ au_opt_clr(sbinfo->si_mntflags, VERBOSE); + break; + + case Opt_sum: -+ au_opt_set(sbinfo->si_mntflags, SUM); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, SUM); ++ else { ++ au_opt_clr(sbinfo->si_mntflags, SUM); ++ au_opt_clr(sbinfo->si_mntflags, SUM_W); ++ } + break; + case Opt_wsum: + au_opt_clr(sbinfo->si_mntflags, SUM); + au_opt_set(sbinfo->si_mntflags, SUM_W); + break; -+ case Opt_nosum: -+ au_opt_clr(sbinfo->si_mntflags, SUM); -+ au_opt_clr(sbinfo->si_mntflags, SUM_W); -+ break; + + case Opt_wbr_create: + err = au_opt_wbr_create(sb, &opt->wbr_create); @@ -26369,35 +26880,29 @@ index 000000000000..84646345116b + case Opt_rdblk: + sbinfo->si_rdblk = opt->rdblk; + break; -+ case Opt_rdblk_def: -+ sbinfo->si_rdblk = AUFS_RDBLK_DEF; -+ break; + case Opt_rdhash: + sbinfo->si_rdhash = opt->rdhash; + break; -+ case Opt_rdhash_def: -+ sbinfo->si_rdhash = AUFS_RDHASH_DEF; -+ break; + + case Opt_shwh: -+ au_opt_set(sbinfo->si_mntflags, SHWH); -+ break; -+ case Opt_noshwh: -+ au_opt_clr(sbinfo->si_mntflags, SHWH); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, SHWH); ++ else ++ au_opt_clr(sbinfo->si_mntflags, SHWH); + break; + + case Opt_dirperm1: -+ au_opt_set(sbinfo->si_mntflags, DIRPERM1); -+ break; -+ case Opt_nodirperm1: -+ au_opt_clr(sbinfo->si_mntflags, DIRPERM1); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, DIRPERM1); ++ else ++ au_opt_clr(sbinfo->si_mntflags, DIRPERM1); + break; + + case Opt_trunc_xino: -+ au_opt_set(sbinfo->si_mntflags, TRUNC_XINO); -+ break; -+ case Opt_notrunc_xino: -+ au_opt_clr(sbinfo->si_mntflags, TRUNC_XINO); ++ if (opt->tf) ++ au_opt_set(sbinfo->si_mntflags, TRUNC_XINO); ++ else ++ au_opt_clr(sbinfo->si_mntflags, TRUNC_XINO); + break; + + case Opt_trunc_xino_path: @@ -26409,39 +26914,39 @@ index 000000000000..84646345116b + break; + + case Opt_trunc_xib: -+ au_fset_opts(opts->flags, TRUNC_XIB); -+ break; -+ case Opt_notrunc_xib: -+ au_fclr_opts(opts->flags, TRUNC_XIB); ++ if (opt->tf) ++ au_fset_opts(opts->flags, TRUNC_XIB); ++ else ++ au_fclr_opts(opts->flags, TRUNC_XIB); + break; + + case Opt_dirren: + err = 1; -+ if (!au_opt_test(sbinfo->si_mntflags, DIRREN)) { -+ err = au_dr_opt_set(sb); -+ if (!err) -+ err = 1; -+ } -+ if (err == 1) -+ au_opt_set(sbinfo->si_mntflags, DIRREN); -+ break; -+ case Opt_nodirren: -+ err = 1; -+ if (au_opt_test(sbinfo->si_mntflags, DIRREN)) { -+ err = au_dr_opt_clr(sb, au_ftest_opts(opts->flags, -+ DR_FLUSHED)); -+ if (!err) -+ err = 1; ++ if (opt->tf) { ++ if (!au_opt_test(sbinfo->si_mntflags, DIRREN)) { ++ err = au_dr_opt_set(sb); ++ if (!err) ++ err = 1; ++ } ++ if (err == 1) ++ au_opt_set(sbinfo->si_mntflags, DIRREN); ++ } else { ++ if (au_opt_test(sbinfo->si_mntflags, DIRREN)) { ++ err = au_dr_opt_clr(sb, au_ftest_opts(opts->flags, ++ DR_FLUSHED)); ++ if (!err) ++ err = 1; ++ } ++ if (err == 1) ++ au_opt_clr(sbinfo->si_mntflags, DIRREN); + } -+ if (err == 1) -+ au_opt_clr(sbinfo->si_mntflags, DIRREN); + break; + + case Opt_acl: -+ sb->s_flags |= SB_POSIXACL; -+ break; -+ case Opt_noacl: -+ sb->s_flags &= ~SB_POSIXACL; ++ if (opt->tf) ++ sb->s_flags |= SB_POSIXACL; ++ else ++ sb->s_flags &= ~SB_POSIXACL; + break; + + default: @@ -26521,12 +27026,9 @@ index 000000000000..84646345116b + case Opt_xino: + err = au_xino_set(sb, &opt->xino, + !!au_ftest_opts(opts->flags, REMOUNT)); -+ if (unlikely(err)) -+ break; -+ -+ *opt_xino = &opt->xino; ++ if (!err) ++ *opt_xino = &opt->xino; + break; -+ + case Opt_noxino: + au_xino_clr(sb); + *opt_xino = (void *)-1; @@ -26838,15 +27340,15 @@ index 000000000000..84646345116b +} diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h new file mode 100644 -index 000000000000..79f3ea56f8bb +index 000000000000..d8bbdbf0560a --- /dev/null +++ b/fs/aufs/opts.h -@@ -0,0 +1,225 @@ +@@ -0,0 +1,263 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -26869,9 +27371,34 @@ index 000000000000..79f3ea56f8bb + +#ifdef __KERNEL__ + ++#include <linux/fs_parser.h> ++#include <linux/namei.h> +#include <linux/path.h> + -+struct file; ++enum { ++ Opt_br, ++ Opt_add, Opt_del, Opt_mod, Opt_append, Opt_prepend, ++ Opt_idel, Opt_imod, ++ Opt_dirwh, Opt_rdcache, Opt_rdblk, Opt_rdhash, ++ Opt_xino, Opt_noxino, ++ Opt_trunc_xino, Opt_trunc_xino_v, ++ Opt_trunc_xino_path, Opt_itrunc_xino, ++ Opt_trunc_xib, ++ Opt_shwh, ++ Opt_plink, Opt_list_plink, ++ Opt_udba, ++ Opt_dio, ++ Opt_diropq, Opt_diropq_a, Opt_diropq_w, ++ Opt_warn_perm, ++ Opt_wbr_copyup, Opt_wbr_create, ++ Opt_fhsm_sec, ++ Opt_verbose, Opt_noverbose, ++ Opt_sum, Opt_wsum, ++ Opt_dirperm1, ++ Opt_dirren, ++ Opt_acl, ++ Opt_tail, Opt_ignore, Opt_ignore_silent, Opt_err ++}; + +/* ---------------------------------------------------------------------- */ + @@ -26916,6 +27443,8 @@ index 000000000000..79f3ea56f8bb + | AuOpt_UDBA_REVAL \ + | AuOpt_UDBA_HNOTIFY) + ++#define AuOpt_LkupDirFlags (LOOKUP_FOLLOW | LOOKUP_DIRECTORY) ++ +#define au_opt_test(flags, name) (flags & AuOpt_##name) +#define au_opt_set(flags, name) do { \ + BUILD_BUG_ON(AuOpt_##name & AuOptMask_UDBA); \ @@ -26968,6 +27497,8 @@ index 000000000000..79f3ea56f8bb + +/* ---------------------------------------------------------------------- */ + ++struct file; ++ +struct au_opt_add { + aufs_bindex_t bindex; + char *pathname; @@ -27017,6 +27548,7 @@ index 000000000000..79f3ea56f8bb + struct au_opt_wbr_create wbr_create; + int wbr_copyup; + unsigned int fhsm_second; ++ bool tf; /* generic flag, true or false */ + }; +}; + @@ -27050,14 +27582,18 @@ index 000000000000..79f3ea56f8bb +/* ---------------------------------------------------------------------- */ + +/* opts.c */ ++int au_br_perm_val(char *perm); +void au_optstr_br_perm(au_br_perm_str_t *str, int perm); ++int au_udba_val(char *str); +const char *au_optstr_udba(int udba); -+const char *au_optstr_wbr_copyup(int wbr_copyup); ++int au_wbr_create_val(char *str, struct au_opt_wbr_create *create); +const char *au_optstr_wbr_create(int wbr_create); ++int au_wbr_copyup_val(char *str); ++const char *au_optstr_wbr_copyup(int wbr_copyup); + -+void au_opts_free(struct au_opts *opts); ++int au_opt_add(struct au_opt *opt, char *opt_str, unsigned long sb_flags, ++ aufs_bindex_t bindex); +struct super_block; -+int au_opts_parse(struct super_block *sb, char *str, struct au_opts *opts); +int au_opts_verify(struct super_block *sb, unsigned long sb_flags, + unsigned int pending); +int au_opts_mount(struct super_block *sb, struct au_opts *opts); @@ -27065,19 +27601,23 @@ index 000000000000..79f3ea56f8bb + +unsigned int au_opt_udba(struct super_block *sb); + ++/* fsctx.c */ ++int aufs_fsctx_init(struct fs_context *fc); ++extern const struct fs_parameter_spec aufs_fsctx_paramspec[]; ++ +#endif /* __KERNEL__ */ +#endif /* __AUFS_OPTS_H__ */ diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c new file mode 100644 -index 000000000000..850829b21888 +index 000000000000..5f9a5b50dcc6 --- /dev/null +++ b/fs/aufs/plink.c @@ -0,0 +1,516 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -27281,35 +27821,35 @@ index 000000000000..850829b21888 +struct au_do_plink_lkup_args { + struct dentry **errp; + struct qstr *tgtname; -+ struct dentry *h_parent; -+ struct au_branch *br; ++ struct path *h_ppath; +}; + +static struct dentry *au_do_plink_lkup(struct qstr *tgtname, -+ struct dentry *h_parent, -+ struct au_branch *br) ++ struct path *h_ppath) +{ + struct dentry *h_dentry; + struct inode *h_inode; + -+ h_inode = d_inode(h_parent); ++ h_inode = d_inode(h_ppath->dentry); + inode_lock_shared_nested(h_inode, AuLsc_I_CHILD2); -+ h_dentry = vfsub_lkup_one(tgtname, h_parent); ++ h_dentry = vfsub_lkup_one(tgtname, h_ppath); + inode_unlock_shared(h_inode); ++ + return h_dentry; +} + +static void au_call_do_plink_lkup(void *args) +{ + struct au_do_plink_lkup_args *a = args; -+ *a->errp = au_do_plink_lkup(a->tgtname, a->h_parent, a->br); ++ *a->errp = au_do_plink_lkup(a->tgtname, a->h_ppath); +} + +/* lookup the plink-ed @inode under the branch at @bindex */ +struct dentry *au_plink_lkup(struct inode *inode, aufs_bindex_t bindex) +{ -+ struct dentry *h_dentry, *h_parent; ++ struct dentry *h_dentry; + struct au_branch *br; ++ struct path h_ppath; + int wkq_err; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); @@ -27317,40 +27857,39 @@ index 000000000000..850829b21888 + AuDebugOn(au_plink_maint(inode->i_sb, AuLock_NOPLM)); + + br = au_sbr(inode->i_sb, bindex); -+ h_parent = br->br_wbr->wbr_plink; ++ h_ppath.dentry = br->br_wbr->wbr_plink; ++ h_ppath.mnt = au_br_mnt(br); + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { + struct au_do_plink_lkup_args args = { + .errp = &h_dentry, + .tgtname = &tgtname, -+ .h_parent = h_parent, -+ .br = br ++ .h_ppath = &h_ppath + }; + + wkq_err = au_wkq_wait(au_call_do_plink_lkup, &args); + if (unlikely(wkq_err)) + h_dentry = ERR_PTR(wkq_err); + } else -+ h_dentry = au_do_plink_lkup(&tgtname, h_parent, br); ++ h_dentry = au_do_plink_lkup(&tgtname, &h_ppath); + + return h_dentry; +} + +/* create a pseudo-link */ -+static int do_whplink(struct qstr *tgt, struct dentry *h_parent, -+ struct dentry *h_dentry, struct au_branch *br) ++static int do_whplink(struct qstr *tgt, struct path *h_ppath, ++ struct dentry *h_dentry) +{ + int err; -+ struct path h_path = { -+ .mnt = au_br_mnt(br) -+ }; ++ struct path h_path; + struct inode *h_dir, *delegated; + -+ h_dir = d_inode(h_parent); ++ h_dir = d_inode(h_ppath->dentry); + inode_lock_nested(h_dir, AuLsc_I_CHILD2); ++ h_path.mnt = h_ppath->mnt; +again: -+ h_path.dentry = vfsub_lkup_one(tgt, h_parent); ++ h_path.dentry = vfsub_lkup_one(tgt, h_ppath); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) + goto out; @@ -27391,28 +27930,30 @@ index 000000000000..850829b21888 +struct do_whplink_args { + int *errp; + struct qstr *tgt; -+ struct dentry *h_parent; ++ struct path *h_ppath; + struct dentry *h_dentry; -+ struct au_branch *br; +}; + +static void call_do_whplink(void *args) +{ + struct do_whplink_args *a = args; -+ *a->errp = do_whplink(a->tgt, a->h_parent, a->h_dentry, a->br); ++ *a->errp = do_whplink(a->tgt, a->h_ppath, a->h_dentry); +} + +static int whplink(struct dentry *h_dentry, struct inode *inode, -+ aufs_bindex_t bindex, struct au_branch *br) ++ aufs_bindex_t bindex) +{ + int err, wkq_err; ++ struct au_branch *br; + struct au_wbr *wbr; -+ struct dentry *h_parent; ++ struct path h_ppath; + char a[PLINK_NAME_LEN]; + struct qstr tgtname = QSTR_INIT(a, 0); + -+ wbr = au_sbr(inode->i_sb, bindex)->br_wbr; -+ h_parent = wbr->wbr_plink; ++ br = au_sbr(inode->i_sb, bindex); ++ wbr = br->br_wbr; ++ h_ppath.dentry = wbr->wbr_plink; ++ h_ppath.mnt = au_br_mnt(br); + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + /* always superio. */ @@ -27420,15 +27961,14 @@ index 000000000000..850829b21888 + struct do_whplink_args args = { + .errp = &err, + .tgt = &tgtname, -+ .h_parent = h_parent, -+ .h_dentry = h_dentry, -+ .br = br ++ .h_ppath = &h_ppath, ++ .h_dentry = h_dentry + }; + wkq_err = au_wkq_wait(call_do_whplink, &args); + if (unlikely(wkq_err)) + err = wkq_err; + } else -+ err = do_whplink(&tgtname, h_parent, h_dentry, br); ++ err = do_whplink(&tgtname, &h_ppath, h_dentry); + + return err; +} @@ -27478,7 +28018,7 @@ index 000000000000..850829b21888 + if (cnt > AUFS_PLINK_WARN) + AuWarn1(msg ", %d\n", cnt); +#undef msg -+ err = whplink(h_dentry, inode, bindex, au_sbr(sb, bindex)); ++ err = whplink(h_dentry, inode, bindex); + if (unlikely(err)) { + pr_warn("err %d, damaged pseudo link.\n", err); + au_hbl_del(&icntnr->plink, hbl); @@ -27591,15 +28131,15 @@ index 000000000000..850829b21888 +} diff --git a/fs/aufs/poll.c b/fs/aufs/poll.c new file mode 100644 -index 000000000000..6975d3ab2d29 +index 000000000000..83defa454c8e --- /dev/null +++ b/fs/aufs/poll.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -27648,15 +28188,15 @@ index 000000000000..6975d3ab2d29 +} diff --git a/fs/aufs/posix_acl.c b/fs/aufs/posix_acl.c new file mode 100644 -index 000000000000..198196f6e796 +index 000000000000..03742bcc6603 --- /dev/null +++ b/fs/aufs/posix_acl.c -@@ -0,0 +1,106 @@ +@@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2014-2020 Junjiro R. Okajima ++ * Copyright (C) 2014-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -27677,7 +28217,7 @@ index 000000000000..198196f6e796 +#include <linux/fs.h> +#include "aufs.h" + -+struct posix_acl *aufs_get_acl(struct inode *inode, int type) ++struct posix_acl *aufs_get_inode_acl(struct inode *inode, int type, bool rcu) +{ + struct posix_acl *acl; + int err; @@ -27685,12 +28225,16 @@ index 000000000000..198196f6e796 + struct inode *h_inode; + struct super_block *sb; + ++ acl = ERR_PTR(-ECHILD); ++ if (rcu) ++ goto out; ++ + acl = NULL; + sb = inode->i_sb; + si_read_lock(sb, AuLock_FLUSH); + ii_read_lock_child(inode); + if (!(sb->s_flags & SB_POSIXACL)) -+ goto out; ++ goto unlock; + + bindex = au_ibtop(inode); + h_inode = au_h_iptr(inode, bindex); @@ -27699,30 +28243,43 @@ index 000000000000..198196f6e796 + != (inode->i_mode & S_IFMT)))) { + err = au_busy_or_stale(); + acl = ERR_PTR(err); -+ goto out; ++ goto unlock; + } + + /* always topmost only */ -+ acl = get_acl(h_inode, type); ++ acl = get_inode_acl(h_inode, type); + if (IS_ERR(acl)) + forget_cached_acl(inode, type); + else + set_cached_acl(inode, type, acl); + -+out: ++unlock: + ii_read_unlock(inode); + si_read_unlock(sb); + ++out: + AuTraceErrPtr(acl); + return acl; +} + -+int aufs_set_acl(struct user_namespace *userns, struct inode *inode, ++struct posix_acl *aufs_get_acl(struct mnt_idmap *idmap, ++ struct dentry *dentry, int type) ++{ ++ struct posix_acl *acl; ++ struct inode *inode; ++ ++ inode = d_inode(dentry); ++ acl = aufs_get_inode_acl(inode, type, /*rcu*/false); ++ ++ return acl; ++} ++ ++int aufs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, + struct posix_acl *acl, int type) +{ + int err; + ssize_t ssz; -+ struct dentry *dentry; ++ struct inode *inode; + struct au_sxattr arg = { + .type = AU_ACL_SET, + .u.acl_set = { @@ -27731,44 +28288,29 @@ index 000000000000..198196f6e796 + }, + }; + ++ inode = d_inode(dentry); + IMustLock(inode); + -+ if (inode->i_ino == AUFS_ROOT_INO) -+ dentry = dget(inode->i_sb->s_root); -+ else { -+ dentry = d_find_alias(inode); -+ if (!dentry) -+ dentry = d_find_any_alias(inode); -+ if (!dentry) { -+ pr_warn("cannot handle this inode, " -+ "please report to aufs-users ML\n"); -+ err = -ENOENT; -+ goto out; -+ } -+ } -+ + ssz = au_sxattr(dentry, inode, &arg); + /* forget even it if succeeds since the branch might set differently */ + forget_cached_acl(inode, type); -+ dput(dentry); + err = ssz; + if (ssz >= 0) + err = 0; + -+out: + return err; +} diff --git a/fs/aufs/procfs.c b/fs/aufs/procfs.c new file mode 100644 -index 000000000000..50ee0a9c1bcb +index 000000000000..0fca104ac554 --- /dev/null +++ b/fs/aufs/procfs.c @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2010-2020 Junjiro R. Okajima ++ * Copyright (C) 2010-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -27936,15 +28478,15 @@ index 000000000000..50ee0a9c1bcb +} diff --git a/fs/aufs/rdu.c b/fs/aufs/rdu.c new file mode 100644 -index 000000000000..afd77564f3dc +index 000000000000..144251c02c3f --- /dev/null +++ b/fs/aufs/rdu.c @@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -27987,8 +28529,8 @@ index 000000000000..afd77564f3dc + int err; +}; + -+static int au_rdu_fill(struct dir_context *ctx, const char *name, int nlen, -+ loff_t offset, u64 h_ino, unsigned int d_type) ++static bool au_rdu_fill(struct dir_context *ctx, const char *name, int nlen, ++ loff_t offset, u64 h_ino, unsigned int d_type) +{ + int err, len; + struct au_rdu_arg *arg = container_of(ctx, struct au_rdu_arg, ctx); @@ -28029,7 +28571,7 @@ index 000000000000..afd77564f3dc + +out: + /* AuTraceErr(err); */ -+ return err; ++ return !err; +} + +static int au_rdu_do(struct file *h_file, struct au_rdu_arg *arg) @@ -28092,7 +28634,7 @@ index 000000000000..afd77564f3dc + arg.end += rdu->sz; + + err = -ENOTDIR; -+ if (unlikely(!file->f_op->iterate && !file->f_op->iterate_shared)) ++ if (unlikely(!file->f_op->iterate_shared)) + goto out; + + err = security_file_permission(file, MAY_READ); @@ -28326,15 +28868,15 @@ index 000000000000..afd77564f3dc +#endif diff --git a/fs/aufs/rwsem.h b/fs/aufs/rwsem.h new file mode 100644 -index 000000000000..6df9f277043f +index 000000000000..9d9cd50ef155 --- /dev/null +++ b/fs/aufs/rwsem.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -28417,15 +28959,15 @@ index 000000000000..6df9f277043f +#endif /* __AUFS_RWSEM_H__ */ diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c new file mode 100644 -index 000000000000..3835be61d978 +index 000000000000..dde9f9c17b18 --- /dev/null +++ b/fs/aufs/sbinfo.c -@@ -0,0 +1,314 @@ +@@ -0,0 +1,316 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -28479,10 +29021,10 @@ index 000000000000..3835be61d978 + au_kfree_rcu(sbinfo); +} + -+int au_si_alloc(struct super_block *sb) ++struct au_sbinfo *au_si_alloc(struct super_block *sb) +{ -+ int err, i; + struct au_sbinfo *sbinfo; ++ int err, i; + + err = -ENOMEM; + sbinfo = kzalloc(sizeof(*sbinfo), GFP_NOFS); @@ -28547,16 +29089,18 @@ index 000000000000..3835be61d978 + + /* leave other members for sysaufs and si_mnt. */ + sbinfo->si_sb = sb; -+ sb->s_fs_info = sbinfo; -+ si_pid_set(sb); -+ return 0; /* success */ ++ if (sb) { ++ sb->s_fs_info = sbinfo; ++ si_pid_set(sb); ++ } ++ return sbinfo; /* success */ + +out_br: + au_kfree_try_rcu(sbinfo->si_branch); +out_sbinfo: + au_kfree_rcu(sbinfo); +out: -+ return err; ++ return ERR_PTR(err); +} + +int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink) @@ -28737,15 +29281,15 @@ index 000000000000..3835be61d978 +} diff --git a/fs/aufs/super.c b/fs/aufs/super.c new file mode 100644 -index 000000000000..1615c0e8f238 +index 000000000000..77c6d90808bb --- /dev/null +++ b/fs/aufs/super.c -@@ -0,0 +1,1050 @@ +@@ -0,0 +1,871 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -28777,7 +29321,7 @@ index 000000000000..1615c0e8f238 +{ + struct au_icntnr *c; + -+ c = au_cache_alloc_icntnr(); ++ c = au_cache_alloc_icntnr(sb); + if (c) { + au_icntnr_init(c); + inode_set_iversion(&c->vfs_inode, 1); /* sigen(sb); */ @@ -28860,7 +29404,7 @@ index 000000000000..1615c0e8f238 + return err; +} + -+static void au_gen_fmt(char *fmt, int len __maybe_unused, const char *pat, ++static void au_gen_fmt(char *fmt, int len, const char *pat, + const char *append) +{ + char *p; @@ -28869,7 +29413,7 @@ index 000000000000..1615c0e8f238 + while (*pat != ':') + *p++ = *pat++; + *p++ = *pat++; -+ strcpy(p, append); ++ strscpy(p, append, len - (p - fmt)); + AuDebugOn(strlen(fmt) >= len); +} + @@ -29196,7 +29740,7 @@ index 000000000000..1615c0e8f238 + continue; + + h_sb = au_sbr_sb(sb, bindex); -+ e = vfsub_sync_filesystem(h_sb, wait); ++ e = vfsub_sync_filesystem(h_sb); + if (unlikely(e && !err)) + err = e; + /* go on even if an error happens */ @@ -29444,7 +29988,7 @@ index 000000000000..1615c0e8f238 + return err; +} + -+static void au_remount_refresh(struct super_block *sb, unsigned int do_idop) ++void au_remount_refresh(struct super_block *sb, unsigned int do_idop) +{ + int err, e; + unsigned int udba; @@ -29505,92 +30049,7 @@ index 000000000000..1615c0e8f238 + AuIOErr("refresh failed, ignored, %d\n", err); +} + -+/* stop extra interpretation of errno in mount(8), and strange error messages */ -+static int cvt_err(int err) -+{ -+ AuTraceErr(err); -+ -+ switch (err) { -+ case -ENOENT: -+ case -ENOTDIR: -+ case -EEXIST: -+ case -EIO: -+ err = -EINVAL; -+ } -+ return err; -+} -+ -+static int aufs_remount_fs(struct super_block *sb, int *flags, char *data) -+{ -+ int err, do_dx; -+ unsigned int mntflags; -+ struct au_opts opts = { -+ .opt = NULL -+ }; -+ struct dentry *root; -+ struct inode *inode; -+ struct au_sbinfo *sbinfo; -+ -+ err = 0; -+ root = sb->s_root; -+ if (!data || !*data) { -+ err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); -+ if (!err) { -+ di_write_lock_child(root); -+ err = au_opts_verify(sb, *flags, /*pending*/0); -+ aufs_write_unlock(root); -+ } -+ goto out; -+ } -+ -+ err = -ENOMEM; -+ opts.opt = (void *)__get_free_page(GFP_NOFS); -+ if (unlikely(!opts.opt)) -+ goto out; -+ opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); -+ opts.flags = AuOpts_REMOUNT; -+ opts.sb_flags = *flags; -+ -+ /* parse it before aufs lock */ -+ err = au_opts_parse(sb, data, &opts); -+ if (unlikely(err)) -+ goto out_opts; -+ -+ sbinfo = au_sbi(sb); -+ inode = d_inode(root); -+ inode_lock(inode); -+ err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM); -+ if (unlikely(err)) -+ goto out_mtx; -+ di_write_lock_child(root); -+ -+ /* au_opts_remount() may return an error */ -+ err = au_opts_remount(sb, &opts); -+ au_opts_free(&opts); -+ -+ if (au_ftest_opts(opts.flags, REFRESH)) -+ au_remount_refresh(sb, au_ftest_opts(opts.flags, REFRESH_IDOP)); -+ -+ if (au_ftest_opts(opts.flags, REFRESH_DYAOP)) { -+ mntflags = au_mntflags(sb); -+ do_dx = !!au_opt_test(mntflags, DIO); -+ au_dy_arefresh(do_dx); -+ } -+ -+ au_fhsm_wrote_all(sb, /*force*/1); /* ?? */ -+ aufs_write_unlock(root); -+ -+out_mtx: -+ inode_unlock(inode); -+out_opts: -+ free_page((unsigned long)opts.opt); -+out: -+ err = cvt_err(err); -+ AuTraceErr(err); -+ return err; -+} -+ -+static const struct super_operations aufs_sop = { ++const struct super_operations aufs_sop = { + .alloc_inode = aufs_alloc_inode, + .destroy_inode = aufs_destroy_inode, + .free_inode = aufs_free_inode, @@ -29599,13 +30058,12 @@ index 000000000000..1615c0e8f238 + .show_options = aufs_show_options, + .statfs = aufs_statfs, + .put_super = aufs_put_super, -+ .sync_fs = aufs_sync_fs, -+ .remount_fs = aufs_remount_fs ++ .sync_fs = aufs_sync_fs +}; + +/* ---------------------------------------------------------------------- */ + -+static int alloc_root(struct super_block *sb) ++int au_alloc_root(struct super_block *sb) +{ + int err; + struct inode *inode; @@ -29641,141 +30099,47 @@ index 000000000000..1615c0e8f238 + return err; +} + -+static int aufs_fill_super(struct super_block *sb, void *raw_data, -+ int silent __maybe_unused) ++/* ---------------------------------------------------------------------- */ ++ ++static void aufs_kill_sb(struct super_block *sb) +{ -+ int err; -+ struct au_opts opts = { -+ .opt = NULL -+ }; + struct au_sbinfo *sbinfo; + struct dentry *root; -+ struct inode *inode; -+ char *arg = raw_data; -+ -+ if (unlikely(!arg || !*arg)) { -+ err = -EINVAL; -+ pr_err("no arg\n"); -+ goto out; -+ } + -+ err = -ENOMEM; -+ opts.opt = (void *)__get_free_page(GFP_NOFS); -+ if (unlikely(!opts.opt)) -+ goto out; -+ opts.max_opt = PAGE_SIZE / sizeof(*opts.opt); -+ opts.sb_flags = sb->s_flags; -+ -+ err = au_si_alloc(sb); -+ if (unlikely(err)) -+ goto out_opts; + sbinfo = au_sbi(sb); ++ if (!sbinfo) ++ goto out; + -+ /* all timestamps always follow the ones on the branch */ -+ sb->s_flags |= SB_NOATIME | SB_NODIRATIME; -+ sb->s_flags |= SB_I_VERSION; /* do we really need this? */ -+ sb->s_op = &aufs_sop; -+ sb->s_d_op = &aufs_dop; -+ sb->s_magic = AUFS_SUPER_MAGIC; -+ sb->s_maxbytes = 0; -+ sb->s_stack_depth = 1; -+ au_export_init(sb); -+ au_xattr_init(sb); ++ au_sbilist_del(sb); + -+ err = alloc_root(sb); -+ if (unlikely(err)) { -+ si_write_unlock(sb); -+ goto out_info; -+ } + root = sb->s_root; -+ inode = d_inode(root); -+ -+ /* -+ * actually we can parse options regardless aufs lock here. -+ * but at remount time, parsing must be done before aufs lock. -+ * so we follow the same rule. -+ */ -+ ii_write_lock_parent(inode); -+ aufs_write_unlock(root); -+ err = au_opts_parse(sb, arg, &opts); -+ if (unlikely(err)) -+ goto out_root; ++ if (root) ++ aufs_write_lock(root); ++ else ++ __si_write_lock(sb); + -+ /* lock vfs_inode first, then aufs. */ -+ inode_lock(inode); -+ aufs_write_lock(root); -+ err = au_opts_mount(sb, &opts); -+ au_opts_free(&opts); -+ if (!err && au_ftest_si(sbinfo, NO_DREVAL)) { -+ sb->s_d_op = &aufs_dop_noreval; -+ pr_info("%ps\n", sb->s_d_op); -+ au_refresh_dop(root, /*force_reval*/0); -+ sbinfo->si_iop_array = aufs_iop_nogetattr; -+ au_refresh_iop(inode, /*force_getattr*/0); ++ au_fhsm_fin(sb); ++ if (sbinfo->si_wbr_create_ops->fin) ++ sbinfo->si_wbr_create_ops->fin(sb); ++ if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) { ++ au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE); ++ au_remount_refresh(sb, /*do_idop*/0); + } -+ aufs_write_unlock(root); -+ inode_unlock(inode); -+ if (!err) -+ goto out_opts; /* success */ -+ -+out_root: -+ dput(root); -+ sb->s_root = NULL; -+out_info: -+ kobject_put(&sbinfo->si_kobj); -+ sb->s_fs_info = NULL; -+out_opts: -+ free_page((unsigned long)opts.opt); -+out: -+ AuTraceErr(err); -+ err = cvt_err(err); -+ AuTraceErr(err); -+ return err; -+} -+ -+/* ---------------------------------------------------------------------- */ -+ -+static struct dentry *aufs_mount(struct file_system_type *fs_type, int flags, -+ const char *dev_name __maybe_unused, -+ void *raw_data) -+{ -+ struct dentry *root; ++ if (au_opt_test(sbinfo->si_mntflags, PLINK)) ++ au_plink_put(sb, /*verbose*/1); ++ au_xino_clr(sb); ++ if (root) ++ au_dr_opt_flush(sb); + -+ /* all timestamps always follow the ones on the branch */ -+ /* mnt->mnt_flags |= MNT_NOATIME | MNT_NODIRATIME; */ -+ root = mount_nodev(fs_type, flags, raw_data, aufs_fill_super); -+ if (IS_ERR(root)) -+ goto out; ++ if (root) ++ aufs_write_unlock(root); ++ else ++ __si_write_unlock(sb); + -+ au_sbilist_add(root->d_sb); ++ sbinfo->si_sb = NULL; ++ au_nwt_flush(&sbinfo->si_nowait); + +out: -+ return root; -+} -+ -+static void aufs_kill_sb(struct super_block *sb) -+{ -+ struct au_sbinfo *sbinfo; -+ -+ sbinfo = au_sbi(sb); -+ if (sbinfo) { -+ au_sbilist_del(sb); -+ aufs_write_lock(sb->s_root); -+ au_fhsm_fin(sb); -+ if (sbinfo->si_wbr_create_ops->fin) -+ sbinfo->si_wbr_create_ops->fin(sb); -+ if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) { -+ au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE); -+ au_remount_refresh(sb, /*do_idop*/0); -+ } -+ if (au_opt_test(sbinfo->si_mntflags, PLINK)) -+ au_plink_put(sb, /*verbose*/1); -+ au_xino_clr(sb); -+ au_dr_opt_flush(sb); -+ sbinfo->si_sb = NULL; -+ aufs_write_unlock(sb->s_root); -+ au_nwt_flush(&sbinfo->si_nowait); -+ } + kill_anon_super(sb); +} + @@ -29786,22 +30150,23 @@ index 000000000000..1615c0e8f238 + /* untested */ + /*| FS_ALLOW_IDMAP*/ + , -+ .mount = aufs_mount, ++ .init_fs_context = aufs_fsctx_init, ++ .parameters = aufs_fsctx_paramspec, + .kill_sb = aufs_kill_sb, + /* no need to __module_get() and module_put(). */ + .owner = THIS_MODULE, +}; diff --git a/fs/aufs/super.h b/fs/aufs/super.h new file mode 100644 -index 000000000000..4638331366b7 +index 000000000000..f1d9aedcbca4 --- /dev/null +++ b/fs/aufs/super.h -@@ -0,0 +1,587 @@ +@@ -0,0 +1,592 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -30060,8 +30425,8 @@ index 000000000000..4638331366b7 +/* ---------------------------------------------------------------------- */ + +/* super.c */ -+extern struct file_system_type aufs_fs_type; +struct inode *au_iget_locked(struct super_block *sb, ino_t ino); ++ +typedef unsigned long long (*au_arraycb_t)(struct super_block *sb, void *array, + unsigned long long max, void *arg); +void *au_array_alloc(unsigned long long *hint, au_arraycb_t cb, @@ -30069,9 +30434,14 @@ index 000000000000..4638331366b7 +struct inode **au_iarray_alloc(struct super_block *sb, unsigned long long *max); +void au_iarray_free(struct inode **a, unsigned long long max); + ++void au_remount_refresh(struct super_block *sb, unsigned int do_idop); ++extern const struct super_operations aufs_sop; ++int au_alloc_root(struct super_block *sb); ++extern struct file_system_type aufs_fs_type; ++ +/* sbinfo.c */ +void au_si_free(struct kobject *kobj); -+int au_si_alloc(struct super_block *sb); ++struct au_sbinfo *au_si_alloc(struct super_block *sb); +int au_sbr_realloc(struct au_sbinfo *sbinfo, int nbr, int may_shrink); + +unsigned int au_sigen_inc(struct super_block *sb); @@ -30386,15 +30756,15 @@ index 000000000000..4638331366b7 +#endif /* __AUFS_SUPER_H__ */ diff --git a/fs/aufs/sysaufs.c b/fs/aufs/sysaufs.c new file mode 100644 -index 000000000000..f615471231b5 +index 000000000000..e3f3489c7570 --- /dev/null +++ b/fs/aufs/sysaufs.c -@@ -0,0 +1,93 @@ +@@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -30429,6 +30799,7 @@ index 000000000000..f615471231b5 + &sysaufs_si_attr_xi_path.attr, + NULL, +}; ++ATTRIBUTE_GROUPS(sysaufs_si); + +static const struct sysfs_ops au_sbi_ops = { + .show = sysaufs_si_show @@ -30437,7 +30808,7 @@ index 000000000000..f615471231b5 +static struct kobj_type au_sbi_ktype = { + .release = au_si_free, + .sysfs_ops = &au_sbi_ops, -+ .default_attrs = sysaufs_si_attrs ++ .default_groups = sysaufs_si_groups +}; + +/* ---------------------------------------------------------------------- */ @@ -30485,15 +30856,15 @@ index 000000000000..f615471231b5 +} diff --git a/fs/aufs/sysaufs.h b/fs/aufs/sysaufs.h new file mode 100644 -index 000000000000..55c5c9868f3b +index 000000000000..3f7efd4510be --- /dev/null +++ b/fs/aufs/sysaufs.h @@ -0,0 +1,102 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -30593,15 +30964,15 @@ index 000000000000..55c5c9868f3b +#endif /* __SYSAUFS_H__ */ diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c new file mode 100644 -index 000000000000..46638d88ef21 +index 000000000000..4e8a4cfa9faa --- /dev/null +++ b/fs/aufs/sysfs.c @@ -0,0 +1,374 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -30973,15 +31344,15 @@ index 000000000000..46638d88ef21 +} diff --git a/fs/aufs/sysrq.c b/fs/aufs/sysrq.c new file mode 100644 -index 000000000000..fc8aa4a2839f +index 000000000000..d4bdeafe2fe3 --- /dev/null +++ b/fs/aufs/sysrq.c @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -31128,15 +31499,15 @@ index 000000000000..fc8aa4a2839f +} diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c new file mode 100644 -index 000000000000..5ba006b80724 +index 000000000000..fdf7644049c5 --- /dev/null +++ b/fs/aufs/vdir.c @@ -0,0 +1,896 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -31586,7 +31957,7 @@ index 000000000000..5ba006b80724 + int err; +}; + -+static int fillvdir(struct dir_context *ctx, const char *__name, int nlen, ++static bool fillvdir(struct dir_context *ctx, const char *__name, int nlen, + loff_t offset __maybe_unused, u64 h_ino, + unsigned int d_type) +{ @@ -31637,7 +32008,7 @@ index 000000000000..5ba006b80724 + arg->vdir->vd_jiffy = jiffies; + /* smp_mb(); */ + AuTraceErr(arg->err); -+ return arg->err; ++ return !arg->err; +} + +static int au_handle_shwh(struct super_block *sb, struct au_vdir *vdir, @@ -32030,15 +32401,15 @@ index 000000000000..5ba006b80724 +} diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c new file mode 100644 -index 000000000000..7b2675ea0432 +index 000000000000..2fb5f1ac0b31 --- /dev/null +++ b/fs/aufs/vfsub.c -@@ -0,0 +1,916 @@ +@@ -0,0 +1,918 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -32057,7 +32428,6 @@ index 000000000000..7b2675ea0432 + */ + +#include <linux/mnt_namespace.h> -+#include <linux/namei.h> +#include <linux/nsproxy.h> +#include <linux/security.h> +#include <linux/splice.h> @@ -32073,13 +32443,13 @@ index 000000000000..7b2675ea0432 +} +#endif + -+int vfsub_sync_filesystem(struct super_block *h_sb, int wait) ++int vfsub_sync_filesystem(struct super_block *h_sb) +{ + int err; + + lockdep_off(); + down_read(&h_sb->s_umount); -+ err = __sync_filesystem(h_sb, wait); ++ err = sync_filesystem(h_sb); + up_read(&h_sb->s_umount); + lockdep_on(); + @@ -32094,6 +32464,11 @@ index 000000000000..7b2675ea0432 + struct kstat st; + struct super_block *h_sb; + ++ /* ++ * Always needs h_path->mnt for LSM or FUSE branch. ++ */ ++ AuDebugOn(!h_path->mnt); ++ + /* for remote fs, leave work for its getattr or d_revalidate */ + /* for bad i_attr fs, handle them in aufs_getattr() */ + /* still some fs may acquire i_mutex. we need to skip them */ @@ -32202,38 +32577,38 @@ index 000000000000..7b2675ea0432 +} + +struct dentry *vfsub_lookup_one_len_unlocked(const char *name, -+ struct dentry *parent, int len) ++ struct path *ppath, int len) +{ -+ struct path path = { -+ .mnt = NULL -+ }; ++ struct path path; + -+ path.dentry = lookup_one_len_unlocked(name, parent, len); ++ path.dentry = lookup_one_len_unlocked(name, ppath->dentry, len); + if (IS_ERR(path.dentry)) + goto out; -+ if (d_is_positive(path.dentry)) ++ if (d_is_positive(path.dentry)) { ++ path.mnt = ppath->mnt; + vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ ++ } + +out: + AuTraceErrPtr(path.dentry); + return path.dentry; +} + -+struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, ++struct dentry *vfsub_lookup_one_len(const char *name, struct path *ppath, + int len) +{ -+ struct path path = { -+ .mnt = NULL -+ }; ++ struct path path; + + /* VFS checks it too, but by WARN_ON_ONCE() */ -+ IMustLock(d_inode(parent)); ++ IMustLock(d_inode(ppath->dentry)); + -+ path.dentry = lookup_one_len(name, parent, len); ++ path.dentry = lookup_one_len(name, ppath->dentry, len); + if (IS_ERR(path.dentry)) + goto out; -+ if (d_is_positive(path.dentry)) ++ if (d_is_positive(path.dentry)) { ++ path.mnt = ppath->mnt; + vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ ++ } + +out: + AuTraceErrPtr(path.dentry); @@ -32243,7 +32618,7 @@ index 000000000000..7b2675ea0432 +void vfsub_call_lkup_one(void *args) +{ + struct vfsub_lkup_one_args *a = args; -+ *a->errp = vfsub_lkup_one(a->name, a->parent); ++ *a->errp = vfsub_lkup_one(a->name, a->ppath); +} + +/* ---------------------------------------------------------------------- */ @@ -32280,7 +32655,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32290,10 +32665,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_create(userns, dir, path->dentry, mode, want_excl); ++ err = vfs_create(idmap, dir, path->dentry, mode, want_excl); + lockdep_on(); + if (!err) { + struct path tmp = *path; @@ -32315,7 +32690,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32325,10 +32700,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_symlink(userns, dir, path->dentry, symname); ++ err = vfs_symlink(idmap, dir, path->dentry, symname); + lockdep_on(); + if (!err) { + struct path tmp = *path; @@ -32350,7 +32725,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32360,10 +32735,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_mknod(userns, dir, path->dentry, mode, dev); ++ err = vfs_mknod(idmap, dir, path->dentry, mode, dev); + lockdep_on(); + if (!err) { + struct path tmp = *path; @@ -32396,7 +32771,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32411,10 +32786,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_link(src_dentry, userns, dir, path->dentry, delegated_inode); ++ err = vfs_link(src_dentry, idmap, dir, path->dentry, delegated_inode); + lockdep_on(); + if (!err) { + struct path tmp = *path; @@ -32457,10 +32832,10 @@ index 000000000000..7b2675ea0432 + if (unlikely(err)) + goto out; + -+ rd.old_mnt_userns = mnt_user_ns(path->mnt); ++ rd.old_mnt_idmap = mnt_idmap(path->mnt); + rd.old_dir = src_dir; + rd.old_dentry = src_dentry; -+ rd.new_mnt_userns = rd.old_mnt_userns; ++ rd.new_mnt_idmap = rd.old_mnt_idmap; + rd.new_dir = dir; + rd.new_dentry = path->dentry; + rd.delegated_inode = delegated_inode; @@ -32490,7 +32865,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32500,10 +32875,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_mkdir(userns, dir, path->dentry, mode); ++ err = vfs_mkdir(idmap, dir, path->dentry, mode); + lockdep_on(); + if (!err) { + struct path tmp = *path; @@ -32525,7 +32900,7 @@ index 000000000000..7b2675ea0432 +{ + int err; + struct dentry *d; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + IMustLock(dir); + @@ -32535,10 +32910,10 @@ index 000000000000..7b2675ea0432 + path->dentry = d; + if (unlikely(err)) + goto out; -+ userns = mnt_user_ns(path->mnt); ++ idmap = mnt_idmap(path->mnt); + + lockdep_off(); -+ err = vfs_rmdir(userns, dir, path->dentry); ++ err = vfs_rmdir(idmap, dir, path->dentry); + lockdep_on(); + if (!err) { + struct path tmp = { @@ -32643,14 +33018,14 @@ index 000000000000..7b2675ea0432 + return err; +} + -+long vfsub_splice_to(struct file *in, loff_t *ppos, -+ struct pipe_inode_info *pipe, size_t len, -+ unsigned int flags) ++long vfsub_splice_read(struct file *in, loff_t *ppos, ++ struct pipe_inode_info *pipe, size_t len, ++ unsigned int flags) +{ + long err; + + lockdep_off(); -+ err = do_splice_to(in, ppos, pipe, len, flags); ++ err = vfs_splice_read(in, ppos, pipe, len, flags); + lockdep_on(); + file_accessed(in); + if (err >= 0) @@ -32696,7 +33071,7 @@ index 000000000000..7b2675ea0432 + int err; + struct inode *h_inode; + struct super_block *h_sb; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + if (!h_file) { + err = vfsub_truncate(h_path, length); @@ -32708,13 +33083,11 @@ index 000000000000..7b2675ea0432 + lockdep_off(); + sb_start_write(h_sb); + lockdep_on(); -+ err = locks_verify_truncate(h_inode, h_file, length); -+ if (!err) -+ err = security_path_truncate(h_path); ++ err = security_file_truncate(h_file); + if (!err) { -+ h_userns = mnt_user_ns(h_path->mnt); ++ h_idmap = mnt_idmap(h_path->mnt); + lockdep_off(); -+ err = do_truncate(h_userns, h_path->dentry, length, attr, ++ err = do_truncate(h_idmap, h_path->dentry, length, attr, + h_file); + lockdep_on(); + } @@ -32744,10 +33117,10 @@ index 000000000000..7b2675ea0432 +int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode) +{ + int err, do_sio, wkq_err; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + -+ userns = mnt_user_ns(path->mnt); -+ do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE); ++ idmap = mnt_idmap(path->mnt); ++ do_sio = au_test_h_perm_sio(idmap, dir, MAY_EXEC | MAY_WRITE); + if (!do_sio) { + lockdep_off(); + err = vfsub_mkdir(dir, path, mode); @@ -32782,10 +33155,10 @@ index 000000000000..7b2675ea0432 +int vfsub_sio_rmdir(struct inode *dir, struct path *path) +{ + int err, do_sio, wkq_err; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + -+ userns = mnt_user_ns(path->mnt); -+ do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE); ++ idmap = mnt_idmap(path->mnt); ++ do_sio = au_test_h_perm_sio(idmap, dir, MAY_EXEC | MAY_WRITE); + if (!do_sio) { + lockdep_off(); + err = vfsub_rmdir(dir, path); @@ -32817,16 +33190,16 @@ index 000000000000..7b2675ea0432 +{ + struct notify_change_args *a = args; + struct inode *h_inode; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + + h_inode = d_inode(a->path->dentry); + IMustLock(h_inode); + + *a->errp = -EPERM; + if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) { -+ userns = mnt_user_ns(a->path->mnt); ++ idmap = mnt_idmap(a->path->mnt); + lockdep_off(); -+ *a->errp = notify_change(userns, a->path->dentry, a->ia, ++ *a->errp = notify_change(idmap, a->path->dentry, a->ia, + a->delegated_inode); + lockdep_on(); + if (!*a->errp) @@ -32883,7 +33256,7 @@ index 000000000000..7b2675ea0432 + struct unlink_args *a = args; + struct dentry *d = a->path->dentry; + struct inode *h_inode; -+ struct user_namespace *userns; ++ struct mnt_idmap *idmap; + const int stop_sillyrename = (au_test_nfs(d->d_sb) + && au_dcount(d) == 1); + @@ -32903,9 +33276,9 @@ index 000000000000..7b2675ea0432 + ihold(h_inode); + } + -+ userns = mnt_user_ns(a->path->mnt); ++ idmap = mnt_idmap(a->path->mnt); + lockdep_off(); -+ *a->errp = vfs_unlink(userns, a->dir, d, a->delegated_inode); ++ *a->errp = vfs_unlink(idmap, a->dir, d, a->delegated_inode); + lockdep_on(); + if (!*a->errp) { + struct path tmp = { @@ -32952,15 +33325,15 @@ index 000000000000..7b2675ea0432 +} diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h new file mode 100644 -index 000000000000..62becb91cc09 +index 000000000000..928c463620c1 --- /dev/null +++ b/fs/aufs/vfsub.h -@@ -0,0 +1,358 @@ +@@ -0,0 +1,404 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -33042,7 +33415,7 @@ index 000000000000..62becb91cc09 +AuStubInt0(vfsub_test_mntns, struct vfsmount *mnt, struct super_block *h_sb); +#endif + -+int vfsub_sync_filesystem(struct super_block *h_sb, int wait); ++int vfsub_sync_filesystem(struct super_block *h_sb); + +/* ---------------------------------------------------------------------- */ + @@ -33061,20 +33434,20 @@ index 000000000000..62becb91cc09 +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path); + +struct dentry *vfsub_lookup_one_len_unlocked(const char *name, -+ struct dentry *parent, int len); -+struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, ++ struct path *ppath, int len); ++struct dentry *vfsub_lookup_one_len(const char *name, struct path *ppath, + int len); + +struct vfsub_lkup_one_args { + struct dentry **errp; + struct qstr *name; -+ struct dentry *parent; ++ struct path *ppath; +}; + +static inline struct dentry *vfsub_lkup_one(struct qstr *name, -+ struct dentry *parent) ++ struct path *ppath) +{ -+ return vfsub_lookup_one_len(name->name, parent, name->len); ++ return vfsub_lookup_one_len(name->name, ppath, name->len); +} + +void vfsub_call_lkup_one(void *args); @@ -33107,6 +33480,20 @@ index 000000000000..62becb91cc09 +} +#endif + ++static inline void vfsub_file_start_write(struct file *file) ++{ ++ lockdep_off(); ++ file_start_write(file); ++ lockdep_on(); ++} ++ ++static inline void vfsub_file_end_write(struct file *file) ++{ ++ lockdep_off(); ++ file_end_write(file); ++ lockdep_on(); ++} ++ +/* ---------------------------------------------------------------------- */ + +struct au_hinode; @@ -33187,29 +33574,29 @@ index 000000000000..62becb91cc09 +static inline int vfsub_update_time(struct inode *h_inode, + struct timespec64 *ts, int flags) +{ -+ return update_time(h_inode, ts, flags); ++ return inode_update_time(h_inode, ts, flags); + /* no vfsub_update_h_iattr() since we don't have struct path */ +} + +#ifdef CONFIG_FS_POSIX_ACL -+static inline int vfsub_acl_chmod(struct user_namespace *h_userns, -+ struct inode *h_inode, umode_t h_mode) ++static inline int vfsub_acl_chmod(struct mnt_idmap *h_idmap, ++ struct dentry *h_dentry, umode_t h_mode) +{ + int err; + -+ err = posix_acl_chmod(h_userns, h_inode, h_mode); ++ err = posix_acl_chmod(h_idmap, h_dentry, h_mode); + if (err == -EOPNOTSUPP) + err = 0; + return err; +} +#else -+AuStubInt0(vfsub_acl_chmod, struct user_namespace *h_userns, -+ struct inode *h_inode, umode_t h_mode); ++AuStubInt0(vfsub_acl_chmod, struct mnt_idmap *h_idmap, ++ struct dentry *h_dentry, umode_t h_mode); +#endif + -+long vfsub_splice_to(struct file *in, loff_t *ppos, -+ struct pipe_inode_info *pipe, size_t len, -+ unsigned int flags); ++long vfsub_splice_read(struct file *in, loff_t *ppos, ++ struct pipe_inode_info *pipe, size_t len, ++ unsigned int flags); +long vfsub_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags); + @@ -33287,44 +33674,76 @@ index 000000000000..62becb91cc09 + +/* ---------------------------------------------------------------------- */ + -+static inline int vfsub_setxattr(struct user_namespace *userns, ++static inline int vfsub_setxattr(struct mnt_idmap *idmap, + struct dentry *dentry, const char *name, + const void *value, size_t size, int flags) +{ + int err; + + lockdep_off(); -+ err = vfs_setxattr(userns, dentry, name, value, size, flags); ++ err = vfs_setxattr(idmap, dentry, name, value, size, flags); + lockdep_on(); + + return err; +} + -+static inline int vfsub_removexattr(struct user_namespace *userns, ++static inline int vfsub_removexattr(struct mnt_idmap *idmap, + struct dentry *dentry, const char *name) +{ + int err; + + lockdep_off(); -+ err = vfs_removexattr(userns, dentry, name); ++ err = vfs_removexattr(idmap, dentry, name); ++ lockdep_on(); ++ ++ return err; ++} ++ ++#ifdef CONFIG_FS_POSIX_ACL ++static inline int vfsub_set_acl(struct mnt_idmap *idmap, ++ struct dentry *dentry, const char *name, ++ struct posix_acl *acl) ++{ ++ int err; ++ ++ lockdep_off(); ++ err = vfs_set_acl(idmap, dentry, name, acl); ++ lockdep_on(); ++ ++ return err; ++} ++ ++static inline int vfsub_remove_acl(struct mnt_idmap *idmap, ++ struct dentry *dentry, const char *name) ++{ ++ int err; ++ ++ lockdep_off(); ++ err = vfs_remove_acl(idmap, dentry, name); + lockdep_on(); + + return err; +} ++#else ++AuStubInt0(vfsub_set_acl, struct mnt_idmap *idmap, struct dentry *dentry, ++ const char *name, struct posix_acl *acl); ++AuStubInt0(vfsub_remove_acl, struct mnt_idmap *idmap, ++ struct dentry *dentry, const char *name); ++#endif + +#endif /* __KERNEL__ */ +#endif /* __AUFS_VFSUB_H__ */ diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c new file mode 100644 -index 000000000000..a7cc1109f69d +index 000000000000..c726f96b7bd5 --- /dev/null +++ b/fs/aufs/wbr_policy.c @@ -0,0 +1,830 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -34152,15 +34571,15 @@ index 000000000000..a7cc1109f69d +}; diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c new file mode 100644 -index 000000000000..3150087c4f87 +index 000000000000..7bd0392eeb87 --- /dev/null +++ b/fs/aufs/whout.c -@@ -0,0 +1,1070 @@ +@@ -0,0 +1,1072 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -34219,19 +34638,19 @@ index 000000000000..3150087c4f87 +/* ---------------------------------------------------------------------- */ + +/* -+ * test if the @wh_name exists under @h_parent. ++ * test if the @wh_name exists under @h_ppath. + * @try_sio specifies the necessary of super-io. + */ -+int au_wh_test(struct user_namespace *h_userns, struct dentry *h_parent, ++int au_wh_test(struct mnt_idmap *h_idmap, struct path *h_ppath, + struct qstr *wh_name, int try_sio) +{ + int err; + struct dentry *wh_dentry; + + if (!try_sio) -+ wh_dentry = vfsub_lkup_one(wh_name, h_parent); ++ wh_dentry = vfsub_lkup_one(wh_name, h_ppath); + else -+ wh_dentry = au_sio_lkup_one(h_userns, wh_name, h_parent); ++ wh_dentry = au_sio_lkup_one(h_idmap, wh_name, h_ppath); + err = PTR_ERR(wh_dentry); + if (IS_ERR(wh_dentry)) { + if (err == -ENAMETOOLONG) @@ -34258,16 +34677,16 @@ index 000000000000..3150087c4f87 +} + +/* -+ * test if the @h_dentry sets opaque or not. ++ * test if the @h_path->dentry sets opaque or not. + */ -+int au_diropq_test(struct user_namespace *h_userns, struct dentry *h_dentry) ++int au_diropq_test(struct mnt_idmap *h_idmap, struct path *h_path) +{ + int err; + struct inode *h_dir; + -+ h_dir = d_inode(h_dentry); -+ err = au_wh_test(h_userns, h_dentry, &diropq_name, -+ au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC)); ++ h_dir = d_inode(h_path->dentry); ++ err = au_wh_test(h_idmap, h_path, &diropq_name, ++ au_test_h_perm_sio(h_idmap, h_dir, MAY_EXEC)); + return err; +} + @@ -34284,7 +34703,8 @@ index 000000000000..3150087c4f87 + /* strict atomic_t is unnecessary here */ + static unsigned short cnt; + struct qstr qs; -+ struct user_namespace *h_userns; ++ struct path h_ppath; ++ struct mnt_idmap *h_idmap; + + BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN); + @@ -34308,11 +34728,13 @@ index 000000000000..3150087c4f87 + *p++ = '.'; + AuDebugOn(name + qs.len + 1 - p <= AUFS_WH_TMP_LEN); + -+ h_userns = au_br_userns(br); ++ h_ppath.dentry = h_parent; ++ h_ppath.mnt = au_br_mnt(br); ++ h_idmap = au_br_idmap(br); + qs.name = name; + for (i = 0; i < 3; i++) { + sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++); -+ dentry = au_sio_lkup_one(h_userns, &qs, h_parent); ++ dentry = au_sio_lkup_one(h_idmap, &qs, &h_ppath); + if (IS_ERR(dentry) || d_is_negative(dentry)) + goto out_name; + dput(dentry); @@ -34406,21 +34828,20 @@ index 000000000000..3150087c4f87 + return err; +} + -+static int unlink_wh_name(struct dentry *h_parent, struct qstr *wh, -+ struct au_branch *br) ++static int unlink_wh_name(struct path *h_ppath, struct qstr *wh) +{ + int err; -+ struct path h_path = { -+ .mnt = au_br_mnt(br) -+ }; ++ struct path h_path; + + err = 0; -+ h_path.dentry = vfsub_lkup_one(wh, h_parent); ++ h_path.dentry = vfsub_lkup_one(wh, h_ppath); + if (IS_ERR(h_path.dentry)) + err = PTR_ERR(h_path.dentry); + else { -+ if (d_is_reg(h_path.dentry)) -+ err = do_unlink_wh(d_inode(h_parent), &h_path); ++ if (d_is_reg(h_path.dentry)) { ++ h_path.mnt = h_ppath->mnt; ++ err = do_unlink_wh(d_inode(h_ppath->dentry), &h_path); ++ } + dput(h_path.dentry); + } + @@ -34860,15 +35281,17 @@ index 000000000000..3150087c4f87 +static struct dentry *do_diropq(struct dentry *dentry, aufs_bindex_t bindex, + unsigned int flags) +{ -+ struct dentry *opq_dentry, *h_dentry; ++ struct dentry *opq_dentry; + struct super_block *sb; + struct au_branch *br; ++ struct path h_path; + int err; + + sb = dentry->d_sb; + br = au_sbr(sb, bindex); -+ h_dentry = au_h_dptr(dentry, bindex); -+ opq_dentry = vfsub_lkup_one(&diropq_name, h_dentry); ++ h_path.dentry = au_h_dptr(dentry, bindex); ++ h_path.mnt = au_br_mnt(br); ++ opq_dentry = vfsub_lkup_one(&diropq_name, &h_path); + if (IS_ERR(opq_dentry)) + goto out; + @@ -34879,11 +35302,8 @@ index 000000000000..3150087c4f87 + goto out; /* success */ + } + } else { -+ struct path tmp = { -+ .dentry = opq_dentry, -+ .mnt = au_br_mnt(br) -+ }; -+ err = do_unlink_wh(au_h_iptr(d_inode(dentry), bindex), &tmp); ++ h_path.dentry = opq_dentry; ++ err = do_unlink_wh(au_h_iptr(d_inode(dentry), bindex), &h_path); + if (!err) + au_set_dbdiropq(dentry, -1); + } @@ -34911,11 +35331,11 @@ index 000000000000..3150087c4f87 + unsigned int flags) +{ + struct dentry *diropq, *h_dentry; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + -+ h_userns = au_sbr_userns(dentry->d_sb, bindex); ++ h_idmap = au_sbr_idmap(dentry->d_sb, bindex); + h_dentry = au_h_dptr(dentry, bindex); -+ if (!au_test_h_perm_sio(h_userns, d_inode(h_dentry), ++ if (!au_test_h_perm_sio(h_idmap, d_inode(h_dentry), + MAY_EXEC | MAY_WRITE)) + diropq = do_diropq(dentry, bindex, flags); + else { @@ -34949,11 +35369,14 @@ index 000000000000..3150087c4f87 + int err; + struct qstr wh_name; + struct dentry *wh_dentry; ++ struct path h_path; + + err = au_wh_name_alloc(&wh_name, base_name); + wh_dentry = ERR_PTR(err); + if (!err) { -+ wh_dentry = vfsub_lkup_one(&wh_name, h_parent); ++ h_path.dentry = h_parent; ++ h_path.mnt = au_br_mnt(br); ++ wh_dentry = vfsub_lkup_one(&wh_name, &h_path); + au_kfree_try_rcu(wh_name.name); + } + return wh_dentry; @@ -34988,8 +35411,8 @@ index 000000000000..3150087c4f87 +/* ---------------------------------------------------------------------- */ + +/* Delete all whiteouts in this directory on branch bindex. */ -+static int del_wh_children(struct dentry *h_dentry, struct au_nhash *whlist, -+ aufs_bindex_t bindex, struct au_branch *br) ++static int del_wh_children(struct path *h_path, struct au_nhash *whlist, ++ aufs_bindex_t bindex) +{ + int err; + unsigned long ul, n; @@ -35019,7 +35442,7 @@ index 000000000000..3150087c4f87 + if (str->len + AUFS_WH_PFX_LEN <= PATH_MAX) { + memcpy(p, str->name, str->len); + wh_name.len = AUFS_WH_PFX_LEN + str->len; -+ err = unlink_wh_name(h_dentry, &wh_name, br); ++ err = unlink_wh_name(h_path, &wh_name); + if (!err) + continue; + break; @@ -35038,16 +35461,15 @@ index 000000000000..3150087c4f87 + +struct del_wh_children_args { + int *errp; -+ struct dentry *h_dentry; ++ struct path *h_path; + struct au_nhash *whlist; + aufs_bindex_t bindex; -+ struct au_branch *br; +}; + +static void call_del_wh_children(void *args) +{ + struct del_wh_children_args *a = args; -+ *a->errp = del_wh_children(a->h_dentry, a->whlist, a->bindex, a->br); ++ *a->errp = del_wh_children(a->h_path, a->whlist, a->bindex); +} + +/* ---------------------------------------------------------------------- */ @@ -35099,16 +35521,18 @@ index 000000000000..3150087c4f87 +{ + int err; + unsigned int h_nlink; -+ struct path h_tmp; ++ struct path wh_path; + struct inode *wh_inode, *h_dir; + struct au_branch *br; -+ struct user_namespace *h_userns; ++ struct mnt_idmap *h_idmap; + + h_dir = d_inode(wh_dentry->d_parent); /* dir inode is locked */ + IMustLock(h_dir); + + br = au_sbr(dir->i_sb, bindex); -+ h_userns = au_br_userns(br); ++ wh_path.dentry = wh_dentry; ++ wh_path.mnt = au_br_mnt(br); ++ h_idmap = au_br_idmap(br); + wh_inode = d_inode(wh_dentry); + inode_lock_nested(wh_inode, AuLsc_I_CHILD); + @@ -35116,16 +35540,15 @@ index 000000000000..3150087c4f87 + * someone else might change some whiteouts while we were sleeping. + * it means this whlist may have an obsoleted entry. + */ -+ if (!au_test_h_perm_sio(h_userns, wh_inode, MAY_EXEC | MAY_WRITE)) -+ err = del_wh_children(wh_dentry, whlist, bindex, br); ++ if (!au_test_h_perm_sio(h_idmap, wh_inode, MAY_EXEC | MAY_WRITE)) ++ err = del_wh_children(&wh_path, whlist, bindex); + else { + int wkq_err; + struct del_wh_children_args args = { + .errp = &err, -+ .h_dentry = wh_dentry, ++ .h_path = &wh_path, + .whlist = whlist, -+ .bindex = bindex, -+ .br = br ++ .bindex = bindex + }; + + wkq_err = au_wkq_wait(call_del_wh_children, &args); @@ -35135,10 +35558,8 @@ index 000000000000..3150087c4f87 + inode_unlock(wh_inode); + + if (!err) { -+ h_tmp.dentry = wh_dentry; -+ h_tmp.mnt = au_br_mnt(br); + h_nlink = h_dir->i_nlink; -+ err = vfsub_rmdir(h_dir, &h_tmp); ++ err = vfsub_rmdir(h_dir, &wh_path); + /* some fs doesn't change the parent nlink in some cases */ + h_nlink -= h_dir->i_nlink; + } @@ -35228,15 +35649,15 @@ index 000000000000..3150087c4f87 +} diff --git a/fs/aufs/whout.h b/fs/aufs/whout.h new file mode 100644 -index 000000000000..df85cf5e76cc +index 000000000000..a7ae8702e7a5 --- /dev/null +++ b/fs/aufs/whout.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -35263,9 +35684,9 @@ index 000000000000..df85cf5e76cc + +/* whout.c */ +int au_wh_name_alloc(struct qstr *wh, const struct qstr *name); -+int au_wh_test(struct user_namespace *h_userns, struct dentry *h_parent, ++int au_wh_test(struct mnt_idmap *h_idmap, struct path *h_ppath, + struct qstr *wh_name, int try_sio); -+int au_diropq_test(struct user_namespace *h_userns, struct dentry *h_dentry); ++int au_diropq_test(struct mnt_idmap *h_idmap, struct path *h_path); +struct au_branch; +struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br, + struct qstr *prefix); @@ -35321,15 +35742,15 @@ index 000000000000..df85cf5e76cc +#endif /* __AUFS_WHOUT_H__ */ diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c new file mode 100644 -index 000000000000..4d66bb2dc657 +index 000000000000..cb71ca3bf51b --- /dev/null +++ b/fs/aufs/wkq.c @@ -0,0 +1,372 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -35699,15 +36120,15 @@ index 000000000000..4d66bb2dc657 +} diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h new file mode 100644 -index 000000000000..5be76b69d8ff +index 000000000000..f8bb8e12395e --- /dev/null +++ b/fs/aufs/wkq.h @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -35794,15 +36215,15 @@ index 000000000000..5be76b69d8ff +#endif /* __AUFS_WKQ_H__ */ diff --git a/fs/aufs/xattr.c b/fs/aufs/xattr.c new file mode 100644 -index 000000000000..429580aa95e5 +index 000000000000..9e08665728ae --- /dev/null +++ b/fs/aufs/xattr.c -@@ -0,0 +1,368 @@ +@@ -0,0 +1,360 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2014-2020 Junjiro R. Okajima ++ * Copyright (C) 2014-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -35821,7 +36242,6 @@ index 000000000000..429580aa95e5 + */ + +#include <linux/fs.h> -+#include <linux/posix_acl_xattr.h> +#include <linux/xattr.h> +#include "aufs.h" + @@ -35868,39 +36288,57 @@ index 000000000000..429580aa95e5 + char *name, char **buf, unsigned int ignore_flags, + unsigned int verbose) +{ -+ int err; ++ int err, is_acl; + ssize_t ssz; + struct inode *h_idst; + struct dentry *h_dst_dentry, *h_src_dentry; -+ struct user_namespace *h_dst_userns, *h_src_userns; ++ struct mnt_idmap *h_dst_idmap, *h_src_idmap; ++ struct posix_acl *acl; + -+ h_src_userns = mnt_user_ns(h_src->mnt); ++ is_acl = !!is_posix_acl_xattr(name); ++ h_src_idmap = mnt_idmap(h_src->mnt); + h_src_dentry = h_src->dentry; -+ ssz = vfs_getxattr_alloc(h_src_userns, h_src_dentry, name, buf, 0, -+ GFP_NOFS); -+ err = ssz; -+ if (unlikely(err <= 0)) { -+ if (err == -ENODATA -+ || (err == -EOPNOTSUPP -+ && ((ignore_flags & au_xattr_out_of_list) -+ || (au_test_nfs_noacl(d_inode(h_src_dentry)) -+ && (!strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) -+ || !strcmp(name, -+ XATTR_NAME_POSIX_ACL_DEFAULT)))) -+ )) -+ err = 0; -+ if (err && (verbose || au_debug_test())) -+ pr_err("%s, err %d\n", name, err); -+ goto out; ++ if (is_acl) { ++ acl = vfs_get_acl(h_src_idmap, h_src_dentry, name); ++ AuDebugOn(!acl); ++ if (unlikely(IS_ERR(acl))) { ++ err = PTR_ERR(acl); ++ if (err == -ENODATA) ++ err = 0; ++ else if (err == -EOPNOTSUPP ++ && au_test_nfs_noacl(d_inode(h_src_dentry))) ++ err = 0; ++ else if (verbose || au_debug_test()) ++ pr_err("%s, err %d\n", name, err); ++ goto out; ++ } ++ } else { ++ ssz = vfs_getxattr_alloc(h_src_idmap, h_src_dentry, name, buf, ++ 0, GFP_NOFS); ++ if (unlikely(ssz <= 0)) { ++ err = ssz; ++ if (err == -ENODATA) ++ err = 0; ++ else if (err == -EOPNOTSUPP ++ && (ignore_flags & au_xattr_out_of_list)) ++ err = 0; ++ else if (err && (verbose || au_debug_test())) ++ pr_err("%s, err %d\n", name, err); ++ goto out; ++ } + } + + /* unlock it temporary */ -+ h_dst_userns = mnt_user_ns(h_dst->mnt); ++ h_dst_idmap = mnt_idmap(h_dst->mnt); + h_dst_dentry = h_dst->dentry; + h_idst = d_inode(h_dst_dentry); + inode_unlock(h_idst); -+ err = vfsub_setxattr(h_dst_userns, h_dst_dentry, name, *buf, ssz, -+ /*flags*/0); ++ if (is_acl) { ++ err = vfsub_set_acl(h_dst_idmap, h_dst_dentry, name, acl); ++ posix_acl_release(acl); ++ } else ++ err = vfsub_setxattr(h_dst_idmap, h_dst_dentry, name, *buf, ++ ssz, /*flags*/0); + inode_lock_nested(h_idst, AuLsc_I_CHILD2); + if (unlikely(err)) { + if (verbose || au_debug_test()) @@ -35915,7 +36353,7 @@ index 000000000000..429580aa95e5 +int au_cpup_xattr(struct path *h_dst, struct path *h_src, int ignore_flags, + unsigned int verbose) +{ -+ int err, unlocked, acl_access, acl_default; ++ int err, unlocked; + ssize_t ssz; + struct dentry *h_dst_dentry, *h_src_dentry; + struct inode *h_isrc, *h_idst; @@ -35963,33 +36401,12 @@ index 000000000000..429580aa95e5 + err = 0; + e = p + ssz; + value = NULL; -+ acl_access = 0; -+ acl_default = 0; ++ ignore_flags |= au_xattr_out_of_list; + while (!err && p < e) { -+ acl_access |= !strncmp(p, XATTR_NAME_POSIX_ACL_ACCESS, -+ sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1); -+ acl_default |= !strncmp(p, XATTR_NAME_POSIX_ACL_DEFAULT, -+ sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) -+ - 1); + err = au_do_cpup_xattr(h_dst, h_src, p, &value, ignore_flags, + verbose); + p += strlen(p) + 1; + } -+ AuTraceErr(err); -+ ignore_flags |= au_xattr_out_of_list; -+ if (!err && !acl_access) { -+ err = au_do_cpup_xattr(h_dst, h_src, -+ XATTR_NAME_POSIX_ACL_ACCESS, &value, -+ ignore_flags, verbose); -+ AuTraceErr(err); -+ } -+ if (!err && !acl_default) { -+ err = au_do_cpup_xattr(h_dst, h_src, -+ XATTR_NAME_POSIX_ACL_DEFAULT, &value, -+ ignore_flags, verbose); -+ AuTraceErr(err); -+ } -+ + au_kfree_try_rcu(value); + +out_free: @@ -36066,7 +36483,7 @@ index 000000000000..429580aa95e5 + break; + case AU_XATTR_GET: + AuDebugOn(d_is_negative(h_path.dentry)); -+ err = vfs_getxattr(mnt_user_ns(h_path.mnt), h_path.dentry, ++ err = vfs_getxattr(mnt_idmap(h_path.mnt), h_path.dentry, + arg->u.get.name, arg->u.get.value, + arg->u.get.size); + break; @@ -36138,7 +36555,7 @@ index 000000000000..429580aa95e5 +} + +static int au_xattr_set(const struct xattr_handler *handler, -+ struct user_namespace *userns, ++ struct mnt_idmap *idmap, + struct dentry *dentry, struct inode *inode, + const char *name, const void *value, size_t size, + int flags) @@ -36154,10 +36571,6 @@ index 000000000000..429580aa95e5 +}; + +static const struct xattr_handler *au_xattr_handlers[] = { -+#ifdef CONFIG_FS_POSIX_ACL -+ &posix_acl_access_xattr_handler, -+ &posix_acl_default_xattr_handler, -+#endif + &au_xattr_handler, /* must be last */ + NULL +}; @@ -36168,15 +36581,15 @@ index 000000000000..429580aa95e5 +} diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c new file mode 100644 -index 000000000000..a9ce74d1ad0d +index 000000000000..e1db09b3541d --- /dev/null +++ b/fs/aufs/xino.c -@@ -0,0 +1,1925 @@ +@@ -0,0 +1,1926 @@ +// SPDX-License-Identifier: GPL-2.0 +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -36383,7 +36796,7 @@ index 000000000000..a9ce74d1ad0d + } + + err = -EINVAL; -+ if (unlikely(sb == d->d_sb)) { ++ if (unlikely(sb && sb == d->d_sb)) { + if (!silent) + pr_err("%s must be outside\n", fpath); + goto out; @@ -36409,22 +36822,23 @@ index 000000000000..a9ce74d1ad0d + struct file *copy_src) +{ + struct file *file; -+ struct dentry *dentry, *parent; ++ struct dentry *dentry; + struct inode *dir, *delegated; + struct qstr *name; -+ struct path path; ++ struct path ppath, path; + int err, do_unlock; + struct au_xino_lock_dir ldir; + + do_unlock = 1; + au_xino_lock_dir(sb, base, &ldir); + dentry = base->dentry; -+ parent = dentry->d_parent; /* dir inode is locked */ -+ dir = d_inode(parent); ++ ppath.dentry = dentry->d_parent; /* dir inode is locked */ ++ ppath.mnt = base->mnt; ++ dir = d_inode(ppath.dentry); + IMustLock(dir); + + name = &dentry->d_name; -+ path.dentry = vfsub_lookup_one_len(name->name, parent, name->len); ++ path.dentry = vfsub_lookup_one_len(name->name, &ppath, name->len); + if (IS_ERR(path.dentry)) { + file = (void *)path.dentry; + pr_err("%pd lookup err %ld\n", dentry, PTR_ERR(path.dentry)); @@ -36432,7 +36846,7 @@ index 000000000000..a9ce74d1ad0d + } + + /* no need to mnt_want_write() since we call dentry_open() later */ -+ err = vfs_create(mnt_user_ns(base->mnt), dir, path.dentry, 0666, NULL); ++ err = vfs_create(mnt_idmap(base->mnt), dir, path.dentry, 0666, NULL); + if (unlikely(err)) { + file = ERR_PTR(err); + pr_err("%pd create err %d\n", dentry, err); @@ -38099,15 +38513,15 @@ index 000000000000..a9ce74d1ad0d +} diff --git a/include/uapi/linux/aufs_type.h b/include/uapi/linux/aufs_type.h new file mode 100644 -index 000000000000..05afb8096ce5 +index 000000000000..83d3a5132b5a --- /dev/null +++ b/include/uapi/linux/aufs_type.h @@ -0,0 +1,452 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* -+ * Copyright (C) 2005-2020 Junjiro R. Okajima ++ * Copyright (C) 2005-2022 Junjiro R. Okajima + * -+ * This program, aufs is free software; you can redistribute it and/or modify ++ * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. @@ -38145,7 +38559,7 @@ index 000000000000..05afb8096ce5 +#include <limits.h> +#endif /* __KERNEL__ */ + -+#define AUFS_VERSION "5.x-rcN-20210308" ++#define AUFS_VERSION "6.5-20230918" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') @@ -38556,5 +38970,5 @@ index 000000000000..05afb8096ce5 + +#endif /* __AUFS_TYPE_H__ */ -- -2.19.1 +2.34.1 diff --git a/features/aufs/aufs6-correct-do_splice_from-prototype.patch b/features/aufs/aufs6-correct-do_splice_from-prototype.patch new file mode 100644 index 00000000..dd83db1e --- /dev/null +++ b/features/aufs/aufs6-correct-do_splice_from-prototype.patch @@ -0,0 +1,26 @@ +From c76e5c498001148b22148fadc86611fd1874caa9 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 25 Jan 2024 11:17:19 -0500 +Subject: [PATCH] aufs6: correct do_splice_from prototype + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + include/linux/splice.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/splice.h b/include/linux/splice.h +index 8024911403e9..727e61a98c49 100644 +--- a/include/linux/splice.h ++++ b/include/linux/splice.h +@@ -109,7 +109,7 @@ extern void splice_shrink_spd(struct splice_pipe_desc *); + extern const struct pipe_buf_operations page_cache_pipe_buf_ops; + extern const struct pipe_buf_operations default_pipe_buf_ops; + +-extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out, ++extern ssize_t do_splice_from(struct pipe_inode_info *pipe, struct file *out, + loff_t *ppos, size_t len, unsigned int flags); + extern long do_splice_to(struct file *in, loff_t *ppos, + struct pipe_inode_info *pipe, size_t len, +-- +2.39.2 + diff --git a/features/aufs/aufs6-fix-magic.mk-include-path.patch b/features/aufs/aufs6-fix-magic.mk-include-path.patch new file mode 100644 index 00000000..9bb1cf43 --- /dev/null +++ b/features/aufs/aufs6-fix-magic.mk-include-path.patch @@ -0,0 +1,37 @@ +From 001144b1c29e0214cad19720e6e1c35a576b124c Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 6 Jul 2023 11:34:59 -0400 +Subject: [PATCH 7/8] aufs6: fix magic.mk include path + +commit 482d7131560c51da3ca [aufs stdalone: make it standalone] in the +aufs upstream changes the way that the .mk file is included. + +This doesn't work properly with all kernel build processes, so we +restore the use of srctree/src to locate the file. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/aufs/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile +index 4af8ecde3e3f..72db3cae2b92 100644 +--- a/fs/aufs/Makefile ++++ b/fs/aufs/Makefile +@@ -1,10 +1,10 @@ + # SPDX-License-Identifier: GPL-2.0 + +-include ${src}/magic.mk ++include ${srctree}/${src}/magic.mk + ifeq (${CONFIG_AUFS_FS},m) +-include ${src}/conf.mk ++include ${srctree}/${src}/conf.mk + endif +--include ${src}/priv_def.mk ++-include ${srctree}/${src}/priv_def.mk + + # cf. include/linux/kernel.h + # enable pr_debug +-- +2.34.1 + diff --git a/features/aufs/aufs5-aufs-kbuild.patch b/features/aufs/aufs6-kbuild.patch index 5226e3cf..57532dd5 100644 --- a/features/aufs/aufs5-aufs-kbuild.patch +++ b/features/aufs/aufs6-kbuild.patch @@ -1,7 +1,7 @@ -From 4e0173f1c63ba3e1c2503af8b563c4c1940aa1b1 Mon Sep 17 00:00:00 2001 +From 9962a8dfbc2b485c58d9ca511ae7bdfd808f78cc Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Fri, 19 Mar 2021 12:33:42 -0400 -Subject: [PATCH 4/5] aufs5: aufs-kbuild +Date: Thu, 21 Sep 2023 17:47:14 -0400 +Subject: [PATCH 1/8] aufs6: kbuild Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- @@ -10,10 +10,10 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> 2 files changed, 2 insertions(+) diff --git a/fs/Kconfig b/fs/Kconfig -index a3bb10cff321..bc30d910ab00 100644 +index 3800e18ad2ea..a0b5168e1ef6 100644 --- a/fs/Kconfig +++ b/fs/Kconfig -@@ -289,6 +289,7 @@ source "fs/sysv/Kconfig" +@@ -332,6 +332,7 @@ source "fs/sysv/Kconfig" source "fs/ufs/Kconfig" source "fs/erofs/Kconfig" source "fs/vboxsf/Kconfig" @@ -22,14 +22,14 @@ index a3bb10cff321..bc30d910ab00 100644 endif # MISC_FILESYSTEMS diff --git a/fs/Makefile b/fs/Makefile -index 14b056ece5fe..b9df02256367 100644 +index 23cc0a3852aa..d58a3f162e31 100644 --- a/fs/Makefile +++ b/fs/Makefile -@@ -136,3 +136,4 @@ obj-$(CONFIG_EROFS_FS) += erofs/ +@@ -130,3 +130,4 @@ obj-$(CONFIG_EROFS_FS) += erofs/ obj-$(CONFIG_VBOXSF_FS) += vboxsf/ obj-$(CONFIG_ZONEFS_FS) += zonefs/ obj-$(CONFIG_YAFFS_FS) += yaffs2/ +obj-$(CONFIG_AUFS_FS) += aufs/ -- -2.19.1 +2.34.1 diff --git a/features/aufs/aufs5-aufs-mmap.patch b/features/aufs/aufs6-mmap.patch index 069d5753..d1e5168f 100644 --- a/features/aufs/aufs5-aufs-mmap.patch +++ b/features/aufs/aufs6-mmap.patch @@ -1,43 +1,43 @@ -From e6100247a1435e9bdb1421e5f80f0b21c98fe4c8 Mon Sep 17 00:00:00 2001 +From 550fbd6a226ed0b04b497dd4dcf5e14c7cd113f1 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Fri, 19 Mar 2021 12:32:26 -0400 -Subject: [PATCH 2/5] aufs5: aufs-mmap +Date: Thu, 21 Sep 2023 17:49:39 -0400 +Subject: [PATCH] aufs6: mmap Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- fs/proc/base.c | 2 +- fs/proc/nommu.c | 5 ++- - fs/proc/task_mmu.c | 7 +++- + fs/proc/task_mmu.c | 6 ++- fs/proc/task_nommu.c | 5 ++- - include/linux/mm.h | 22 ++++++++++ - include/linux/mm_types.h | 2 + + include/linux/mm.h | 37 +++++++++++++++++ + include/linux/mm_types.h | 6 +++ kernel/fork.c | 2 +- - mm/Makefile | 2 +- + mm/Makefile | 1 + mm/filemap.c | 2 +- - mm/mmap.c | 33 +++++++++++---- + mm/mmap.c | 41 +++++++++++++++---- mm/nommu.c | 10 ++--- mm/prfile.c | 86 ++++++++++++++++++++++++++++++++++++++++ - 12 files changed, 157 insertions(+), 21 deletions(-) + 12 files changed, 184 insertions(+), 19 deletions(-) create mode 100644 mm/prfile.c diff --git a/fs/proc/base.c b/fs/proc/base.c -index 3851bfcdba56..d632ddd5f5ee 100644 +index 98a031ac2648..9cd1d25f9fc0 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c -@@ -2183,7 +2183,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) +@@ -2215,7 +2215,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path) rc = -ENOENT; vma = find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { -- *path = vma->vm_file->f_path; -+ *path = vma_pr_or_file(vma)->f_path; +- *path = *file_user_path(vma->vm_file); ++ *path = *file_user_path(vma_pr_or_file(vma)); path_get(path); rc = 0; } diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c -index 13452b32e2bd..38acccfef9d4 100644 +index c6e7ebc63756..d7ccfd909764 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c -@@ -40,7 +40,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) +@@ -39,7 +39,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) file = region->vm_file; if (file) { @@ -50,35 +50,35 @@ index 13452b32e2bd..38acccfef9d4 100644 ino = inode->i_ino; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index e862cab69583..5c45041943a6 100644 +index 3f78ebbb795f..32f9aaf5345e 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c -@@ -280,7 +280,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma) +@@ -273,8 +273,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma) const char *name = NULL; if (file) { -- struct inode *inode = file_inode(vma->vm_file); +- const struct inode *inode = file_user_inode(vma->vm_file); + struct inode *inode; -+ + + file = vma_pr_or_file(vma); -+ inode = file_inode(file); ++ inode = file_user_inode(vma->vm_file); dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; -@@ -1861,7 +1864,7 @@ static int show_numa_map(struct seq_file *m, void *v) +@@ -2701,7 +2703,7 @@ static int show_numa_map(struct seq_file *m, void *v) struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; - struct file *file = vma->vm_file; + struct file *file = vma_pr_or_file(vma); struct mm_struct *mm = vma->vm_mm; - struct mempolicy *pol; char buffer[64]; + struct mempolicy *pol; diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c -index a6d21fc0033c..02c2de31196e 100644 +index bce674533000..b12b5a75c799 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c -@@ -155,7 +155,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma) +@@ -137,7 +137,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma) file = vma->vm_file; if (file) { @@ -91,13 +91,14 @@ index a6d21fc0033c..02c2de31196e 100644 ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; diff --git a/include/linux/mm.h b/include/linux/mm.h -index 64a71bf20536..7811b753c291 100644 +index f5a97dec5169..dc908f541ce9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1747,6 +1747,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, - unmap_mapping_range(mapping, holebegin, holelen, 0); - } +@@ -2432,6 +2432,43 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, + static inline struct vm_area_struct *vma_lookup(struct mm_struct *mm, + unsigned long addr); ++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */ +extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int); +extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[], + int); @@ -120,100 +121,105 @@ index 64a71bf20536..7811b753c291 100644 +#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__) +#endif /* !CONFIG_MMU */ + ++#else ++ ++#define vma_file_update_time(vma) file_update_time((vma)->vm_file) ++#define vma_pr_or_file(vma) (vma)->vm_file ++#define vma_get_file(vma) get_file((vma)->vm_file) ++#define vma_fput(vma) fput((vma)->vm_file) ++ ++#ifndef CONFIG_MMU ++#define vmr_pr_or_file(region) (region)->vm_file ++#define vmr_fput(region) fput((region)->vm_file) ++#endif /* !CONFIG_MMU */ ++ ++#endif /* CONFIG_AUFS_FS */ ++ extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, unsigned int gup_flags); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 6613b26a8894..e94df45b5483 100644 +index 8b611e13153e..f5f10bfa5b63 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h -@@ -279,6 +279,7 @@ struct vm_region { +@@ -527,6 +527,9 @@ struct vm_region { unsigned long vm_top; /* region allocated to here */ unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ struct file *vm_file; /* the backing file or NULL */ ++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */ + struct file *vm_prfile; /* the virtual backing file or NULL */ ++#endif int vm_usage; /* region usage count (access under nommu_region_sem) */ bool vm_icache_flushed : 1; /* true if the icache has been flushed for -@@ -358,6 +359,7 @@ struct vm_area_struct { +@@ -691,6 +694,9 @@ struct vm_area_struct { unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE units */ struct file * vm_file; /* File we map to (can be NULL). */ ++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */ + struct file *vm_prfile; /* shadow of vm_file */ ++#endif void * vm_private_data; /* was vm_pte (shared mem) */ - #ifdef CONFIG_SWAP + #ifdef CONFIG_ANON_VMA_NAME diff --git a/kernel/fork.c b/kernel/fork.c -index 0acc8ed1076b..882c91a52aa5 100644 +index 47ff3b35352e..41a80f248514 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -555,7 +555,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, - struct inode *inode = file_inode(file); +@@ -716,7 +716,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, + if (file) { struct address_space *mapping = file->f_mapping; - get_file(file); + vma_get_file(tmp); - if (tmp->vm_flags & VM_DENYWRITE) - put_write_access(inode); i_mmap_lock_write(mapping); + if (vma_is_shared_maywrite(tmp)) + mapping_allow_writable(mapping); diff --git a/mm/Makefile b/mm/Makefile -index 72227b24a616..5d03943b08e0 100644 +index e4b5b75aaec9..d69ba9efb769 100644 --- a/mm/Makefile +++ b/mm/Makefile -@@ -52,7 +52,7 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ - mm_init.o percpu.o slab_common.o \ - compaction.o vmacache.o \ - interval_tree.o list_lru.o workingset.o \ -- debug.o gup.o mmap_lock.o $(mmu-y) -+ prfile.o debug.o gup.o mmap_lock.o $(mmu-y) - - # Give 'page_alloc' its own module-parameter namespace - page-alloc-y := page_alloc.o +@@ -134,3 +134,4 @@ obj-$(CONFIG_IO_MAPPING) += io-mapping.o + obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o + obj-$(CONFIG_GENERIC_IOREMAP) += ioremap.o + obj-$(CONFIG_SHRINKER_DEBUG) += shrinker_debug.o ++obj-y += prfile.o diff --git a/mm/filemap.c b/mm/filemap.c -index 43700480d897..be29fc5b9d04 100644 +index 750e779c23db..b84a752ff676 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -3155,7 +3155,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) +@@ -3587,7 +3587,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) vm_fault_t ret = VM_FAULT_LOCKED; sb_start_pagefault(mapping->host->i_sb); - file_update_time(vmf->vma->vm_file); + vma_file_update_time(vmf->vma); - lock_page(page); - if (page->mapping != mapping) { - unlock_page(page); + folio_lock(folio); + if (folio->mapping != mapping) { + folio_unlock(folio); diff --git a/mm/mmap.c b/mm/mmap.c -index 3f287599a7a3..eb36f1b18f04 100644 +index b78e83d351d2..e2ae3999a51c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -179,7 +179,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -140,7 +140,7 @@ static void remove_vma(struct vm_area_struct *vma, bool unreachable) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) - fput(vma->vm_file); + vma_fput(vma); mpol_put(vma_policy(vma)); - vm_area_free(vma); - return next; -@@ -949,7 +949,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start, - if (remove_next) { - if (file) { - uprobe_munmap(next, next->vm_start, next->vm_end); -- fput(file); -+ vma_fput(vma); + if (unreachable) + __vm_area_free(vma); +@@ -554,7 +554,7 @@ static inline void vma_complete(struct vma_prepare *vp, + if (vp->file) { + uprobe_munmap(vp->remove, vp->remove->vm_start, + vp->remove->vm_end); +- fput(vp->file); ++ vma_fput(vp->vma); } - if (next->anon_vma) - anon_vma_merge(vma, next); -@@ -1895,7 +1895,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, - return addr; - - unmap_and_free_vma: -- fput(vma->vm_file); -+ vma_fput(vma); - vma->vm_file = NULL; - - /* Undo any partial mapping done by a device driver. */ -@@ -2755,7 +2755,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, + if (vp->remove->anon_vma) + anon_vma_merge(vp->vma, vp->remove); +@@ -2355,7 +2355,7 @@ static int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma, goto out_free_mpol; if (new->vm_file) @@ -222,54 +228,70 @@ index 3f287599a7a3..eb36f1b18f04 100644 if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); -@@ -2774,7 +2774,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma, - if (new->vm_ops && new->vm_ops->close) - new->vm_ops->close(new); - if (new->vm_file) -- fput(new->vm_file); -+ vma_fput(new); - unlink_anon_vmas(new); - out_free_mpol: - mpol_put(vma_policy(new)); -@@ -2967,7 +2967,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, - struct vm_area_struct *vma; +@@ -2853,7 +2853,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, + * and cause general protection fault + * ultimately. + */ +- fput(vma->vm_file); ++ vma_fput(vma); + vm_area_free(vma); + vma = merge; + /* Update vm_flags to pick up the change. */ +@@ -2948,7 +2948,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr, + + if (file || vma->vm_file) { + unmap_and_free_vma: +- fput(vma->vm_file); ++ vma_fput(vma); + vma->vm_file = NULL; + + vma_iter_set(&vmi, vma->vm_end); +@@ -3010,6 +3010,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long populate = 0; unsigned long ret = -EINVAL; -- struct file *file; -+ struct file *file, *prfile; + struct file *file; ++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */ ++ struct file *prfile; ++#endif - pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n", + pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst.\n", current->comm, current->pid); -@@ -3042,10 +3042,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, - } - } +@@ -3068,10 +3071,34 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, + if (vma->vm_flags & VM_LOCKED) + flags |= MAP_LOCKED; -- file = get_file(vma->vm_file); ++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */ + vma_get_file(vma); + file = vma->vm_file; + prfile = vma->vm_prfile; - ret = do_mmap(vma->vm_file, start, size, - prot, flags, pgoff, &populate, NULL); ++ ret = do_mmap(vma->vm_file, start, size, ++ prot, flags, pgoff, &populate, NULL); + if (!IS_ERR_VALUE(ret) && file && prfile) { + struct vm_area_struct *new_vma; + + new_vma = find_vma(mm, ret); + if (!new_vma->vm_prfile) + new_vma->vm_prfile = prfile; -+ if (new_vma != vma) ++ if (prfile) + get_file(prfile); + } + /* + * two fput()s instead of vma_fput(vma), + * coz vma may not be available anymore. + */ - fput(file); ++ fput(file); + if (prfile) + fput(prfile); ++#else + file = get_file(vma->vm_file); + ret = do_mmap(vma->vm_file, start, size, + prot, flags, 0, pgoff, &populate, NULL); + fput(file); ++#endif /* CONFIG_AUFS_FS */ out: mmap_write_unlock(mm); if (populate) -@@ -3332,7 +3349,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -3418,7 +3445,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) @@ -277,12 +299,21 @@ index 3f287599a7a3..eb36f1b18f04 100644 + vma_get_file(new_vma); if (new_vma->vm_ops && new_vma->vm_ops->open) new_vma->vm_ops->open(new_vma); - vma_link(mm, new_vma, prev, rb_link, rb_parent); + if (vma_link(mm, new_vma)) +@@ -3432,7 +3459,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, + new_vma->vm_ops->close(new_vma); + + if (new_vma->vm_file) +- fput(new_vma->vm_file); ++ vma_fput(new_vma); + + unlink_anon_vmas(new_vma); + out_free_mempol: diff --git a/mm/nommu.c b/mm/nommu.c -index 5c9ab799c0e6..dd78905704c1 100644 +index b6dc558d3144..d96655486468 100644 --- a/mm/nommu.c +++ b/mm/nommu.c -@@ -533,7 +533,7 @@ static void __put_nommu_region(struct vm_region *region) +@@ -523,7 +523,7 @@ static void __put_nommu_region(struct vm_region *region) up_write(&nommu_region_sem); if (region->vm_file) @@ -291,7 +322,7 @@ index 5c9ab799c0e6..dd78905704c1 100644 /* IO memory and memory shared directly out of the pagecache * from ramfs/tmpfs mustn't be released here */ -@@ -665,7 +665,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) +@@ -603,7 +603,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -300,7 +331,7 @@ index 5c9ab799c0e6..dd78905704c1 100644 put_nommu_region(vma->vm_region); vm_area_free(vma); } -@@ -1188,7 +1188,7 @@ unsigned long do_mmap(struct file *file, +@@ -1135,7 +1135,7 @@ unsigned long do_mmap(struct file *file, goto error_just_free; } } @@ -309,9 +340,9 @@ index 5c9ab799c0e6..dd78905704c1 100644 kmem_cache_free(vm_region_jar, region); region = pregion; result = start; -@@ -1265,10 +1265,10 @@ unsigned long do_mmap(struct file *file, - up_write(&nommu_region_sem); +@@ -1221,10 +1221,10 @@ unsigned long do_mmap(struct file *file, error: + vma_iter_free(&vmi); if (region->vm_file) - fput(region->vm_file); + vmr_fput(region); @@ -324,7 +355,7 @@ index 5c9ab799c0e6..dd78905704c1 100644 diff --git a/mm/prfile.c b/mm/prfile.c new file mode 100644 -index 000000000000..00d51187c325 +index 000000000000..8f820a235364 --- /dev/null +++ b/mm/prfile.c @@ -0,0 +1,86 @@ @@ -336,7 +367,7 @@ index 000000000000..00d51187c325 + * + * See Documentation/filesystems/aufs/design/06mmap.txt + * -+ * Copyright (c) 2014-2020 Junjro R. Okajima ++ * Copyright (c) 2014-2022 Junjro R. Okajima + * Copyright (c) 2014 Ian Campbell + */ + @@ -415,5 +446,5 @@ index 000000000000..00d51187c325 +} +#endif /* !CONFIG_MMU */ -- -2.19.1 +2.39.2 diff --git a/features/aufs/aufs5-aufs-standalone.patch b/features/aufs/aufs6-standalone.patch index d7decf0f..d7ceb50a 100644 --- a/features/aufs/aufs5-aufs-standalone.patch +++ b/features/aufs/aufs6-standalone.patch @@ -1,32 +1,30 @@ -From 2e4cec6bb91e9dbd6f6b3fd3d26af6b0c2e63a1a Mon Sep 17 00:00:00 2001 +From da930b7640bef946a6d703e28ec8c8d785245ab1 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> -Date: Fri, 19 Mar 2021 12:32:45 -0400 -Subject: [PATCH 3/5] aufs5: aufs-standalone +Date: Thu, 21 Sep 2023 17:50:11 -0400 +Subject: [PATCH 4/8] aufs6: standalone Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- fs/dcache.c | 2 ++ fs/exec.c | 1 + fs/fcntl.c | 1 + - fs/file_table.c | 2 ++ - fs/inode.c | 1 + + fs/file_table.c | 1 + fs/namespace.c | 3 +++ fs/notify/group.c | 1 + fs/open.c | 1 + fs/read_write.c | 2 ++ - fs/splice.c | 2 ++ - fs/sync.c | 1 + + fs/splice.c | 1 + fs/xattr.c | 1 + kernel/locking/lockdep.c | 1 + kernel/task_work.c | 1 + security/security.c | 8 ++++++++ - 15 files changed, 28 insertions(+) + 13 files changed, 24 insertions(+) diff --git a/fs/dcache.c b/fs/dcache.c -index 3caa7ab4b84f..00e97c9ae7c4 100644 +index 6c930ceed526..576ad162cdec 100644 --- a/fs/dcache.c +++ b/fs/dcache.c -@@ -1423,6 +1423,7 @@ void d_walk(struct dentry *parent, void *data, +@@ -1450,6 +1450,7 @@ void d_walk(struct dentry *parent, void *data, seq = 1; goto again; } @@ -34,7 +32,7 @@ index 3caa7ab4b84f..00e97c9ae7c4 100644 struct check_mount { struct vfsmount *mnt; -@@ -2968,6 +2969,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2) +@@ -3051,6 +3052,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2) write_sequnlock(&rename_lock); } @@ -43,10 +41,10 @@ index 3caa7ab4b84f..00e97c9ae7c4 100644 /** * d_ancestor - search for an ancestor diff --git a/fs/exec.c b/fs/exec.c -index 18594f11c31f..ac38c0424d2a 100644 +index 6518e33ea813..b67efac6a1ad 100644 --- a/fs/exec.c +++ b/fs/exec.c -@@ -114,6 +114,7 @@ bool path_noexec(const struct path *path) +@@ -112,6 +112,7 @@ bool path_noexec(const struct path *path) return (path->mnt->mnt_flags & MNT_NOEXEC) || (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC); } @@ -55,10 +53,10 @@ index 18594f11c31f..ac38c0424d2a 100644 #ifdef CONFIG_USELIB /* diff --git a/fs/fcntl.c b/fs/fcntl.c -index d8a12eb63961..053299618631 100644 +index 84a52a8eec92..fdd334fc02fb 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c -@@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, unsigned long arg) +@@ -87,6 +87,7 @@ int setfl(int fd, struct file *filp, unsigned int arg) out: return error; } @@ -67,10 +65,10 @@ index d8a12eb63961..053299618631 100644 static void f_modown(struct file *filp, struct pid *pid, enum pid_type type, int force) diff --git a/fs/file_table.c b/fs/file_table.c -index 45437f8e1003..786af52904fc 100644 +index ee21b3da9d08..c45ac36795dd 100644 --- a/fs/file_table.c +++ b/fs/file_table.c -@@ -161,6 +161,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred) +@@ -225,6 +225,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred) } return ERR_PTR(-ENFILE); } @@ -78,31 +76,11 @@ index 45437f8e1003..786af52904fc 100644 /* * Variant of alloc_empty_file() that doesn't check and modify nr_files. -@@ -375,6 +376,7 @@ void __fput_sync(struct file *file) - } - - EXPORT_SYMBOL(fput); -+EXPORT_SYMBOL_GPL(__fput_sync); - - void __init files_init(void) - { -diff --git a/fs/inode.c b/fs/inode.c -index ba1df0895b69..0672530acf7d 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -1778,6 +1778,7 @@ int update_time(struct inode *inode, struct timespec64 *time, int flags) - return inode->i_op->update_time(inode, time, flags); - return generic_update_time(inode, time, flags); - } -+EXPORT_SYMBOL_GPL(update_time); - - /** - * atime_needs_update - update the access time diff --git a/fs/namespace.c b/fs/namespace.c -index 540679d7e043..74957d5edaa8 100644 +index 6c57487f126b..16be9ac1c734 100644 --- a/fs/namespace.c +++ b/fs/namespace.c -@@ -438,6 +438,7 @@ void __mnt_drop_write(struct vfsmount *mnt) +@@ -466,6 +466,7 @@ void __mnt_drop_write(struct vfsmount *mnt) mnt_dec_writers(real_mount(mnt)); preempt_enable(); } @@ -110,7 +88,7 @@ index 540679d7e043..74957d5edaa8 100644 /** * mnt_drop_write - give up write access to a mount -@@ -812,6 +813,7 @@ int is_current_mnt_ns(struct vfsmount *mnt) +@@ -877,6 +878,7 @@ int is_current_mnt_ns(struct vfsmount *mnt) { return check_mnt(real_mount(mnt)); } @@ -118,7 +96,7 @@ index 540679d7e043..74957d5edaa8 100644 /* * vfsmount lock must be held for write -@@ -1985,6 +1987,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, +@@ -2152,6 +2154,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, } return 0; } @@ -127,7 +105,7 @@ index 540679d7e043..74957d5edaa8 100644 static void lock_mnt_tree(struct mount *mnt) { diff --git a/fs/notify/group.c b/fs/notify/group.c -index ffd723ffe46d..ec6172836b6f 100644 +index 1de6631a3925..3008eb37a18d 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c @@ -100,6 +100,7 @@ void fsnotify_get_group(struct fsnotify_group *group) @@ -139,10 +117,10 @@ index ffd723ffe46d..ec6172836b6f 100644 /* * Drop a reference to a group. Free it if it's through. diff --git a/fs/open.c b/fs/open.c -index e53af13b5835..f37da065e654 100644 +index 98f6601fbac6..8624e4ffa15b 100644 --- a/fs/open.c +++ b/fs/open.c -@@ -65,6 +65,7 @@ int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry, +@@ -67,6 +67,7 @@ int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry, inode_unlock(dentry->d_inode); return ret; } @@ -151,10 +129,10 @@ index e53af13b5835..f37da065e654 100644 long vfs_truncate(const struct path *path, loff_t length) { diff --git a/fs/read_write.c b/fs/read_write.c -index 9db7adf160d2..8dc93a57a933 100644 +index 4771701c896b..c79270aba792 100644 --- a/fs/read_write.c +++ b/fs/read_write.c -@@ -503,6 +503,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) +@@ -477,6 +477,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) inc_syscr(current); return ret; } @@ -162,7 +140,7 @@ index 9db7adf160d2..8dc93a57a933 100644 static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) { -@@ -613,6 +614,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ +@@ -592,6 +593,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ file_end_write(file); return ret; } @@ -171,42 +149,22 @@ index 9db7adf160d2..8dc93a57a933 100644 /* file_ppos returns &file->f_pos or NULL if file is stream */ static inline loff_t *file_ppos(struct file *file) diff --git a/fs/splice.c b/fs/splice.c -index 3e6ba363b777..7c1be373eb7c 100644 +index 7216ef993b5f..7ce1f1bc4268 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -766,6 +766,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +@@ -932,6 +932,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, return warn_unsupported(out, "write"); return out->f_op->splice_write(pipe, out, ppos, len, flags); } +EXPORT_SYMBOL_GPL(do_splice_from); /* - * Attempt to initiate a splice from a file to a pipe. -@@ -795,6 +796,7 @@ long do_splice_to(struct file *in, loff_t *ppos, - return warn_unsupported(in, "read"); - return in->f_op->splice_read(in, ppos, pipe, len, flags); - } -+EXPORT_SYMBOL_GPL(do_splice_to); - - /** - * splice_direct_to_actor - splices data directly between two non-pipes -diff --git a/fs/sync.c b/fs/sync.c -index b7b5a0a0df6f..fa5c7fba7f1b 100644 ---- a/fs/sync.c -+++ b/fs/sync.c -@@ -39,6 +39,7 @@ int __sync_filesystem(struct super_block *sb, int wait) - sb->s_op->sync_fs(sb, wait); - return __sync_blockdev(sb->s_bdev, wait); - } -+EXPORT_SYMBOL_GPL(__sync_filesystem); - - /* - * Write out and wait upon all dirty data associated with this + * Indicate to the caller that there was a premature EOF when reading from the diff --git a/fs/xattr.c b/fs/xattr.c -index b3444e06cded..7b0f851b63d7 100644 +index efd4736bc94b..ce1a2c39ab23 100644 --- a/fs/xattr.c +++ b/fs/xattr.c -@@ -383,6 +383,7 @@ vfs_getxattr_alloc(struct user_namespace *mnt_userns, struct dentry *dentry, +@@ -406,6 +406,7 @@ vfs_getxattr_alloc(struct mnt_idmap *idmap, struct dentry *dentry, *xattr_value = value; return error; } @@ -215,10 +173,10 @@ index b3444e06cded..7b0f851b63d7 100644 ssize_t __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name, diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index 0f557138af3e..ac177ade7d9b 100644 +index db4297f60bd3..9aca18312afb 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c -@@ -209,6 +209,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock) +@@ -239,6 +239,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock) */ return lock_classes + class_idx; } @@ -227,82 +185,82 @@ index 0f557138af3e..ac177ade7d9b 100644 #ifdef CONFIG_LOCK_STAT diff --git a/kernel/task_work.c b/kernel/task_work.c -index 9cde961875c0..ac8c79dc8181 100644 +index 065e1ef8fc8d..c623c6f0c645 100644 --- a/kernel/task_work.c +++ b/kernel/task_work.c -@@ -143,3 +143,4 @@ void task_work_run(void) +@@ -182,3 +182,4 @@ void task_work_run(void) } while (work); } } +EXPORT_SYMBOL_GPL(task_work_run); diff --git a/security/security.c b/security/security.c -index 5ac96b16f8fa..46d334d6ac1f 100644 +index 23b129d482a7..fca4c5707a1c 100644 --- a/security/security.c +++ b/security/security.c -@@ -1102,6 +1102,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry) +@@ -1750,6 +1750,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry) return 0; return call_int_hook(path_rmdir, 0, dir, dentry); } +EXPORT_SYMBOL_GPL(security_path_rmdir); - int security_path_unlink(const struct path *dir, struct dentry *dentry) - { -@@ -1118,6 +1119,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry, + /** + * security_path_unlink() - Check if removing a hard link is allowed +@@ -1785,6 +1786,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry, return 0; return call_int_hook(path_symlink, 0, dir, dentry, old_name); } +EXPORT_SYMBOL_GPL(security_path_symlink); - int security_path_link(struct dentry *old_dentry, const struct path *new_dir, - struct dentry *new_dentry) -@@ -1126,6 +1128,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir, + /** + * security_path_link - Check if creating a hard link is allowed +@@ -1803,6 +1805,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir, return 0; return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry); } +EXPORT_SYMBOL_GPL(security_path_link); - int security_path_rename(const struct path *old_dir, struct dentry *old_dentry, - const struct path *new_dir, struct dentry *new_dentry, -@@ -1153,6 +1156,7 @@ int security_path_truncate(const struct path *path) - return 0; - return call_int_hook(path_truncate, 0, path); - } -+EXPORT_SYMBOL_GPL(security_path_truncate); - - int security_path_chmod(const struct path *path, umode_t mode) - { -@@ -1160,6 +1164,7 @@ int security_path_chmod(const struct path *path, umode_t mode) + /** + * security_path_rename() - Check if renaming a file is allowed +@@ -1864,6 +1867,7 @@ int security_path_chmod(const struct path *path, umode_t mode) return 0; return call_int_hook(path_chmod, 0, path, mode); } +EXPORT_SYMBOL_GPL(security_path_chmod); - int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) - { -@@ -1167,6 +1172,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) + /** + * security_path_chown() - Check if changing the file's owner/group is allowed +@@ -1881,6 +1885,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) return 0; return call_int_hook(path_chown, 0, path, uid, gid); } +EXPORT_SYMBOL_GPL(security_path_chown); - int security_path_chroot(const struct path *path) - { -@@ -1267,6 +1273,7 @@ int security_inode_permission(struct inode *inode, int mask) + /** + * security_path_chroot() - Check if changing the root directory is allowed +@@ -2110,6 +2115,7 @@ int security_inode_permission(struct inode *inode, int mask) return 0; return call_int_hook(inode_permission, 0, inode, mask); } +EXPORT_SYMBOL_GPL(security_inode_permission); - int security_inode_setattr(struct dentry *dentry, struct iattr *attr) - { -@@ -1464,6 +1471,7 @@ int security_file_permission(struct file *file, int mask) + /** + * security_inode_setattr() - Check if setting file attributes is allowed +@@ -2588,6 +2594,7 @@ int security_file_permission(struct file *file, int mask) return fsnotify_perm(file, mask); } +EXPORT_SYMBOL_GPL(security_file_permission); - int security_file_alloc(struct file *file) + /** + * security_file_alloc() - Allocate and init a file's LSM blob +@@ -2854,6 +2861,7 @@ int security_file_truncate(struct file *file) { + return call_int_hook(file_truncate, 0, file); + } ++EXPORT_SYMBOL_GPL(security_file_truncate); + + /** + * security_task_alloc() - Allocate a task's LSM blob -- -2.19.1 +2.34.1 diff --git a/features/bluetooth/bluetooth-vhci.cfg b/features/bluetooth/bluetooth-vhci.cfg new file mode 100644 index 00000000..3f7c7850 --- /dev/null +++ b/features/bluetooth/bluetooth-vhci.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_BT_HCIVHCI=y diff --git a/features/bluetooth/bluetooth-vhci.scc b/features/bluetooth/bluetooth-vhci.scc new file mode 100644 index 00000000..e99f33d5 --- /dev/null +++ b/features/bluetooth/bluetooth-vhci.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable Bluetooth Virtual HCI device driver" +define KFEATURE_COMPATIBILITY all + +include bluetooth.scc + +kconf non-hardware bluetooth-vhci.cfg diff --git a/features/bpf/bpf.cfg b/features/bpf/bpf.cfg index b90e87a5..50c27ceb 100644 --- a/features/bpf/bpf.cfg +++ b/features/bpf/bpf.cfg @@ -3,4 +3,5 @@ CONFIG_BPF=y CONFIG_BPF_SYSCALL=y CONFIG_BPF_JIT=y CONFIG_BPF_EVENTS=y +CONFIG_BPF_UNPRIV_DEFAULT_OFF=y CONFIG_CGROUP_BPF=y diff --git a/features/can/can.cfg b/features/can/can.cfg index a15e6061..d50e8109 100644 --- a/features/can/can.cfg +++ b/features/can/can.cfg @@ -19,8 +19,6 @@ CONFIG_CAN_GS_USB=m CONFIG_CAN_KVASER_USB=m CONFIG_CAN_PEAK_USB=m CONFIG_CAN_8DEV_USB=m -# x86 PCH -#CONFIG_PCH_CAN=m # drivers for ISA/PCI cards CONFIG_CAN_C_CAN_PCI=m # Philips/NXP SJA1000 based PCI(e) diff --git a/features/cgroups/cgroups.cfg b/features/cgroups/cgroups.cfg index d87090f1..d2d0c3ea 100644 --- a/features/cgroups/cgroups.cfg +++ b/features/cgroups/cgroups.cfg @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT # General controller group CONFIG_CGROUPS=y -CONFIG_CGROUP_DEBUG=y +CONFIG_CGROUP_DEBUG=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_DEVICE=y @@ -13,12 +13,11 @@ CONFIG_CGROUP_NET_PRIO=y CONFIG_CGROUP_PERF=y CONFIG_MEMCG=y -CONFIG_MEMCG_SWAP=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_BLK_CGROUP=y -# CONFIG_BFQ_CGROUP_DEBUG is not set +CONFIG_BFQ_CGROUP_DEBUG=n # Namespace controller diff --git a/features/clear_warn_once/clear_warn_once.scc b/features/clear_warn_once/clear_warn_once.scc index 4b194d17..d5e0e017 100644 --- a/features/clear_warn_once/clear_warn_once.scc +++ b/features/clear_warn_once/clear_warn_once.scc @@ -1,3 +1,4 @@ patch clear_warn_once-expand-debugfs-to-include-read-suppo.patch patch clear_warn_once-bind-a-timer-to-written-reset-value.patch patch clear_warn_once-add-a-clear_warn_once-boot-parameter.patch +patch sched-isolation-really-align-nohz_full-with-rcu_nocb.patch diff --git a/features/clear_warn_once/sched-isolation-really-align-nohz_full-with-rcu_nocb.patch b/features/clear_warn_once/sched-isolation-really-align-nohz_full-with-rcu_nocb.patch new file mode 100644 index 00000000..35145584 --- /dev/null +++ b/features/clear_warn_once/sched-isolation-really-align-nohz_full-with-rcu_nocb.patch @@ -0,0 +1,88 @@ +Date: Mon, 21 Feb 2022 13:20:08 -0500 +Subject: [PATCH 1/2] sched/isolation: really align nohz_full with rcu_nocbs +From: Paul Gortmaker <paul.gortmaker@windriver.com> +To: linux-kernel@vger.kernel.org, Frederic Weisbecker <fweisbec@gmail.com>, + Peter Zijlstra <peterz@infradead.org> +CC: Paul Gortmaker <paul.gortmaker@windriver.com>, Thomas Gleixner + <tglx@linutronix.de>, "Paul E . McKenney" <paulmck@kernel.org>, Ingo Molnar + <mingo@kernel.org> +X-Mailer: git-send-email 2.17.1 +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=utf-8 + +At the moment it is currently possible to sneak a core into nohz_full +that lies between nr_possible and NR_CPUS - but you won't "see" it +because cpumask_pr_args() implicitly hides anything above nr_cpu_ids. + +This becomes a problem when the nohz_full CPU set doesn't contain at +least one other valid nohz CPU - in which case we end up with the +tick_nohz_full_running set and no tick core specified, which trips an +endless sequence of WARN() and renders the machine unusable. + +I inadvertently opened the door for this when fixing an overly +restrictive nohz_full conditional in the below Fixes: commit - and then +courtesy of my optimistic ACPI reporting nr_possible of 64 (the default +Kconfig for NR_CPUS) and the not-so helpful implict filtering done by +cpumask_pr_args, I unfortunately did not spot it during my testing. + +So here, I don't rely on what was printed anymore, but code exactly what +our restrictions should be in order to be aligned with rcu_nocbs - which +was the original goal. Since the checks lie in "__init" code it is largely +free for us to do this anyway. + +Building with NOHZ_FULL and NR_CPUS=128 on an otherwise defconfig, and +booting with "rcu_nocbs=8-127 nohz_full=96-127" on the same 16 core T5500 +Dell machine now results in the following (only relevant lines shown): + + smpboot: Allowing 64 CPUs, 48 hotplug CPUs + setup_percpu: NR_CPUS:128 nr_cpumask_bits:128 nr_cpu_ids:64 nr_node_ids:2 + housekeeping: kernel parameter 'nohz_full=' or 'isolcpus=' contains nonexistent CPUs. + housekeeping: kernel parameter 'nohz_full=' or 'isolcpus=' has no valid CPUs. + rcu: RCU restricting CPUs from NR_CPUS=128 to nr_cpu_ids=64. + rcu: Note: kernel parameter 'rcu_nocbs=', 'nohz_full', or 'isolcpus=' contains nonexistent CPUs. + rcu: Offload RCU callbacks from CPUs: 8-63. + +One can see both new housekeeping checks are triggered in the above. +The same invalid boot arg combination would have previously resulted in +an infinitely scrolling mix of WARN from all cores per tick on this box. + +We may need to revisit these sanity checks when nohz_full is accepted as +a stand alone keyword "enable" w/o a cpuset (see rcu/nohz d2cf0854d728). + +Fixes: 915a2bc3c6b7 ("sched/isolation: Reconcile rcu_nocbs= and nohz_full=") +Cc: Frederic Weisbecker <fweisbec@gmail.com> +Cc: Peter Zijlstra <peterz@infradead.org> +Cc: Thomas Gleixner <tglx@linutronix.de> +Cc: Paul E. McKenney <paulmck@kernel.org> +Cc: Ingo Molnar <mingo@kernel.org> +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> +--- + kernel/sched/isolation.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c +index b4d10815c45a..f7d2406c1f1d 100644 +--- a/kernel/sched/isolation.c ++++ b/kernel/sched/isolation.c +@@ -126,6 +126,17 @@ static int __init housekeeping_setup(char *str, unsigned long flags) + goto free_non_housekeeping_mask; + } + ++ if (!cpumask_subset(non_housekeeping_mask, cpu_possible_mask)) { ++ pr_info("housekeeping: kernel parameter 'nohz_full=' or 'isolcpus=' contains nonexistent CPUs.\n"); ++ cpumask_and(non_housekeeping_mask, cpu_possible_mask, ++ non_housekeeping_mask); ++ } ++ ++ if (cpumask_empty(non_housekeeping_mask)) { ++ pr_info("housekeeping: kernel parameter 'nohz_full=' or 'isolcpus=' has no valid CPUs.\n"); ++ goto free_non_housekeeping_mask; ++ } ++ + alloc_bootmem_cpumask_var(&housekeeping_staging); + cpumask_andnot(housekeeping_staging, + cpu_possible_mask, non_housekeeping_mask); +-- +2.17.1 + diff --git a/features/debug/debug-btf.cfg b/features/debug/debug-btf.cfg new file mode 100644 index 00000000..59df424f --- /dev/null +++ b/features/debug/debug-btf.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_DEBUG_INFO_BTF=y +CONFIG_MODULE_ALLOW_BTF_MISMATCH=y diff --git a/features/debug/debug-btf.scc b/features/debug/debug-btf.scc new file mode 100644 index 00000000..57dfb930 --- /dev/null +++ b/features/debug/debug-btf.scc @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable BTF debug" +define KFEATURE_COMPATIBILITY all + +include debug-kernel.scc +kconf non-hardware debug-btf.cfg diff --git a/features/debug/debug-kernel.cfg b/features/debug/debug-kernel.cfg index 53fcbf0a..048ed3d9 100644 --- a/features/debug/debug-kernel.cfg +++ b/features/debug/debug-kernel.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_INFO=y -CONFIG_DEBUG_PREEMPT=y diff --git a/features/debug/debug-runtime.cfg b/features/debug/debug-runtime.cfg new file mode 100644 index 00000000..344bad2f --- /dev/null +++ b/features/debug/debug-runtime.cfg @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_PREEMPT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_PROVE_LOCKING=y +CONFIG_DEBUG_TIMEKEEPING=y
\ No newline at end of file diff --git a/features/debug/debug-runtime.scc b/features/debug/debug-runtime.scc new file mode 100644 index 00000000..2db9a271 --- /dev/null +++ b/features/debug/debug-runtime.scc @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT + +define KFEATURE_DESCRIPTION "Enable kernel reuntime debugging" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware debug-runtime.cfg diff --git a/features/debug/printk.cfg b/features/debug/printk.cfg index 0df20f91..5beb425f 100644 --- a/features/debug/printk.cfg +++ b/features/debug/printk.cfg @@ -5,8 +5,5 @@ CONFIG_PRINTK=y CONFIG_PRINTK_TIME=y -CONFIG_EARLY_PRINTK=y - -CONFIG_EARLY_PRINTK_DBGP=y CONFIG_EFI_EARLYCON=y CONFIG_TTY_PRINTK=y diff --git a/features/docker/docker.scc b/features/docker/docker.scc index 19418f9e..2bc55019 100644 --- a/features/docker/docker.scc +++ b/features/docker/docker.scc @@ -3,4 +3,4 @@ define KFEATURE_DESCRIPTION "Enable Features needed by docker in addition to LXC features" define KFEATURE_COMPATIBILITY board -kconf non-hardware docker.cfg +include cfg/docker.scc diff --git a/features/drm-bochs/drm-bochs.cfg b/features/drm-bochs/drm-bochs.cfg index 1c37b67d..2d061433 100644 --- a/features/drm-bochs/drm-bochs.cfg +++ b/features/drm-bochs/drm-bochs.cfg @@ -8,11 +8,9 @@ CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_COMPAT=y CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_ALGOBIT=y CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 CONFIG_DRM_TTM=y @@ -22,7 +20,7 @@ CONFIG_DRM_PANEL=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y -CONFIG_FB_CMDLINE=y +CONFIG_VIDEO_CMDLINE=y CONFIG_FB_NOTIFY=y CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y diff --git a/features/drm-emgd/drm-emgd.cfg b/features/drm-emgd/drm-emgd.cfg index 13678d58..298549ad 100644 --- a/features/drm-emgd/drm-emgd.cfg +++ b/features/drm-emgd/drm-emgd.cfg @@ -5,11 +5,10 @@ CONFIG_DRM_EGD=m CONFIG_DRM_KMS_HELPER=m CONFIG_I2C=y -CONFIG_VIDEO_V4L2=m +CONFIG_VIDEO_DEV=m CONFIG_VIDEO_IVTV=y CONFIG_MEDIA_SUPPORT=m CONFIG_VIDEO_DEV=m -CONFIG_I2C_ALGOBIT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CFB_FILLRECT=y diff --git a/features/drm-gma500/drm-gma500.cfg b/features/drm-gma500/drm-gma500.cfg index e4019752..dc26f5d1 100644 --- a/features/drm-gma500/drm-gma500.cfg +++ b/features/drm-gma500/drm-gma500.cfg @@ -2,5 +2,3 @@ CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=m CONFIG_DRM_GMA500=m -CONFIG_DRM_GMA600=y -CONFIG_DRM_GMA3600=y diff --git a/features/drm-psb/drm-psb.cfg b/features/drm-psb/drm-psb.cfg index 86e508bd..2af3ab9c 100644 --- a/features/drm-psb/drm-psb.cfg +++ b/features/drm-psb/drm-psb.cfg @@ -3,11 +3,10 @@ CONFIG_DRM=y CONFIG_DRM_PSB=m CONFIG_I2C=y -CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_DEV=y CONFIG_VIDEO_IVTV=y CONFIG_MEDIA_SUPPORT=y CONFIG_VIDEO_DEV=y -CONFIG_I2C_ALGOBIT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CFB_FILLRECT=y diff --git a/features/edac/edac.cfg b/features/edac/edac.cfg index 9b3d3fc5..4f75d2f8 100644 --- a/features/edac/edac.cfg +++ b/features/edac/edac.cfg @@ -15,3 +15,11 @@ CONFIG_RAS=y CONFIG_EDAC=y CONFIG_EDAC_DEBUG=y +CONFIG_EDAC_SBRIDGE=m +CONFIG_ACPI_APEI=y +CONFIG_ACPI_APEI_EINJ=m +CONFIG_ACPI_APEI_GHES=y +CONFIG_EDAC_PND2=m +CONFIG_EDAC_SKX=m +CONFIG_EDAC_I10NM=m +CONFIG_EDAC_IGEN6=m diff --git a/features/edf/edf.cfg b/features/edf/edf.cfg index 97e4b7cd..531548fb 100644 --- a/features/edf/edf.cfg +++ b/features/edf/edf.cfg @@ -2,4 +2,4 @@ CONFIG_HIGH_RES_TIMERS=y CONFIG_PREEMPT=y CONFIG_HZ_1000=y -# CONFIG_NO_HZ is not set +CONFIG_NO_HZ=n diff --git a/features/eg20t/eg20t.cfg b/features/eg20t/eg20t.cfg index 8bfff936..9c411acf 100644 --- a/features/eg20t/eg20t.cfg +++ b/features/eg20t/eg20t.cfg @@ -30,4 +30,3 @@ CONFIG_GPIO_PCH=y CONFIG_CAN=y CONFIG_CAN_DEV=y -CONFIG_PCH_CAN=y diff --git a/features/f2fs/f2fs.cfg b/features/f2fs/f2fs.cfg index 4e59ac15..6b1e6e80 100644 --- a/features/f2fs/f2fs.cfg +++ b/features/f2fs/f2fs.cfg @@ -5,5 +5,4 @@ CONFIG_F2FS_FS_XATTR=y CONFIG_F2FS_FS_POSIX_ACL=y CONFIG_F2FS_FS_SECURITY=y CONFIG_F2FS_CHECK_FS=y -CONFIG_F2FS_IO_TRACE=y CONFIG_F2FS_FAULT_INJECTION=y diff --git a/features/firewire/firewire.cfg b/features/firewire/firewire.cfg index 5006e4f3..9dbe643c 100644 --- a/features/firewire/firewire.cfg +++ b/features/firewire/firewire.cfg @@ -3,14 +3,14 @@ CONFIG_FIREWIRE=m CONFIG_FIREWIRE_OHCI=m CONFIG_FIREWIRE_SBP2=m CONFIG_FIREWIRE_NET=m -# CONFIG_DVB_FIREDTV is not set +CONFIG_DVB_FIREDTV=n CONFIG_SND_FIREWIRE=y CONFIG_SND_FIREWIRE_LIB=m CONFIG_SND_DICE=m -# CONFIG_SND_OXFW is not set -# CONFIG_SND_ISIGHT is not set -# CONFIG_SND_FIREWORKS is not set -# CONFIG_SND_BEBOB is not set -# CONFIG_SND_FIREWIRE_DIGI00X is not set +CONFIG_SND_OXFW=n +CONFIG_SND_ISIGHT=n +CONFIG_SND_FIREWORKS=n +CONFIG_SND_BEBOB=n +CONFIG_SND_FIREWIRE_DIGI00X=n CONFIG_SND_FIREWIRE_TASCAM=m -# CONFIG_FIREWIRE_SERIAL is not set +CONFIG_FIREWIRE_SERIAL=n diff --git a/features/ftrace/ftrace-function-tracer-disable.cfg b/features/ftrace/ftrace-function-tracer-disable.cfg index e60ac8a9..e27cba4b 100644 --- a/features/ftrace/ftrace-function-tracer-disable.cfg +++ b/features/ftrace/ftrace-function-tracer-disable.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT -# CONFIG_FUNCTION_TRACER is not set -# CONFIG_FUNCTION_GRAPH_TRACER is not set -# CONFIG_DYNAMIC_FTRACE is not set +CONFIG_FUNCTION_TRACER=n +CONFIG_FUNCTION_GRAPH_TRACER=n +CONFIG_DYNAMIC_FTRACE=n diff --git a/features/full_nohz/full_nohz.cfg b/features/full_nohz/full_nohz.cfg index fbccdad7..16db2004 100644 --- a/features/full_nohz/full_nohz.cfg +++ b/features/full_nohz/full_nohz.cfg @@ -1,3 +1,3 @@ # SPDX-License-Identifier: MIT CONFIG_NO_HZ_FULL=y -CONFIG_RCU_FAST_NO_HZ=y +CONFIG_RCU_EXPERT=y diff --git a/features/gpio/sim.cfg b/features/gpio/sim.cfg new file mode 100644 index 00000000..ce76a1fe --- /dev/null +++ b/features/gpio/sim.cfg @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT + +CONFIG_GPIOLIB=y +CONFIG_GPIO_SIM=m diff --git a/features/gpio/sim.scc b/features/gpio/sim.scc new file mode 100644 index 00000000..d98952dd --- /dev/null +++ b/features/gpio/sim.scc @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT + +define KFEATURE_DESCRIPTION "Enable support for the GPIO simulator module" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware sim.cfg diff --git a/features/gre/gre.cfg b/features/gre/gre.cfg index cd436df7..c713f965 100644 --- a/features/gre/gre.cfg +++ b/features/gre/gre.cfg @@ -4,4 +4,4 @@ CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IPV6_GRE=m CONFIG_OPENVSWITCH_GRE=y -# CONFIG_PPTP is not set +CONFIG_PPTP=n diff --git a/features/grsec/grsec.cfg b/features/grsec/grsec.cfg index f984225d..b90fb86a 100644 --- a/features/grsec/grsec.cfg +++ b/features/grsec/grsec.cfg @@ -3,16 +3,16 @@ # Grsecurity # CONFIG_GRKERNSEC=y -# CONFIG_GRKERNSEC_LOW is not set -# CONFIG_GRKERNSEC_MEDIUM is not set -# CONFIG_GRKERNSEC_HIGH is not set +CONFIG_GRKERNSEC_LOW=n +CONFIG_GRKERNSEC_MEDIUM=n +CONFIG_GRKERNSEC_HIGH=n CONFIG_GRKERNSEC_CUSTOM=y CONFIG_GRKERNSEC_KMEM=y CONFIG_GRKERNSEC_PROC_MEMMAP=y CONFIG_GRKERNSEC_BRUTE=y CONFIG_GRKERNSEC_MODSTOP=y -# CONFIG_GRKERNSEC_HIDESYM is not set +CONFIG_GRKERNSEC_HIDESYM=n # # Role Based Access Control Options @@ -99,16 +99,16 @@ CONFIG_PAX_RANDKSTACK=y CONFIG_PAX_MEMORY_UDEREF=y CONFIG_GRKERNSEC_IO=y -# CONFIG_GRKERNSEC_MODHARDEN is not set -# CONFIG_GRKERNSEC_NO_RBAC is not set -# CONFIG_GRKERNSEC_ROFS is not set -# CONFIG_GRKERNSEC_AUDIT_PTRACE is not set -# CONFIG_GRKERNSEC_AUDIT_TEXTREL is not set -# CONFIG_GRKERNSEC_HARDEN_PTRACE is not set -# CONFIG_GRKERNSEC_BLACKHOLE is not set -# CONFIG_GRKERNSEC_VM86 is not set -# CONFIG_PAX_MPROTECT_ALLOW_PTRACE is not set -# CONFIG_PAX_SEGMEXEC is not set -# CONFIG_PAX_KERNEXEC is not set -# CONFIG_PAX_NOELFRELOCS is not set -# CONFIG_PAX_USERCOPY is not set +CONFIG_GRKERNSEC_MODHARDEN=n +CONFIG_GRKERNSEC_NO_RBAC=n +CONFIG_GRKERNSEC_ROFS=n +CONFIG_GRKERNSEC_AUDIT_PTRACE=n +CONFIG_GRKERNSEC_AUDIT_TEXTREL=n +CONFIG_GRKERNSEC_HARDEN_PTRACE=n +CONFIG_GRKERNSEC_BLACKHOLE=n +CONFIG_GRKERNSEC_VM86=n +CONFIG_PAX_MPROTECT_ALLOW_PTRACE=n +CONFIG_PAX_SEGMEXEC=n +CONFIG_PAX_KERNEXEC=n +CONFIG_PAX_NOELFRELOCS=n +CONFIG_PAX_USERCOPY=n diff --git a/features/grsec/pax.cfg b/features/grsec/pax.cfg index 6042947a..4ea6b0c3 100644 --- a/features/grsec/pax.cfg +++ b/features/grsec/pax.cfg @@ -7,8 +7,8 @@ CONFIG_PAX=y CONFIG_PAX_SOFTMODE=y CONFIG_PAX_EI_PAX=y CONFIG_PAX_PT_PAX_FLAGS=y -# CONFIG_PAX_NO_ACL_FLAGS is not set -# CONFIG_PAX_HAVE_ACL_FLAGS is not set +CONFIG_PAX_NO_ACL_FLAGS=n +CONFIG_PAX_HAVE_ACL_FLAGS=n CONFIG_PAX_HOOK_ACL_FLAGS=y # @@ -27,7 +27,7 @@ CONFIG_PAX_EMUPLT=y # CONFIG_PAX_ASLR=y CONFIG_PAX_RANDUSTACK=y -# CONFIG_PAX_RANDMMAP is not set +CONFIG_PAX_RANDMMAP=n # # Miscellaneous hardening features diff --git a/features/hid/hid.cfg b/features/hid/hid.cfg new file mode 100644 index 00000000..cfd84dbd --- /dev/null +++ b/features/hid/hid.cfg @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT + +CONFIG_HID_SUPPORT=y +CONFIG_HID=y diff --git a/features/hid/hid.scc b/features/hid/hid.scc new file mode 100644 index 00000000..28d242df --- /dev/null +++ b/features/hid/hid.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable base HID config" +define KFEATURE_COMPATIBILITY board + +kconf hardware hid.cfg diff --git a/features/hostapd/hostapd.scc b/features/hostapd/hostapd.scc index d03b3ce2..aedf9549 100644 --- a/features/hostapd/hostapd.scc +++ b/features/hostapd/hostapd.scc @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -kconf hardware hostapd.cfg +kconf non-hardware hostapd.cfg diff --git a/features/i3c/i3c.cfg b/features/i3c/i3c.cfg new file mode 100644 index 00000000..17f0ce91 --- /dev/null +++ b/features/i3c/i3c.cfg @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +CONFIG_I3C=m +CONFIG_CDNS_I3C_MASTER=m +CONFIG_DW_I3C_MASTER=m +CONFIG_SVC_I3C_MASTER=m +CONFIG_MIPI_I3C_HCI=m diff --git a/features/i3c/i3c.scc b/features/i3c/i3c.scc new file mode 100644 index 00000000..f5615e88 --- /dev/null +++ b/features/i3c/i3c.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable I3C Support" +define KFEATURE_COMPATIBILITY board + +kconf hardware i3c.cfg diff --git a/features/i915/i915.cfg b/features/i915/i915.cfg index 516c68af..f5e9351a 100644 --- a/features/i915/i915.cfg +++ b/features/i915/i915.cfg @@ -3,11 +3,9 @@ CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_COMPAT=y CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_ALGOBIT=y CONFIG_AGP=y CONFIG_AGP_INTEL=y CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=m CONFIG_DRM_I915=m -CONFIG_DRM_KMS_FB_HELPER=y diff --git a/features/ieee802154/ieee802154-hwsim.cfg b/features/ieee802154/ieee802154-hwsim.cfg new file mode 100644 index 00000000..5fe6f5c6 --- /dev/null +++ b/features/ieee802154/ieee802154-hwsim.cfg @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# dependencies +CONFIG_MAC802154=y +CONFIG_NETDEVICES=y +CONFIG_IEEE802154=y +CONFIG_IEEE802154_DRIVERS=y + +CONFIG_IEEE802154_HWSIM=y diff --git a/features/ieee802154/ieee802154-hwsim.scc b/features/ieee802154/ieee802154-hwsim.scc new file mode 100644 index 00000000..c29d43f5 --- /dev/null +++ b/features/ieee802154/ieee802154-hwsim.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable simulated radio testing tool for mac802154" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware ieee802154-hwsim.cfg diff --git a/features/ima/ima.cfg b/features/ima/ima.cfg index 1c613636..5fd3288e 100644 --- a/features/ima/ima.cfg +++ b/features/ima/ima.cfg @@ -1,19 +1,34 @@ # SPDX-License-Identifier: MIT CONFIG_IMA=y +CONFIG_IMA_LSM_RULES=y CONFIG_IMA_MEASURE_PCR_IDX=10 -CONFIG_IMA_NG_TEMPLATE=y -CONFIG_IMA_DEFAULT_TEMPLATE="ima-ng" -CONFIG_IMA_DEFAULT_HASH_SHA1=y -CONFIG_IMA_DEFAULT_HASH="sha1" -CONFIG_IMA_APPRAISE=y -CONFIG_IMA_APPRAISE_BOOTPARAM=y -CONFIG_IMA_TRUSTED_KEYRING=y +CONFIG_IMA_SIG_TEMPLATE=y +CONFIG_IMA_DEFAULT_TEMPLATE="ima-sig" +CONFIG_IMA_DEFAULT_HASH_SHA256=y +CONFIG_IMA_DEFAULT_HASH="sha256" +CONFIG_IMA_ARCH_POLICY=y +CONFIG_IMA_APPRAISE_BUILD_POLICY=y +CONFIG_IMA_APPRAISE_REQUIRE_POLICY_SIGS=y +CONFIG_IMA_APPRAISE_SIGNED_INIT=y +CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS=y +CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS=y +CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT=y +CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY=y CONFIG_SIGNATURE=y CONFIG_IMA_WRITE_POLICY=y CONFIG_IMA_READ_POLICY=y -CONFIG_IMA_LOAD_X509=y -CONFIG_IMA_X509_PATH="/etc/keys/x509_ima.der" - -#CONFIG_INTEGRITY_SIGNATURE=y -#CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y -#CONFIG_INTEGRITY_TRUSTED_KEYRING=y +CONFIG_INTEGRITY=y +CONFIG_INTEGRITY_SIGNATURE=y +CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y +CONFIG_INTEGRITY_TRUSTED_KEYRING=y +CONFIG_EVM=y +CONFIG_KEYS=y +CONFIG_ASYMMETRIC_KEY_TYPE=y +CONFIG_SYSTEM_TRUSTED_KEYRING=y +CONFIG_SECONDARY_TRUSTED_KEYRING=y +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y +CONFIG_X509_CERTIFICATE_PARSER=y +CONFIG_PKCS8_PRIVATE_KEY_PARSER=y +CONFIG_CRYPTO_ECDSA=y +CONFIG_SECURITY=y +CONFIG_SECURITYFS=y diff --git a/features/ima/ima_evm_root_ca.cfg b/features/ima/ima_evm_root_ca.cfg index b4392afb..0761fb28 100644 --- a/features/ima/ima_evm_root_ca.cfg +++ b/features/ima/ima_evm_root_ca.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT -# CONFIG_IMA_APPRAISE_SIGNED_INIT is not set +CONFIG_IMA_APPRAISE_SIGNED_INIT=n CONFIG_EVM_LOAD_X509=y CONFIG_EVM_X509_PATH="/etc/keys/x509_evm.der" diff --git a/features/intel-dptf/intel-dptf.scc b/features/intel-dptf/intel-dptf.scc index 0671f673..b488a2c5 100644 --- a/features/intel-dptf/intel-dptf.scc +++ b/features/intel-dptf/intel-dptf.scc @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT define KFEATURE_DESCRIPTION "Enable Dynamic Platform and Thermal Framework PCH FIVR Participant device support" -kconf hardware intel-dptf.cfg +kconf non-hardware intel-dptf.cfg diff --git a/features/intel-persistent-memory/intel-x86-64-dax.cfg b/features/intel-persistent-memory/intel-x86-64-dax.cfg index 9e887919..ca53f2de 100644 --- a/features/intel-persistent-memory/intel-x86-64-dax.cfg +++ b/features/intel-persistent-memory/intel-x86-64-dax.cfg @@ -5,4 +5,3 @@ CONFIG_DEV_DAX=m CONFIG_DEV_DAX_PMEM=m CONFIG_DEV_DAX_KMEM=m -CONFIG_DEV_DAX_PMEM_COMPAT=m diff --git a/features/intel-persistent-memory/intel-x86-64-pmem.cfg b/features/intel-persistent-memory/intel-x86-64-pmem.cfg index a0ab17e9..e7f039e9 100644 --- a/features/intel-persistent-memory/intel-x86-64-pmem.cfg +++ b/features/intel-persistent-memory/intel-x86-64-pmem.cfg @@ -16,7 +16,6 @@ CONFIG_ZONE_DEVICE=y # CONFIG_LIBNVDIMM=m CONFIG_BLK_DEV_PMEM=m -CONFIG_ND_BLK=m CONFIG_BTT=y CONFIG_NVDIMM_PFN=y CONFIG_NVDIMM_DAX=y diff --git a/features/intel-pinctrl/intel-pinctrl.cfg b/features/intel-pinctrl/intel-pinctrl.cfg index 491aca89..ca928504 100644 --- a/features/intel-pinctrl/intel-pinctrl.cfg +++ b/features/intel-pinctrl/intel-pinctrl.cfg @@ -1,5 +1,6 @@ # SPDX-License-Identifier: MIT CONFIG_PINCTRL_INTEL=y +CONFIG_PINCTRL_ALDERLAKE=y CONFIG_PINCTRL_BAYTRAIL=y CONFIG_PINCTRL_CHERRYVIEW=y CONFIG_PINCTRL_BROXTON=y @@ -13,3 +14,4 @@ CONFIG_PINCTRL_ICELAKE=y CONFIG_PINCTRL_LEWISBURG=y CONFIG_PINCTRL_LYNXPOINT=m CONFIG_PINCTRL_TIGERLAKE=y +CONFIG_PINCTRL_ELKHARTLAKE=y diff --git a/features/intel-sgx/intel-sgx.cfg b/features/intel-sgx/intel-sgx.cfg new file mode 100644 index 00000000..35010062 --- /dev/null +++ b/features/intel-sgx/intel-sgx.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_X86_SGX=y diff --git a/features/intel-sgx/intel-sgx.scc b/features/intel-sgx/intel-sgx.scc new file mode 100644 index 00000000..2ec2ec60 --- /dev/null +++ b/features/intel-sgx/intel-sgx.scc @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable Intel Software Guard eXtensions (SGX)" + +kconf hardware intel-sgx.cfg diff --git a/features/iommu/iommu.cfg b/features/iommu/iommu.cfg index 4becf3eb..56221474 100644 --- a/features/iommu/iommu.cfg +++ b/features/iommu/iommu.cfg @@ -5,4 +5,4 @@ CONFIG_IOMMU_API=y CONFIG_IOMMU_IOVA=y CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_FLOPPY_WA=y -# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_DEFAULT_ON=n diff --git a/features/iscsi/iscsi.cfg b/features/iscsi/iscsi.cfg new file mode 100644 index 00000000..7c47204b --- /dev/null +++ b/features/iscsi/iscsi.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_ISCSI_TCP=m +CONFIG_ISCSI_BOOT_SYSFS=m diff --git a/features/iscsi/iscsi.scc b/features/iscsi/iscsi.scc new file mode 100644 index 00000000..4fc0cec3 --- /dev/null +++ b/features/iscsi/iscsi.scc @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "iSCSI Initiator over TCP/IP" + +kconf non-hardware iscsi.cfg diff --git a/features/kfence/kfence.cfg b/features/kfence/kfence.cfg new file mode 100644 index 00000000..6f4875c3 --- /dev/null +++ b/features/kfence/kfence.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_KFENCE=y diff --git a/features/kfence/kfence.scc b/features/kfence/kfence.scc new file mode 100644 index 00000000..741bca26 --- /dev/null +++ b/features/kfence/kfence.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "a low-overhead sampling-based memory safety error detector" +define KFEATURE_COMPATIBILITY arch + +kconf non-hardware kfence.cfg diff --git a/features/kmemcheck/kmemcheck.cfg b/features/kmemcheck/kmemcheck.cfg index 210e7e26..0e6fbef9 100644 --- a/features/kmemcheck/kmemcheck.cfg +++ b/features/kmemcheck/kmemcheck.cfg @@ -1,8 +1,8 @@ # SPDX-License-Identifier: MIT # To get more information CONFIG_DEBUG_INFO=y -# CONFIG_FUNCTION_TRACER is not set -# CONFIG_DEBUG_PAGEALLOC is not set +CONFIG_FUNCTION_TRACER=n +CONFIG_DEBUG_PAGEALLOC=n # kmemcheck related CONFIG_KMEMCHECK=y diff --git a/features/landlock/landlock.cfg b/features/landlock/landlock.cfg new file mode 100644 index 00000000..dfe9f066 --- /dev/null +++ b/features/landlock/landlock.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_SECURITY_LANDLOCK=y + diff --git a/features/landlock/landlock.scc b/features/landlock/landlock.scc new file mode 100644 index 00000000..d2917123 --- /dev/null +++ b/features/landlock/landlock.scc @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable the landlock security module" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware landlock.cfg + diff --git a/features/leds/leds.cfg b/features/leds/leds.cfg index eb40627c..33f3da76 100644 --- a/features/leds/leds.cfg +++ b/features/leds/leds.cfg @@ -13,4 +13,3 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=y # Include them here, but they won't be enabled unless GPIO is explicitly # enabled as well. CONFIG_LEDS_GPIO=y -CONFIG_LEDS_TRIGGER_GPIO=y diff --git a/features/lto/lto-disable.cfg b/features/lto/lto-disable.cfg index 81939aff..75bedad3 100644 --- a/features/lto/lto-disable.cfg +++ b/features/lto/lto-disable.cfg @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -# CONFIG_LTO_MENU is not set -# CONFIG_LTO is not set -# CONFIG_LTO_DEBUG is not set -# CONFIG_LTO_CP_CLONE is not set -# CONFIG_LTO_SLIM is not set +CONFIG_LTO_MENU=n +CONFIG_LTO=n +CONFIG_LTO_DEBUG=n +CONFIG_LTO_CP_CLONE=n +CONFIG_LTO_SLIM=n diff --git a/features/lxc/lxc-enable.scc b/features/lxc/lxc-enable.scc index 1482f6ad..1fabf96d 100644 --- a/features/lxc/lxc-enable.scc +++ b/features/lxc/lxc-enable.scc @@ -2,4 +2,4 @@ define KFEATURE_DESCRIPTION "Enable LXC support" define KFEATURE_COMPATIBILITY all -kconf non-hardware lxc.cfg +include cfg/lxc.scc diff --git a/features/mac80211/mac80211-hwsim.cfg b/features/mac80211/mac80211-hwsim.cfg new file mode 100644 index 00000000..863a041f --- /dev/null +++ b/features/mac80211/mac80211-hwsim.cfg @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +# dependencies +CONFIG_CFG80211=y +CONFIG_MAC80211=y + +CONFIG_MAC80211_HWSIM=y diff --git a/features/mac80211/mac80211-hwsim.scc b/features/mac80211/mac80211-hwsim.scc new file mode 100644 index 00000000..71df2daf --- /dev/null +++ b/features/mac80211/mac80211-hwsim.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable simulated radio testing tool for mac80211" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware mac80211-hwsim.cfg diff --git a/features/mac80211/mac80211.scc b/features/mac80211/mac80211.scc index 5939f434..01806b6e 100644 --- a/features/mac80211/mac80211.scc +++ b/features/mac80211/mac80211.scc @@ -2,4 +2,4 @@ define KFEATURE_DESCRIPTION "Enable mac 80211 + WLAN support" define KFEATURE_COMPATIBILITY board -kconf hardware mac80211.cfg +kconf non-hardware mac80211.cfg diff --git a/features/media/media-dvb-frontends.cfg b/features/media/media-dvb-frontends.cfg index acada3df..10f02cc5 100644 --- a/features/media/media-dvb-frontends.cfg +++ b/features/media/media-dvb-frontends.cfg @@ -29,12 +29,9 @@ CONFIG_DVB_STV6110=m CONFIG_DVB_STV0900=m CONFIG_DVB_TDA8083=m CONFIG_DVB_TDA10086=m -CONFIG_DVB_TDA8261=m -CONFIG_DVB_VES1X93=m CONFIG_DVB_TUNER_ITD1000=m CONFIG_DVB_TUNER_CX24113=m CONFIG_DVB_TDA826X=m -CONFIG_DVB_TUA6100=m CONFIG_DVB_CX24116=m CONFIG_DVB_SI21XX=m CONFIG_DVB_DS3000=m @@ -44,12 +41,10 @@ CONFIG_DVB_TDA10071=m # # DVB-T (terrestrial) frontends # -CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m CONFIG_DVB_DRXD=m -CONFIG_DVB_L64781=m CONFIG_DVB_TDA1004X=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m diff --git a/features/media/media-i2c.cfg b/features/media/media-i2c.cfg index f87806a9..2069c5b2 100644 --- a/features/media/media-i2c.cfg +++ b/features/media/media-i2c.cfg @@ -9,9 +9,6 @@ CONFIG_VIDEO_IR_I2C=m CONFIG_VIDEO_TVAUDIO=m CONFIG_VIDEO_TDA7432=m -CONFIG_VIDEO_TDA9840=m -CONFIG_VIDEO_TEA6415C=m -CONFIG_VIDEO_TEA6420=m CONFIG_VIDEO_MSP3400=m CONFIG_VIDEO_CS5345=m CONFIG_VIDEO_CS53L32A=m diff --git a/features/media/media-pci-capture.cfg b/features/media/media-pci-capture.cfg index 33f1079e..fdf12149 100644 --- a/features/media/media-pci-capture.cfg +++ b/features/media/media-pci-capture.cfg @@ -11,10 +11,6 @@ CONFIG_VIDEO_IVTV=m CONFIG_VIDEO_IVTV_ALSA=m CONFIG_VIDEO_FB_IVTV=m -CONFIG_VIDEO_HEXIUM_GEMINI=m -CONFIG_VIDEO_HEXIUM_ORION=m -CONFIG_VIDEO_MXB=m - # # Media capture/analog/hybrid TV support # @@ -43,17 +39,6 @@ CONFIG_VIDEO_SAA7134_RC=y CONFIG_VIDEO_SAA7134_DVB=m CONFIG_VIDEO_SAA7164=m -# -# Media digital TV PCI Adapters -# -CONFIG_DVB_AV7110=m -CONFIG_DVB_AV7110_OSD=y -CONFIG_DVB_BUDGET_CORE=m -CONFIG_DVB_BUDGET=m -CONFIG_DVB_BUDGET_CI=m -CONFIG_DVB_BUDGET_AV=m -CONFIG_DVB_BUDGET_PATCH=m - CONFIG_DVB_B2C2_FLEXCOP_PCI=m CONFIG_DVB_PLUTO2=m diff --git a/features/media/media-platform.cfg b/features/media/media-platform.cfg index 58ad7330..135e3eeb 100644 --- a/features/media/media-platform.cfg +++ b/features/media/media-platform.cfg @@ -2,5 +2,6 @@ # # Media Platform Configuration # +CONFIG_MEDIA_PLATFORM_SUPPORT=y CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_MEM2MEM_DEINTERLACE=m diff --git a/features/media/media-radio.cfg b/features/media/media-radio.cfg index 19453262..ca695abf 100644 --- a/features/media/media-radio.cfg +++ b/features/media/media-radio.cfg @@ -3,7 +3,7 @@ # Media AM/FM Radio Adapters # CONFIG_MEDIA_RADIO_SUPPORT=y -CONFIG_RADIO_ADAPTERS=y +CONFIG_RADIO_ADAPTERS=m CONFIG_RADIO_SI470X=m CONFIG_USB_SI470X=m CONFIG_I2C_SI470X=m diff --git a/features/media/media-usb-tv.cfg b/features/media/media-usb-tv.cfg index 96cd81c9..33e2279a 100644 --- a/features/media/media-usb-tv.cfg +++ b/features/media/media-usb-tv.cfg @@ -8,7 +8,6 @@ CONFIG_VIDEO_PVRUSB2_SYSFS=y CONFIG_VIDEO_PVRUSB2_DVB=y CONFIG_VIDEO_HDPVR=m CONFIG_VIDEO_STK1160=m -CONFIG_VIDEO_STK1160_COMMON=m # # Analog/digital TV USB devices @@ -17,9 +16,6 @@ CONFIG_VIDEO_CX231XX=m CONFIG_VIDEO_CX231XX_RC=y CONFIG_VIDEO_CX231XX_ALSA=m CONFIG_VIDEO_CX231XX_DVB=m -CONFIG_VIDEO_TM6000=m -CONFIG_VIDEO_TM6000_ALSA=m -CONFIG_VIDEO_TM6000_DVB=m # # Digital TV USB devices diff --git a/features/media/media-usb-webcams.cfg b/features/media/media-usb-webcams.cfg index 93361188..8549b0a8 100644 --- a/features/media/media-usb-webcams.cfg +++ b/features/media/media-usb-webcams.cfg @@ -56,12 +56,5 @@ CONFIG_USB_GSPCA_ZC3XX=m CONFIG_USB_PWC=m CONFIG_USB_PWC_INPUT_EVDEV=y -# Vision's CPiA2 (Colour Processor Interface ASIC) Camera Drivers -CONFIG_VIDEO_CPIA2=m - - -# USB Syntek DC1125 Camera Support -CONFIG_USB_STKWEBCAM=m - # USB Sensoray 2255 video capture Device CONFIG_USB_S2255=m diff --git a/features/media/media.cfg b/features/media/media.cfg index 13e57b73..148fa991 100644 --- a/features/media/media.cfg +++ b/features/media/media.cfg @@ -10,7 +10,6 @@ CONFIG_MEDIA_CONTROLLER=y # Enable the V4L2 core and API # CONFIG_VIDEO_DEV=m -CONFIG_VIDEO_V4L2=m CONFIG_VIDEO_V4L2_SUBDEV_API=y # @@ -19,14 +18,6 @@ CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_V4L2_MEM2MEM_DEV=m # -# Used by drivers that need Videobuf modules -# -CONFIG_VIDEOBUF_GEN=m -CONFIG_VIDEOBUF_DMA_SG=m -CONFIG_VIDEOBUF_DMA_CONTIG=m -CONFIG_VIDEOBUF_VMALLOC=m - -# # Used by drivers that need Videobuf2 modules # CONFIG_VIDEOBUF2_CORE=m diff --git a/features/mei/amt.cfg b/features/mei/amt.cfg index f1c7aa59..df0bf237 100644 --- a/features/mei/amt.cfg +++ b/features/mei/amt.cfg @@ -1,3 +1,4 @@ # SPDX-License-Identifier: MIT CONFIG_WATCHDOG_CORE=y +CONFIG_WATCHDOG_SYSFS=y CONFIG_INTEL_MEI_WDT=m diff --git a/features/minnow-io/minnow-io.cfg b/features/minnow-io/minnow-io.cfg index 5ca458d1..c8fe2ce3 100644 --- a/features/minnow-io/minnow-io.cfg +++ b/features/minnow-io/minnow-io.cfg @@ -4,7 +4,6 @@ CONFIG_MINNOWBOARD_GPIO=m CONFIG_MINNOWBOARD_KEYS=m # GPIO Support -CONFIG_GPIO_SYSFS=y CONFIG_GPIOLIB=y CONFIG_GPIO_GENERIC=y diff --git a/features/misc/bosch-pressure-sensor-i2c.cfg b/features/misc/bosch-pressure-sensor-i2c.cfg index 420a95f7..8594140b 100644 --- a/features/misc/bosch-pressure-sensor-i2c.cfg +++ b/features/misc/bosch-pressure-sensor-i2c.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: MIT -# CONFIG_BMP280 is not set +CONFIG_BMP280=n CONFIG_BMP085=m CONFIG_BMP085_I2C=m diff --git a/features/net/net.scc b/features/net/net.scc index a907e016..606aaa91 100644 --- a/features/net/net.scc +++ b/features/net/net.scc @@ -1,4 +1,3 @@ # SPDX-License-Identifier: MIT kconf hardware net.cfg -patch netfilter-Fix-remainder-of-pseudo-header-protocol-0.patch diff --git a/features/net/netfilter-Fix-remainder-of-pseudo-header-protocol-0.patch b/features/net/netfilter-Fix-remainder-of-pseudo-header-protocol-0.patch deleted file mode 100644 index d1fdbf98..00000000 --- a/features/net/netfilter-Fix-remainder-of-pseudo-header-protocol-0.patch +++ /dev/null @@ -1,92 +0,0 @@ -From b383959122e464ccdc21f6b37af88152d29cdf95 Mon Sep 17 00:00:00 2001 -From: He Zhe <zhe.he@windriver.com> -Date: Tue, 25 Jun 2019 18:15:50 +0800 -Subject: [PATCH] netfilter: Fix remainder of pseudo-header protocol 0 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Since v5.1-rc1, some types of packets do not get unreachable reply with the -following iptables setting. Fox example, - -$ iptables -A INPUT -p icmp --icmp-type 8 -j REJECT -$ ping 127.0.0.1 -c 1 -PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. -— 127.0.0.1 ping statistics — -1 packets transmitted, 0 received, 100% packet loss, time 0ms - -We should have got the following reply from command line, but we did not. -From 127.0.0.1 icmp_seq=1 Destination Port Unreachable - -Yi Zhao reported it and narrowed it down to: -7fc38225363d ("netfilter: reject: skip csum verification for protocols that don't support it"), - -This is because nf_ip_checksum still expects pseudo-header protocol type 0 for -packets that are of neither TCP or UDP, and thus ICMP packets are mistakenly -treated as TCP/UDP. - -This patch corrects the conditions in nf_ip_checksum and all other places that -still call it with protocol 0. - -Fixes: 7fc38225363d ("netfilter: reject: skip csum verification for protocols that don't support it") -Reported-by: Yi Zhao <yi.zhao@windriver.com> -Signed-off-by: He Zhe <zhe.he@windriver.com> -Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> ---- - net/netfilter/nf_conntrack_proto_icmp.c | 2 +- - net/netfilter/nf_nat_proto.c | 2 +- - net/netfilter/utils.c | 5 +++-- - 3 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/net/netfilter/nf_conntrack_proto_icmp.c b/net/netfilter/nf_conntrack_proto_icmp.c -index a824367ed518..dd53e2b20f6b 100644 ---- a/net/netfilter/nf_conntrack_proto_icmp.c -+++ b/net/netfilter/nf_conntrack_proto_icmp.c -@@ -218,7 +218,7 @@ int nf_conntrack_icmpv4_error(struct nf_conn *tmpl, - /* See ip_conntrack_proto_tcp.c */ - if (state->net->ct.sysctl_checksum && - state->hook == NF_INET_PRE_ROUTING && -- nf_ip_checksum(skb, state->hook, dataoff, 0)) { -+ nf_ip_checksum(skb, state->hook, dataoff, IPPROTO_ICMP)) { - icmp_error_log(skb, state, "bad hw icmp checksum"); - return -NF_ACCEPT; - } -diff --git a/net/netfilter/nf_nat_proto.c b/net/netfilter/nf_nat_proto.c -index 07da07788f6b..83a24cc5753b 100644 ---- a/net/netfilter/nf_nat_proto.c -+++ b/net/netfilter/nf_nat_proto.c -@@ -564,7 +564,7 @@ int nf_nat_icmp_reply_translation(struct sk_buff *skb, - - if (!skb_make_writable(skb, hdrlen + sizeof(*inside))) - return 0; -- if (nf_ip_checksum(skb, hooknum, hdrlen, 0)) -+ if (nf_ip_checksum(skb, hooknum, hdrlen, IPPROTO_ICMP)) - return 0; - - inside = (void *)skb->data + hdrlen; -diff --git a/net/netfilter/utils.c b/net/netfilter/utils.c -index 06dc55590441..51b454d8fa9c 100644 ---- a/net/netfilter/utils.c -+++ b/net/netfilter/utils.c -@@ -17,7 +17,8 @@ __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, - case CHECKSUM_COMPLETE: - if (hook != NF_INET_PRE_ROUTING && hook != NF_INET_LOCAL_IN) - break; -- if ((protocol == 0 && !csum_fold(skb->csum)) || -+ if ((protocol != IPPROTO_TCP && protocol != IPPROTO_UDP && -+ !csum_fold(skb->csum)) || - !csum_tcpudp_magic(iph->saddr, iph->daddr, - skb->len - dataoff, protocol, - skb->csum)) { -@@ -26,7 +27,7 @@ __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, - } - /* fall through */ - case CHECKSUM_NONE: -- if (protocol == 0) -+ if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP) - skb->csum = 0; - else - skb->csum = csum_tcpudp_nofold(iph->saddr, iph->daddr, --- -2.19.1 - diff --git a/features/net/xdp/xdp.cfg b/features/net/xdp/xdp.cfg new file mode 100644 index 00000000..061b65a4 --- /dev/null +++ b/features/net/xdp/xdp.cfg @@ -0,0 +1 @@ +CONFIG_XDP_SOCKETS=y diff --git a/features/net/xdp/xdp.scc b/features/net/xdp/xdp.scc new file mode 100644 index 00000000..e4df6d09 --- /dev/null +++ b/features/net/xdp/xdp.scc @@ -0,0 +1 @@ +kconf hardware xdp.cfg diff --git a/features/net_sched/net_sched.cfg b/features/net_sched/net_sched.cfg index c9714dab..137ca752 100644 --- a/features/net_sched/net_sched.cfg +++ b/features/net_sched/net_sched.cfg @@ -7,7 +7,6 @@ CONFIG_NET_SCHED=y # # Queueing/Scheduling # -CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m @@ -16,12 +15,13 @@ CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m -CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_SCH_CODEL=m CONFIG_NET_SCH_FQ_CODEL=m +CONFIG_NET_SCH_MULTIQ=m + # # Classification # @@ -31,3 +31,8 @@ CONFIG_NET_CLS_BASIC=y CONFIG_NET_CLS_CGROUP=y CONFIG_NET_CLS_U32=y CONFIG_NET_ACT_MIRRED=m +CONFIG_NET_ACT_SKBEDIT=m +CONFIG_NET_EMATCH=y + +CONFIG_NET_EMATCH_U32=y +CONFIG_NET_EMATCH_META=y diff --git a/features/netfilter/netfilter.cfg b/features/netfilter/netfilter.cfg index bc0d0603..ba275be4 100644 --- a/features/netfilter/netfilter.cfg +++ b/features/netfilter/netfilter.cfg @@ -29,13 +29,14 @@ CONFIG_NF_CT_NETLINK=m CONFIG_NETFILTER_XTABLES=m CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m CONFIG_NETFILTER_XT_TARGET_CONNMARK=m +CONFIG_NETFILTER_XT_TARGET_CT=m CONFIG_NETFILTER_XT_TARGET_DSCP=m CONFIG_NETFILTER_XT_TARGET_HL=m CONFIG_NETFILTER_XT_TARGET_LOG=m CONFIG_NETFILTER_XT_TARGET_MARK=m CONFIG_NETFILTER_XT_TARGET_NFLOG=m CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m -CONFIG_NETFILTER_XT_TARGET_NOTRACK=m +# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set CONFIG_NETFILTER_XT_TARGET_TRACE=m CONFIG_NETFILTER_XT_TARGET_TCPMSS=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m @@ -91,7 +92,6 @@ CONFIG_NF_NAT_PPTP=m CONFIG_NF_NAT_H323=m CONFIG_NF_NAT_SIP=m CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_TTL=m CONFIG_IP_NF_RAW=m diff --git a/features/nf_tables/nf_tables.cfg b/features/nf_tables/nf_tables.cfg index 85b89b75..5b0f28df 100644 --- a/features/nf_tables/nf_tables.cfg +++ b/features/nf_tables/nf_tables.cfg @@ -1,31 +1,24 @@ # SPDX-License-Identifier: MIT -CONFIG_NF_TABLES=m -CONFIG_NF_TABLES_INET=m -CONFIG_NFT_EXTHDR=m -CONFIG_NFT_META=m +CONFIG_NF_TABLES=y +CONFIG_NF_TABLES_INET=y +CONFIG_NF_TABLES_NETDEV=y CONFIG_NFT_CT=m -CONFIG_NFT_SET_RBTREE=m -CONFIG_NFT_SET_HASH=m -CONFIG_NFT_RBTREE=m CONFIG_NFT_HASH=m -CONFIG_NFT_COUNTER=m CONFIG_NFT_MASQ=m -CONFIG_NFT_MASQ_IPV4=m CONFIG_NFT_REDIR=m -CONFIG_NFT_REDIR_IPV4=m CONFIG_NFT_LOG=m CONFIG_NFT_LIMIT=m +CONFIG_NFT_CONNLIMIT=m +CONFIG_NFT_TUNNEL=m CONFIG_NFT_NAT=m CONFIG_NFT_QUEUE=m CONFIG_NFT_REJECT=m CONFIG_NFT_REJECT_INET=m CONFIG_NFT_COMPAT=m -CONFIG_NF_TABLES_IPV4=m -CONFIG_NFT_CHAIN_ROUTE_IPV4=m -CONFIG_NFT_CHAIN_NAT_IPV4=m +CONFIG_NF_TABLES_IPV4=y CONFIG_NFT_REJECT_IPV4=m CONFIG_NFT_REJECT_IPV6=m -CONFIG_NF_TABLES_ARP=m -CONFIG_NF_TABLES_IPV6=m -CONFIG_NFT_CHAIN_ROUTE_IPV6=m +CONFIG_NF_TABLES_ARP=y +CONFIG_NF_TABLES_IPV6=y CONFIG_NF_TABLES_BRIDGE=m +CONFIG_NFT_SOCKET=m diff --git a/features/nf_tables/nft_test.cfg b/features/nf_tables/nft_test.cfg new file mode 100644 index 00000000..0a959d0e --- /dev/null +++ b/features/nf_tables/nft_test.cfg @@ -0,0 +1,13 @@ +CONFIG_NF_CONNTRACK_TIMEOUT=y +CONFIG_NF_FLOW_TABLE_INET=m +CONFIG_NF_FLOW_TABLE=m +CONFIG_NFT_FIB_INET=y +CONFIG_NFT_FIB_IPV4=y +CONFIG_NFT_FIB_IPV6=y +CONFIG_NFT_FLOW_OFFLOAD=m +CONFIG_NFT_NUMGEN=m +CONFIG_NFT_OSF=m +CONFIG_NFT_QUOTA=m +CONFIG_NFT_SYNPROXY=m +CONFIG_NFT_XFRM=m +CONFIG_VETH=y diff --git a/features/nf_tables/nft_test.scc b/features/nf_tables/nft_test.scc new file mode 100644 index 00000000..8181c215 --- /dev/null +++ b/features/nf_tables/nft_test.scc @@ -0,0 +1,5 @@ +define KFEATURE_DESCRIPTION "Add extra nftables modules" +define KFEATURE_COMPATIBILITY all + +include nf_tables.cfg +include nft_test.cfg diff --git a/features/nfsd/nfsd.cfg b/features/nfsd/nfsd.cfg index 2e7abe16..8cd76e3c 100644 --- a/features/nfsd/nfsd.cfg +++ b/features/nfsd/nfsd.cfg @@ -1,5 +1,4 @@ # SPDX-License-Identifier: MIT CONFIG_NFSD=m -CONFIG_NFSD_V3=y -# CONFIG_NFSD_V3_ACL is not set +CONFIG_NFSD_V3_ACL=n CONFIG_NFSD_V4=y diff --git a/features/numa/numa.cfg b/features/numa/numa.cfg index cc550c4c..2cf4bae2 100644 --- a/features/numa/numa.cfg +++ b/features/numa/numa.cfg @@ -1,8 +1,9 @@ # SPDX-License-Identifier: MIT CONFIG_NUMA=y +CONFIG_NUMA_BALANCING=y +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_X86_64_ACPI_NUMA=y CONFIG_NUMA_EMU=y CONFIG_NODES_SHIFT=6 -CONFIG_NEED_MULTIPLE_NODES=y CONFIG_USE_PERCPU_NUMA_NODE_ID=y CONFIG_ACPI_NUMA=y diff --git a/features/optee/optee.cfg b/features/optee/optee.cfg new file mode 100644 index 00000000..3aa27f0a --- /dev/null +++ b/features/optee/optee.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_TEE=y +CONFIG_OPTEE=y diff --git a/features/optee/optee.scc b/features/optee/optee.scc new file mode 100644 index 00000000..db4c19e5 --- /dev/null +++ b/features/optee/optee.scc @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable optee support" + +kconf hardware optee.cfg diff --git a/features/pci/pci-of-generic.cfg b/features/pci/pci-of-generic.cfg new file mode 100644 index 00000000..67a3ccff --- /dev/null +++ b/features/pci/pci-of-generic.cfg @@ -0,0 +1,3 @@ +# Support a simple generic PCI host controller, such as the one emulated by kvmtool +CONFIG_PCI_HOST_GENERIC=y + diff --git a/features/pci/pci-of-generic.scc b/features/pci/pci-of-generic.scc new file mode 100644 index 00000000..cc76fb88 --- /dev/null +++ b/features/pci/pci-of-generic.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable Generic PCI OF device" +define KFEATURE_COMPATIBILITY board + +kconf hardware pci-of-generic.cfg diff --git a/features/pci/pci.cfg b/features/pci/pci.cfg index f3c57c54..3ed13b59 100644 --- a/features/pci/pci.cfg +++ b/features/pci/pci.cfg @@ -1,12 +1,8 @@ # SPDX-License-Identifier: MIT CONFIG_PCI=y -CONFIG_PCI_MMCONFIG=y CONFIG_PCI_MSI=y CONFIG_PCIEPORTBUS=y CONFIG_HOTPLUG_PCI=y -# CONFIG_HOTPLUG_PCI_PCIE is not set - - - +CONFIG_HOTPLUG_PCI_PCIE=n diff --git a/features/perf/libbpf-Fix-build-warning-on-ref_ctr_off.patch b/features/perf/libbpf-Fix-build-warning-on-ref_ctr_off.patch new file mode 100644 index 00000000..10ed1460 --- /dev/null +++ b/features/perf/libbpf-Fix-build-warning-on-ref_ctr_off.patch @@ -0,0 +1,46 @@ +From a41f5bda3e72b4f2bcdbe84cd65190121e3cc3ff Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 4 Dec 2022 18:23:47 -0800 +Subject: [PATCH] libbpf: Fix build warning on ref_ctr_off + +Clang warns on 32-bit ARM on this comparision + +libbpf.c:10497:18: error: result of comparison of constant 4294967296 with expression of type 'size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] + if (ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) + ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Check for platform long int to be larger than 32-bits before enabling +this check, it false on 32bit anyways. + +Cc: Alexei Starovoitov <ast@kernel.org> +Cc: Daniel Borkmann <daniel@iogearbox.net> +Cc: Song Liu <song@kernel.org> +Cc: Yonghong Song <yhs@fb.com> +Cc: Jiri Olsa <jolsa@kernel.org> +Cc: Paul Walmsley <paul.walmsley@sifive.com> +Cc: Palmer Dabbelt <palmer@dabbelt.com> +Cc: Nathan Chancellor <nathan@kernel.org> +Cc: Nick Desaulniers <ndesaulniers@google.com> + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + tools/lib/bpf/libbpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c +index 05c4db355f28..23991e0d21a9 100644 +--- a/tools/lib/bpf/libbpf.c ++++ b/tools/lib/bpf/libbpf.c +@@ -9867,7 +9867,7 @@ static int perf_event_open_probe(bool uprobe, bool retprobe, const char *name, + char errmsg[STRERR_BUFSIZE]; + int type, pfd; + +- if ((__u64)ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) ++ if (BITS_PER_LONG > 32 && (__u64)ref_ctr_off >= (1ULL << PERF_UPROBE_REF_CTR_OFFSET_BITS)) + return -EINVAL; + + memset(&attr, 0, attr_sz); +-- +2.34.1 + diff --git a/features/perf/perf.scc b/features/perf/perf.scc index 7cc48b16..dc9de471 100644 --- a/features/perf/perf.scc +++ b/features/perf/perf.scc @@ -10,3 +10,5 @@ patch perf-fix-bench-numa-compilation.patch patch perf-mips64-Convert-__u64-to-unsigned-long-long.patch patch perf-x86-32-explicitly-include-errno.h.patch patch perf-perf-can-not-parser-the-backtrace-of-app-in-the.patch +patch libbpf-Fix-build-warning-on-ref_ctr_off.patch +patch tools-Remove-some-options-from-CLANG_CROSS_FLAGS.patch diff --git a/features/perf/tools-Remove-some-options-from-CLANG_CROSS_FLAGS.patch b/features/perf/tools-Remove-some-options-from-CLANG_CROSS_FLAGS.patch new file mode 100644 index 00000000..31008bfa --- /dev/null +++ b/features/perf/tools-Remove-some-options-from-CLANG_CROSS_FLAGS.patch @@ -0,0 +1,37 @@ +From 2c720c18adae3422b022c2c88fb91379b1f3e2c6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 4 Dec 2022 18:33:48 -0800 +Subject: [PATCH 3/3] tools: Remove some options from CLANG_CROSS_FLAGS + +These options are not needed with OE/Yocto since compiler is already +passing these options via TOOLCHAIN_OPTIONS, having these options infact +regressed OE builds because build time --sysroot on OE cross compiler is +/not/exist and that creates problems where clang can no more find system +headers anymore during compilation + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + tools/scripts/Makefile.include | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include +index 0efb8f2b33ce..3d206d772cc2 100644 +--- a/tools/scripts/Makefile.include ++++ b/tools/scripts/Makefile.include +@@ -101,9 +101,9 @@ ifeq ($(CLANG_CROSS_FLAGS),) + CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%)) + GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null)) + ifneq ($(GCC_TOOLCHAIN_DIR),) +-CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) +-CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot) +-CLANG_CROSS_FLAGS += --gcc-toolchain=$(realpath $(GCC_TOOLCHAIN_DIR)/..) ++#CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) ++#CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot) ++#CLANG_CROSS_FLAGS += --gcc-toolchain=$(realpath $(GCC_TOOLCHAIN_DIR)/..) + endif # GCC_TOOLCHAIN_DIR + endif # CLANG_CROSS_FLAGS + CFLAGS += $(CLANG_CROSS_FLAGS) +-- +2.19.1 + diff --git a/features/qat/qat.cfg b/features/qat/qat.cfg index 2dc36225..5f138f1f 100644 --- a/features/qat/qat.cfg +++ b/features/qat/qat.cfg @@ -10,3 +10,5 @@ CONFIG_CRYPTO_VMAC=m CONFIG_CRYPTO_CTS=m CONFIG_CRYPTO_RSA=y CONFIG_CRYPTO_DH=y +CONFIG_PCIEAER=y +CONFIG_RAS=y diff --git a/features/qat/y_or_m_enabled.cfg b/features/qat/y_or_m_enabled.cfg new file mode 100644 index 00000000..357efc5a --- /dev/null +++ b/features/qat/y_or_m_enabled.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +CONFIG_CRYPTO_CCM +CONFIG_CRYPTO_GCM diff --git a/features/random/random.scc b/features/random/random.scc deleted file mode 100644 index 0fd6584c..00000000 --- a/features/random/random.scc +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: MIT -define KFEATURE_DESCRIPTION "Trust CPU's random number generator for initializing kernel's CRNG" -define KFEATURE_COMPATIBILITY arch - -kconf hardware random.cfg diff --git a/features/rt/ARM-Allow-to-enable-RT.patch b/features/rt/ARM-Allow-to-enable-RT.patch deleted file mode 100644 index cf78c0cb..00000000 --- a/features/rt/ARM-Allow-to-enable-RT.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b543f40eada157accc05e9e419a6ffc0168647d6 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 11 Oct 2019 13:14:29 +0200 -Subject: [PATCH 178/191] ARM: Allow to enable RT - -Allow to select RT. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm/Kconfig | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index fe49c7cb76bd..876e4d478e57 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -31,6 +31,7 @@ config ARM - select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX - select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 - select ARCH_SUPPORTS_ATOMIC_RMW -+ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK - select ARCH_USE_BUILTIN_BSWAP - select ARCH_USE_CMPXCHG_LOCKREF - select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU -@@ -123,6 +124,7 @@ config ARM - select OLD_SIGSUSPEND3 - select PCI_SYSCALL if PCI - select PERF_USE_VMALLOC -+ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM - select RTC_LIB - select SET_FS - select SYS_SUPPORTS_APM_EMULATION --- -2.19.1 - diff --git a/features/rt/ARM-enable-irq-in-translation-section-permission-fau.patch b/features/rt/ARM-enable-irq-in-translation-section-permission-fau.patch deleted file mode 100644 index 47dd0be4..00000000 --- a/features/rt/ARM-enable-irq-in-translation-section-permission-fau.patch +++ /dev/null @@ -1,94 +0,0 @@ -From ced2a927997124c1cceecd5da04917ad03992490 Mon Sep 17 00:00:00 2001 -From: "Yadi.hu" <yadi.hu@windriver.com> -Date: Wed, 10 Dec 2014 10:32:09 +0800 -Subject: [PATCH 173/191] ARM: enable irq in translation/section permission - fault handlers -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Probably happens on all ARM, with -CONFIG_PREEMPT_RT -CONFIG_DEBUG_ATOMIC_SLEEP - -This simple program.... - -int main() { - *((char*)0xc0001000) = 0; -}; - -[ 512.742724] BUG: sleeping function called from invalid context at kernel/rtmutex.c:658 -[ 512.743000] in_atomic(): 0, irqs_disabled(): 128, pid: 994, name: a -[ 512.743217] INFO: lockdep is turned off. -[ 512.743360] irq event stamp: 0 -[ 512.743482] hardirqs last enabled at (0): [< (null)>] (null) -[ 512.743714] hardirqs last disabled at (0): [<c0426370>] copy_process+0x3b0/0x11c0 -[ 512.744013] softirqs last enabled at (0): [<c0426370>] copy_process+0x3b0/0x11c0 -[ 512.744303] softirqs last disabled at (0): [< (null)>] (null) -[ 512.744631] [<c041872c>] (unwind_backtrace+0x0/0x104) -[ 512.745001] [<c09af0c4>] (dump_stack+0x20/0x24) -[ 512.745355] [<c0462490>] (__might_sleep+0x1dc/0x1e0) -[ 512.745717] [<c09b6770>] (rt_spin_lock+0x34/0x6c) -[ 512.746073] [<c0441bf0>] (do_force_sig_info+0x34/0xf0) -[ 512.746457] [<c0442668>] (force_sig_info+0x18/0x1c) -[ 512.746829] [<c041d880>] (__do_user_fault+0x9c/0xd8) -[ 512.747185] [<c041d938>] (do_bad_area+0x7c/0x94) -[ 512.747536] [<c041d990>] (do_sect_fault+0x40/0x48) -[ 512.747898] [<c040841c>] (do_DataAbort+0x40/0xa0) -[ 512.748181] Exception stack(0xecaa1fb0 to 0xecaa1ff8) - -Oxc0000000 belongs to kernel address space, user task can not be -allowed to access it. For above condition, correct result is that -test case should receive a “segment fault” and exits but not stacks. - -the root cause is commit 02fe2845d6a8 ("avoid enabling interrupts in -prefetch/data abort handlers"),it deletes irq enable block in Data -abort assemble code and move them into page/breakpiont/alignment fault -handlers instead. But author does not enable irq in translation/section -permission fault handlers. ARM disables irq when it enters exception/ -interrupt mode, if kernel doesn't enable irq, it would be still disabled -during translation/section permission fault. - -We see the above splat because do_force_sig_info is still called with -IRQs off, and that code eventually does a: - - spin_lock_irqsave(&t->sighand->siglock, flags); - -As this is architecture independent code, and we've not seen any other -need for other arch to have the siglock converted to raw lock, we can -conclude that we should enable irq for ARM translation/section -permission exception. - -Signed-off-by: Yadi.hu <yadi.hu@windriver.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm/mm/fault.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c -index da78740faf7b..07f79e533a29 100644 ---- a/arch/arm/mm/fault.c -+++ b/arch/arm/mm/fault.c -@@ -400,6 +400,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, - if (addr < TASK_SIZE) - return do_page_fault(addr, fsr, regs); - -+ if (interrupts_enabled(regs)) -+ local_irq_enable(); -+ - if (user_mode(regs)) - goto bad_area; - -@@ -479,6 +482,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, - static int - do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) - { -+ if (interrupts_enabled(regs)) -+ local_irq_enable(); -+ - do_bad_area(addr, fsr, regs); - return 0; - } --- -2.19.1 - diff --git a/features/rt/ARM64-Allow-to-enable-RT.patch b/features/rt/ARM64-Allow-to-enable-RT.patch deleted file mode 100644 index 3f265dc0..00000000 --- a/features/rt/ARM64-Allow-to-enable-RT.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 49cc082d1b5e913dd79529b9fbed93801c11af68 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 11 Oct 2019 13:14:35 +0200 -Subject: [PATCH 179/191] ARM64: Allow to enable RT - -Allow to select RT. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm64/Kconfig | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 93a4dd767825..9cc92459812c 100644 ---- a/arch/arm64/Kconfig -+++ b/arch/arm64/Kconfig -@@ -78,6 +78,7 @@ config ARM64 - select ARCH_SUPPORTS_ATOMIC_RMW - select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && (GCC_VERSION >= 50000 || CC_IS_CLANG) - select ARCH_SUPPORTS_NUMA_BALANCING -+ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK - select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT - select ARCH_WANT_DEFAULT_BPF_JIT - select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT -@@ -203,6 +204,7 @@ config ARM64 - select PCI_DOMAINS_GENERIC if PCI - select PCI_ECAM if (ACPI && PCI) - select PCI_SYSCALL if PCI -+ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM - select POWER_RESET - select POWER_SUPPLY - select SPARSE_IRQ --- -2.19.1 - diff --git a/features/rt/Add-localversion-for-RT-release.patch b/features/rt/Add-localversion-for-RT-release.patch deleted file mode 100644 index f18bce5a..00000000 --- a/features/rt/Add-localversion-for-RT-release.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 98e2d66a6a93107c8552dfa1023d83c9f757dfd5 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 8 Jul 2011 20:25:16 +0200 -Subject: [PATCH 191/191] Add localversion for -RT release - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - localversion-rt | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 localversion-rt - -diff --git a/localversion-rt b/localversion-rt -new file mode 100644 -index 000000000000..6f206be67cd2 ---- /dev/null -+++ b/localversion-rt -@@ -0,0 +1 @@ -+-rt1 --- -2.19.1 - diff --git a/features/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch b/features/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch deleted file mode 100644 index b42375b5..00000000 --- a/features/rt/KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 67396da80e5247521bb3a295c0a17ea970b143d6 Mon Sep 17 00:00:00 2001 -From: Josh Cartwright <joshc@ni.com> -Date: Thu, 11 Feb 2016 11:54:01 -0600 -Subject: [PATCH 175/191] KVM: arm/arm64: downgrade preempt_disable()d region - to migrate_disable() - -kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating -the vgic and timer states to prevent the calling task from migrating to -another CPU. It does so to prevent the task from writing to the -incorrect per-CPU GIC distributor registers. - -On -rt kernels, it's possible to maintain the same guarantee with the -use of migrate_{disable,enable}(), with the added benefit that the -migrate-disabled region is preemptible. Update -kvm_arch_vcpu_ioctl_run() to do so. - -Cc: Christoffer Dall <christoffer.dall@linaro.org> -Reported-by: Manish Jaggi <Manish.Jaggi@caviumnetworks.com> -Signed-off-by: Josh Cartwright <joshc@ni.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm64/kvm/arm.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c -index 7f06ba76698d..f9318256d6fb 100644 ---- a/arch/arm64/kvm/arm.c -+++ b/arch/arm64/kvm/arm.c -@@ -737,7 +737,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) - * involves poking the GIC, which must be done in a - * non-preemptible context. - */ -- preempt_disable(); -+ migrate_disable(); - - kvm_pmu_flush_hwstate(vcpu); - -@@ -786,7 +786,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) - kvm_timer_sync_user(vcpu); - kvm_vgic_sync_hwstate(vcpu); - local_irq_enable(); -- preempt_enable(); -+ migrate_enable(); - continue; - } - -@@ -858,7 +858,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) - /* Exit types that need handling before we can be preempted */ - handle_exit_early(vcpu, ret); - -- preempt_enable(); -+ migrate_enable(); - - /* - * The ARMv8 architecture doesn't give the hypervisor --- -2.19.1 - diff --git a/features/rt/PCI-hv-Use-tasklet_disable_in_atomic.patch b/features/rt/PCI-hv-Use-tasklet_disable_in_atomic.patch deleted file mode 100644 index 497e17e0..00000000 --- a/features/rt/PCI-hv-Use-tasklet_disable_in_atomic.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 9fc84c65954200bfb07bc299f48f8fed7905ba92 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:15 +0100 -Subject: [PATCH 052/191] PCI: hv: Use tasklet_disable_in_atomic() - -The hv_compose_msi_msg() callback in irq_chip::irq_compose_msi_msg is -invoked via irq_chip_compose_msi_msg(), which itself is always invoked from -atomic contexts from the guts of the interrupt core code. - -There is no way to change this w/o rewriting the whole driver, so use -tasklet_disable_in_atomic() which allows to make tasklet_disable() -sleepable once the remaining atomic users are addressed. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: "K. Y. Srinivasan" <kys@microsoft.com> -Cc: Haiyang Zhang <haiyangz@microsoft.com> -Cc: Stephen Hemminger <sthemmin@microsoft.com> -Cc: Wei Liu <wei.liu@kernel.org> -Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> -Cc: Rob Herring <robh@kernel.org> -Cc: Bjorn Helgaas <bhelgaas@google.com> -Cc: linux-hyperv@vger.kernel.org -Cc: linux-pci@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/pci/controller/pci-hyperv.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c -index 27a17a1e4a7c..a313708bcf75 100644 ---- a/drivers/pci/controller/pci-hyperv.c -+++ b/drivers/pci/controller/pci-hyperv.c -@@ -1458,7 +1458,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) - * Prevents hv_pci_onchannelcallback() from running concurrently - * in the tasklet. - */ -- tasklet_disable(&channel->callback_event); -+ tasklet_disable_in_atomic(&channel->callback_event); - - /* - * Since this function is called with IRQ locks held, can't --- -2.19.1 - diff --git a/features/rt/POWERPC-Allow-to-enable-RT.patch b/features/rt/POWERPC-Allow-to-enable-RT.patch deleted file mode 100644 index b0222f0a..00000000 --- a/features/rt/POWERPC-Allow-to-enable-RT.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 76fabe2ab5dd6e98cc51f7289944552db0f5480e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 11 Oct 2019 13:14:41 +0200 -Subject: [PATCH 185/191] POWERPC: Allow to enable RT - -Allow to select RT. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/Kconfig | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index bbee9b2f2bc7..a4fe480b4e9d 100644 ---- a/arch/powerpc/Kconfig -+++ b/arch/powerpc/Kconfig -@@ -147,6 +147,7 @@ config PPC - select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX - select ARCH_SUPPORTS_ATOMIC_RMW - select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC32 || PPC_BOOK3S_64 -+ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK - select ARCH_USE_BUILTIN_BSWAP - select ARCH_USE_CMPXCHG_LOCKREF if PPC64 - select ARCH_USE_QUEUED_RWLOCKS if PPC_QUEUED_SPINLOCKS -@@ -240,6 +241,7 @@ config PPC - select HAVE_SYSCALL_TRACEPOINTS - select HAVE_VIRT_CPU_ACCOUNTING - select HAVE_IRQ_TIME_ACCOUNTING -+ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM - select HAVE_RSEQ - select IOMMU_HELPER if PPC64 - select IRQ_DOMAIN --- -2.19.1 - diff --git a/features/rt/arch-arm64-Add-lazy-preempt-support.patch b/features/rt/arch-arm64-Add-lazy-preempt-support.patch deleted file mode 100644 index cc7a56d7..00000000 --- a/features/rt/arch-arm64-Add-lazy-preempt-support.patch +++ /dev/null @@ -1,170 +0,0 @@ -From f4aa6daf2286c2e06200d7909bb812c7ceb09e69 Mon Sep 17 00:00:00 2001 -From: Anders Roxell <anders.roxell@linaro.org> -Date: Thu, 14 May 2015 17:52:17 +0200 -Subject: [PATCH 168/191] arch/arm64: Add lazy preempt support - -arm64 is missing support for PREEMPT_RT. The main feature which is -lacking is support for lazy preemption. The arch-specific entry code, -thread information structure definitions, and associated data tables -have to be extended to provide this support. Then the Kconfig file has -to be extended to indicate the support is available, and also to -indicate that support for full RT preemption is now available. - -Signed-off-by: Anders Roxell <anders.roxell@linaro.org> ---- - arch/arm64/Kconfig | 1 + - arch/arm64/include/asm/preempt.h | 25 ++++++++++++++++++++++++- - arch/arm64/include/asm/thread_info.h | 8 +++++++- - arch/arm64/kernel/asm-offsets.c | 1 + - arch/arm64/kernel/entry.S | 13 +++++++++++-- - arch/arm64/kernel/signal.c | 2 +- - 6 files changed, 45 insertions(+), 5 deletions(-) - -diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 5656e7aacd69..93a4dd767825 100644 ---- a/arch/arm64/Kconfig -+++ b/arch/arm64/Kconfig -@@ -182,6 +182,7 @@ config ARM64 - select HAVE_PERF_REGS - select HAVE_PERF_USER_STACK_DUMP - select HAVE_REGS_AND_STACK_ACCESS_API -+ select HAVE_PREEMPT_LAZY - select HAVE_FUNCTION_ARG_ACCESS_API - select HAVE_FUTEX_CMPXCHG if FUTEX - select MMU_GATHER_RCU_TABLE_FREE -diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h -index f06a23898540..994f997b1572 100644 ---- a/arch/arm64/include/asm/preempt.h -+++ b/arch/arm64/include/asm/preempt.h -@@ -70,13 +70,36 @@ static inline bool __preempt_count_dec_and_test(void) - * interrupt occurring between the non-atomic READ_ONCE/WRITE_ONCE - * pair. - */ -- return !pc || !READ_ONCE(ti->preempt_count); -+ 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); -+#else -+ return false; -+#endif - } - - static inline bool should_resched(int preempt_offset) - { -+#ifdef CONFIG_PREEMPT_LAZY -+ u64 pc = READ_ONCE(current_thread_info()->preempt_count); -+ if (pc == preempt_offset) -+ return true; -+ -+ if ((pc & ~PREEMPT_NEED_RESCHED) != preempt_offset) -+ return false; -+ -+ if (current_thread_info()->preempt_lazy_count) -+ return false; -+ return test_thread_flag(TIF_NEED_RESCHED_LAZY); -+#else - u64 pc = READ_ONCE(current_thread_info()->preempt_count); - return pc == preempt_offset; -+#endif - } - - #ifdef CONFIG_PREEMPTION -diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h -index 9f4e3b266f21..d3fa570c7235 100644 ---- a/arch/arm64/include/asm/thread_info.h -+++ b/arch/arm64/include/asm/thread_info.h -@@ -26,6 +26,7 @@ struct thread_info { - #ifdef CONFIG_ARM64_SW_TTBR0_PAN - u64 ttbr0; /* saved TTBR0_EL1 */ - #endif -+ int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ - union { - u64 preempt_count; /* 0 => preemptible, <0 => bug */ - struct { -@@ -65,6 +66,7 @@ void arch_release_task_struct(struct task_struct *tsk); - #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ - #define TIF_MTE_ASYNC_FAULT 5 /* MTE Asynchronous Tag Check Fault */ - #define TIF_NOTIFY_SIGNAL 6 /* signal notifications exist */ -+#define TIF_NEED_RESCHED_LAZY 7 - #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ - #define TIF_SYSCALL_AUDIT 9 /* syscall auditing */ - #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ -@@ -95,8 +97,10 @@ void arch_release_task_struct(struct task_struct *tsk); - #define _TIF_SVE (1 << TIF_SVE) - #define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT) - #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) -+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) - --#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ -+#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY | \ -+ _TIF_SIGPENDING | \ - _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ - _TIF_UPROBE | _TIF_MTE_ASYNC_FAULT | \ - _TIF_NOTIFY_SIGNAL) -@@ -105,6 +109,8 @@ void arch_release_task_struct(struct task_struct *tsk); - _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ - _TIF_SYSCALL_EMU) - -+#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) -+ - #ifdef CONFIG_SHADOW_CALL_STACK - #define INIT_SCS \ - .scs_base = init_shadow_call_stack, \ -diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c -index a36e2fc330d4..b94354a3af96 100644 ---- a/arch/arm64/kernel/asm-offsets.c -+++ b/arch/arm64/kernel/asm-offsets.c -@@ -30,6 +30,7 @@ int main(void) - BLANK(); - DEFINE(TSK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags)); - DEFINE(TSK_TI_PREEMPT, offsetof(struct task_struct, thread_info.preempt_count)); -+ DEFINE(TSK_TI_PREEMPT_LAZY, offsetof(struct task_struct, thread_info.preempt_lazy_count)); - #ifdef CONFIG_ARM64_SW_TTBR0_PAN - DEFINE(TSK_TI_TTBR0, offsetof(struct task_struct, thread_info.ttbr0)); - #endif -diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S -index a31a0a713c85..63e1ad8c2ea8 100644 ---- a/arch/arm64/kernel/entry.S -+++ b/arch/arm64/kernel/entry.S -@@ -678,9 +678,18 @@ alternative_if ARM64_HAS_IRQ_PRIO_MASKING - mrs x0, daif - orr x24, x24, x0 - alternative_else_nop_endif -- cbnz x24, 1f // preempt count != 0 || NMI return path -- bl arm64_preempt_schedule_irq // irq en/disable is done inside -+ -+ 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 -+ -+ ldr x0, [tsk, #TSK_TI_FLAGS] // get flags -+ tbz x0, #TIF_NEED_RESCHED_LAZY, 2f // needs rescheduling? - 1: -+ bl arm64_preempt_schedule_irq // irq en/disable is done inside -+2: - #endif - - mov x0, sp -diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c -index 6237486ff6bb..ab411f336c39 100644 ---- a/arch/arm64/kernel/signal.c -+++ b/arch/arm64/kernel/signal.c -@@ -915,7 +915,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, - unsigned long thread_flags) - { - do { -- if (thread_flags & _TIF_NEED_RESCHED) { -+ if (thread_flags & _TIF_NEED_RESCHED_MASK) { - /* Unmask Debug and SError for the next task */ - local_daif_restore(DAIF_PROCCTX_NOIRQ); - --- -2.19.1 - diff --git a/features/rt/arm-Add-support-for-lazy-preemption.patch b/features/rt/arm-Add-support-for-lazy-preemption.patch deleted file mode 100644 index b6e2718c..00000000 --- a/features/rt/arm-Add-support-for-lazy-preemption.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 71f7a0c901c01218f119d2e16cb22e1069a61900 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 31 Oct 2012 12:04:11 +0100 -Subject: [PATCH 166/191] arm: Add support for lazy preemption - -Implement the arm pieces for lazy preempt. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/arm/Kconfig | 1 + - arch/arm/include/asm/thread_info.h | 6 +++++- - arch/arm/kernel/asm-offsets.c | 1 + - arch/arm/kernel/entry-armv.S | 19 ++++++++++++++++--- - arch/arm/kernel/signal.c | 3 ++- - 5 files changed, 25 insertions(+), 5 deletions(-) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 5da96f5df48f..5179eb3a35d5 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -107,6 +107,7 @@ config ARM - select HAVE_PERF_EVENTS - select HAVE_PERF_REGS - select HAVE_PERF_USER_STACK_DUMP -+ select HAVE_PREEMPT_LAZY - select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE - select HAVE_REGS_AND_STACK_ACCESS_API - select HAVE_RSEQ -diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h -index 70d4cbc49ae1..b86418b4dfef 100644 ---- a/arch/arm/include/asm/thread_info.h -+++ b/arch/arm/include/asm/thread_info.h -@@ -54,6 +54,7 @@ struct cpu_context_save { - struct thread_info { - unsigned long flags; /* low level flags */ - int preempt_count; /* 0 => preemptable, <0 => bug */ -+ int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ - mm_segment_t addr_limit; /* address limit */ - struct task_struct *task; /* main task structure */ - __u32 cpu; /* cpu */ -@@ -146,6 +147,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, - #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ - #define TIF_SECCOMP 7 /* seccomp syscall filtering active */ - #define TIF_NOTIFY_SIGNAL 8 /* signal notifications exist */ -+#define TIF_NEED_RESCHED_LAZY 9 - - #define TIF_USING_IWMMXT 17 - #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ -@@ -160,6 +162,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, - #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) - #define _TIF_SECCOMP (1 << TIF_SECCOMP) - #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) -+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) - #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) - - /* Checks for any syscall work in entry-common.S */ -@@ -169,7 +172,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, - /* - * Change these and you break ASM code in entry-common.S - */ --#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ -+#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY | \ -+ _TIF_SIGPENDING | \ - _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ - _TIF_NOTIFY_SIGNAL) - -diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c -index be8050b0c3df..884e40a525ce 100644 ---- a/arch/arm/kernel/asm-offsets.c -+++ b/arch/arm/kernel/asm-offsets.c -@@ -42,6 +42,7 @@ int main(void) - BLANK(); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); -+ DEFINE(TI_PREEMPT_LAZY, offsetof(struct thread_info, preempt_lazy_count)); - DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); -diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S -index 0ea8529a4872..fa0d155d21b3 100644 ---- a/arch/arm/kernel/entry-armv.S -+++ b/arch/arm/kernel/entry-armv.S -@@ -206,11 +206,18 @@ __irq_svc: - - #ifdef CONFIG_PREEMPTION - ldr r8, [tsk, #TI_PREEMPT] @ get preempt count -- ldr r0, [tsk, #TI_FLAGS] @ get flags - teq r8, #0 @ if preempt count != 0 -+ bne 1f @ return from exeption -+ ldr r0, [tsk, #TI_FLAGS] @ get flags -+ tst r0, #_TIF_NEED_RESCHED @ if NEED_RESCHED is set -+ blne svc_preempt @ preempt! -+ -+ ldr r8, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count -+ teq r8, #0 @ if preempt lazy count != 0 - movne r0, #0 @ force flags to 0 -- tst r0, #_TIF_NEED_RESCHED -+ tst r0, #_TIF_NEED_RESCHED_LAZY - blne svc_preempt -+1: - #endif - - svc_exit r5, irq = 1 @ return from exception -@@ -225,8 +232,14 @@ svc_preempt: - 1: bl preempt_schedule_irq @ irq en/disable is done inside - ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS - tst r0, #_TIF_NEED_RESCHED -+ bne 1b -+ tst r0, #_TIF_NEED_RESCHED_LAZY - reteq r8 @ go again -- b 1b -+ ldr r0, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count -+ teq r0, #0 @ if preempt lazy count != 0 -+ beq 1b -+ ret r8 @ go again -+ - #endif - - __und_fault: -diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c -index a3a38d0a4c85..f04ccf19ab1f 100644 ---- a/arch/arm/kernel/signal.c -+++ b/arch/arm/kernel/signal.c -@@ -649,7 +649,8 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) - */ - trace_hardirqs_off(); - do { -- if (likely(thread_flags & _TIF_NEED_RESCHED)) { -+ if (likely(thread_flags & (_TIF_NEED_RESCHED | -+ _TIF_NEED_RESCHED_LAZY))) { - schedule(); - } else { - if (unlikely(!user_mode(regs))) --- -2.19.1 - diff --git a/features/rt/arm64-fpsimd-Delay-freeing-memory-in-fpsimd_flush_th.patch b/features/rt/arm64-fpsimd-Delay-freeing-memory-in-fpsimd_flush_th.patch deleted file mode 100644 index 75e9f204..00000000 --- a/features/rt/arm64-fpsimd-Delay-freeing-memory-in-fpsimd_flush_th.patch +++ /dev/null @@ -1,65 +0,0 @@ -From c17705510939368390130106b37160bb2ff08e1c Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 25 Jul 2018 14:02:38 +0200 -Subject: [PATCH 176/191] arm64: fpsimd: Delay freeing memory in - fpsimd_flush_thread() - -fpsimd_flush_thread() invokes kfree() via sve_free() within a preempt disabled -section which is not working on -RT. - -Delay freeing of memory until preemption is enabled again. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm64/kernel/fpsimd.c | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) - -diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c -index 062b21f30f94..0ea2df6554e5 100644 ---- a/arch/arm64/kernel/fpsimd.c -+++ b/arch/arm64/kernel/fpsimd.c -@@ -226,6 +226,16 @@ static void sve_free(struct task_struct *task) - __sve_free(task); - } - -+static void *sve_free_atomic(struct task_struct *task) -+{ -+ void *sve_state = task->thread.sve_state; -+ -+ WARN_ON(test_tsk_thread_flag(task, TIF_SVE)); -+ -+ task->thread.sve_state = NULL; -+ return sve_state; -+} -+ - /* - * TIF_SVE controls whether a task can use SVE without trapping while - * in userspace, and also the way a task's FPSIMD/SVE state is stored -@@ -1022,6 +1032,7 @@ void fpsimd_thread_switch(struct task_struct *next) - void fpsimd_flush_thread(void) - { - int vl, supported_vl; -+ void *mem = NULL; - - if (!system_supports_fpsimd()) - return; -@@ -1034,7 +1045,7 @@ void fpsimd_flush_thread(void) - - if (system_supports_sve()) { - clear_thread_flag(TIF_SVE); -- sve_free(current); -+ mem = sve_free_atomic(current); - - /* - * Reset the task vector length as required. -@@ -1068,6 +1079,7 @@ void fpsimd_flush_thread(void) - } - - put_cpu_fpsimd_context(); -+ kfree(mem); - } - - /* --- -2.19.1 - diff --git a/features/rt/ath9k-Use-tasklet_disable_in_atomic.patch b/features/rt/ath9k-Use-tasklet_disable_in_atomic.patch deleted file mode 100644 index d14560b6..00000000 --- a/features/rt/ath9k-Use-tasklet_disable_in_atomic.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0fdf02e085f667a14612fe8555ffffcdc7b3044e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:13 +0100 -Subject: [PATCH 050/191] ath9k: Use tasklet_disable_in_atomic() - -All callers of ath9k_beacon_ensure_primary_slot() are preemptible / -acquire a mutex except for this callchain: - - spin_lock_bh(&sc->sc_pcu_lock); - ath_complete_reset() - -> ath9k_calculate_summary_state() - -> ath9k_beacon_ensure_primary_slot() - -It's unclear how that can be distangled, so use tasklet_disable_in_atomic() -for now. This allows tasklet_disable() to become sleepable once the -remaining atomic users are cleaned up. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: ath9k-devel@qca.qualcomm.com -Cc: Kalle Valo <kvalo@codeaurora.org> -Cc: "David S. Miller" <davem@davemloft.net> -Cc: Jakub Kicinski <kuba@kernel.org> -Cc: linux-wireless@vger.kernel.org -Cc: netdev@vger.kernel.org -Acked-by: Kalle Valo <kvalo@codeaurora.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/net/wireless/ath/ath9k/beacon.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c -index 71e2ada86793..72e2e71aac0e 100644 ---- a/drivers/net/wireless/ath/ath9k/beacon.c -+++ b/drivers/net/wireless/ath/ath9k/beacon.c -@@ -251,7 +251,7 @@ void ath9k_beacon_ensure_primary_slot(struct ath_softc *sc) - int first_slot = ATH_BCBUF; - int slot; - -- tasklet_disable(&sc->bcon_tasklet); -+ tasklet_disable_in_atomic(&sc->bcon_tasklet); - - /* Find first taken slot. */ - for (slot = 0; slot < ATH_BCBUF; slot++) { --- -2.19.1 - diff --git a/features/rt/atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch b/features/rt/atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch deleted file mode 100644 index 475b8b02..00000000 --- a/features/rt/atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3a6d1acf6c1ff722cb9479fba99a7ea0c6c50ee7 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:14 +0100 -Subject: [PATCH 051/191] atm: eni: Use tasklet_disable_in_atomic() in the - send() callback - -The atmdev_ops::send callback which calls tasklet_disable() is invoked with -bottom halfs disabled from net_device_ops::ndo_start_xmit(). All other -invocations of tasklet_disable() in this driver happen in preemptible -context. - -Change the send() call to use tasklet_disable_in_atomic() which allows -tasklet_disable() to be made sleepable once the remaining atomic context -usage sites are cleaned up. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: Chas Williams <3chas3@gmail.com> -Cc: linux-atm-general@lists.sourceforge.net -Cc: netdev@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/atm/eni.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c -index b574cce98dc3..422753d52244 100644 ---- a/drivers/atm/eni.c -+++ b/drivers/atm/eni.c -@@ -2054,7 +2054,7 @@ static int eni_send(struct atm_vcc *vcc,struct sk_buff *skb) - } - submitted++; - ATM_SKB(skb)->vcc = vcc; -- tasklet_disable(&ENI_DEV(vcc->dev)->task); -+ tasklet_disable_in_atomic(&ENI_DEV(vcc->dev)->task); - res = do_tx(skb); - tasklet_enable(&ENI_DEV(vcc->dev)->task); - if (res == enq_ok) return 0; --- -2.19.1 - diff --git a/features/rt/block-mq-do-not-invoke-preempt_disable.patch b/features/rt/block-mq-do-not-invoke-preempt_disable.patch deleted file mode 100644 index c869f8a1..00000000 --- a/features/rt/block-mq-do-not-invoke-preempt_disable.patch +++ /dev/null @@ -1,39 +0,0 @@ -From daef692486de5a4273e1fdff8121fca46992bc5b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 134/191] block/mq: do not invoke preempt_disable() - -preempt_disable() and get_cpu() don't play well together with the sleeping -locks it tries to allocate later. -It seems to be enough to replace it with get_cpu_light() and migrate_disable(). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - block/blk-mq.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/block/blk-mq.c b/block/blk-mq.c -index d4d7c1caa439..2003865f725b 100644 ---- a/block/blk-mq.c -+++ b/block/blk-mq.c -@@ -1560,14 +1560,14 @@ static void __blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async, - return; - - if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { -- int cpu = get_cpu(); -+ int cpu = get_cpu_light(); - if (cpumask_test_cpu(cpu, hctx->cpumask)) { - __blk_mq_run_hw_queue(hctx); -- put_cpu(); -+ put_cpu_light(); - return; - } - -- put_cpu(); -+ put_cpu_light(); - } - - kblockd_mod_delayed_work_on(blk_mq_hctx_next_cpu(hctx), &hctx->run_work, --- -2.19.1 - diff --git a/features/rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch b/features/rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch deleted file mode 100644 index a215e848..00000000 --- a/features/rt/cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 79683d22afc9a06abcf0b901d55a36b471da6a43 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 3 Jul 2018 18:19:48 +0200 -Subject: [PATCH 035/191] cgroup: use irqsave in cgroup_rstat_flush_locked() - -All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock -either with spin_lock_irq() or spin_lock_irqsave(). -cgroup_rstat_flush_locked() itself acquires cgroup_rstat_cpu_lock which -is a raw_spin_lock. This lock is also acquired in cgroup_rstat_updated() -in IRQ context and therefore requires _irqsave() locking suffix in -cgroup_rstat_flush_locked(). -Since there is no difference between spin_lock_t and raw_spin_lock_t -on !RT lockdep does not complain here. On RT lockdep complains because -the interrupts were not disabled here and a deadlock is possible. - -Acquire the raw_spin_lock_t with disabled interrupts. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/cgroup/rstat.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c -index d51175cedfca..b424f3157b34 100644 ---- a/kernel/cgroup/rstat.c -+++ b/kernel/cgroup/rstat.c -@@ -149,8 +149,9 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) - raw_spinlock_t *cpu_lock = per_cpu_ptr(&cgroup_rstat_cpu_lock, - cpu); - struct cgroup *pos = NULL; -+ unsigned long flags; - -- raw_spin_lock(cpu_lock); -+ raw_spin_lock_irqsave(cpu_lock, flags); - while ((pos = cgroup_rstat_cpu_pop_updated(pos, cgrp, cpu))) { - struct cgroup_subsys_state *css; - -@@ -162,7 +163,7 @@ static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) - css->ss->css_rstat_flush(css, cpu); - rcu_read_unlock(); - } -- raw_spin_unlock(cpu_lock); -+ raw_spin_unlock_irqrestore(cpu_lock, flags); - - /* if @may_sleep, play nice and yield if necessary */ - if (may_sleep && (need_resched() || --- -2.19.1 - diff --git a/features/rt/console-add-write_atomic-interface.patch b/features/rt/console-add-write_atomic-interface.patch deleted file mode 100644 index 3495b552..00000000 --- a/features/rt/console-add-write_atomic-interface.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 92323b9fa8b3aad4e8ba5e08e23fdf18e9ad1545 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:01 +0106 -Subject: [PATCH 024/191] console: add write_atomic interface - -Add a write_atomic() callback to the console. This is an optional -function for console drivers. The function must be atomic (including -NMI safe) for writing to the console. - -Console drivers must still implement the write() callback. The -write_atomic() callback will only be used in special situations, -such as when the kernel panics. - -Creating an NMI safe write_atomic() that must synchronize with -write() requires a careful implementation of the console driver. To -aid with the implementation, a set of console_atomic_*() functions -are provided: - - void console_atomic_lock(unsigned int *flags); - void console_atomic_unlock(unsigned int flags); - -These functions synchronize using a processor-reentrant spinlock -(called a cpulock). - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/console.h | 4 ++ - kernel/printk/printk.c | 100 ++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 104 insertions(+) - -diff --git a/include/linux/console.h b/include/linux/console.h -index 20874db50bc8..919c8d43d986 100644 ---- a/include/linux/console.h -+++ b/include/linux/console.h -@@ -140,6 +140,7 @@ static inline int con_debug_leave(void) - struct console { - char name[16]; - void (*write)(struct console *, const char *, unsigned); -+ void (*write_atomic)(struct console *co, const char *s, unsigned int count); - int (*read)(struct console *, char *, unsigned); - struct tty_driver *(*device)(struct console *, int *); - void (*unblank)(void); -@@ -229,4 +230,7 @@ extern void console_init(void); - void dummycon_register_output_notifier(struct notifier_block *nb); - void dummycon_unregister_output_notifier(struct notifier_block *nb); - -+extern void console_atomic_lock(unsigned int *flags); -+extern void console_atomic_unlock(unsigned int flags); -+ - #endif /* _LINUX_CONSOLE_H */ -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 3e0b9bf28e12..5af6f757818f 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3546,3 +3546,103 @@ void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - EXPORT_SYMBOL_GPL(kmsg_dump_rewind); - - #endif -+ -+struct prb_cpulock { -+ atomic_t owner; -+ unsigned long __percpu *irqflags; -+}; -+ -+#define DECLARE_STATIC_PRINTKRB_CPULOCK(name) \ -+static DEFINE_PER_CPU(unsigned long, _##name##_percpu_irqflags); \ -+static struct prb_cpulock name = { \ -+ .owner = ATOMIC_INIT(-1), \ -+ .irqflags = &_##name##_percpu_irqflags, \ -+} -+ -+static bool __prb_trylock(struct prb_cpulock *cpu_lock, -+ unsigned int *cpu_store) -+{ -+ unsigned long *flags; -+ unsigned int cpu; -+ -+ cpu = get_cpu(); -+ -+ *cpu_store = atomic_read(&cpu_lock->owner); -+ /* memory barrier to ensure the current lock owner is visible */ -+ smp_rmb(); -+ if (*cpu_store == -1) { -+ flags = per_cpu_ptr(cpu_lock->irqflags, cpu); -+ local_irq_save(*flags); -+ if (atomic_try_cmpxchg_acquire(&cpu_lock->owner, -+ cpu_store, cpu)) { -+ return true; -+ } -+ local_irq_restore(*flags); -+ } else if (*cpu_store == cpu) { -+ return true; -+ } -+ -+ put_cpu(); -+ return false; -+} -+ -+/* -+ * prb_lock: Perform a processor-reentrant spin lock. -+ * @cpu_lock: A pointer to the lock object. -+ * @cpu_store: A "flags" pointer to store lock status information. -+ * -+ * If no processor has the lock, the calling processor takes the lock and -+ * becomes the owner. If the calling processor is already the owner of the -+ * lock, this function succeeds immediately. If lock is locked by another -+ * processor, this function spins until the calling processor becomes the -+ * owner. -+ * -+ * It is safe to call this function from any context and state. -+ */ -+static void prb_lock(struct prb_cpulock *cpu_lock, unsigned int *cpu_store) -+{ -+ for (;;) { -+ if (__prb_trylock(cpu_lock, cpu_store)) -+ break; -+ cpu_relax(); -+ } -+} -+ -+/* -+ * prb_unlock: Perform a processor-reentrant spin unlock. -+ * @cpu_lock: A pointer to the lock object. -+ * @cpu_store: A "flags" object storing lock status information. -+ * -+ * Release the lock. The calling processor must be the owner of the lock. -+ * -+ * It is safe to call this function from any context and state. -+ */ -+static void prb_unlock(struct prb_cpulock *cpu_lock, unsigned int cpu_store) -+{ -+ unsigned long *flags; -+ unsigned int cpu; -+ -+ cpu = atomic_read(&cpu_lock->owner); -+ atomic_set_release(&cpu_lock->owner, cpu_store); -+ -+ if (cpu_store == -1) { -+ flags = per_cpu_ptr(cpu_lock->irqflags, cpu); -+ local_irq_restore(*flags); -+ } -+ -+ put_cpu(); -+} -+ -+DECLARE_STATIC_PRINTKRB_CPULOCK(printk_cpulock); -+ -+void console_atomic_lock(unsigned int *flags) -+{ -+ prb_lock(&printk_cpulock, flags); -+} -+EXPORT_SYMBOL(console_atomic_lock); -+ -+void console_atomic_unlock(unsigned int flags) -+{ -+ prb_unlock(&printk_cpulock, flags); -+} -+EXPORT_SYMBOL(console_atomic_unlock); --- -2.19.1 - diff --git a/features/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch b/features/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch deleted file mode 100644 index 115f4072..00000000 --- a/features/rt/cpuset-Convert-callback_lock-to-raw_spinlock_t.patch +++ /dev/null @@ -1,328 +0,0 @@ -From f2031242ce940802f8703826b47dfd2e1290f97c Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <efault@gmx.de> -Date: Sun, 8 Jan 2017 09:32:25 +0100 -Subject: [PATCH 160/191] cpuset: Convert callback_lock to raw_spinlock_t - -The two commits below add up to a cpuset might_sleep() splat for RT: - -8447a0fee974 cpuset: convert callback_mutex to a spinlock -344736f29b35 cpuset: simplify cpuset_node_allowed API - -BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:995 -in_atomic(): 0, irqs_disabled(): 1, pid: 11718, name: cset -CPU: 135 PID: 11718 Comm: cset Tainted: G E 4.10.0-rt1-rt #4 -Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRHSXSD1.86B.0056.R01.1409242327 09/24/2014 -Call Trace: - ? dump_stack+0x5c/0x81 - ? ___might_sleep+0xf4/0x170 - ? rt_spin_lock+0x1c/0x50 - ? __cpuset_node_allowed+0x66/0xc0 - ? ___slab_alloc+0x390/0x570 <disables IRQs> - ? anon_vma_fork+0x8f/0x140 - ? copy_page_range+0x6cf/0xb00 - ? anon_vma_fork+0x8f/0x140 - ? __slab_alloc.isra.74+0x5a/0x81 - ? anon_vma_fork+0x8f/0x140 - ? kmem_cache_alloc+0x1b5/0x1f0 - ? anon_vma_fork+0x8f/0x140 - ? copy_process.part.35+0x1670/0x1ee0 - ? _do_fork+0xdd/0x3f0 - ? _do_fork+0xdd/0x3f0 - ? do_syscall_64+0x61/0x170 - ? entry_SYSCALL64_slow_path+0x25/0x25 - -The later ensured that a NUMA box WILL take callback_lock in atomic -context by removing the allocator and reclaim path __GFP_HARDWALL -usage which prevented such contexts from taking callback_mutex. - -One option would be to reinstate __GFP_HARDWALL protections for -RT, however, as the 8447a0fee974 changelog states: - -The callback_mutex is only used to synchronize reads/updates of cpusets' -flags and cpu/node masks. These operations should always proceed fast so -there's no reason why we can't use a spinlock instead of the mutex. - -Cc: stable-rt@vger.kernel.org -Signed-off-by: Mike Galbraith <efault@gmx.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/cgroup/cpuset.c | 70 +++++++++++++++++++++--------------------- - 1 file changed, 35 insertions(+), 35 deletions(-) - -diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c -index 5258b68153e0..fb8715c1edfc 100644 ---- a/kernel/cgroup/cpuset.c -+++ b/kernel/cgroup/cpuset.c -@@ -345,7 +345,7 @@ void cpuset_read_unlock(void) - percpu_up_read(&cpuset_rwsem); - } - --static DEFINE_SPINLOCK(callback_lock); -+static DEFINE_RAW_SPINLOCK(callback_lock); - - static struct workqueue_struct *cpuset_migrate_mm_wq; - -@@ -1280,7 +1280,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd, - * Newly added CPUs will be removed from effective_cpus and - * newly deleted ones will be added back to effective_cpus. - */ -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - if (adding) { - cpumask_or(parent->subparts_cpus, - parent->subparts_cpus, tmp->addmask); -@@ -1299,7 +1299,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd, - } - - parent->nr_subparts_cpus = cpumask_weight(parent->subparts_cpus); -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - return cmd == partcmd_update; - } -@@ -1404,7 +1404,7 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp) - continue; - rcu_read_unlock(); - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - - cpumask_copy(cp->effective_cpus, tmp->new_cpus); - if (cp->nr_subparts_cpus && -@@ -1435,7 +1435,7 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp) - = cpumask_weight(cp->subparts_cpus); - } - } -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - WARN_ON(!is_in_v2_mode() && - !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); -@@ -1553,7 +1553,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, - return -EINVAL; - } - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cpumask_copy(cs->cpus_allowed, trialcs->cpus_allowed); - - /* -@@ -1564,7 +1564,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, - cs->cpus_allowed); - cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus); - } -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - update_cpumasks_hier(cs, &tmp); - -@@ -1758,9 +1758,9 @@ static void update_nodemasks_hier(struct cpuset *cs, nodemask_t *new_mems) - continue; - rcu_read_unlock(); - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cp->effective_mems = *new_mems; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - WARN_ON(!is_in_v2_mode() && - !nodes_equal(cp->mems_allowed, cp->effective_mems)); -@@ -1828,9 +1828,9 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, - if (retval < 0) - goto done; - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cs->mems_allowed = trialcs->mems_allowed; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - /* use trialcs->mems_allowed as a temp variable */ - update_nodemasks_hier(cs, &trialcs->mems_allowed); -@@ -1921,9 +1921,9 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, - spread_flag_changed = ((is_spread_slab(cs) != is_spread_slab(trialcs)) - || (is_spread_page(cs) != is_spread_page(trialcs))); - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cs->flags = trialcs->flags; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - if (!cpumask_empty(trialcs->cpus_allowed) && balance_flag_changed) - rebuild_sched_domains_locked(); -@@ -2432,7 +2432,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) - cpuset_filetype_t type = seq_cft(sf)->private; - int ret = 0; - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - - switch (type) { - case FILE_CPULIST: -@@ -2454,7 +2454,7 @@ static int cpuset_common_seq_show(struct seq_file *sf, void *v) - ret = -EINVAL; - } - -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - return ret; - } - -@@ -2767,14 +2767,14 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) - - cpuset_inc(); - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - if (is_in_v2_mode()) { - cpumask_copy(cs->effective_cpus, parent->effective_cpus); - cs->effective_mems = parent->effective_mems; - cs->use_parent_ecpus = true; - parent->child_ecpus_count++; - } -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags)) - goto out_unlock; -@@ -2801,12 +2801,12 @@ static int cpuset_css_online(struct cgroup_subsys_state *css) - } - rcu_read_unlock(); - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cs->mems_allowed = parent->mems_allowed; - cs->effective_mems = parent->mems_allowed; - cpumask_copy(cs->cpus_allowed, parent->cpus_allowed); - cpumask_copy(cs->effective_cpus, parent->cpus_allowed); -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - out_unlock: - percpu_up_write(&cpuset_rwsem); - put_online_cpus(); -@@ -2862,7 +2862,7 @@ static void cpuset_css_free(struct cgroup_subsys_state *css) - static void cpuset_bind(struct cgroup_subsys_state *root_css) - { - percpu_down_write(&cpuset_rwsem); -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - - if (is_in_v2_mode()) { - cpumask_copy(top_cpuset.cpus_allowed, cpu_possible_mask); -@@ -2873,7 +2873,7 @@ static void cpuset_bind(struct cgroup_subsys_state *root_css) - top_cpuset.mems_allowed = top_cpuset.effective_mems; - } - -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - percpu_up_write(&cpuset_rwsem); - } - -@@ -2970,12 +2970,12 @@ hotplug_update_tasks_legacy(struct cpuset *cs, - { - bool is_empty; - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cpumask_copy(cs->cpus_allowed, new_cpus); - cpumask_copy(cs->effective_cpus, new_cpus); - cs->mems_allowed = *new_mems; - cs->effective_mems = *new_mems; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - /* - * Don't call update_tasks_cpumask() if the cpuset becomes empty, -@@ -3012,10 +3012,10 @@ hotplug_update_tasks(struct cpuset *cs, - if (nodes_empty(*new_mems)) - *new_mems = parent_cs(cs)->effective_mems; - -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - cpumask_copy(cs->effective_cpus, new_cpus); - cs->effective_mems = *new_mems; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - - if (cpus_updated) - update_tasks_cpumask(cs); -@@ -3170,7 +3170,7 @@ static void cpuset_hotplug_workfn(struct work_struct *work) - - /* synchronize cpus_allowed to cpu_active_mask */ - if (cpus_updated) { -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - if (!on_dfl) - cpumask_copy(top_cpuset.cpus_allowed, &new_cpus); - /* -@@ -3190,17 +3190,17 @@ static void cpuset_hotplug_workfn(struct work_struct *work) - } - } - cpumask_copy(top_cpuset.effective_cpus, &new_cpus); -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - /* we don't mess with cpumasks of tasks in top_cpuset */ - } - - /* synchronize mems_allowed to N_MEMORY */ - if (mems_updated) { -- spin_lock_irq(&callback_lock); -+ raw_spin_lock_irq(&callback_lock); - if (!on_dfl) - top_cpuset.mems_allowed = new_mems; - top_cpuset.effective_mems = new_mems; -- spin_unlock_irq(&callback_lock); -+ raw_spin_unlock_irq(&callback_lock); - update_tasks_nodemask(&top_cpuset); - } - -@@ -3301,11 +3301,11 @@ void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) - { - unsigned long flags; - -- spin_lock_irqsave(&callback_lock, flags); -+ raw_spin_lock_irqsave(&callback_lock, flags); - rcu_read_lock(); - guarantee_online_cpus(task_cs(tsk), pmask); - rcu_read_unlock(); -- spin_unlock_irqrestore(&callback_lock, flags); -+ raw_spin_unlock_irqrestore(&callback_lock, flags); - } - - /** -@@ -3366,11 +3366,11 @@ nodemask_t cpuset_mems_allowed(struct task_struct *tsk) - nodemask_t mask; - unsigned long flags; - -- spin_lock_irqsave(&callback_lock, flags); -+ raw_spin_lock_irqsave(&callback_lock, flags); - rcu_read_lock(); - guarantee_online_mems(task_cs(tsk), &mask); - rcu_read_unlock(); -- spin_unlock_irqrestore(&callback_lock, flags); -+ raw_spin_unlock_irqrestore(&callback_lock, flags); - - return mask; - } -@@ -3462,14 +3462,14 @@ bool __cpuset_node_allowed(int node, gfp_t gfp_mask) - return true; - - /* Not hardwall and node outside mems_allowed: scan up cpusets */ -- spin_lock_irqsave(&callback_lock, flags); -+ raw_spin_lock_irqsave(&callback_lock, flags); - - rcu_read_lock(); - cs = nearest_hardwall_ancestor(task_cs(current)); - allowed = node_isset(node, cs->mems_allowed); - rcu_read_unlock(); - -- spin_unlock_irqrestore(&callback_lock, flags); -+ raw_spin_unlock_irqrestore(&callback_lock, flags); - return allowed; - } - --- -2.19.1 - diff --git a/features/rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch b/features/rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch deleted file mode 100644 index 68cc1e5a..00000000 --- a/features/rt/crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch +++ /dev/null @@ -1,84 +0,0 @@ -From bdce470739405260aab0f96686cd9b15cecde177 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 26 Jul 2018 18:52:00 +0200 -Subject: [PATCH 146/191] crypto: cryptd - add a lock instead - preempt_disable/local_bh_disable - -cryptd has a per-CPU lock which protected with local_bh_disable() and -preempt_disable(). -Add an explicit spin_lock to make the locking context more obvious and -visible to lockdep. Since it is a per-CPU lock, there should be no lock -contention on the actual spinlock. -There is a small race-window where we could be migrated to another CPU -after the cpu_queue has been obtain. This is not a problem because the -actual ressource is protected by the spinlock. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - crypto/cryptd.c | 19 +++++++++---------- - 1 file changed, 9 insertions(+), 10 deletions(-) - -diff --git a/crypto/cryptd.c b/crypto/cryptd.c -index a1bea0f4baa8..5f8ca8c1f59c 100644 ---- a/crypto/cryptd.c -+++ b/crypto/cryptd.c -@@ -36,6 +36,7 @@ static struct workqueue_struct *cryptd_wq; - struct cryptd_cpu_queue { - struct crypto_queue queue; - struct work_struct work; -+ spinlock_t qlock; - }; - - struct cryptd_queue { -@@ -105,6 +106,7 @@ static int cryptd_init_queue(struct cryptd_queue *queue, - cpu_queue = per_cpu_ptr(queue->cpu_queue, cpu); - crypto_init_queue(&cpu_queue->queue, max_cpu_qlen); - INIT_WORK(&cpu_queue->work, cryptd_queue_worker); -+ spin_lock_init(&cpu_queue->qlock); - } - pr_info("cryptd: max_cpu_qlen set to %d\n", max_cpu_qlen); - return 0; -@@ -129,8 +131,10 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, - struct cryptd_cpu_queue *cpu_queue; - refcount_t *refcnt; - -- cpu = get_cpu(); -- cpu_queue = this_cpu_ptr(queue->cpu_queue); -+ cpu_queue = raw_cpu_ptr(queue->cpu_queue); -+ spin_lock_bh(&cpu_queue->qlock); -+ cpu = smp_processor_id(); -+ - err = crypto_enqueue_request(&cpu_queue->queue, request); - - refcnt = crypto_tfm_ctx(request->tfm); -@@ -146,7 +150,7 @@ static int cryptd_enqueue_request(struct cryptd_queue *queue, - refcount_inc(refcnt); - - out_put_cpu: -- put_cpu(); -+ spin_unlock_bh(&cpu_queue->qlock); - - return err; - } -@@ -162,16 +166,11 @@ static void cryptd_queue_worker(struct work_struct *work) - cpu_queue = container_of(work, struct cryptd_cpu_queue, work); - /* - * Only handle one request at a time to avoid hogging crypto workqueue. -- * preempt_disable/enable is used to prevent being preempted by -- * cryptd_enqueue_request(). local_bh_disable/enable is used to prevent -- * cryptd_enqueue_request() being accessed from software interrupts. - */ -- local_bh_disable(); -- preempt_disable(); -+ spin_lock_bh(&cpu_queue->qlock); - backlog = crypto_get_backlog(&cpu_queue->queue); - req = crypto_dequeue_request(&cpu_queue->queue); -- preempt_enable(); -- local_bh_enable(); -+ spin_unlock_bh(&cpu_queue->qlock); - - if (!req) - return; --- -2.19.1 - diff --git a/features/rt/crypto-limit-more-FPU-enabled-sections.patch b/features/rt/crypto-limit-more-FPU-enabled-sections.patch deleted file mode 100644 index b807de7f..00000000 --- a/features/rt/crypto-limit-more-FPU-enabled-sections.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 7773b9611cf2e303a1744ba642f49ba967c24ad0 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 30 Nov 2017 13:40:10 +0100 -Subject: [PATCH 145/191] crypto: limit more FPU-enabled sections -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 -disables preemption. -There are two problems with the way they are used: -- the while loop which processes X bytes may create latency spikes and - should be avoided or limited. -- the cipher-walk-next part may allocate/free memory and may use - kmap_atomic(). - -The whole kernel_fpu_begin()/end() processing isn't probably that cheap. -It most likely makes sense to process as much of those as possible in one -go. The new *_fpu_sched_rt() schedules only if a RT task is pending. - -Probably we should measure the performance those ciphers in pure SW -mode and with this optimisations to see if it makes sense to keep them -for RT. - -This kernel_fpu_resched() makes the code more preemptible which might hurt -performance. - -Cc: stable-rt@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/x86/include/asm/fpu/api.h | 1 + - arch/x86/kernel/fpu/core.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+) - -diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h -index ed33a14188f6..716727dfd1af 100644 ---- a/arch/x86/include/asm/fpu/api.h -+++ b/arch/x86/include/asm/fpu/api.h -@@ -28,6 +28,7 @@ extern void kernel_fpu_begin_mask(unsigned int kfpu_mask); - extern void kernel_fpu_end(void); - extern bool irq_fpu_usable(void); - extern void fpregs_mark_activate(void); -+extern void kernel_fpu_resched(void); - - /* Code that is unaware of kernel_fpu_begin_mask() can use this */ - static inline void kernel_fpu_begin(void) -diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c -index 571220ac8bea..d315d45b64fa 100644 ---- a/arch/x86/kernel/fpu/core.c -+++ b/arch/x86/kernel/fpu/core.c -@@ -159,6 +159,18 @@ void kernel_fpu_end(void) - } - EXPORT_SYMBOL_GPL(kernel_fpu_end); - -+void kernel_fpu_resched(void) -+{ -+ WARN_ON_FPU(!this_cpu_read(in_kernel_fpu)); -+ -+ if (should_resched(PREEMPT_OFFSET)) { -+ kernel_fpu_end(); -+ cond_resched(); -+ kernel_fpu_begin(); -+ } -+} -+EXPORT_SYMBOL_GPL(kernel_fpu_resched); -+ - /* - * Save the FPU state (mark it for reload if necessary): - * --- -2.19.1 - diff --git a/features/rt/debugobjects-Make-RT-aware.patch b/features/rt/debugobjects-Make-RT-aware.patch deleted file mode 100644 index 59a4e281..00000000 --- a/features/rt/debugobjects-Make-RT-aware.patch +++ /dev/null @@ -1,31 +0,0 @@ -From e4cdd4565da1b21cf7b71738d85a794dab064aa5 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 17 Jul 2011 21:41:35 +0200 -Subject: [PATCH 140/191] debugobjects: Make RT aware - -Avoid filling the pool / allocating memory with irqs off(). - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - lib/debugobjects.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/lib/debugobjects.c b/lib/debugobjects.c -index 9e14ae02306b..083882a3cf2f 100644 ---- a/lib/debugobjects.c -+++ b/lib/debugobjects.c -@@ -557,7 +557,10 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack - struct debug_obj *obj; - unsigned long flags; - -- fill_pool(); -+#ifdef CONFIG_PREEMPT_RT -+ if (preempt_count() == 0 && !irqs_disabled()) -+#endif -+ fill_pool(); - - db = get_bucket((unsigned long) addr); - --- -2.19.1 - diff --git a/features/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch b/features/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch deleted file mode 100644 index 4ed6aa46..00000000 --- a/features/rt/drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 66e6d402c94d47b29c4a7f3f5872fee8d2be6ebb Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <umgwanakikbuti@gmail.com> -Date: Thu, 31 Mar 2016 04:08:28 +0200 -Subject: [PATCH 186/191] drivers/block/zram: Replace bit spinlocks with - rtmutex for -rt - -They're nondeterministic, and lead to ___might_sleep() splats in -rt. -OTOH, they're a lot less wasteful than an rtmutex per page. - -Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/block/zram/zram_drv.c | 36 +++++++++++++++++++++++++++++++++++ - drivers/block/zram/zram_drv.h | 1 + - 2 files changed, 37 insertions(+) - -diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c -index cf8deecc39ef..5c7999ebc4e0 100644 ---- a/drivers/block/zram/zram_drv.c -+++ b/drivers/block/zram/zram_drv.c -@@ -59,6 +59,40 @@ static void zram_free_page(struct zram *zram, size_t index); - static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, - u32 index, int offset, struct bio *bio); - -+#ifdef CONFIG_PREEMPT_RT -+static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) -+{ -+ size_t index; -+ -+ for (index = 0; index < num_pages; index++) -+ spin_lock_init(&zram->table[index].lock); -+} -+ -+static int zram_slot_trylock(struct zram *zram, u32 index) -+{ -+ int ret; -+ -+ ret = spin_trylock(&zram->table[index].lock); -+ if (ret) -+ __set_bit(ZRAM_LOCK, &zram->table[index].flags); -+ return ret; -+} -+ -+static void zram_slot_lock(struct zram *zram, u32 index) -+{ -+ spin_lock(&zram->table[index].lock); -+ __set_bit(ZRAM_LOCK, &zram->table[index].flags); -+} -+ -+static void zram_slot_unlock(struct zram *zram, u32 index) -+{ -+ __clear_bit(ZRAM_LOCK, &zram->table[index].flags); -+ spin_unlock(&zram->table[index].lock); -+} -+ -+#else -+ -+static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) { } - - static int zram_slot_trylock(struct zram *zram, u32 index) - { -@@ -74,6 +108,7 @@ static void zram_slot_unlock(struct zram *zram, u32 index) - { - bit_spin_unlock(ZRAM_LOCK, &zram->table[index].flags); - } -+#endif - - static inline bool init_done(struct zram *zram) - { -@@ -1169,6 +1204,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) - - if (!huge_class_size) - huge_class_size = zs_huge_class_size(zram->mem_pool); -+ zram_meta_init_table_locks(zram, num_pages); - return true; - } - -diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h -index 419a7e8281ee..561c7ba1421f 100644 ---- a/drivers/block/zram/zram_drv.h -+++ b/drivers/block/zram/zram_drv.h -@@ -63,6 +63,7 @@ struct zram_table_entry { - unsigned long element; - }; - unsigned long flags; -+ spinlock_t lock; - #ifdef CONFIG_ZRAM_MEMORY_TRACKING - ktime_t ac_time; - #endif --- -2.19.1 - diff --git a/features/rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch b/features/rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch deleted file mode 100644 index 2c1a9fa8..00000000 --- a/features/rt/drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch +++ /dev/null @@ -1,79 +0,0 @@ -From bd74da1edb71b84b90b8f68b9a8d28b0f580b1f0 Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <umgwanakikbuti@gmail.com> -Date: Sat, 27 Feb 2016 09:01:42 +0100 -Subject: [PATCH 156/191] drm/i915: Don't disable interrupts on PREEMPT_RT - during atomic updates - -Commit - 8d7849db3eab7 ("drm/i915: Make sprite updates atomic") - -started disabling interrupts across atomic updates. This breaks on PREEMPT_RT -because within this section the code attempt to acquire spinlock_t locks which -are sleeping locks on PREEMPT_RT. - -According to the comment the interrupts are disabled to avoid random delays and -not required for protection or synchronisation. - -Don't disable interrupts on PREEMPT_RT during atomic updates. - -[bigeasy: drop local locks, commit message] - -Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/gpu/drm/i915/display/intel_sprite.c | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c -index 993543334a1e..cc0dd8a1e420 100644 ---- a/drivers/gpu/drm/i915/display/intel_sprite.c -+++ b/drivers/gpu/drm/i915/display/intel_sprite.c -@@ -127,7 +127,8 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) - "PSR idle timed out 0x%x, atomic update may fail\n", - psr_status); - -- local_irq_disable(); -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ local_irq_disable(); - - crtc->debug.min_vbl = min; - crtc->debug.max_vbl = max; -@@ -152,11 +153,13 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) - break; - } - -- local_irq_enable(); -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ local_irq_enable(); - - timeout = schedule_timeout(timeout); - -- local_irq_disable(); -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ local_irq_disable(); - } - - finish_wait(wq, &wait); -@@ -189,7 +192,8 @@ void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state) - return; - - irq_disable: -- local_irq_disable(); -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ local_irq_disable(); - } - - #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_VBLANK_EVADE) -@@ -268,7 +272,8 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state) - new_crtc_state->uapi.event = NULL; - } - -- local_irq_enable(); -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ local_irq_enable(); - - /* Send VRR Push to terminate Vblank */ - intel_vrr_send_push(new_crtc_state); --- -2.19.1 - diff --git a/features/rt/drm-i915-disable-tracing-on-RT.patch b/features/rt/drm-i915-disable-tracing-on-RT.patch deleted file mode 100644 index 41898919..00000000 --- a/features/rt/drm-i915-disable-tracing-on-RT.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5e250a1f215a8a39bc712c70a8a6215f570e3a9c Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 6 Dec 2018 09:52:20 +0100 -Subject: [PATCH 157/191] drm/i915: disable tracing on -RT - -Luca Abeni reported this: -| BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003 -| CPU: 1 PID: 15203 Comm: kworker/u8:2 Not tainted 4.19.1-rt3 #10 -| Call Trace: -| rt_spin_lock+0x3f/0x50 -| gen6_read32+0x45/0x1d0 [i915] -| g4x_get_vblank_counter+0x36/0x40 [i915] -| trace_event_raw_event_i915_pipe_update_start+0x7d/0xf0 [i915] - -The tracing events use trace_i915_pipe_update_start() among other events -use functions acquire spin locks. A few trace points use -intel_get_crtc_scanline(), others use ->get_vblank_counter() wich also -might acquire a sleeping lock. - -Based on this I don't see any other way than disable trace points on RT. - -Cc: stable-rt@vger.kernel.org -Reported-by: Luca Abeni <lucabe72@gmail.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/gpu/drm/i915/i915_trace.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h -index a4addcc64978..0ba5a0a0fd25 100644 ---- a/drivers/gpu/drm/i915/i915_trace.h -+++ b/drivers/gpu/drm/i915/i915_trace.h -@@ -2,6 +2,10 @@ - #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) - #define _I915_TRACE_H_ - -+#ifdef CONFIG_PREEMPT_RT -+#define NOTRACE -+#endif -+ - #include <linux/stringify.h> - #include <linux/types.h> - #include <linux/tracepoint.h> --- -2.19.1 - diff --git a/features/rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch b/features/rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch deleted file mode 100644 index e8de6823..00000000 --- a/features/rt/drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0dfb9c223f7310e28f5a5384a96aa99b563e219b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 7 Jul 2020 12:25:11 +0200 -Subject: [PATCH 159/191] drm/i915/gt: Only disable interrupts for the timeline - lock on !force-threaded - -According to commit - d67739268cf0e ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe") - -the intrrupts are disabled the code may be called from an interrupt -handler and from preemptible context. -With `force_irqthreads' set the timeline mutex is never observed in IRQ -context so it is not neede to disable interrupts. - -Disable only interrupts if not in `force_irqthreads' mode. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/gpu/drm/i915/gt/intel_engine_pm.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c -index e67d09259dd0..2a480b47dac2 100644 ---- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c -+++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c -@@ -81,9 +81,10 @@ static int __engine_unpark(struct intel_wakeref *wf) - - static unsigned long __timeline_mark_lock(struct intel_context *ce) - { -- unsigned long flags; -+ unsigned long flags = 0; - -- local_irq_save(flags); -+ if (!force_irqthreads) -+ local_irq_save(flags); - mutex_acquire(&ce->timeline->mutex.dep_map, 2, 0, _THIS_IP_); - - return flags; -@@ -93,7 +94,8 @@ static void __timeline_mark_unlock(struct intel_context *ce, - unsigned long flags) - { - mutex_release(&ce->timeline->mutex.dep_map, _THIS_IP_); -- local_irq_restore(flags); -+ if (!force_irqthreads) -+ local_irq_restore(flags); - } - - #else --- -2.19.1 - diff --git a/features/rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch b/features/rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch deleted file mode 100644 index 16b96b72..00000000 --- a/features/rt/drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 90efb159f7ef762ff40fc78ca4a4aad63dcb530c Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 19 Dec 2018 10:47:02 +0100 -Subject: [PATCH 158/191] drm/i915: skip DRM_I915_LOW_LEVEL_TRACEPOINTS with - NOTRACE - -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 -nop. Currently this happens for two .c files which use the tracepoitns -behind DRM_I915_LOW_LEVEL_TRACEPOINTS. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/gpu/drm/i915/i915_trace.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h -index 0ba5a0a0fd25..396b6598694d 100644 ---- a/drivers/gpu/drm/i915/i915_trace.h -+++ b/drivers/gpu/drm/i915/i915_trace.h -@@ -782,7 +782,7 @@ DEFINE_EVENT(i915_request, i915_request_add, - TP_ARGS(rq) - ); - --#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) -+#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) && !defined(NOTRACE) - DEFINE_EVENT(i915_request, i915_request_submit, - TP_PROTO(struct i915_request *rq), - TP_ARGS(rq) --- -2.19.1 - diff --git a/features/rt/drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch b/features/rt/drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch deleted file mode 100644 index 5535ee9e..00000000 --- a/features/rt/drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch +++ /dev/null @@ -1,60 +0,0 @@ -From bcd7c523e0e70fe91424916891e64bc520ea1262 Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <umgwanakikbuti@gmail.com> -Date: Sat, 27 Feb 2016 08:09:11 +0100 -Subject: [PATCH 155/191] drm,radeon,i915: Use preempt_disable/enable_rt() - where recommended - -DRM folks identified the spots, so use them. - -Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> -Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Cc: linux-rt-users <linux-rt-users@vger.kernel.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - drivers/gpu/drm/i915/i915_irq.c | 2 ++ - drivers/gpu/drm/radeon/radeon_display.c | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c -index 1a701367a718..32db99bead7d 100644 ---- a/drivers/gpu/drm/i915/i915_irq.c -+++ b/drivers/gpu/drm/i915/i915_irq.c -@@ -888,6 +888,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, - spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); - - /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_disable_rt(); - - /* Get optional system timestamp before query. */ - if (stime) -@@ -952,6 +953,7 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, - *etime = ktime_get(); - - /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_enable_rt(); - - spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); - -diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c -index 652af7a134bd..a2f5a4c0134f 100644 ---- a/drivers/gpu/drm/radeon/radeon_display.c -+++ b/drivers/gpu/drm/radeon/radeon_display.c -@@ -1813,6 +1813,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - struct radeon_device *rdev = dev->dev_private; - - /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_disable_rt(); - - /* Get optional system timestamp before query. */ - if (stime) -@@ -1905,6 +1906,7 @@ int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe, - *etime = ktime_get(); - - /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ -+ preempt_enable_rt(); - - /* Decode into vertical and horizontal scanout position. */ - *vpos = position & 0x1fff; --- -2.19.1 - diff --git a/features/rt/efi-Allow-efi-runtime.patch b/features/rt/efi-Allow-efi-runtime.patch deleted file mode 100644 index 84be1d7e..00000000 --- a/features/rt/efi-Allow-efi-runtime.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 2b3184121c862ea3b57dc901f864eed390eed7c8 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 26 Jul 2018 15:06:10 +0200 -Subject: [PATCH 098/191] efi: Allow efi=runtime - -In case the command line option "efi=noruntime" is default at built-time, the user -could overwrite its state by `efi=runtime' and allow it again. - -Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/firmware/efi/efi.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index 1819da1c9fec..709c65c0a816 100644 ---- a/drivers/firmware/efi/efi.c -+++ b/drivers/firmware/efi/efi.c -@@ -97,6 +97,9 @@ static int __init parse_efi_cmdline(char *str) - if (parse_option_str(str, "noruntime")) - disable_runtime = true; - -+ if (parse_option_str(str, "runtime")) -+ disable_runtime = false; -+ - if (parse_option_str(str, "nosoftreserve")) - set_bit(EFI_MEM_NO_SOFT_RESERVE, &efi.flags); - --- -2.19.1 - diff --git a/features/rt/efi-Disable-runtime-services-on-RT.patch b/features/rt/efi-Disable-runtime-services-on-RT.patch deleted file mode 100644 index fbc4df1d..00000000 --- a/features/rt/efi-Disable-runtime-services-on-RT.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 8ff328d63beab0f17efde608bcaa09ff553a8e94 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 26 Jul 2018 15:03:16 +0200 -Subject: [PATCH 097/191] efi: Disable runtime services on RT - -Based on meassurements the EFI functions get_variable / -get_next_variable take up to 2us which looks okay. -The functions get_time, set_time take around 10ms. Those 10ms are too -much. Even one ms would be too much. -Ard mentioned that SetVariable might even trigger larger latencies if -the firware will erase flash blocks on NOR. - -The time-functions are used by efi-rtc and can be triggered during -runtimed (either via explicit read/write or ntp sync). - -The variable write could be used by pstore. -These functions can be disabled without much of a loss. The poweroff / -reboot hooks may be provided by PSCI. - -Disable EFI's runtime wrappers. - -This was observed on "EFI v2.60 by SoftIron Overdrive 1000". - -Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/firmware/efi/efi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c -index df3f9bcab581..1819da1c9fec 100644 ---- a/drivers/firmware/efi/efi.c -+++ b/drivers/firmware/efi/efi.c -@@ -66,7 +66,7 @@ struct mm_struct efi_mm = { - - struct workqueue_struct *efi_rts_wq; - --static bool disable_runtime; -+static bool disable_runtime = IS_ENABLED(CONFIG_PREEMPT_RT); - static int __init setup_noefi(char *arg) - { - disable_runtime = true; --- -2.19.1 - diff --git a/features/rt/firewire-ohci-Use-tasklet_disable_in_atomic-where-re.patch b/features/rt/firewire-ohci-Use-tasklet_disable_in_atomic-where-re.patch deleted file mode 100644 index 60edded7..00000000 --- a/features/rt/firewire-ohci-Use-tasklet_disable_in_atomic-where-re.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 784277e7d29b56d2fc367068d909e1219c082315 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:16 +0100 -Subject: [PATCH 053/191] firewire: ohci: Use tasklet_disable_in_atomic() where - required - -tasklet_disable() is invoked in several places. Some of them are in atomic -context which prevents a conversion of tasklet_disable() to a sleepable -function. - -The atomic callchains are: - - ar_context_tasklet() - ohci_cancel_packet() - tasklet_disable() - - ... - ohci_flush_iso_completions() - tasklet_disable() - -The invocation of tasklet_disable() from at_context_flush() is always in -preemptible context. - -Use tasklet_disable_in_atomic() for the two invocations in -ohci_cancel_packet() and ohci_flush_iso_completions(). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> -Cc: linux1394-devel@lists.sourceforge.net -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/firewire/ohci.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c -index 9811c40956e5..17c9d825188b 100644 ---- a/drivers/firewire/ohci.c -+++ b/drivers/firewire/ohci.c -@@ -2545,7 +2545,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) - struct driver_data *driver_data = packet->driver_data; - int ret = -ENOENT; - -- tasklet_disable(&ctx->tasklet); -+ tasklet_disable_in_atomic(&ctx->tasklet); - - if (packet->ack != 0) - goto out; -@@ -3465,7 +3465,7 @@ static int ohci_flush_iso_completions(struct fw_iso_context *base) - struct iso_context *ctx = container_of(base, struct iso_context, base); - int ret = 0; - -- tasklet_disable(&ctx->context.tasklet); -+ tasklet_disable_in_atomic(&ctx->context.tasklet); - - if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) { - context_tasklet((unsigned long)&ctx->context); --- -2.19.1 - diff --git a/features/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch b/features/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch deleted file mode 100644 index 0e3c58f2..00000000 --- a/features/rt/fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 3280c5c16fc06b062dce646186bf6d9449b03a5e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 20 Oct 2017 11:29:53 +0200 -Subject: [PATCH 090/191] fs/dcache: disable preemption on i_dir_seq's write - side - -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 -held. The problem is that during the write process on RT the preemption -is still enabled and if this process is interrupted by a reader with RT -priority then we lock up. -To avoid that lock up I am disabling the preemption during the update. -The rename of i_dir_seq is here to ensure to catch new write sides in -future. - -Cc: stable-rt@vger.kernel.org -Reported-by: Oleg.Karfich@wago.com -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - fs/dcache.c | 12 +++++++----- - fs/inode.c | 2 +- - include/linux/fs.h | 2 +- - 3 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/fs/dcache.c b/fs/dcache.c -index 2c36711a222e..cd6405fd483a 100644 ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -2537,9 +2537,10 @@ EXPORT_SYMBOL(d_rehash); - static inline unsigned start_dir_add(struct inode *dir) - { - -+ preempt_disable_rt(); - for (;;) { -- unsigned n = dir->i_dir_seq; -- if (!(n & 1) && cmpxchg(&dir->i_dir_seq, n, n + 1) == n) -+ unsigned n = dir->__i_dir_seq; -+ if (!(n & 1) && cmpxchg(&dir->__i_dir_seq, n, n + 1) == n) - return n; - cpu_relax(); - } -@@ -2547,7 +2548,8 @@ static inline unsigned start_dir_add(struct inode *dir) - - static inline void end_dir_add(struct inode *dir, unsigned n) - { -- smp_store_release(&dir->i_dir_seq, n + 2); -+ smp_store_release(&dir->__i_dir_seq, n + 2); -+ preempt_enable_rt(); - } - - static void d_wait_lookup(struct dentry *dentry) -@@ -2583,7 +2585,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, - - retry: - rcu_read_lock(); -- seq = smp_load_acquire(&parent->d_inode->i_dir_seq); -+ seq = smp_load_acquire(&parent->d_inode->__i_dir_seq); - r_seq = read_seqbegin(&rename_lock); - dentry = __d_lookup_rcu(parent, name, &d_seq); - if (unlikely(dentry)) { -@@ -2611,7 +2613,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, - } - - hlist_bl_lock(b); -- if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { -+ if (unlikely(READ_ONCE(parent->d_inode->__i_dir_seq) != seq)) { - hlist_bl_unlock(b); - rcu_read_unlock(); - goto retry; -diff --git a/fs/inode.c b/fs/inode.c -index 0672530acf7d..70a1230062e3 100644 ---- a/fs/inode.c -+++ b/fs/inode.c -@@ -158,7 +158,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) - inode->i_pipe = NULL; - inode->i_cdev = NULL; - inode->i_link = NULL; -- inode->i_dir_seq = 0; -+ inode->__i_dir_seq = 0; - inode->i_rdev = 0; - inode->dirtied_when = 0; - -diff --git a/include/linux/fs.h b/include/linux/fs.h -index 4fa4b24535fd..9ac35f563f6e 100644 ---- a/include/linux/fs.h -+++ b/include/linux/fs.h -@@ -700,7 +700,7 @@ struct inode { - struct pipe_inode_info *i_pipe; - struct cdev *i_cdev; - char *i_link; -- unsigned i_dir_seq; -+ unsigned __i_dir_seq; - }; - - __u32 i_generation; --- -2.19.1 - diff --git a/features/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch b/features/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch deleted file mode 100644 index 281405e5..00000000 --- a/features/rt/fs-dcache-use-swait_queue-instead-of-waitqueue.patch +++ /dev/null @@ -1,262 +0,0 @@ -From 36dc3d1f121e7e2b2d5d102de86220b6eb1d827d Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 14 Sep 2016 14:35:49 +0200 -Subject: [PATCH 089/191] fs/dcache: use swait_queue instead of waitqueue - -__d_lookup_done() invokes wake_up_all() while holding a hlist_bl_lock() -which disables preemption. As a workaround convert it to swait. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - fs/afs/dir_silly.c | 2 +- - fs/cifs/readdir.c | 2 +- - fs/dcache.c | 27 +++++++++++++++------------ - fs/fuse/readdir.c | 2 +- - fs/namei.c | 4 ++-- - fs/nfs/dir.c | 4 ++-- - fs/nfs/unlink.c | 4 ++-- - fs/proc/base.c | 3 ++- - fs/proc/proc_sysctl.c | 2 +- - include/linux/dcache.h | 4 ++-- - include/linux/nfs_xdr.h | 2 +- - kernel/sched/swait.c | 1 + - 12 files changed, 31 insertions(+), 26 deletions(-) - -diff --git a/fs/afs/dir_silly.c b/fs/afs/dir_silly.c -index 04f75a44f243..60cbce1995a5 100644 ---- a/fs/afs/dir_silly.c -+++ b/fs/afs/dir_silly.c -@@ -236,7 +236,7 @@ int afs_silly_iput(struct dentry *dentry, struct inode *inode) - struct dentry *alias; - int ret; - -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - - _enter("%p{%pd},%llx", dentry, dentry, vnode->fid.vnode); - -diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c -index 80bf4c6f4c7b..a975cfed14f5 100644 ---- a/fs/cifs/readdir.c -+++ b/fs/cifs/readdir.c -@@ -82,7 +82,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name, - struct inode *inode; - struct super_block *sb = parent->d_sb; - struct cifs_sb_info *cifs_sb = CIFS_SB(sb); -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - - cifs_dbg(FYI, "%s: for %s\n", __func__, name->name); - -diff --git a/fs/dcache.c b/fs/dcache.c -index 00e97c9ae7c4..2c36711a222e 100644 ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -2552,21 +2552,24 @@ static inline void end_dir_add(struct inode *dir, unsigned n) - - static void d_wait_lookup(struct dentry *dentry) - { -- if (d_in_lookup(dentry)) { -- DECLARE_WAITQUEUE(wait, current); -- add_wait_queue(dentry->d_wait, &wait); -- do { -- set_current_state(TASK_UNINTERRUPTIBLE); -- spin_unlock(&dentry->d_lock); -- schedule(); -- spin_lock(&dentry->d_lock); -- } while (d_in_lookup(dentry)); -- } -+ struct swait_queue __wait; -+ -+ if (!d_in_lookup(dentry)) -+ return; -+ -+ INIT_LIST_HEAD(&__wait.task_list); -+ do { -+ prepare_to_swait_exclusive(dentry->d_wait, &__wait, TASK_UNINTERRUPTIBLE); -+ spin_unlock(&dentry->d_lock); -+ schedule(); -+ spin_lock(&dentry->d_lock); -+ } while (d_in_lookup(dentry)); -+ finish_swait(dentry->d_wait, &__wait); - } - - struct dentry *d_alloc_parallel(struct dentry *parent, - const struct qstr *name, -- wait_queue_head_t *wq) -+ struct swait_queue_head *wq) - { - unsigned int hash = name->hash; - struct hlist_bl_head *b = in_lookup_hash(parent, hash); -@@ -2681,7 +2684,7 @@ void __d_lookup_done(struct dentry *dentry) - hlist_bl_lock(b); - dentry->d_flags &= ~DCACHE_PAR_LOOKUP; - __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); -- wake_up_all(dentry->d_wait); -+ swake_up_all(dentry->d_wait); - dentry->d_wait = NULL; - hlist_bl_unlock(b); - INIT_HLIST_NODE(&dentry->d_u.d_alias); -diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c -index 3441ffa740f3..2fcae5cfd272 100644 ---- a/fs/fuse/readdir.c -+++ b/fs/fuse/readdir.c -@@ -158,7 +158,7 @@ static int fuse_direntplus_link(struct file *file, - struct inode *dir = d_inode(parent); - struct fuse_conn *fc; - struct inode *inode; -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - - if (!o->nodeid) { - /* -diff --git a/fs/namei.c b/fs/namei.c -index 216f16e74351..06ffd9490a34 100644 ---- a/fs/namei.c -+++ b/fs/namei.c -@@ -1602,7 +1602,7 @@ static struct dentry *__lookup_slow(const struct qstr *name, - { - struct dentry *dentry, *old; - struct inode *inode = dir->d_inode; -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - - /* Don't go there if it's already dead */ - if (unlikely(IS_DEADDIR(inode))) -@@ -3131,7 +3131,7 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file, - struct dentry *dentry; - int error, create_error = 0; - umode_t mode = op->mode; -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - - if (unlikely(IS_DEADDIR(dir_inode))) - return ERR_PTR(-ENOENT); -diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c -index fc4f490f2d78..8f00a87b7ae2 100644 ---- a/fs/nfs/dir.c -+++ b/fs/nfs/dir.c -@@ -636,7 +636,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry, - unsigned long dir_verifier) - { - struct qstr filename = QSTR_INIT(entry->name, entry->len); -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - struct dentry *dentry; - struct dentry *alias; - struct inode *inode; -@@ -1868,7 +1868,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, - struct file *file, unsigned open_flags, - umode_t mode) - { -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - struct nfs_open_context *ctx; - struct dentry *res; - struct iattr attr = { .ia_valid = ATTR_OPEN }; -diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c -index 5fa11e1aca4c..984f26eb888c 100644 ---- a/fs/nfs/unlink.c -+++ b/fs/nfs/unlink.c -@@ -13,7 +13,7 @@ - #include <linux/sunrpc/clnt.h> - #include <linux/nfs_fs.h> - #include <linux/sched.h> --#include <linux/wait.h> -+#include <linux/swait.h> - #include <linux/namei.h> - #include <linux/fsnotify.h> - -@@ -180,7 +180,7 @@ nfs_async_unlink(struct dentry *dentry, const struct qstr *name) - - data->cred = get_current_cred(); - data->res.dir_attr = &data->dir_attr; -- init_waitqueue_head(&data->wq); -+ init_swait_queue_head(&data->wq); - - status = -EBUSY; - spin_lock(&dentry->d_lock); -diff --git a/fs/proc/base.c b/fs/proc/base.c -index d632ddd5f5ee..4ea6111fae71 100644 ---- a/fs/proc/base.c -+++ b/fs/proc/base.c -@@ -95,6 +95,7 @@ - #include <linux/posix-timers.h> - #include <linux/time_namespace.h> - #include <linux/resctrl.h> -+#include <linux/swait.h> - #include <trace/events/oom.h> - #include "internal.h" - #include "fd.h" -@@ -2037,7 +2038,7 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, - - child = d_hash_and_lookup(dir, &qname); - if (!child) { -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - child = d_alloc_parallel(dir, &qname, &wq); - if (IS_ERR(child)) - goto end_instantiate; -diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c -index 984e42f8cb11..2bc8e2409308 100644 ---- a/fs/proc/proc_sysctl.c -+++ b/fs/proc/proc_sysctl.c -@@ -683,7 +683,7 @@ static bool proc_sys_fill_cache(struct file *file, - - child = d_lookup(dir, &qname); - if (!child) { -- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); -+ DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq); - child = d_alloc_parallel(dir, &qname, &wq); - if (IS_ERR(child)) - return false; -diff --git a/include/linux/dcache.h b/include/linux/dcache.h -index c1e48014106f..f2dc84edbcf1 100644 ---- a/include/linux/dcache.h -+++ b/include/linux/dcache.h -@@ -107,7 +107,7 @@ struct dentry { - - union { - struct list_head d_lru; /* LRU list */ -- wait_queue_head_t *d_wait; /* in-lookup ones only */ -+ struct swait_queue_head *d_wait; /* in-lookup ones only */ - }; - struct list_head d_child; /* child of parent list */ - struct list_head d_subdirs; /* our children */ -@@ -239,7 +239,7 @@ extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op - extern struct dentry * d_alloc(struct dentry *, const struct qstr *); - extern struct dentry * d_alloc_anon(struct super_block *); - extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *, -- wait_queue_head_t *); -+ struct swait_queue_head *); - extern struct dentry * d_splice_alias(struct inode *, struct dentry *); - extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); - extern struct dentry * d_exact_alias(struct dentry *, struct inode *); -diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h -index 0d62b8db4d24..0278c359e3ef 100644 ---- a/include/linux/nfs_xdr.h -+++ b/include/linux/nfs_xdr.h -@@ -1684,7 +1684,7 @@ struct nfs_unlinkdata { - struct nfs_removeargs args; - struct nfs_removeres res; - struct dentry *dentry; -- wait_queue_head_t wq; -+ struct swait_queue_head wq; - const struct cred *cred; - struct nfs_fattr dir_attr; - long timeout; -diff --git a/kernel/sched/swait.c b/kernel/sched/swait.c -index e1c655f928c7..f230b1ac7f91 100644 ---- a/kernel/sched/swait.c -+++ b/kernel/sched/swait.c -@@ -64,6 +64,7 @@ void swake_up_all(struct swait_queue_head *q) - struct swait_queue *curr; - LIST_HEAD(tmp); - -+ WARN_ON(irqs_disabled()); - raw_spin_lock_irq(&q->lock); - list_splice_init(&q->task_list, &tmp); - while (!list_empty(&tmp)) { --- -2.19.1 - diff --git a/features/rt/fs-namespace-Use-cpu_chill-in-trylock-loops.patch b/features/rt/fs-namespace-Use-cpu_chill-in-trylock-loops.patch deleted file mode 100644 index a4536630..00000000 --- a/features/rt/fs-namespace-Use-cpu_chill-in-trylock-loops.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 411705d51a89aa7c844f7cae5379a406d720f619 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 7 Mar 2012 21:00:34 +0100 -Subject: [PATCH 139/191] fs: namespace: Use cpu_chill() in trylock loops - -Retry loops on RT might loop forever when the modifying side was -preempted. Use cpu_chill() instead of cpu_relax() to let the system -make progress. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - fs/namespace.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/fs/namespace.c b/fs/namespace.c -index 74957d5edaa8..a02b35e791a3 100644 ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -14,6 +14,7 @@ - #include <linux/mnt_namespace.h> - #include <linux/user_namespace.h> - #include <linux/namei.h> -+#include <linux/hrtimer.h> - #include <linux/security.h> - #include <linux/cred.h> - #include <linux/idr.h> -@@ -342,8 +343,11 @@ int __mnt_want_write(struct vfsmount *m) - * incremented count after it has set MNT_WRITE_HOLD. - */ - smp_mb(); -- while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) -- cpu_relax(); -+ while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { -+ preempt_enable(); -+ cpu_chill(); -+ preempt_disable(); -+ } - /* - * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will - * be set to match its requirements. So we must not load that until --- -2.19.1 - diff --git a/features/rt/futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch b/features/rt/futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch deleted file mode 100644 index 1e9a9e63..00000000 --- a/features/rt/futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 1301c0809848cdcd4a0fae002d13707fa3e3db5d Mon Sep 17 00:00:00 2001 -From: Steven Rostedt <rostedt@goodmis.org> -Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 066/191] futex: Fix bug on when a requeued RT task times out - -Requeue with timeout causes a bug with PREEMPT_RT. - -The bug comes from a timed out condition. - - TASK 1 TASK 2 - ------ ------ - futex_wait_requeue_pi() - futex_wait_queue_me() - <timed out> - - double_lock_hb(); - - raw_spin_lock(pi_lock); - if (current->pi_blocked_on) { - } else { - current->pi_blocked_on = PI_WAKE_INPROGRESS; - run_spin_unlock(pi_lock); - spin_lock(hb->lock); <-- blocked! - - plist_for_each_entry_safe(this) { - rt_mutex_start_proxy_lock(); - task_blocks_on_rt_mutex(); - BUG_ON(task->pi_blocked_on)!!!! - -The BUG_ON() actually has a check for PI_WAKE_INPROGRESS, but the -problem is that, after TASK 1 sets PI_WAKE_INPROGRESS, it then tries to -grab the hb->lock, which it fails to do so. As the hb->lock is a mutex, -it will block and set the "pi_blocked_on" to the hb->lock. - -When TASK 2 goes to requeue it, the check for PI_WAKE_INPROGESS fails -because the task1's pi_blocked_on is no longer set to that, but instead, -set to the hb->lock. - -The fix: - -When calling rt_mutex_start_proxy_lock() a check is made to see -if the proxy tasks pi_blocked_on is set. If so, exit out early. -Otherwise set it to a new flag PI_REQUEUE_INPROGRESS, which notifies -the proxy task that it is being requeued, and will handle things -appropriately. - -Signed-off-by: Steven Rostedt <rostedt@goodmis.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/locking/rtmutex.c | 31 ++++++++++++++++++++++++++++++- - kernel/locking/rtmutex_common.h | 1 + - 2 files changed, 31 insertions(+), 1 deletion(-) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 7fff3b88b96b..4d2a57e8dcb9 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -138,7 +138,8 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) - - static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) - { -- return waiter && waiter != PI_WAKEUP_INPROGRESS; -+ return waiter && waiter != PI_WAKEUP_INPROGRESS && -+ waiter != PI_REQUEUE_INPROGRESS; - } - - /* -@@ -1707,6 +1708,34 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, - if (try_to_take_rt_mutex(lock, task, NULL)) - return 1; - -+#ifdef CONFIG_PREEMPT_RT -+ /* -+ * In PREEMPT_RT there's an added race. -+ * If the task, that we are about to requeue, times out, -+ * it can set the PI_WAKEUP_INPROGRESS. This tells the requeue -+ * to skip this task. But right after the task sets -+ * its pi_blocked_on to PI_WAKEUP_INPROGRESS it can then -+ * block on the spin_lock(&hb->lock), which in RT is an rtmutex. -+ * This will replace the PI_WAKEUP_INPROGRESS with the actual -+ * lock that it blocks on. We *must not* place this task -+ * on this proxy lock in that case. -+ * -+ * To prevent this race, we first take the task's pi_lock -+ * and check if it has updated its pi_blocked_on. If it has, -+ * we assume that it woke up and we return -EAGAIN. -+ * Otherwise, we set the task's pi_blocked_on to -+ * PI_REQUEUE_INPROGRESS, so that if the task is waking up -+ * it will know that we are in the process of requeuing it. -+ */ -+ raw_spin_lock(&task->pi_lock); -+ if (task->pi_blocked_on) { -+ raw_spin_unlock(&task->pi_lock); -+ return -EAGAIN; -+ } -+ task->pi_blocked_on = PI_REQUEUE_INPROGRESS; -+ raw_spin_unlock(&task->pi_lock); -+#endif -+ - /* We enforce deadlock detection for futexes */ - ret = task_blocks_on_rt_mutex(lock, waiter, task, - RT_MUTEX_FULL_CHAINWALK); -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index 096b16cfb096..37cd6b3bf6f4 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -126,6 +126,7 @@ enum rtmutex_chainwalk { - * PI-futex support (proxy locking functions, etc.): - */ - #define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1) -+#define PI_REQUEUE_INPROGRESS ((struct rt_mutex_waiter *) 2) - - extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); - extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, --- -2.19.1 - diff --git a/features/rt/genirq-Disable-irqpoll-on-rt.patch b/features/rt/genirq-Disable-irqpoll-on-rt.patch deleted file mode 100644 index 37c2cf92..00000000 --- a/features/rt/genirq-Disable-irqpoll-on-rt.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 838f295da60b853b16a3bfbfdd0790472ce70d94 Mon Sep 17 00:00:00 2001 -From: Ingo Molnar <mingo@elte.hu> -Date: Fri, 3 Jul 2009 08:29:57 -0500 -Subject: [PATCH 189/191] genirq: Disable irqpoll on -rt - -Creates long latencies for no value - -Signed-off-by: Ingo Molnar <mingo@elte.hu> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/irq/spurious.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c -index f865e5f4d382..dc7311dd74b1 100644 ---- a/kernel/irq/spurious.c -+++ b/kernel/irq/spurious.c -@@ -443,6 +443,10 @@ MODULE_PARM_DESC(noirqdebug, "Disable irq lockup detection when true"); - - static int __init irqfixup_setup(char *str) - { -+#ifdef CONFIG_PREEMPT_RT -+ pr_warn("irqfixup boot option not supported w/ CONFIG_PREEMPT_RT\n"); -+ return 1; -+#endif - irqfixup = 1; - printk(KERN_WARNING "Misrouted IRQ fixup support enabled.\n"); - printk(KERN_WARNING "This may impact system performance.\n"); -@@ -455,6 +459,10 @@ module_param(irqfixup, int, 0644); - - static int __init irqpoll_setup(char *str) - { -+#ifdef CONFIG_PREEMPT_RT -+ pr_warn("irqpoll boot option not supported w/ CONFIG_PREEMPT_RT\n"); -+ return 1; -+#endif - irqfixup = 2; - printk(KERN_WARNING "Misrouted IRQ fixup and polling support " - "enabled\n"); --- -2.19.1 - diff --git a/features/rt/genirq-Move-prio-assignment-into-the-newly-created-t.patch b/features/rt/genirq-Move-prio-assignment-into-the-newly-created-t.patch deleted file mode 100644 index 3c62cff6..00000000 --- a/features/rt/genirq-Move-prio-assignment-into-the-newly-created-t.patch +++ /dev/null @@ -1,61 +0,0 @@ -From a5c8ce0345b9379be44f67042816beb0afda8176 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 9 Nov 2020 23:32:39 +0100 -Subject: [PATCH 004/191] genirq: Move prio assignment into the newly created - thread - -With enabled threaded interrupts the nouveau driver reported the -following: -| Chain exists of: -| &mm->mmap_lock#2 --> &device->mutex --> &cpuset_rwsem -| -| Possible unsafe locking scenario: -| -| CPU0 CPU1 -| ---- ---- -| lock(&cpuset_rwsem); -| lock(&device->mutex); -| lock(&cpuset_rwsem); -| lock(&mm->mmap_lock#2); - -The device->mutex is nvkm_device::mutex. - -Unblocking the lockchain at `cpuset_rwsem' is probably the easiest thing -to do. -Move the priority assignment to the start of the newly created thread. - -Fixes: 710da3c8ea7df ("sched/core: Prevent race condition between cpuset and __sched_setscheduler()") -Reported-by: Mike Galbraith <efault@gmx.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -[bigeasy: Patch description] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Link: https://lkml.kernel.org/r/a23a826af7c108ea5651e73b8fbae5e653f16e86.camel@gmx.de ---- - kernel/irq/manage.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index dec3f73e8db9..ac2c57429750 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -1225,6 +1225,8 @@ static int irq_thread(void *data) - irqreturn_t (*handler_fn)(struct irq_desc *desc, - struct irqaction *action); - -+ sched_set_fifo(current); -+ - if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD, - &action->thread_flags)) - handler_fn = irq_forced_thread_fn; -@@ -1390,8 +1392,6 @@ setup_irq_thread(struct irqaction *new, unsigned int irq, bool secondary) - if (IS_ERR(t)) - return PTR_ERR(t); - -- sched_set_fifo(t); -- - /* - * We keep the reference to the task struct even if - * the thread dies to avoid that the interrupt code --- -2.19.1 - diff --git a/features/rt/genirq-update-irq_set_irqchip_state-documentation.patch b/features/rt/genirq-update-irq_set_irqchip_state-documentation.patch deleted file mode 100644 index d203983a..00000000 --- a/features/rt/genirq-update-irq_set_irqchip_state-documentation.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a7f1d1036ba191caf447313670c2d682537c6f51 Mon Sep 17 00:00:00 2001 -From: Josh Cartwright <joshc@ni.com> -Date: Thu, 11 Feb 2016 11:54:00 -0600 -Subject: [PATCH 174/191] genirq: update irq_set_irqchip_state documentation - -On -rt kernels, the use of migrate_disable()/migrate_enable() is -sufficient to guarantee a task isn't moved to another CPU. Update the -irq_set_irqchip_state() documentation to reflect this. - -Signed-off-by: Josh Cartwright <joshc@ni.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/irq/manage.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index f4d18858d079..b279a8683c38 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -2787,7 +2787,7 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state); - * This call sets the internal irqchip state of an interrupt, - * depending on the value of @which. - * -- * This function should be called with preemption disabled if the -+ * This function should be called with migration disabled if the - * interrupt controller has per-cpu registers. - */ - int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, --- -2.19.1 - diff --git a/features/rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch b/features/rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch deleted file mode 100644 index 30c5cea1..00000000 --- a/features/rt/highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a93cd2c33ab23c4dce5b28971b24ad3bb0a85d55 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 30 Oct 2020 13:59:06 +0100 -Subject: [PATCH 001/191] highmem: Don't disable preemption on RT in - kmap_atomic() - -Disabling preemption makes it impossible to acquire sleeping locks within -kmap_atomic() section. -For PREEMPT_RT it is sufficient to disable migration. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/highmem-internal.h | 27 ++++++++++++++++++++++----- - 1 file changed, 22 insertions(+), 5 deletions(-) - -diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h -index 7902c7d8b55f..4aa1031d3e4c 100644 ---- a/include/linux/highmem-internal.h -+++ b/include/linux/highmem-internal.h -@@ -90,7 +90,11 @@ static inline void __kunmap_local(void *vaddr) - - static inline void *kmap_atomic_prot(struct page *page, pgprot_t prot) - { -- preempt_disable(); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ migrate_disable(); -+ else -+ preempt_disable(); -+ - pagefault_disable(); - return __kmap_local_page_prot(page, prot); - } -@@ -102,7 +106,11 @@ static inline void *kmap_atomic(struct page *page) - - static inline void *kmap_atomic_pfn(unsigned long pfn) - { -- preempt_disable(); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ migrate_disable(); -+ else -+ preempt_disable(); -+ - pagefault_disable(); - return __kmap_local_pfn_prot(pfn, kmap_prot); - } -@@ -111,7 +119,10 @@ static inline void __kunmap_atomic(void *addr) - { - kunmap_local_indexed(addr); - pagefault_enable(); -- preempt_enable(); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ migrate_enable(); -+ else -+ preempt_enable(); - } - - unsigned int __nr_free_highpages(void); -@@ -179,7 +190,10 @@ static inline void __kunmap_local(void *addr) - - static inline void *kmap_atomic(struct page *page) - { -- preempt_disable(); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ migrate_disable(); -+ else -+ preempt_disable(); - pagefault_disable(); - return page_address(page); - } -@@ -200,7 +214,10 @@ static inline void __kunmap_atomic(void *addr) - kunmap_flush_on_unmap(addr); - #endif - pagefault_enable(); -- preempt_enable(); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ migrate_enable(); -+ else -+ preempt_enable(); - } - - static inline unsigned int nr_free_highpages(void) { return 0; } --- -2.19.1 - diff --git a/features/rt/irqtime-Make-accounting-correct-on-RT.patch b/features/rt/irqtime-Make-accounting-correct-on-RT.patch deleted file mode 100644 index bb84cb23..00000000 --- a/features/rt/irqtime-Make-accounting-correct-on-RT.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 02a22f4cb3638326b34be9b98415ab6f2718f071 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:54 +0100 -Subject: [PATCH 056/191] irqtime: Make accounting correct on RT - -vtime_account_irq and irqtime_account_irq() base checks on preempt_count() -which fails on RT because preempt_count() does not contain the softirq -accounting which is seperate on RT. - -These checks do not need the full preempt count as they only operate on the -hard and softirq sections. - -Use irq_count() instead which provides the correct value on both RT and non -RT kernels. The compiler is clever enough to fold the masking for !RT: - - 99b: 65 8b 05 00 00 00 00 mov %gs:0x0(%rip),%eax - - 9a2: 25 ff ff ff 7f and $0x7fffffff,%eax - + 9a2: 25 00 ff ff 00 and $0xffff00,%eax - -Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Frederic Weisbecker <frederic@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/sched/cputime.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c -index 5f611658eeab..2c36a5fad589 100644 ---- a/kernel/sched/cputime.c -+++ b/kernel/sched/cputime.c -@@ -60,7 +60,7 @@ void irqtime_account_irq(struct task_struct *curr, unsigned int offset) - cpu = smp_processor_id(); - delta = sched_clock_cpu(cpu) - irqtime->irq_start_time; - irqtime->irq_start_time += delta; -- pc = preempt_count() - offset; -+ pc = irq_count() - offset; - - /* - * We do not account for softirq time from ksoftirqd here. -@@ -421,7 +421,7 @@ void vtime_task_switch(struct task_struct *prev) - - void vtime_account_irq(struct task_struct *tsk, unsigned int offset) - { -- unsigned int pc = preempt_count() - offset; -+ unsigned int pc = irq_count() - offset; - - if (pc & HARDIRQ_OFFSET) { - vtime_account_hardirq(tsk); --- -2.19.1 - diff --git a/features/rt/irqwork-push-most-work-into-softirq-context.patch b/features/rt/irqwork-push-most-work-into-softirq-context.patch deleted file mode 100644 index 0b69634b..00000000 --- a/features/rt/irqwork-push-most-work-into-softirq-context.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 79182fbaac5c336ea2aadecca97ad3e96ba2d2f0 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 23 Jun 2015 15:32:51 +0200 -Subject: [PATCH 144/191] irqwork: push most work into softirq context - -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. -The NOHZ trigger (nohz_full_kick_work) was the first user that did not work -as expected if it did not run in the original irqwork context so we had to -bring it back somehow for it. push_irq_work_func is the second one that -requires this. - -This patch adds the IRQ_WORK_HARD_IRQ which makes sure the callback runs -in raw-irq context. Everything else is defered into softirq context. Without --RT we have the orignal behavior. - -This patch incorporates tglx orignal work which revoked a little bringing back -the arch_irq_work_raise() if possible and a few fixes from Steven Rostedt and -Mike Galbraith, - -[bigeasy: melt tglx's irq_work_tick_soft() which splits irq_work_tick() into a - hard and soft variant] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/irq_work.h | 6 ++++ - kernel/irq_work.c | 69 ++++++++++++++++++++++++++++++++-------- - kernel/sched/topology.c | 3 +- - kernel/time/timer.c | 2 ++ - 4 files changed, 66 insertions(+), 14 deletions(-) - -diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h -index ec2a47a81e42..dbbef9089789 100644 ---- a/include/linux/irq_work.h -+++ b/include/linux/irq_work.h -@@ -64,4 +64,10 @@ static inline void irq_work_run(void) { } - static inline void irq_work_single(void *arg) { } - #endif - -+#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT) -+void irq_work_tick_soft(void); -+#else -+static inline void irq_work_tick_soft(void) { } -+#endif -+ - #endif /* _LINUX_IRQ_WORK_H */ -diff --git a/kernel/irq_work.c b/kernel/irq_work.c -index e8da1e71583a..c3455910196f 100644 ---- a/kernel/irq_work.c -+++ b/kernel/irq_work.c -@@ -18,6 +18,7 @@ - #include <linux/cpu.h> - #include <linux/notifier.h> - #include <linux/smp.h> -+#include <linux/interrupt.h> - #include <asm/processor.h> - - -@@ -52,13 +53,27 @@ void __weak arch_irq_work_raise(void) - /* Enqueue on current CPU, work must already be claimed and preempt disabled */ - static void __irq_work_queue_local(struct irq_work *work) - { -- /* If the work is "lazy", handle it from next tick if any */ -- if (atomic_read(&work->node.a_flags) & IRQ_WORK_LAZY) { -- if (llist_add(&work->node.llist, this_cpu_ptr(&lazy_list)) && -- tick_nohz_tick_stopped()) -- arch_irq_work_raise(); -- } else { -- if (llist_add(&work->node.llist, this_cpu_ptr(&raised_list))) -+ struct llist_head *list; -+ bool lazy_work; -+ int work_flags; -+ -+ work_flags = atomic_read(&work->node.a_flags); -+ if (work_flags & IRQ_WORK_LAZY) -+ lazy_work = true; -+ else if (IS_ENABLED(CONFIG_PREEMPT_RT) && -+ !(work_flags & IRQ_WORK_HARD_IRQ)) -+ lazy_work = true; -+ else -+ lazy_work = false; -+ -+ if (lazy_work) -+ list = this_cpu_ptr(&lazy_list); -+ else -+ list = this_cpu_ptr(&raised_list); -+ -+ if (llist_add(&work->node.llist, list)) { -+ /* If the work is "lazy", handle it from next tick if any */ -+ if (!lazy_work || tick_nohz_tick_stopped()) - arch_irq_work_raise(); - } - } -@@ -102,7 +117,14 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) - if (cpu != smp_processor_id()) { - /* Arch remote IPI send/receive backend aren't NMI safe */ - WARN_ON_ONCE(in_nmi()); -- __smp_call_single_queue(cpu, &work->node.llist); -+ -+ if (IS_ENABLED(CONFIG_PREEMPT_RT) && !(atomic_read(&work->node.a_flags) & IRQ_WORK_HARD_IRQ)) { -+ if (llist_add(&work->node.llist, &per_cpu(lazy_list, cpu))) -+ /* && tick_nohz_tick_stopped_cpu(cpu) */ -+ arch_send_call_function_single_ipi(cpu); -+ } else { -+ __smp_call_single_queue(cpu, &work->node.llist); -+ } - } else { - __irq_work_queue_local(work); - } -@@ -120,9 +142,8 @@ bool irq_work_needs_cpu(void) - raised = this_cpu_ptr(&raised_list); - lazy = this_cpu_ptr(&lazy_list); - -- if (llist_empty(raised) || arch_irq_work_has_interrupt()) -- if (llist_empty(lazy)) -- return false; -+ if (llist_empty(raised) && llist_empty(lazy)) -+ return false; - - /* All work should have been flushed before going offline */ - WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); -@@ -165,8 +186,12 @@ static void irq_work_run_list(struct llist_head *list) - struct irq_work *work, *tmp; - struct llist_node *llnode; - -+#ifndef CONFIG_PREEMPT_RT -+ /* -+ * nort: On RT IRQ-work may run in SOFTIRQ context. -+ */ - BUG_ON(!irqs_disabled()); -- -+#endif - if (llist_empty(list)) - return; - -@@ -182,7 +207,16 @@ static void irq_work_run_list(struct llist_head *list) - void irq_work_run(void) - { - irq_work_run_list(this_cpu_ptr(&raised_list)); -- irq_work_run_list(this_cpu_ptr(&lazy_list)); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { -+ /* -+ * NOTE: we raise softirq via IPI for safety, -+ * and execute in irq_work_tick() to move the -+ * overhead from hard to soft irq context. -+ */ -+ if (!llist_empty(this_cpu_ptr(&lazy_list))) -+ raise_softirq(TIMER_SOFTIRQ); -+ } else -+ irq_work_run_list(this_cpu_ptr(&lazy_list)); - } - EXPORT_SYMBOL_GPL(irq_work_run); - -@@ -192,8 +226,17 @@ void irq_work_tick(void) - - if (!llist_empty(raised) && !arch_irq_work_has_interrupt()) - irq_work_run_list(raised); -+ -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) -+ irq_work_run_list(this_cpu_ptr(&lazy_list)); -+} -+ -+#if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT) -+void irq_work_tick_soft(void) -+{ - irq_work_run_list(this_cpu_ptr(&lazy_list)); - } -+#endif - - /* - * Synchronize against the irq_work @entry, ensures the entry is not -diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c -index 09d35044bd88..6f7c0f493be3 100644 ---- a/kernel/sched/topology.c -+++ b/kernel/sched/topology.c -@@ -526,7 +526,8 @@ static int init_rootdomain(struct root_domain *rd) - #ifdef HAVE_RT_PUSH_IPI - rd->rto_cpu = -1; - raw_spin_lock_init(&rd->rto_lock); -- init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); -+// init_irq_work(&rd->rto_push_work, rto_push_irq_work_func); -+ rd->rto_push_work = IRQ_WORK_INIT_HARD(rto_push_irq_work_func); - #endif - - rd->visit_gen = 0; -diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index a0ec4450b1d8..4f7602724f9a 100644 ---- a/kernel/time/timer.c -+++ b/kernel/time/timer.c -@@ -1757,6 +1757,8 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h) - { - struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); - -+ irq_work_tick_soft(); -+ - __run_timers(base); - if (IS_ENABLED(CONFIG_NO_HZ_COMMON)) - __run_timers(this_cpu_ptr(&timer_bases[BASE_DEF])); --- -2.19.1 - diff --git a/features/rt/jump-label-disable-if-stop_machine-is-used.patch b/features/rt/jump-label-disable-if-stop_machine-is-used.patch deleted file mode 100644 index 7ed59db6..00000000 --- a/features/rt/jump-label-disable-if-stop_machine-is-used.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 14fd102dd9a45ac6a7e986617ed27fcdcd6f860f Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 8 Jul 2015 17:14:48 +0200 -Subject: [PATCH 169/191] jump-label: disable if stop_machine() is used - -Some architectures are using stop_machine() while switching the opcode which -leads to latency spikes. -The architectures which use stop_machine() atm: -- ARM stop machine -- s390 stop machine - -The architecures which use other sorcery: -- MIPS -- X86 -- powerpc -- sparc -- arm64 - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -[bigeasy: only ARM for now] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 5179eb3a35d5..fe49c7cb76bd 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -67,7 +67,7 @@ config ARM - select HARDIRQS_SW_RESEND - select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT - select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 -- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU -+ select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && !PREEMPT_RT - select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU - select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL - select HAVE_ARCH_MMAP_RND_BITS if MMU --- -2.19.1 - diff --git a/features/rt/kconfig-Disable-config-options-which-are-not-RT-comp.patch b/features/rt/kconfig-Disable-config-options-which-are-not-RT-comp.patch deleted file mode 100644 index 3bb7f987..00000000 --- a/features/rt/kconfig-Disable-config-options-which-are-not-RT-comp.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6e80f68f3fae004cd7506a5584ed2e5216bacd62 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 24 Jul 2011 12:11:43 +0200 -Subject: [PATCH 093/191] kconfig: Disable config options which are not RT - compatible - -Disable stuff which is known to have issues on RT - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - mm/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mm/Kconfig b/mm/Kconfig -index 24c045b24b95..ec06984ec4ac 100644 ---- a/mm/Kconfig -+++ b/mm/Kconfig -@@ -387,7 +387,7 @@ config NOMMU_INITIAL_TRIM_EXCESS - - config TRANSPARENT_HUGEPAGE - bool "Transparent Hugepage Support" -- depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE -+ depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT - select COMPACTION - select XARRAY_MULTI - help --- -2.19.1 - diff --git a/features/rt/kcov-Remove-kcov-include-from-sched.h-and-move-it-to.patch b/features/rt/kcov-Remove-kcov-include-from-sched.h-and-move-it-to.patch deleted file mode 100644 index 2cb22e3a..00000000 --- a/features/rt/kcov-Remove-kcov-include-from-sched.h-and-move-it-to.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 4dcdff69e55d504a126793e1126d5d475b8c40b0 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 18 Feb 2021 18:31:24 +0100 -Subject: [PATCH 034/191] kcov: Remove kcov include from sched.h and move it to - its users. - -The recent addition of in_serving_softirq() to kconv.h results in -compile failure on PREEMPT_RT because it requires -task_struct::softirq_disable_cnt. This is not available if kconv.h is -included from sched.h. - -It is not needed to include kconv.h from sched.h. All but the net/ user -already include the kconv header file. - -Move the include of the kconv.h header from sched.h it its users. -Additionally include sched.h from kconv.h to ensure that everything -task_struct related is available. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> -Signed-off-by: Ingo Molnar <mingo@kernel.org> -Acked-by: Johannes Berg <johannes@sipsolutions.net> -Acked-by: Andrey Konovalov <andreyknvl@google.com> -Link: https://lkml.kernel.org/r/20210218173124.iy5iyqv3a4oia4vv@linutronix.de -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/usb/usbip/usbip_common.h | 1 + - include/linux/kcov.h | 1 + - include/linux/sched.h | 1 - - net/core/skbuff.c | 1 + - net/mac80211/iface.c | 1 + - net/mac80211/rx.c | 1 + - 6 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h -index d60ce17d3dd2..a7dd6c66aee5 100644 ---- a/drivers/usb/usbip/usbip_common.h -+++ b/drivers/usb/usbip/usbip_common.h -@@ -18,6 +18,7 @@ - #include <linux/usb.h> - #include <linux/wait.h> - #include <linux/sched/task.h> -+#include <linux/kcov.h> - #include <uapi/linux/usbip.h> - - #undef pr_fmt -diff --git a/include/linux/kcov.h b/include/linux/kcov.h -index 4e3037dc1204..55dc338f6bcd 100644 ---- a/include/linux/kcov.h -+++ b/include/linux/kcov.h -@@ -2,6 +2,7 @@ - #ifndef _LINUX_KCOV_H - #define _LINUX_KCOV_H - -+#include <linux/sched.h> - #include <uapi/linux/kcov.h> - - struct task_struct; -diff --git a/include/linux/sched.h b/include/linux/sched.h -index ef00bb22164c..cf245bc237e7 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -14,7 +14,6 @@ - #include <linux/pid.h> - #include <linux/sem.h> - #include <linux/shm.h> --#include <linux/kcov.h> - #include <linux/mutex.h> - #include <linux/plist.h> - #include <linux/hrtimer.h> -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index c421c8f80925..4275b88726f4 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -60,6 +60,7 @@ - #include <linux/prefetch.h> - #include <linux/if_vlan.h> - #include <linux/mpls.h> -+#include <linux/kcov.h> - - #include <net/protocol.h> - #include <net/dst.h> -diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index b80c9b016b2b..c127debdc12e 100644 ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -15,6 +15,7 @@ - #include <linux/if_arp.h> - #include <linux/netdevice.h> - #include <linux/rtnetlink.h> -+#include <linux/kcov.h> - #include <net/mac80211.h> - #include <net/ieee80211_radiotap.h> - #include "ieee80211_i.h" -diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c -index c1343c028b76..62047e93e217 100644 ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -17,6 +17,7 @@ - #include <linux/etherdevice.h> - #include <linux/rcupdate.h> - #include <linux/export.h> -+#include <linux/kcov.h> - #include <linux/bitops.h> - #include <net/mac80211.h> - #include <net/ieee80211_radiotap.h> --- -2.19.1 - diff --git a/features/rt/kernel-sched-add-put-get-_cpu_light.patch b/features/rt/kernel-sched-add-put-get-_cpu_light.patch deleted file mode 100644 index 8cb9d552..00000000 --- a/features/rt/kernel-sched-add-put-get-_cpu_light.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7497b8dc12591dd237a63c9748b71666d48a2eb4 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 101/191] kernel/sched: add {put|get}_cpu_light() - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/smp.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/include/linux/smp.h b/include/linux/smp.h -index 70c6f6284dcf..4c602ca3bc13 100644 ---- a/include/linux/smp.h -+++ b/include/linux/smp.h -@@ -238,6 +238,9 @@ static inline int get_boot_cpu_id(void) - #define get_cpu() ({ preempt_disable(); __smp_processor_id(); }) - #define put_cpu() preempt_enable() - -+#define get_cpu_light() ({ migrate_disable(); __smp_processor_id(); }) -+#define put_cpu_light() migrate_enable() -+ - /* - * Callback to arch code if there's nosmp or maxcpus=0 on the - * boot command line: --- -2.19.1 - diff --git a/features/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/features/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch deleted file mode 100644 index 085edde5..00000000 --- a/features/rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ /dev/null @@ -1,80 +0,0 @@ -From cb9ddd5eec36831a80572aa3d33be62eff791e74 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 21 Nov 2016 19:31:08 +0100 -Subject: [PATCH 121/191] kernel/sched: move stack + kprobe clean up to - __put_task_struct() - -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 -CONFIG_THREAD_INFO_IN_TASK")). This also comes handy on -RT because we can't -free memory in preempt disabled region. -vfree_atomic() delays the memory cleanup to a worker. Since we move everything -to the RCU callback, we can also free it immediately. - -Cc: stable-rt@vger.kernel.org #for kprobe_flush_task() -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/fork.c | 12 +++++++++++- - kernel/sched/core.c | 9 --------- - 2 files changed, 11 insertions(+), 10 deletions(-) - -diff --git a/kernel/fork.c b/kernel/fork.c -index da1b307cbf73..5fdb0a1bbad8 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -42,6 +42,7 @@ - #include <linux/mmu_notifier.h> - #include <linux/fs.h> - #include <linux/mm.h> -+#include <linux/kprobes.h> - #include <linux/vmacache.h> - #include <linux/nsproxy.h> - #include <linux/capability.h> -@@ -288,7 +289,7 @@ static inline void free_thread_stack(struct task_struct *tsk) - return; - } - -- vfree_atomic(tsk->stack); -+ vfree(tsk->stack); - return; - } - #endif -@@ -743,6 +744,15 @@ void __put_task_struct(struct task_struct *tsk) - WARN_ON(refcount_read(&tsk->usage)); - WARN_ON(tsk == current); - -+ /* -+ * Remove function-return probe instances associated with this -+ * task and put them back on the free list. -+ */ -+ kprobe_flush_task(tsk); -+ -+ /* Task is done with its stack. */ -+ put_task_stack(tsk); -+ - io_uring_free(tsk); - cgroup_free(tsk); - task_numa_free(tsk, true); -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 9ec24e4188f4..2069022bdce5 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -4282,15 +4282,6 @@ static struct rq *finish_task_switch(struct task_struct *prev) - if (prev->sched_class->task_dead) - prev->sched_class->task_dead(prev); - -- /* -- * Remove function-return probe instances associated with this -- * task and put them back on the free list. -- */ -- kprobe_flush_task(prev); -- -- /* Task is done with its stack. */ -- put_task_stack(prev); -- - put_task_struct_rcu_user(prev); - } - --- -2.19.1 - diff --git a/features/rt/kthread-Move-prio-affinite-change-into-the-newly-cre.patch b/features/rt/kthread-Move-prio-affinite-change-into-the-newly-cre.patch deleted file mode 100644 index ee7fef7e..00000000 --- a/features/rt/kthread-Move-prio-affinite-change-into-the-newly-cre.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 278ed17d1f399724a529b1b7c3730b364f136e16 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 9 Nov 2020 21:30:41 +0100 -Subject: [PATCH 003/191] kthread: Move prio/affinite change into the newly - created thread - -With enabled threaded interrupts the nouveau driver reported the -following: -| Chain exists of: -| &mm->mmap_lock#2 --> &device->mutex --> &cpuset_rwsem -| -| Possible unsafe locking scenario: -| -| CPU0 CPU1 -| ---- ---- -| lock(&cpuset_rwsem); -| lock(&device->mutex); -| lock(&cpuset_rwsem); -| lock(&mm->mmap_lock#2); - -The device->mutex is nvkm_device::mutex. - -Unblocking the lockchain at `cpuset_rwsem' is probably the easiest thing -to do. -Move the priority reset to the start of the newly created thread. - -Fixes: 710da3c8ea7df ("sched/core: Prevent race condition between cpuset and __sched_setscheduler()") -Reported-by: Mike Galbraith <efault@gmx.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Link: https://lkml.kernel.org/r/a23a826af7c108ea5651e73b8fbae5e653f16e86.camel@gmx.de ---- - kernel/kthread.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/kernel/kthread.c b/kernel/kthread.c -index 1578973c5740..bb0602597ffd 100644 ---- a/kernel/kthread.c -+++ b/kernel/kthread.c -@@ -243,6 +243,7 @@ EXPORT_SYMBOL_GPL(kthread_parkme); - - static int kthread(void *_create) - { -+ static const struct sched_param param = { .sched_priority = 0 }; - /* Copy data: it's on kthread's stack */ - struct kthread_create_info *create = _create; - int (*threadfn)(void *data) = create->threadfn; -@@ -273,6 +274,13 @@ static int kthread(void *_create) - init_completion(&self->parked); - current->vfork_done = &self->exited; - -+ /* -+ * The new thread inherited kthreadd's priority and CPU mask. Reset -+ * back to default in case they have been changed. -+ */ -+ sched_setscheduler_nocheck(current, SCHED_NORMAL, ¶m); -+ set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_FLAG_KTHREAD)); -+ - /* OK, tell user we're spawned, wait for stop or wakeup */ - __set_current_state(TASK_UNINTERRUPTIBLE); - create->result = current; -@@ -370,7 +378,6 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), - } - task = create->result; - if (!IS_ERR(task)) { -- static const struct sched_param param = { .sched_priority = 0 }; - char name[TASK_COMM_LEN]; - - /* -@@ -379,13 +386,6 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), - */ - vsnprintf(name, sizeof(name), namefmt, args); - set_task_comm(task, name); -- /* -- * root may have changed our (kthreadd's) priority or CPU mask. -- * The kernel thread should not inherit these properties. -- */ -- sched_setscheduler_nocheck(task, SCHED_NORMAL, ¶m); -- set_cpus_allowed_ptr(task, -- housekeeping_cpumask(HK_FLAG_KTHREAD)); - } - kfree(create); - return task; --- -2.19.1 - diff --git a/features/rt/leds-trigger-disable-CPU-trigger-on-RT.patch b/features/rt/leds-trigger-disable-CPU-trigger-on-RT.patch deleted file mode 100644 index c0182d45..00000000 --- a/features/rt/leds-trigger-disable-CPU-trigger-on-RT.patch +++ /dev/null @@ -1,39 +0,0 @@ -From fc70c36c08df5b41b07e2c8aa2833f78c0b5b090 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 23 Jan 2014 14:45:59 +0100 -Subject: [PATCH 170/191] leds: trigger: disable CPU trigger on -RT - -as it triggers: -|CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.8-rt10 #141 -|[<c0014aa4>] (unwind_backtrace+0x0/0xf8) from [<c0012788>] (show_stack+0x1c/0x20) -|[<c0012788>] (show_stack+0x1c/0x20) from [<c043c8dc>] (dump_stack+0x20/0x2c) -|[<c043c8dc>] (dump_stack+0x20/0x2c) from [<c004c5e8>] (__might_sleep+0x13c/0x170) -|[<c004c5e8>] (__might_sleep+0x13c/0x170) from [<c043f270>] (__rt_spin_lock+0x28/0x38) -|[<c043f270>] (__rt_spin_lock+0x28/0x38) from [<c043fa00>] (rt_read_lock+0x68/0x7c) -|[<c043fa00>] (rt_read_lock+0x68/0x7c) from [<c036cf74>] (led_trigger_event+0x2c/0x5c) -|[<c036cf74>] (led_trigger_event+0x2c/0x5c) from [<c036e0bc>] (ledtrig_cpu+0x54/0x5c) -|[<c036e0bc>] (ledtrig_cpu+0x54/0x5c) from [<c000ffd8>] (arch_cpu_idle_exit+0x18/0x1c) -|[<c000ffd8>] (arch_cpu_idle_exit+0x18/0x1c) from [<c00590b8>] (cpu_startup_entry+0xa8/0x234) -|[<c00590b8>] (cpu_startup_entry+0xa8/0x234) from [<c043b2cc>] (rest_init+0xb8/0xe0) -|[<c043b2cc>] (rest_init+0xb8/0xe0) from [<c061ebe0>] (start_kernel+0x2c4/0x380) - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/leds/trigger/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig -index b77a01bd27f4..aa74e2a05798 100644 ---- a/drivers/leds/trigger/Kconfig -+++ b/drivers/leds/trigger/Kconfig -@@ -64,6 +64,7 @@ config LEDS_TRIGGER_BACKLIGHT - - config LEDS_TRIGGER_CPU - bool "LED CPU Trigger" -+ depends on !PREEMPT_RT - help - This allows LEDs to be controlled by active CPUs. This shows - the active CPUs across an array of LEDs so you can see which --- -2.19.1 - diff --git a/features/rt/lockdep-Make-it-RT-aware.patch b/features/rt/lockdep-Make-it-RT-aware.patch deleted file mode 100644 index 7b9c216e..00000000 --- a/features/rt/lockdep-Make-it-RT-aware.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 41fd5cd7a4baa5c51e83bd2637358791447960a7 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 17 Jul 2011 18:51:23 +0200 -Subject: [PATCH 151/191] lockdep: Make it RT aware - -teach lockdep that we don't really do softirqs on -RT. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/irqflags.h | 23 +++++++++++++++-------- - kernel/locking/lockdep.c | 2 ++ - 2 files changed, 17 insertions(+), 8 deletions(-) - -diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h -index 600c10da321a..4b140938b03e 100644 ---- a/include/linux/irqflags.h -+++ b/include/linux/irqflags.h -@@ -71,14 +71,6 @@ do { \ - do { \ - __this_cpu_dec(hardirq_context); \ - } while (0) --# define lockdep_softirq_enter() \ --do { \ -- current->softirq_context++; \ --} while (0) --# define lockdep_softirq_exit() \ --do { \ -- current->softirq_context--; \ --} while (0) - - # define lockdep_hrtimer_enter(__hrtimer) \ - ({ \ -@@ -140,6 +132,21 @@ do { \ - # define lockdep_irq_work_exit(__work) do { } while (0) - #endif - -+#if defined(CONFIG_TRACE_IRQFLAGS) && !defined(CONFIG_PREEMPT_RT) -+# define lockdep_softirq_enter() \ -+do { \ -+ current->softirq_context++; \ -+} while (0) -+# define lockdep_softirq_exit() \ -+do { \ -+ current->softirq_context--; \ -+} while (0) -+ -+#else -+# define lockdep_softirq_enter() do { } while (0) -+# define lockdep_softirq_exit() do { } while (0) -+#endif -+ - #if defined(CONFIG_IRQSOFF_TRACER) || \ - defined(CONFIG_PREEMPT_TRACER) - extern void stop_critical_timings(void); -diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index ac177ade7d9b..82fd5cacc492 100644 ---- a/kernel/locking/lockdep.c -+++ b/kernel/locking/lockdep.c -@@ -5360,6 +5360,7 @@ static noinstr void check_flags(unsigned long flags) - } - } - -+#ifndef CONFIG_PREEMPT_RT - /* - * We dont accurately track softirq state in e.g. - * hardirq contexts (such as on 4KSTACKS), so only -@@ -5374,6 +5375,7 @@ static noinstr void check_flags(unsigned long flags) - DEBUG_LOCKS_WARN_ON(!current->softirqs_enabled); - } - } -+#endif - - if (!debug_locks) - print_irqtrace_events(current); --- -2.19.1 - diff --git a/features/rt/lockdep-Reduce-header-files-in-debug_locks.h.patch b/features/rt/lockdep-Reduce-header-files-in-debug_locks.h.patch deleted file mode 100644 index 24d5c811..00000000 --- a/features/rt/lockdep-Reduce-header-files-in-debug_locks.h.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b127ff5cf25163e47794c314b66398cef8fec54f Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 14 Aug 2020 16:55:25 +0200 -Subject: [PATCH 070/191] lockdep: Reduce header files in debug_locks.h - -The inclusion of printk.h leads to circular dependency if spinlock_t is -based on rt_mutex. - -Include only atomic.h (xchg()) and cache.h (__read_mostly). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/debug_locks.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h -index 2915f56ad421..5a9e3e3769ce 100644 ---- a/include/linux/debug_locks.h -+++ b/include/linux/debug_locks.h -@@ -3,8 +3,7 @@ - #define __LINUX_DEBUG_LOCKING_H - - #include <linux/atomic.h> --#include <linux/bug.h> --#include <linux/printk.h> -+#include <linux/cache.h> - - struct task_struct; - --- -2.19.1 - diff --git a/features/rt/lockdep-disable-self-test.patch b/features/rt/lockdep-disable-self-test.patch deleted file mode 100644 index fae3936a..00000000 --- a/features/rt/lockdep-disable-self-test.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 87bd0ee2b2c1a55ad355c37f1143996b0c9f654d Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 17 Oct 2017 16:36:18 +0200 -Subject: [PATCH 154/191] lockdep: disable self-test -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -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 -still reported false positives. Now the selftest locks up the system -during boot and it needs to be investigated… - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - lib/Kconfig.debug | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index 2779c29d9981..74a0a9e54fdb 100644 ---- a/lib/Kconfig.debug -+++ b/lib/Kconfig.debug -@@ -1392,7 +1392,7 @@ config DEBUG_ATOMIC_SLEEP - - config DEBUG_LOCKING_API_SELFTESTS - bool "Locking API boot-time self-tests" -- depends on DEBUG_KERNEL -+ depends on DEBUG_KERNEL && !PREEMPT_RT - help - Say Y here if you want the kernel to run a short self-test during - bootup. The self-test checks whether common types of locking bugs --- -2.19.1 - diff --git a/features/rt/lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch b/features/rt/lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch deleted file mode 100644 index decdc693..00000000 --- a/features/rt/lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 976fc02f2b164dce981f5e3c6a5aca9d9aba1a73 Mon Sep 17 00:00:00 2001 -From: Yong Zhang <yong.zhang@windriver.com> -Date: Mon, 16 Apr 2012 15:01:56 +0800 -Subject: [PATCH 152/191] lockdep: selftest: Only do hardirq context test for - raw spinlock - -On -rt there is no softirq context any more and rwlock is sleepable, -disable softirq context test and rwlock+irq test. - -Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> -Cc: Yong Zhang <yong.zhang@windriver.com> -Link: http://lkml.kernel.org/r/1334559716-18447-3-git-send-email-yong.zhang0@gmail.com -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - lib/locking-selftest.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c -index 2d85abac1744..5ff07ae1cc67 100644 ---- a/lib/locking-selftest.c -+++ b/lib/locking-selftest.c -@@ -2841,6 +2841,7 @@ void locking_selftest(void) - - printk(" --------------------------------------------------------------------------\n"); - -+#ifndef CONFIG_PREEMPT_RT - /* - * irq-context testcases: - */ -@@ -2855,6 +2856,28 @@ void locking_selftest(void) - DO_TESTCASE_6x2x2RW("irq read-recursion #2", irq_read_recursion2); - DO_TESTCASE_6x2x2RW("irq read-recursion #3", irq_read_recursion3); - -+#else -+ /* On -rt, we only do hardirq context test for raw spinlock */ -+ DO_TESTCASE_1B("hard-irqs-on + irq-safe-A", irqsafe1_hard_spin, 12); -+ DO_TESTCASE_1B("hard-irqs-on + irq-safe-A", irqsafe1_hard_spin, 21); -+ -+ DO_TESTCASE_1B("hard-safe-A + irqs-on", irqsafe2B_hard_spin, 12); -+ DO_TESTCASE_1B("hard-safe-A + irqs-on", irqsafe2B_hard_spin, 21); -+ -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 123); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 132); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 213); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 231); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 312); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #1", irqsafe3_hard_spin, 321); -+ -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 123); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 132); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 213); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 231); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 312); -+ DO_TESTCASE_1B("hard-safe-A + unsafe-B #2", irqsafe4_hard_spin, 321); -+#endif - ww_tests(); - - force_read_lock_recursive = 0; --- -2.19.1 - diff --git a/features/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch b/features/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch deleted file mode 100644 index a0354b31..00000000 --- a/features/rt/lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch +++ /dev/null @@ -1,148 +0,0 @@ -From d161010c471cc0d0b18c8875379b75194cd124e8 Mon Sep 17 00:00:00 2001 -From: Josh Cartwright <josh.cartwright@ni.com> -Date: Wed, 28 Jan 2015 13:08:45 -0600 -Subject: [PATCH 153/191] lockdep: selftest: fix warnings due to missing - PREEMPT_RT conditionals - -"lockdep: Selftest: Only do hardirq context test for raw spinlock" -disabled the execution of certain tests with PREEMPT_RT, but did -not prevent the tests from still being defined. This leads to warnings -like: - - ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_12' defined but not used [-Wunused-function] - ./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_21' defined but not used [-Wunused-function] - ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_12' defined but not used [-Wunused-function] - ./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_21' defined but not used [-Wunused-function] - ./linux/lib/locking-selftest.c:580:1: warning: 'irqsafe1_soft_spin_12' defined but not used [-Wunused-function] - ... - -Fixed by wrapping the test definitions in #ifndef CONFIG_PREEMPT_RT -conditionals. - -Signed-off-by: Josh Cartwright <josh.cartwright@ni.com> -Signed-off-by: Xander Huff <xander.huff@ni.com> -Acked-by: Gratian Crisan <gratian.crisan@ni.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - lib/locking-selftest.c | 28 ++++++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c -index 5ff07ae1cc67..3d2d99d8ed13 100644 ---- a/lib/locking-selftest.c -+++ b/lib/locking-selftest.c -@@ -794,6 +794,8 @@ GENERATE_TESTCASE(init_held_rtmutex); - #include "locking-selftest-spin-hardirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_spin) - -+#ifndef CONFIG_PREEMPT_RT -+ - #include "locking-selftest-rlock-hardirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock) - -@@ -809,9 +811,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock) - #include "locking-selftest-wlock-softirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock) - -+#endif -+ - #undef E1 - #undef E2 - -+#ifndef CONFIG_PREEMPT_RT - /* - * Enabling hardirqs with a softirq-safe lock held: - */ -@@ -844,6 +849,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) - #undef E1 - #undef E2 - -+#endif -+ - /* - * Enabling irqs with an irq-safe lock held: - */ -@@ -867,6 +874,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock) - #include "locking-selftest-spin-hardirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin) - -+#ifndef CONFIG_PREEMPT_RT -+ - #include "locking-selftest-rlock-hardirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock) - -@@ -882,6 +891,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock) - #include "locking-selftest-wlock-softirq.h" - GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) - -+#endif -+ - #undef E1 - #undef E2 - -@@ -913,6 +924,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock) - #include "locking-selftest-spin-hardirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin) - -+#ifndef CONFIG_PREEMPT_RT -+ - #include "locking-selftest-rlock-hardirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock) - -@@ -928,6 +941,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock) - #include "locking-selftest-wlock-softirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) - -+#endif -+ - #undef E1 - #undef E2 - #undef E3 -@@ -961,6 +976,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock) - #include "locking-selftest-spin-hardirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin) - -+#ifndef CONFIG_PREEMPT_RT -+ - #include "locking-selftest-rlock-hardirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock) - -@@ -976,10 +993,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock) - #include "locking-selftest-wlock-softirq.h" - GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock) - -+#endif -+ - #undef E1 - #undef E2 - #undef E3 - -+#ifndef CONFIG_PREEMPT_RT -+ - /* - * read-lock / write-lock irq inversion. - * -@@ -1169,6 +1190,11 @@ GENERATE_PERMUTATIONS_3_EVENTS(W1W2_R2R3_R3W1) - #undef E1 - #undef E2 - #undef E3 -+ -+#endif -+ -+#ifndef CONFIG_PREEMPT_RT -+ - /* - * read-lock / write-lock recursion that is actually safe. - */ -@@ -1215,6 +1241,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft_wlock) - #undef E2 - #undef E3 - -+#endif -+ - /* - * read-lock / write-lock recursion that is unsafe. - */ --- -2.19.1 - diff --git a/features/rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch b/features/rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch deleted file mode 100644 index 665a4bb1..00000000 --- a/features/rt/locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 634b7dbcbf43a51f9c149ff014b99cf95ec798d6 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 19 Nov 2019 09:25:04 +0100 -Subject: [PATCH 131/191] locking: Make spinlock_t and rwlock_t a RCU section - on RT - -On !RT a locked spinlock_t and rwlock_t disables preemption which -implies a RCU read section. There is code that relies on that behaviour. - -Add an explicit RCU read section on RT while a sleeping lock (a lock -which would disables preemption on !RT) acquired. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/locking/rtmutex.c | 6 ++++++ - kernel/locking/rwlock-rt.c | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 4cd9d6c4cd68..d4da971759fb 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1118,6 +1118,7 @@ void __lockfunc rt_spin_lock(spinlock_t *lock) - { - spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); - rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ rcu_read_lock(); - migrate_disable(); - } - EXPORT_SYMBOL(rt_spin_lock); -@@ -1132,6 +1133,7 @@ void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) - { - spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); - rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ rcu_read_lock(); - migrate_disable(); - } - EXPORT_SYMBOL(rt_spin_lock_nested); -@@ -1141,6 +1143,7 @@ void __lockfunc rt_spin_lock_nest_lock(spinlock_t *lock, - { - spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); - rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ rcu_read_lock(); - migrate_disable(); - } - EXPORT_SYMBOL(rt_spin_lock_nest_lock); -@@ -1151,6 +1154,7 @@ void __lockfunc rt_spin_unlock(spinlock_t *lock) - /* NOTE: we always pass in '1' for nested, for simplicity */ - spin_release(&lock->dep_map, _RET_IP_); - migrate_enable(); -+ rcu_read_unlock(); - rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); - } - EXPORT_SYMBOL(rt_spin_unlock); -@@ -1180,6 +1184,7 @@ int __lockfunc rt_spin_trylock(spinlock_t *lock) - ret = __rt_mutex_trylock(&lock->lock); - if (ret) { - spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ rcu_read_lock(); - migrate_disable(); - } - return ret; -@@ -1194,6 +1199,7 @@ int __lockfunc rt_spin_trylock_bh(spinlock_t *lock) - ret = __rt_mutex_trylock(&lock->lock); - if (ret) { - spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ rcu_read_lock(); - migrate_disable(); - } else { - local_bh_enable(); -diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c -index 948d10214ee2..cc8bc2ef4ba2 100644 ---- a/kernel/locking/rwlock-rt.c -+++ b/kernel/locking/rwlock-rt.c -@@ -270,6 +270,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) - ret = __read_rt_trylock(rwlock); - if (ret) { - rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); -+ rcu_read_lock(); - migrate_disable(); - } - return ret; -@@ -283,6 +284,7 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock) - ret = __write_rt_trylock(rwlock); - if (ret) { - rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); -+ rcu_read_lock(); - migrate_disable(); - } - return ret; -@@ -293,6 +295,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) - { - rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); - __read_rt_lock(rwlock); -+ rcu_read_lock(); - migrate_disable(); - } - EXPORT_SYMBOL(rt_read_lock); -@@ -301,6 +304,7 @@ void __lockfunc rt_write_lock(rwlock_t *rwlock) - { - rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); - __write_rt_lock(rwlock); -+ rcu_read_lock(); - migrate_disable(); - } - EXPORT_SYMBOL(rt_write_lock); -@@ -309,6 +313,7 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) - { - rwlock_release(&rwlock->dep_map, _RET_IP_); - migrate_enable(); -+ rcu_read_unlock(); - __read_rt_unlock(rwlock); - } - EXPORT_SYMBOL(rt_read_unlock); -@@ -317,6 +322,7 @@ void __lockfunc rt_write_unlock(rwlock_t *rwlock) - { - rwlock_release(&rwlock->dep_map, _RET_IP_); - migrate_enable(); -+ rcu_read_unlock(); - __write_rt_unlock(rwlock); - } - EXPORT_SYMBOL(rt_write_unlock); --- -2.19.1 - diff --git a/features/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch b/features/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch deleted file mode 100644 index 198af701..00000000 --- a/features/rt/locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 4c06cc850cb5404dedbdefec937342ce96422992 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 4 Aug 2017 17:40:42 +0200 -Subject: [PATCH 103/191] locking: don't check for __LINUX_SPINLOCK_TYPES_H on - -RT archs - -Upstream uses arch_spinlock_t within spinlock_t and requests that -spinlock_types.h header file is included first. -On -RT we have the rt_mutex with its raw_lock wait_lock which needs -architectures' spinlock_types.h header file for its definition. However -we need rt_mutex first because it is used to build the spinlock_t so -that check does not work for us. -Therefore I am dropping that check. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/alpha/include/asm/spinlock_types.h | 4 ---- - arch/arm/include/asm/spinlock_types.h | 4 ---- - arch/arm64/include/asm/spinlock_types.h | 4 ---- - arch/hexagon/include/asm/spinlock_types.h | 4 ---- - arch/ia64/include/asm/spinlock_types.h | 4 ---- - arch/powerpc/include/asm/spinlock_types.h | 4 ---- - arch/s390/include/asm/spinlock_types.h | 4 ---- - arch/sh/include/asm/spinlock_types.h | 4 ---- - arch/xtensa/include/asm/spinlock_types.h | 4 ---- - 9 files changed, 36 deletions(-) - -diff --git a/arch/alpha/include/asm/spinlock_types.h b/arch/alpha/include/asm/spinlock_types.h -index 1d5716bc060b..6883bc952d22 100644 ---- a/arch/alpha/include/asm/spinlock_types.h -+++ b/arch/alpha/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef _ALPHA_SPINLOCK_TYPES_H - #define _ALPHA_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - typedef struct { - volatile unsigned int lock; - } arch_spinlock_t; -diff --git a/arch/arm/include/asm/spinlock_types.h b/arch/arm/include/asm/spinlock_types.h -index 5976958647fe..a37c0803954b 100644 ---- a/arch/arm/include/asm/spinlock_types.h -+++ b/arch/arm/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef __ASM_SPINLOCK_TYPES_H - #define __ASM_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - #define TICKET_SHIFT 16 - - typedef struct { -diff --git a/arch/arm64/include/asm/spinlock_types.h b/arch/arm64/include/asm/spinlock_types.h -index 18782f0c4721..6672b05350b4 100644 ---- a/arch/arm64/include/asm/spinlock_types.h -+++ b/arch/arm64/include/asm/spinlock_types.h -@@ -5,10 +5,6 @@ - #ifndef __ASM_SPINLOCK_TYPES_H - #define __ASM_SPINLOCK_TYPES_H - --#if !defined(__LINUX_SPINLOCK_TYPES_H) && !defined(__ASM_SPINLOCK_H) --# error "please don't include this file directly" --#endif -- - #include <asm-generic/qspinlock_types.h> - #include <asm-generic/qrwlock_types.h> - -diff --git a/arch/hexagon/include/asm/spinlock_types.h b/arch/hexagon/include/asm/spinlock_types.h -index 19d233497ba5..de72fb23016d 100644 ---- a/arch/hexagon/include/asm/spinlock_types.h -+++ b/arch/hexagon/include/asm/spinlock_types.h -@@ -8,10 +8,6 @@ - #ifndef _ASM_SPINLOCK_TYPES_H - #define _ASM_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - typedef struct { - volatile unsigned int lock; - } arch_spinlock_t; -diff --git a/arch/ia64/include/asm/spinlock_types.h b/arch/ia64/include/asm/spinlock_types.h -index 6e345fefcdca..681408d6816f 100644 ---- a/arch/ia64/include/asm/spinlock_types.h -+++ b/arch/ia64/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef _ASM_IA64_SPINLOCK_TYPES_H - #define _ASM_IA64_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - typedef struct { - volatile unsigned int lock; - } arch_spinlock_t; -diff --git a/arch/powerpc/include/asm/spinlock_types.h b/arch/powerpc/include/asm/spinlock_types.h -index c5d742f18021..cc6922a011ba 100644 ---- a/arch/powerpc/include/asm/spinlock_types.h -+++ b/arch/powerpc/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef _ASM_POWERPC_SPINLOCK_TYPES_H - #define _ASM_POWERPC_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - #ifdef CONFIG_PPC_QUEUED_SPINLOCKS - #include <asm-generic/qspinlock_types.h> - #include <asm-generic/qrwlock_types.h> -diff --git a/arch/s390/include/asm/spinlock_types.h b/arch/s390/include/asm/spinlock_types.h -index cfed272e4fd5..8e28e8176ec8 100644 ---- a/arch/s390/include/asm/spinlock_types.h -+++ b/arch/s390/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef __ASM_SPINLOCK_TYPES_H - #define __ASM_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - typedef struct { - int lock; - } __attribute__ ((aligned (4))) arch_spinlock_t; -diff --git a/arch/sh/include/asm/spinlock_types.h b/arch/sh/include/asm/spinlock_types.h -index e82369f286a2..22ca9a98bbb8 100644 ---- a/arch/sh/include/asm/spinlock_types.h -+++ b/arch/sh/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef __ASM_SH_SPINLOCK_TYPES_H - #define __ASM_SH_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H --# error "please don't include this file directly" --#endif -- - typedef struct { - volatile unsigned int lock; - } arch_spinlock_t; -diff --git a/arch/xtensa/include/asm/spinlock_types.h b/arch/xtensa/include/asm/spinlock_types.h -index 64c9389254f1..dc846323b1cd 100644 ---- a/arch/xtensa/include/asm/spinlock_types.h -+++ b/arch/xtensa/include/asm/spinlock_types.h -@@ -2,10 +2,6 @@ - #ifndef __ASM_SPINLOCK_TYPES_H - #define __ASM_SPINLOCK_TYPES_H - --#if !defined(__LINUX_SPINLOCK_TYPES_H) && !defined(__ASM_SPINLOCK_H) --# error "please don't include this file directly" --#endif -- - #include <asm-generic/qspinlock_types.h> - #include <asm-generic/qrwlock_types.h> - --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch b/features/rt/locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch deleted file mode 100644 index 2e0997d6..00000000 --- a/features/rt/locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 50f8ea4c311b4bc5100595c2c43f02754afa2798 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 2 Dec 2015 11:34:07 +0100 -Subject: [PATCH 076/191] locking/rtmutex: Allow rt_mutex_trylock() on - PREEMPT_RT - -Non PREEMPT_RT kernel can deadlock on rt_mutex_trylock() in softirq -context. -On PREEMPT_RT the softirq context is handled in thread context. This -avoids the deadlock in the slow path and PI-boosting will be done on the -correct thread. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/locking/rtmutex.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 03ffb955b286..f0bc7fcae441 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1866,7 +1866,11 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) - - int __sched __rt_mutex_trylock(struct rt_mutex *lock) - { -+#ifdef CONFIG_PREEMPT_RT -+ if (WARN_ON_ONCE(in_irq() || in_nmi())) -+#else - if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq())) -+#endif - return 0; - - return rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Avoid-include-hell.patch b/features/rt/locking-rtmutex-Avoid-include-hell.patch deleted file mode 100644 index 57b13749..00000000 --- a/features/rt/locking-rtmutex-Avoid-include-hell.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1fec4e5db16df775436f8ababd922f46ee58e7e0 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 29 Jun 2011 20:06:39 +0200 -Subject: [PATCH 069/191] locking/rtmutex: Avoid include hell - -Include only the required raw types. This avoids pulling in the -complete spinlock header which in turn requires rtmutex.h at some point. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/rtmutex.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index 243fabc2c85f..add1dab27df5 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -15,7 +15,7 @@ - - #include <linux/linkage.h> - #include <linux/rbtree.h> --#include <linux/spinlock_types.h> -+#include <linux/spinlock_types_raw.h> - - extern int max_lock_depth; /* for sysctl */ - --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Handle-the-various-new-futex-race-co.patch b/features/rt/locking-rtmutex-Handle-the-various-new-futex-race-co.patch deleted file mode 100644 index 12a83eab..00000000 --- a/features/rt/locking-rtmutex-Handle-the-various-new-futex-race-co.patch +++ /dev/null @@ -1,255 +0,0 @@ -From d8b0c4e14162b18ee6a955f443a6a1b3fa8473e1 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 10 Jun 2011 11:04:15 +0200 -Subject: [PATCH 065/191] locking/rtmutex: Handle the various new futex race - conditions - -RT opens a few new interesting race conditions in the rtmutex/futex -combo due to futex hash bucket lock being a 'sleeping' spinlock and -therefor not disabling preemption. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/futex.c | 78 ++++++++++++++++++++++++++------- - kernel/locking/rtmutex.c | 36 ++++++++++++--- - kernel/locking/rtmutex_common.h | 2 + - 3 files changed, 95 insertions(+), 21 deletions(-) - -diff --git a/kernel/futex.c b/kernel/futex.c -index e68db7745039..0315333c0587 100644 ---- a/kernel/futex.c -+++ b/kernel/futex.c -@@ -2154,6 +2154,16 @@ static int futex_requeue(u32 __user *uaddr1, unsigned int flags, - */ - requeue_pi_wake_futex(this, &key2, hb2); - continue; -+ } else if (ret == -EAGAIN) { -+ /* -+ * Waiter was woken by timeout or -+ * signal and has set pi_blocked_on to -+ * PI_WAKEUP_INPROGRESS before we -+ * tried to enqueue it on the rtmutex. -+ */ -+ this->pi_state = NULL; -+ put_pi_state(pi_state); -+ continue; - } else if (ret) { - /* - * rt_mutex_start_proxy_lock() detected a -@@ -3171,7 +3181,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - { - struct hrtimer_sleeper timeout, *to; - struct rt_mutex_waiter rt_waiter; -- struct futex_hash_bucket *hb; -+ struct futex_hash_bucket *hb, *hb2; - union futex_key key2 = FUTEX_KEY_INIT; - struct futex_q q = futex_q_init; - int res, ret; -@@ -3223,20 +3233,55 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - /* Queue the futex_q, drop the hb lock, wait for wakeup. */ - futex_wait_queue_me(hb, &q, to); - -- spin_lock(&hb->lock); -- ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); -- spin_unlock(&hb->lock); -- if (ret) -- goto out; -+ /* -+ * On RT we must avoid races with requeue and trying to block -+ * on two mutexes (hb->lock and uaddr2's rtmutex) by -+ * serializing access to pi_blocked_on with pi_lock. -+ */ -+ raw_spin_lock_irq(¤t->pi_lock); -+ if (current->pi_blocked_on) { -+ /* -+ * We have been requeued or are in the process of -+ * being requeued. -+ */ -+ raw_spin_unlock_irq(¤t->pi_lock); -+ } else { -+ /* -+ * Setting pi_blocked_on to PI_WAKEUP_INPROGRESS -+ * prevents a concurrent requeue from moving us to the -+ * uaddr2 rtmutex. After that we can safely acquire -+ * (and possibly block on) hb->lock. -+ */ -+ current->pi_blocked_on = PI_WAKEUP_INPROGRESS; -+ raw_spin_unlock_irq(¤t->pi_lock); -+ -+ spin_lock(&hb->lock); -+ -+ /* -+ * Clean up pi_blocked_on. We might leak it otherwise -+ * when we succeeded with the hb->lock in the fast -+ * path. -+ */ -+ raw_spin_lock_irq(¤t->pi_lock); -+ current->pi_blocked_on = NULL; -+ raw_spin_unlock_irq(¤t->pi_lock); -+ -+ ret = handle_early_requeue_pi_wakeup(hb, &q, &key2, to); -+ spin_unlock(&hb->lock); -+ if (ret) -+ goto out; -+ } - - /* -- * In order for us to be here, we know our q.key == key2, and since -- * we took the hb->lock above, we also know that futex_requeue() has -- * completed and we no longer have to concern ourselves with a wakeup -- * race with the atomic proxy lock acquisition by the requeue code. The -- * futex_requeue dropped our key1 reference and incremented our key2 -- * reference count. -+ * In order to be here, we have either been requeued, are in -+ * the process of being requeued, or requeue successfully -+ * acquired uaddr2 on our behalf. If pi_blocked_on was -+ * non-null above, we may be racing with a requeue. Do not -+ * rely on q->lock_ptr to be hb2->lock until after blocking on -+ * hb->lock or hb2->lock. The futex_requeue dropped our key1 -+ * reference and incremented our key2 reference count. - */ -+ hb2 = hash_futex(&key2); - - /* Check if the requeue code acquired the second futex for us. */ - if (!q.rt_waiter) { -@@ -3245,14 +3290,16 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - * did a lock-steal - fix up the PI-state in that case. - */ - if (q.pi_state && (q.pi_state->owner != current)) { -- spin_lock(q.lock_ptr); -+ spin_lock(&hb2->lock); -+ BUG_ON(&hb2->lock != q.lock_ptr); - ret = fixup_pi_state_owner(uaddr2, &q, current); - /* - * Drop the reference to the pi state which - * the requeue_pi() code acquired for us. - */ - put_pi_state(q.pi_state); -- spin_unlock(q.lock_ptr); -+ spin_unlock(&hb2->lock); -+ - /* - * Adjust the return value. It's either -EFAULT or - * success (1) but the caller expects 0 for success. -@@ -3271,7 +3318,8 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - pi_mutex = &q.pi_state->pi_mutex; - ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); - -- spin_lock(q.lock_ptr); -+ spin_lock(&hb2->lock); -+ BUG_ON(&hb2->lock != q.lock_ptr); - if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) - ret = 0; - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index c9a37b6d6ea0..7fff3b88b96b 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -136,6 +136,11 @@ static void fixup_rt_mutex_waiters(struct rt_mutex *lock) - WRITE_ONCE(*p, owner & ~RT_MUTEX_HAS_WAITERS); - } - -+static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter) -+{ -+ return waiter && waiter != PI_WAKEUP_INPROGRESS; -+} -+ - /* - * We can speed up the acquire/release, if there's no debugging state to be - * set up. -@@ -360,7 +365,8 @@ int max_lock_depth = 1024; - - static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) - { -- return p->pi_blocked_on ? p->pi_blocked_on->lock : NULL; -+ return rt_mutex_real_waiter(p->pi_blocked_on) ? -+ p->pi_blocked_on->lock : NULL; - } - - /* -@@ -496,7 +502,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * reached or the state of the chain has changed while we - * dropped the locks. - */ -- if (!waiter) -+ if (!rt_mutex_real_waiter(waiter)) - goto out_unlock_pi; - - /* -@@ -929,6 +935,22 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - return -EDEADLK; - - raw_spin_lock(&task->pi_lock); -+ /* -+ * In the case of futex requeue PI, this will be a proxy -+ * lock. The task will wake unaware that it is enqueueed on -+ * this lock. Avoid blocking on two locks and corrupting -+ * pi_blocked_on via the PI_WAKEUP_INPROGRESS -+ * flag. futex_wait_requeue_pi() sets this when it wakes up -+ * before requeue (due to a signal or timeout). Do not enqueue -+ * the task if PI_WAKEUP_INPROGRESS is set. -+ */ -+ if (task != current && task->pi_blocked_on == PI_WAKEUP_INPROGRESS) { -+ raw_spin_unlock(&task->pi_lock); -+ return -EAGAIN; -+ } -+ -+ BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)); -+ - waiter->task = task; - waiter->lock = lock; - waiter->prio = task->prio; -@@ -952,7 +974,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - rt_mutex_enqueue_pi(owner, waiter); - - rt_mutex_adjust_prio(owner); -- if (owner->pi_blocked_on) -+ if (rt_mutex_real_waiter(owner->pi_blocked_on)) - chain_walk = 1; - } else if (rt_mutex_cond_detect_deadlock(waiter, chwalk)) { - chain_walk = 1; -@@ -1048,7 +1070,7 @@ static void remove_waiter(struct rt_mutex *lock, - { - bool is_top_waiter = (waiter == rt_mutex_top_waiter(lock)); - struct task_struct *owner = rt_mutex_owner(lock); -- struct rt_mutex *next_lock; -+ struct rt_mutex *next_lock = NULL; - - lockdep_assert_held(&lock->wait_lock); - -@@ -1074,7 +1096,8 @@ static void remove_waiter(struct rt_mutex *lock, - rt_mutex_adjust_prio(owner); - - /* Store the lock on which owner is blocked or NULL */ -- next_lock = task_blocked_on_lock(owner); -+ if (rt_mutex_real_waiter(owner->pi_blocked_on)) -+ next_lock = task_blocked_on_lock(owner); - - raw_spin_unlock(&owner->pi_lock); - -@@ -1110,7 +1133,8 @@ void rt_mutex_adjust_pi(struct task_struct *task) - raw_spin_lock_irqsave(&task->pi_lock, flags); - - waiter = task->pi_blocked_on; -- if (!waiter || rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { -+ if (!rt_mutex_real_waiter(waiter) || -+ rt_mutex_waiter_equal(waiter, task_to_waiter(task))) { - raw_spin_unlock_irqrestore(&task->pi_lock, flags); - return; - } -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index b1455dc2366f..096b16cfb096 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -125,6 +125,8 @@ enum rtmutex_chainwalk { - /* - * PI-futex support (proxy locking functions, etc.): - */ -+#define PI_WAKEUP_INPROGRESS ((struct rt_mutex_waiter *) 1) -+ - extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); - extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, - struct task_struct *proxy_owner); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Make-lock_killable-work.patch b/features/rt/locking-rtmutex-Make-lock_killable-work.patch deleted file mode 100644 index f68466c3..00000000 --- a/features/rt/locking-rtmutex-Make-lock_killable-work.patch +++ /dev/null @@ -1,49 +0,0 @@ -From fee27667d6f81e0cd5a7e9ca9fe1422c613775d0 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sat, 1 Apr 2017 12:50:59 +0200 -Subject: [PATCH 067/191] locking/rtmutex: Make lock_killable work - -Locking an rt mutex killable does not work because signal handling is -restricted to TASK_INTERRUPTIBLE. - -Use signal_pending_state() unconditionally. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/locking/rtmutex.c | 19 +++++++------------ - 1 file changed, 7 insertions(+), 12 deletions(-) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 4d2a57e8dcb9..b346dbc37d6d 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1179,18 +1179,13 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, - if (try_to_take_rt_mutex(lock, current, waiter)) - break; - -- /* -- * TASK_INTERRUPTIBLE checks for signals and -- * timeout. Ignored otherwise. -- */ -- if (likely(state == TASK_INTERRUPTIBLE)) { -- /* Signal pending? */ -- if (signal_pending(current)) -- ret = -EINTR; -- if (timeout && !timeout->task) -- ret = -ETIMEDOUT; -- if (ret) -- break; -+ if (timeout && !timeout->task) { -+ ret = -ETIMEDOUT; -+ break; -+ } -+ if (signal_pending_state(state, current)) { -+ ret = -EINTR; -+ break; - } - - raw_spin_unlock_irq(&lock->wait_lock); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch b/features/rt/locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch deleted file mode 100644 index 61fe6760..00000000 --- a/features/rt/locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch +++ /dev/null @@ -1,59 +0,0 @@ -From d3f167aba99034929675a15535bcbd7deccf97bc Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 29 Sep 2020 16:32:49 +0200 -Subject: [PATCH 063/191] locking/rtmutex: Move rt_mutex_init() outside of - CONFIG_DEBUG_RT_MUTEXES - -rt_mutex_init() only initializes lockdep if CONFIG_DEBUG_RT_MUTEXES is -enabled. The static initializer (DEFINE_RT_MUTEX) does not have such a -restriction. - -Move rt_mutex_init() outside of CONFIG_DEBUG_RT_MUTEXES. -Move the remaining functions in this CONFIG_DEBUG_RT_MUTEXES block to -the upper block. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rtmutex.h | 12 +++--------- - 1 file changed, 3 insertions(+), 9 deletions(-) - -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index 88a0ba806066..2dc10b582d4a 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -43,6 +43,7 @@ struct hrtimer_sleeper; - extern int rt_mutex_debug_check_no_locks_freed(const void *from, - unsigned long len); - extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task); -+ extern void rt_mutex_debug_task_free(struct task_struct *tsk); - #else - static inline int rt_mutex_debug_check_no_locks_freed(const void *from, - unsigned long len) -@@ -50,22 +51,15 @@ struct hrtimer_sleeper; - return 0; - } - # define rt_mutex_debug_check_no_locks_held(task) do { } while (0) -+# define rt_mutex_debug_task_free(t) do { } while (0) - #endif - --#ifdef CONFIG_DEBUG_RT_MUTEXES -- --# define rt_mutex_init(mutex) \ -+#define rt_mutex_init(mutex) \ - do { \ - static struct lock_class_key __key; \ - __rt_mutex_init(mutex, __func__, &__key); \ - } while (0) - -- extern void rt_mutex_debug_task_free(struct task_struct *tsk); --#else --# define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL, NULL) --# define rt_mutex_debug_task_free(t) do { } while (0) --#endif -- - #ifdef CONFIG_DEBUG_LOCK_ALLOC - #define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \ - , .dep_map = { .name = #mutexname } --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch b/features/rt/locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch deleted file mode 100644 index 3d8c655e..00000000 --- a/features/rt/locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch +++ /dev/null @@ -1,144 +0,0 @@ -From e5c1aab430c174bc70abbda6936ea83bd7eb4db6 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 16:14:22 +0200 -Subject: [PATCH 072/191] locking/rtmutex: Provide rt_mutex_slowlock_locked() - -This is the inner-part of rt_mutex_slowlock(), required for rwsem-rt. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/locking/rtmutex.c | 67 +++++++++++++++++++-------------- - kernel/locking/rtmutex_common.h | 7 ++++ - 2 files changed, 45 insertions(+), 29 deletions(-) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index b346dbc37d6d..670c4a577322 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1216,35 +1216,16 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, - } - } - --/* -- * Slow path lock function: -- */ --static int __sched --rt_mutex_slowlock(struct rt_mutex *lock, int state, -- struct hrtimer_sleeper *timeout, -- enum rtmutex_chainwalk chwalk) -+int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, -+ struct hrtimer_sleeper *timeout, -+ enum rtmutex_chainwalk chwalk, -+ struct rt_mutex_waiter *waiter) - { -- struct rt_mutex_waiter waiter; -- unsigned long flags; -- int ret = 0; -- -- rt_mutex_init_waiter(&waiter); -- -- /* -- * Technically we could use raw_spin_[un]lock_irq() here, but this can -- * be called in early boot if the cmpxchg() fast path is disabled -- * (debug, no architecture support). In this case we will acquire the -- * rtmutex with lock->wait_lock held. But we cannot unconditionally -- * enable interrupts in that early boot case. So we need to use the -- * irqsave/restore variants. -- */ -- raw_spin_lock_irqsave(&lock->wait_lock, flags); -+ int ret; - - /* Try to acquire the lock again: */ -- if (try_to_take_rt_mutex(lock, current, NULL)) { -- raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -+ if (try_to_take_rt_mutex(lock, current, NULL)) - return 0; -- } - - set_current_state(state); - -@@ -1252,16 +1233,16 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - if (unlikely(timeout)) - hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS); - -- ret = task_blocks_on_rt_mutex(lock, &waiter, current, chwalk); -+ ret = task_blocks_on_rt_mutex(lock, waiter, current, chwalk); - - if (likely(!ret)) - /* sleep on the mutex */ -- ret = __rt_mutex_slowlock(lock, state, timeout, &waiter); -+ ret = __rt_mutex_slowlock(lock, state, timeout, waiter); - - if (unlikely(ret)) { - __set_current_state(TASK_RUNNING); -- remove_waiter(lock, &waiter); -- rt_mutex_handle_deadlock(ret, chwalk, &waiter); -+ remove_waiter(lock, waiter); -+ rt_mutex_handle_deadlock(ret, chwalk, waiter); - } - - /* -@@ -1269,6 +1250,34 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - * unconditionally. We might have to fix that up. - */ - fixup_rt_mutex_waiters(lock); -+ return ret; -+} -+ -+/* -+ * Slow path lock function: -+ */ -+static int __sched -+rt_mutex_slowlock(struct rt_mutex *lock, int state, -+ struct hrtimer_sleeper *timeout, -+ enum rtmutex_chainwalk chwalk) -+{ -+ struct rt_mutex_waiter waiter; -+ unsigned long flags; -+ int ret = 0; -+ -+ rt_mutex_init_waiter(&waiter); -+ -+ /* -+ * Technically we could use raw_spin_[un]lock_irq() here, but this can -+ * be called in early boot if the cmpxchg() fast path is disabled -+ * (debug, no architecture support). In this case we will acquire the -+ * rtmutex with lock->wait_lock held. But we cannot unconditionally -+ * enable interrupts in that early boot case. So we need to use the -+ * irqsave/restore variants. -+ */ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); -+ -+ ret = rt_mutex_slowlock_locked(lock, state, timeout, chwalk, &waiter); - - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index 37cd6b3bf6f4..b5a2affa59d5 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -15,6 +15,7 @@ - - #include <linux/rtmutex.h> - #include <linux/sched/wake_q.h> -+#include <linux/sched/debug.h> - - /* - * This is the control structure for tasks blocked on a rt_mutex, -@@ -153,6 +154,12 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, - struct wake_q_head *wqh); - - extern void rt_mutex_postunlock(struct wake_q_head *wake_q); -+/* RW semaphore special interface */ -+ -+int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, -+ struct hrtimer_sleeper *timeout, -+ enum rtmutex_chainwalk chwalk, -+ struct rt_mutex_waiter *waiter); - - #ifdef CONFIG_DEBUG_RT_MUTEXES - # include "rtmutex-debug.h" --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Remove-cruft.patch b/features/rt/locking-rtmutex-Remove-cruft.patch deleted file mode 100644 index e2db5d4c..00000000 --- a/features/rt/locking-rtmutex-Remove-cruft.patch +++ /dev/null @@ -1,98 +0,0 @@ -From e859f18657493031c5e83651fea4298b1e5dd97b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 29 Sep 2020 15:21:17 +0200 -Subject: [PATCH 061/191] locking/rtmutex: Remove cruft - -Most of this is around since the very beginning. I'm not sure if this -was used while the rtmutex-deadlock-tester was around but today it seems -to only waste memory: -- save_state: No users -- name: Assigned and printed if a dead lock was detected. I'm keeping it - but want to point out that lockdep has the same information. -- file + line: Printed if ::name was NULL. This is only used for - in-kernel locks so it ::name shouldn't be NULL and then ::file and - ::line isn't used. -- magic: Assigned to NULL by rt_mutex_destroy(). - -Remove members of rt_mutex which are not used. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rtmutex.h | 7 ++----- - kernel/locking/rtmutex-debug.c | 7 +------ - kernel/locking/rtmutex.c | 3 --- - kernel/locking/rtmutex_common.h | 1 - - 4 files changed, 3 insertions(+), 15 deletions(-) - -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index 6fd615a0eea9..16f974a22f51 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -32,10 +32,7 @@ struct rt_mutex { - struct rb_root_cached waiters; - struct task_struct *owner; - #ifdef CONFIG_DEBUG_RT_MUTEXES -- int save_state; -- const char *name, *file; -- int line; -- void *magic; -+ const char *name; - #endif - #ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; -@@ -60,7 +57,7 @@ struct hrtimer_sleeper; - - #ifdef CONFIG_DEBUG_RT_MUTEXES - # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ -- , .name = #mutexname, .file = __FILE__, .line = __LINE__ -+ , .name = #mutexname - - # define rt_mutex_init(mutex) \ - do { \ -diff --git a/kernel/locking/rtmutex-debug.c b/kernel/locking/rtmutex-debug.c -index 36e69100e8e0..7e411b946d4c 100644 ---- a/kernel/locking/rtmutex-debug.c -+++ b/kernel/locking/rtmutex-debug.c -@@ -42,12 +42,7 @@ static void printk_task(struct task_struct *p) - - static void printk_lock(struct rt_mutex *lock, int print_owner) - { -- if (lock->name) -- printk(" [%p] {%s}\n", -- lock, lock->name); -- else -- printk(" [%p] {%s:%d}\n", -- lock, lock->file, lock->line); -+ printk(" [%p] {%s}\n", lock, lock->name); - - if (print_owner && rt_mutex_owner(lock)) { - printk(".. ->owner: %p\n", lock->owner); -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 48fff6437901..170e160fc0b5 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1640,9 +1640,6 @@ void __sched rt_mutex_futex_unlock(struct rt_mutex *lock) - void rt_mutex_destroy(struct rt_mutex *lock) - { - WARN_ON(rt_mutex_is_locked(lock)); --#ifdef CONFIG_DEBUG_RT_MUTEXES -- lock->magic = NULL; --#endif - } - EXPORT_SYMBOL_GPL(rt_mutex_destroy); - -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index ca6fb489007b..e6913103d7ff 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -30,7 +30,6 @@ struct rt_mutex_waiter { - struct task_struct *task; - struct rt_mutex *lock; - #ifdef CONFIG_DEBUG_RT_MUTEXES -- unsigned long ip; - struct pid *deadlock_task_pid; - struct rt_mutex *deadlock_lock; - #endif --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Remove-output-from-deadlock-detector.patch b/features/rt/locking-rtmutex-Remove-output-from-deadlock-detector.patch deleted file mode 100644 index fbcd6d07..00000000 --- a/features/rt/locking-rtmutex-Remove-output-from-deadlock-detector.patch +++ /dev/null @@ -1,311 +0,0 @@ -From 485d93ce4bd0dfae3a0324cc8b0257ae3de02d01 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 29 Sep 2020 16:05:11 +0200 -Subject: [PATCH 062/191] locking/rtmutex: Remove output from deadlock - detector. - -In commit - f5694788ad8da ("rt_mutex: Add lockdep annotations") - -rtmutex gained lockdep annotation for rt_mutex_lock() and and related -functions. -lockdep will see the locking order and may complain about a deadlock -before rtmutex' own mechanism gets a chance to detect it. -The rtmutex deadlock detector will only complain locks with the -RT_MUTEX_MIN_CHAINWALK and a waiter must be pending. That means it -works only for in-kernel locks because the futex interface always uses -RT_MUTEX_FULL_CHAINWALK. -The requirement for an active waiter limits the detector to actual -deadlocks and makes it possible to report potential deadlocks like -lockdep does. -It looks like lockdep is better suited for reporting deadlocks. - -Remove rtmutex' debug print on deadlock detection. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rtmutex.h | 7 --- - kernel/locking/rtmutex-debug.c | 97 --------------------------------- - kernel/locking/rtmutex-debug.h | 11 ---- - kernel/locking/rtmutex.c | 9 --- - kernel/locking/rtmutex.h | 7 --- - kernel/locking/rtmutex_common.h | 4 -- - 6 files changed, 135 deletions(-) - -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index 16f974a22f51..88a0ba806066 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -31,9 +31,6 @@ struct rt_mutex { - raw_spinlock_t wait_lock; - struct rb_root_cached waiters; - struct task_struct *owner; --#ifdef CONFIG_DEBUG_RT_MUTEXES -- const char *name; --#endif - #ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; - #endif -@@ -56,8 +53,6 @@ struct hrtimer_sleeper; - #endif - - #ifdef CONFIG_DEBUG_RT_MUTEXES --# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ -- , .name = #mutexname - - # define rt_mutex_init(mutex) \ - do { \ -@@ -67,7 +62,6 @@ do { \ - - extern void rt_mutex_debug_task_free(struct task_struct *tsk); - #else --# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) - # define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL, NULL) - # define rt_mutex_debug_task_free(t) do { } while (0) - #endif -@@ -83,7 +77,6 @@ do { \ - { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ - , .waiters = RB_ROOT_CACHED \ - , .owner = NULL \ -- __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \ - __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)} - - #define DEFINE_RT_MUTEX(mutexname) \ -diff --git a/kernel/locking/rtmutex-debug.c b/kernel/locking/rtmutex-debug.c -index 7e411b946d4c..fb150100335f 100644 ---- a/kernel/locking/rtmutex-debug.c -+++ b/kernel/locking/rtmutex-debug.c -@@ -32,105 +32,12 @@ - - #include "rtmutex_common.h" - --static void printk_task(struct task_struct *p) --{ -- if (p) -- printk("%16s:%5d [%p, %3d]", p->comm, task_pid_nr(p), p, p->prio); -- else -- printk("<none>"); --} -- --static void printk_lock(struct rt_mutex *lock, int print_owner) --{ -- printk(" [%p] {%s}\n", lock, lock->name); -- -- if (print_owner && rt_mutex_owner(lock)) { -- printk(".. ->owner: %p\n", lock->owner); -- printk(".. held by: "); -- printk_task(rt_mutex_owner(lock)); -- printk("\n"); -- } --} -- - void rt_mutex_debug_task_free(struct task_struct *task) - { - DEBUG_LOCKS_WARN_ON(!RB_EMPTY_ROOT(&task->pi_waiters.rb_root)); - DEBUG_LOCKS_WARN_ON(task->pi_blocked_on); - } - --/* -- * We fill out the fields in the waiter to store the information about -- * the deadlock. We print when we return. act_waiter can be NULL in -- * case of a remove waiter operation. -- */ --void debug_rt_mutex_deadlock(enum rtmutex_chainwalk chwalk, -- struct rt_mutex_waiter *act_waiter, -- struct rt_mutex *lock) --{ -- struct task_struct *task; -- -- if (!debug_locks || chwalk == RT_MUTEX_FULL_CHAINWALK || !act_waiter) -- return; -- -- task = rt_mutex_owner(act_waiter->lock); -- if (task && task != current) { -- act_waiter->deadlock_task_pid = get_pid(task_pid(task)); -- act_waiter->deadlock_lock = lock; -- } --} -- --void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter) --{ -- struct task_struct *task; -- -- if (!waiter->deadlock_lock || !debug_locks) -- return; -- -- rcu_read_lock(); -- task = pid_task(waiter->deadlock_task_pid, PIDTYPE_PID); -- if (!task) { -- rcu_read_unlock(); -- return; -- } -- -- if (!debug_locks_off()) { -- rcu_read_unlock(); -- return; -- } -- -- pr_warn("\n"); -- pr_warn("============================================\n"); -- pr_warn("WARNING: circular locking deadlock detected!\n"); -- pr_warn("%s\n", print_tainted()); -- pr_warn("--------------------------------------------\n"); -- printk("%s/%d is deadlocking current task %s/%d\n\n", -- task->comm, task_pid_nr(task), -- current->comm, task_pid_nr(current)); -- -- printk("\n1) %s/%d is trying to acquire this lock:\n", -- current->comm, task_pid_nr(current)); -- printk_lock(waiter->lock, 1); -- -- printk("\n2) %s/%d is blocked on this lock:\n", -- task->comm, task_pid_nr(task)); -- printk_lock(waiter->deadlock_lock, 1); -- -- debug_show_held_locks(current); -- debug_show_held_locks(task); -- -- printk("\n%s/%d's [blocked] stackdump:\n\n", -- task->comm, task_pid_nr(task)); -- show_stack(task, NULL, KERN_DEFAULT); -- printk("\n%s/%d's [current] stackdump:\n\n", -- current->comm, task_pid_nr(current)); -- dump_stack(); -- debug_show_all_locks(); -- rcu_read_unlock(); -- -- printk("[ turning off deadlock detection." -- "Please report this trace. ]\n\n"); --} -- - void debug_rt_mutex_lock(struct rt_mutex *lock) - { - } -@@ -153,12 +60,10 @@ void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock) - void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter) - { - memset(waiter, 0x11, sizeof(*waiter)); -- waiter->deadlock_task_pid = NULL; - } - - void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter) - { -- put_pid(waiter->deadlock_task_pid); - memset(waiter, 0x22, sizeof(*waiter)); - } - -@@ -168,10 +73,8 @@ void debug_rt_mutex_init(struct rt_mutex *lock, const char *name, struct lock_cl - * Make sure we are not reinitializing a held lock: - */ - debug_check_no_locks_freed((void *)lock, sizeof(*lock)); -- lock->name = name; - - #ifdef CONFIG_DEBUG_LOCK_ALLOC - lockdep_init_map(&lock->dep_map, name, key, 0); - #endif - } -- -diff --git a/kernel/locking/rtmutex-debug.h b/kernel/locking/rtmutex-debug.h -index fc549713bba3..659e93e256c6 100644 ---- a/kernel/locking/rtmutex-debug.h -+++ b/kernel/locking/rtmutex-debug.h -@@ -18,20 +18,9 @@ extern void debug_rt_mutex_unlock(struct rt_mutex *lock); - extern void debug_rt_mutex_proxy_lock(struct rt_mutex *lock, - struct task_struct *powner); - extern void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock); --extern void debug_rt_mutex_deadlock(enum rtmutex_chainwalk chwalk, -- struct rt_mutex_waiter *waiter, -- struct rt_mutex *lock); --extern void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter); --# define debug_rt_mutex_reset_waiter(w) \ -- do { (w)->deadlock_lock = NULL; } while (0) - - static inline bool debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter, - enum rtmutex_chainwalk walk) - { - return (waiter != NULL); - } -- --static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w) --{ -- debug_rt_mutex_print_deadlock(w); --} -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 170e160fc0b5..5e04d7a247d9 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -579,7 +579,6 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * walk, we detected a deadlock. - */ - if (lock == orig_lock || rt_mutex_owner(lock) == top_task) { -- debug_rt_mutex_deadlock(chwalk, orig_waiter, lock); - raw_spin_unlock(&lock->wait_lock); - ret = -EDEADLK; - goto out_unlock_pi; -@@ -1171,8 +1170,6 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, - - raw_spin_unlock_irq(&lock->wait_lock); - -- debug_rt_mutex_print_deadlock(waiter); -- - schedule(); - - raw_spin_lock_irq(&lock->wait_lock); -@@ -1193,10 +1190,6 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, - if (res != -EDEADLOCK || detect_deadlock) - return; - -- /* -- * Yell lowdly and stop the task right here. -- */ -- rt_mutex_print_deadlock(w); - while (1) { - set_current_state(TASK_INTERRUPTIBLE); - schedule(); -@@ -1750,8 +1743,6 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, - ret = 0; - } - -- debug_rt_mutex_print_deadlock(waiter); -- - return ret; - } - -diff --git a/kernel/locking/rtmutex.h b/kernel/locking/rtmutex.h -index 732f96abf462..338ccd29119a 100644 ---- a/kernel/locking/rtmutex.h -+++ b/kernel/locking/rtmutex.h -@@ -19,15 +19,8 @@ - #define debug_rt_mutex_proxy_unlock(l) do { } while (0) - #define debug_rt_mutex_unlock(l) do { } while (0) - #define debug_rt_mutex_init(m, n, k) do { } while (0) --#define debug_rt_mutex_deadlock(d, a ,l) do { } while (0) --#define debug_rt_mutex_print_deadlock(w) do { } while (0) - #define debug_rt_mutex_reset_waiter(w) do { } while (0) - --static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w) --{ -- WARN(1, "rtmutex deadlock detected\n"); --} -- - static inline bool debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *w, - enum rtmutex_chainwalk walk) - { -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index e6913103d7ff..b1455dc2366f 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -29,10 +29,6 @@ struct rt_mutex_waiter { - struct rb_node pi_tree_entry; - struct task_struct *task; - struct rt_mutex *lock; --#ifdef CONFIG_DEBUG_RT_MUTEXES -- struct pid *deadlock_task_pid; -- struct rt_mutex *deadlock_lock; --#endif - int prio; - u64 deadline; - }; --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Remove-rt_mutex_timed_lock.patch b/features/rt/locking-rtmutex-Remove-rt_mutex_timed_lock.patch deleted file mode 100644 index 33f0f4da..00000000 --- a/features/rt/locking-rtmutex-Remove-rt_mutex_timed_lock.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 0f2d138c83afbe1bb580d0d1ab2e50418bdb7e6e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 7 Oct 2020 12:11:33 +0200 -Subject: [PATCH 064/191] locking/rtmutex: Remove rt_mutex_timed_lock() - -rt_mutex_timed_lock() has no callers since commit - c051b21f71d1f ("rtmutex: Confine deadlock logic to futex") - -Remove rt_mutex_timed_lock(). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rtmutex.h | 3 --- - kernel/locking/rtmutex.c | 46 ---------------------------------------- - 2 files changed, 49 deletions(-) - -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index 2dc10b582d4a..243fabc2c85f 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -99,9 +99,6 @@ extern void rt_mutex_lock(struct rt_mutex *lock); - #endif - - extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); --extern int rt_mutex_timed_lock(struct rt_mutex *lock, -- struct hrtimer_sleeper *timeout); -- - extern int rt_mutex_trylock(struct rt_mutex *lock); - - extern void rt_mutex_unlock(struct rt_mutex *lock); -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 5e04d7a247d9..c9a37b6d6ea0 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1387,21 +1387,6 @@ rt_mutex_fastlock(struct rt_mutex *lock, int state, - return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK); - } - --static inline int --rt_mutex_timed_fastlock(struct rt_mutex *lock, int state, -- struct hrtimer_sleeper *timeout, -- enum rtmutex_chainwalk chwalk, -- int (*slowfn)(struct rt_mutex *lock, int state, -- struct hrtimer_sleeper *timeout, -- enum rtmutex_chainwalk chwalk)) --{ -- if (chwalk == RT_MUTEX_MIN_CHAINWALK && -- likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) -- return 0; -- -- return slowfn(lock, state, timeout, chwalk); --} -- - static inline int - rt_mutex_fasttrylock(struct rt_mutex *lock, - int (*slowfn)(struct rt_mutex *lock)) -@@ -1509,37 +1494,6 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) - return __rt_mutex_slowtrylock(lock); - } - --/** -- * rt_mutex_timed_lock - lock a rt_mutex interruptible -- * the timeout structure is provided -- * by the caller -- * -- * @lock: the rt_mutex to be locked -- * @timeout: timeout structure or NULL (no timeout) -- * -- * Returns: -- * 0 on success -- * -EINTR when interrupted by a signal -- * -ETIMEDOUT when the timeout expired -- */ --int --rt_mutex_timed_lock(struct rt_mutex *lock, struct hrtimer_sleeper *timeout) --{ -- int ret; -- -- might_sleep(); -- -- mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); -- ret = rt_mutex_timed_fastlock(lock, TASK_INTERRUPTIBLE, timeout, -- RT_MUTEX_MIN_CHAINWALK, -- rt_mutex_slowlock); -- if (ret) -- mutex_release(&lock->dep_map, _RET_IP_); -- -- return ret; --} --EXPORT_SYMBOL_GPL(rt_mutex_timed_lock); -- - /** - * rt_mutex_trylock - try to lock a rt_mutex - * --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-Use-custom-scheduling-function-for-s.patch b/features/rt/locking-rtmutex-Use-custom-scheduling-function-for-s.patch deleted file mode 100644 index 3ba23b2f..00000000 --- a/features/rt/locking-rtmutex-Use-custom-scheduling-function-for-s.patch +++ /dev/null @@ -1,242 +0,0 @@ -From 7e9de9093f6ab9c69a00c038c12e21054214f301 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 6 Oct 2020 13:07:17 +0200 -Subject: [PATCH 082/191] locking/rtmutex: Use custom scheduling function for - spin-schedule() - -PREEMPT_RT builds the rwsem, mutex, spinlock and rwlock typed locks on -top of a rtmutex lock. While blocked task->pi_blocked_on is set -(tsk_is_pi_blocked()) and task needs to schedule away while waiting. - -The schedule process must distinguish between blocking on a regular -sleeping lock (rwsem and mutex) and a RT-only sleeping lock (spinlock -and rwlock): -- rwsem and mutex must flush block requests (blk_schedule_flush_plug()) - even if blocked on a lock. This can not deadlock because this also - happens for non-RT. - There should be a warning if the scheduling point is within a RCU read - section. - -- spinlock and rwlock must not flush block requests. This will deadlock - if the callback attempts to acquire a lock which is already acquired. - Similarly to being preempted, there should be no warning if the - scheduling point is within a RCU read section. - -Add preempt_schedule_lock() which is invoked if scheduling is required -while blocking on a PREEMPT_RT-only sleeping lock. -Remove tsk_is_pi_blocked() from the scheduler path which is no longer -needed with the additional scheduler entry point. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm64/include/asm/preempt.h | 3 +++ - arch/x86/include/asm/preempt.h | 3 +++ - include/asm-generic/preempt.h | 3 +++ - include/linux/sched/rt.h | 8 -------- - kernel/locking/rtmutex.c | 2 +- - kernel/locking/rwlock-rt.c | 2 +- - kernel/sched/core.c | 32 +++++++++++++++++++++----------- - 7 files changed, 32 insertions(+), 21 deletions(-) - -diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h -index 80e946b2abee..f06a23898540 100644 ---- a/arch/arm64/include/asm/preempt.h -+++ b/arch/arm64/include/asm/preempt.h -@@ -81,6 +81,9 @@ static inline bool should_resched(int preempt_offset) - - #ifdef CONFIG_PREEMPTION - void preempt_schedule(void); -+#ifdef CONFIG_PREEMPT_RT -+void preempt_schedule_lock(void); -+#endif - #define __preempt_schedule() preempt_schedule() - void preempt_schedule_notrace(void); - #define __preempt_schedule_notrace() preempt_schedule_notrace() -diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h -index f8cb8af4de5c..7e0358f99d22 100644 ---- a/arch/x86/include/asm/preempt.h -+++ b/arch/x86/include/asm/preempt.h -@@ -104,6 +104,9 @@ static __always_inline bool should_resched(int preempt_offset) - } - - #ifdef CONFIG_PREEMPTION -+#ifdef CONFIG_PREEMPT_RT -+ extern void preempt_schedule_lock(void); -+#endif - - extern asmlinkage void preempt_schedule(void); - extern asmlinkage void preempt_schedule_thunk(void); -diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h -index d683f5e6d791..71c1535db56a 100644 ---- a/include/asm-generic/preempt.h -+++ b/include/asm-generic/preempt.h -@@ -79,6 +79,9 @@ static __always_inline bool should_resched(int preempt_offset) - } - - #ifdef CONFIG_PREEMPTION -+#ifdef CONFIG_PREEMPT_RT -+extern void preempt_schedule_lock(void); -+#endif - extern asmlinkage void preempt_schedule(void); - #define __preempt_schedule() preempt_schedule() - extern asmlinkage void preempt_schedule_notrace(void); -diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h -index e5af028c08b4..994c25640e15 100644 ---- a/include/linux/sched/rt.h -+++ b/include/linux/sched/rt.h -@@ -39,20 +39,12 @@ static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *p) - } - extern void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task); - extern void rt_mutex_adjust_pi(struct task_struct *p); --static inline bool tsk_is_pi_blocked(struct task_struct *tsk) --{ -- return tsk->pi_blocked_on != NULL; --} - #else - static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) - { - return NULL; - } - # define rt_mutex_adjust_pi(p) do { } while (0) --static inline bool tsk_is_pi_blocked(struct task_struct *tsk) --{ -- return false; --} - #endif - - extern void normalize_rt_tasks(void); -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 3fc947dd2e60..4cd9d6c4cd68 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1049,7 +1049,7 @@ void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - if (top_waiter != waiter || adaptive_wait(lock, lock_owner)) -- schedule(); -+ preempt_schedule_lock(); - - raw_spin_lock_irqsave(&lock->wait_lock, flags); - -diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c -index 64c4f5728b11..948d10214ee2 100644 ---- a/kernel/locking/rwlock-rt.c -+++ b/kernel/locking/rwlock-rt.c -@@ -211,7 +211,7 @@ static void __write_rt_lock(struct rt_rw_lock *lock) - raw_spin_unlock_irqrestore(&m->wait_lock, flags); - - if (atomic_read(&lock->readers) != 0) -- schedule(); -+ preempt_schedule_lock(); - - raw_spin_lock_irqsave(&m->wait_lock, flags); - -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 46e7db92b343..59fb8b18799f 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -5004,7 +5004,7 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) - * - * WARNING: must be called with preemption disabled! - */ --static void __sched notrace __schedule(bool preempt) -+static void __sched notrace __schedule(bool preempt, bool spinning_lock) - { - struct task_struct *prev, *next; - unsigned long *switch_count; -@@ -5057,7 +5057,7 @@ static void __sched notrace __schedule(bool preempt) - * - ptrace_{,un}freeze_traced() can change ->state underneath us. - */ - prev_state = prev->state; -- if (!preempt && prev_state) { -+ if ((!preempt || spinning_lock) && prev_state) { - if (signal_pending_state(prev_state, prev)) { - prev->state = TASK_RUNNING; - } else { -@@ -5141,7 +5141,7 @@ void __noreturn do_task_dead(void) - /* Tell freezer to ignore us: */ - current->flags |= PF_NOFREEZE; - -- __schedule(false); -+ __schedule(false, false); - BUG(); - - /* Avoid "noreturn function does return" - but don't continue if BUG() is a NOP: */ -@@ -5174,9 +5174,6 @@ static inline void sched_submit_work(struct task_struct *tsk) - preempt_enable_no_resched(); - } - -- if (tsk_is_pi_blocked(tsk)) -- return; -- - /* - * If we are going to sleep and we have plugged IO queued, - * make sure to submit it to avoid deadlocks. -@@ -5202,7 +5199,7 @@ asmlinkage __visible void __sched schedule(void) - sched_submit_work(tsk); - do { - preempt_disable(); -- __schedule(false); -+ __schedule(false, false); - sched_preempt_enable_no_resched(); - } while (need_resched()); - sched_update_worker(tsk); -@@ -5230,7 +5227,7 @@ void __sched schedule_idle(void) - */ - WARN_ON_ONCE(current->state); - do { -- __schedule(false); -+ __schedule(false, false); - } while (need_resched()); - } - -@@ -5283,7 +5280,7 @@ static void __sched notrace preempt_schedule_common(void) - */ - preempt_disable_notrace(); - preempt_latency_start(1); -- __schedule(true); -+ __schedule(true, false); - preempt_latency_stop(1); - preempt_enable_no_resched_notrace(); - -@@ -5313,6 +5310,19 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) - NOKPROBE_SYMBOL(preempt_schedule); - EXPORT_SYMBOL(preempt_schedule); - -+#ifdef CONFIG_PREEMPT_RT -+void __sched notrace preempt_schedule_lock(void) -+{ -+ do { -+ preempt_disable(); -+ __schedule(true, true); -+ sched_preempt_enable_no_resched(); -+ } while (need_resched()); -+} -+NOKPROBE_SYMBOL(preempt_schedule_lock); -+EXPORT_SYMBOL(preempt_schedule_lock); -+#endif -+ - #ifdef CONFIG_PREEMPT_DYNAMIC - DEFINE_STATIC_CALL(preempt_schedule, __preempt_schedule_func); - EXPORT_STATIC_CALL_TRAMP(preempt_schedule); -@@ -5362,7 +5372,7 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) - * an infinite recursion. - */ - prev_ctx = exception_enter(); -- __schedule(true); -+ __schedule(true, false); - exception_exit(prev_ctx); - - preempt_latency_stop(1); -@@ -5580,7 +5590,7 @@ asmlinkage __visible void __sched preempt_schedule_irq(void) - do { - preempt_disable(); - local_irq_enable(); -- __schedule(true); -+ __schedule(true, false); - local_irq_disable(); - sched_preempt_enable_no_resched(); - } while (need_resched()); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-add-mutex-implementation-based-on-rt.patch b/features/rt/locking-rtmutex-add-mutex-implementation-based-on-rt.patch deleted file mode 100644 index 287478c2..00000000 --- a/features/rt/locking-rtmutex-add-mutex-implementation-based-on-rt.patch +++ /dev/null @@ -1,384 +0,0 @@ -From d1a9c2854e127015b149b26f5d1bf143c7f2c8ce Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 17:17:03 +0200 -Subject: [PATCH 077/191] locking/rtmutex: add mutex implementation based on - rtmutex - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/mutex_rt.h | 130 ++++++++++++++++++++++ - kernel/locking/mutex-rt.c | 224 ++++++++++++++++++++++++++++++++++++++ - 2 files changed, 354 insertions(+) - create mode 100644 include/linux/mutex_rt.h - create mode 100644 kernel/locking/mutex-rt.c - -diff --git a/include/linux/mutex_rt.h b/include/linux/mutex_rt.h -new file mode 100644 -index 000000000000..f0b2e07cd5c5 ---- /dev/null -+++ b/include/linux/mutex_rt.h -@@ -0,0 +1,130 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef __LINUX_MUTEX_RT_H -+#define __LINUX_MUTEX_RT_H -+ -+#ifndef __LINUX_MUTEX_H -+#error "Please include mutex.h" -+#endif -+ -+#include <linux/rtmutex.h> -+ -+/* FIXME: Just for __lockfunc */ -+#include <linux/spinlock.h> -+ -+struct mutex { -+ struct rt_mutex lock; -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ struct lockdep_map dep_map; -+#endif -+}; -+ -+#define __MUTEX_INITIALIZER(mutexname) \ -+ { \ -+ .lock = __RT_MUTEX_INITIALIZER(mutexname.lock) \ -+ __DEP_MAP_MUTEX_INITIALIZER(mutexname) \ -+ } -+ -+#define DEFINE_MUTEX(mutexname) \ -+ struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) -+ -+extern void __mutex_do_init(struct mutex *lock, const char *name, struct lock_class_key *key); -+extern void __lockfunc _mutex_lock(struct mutex *lock); -+extern void __lockfunc _mutex_lock_io_nested(struct mutex *lock, int subclass); -+extern int __lockfunc _mutex_lock_interruptible(struct mutex *lock); -+extern int __lockfunc _mutex_lock_killable(struct mutex *lock); -+extern void __lockfunc _mutex_lock_nested(struct mutex *lock, int subclass); -+extern void __lockfunc _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); -+extern int __lockfunc _mutex_lock_interruptible_nested(struct mutex *lock, int subclass); -+extern int __lockfunc _mutex_lock_killable_nested(struct mutex *lock, int subclass); -+extern int __lockfunc _mutex_trylock(struct mutex *lock); -+extern void __lockfunc _mutex_unlock(struct mutex *lock); -+ -+#define mutex_is_locked(l) rt_mutex_is_locked(&(l)->lock) -+#define mutex_lock(l) _mutex_lock(l) -+#define mutex_lock_interruptible(l) _mutex_lock_interruptible(l) -+#define mutex_lock_killable(l) _mutex_lock_killable(l) -+#define mutex_trylock(l) _mutex_trylock(l) -+#define mutex_unlock(l) _mutex_unlock(l) -+#define mutex_lock_io(l) _mutex_lock_io_nested(l, 0); -+ -+#define __mutex_owner(l) ((l)->lock.owner) -+ -+#ifdef CONFIG_DEBUG_MUTEXES -+#define mutex_destroy(l) rt_mutex_destroy(&(l)->lock) -+#else -+static inline void mutex_destroy(struct mutex *lock) {} -+#endif -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define mutex_lock_nested(l, s) _mutex_lock_nested(l, s) -+# define mutex_lock_interruptible_nested(l, s) \ -+ _mutex_lock_interruptible_nested(l, s) -+# define mutex_lock_killable_nested(l, s) \ -+ _mutex_lock_killable_nested(l, s) -+# define mutex_lock_io_nested(l, s) _mutex_lock_io_nested(l, s) -+ -+# define mutex_lock_nest_lock(lock, nest_lock) \ -+do { \ -+ typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ -+ _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ -+} while (0) -+ -+#else -+# define mutex_lock_nested(l, s) _mutex_lock(l) -+# define mutex_lock_interruptible_nested(l, s) \ -+ _mutex_lock_interruptible(l) -+# define mutex_lock_killable_nested(l, s) \ -+ _mutex_lock_killable(l) -+# define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) -+# define mutex_lock_io_nested(l, s) _mutex_lock_io_nested(l, s) -+#endif -+ -+# define mutex_init(mutex) \ -+do { \ -+ static struct lock_class_key __key; \ -+ \ -+ rt_mutex_init(&(mutex)->lock); \ -+ __mutex_do_init((mutex), #mutex, &__key); \ -+} while (0) -+ -+# define __mutex_init(mutex, name, key) \ -+do { \ -+ rt_mutex_init(&(mutex)->lock); \ -+ __mutex_do_init((mutex), name, key); \ -+} while (0) -+ -+/** -+ * These values are chosen such that FAIL and SUCCESS match the -+ * values of the regular mutex_trylock(). -+ */ -+enum mutex_trylock_recursive_enum { -+ MUTEX_TRYLOCK_FAILED = 0, -+ MUTEX_TRYLOCK_SUCCESS = 1, -+ MUTEX_TRYLOCK_RECURSIVE, -+}; -+/** -+ * mutex_trylock_recursive - trylock variant that allows recursive locking -+ * @lock: mutex to be locked -+ * -+ * This function should not be used, _ever_. It is purely for hysterical GEM -+ * raisins, and once those are gone this will be removed. -+ * -+ * Returns: -+ * MUTEX_TRYLOCK_FAILED - trylock failed, -+ * MUTEX_TRYLOCK_SUCCESS - lock acquired, -+ * MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. -+ */ -+int __rt_mutex_owner_current(struct rt_mutex *lock); -+ -+static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enum -+mutex_trylock_recursive(struct mutex *lock) -+{ -+ if (unlikely(__rt_mutex_owner_current(&lock->lock))) -+ return MUTEX_TRYLOCK_RECURSIVE; -+ -+ return mutex_trylock(lock); -+} -+ -+extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); -+ -+#endif -diff --git a/kernel/locking/mutex-rt.c b/kernel/locking/mutex-rt.c -new file mode 100644 -index 000000000000..2b849e6b9b4a ---- /dev/null -+++ b/kernel/locking/mutex-rt.c -@@ -0,0 +1,224 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * Real-Time Preemption Support -+ * -+ * started by Ingo Molnar: -+ * -+ * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> -+ * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> -+ * -+ * historic credit for proving that Linux spinlocks can be implemented via -+ * RT-aware mutexes goes to many people: The Pmutex project (Dirk Grambow -+ * and others) who prototyped it on 2.4 and did lots of comparative -+ * research and analysis; TimeSys, for proving that you can implement a -+ * fully preemptible kernel via the use of IRQ threading and mutexes; -+ * Bill Huey for persuasively arguing on lkml that the mutex model is the -+ * right one; and to MontaVista, who ported pmutexes to 2.6. -+ * -+ * This code is a from-scratch implementation and is not based on pmutexes, -+ * but the idea of converting spinlocks to mutexes is used here too. -+ * -+ * lock debugging, locking tree, deadlock detection: -+ * -+ * Copyright (C) 2004, LynuxWorks, Inc., Igor Manyilov, Bill Huey -+ * Released under the General Public License (GPL). -+ * -+ * Includes portions of the generic R/W semaphore implementation from: -+ * -+ * Copyright (c) 2001 David Howells (dhowells@redhat.com). -+ * - Derived partially from idea by Andrea Arcangeli <andrea@suse.de> -+ * - Derived also from comments by Linus -+ * -+ * Pending ownership of locks and ownership stealing: -+ * -+ * Copyright (C) 2005, Kihon Technologies Inc., Steven Rostedt -+ * -+ * (also by Steven Rostedt) -+ * - Converted single pi_lock to individual task locks. -+ * -+ * By Esben Nielsen: -+ * Doing priority inheritance with help of the scheduler. -+ * -+ * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> -+ * - major rework based on Esben Nielsens initial patch -+ * - replaced thread_info references by task_struct refs -+ * - removed task->pending_owner dependency -+ * - BKL drop/reacquire for semaphore style locks to avoid deadlocks -+ * in the scheduler return path as discussed with Steven Rostedt -+ * -+ * Copyright (C) 2006, Kihon Technologies Inc. -+ * Steven Rostedt <rostedt@goodmis.org> -+ * - debugged and patched Thomas Gleixner's rework. -+ * - added back the cmpxchg to the rework. -+ * - turned atomic require back on for SMP. -+ */ -+ -+#include <linux/spinlock.h> -+#include <linux/rtmutex.h> -+#include <linux/sched.h> -+#include <linux/delay.h> -+#include <linux/module.h> -+#include <linux/kallsyms.h> -+#include <linux/syscalls.h> -+#include <linux/interrupt.h> -+#include <linux/plist.h> -+#include <linux/fs.h> -+#include <linux/futex.h> -+#include <linux/hrtimer.h> -+#include <linux/blkdev.h> -+ -+#include "rtmutex_common.h" -+ -+/* -+ * struct mutex functions -+ */ -+void __mutex_do_init(struct mutex *mutex, const char *name, -+ struct lock_class_key *key) -+{ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ /* -+ * Make sure we are not reinitializing a held lock: -+ */ -+ debug_check_no_locks_freed((void *)mutex, sizeof(*mutex)); -+ lockdep_init_map(&mutex->dep_map, name, key, 0); -+#endif -+ mutex->lock.save_state = 0; -+} -+EXPORT_SYMBOL(__mutex_do_init); -+ -+static int _mutex_lock_blk_flush(struct mutex *lock, int state) -+{ -+ /* -+ * Flush blk before ->pi_blocked_on is set. At schedule() time it is too -+ * late if one of the callbacks needs to acquire a sleeping lock. -+ */ -+ if (blk_needs_flush_plug(current)) -+ blk_schedule_flush_plug(current); -+ return __rt_mutex_lock_state(&lock->lock, state); -+} -+ -+void __lockfunc _mutex_lock(struct mutex *lock) -+{ -+ mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); -+ _mutex_lock_blk_flush(lock, TASK_UNINTERRUPTIBLE); -+} -+EXPORT_SYMBOL(_mutex_lock); -+ -+void __lockfunc _mutex_lock_io_nested(struct mutex *lock, int subclass) -+{ -+ int token; -+ -+ token = io_schedule_prepare(); -+ -+ mutex_acquire_nest(&lock->dep_map, subclass, 0, NULL, _RET_IP_); -+ __rt_mutex_lock_state(&lock->lock, TASK_UNINTERRUPTIBLE); -+ -+ io_schedule_finish(token); -+} -+EXPORT_SYMBOL_GPL(_mutex_lock_io_nested); -+ -+int __lockfunc _mutex_lock_interruptible(struct mutex *lock) -+{ -+ int ret; -+ -+ mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); -+ ret = _mutex_lock_blk_flush(lock, TASK_INTERRUPTIBLE); -+ if (ret) -+ mutex_release(&lock->dep_map, _RET_IP_); -+ return ret; -+} -+EXPORT_SYMBOL(_mutex_lock_interruptible); -+ -+int __lockfunc _mutex_lock_killable(struct mutex *lock) -+{ -+ int ret; -+ -+ mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); -+ ret = _mutex_lock_blk_flush(lock, TASK_KILLABLE); -+ if (ret) -+ mutex_release(&lock->dep_map, _RET_IP_); -+ return ret; -+} -+EXPORT_SYMBOL(_mutex_lock_killable); -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+void __lockfunc _mutex_lock_nested(struct mutex *lock, int subclass) -+{ -+ mutex_acquire_nest(&lock->dep_map, subclass, 0, NULL, _RET_IP_); -+ _mutex_lock_blk_flush(lock, TASK_UNINTERRUPTIBLE); -+} -+EXPORT_SYMBOL(_mutex_lock_nested); -+ -+void __lockfunc _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest) -+{ -+ mutex_acquire_nest(&lock->dep_map, 0, 0, nest, _RET_IP_); -+ _mutex_lock_blk_flush(lock, TASK_UNINTERRUPTIBLE); -+} -+EXPORT_SYMBOL(_mutex_lock_nest_lock); -+ -+int __lockfunc _mutex_lock_interruptible_nested(struct mutex *lock, int subclass) -+{ -+ int ret; -+ -+ mutex_acquire_nest(&lock->dep_map, subclass, 0, NULL, _RET_IP_); -+ ret = _mutex_lock_blk_flush(lock, TASK_INTERRUPTIBLE); -+ if (ret) -+ mutex_release(&lock->dep_map, _RET_IP_); -+ return ret; -+} -+EXPORT_SYMBOL(_mutex_lock_interruptible_nested); -+ -+int __lockfunc _mutex_lock_killable_nested(struct mutex *lock, int subclass) -+{ -+ int ret; -+ -+ mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); -+ ret = _mutex_lock_blk_flush(lock, TASK_KILLABLE); -+ if (ret) -+ mutex_release(&lock->dep_map, _RET_IP_); -+ return ret; -+} -+EXPORT_SYMBOL(_mutex_lock_killable_nested); -+#endif -+ -+int __lockfunc _mutex_trylock(struct mutex *lock) -+{ -+ int ret = __rt_mutex_trylock(&lock->lock); -+ -+ if (ret) -+ mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ -+ return ret; -+} -+EXPORT_SYMBOL(_mutex_trylock); -+ -+void __lockfunc _mutex_unlock(struct mutex *lock) -+{ -+ mutex_release(&lock->dep_map, _RET_IP_); -+ __rt_mutex_unlock(&lock->lock); -+} -+EXPORT_SYMBOL(_mutex_unlock); -+ -+/** -+ * atomic_dec_and_mutex_lock - return holding mutex if we dec to 0 -+ * @cnt: the atomic which we are to dec -+ * @lock: the mutex to return holding if we dec to 0 -+ * -+ * return true and hold lock if we dec to 0, return false otherwise -+ */ -+int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock) -+{ -+ /* dec if we can't possibly hit 0 */ -+ if (atomic_add_unless(cnt, -1, 1)) -+ return 0; -+ /* we might hit 0, so take the lock */ -+ mutex_lock(lock); -+ if (!atomic_dec_and_test(cnt)) { -+ /* when we actually did the dec, we didn't hit 0 */ -+ mutex_unlock(lock); -+ return 0; -+ } -+ /* we hit 0, and we hold the lock */ -+ return 1; -+} -+EXPORT_SYMBOL(atomic_dec_and_mutex_lock); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-add-rwlock-implementation-based-on-r.patch b/features/rt/locking-rtmutex-add-rwlock-implementation-based-on-r.patch deleted file mode 100644 index c45a4242..00000000 --- a/features/rt/locking-rtmutex-add-rwlock-implementation-based-on-r.patch +++ /dev/null @@ -1,557 +0,0 @@ -From 157ad15dc4fba83f4959571c08ebc2654dbdacd6 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 17:18:06 +0200 -Subject: [PATCH 079/191] locking/rtmutex: add rwlock implementation based on - rtmutex - -The implementation is bias-based, similar to the rwsem implementation. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rwlock_rt.h | 113 +++++++++++ - include/linux/rwlock_types_rt.h | 56 ++++++ - kernel/Kconfig.locks | 2 +- - kernel/locking/rwlock-rt.c | 334 ++++++++++++++++++++++++++++++++ - 4 files changed, 504 insertions(+), 1 deletion(-) - create mode 100644 include/linux/rwlock_rt.h - create mode 100644 include/linux/rwlock_types_rt.h - create mode 100644 kernel/locking/rwlock-rt.c - -diff --git a/include/linux/rwlock_rt.h b/include/linux/rwlock_rt.h -new file mode 100644 -index 000000000000..552b8d69cdb3 ---- /dev/null -+++ b/include/linux/rwlock_rt.h -@@ -0,0 +1,113 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef __LINUX_RWLOCK_RT_H -+#define __LINUX_RWLOCK_RT_H -+ -+#ifndef __LINUX_SPINLOCK_H -+#error Do not include directly. Use spinlock.h -+#endif -+ -+extern void __lockfunc rt_write_lock(rwlock_t *rwlock); -+extern void __lockfunc rt_read_lock(rwlock_t *rwlock); -+extern int __lockfunc rt_write_trylock(rwlock_t *rwlock); -+extern int __lockfunc rt_read_trylock(rwlock_t *rwlock); -+extern void __lockfunc rt_write_unlock(rwlock_t *rwlock); -+extern void __lockfunc rt_read_unlock(rwlock_t *rwlock); -+extern int __lockfunc rt_read_can_lock(rwlock_t *rwlock); -+extern int __lockfunc rt_write_can_lock(rwlock_t *rwlock); -+extern void __rt_rwlock_init(rwlock_t *rwlock, char *name, struct lock_class_key *key); -+extern int __lockfunc rt_rwlock_is_contended(rwlock_t *rwlock); -+ -+#define read_can_lock(rwlock) rt_read_can_lock(rwlock) -+#define write_can_lock(rwlock) rt_write_can_lock(rwlock) -+ -+#define read_trylock(lock) __cond_lock(lock, rt_read_trylock(lock)) -+#define write_trylock(lock) __cond_lock(lock, rt_write_trylock(lock)) -+ -+static inline int __write_trylock_rt_irqsave(rwlock_t *lock, unsigned long *flags) -+{ -+ *flags = 0; -+ return rt_write_trylock(lock); -+} -+ -+#define write_trylock_irqsave(lock, flags) \ -+ __cond_lock(lock, __write_trylock_rt_irqsave(lock, &(flags))) -+ -+#define read_lock_irqsave(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ rt_read_lock(lock); \ -+ flags = 0; \ -+ } while (0) -+ -+#define write_lock_irqsave(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ rt_write_lock(lock); \ -+ flags = 0; \ -+ } while (0) -+ -+#define read_lock(lock) rt_read_lock(lock) -+ -+#define read_lock_bh(lock) \ -+ do { \ -+ local_bh_disable(); \ -+ rt_read_lock(lock); \ -+ } while (0) -+ -+#define read_lock_irq(lock) read_lock(lock) -+ -+#define write_lock(lock) rt_write_lock(lock) -+ -+#define write_lock_bh(lock) \ -+ do { \ -+ local_bh_disable(); \ -+ rt_write_lock(lock); \ -+ } while (0) -+ -+#define write_lock_irq(lock) write_lock(lock) -+ -+#define read_unlock(lock) rt_read_unlock(lock) -+ -+#define read_unlock_bh(lock) \ -+ do { \ -+ rt_read_unlock(lock); \ -+ local_bh_enable(); \ -+ } while (0) -+ -+#define read_unlock_irq(lock) read_unlock(lock) -+ -+#define write_unlock(lock) rt_write_unlock(lock) -+ -+#define write_unlock_bh(lock) \ -+ do { \ -+ rt_write_unlock(lock); \ -+ local_bh_enable(); \ -+ } while (0) -+ -+#define write_unlock_irq(lock) write_unlock(lock) -+ -+#define read_unlock_irqrestore(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ (void) flags; \ -+ rt_read_unlock(lock); \ -+ } while (0) -+ -+#define write_unlock_irqrestore(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ (void) flags; \ -+ rt_write_unlock(lock); \ -+ } while (0) -+ -+#define rwlock_init(rwl) \ -+do { \ -+ static struct lock_class_key __key; \ -+ \ -+ __rt_rwlock_init(rwl, #rwl, &__key); \ -+} while (0) -+ -+#define rwlock_is_contended(lock) \ -+ rt_rwlock_is_contended(lock) -+ -+#endif -diff --git a/include/linux/rwlock_types_rt.h b/include/linux/rwlock_types_rt.h -new file mode 100644 -index 000000000000..4762391d659b ---- /dev/null -+++ b/include/linux/rwlock_types_rt.h -@@ -0,0 +1,56 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef __LINUX_RWLOCK_TYPES_RT_H -+#define __LINUX_RWLOCK_TYPES_RT_H -+ -+#ifndef __LINUX_SPINLOCK_TYPES_H -+#error "Do not include directly. Include spinlock_types.h instead" -+#endif -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define RW_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname } -+#else -+# define RW_DEP_MAP_INIT(lockname) -+#endif -+ -+typedef struct rt_rw_lock rwlock_t; -+ -+#define __RW_LOCK_UNLOCKED(name) __RWLOCK_RT_INITIALIZER(name) -+ -+#define DEFINE_RWLOCK(name) \ -+ rwlock_t name = __RW_LOCK_UNLOCKED(name) -+ -+/* -+ * A reader biased implementation primarily for CPU pinning. -+ * -+ * Can be selected as general replacement for the single reader RT rwlock -+ * variant -+ */ -+struct rt_rw_lock { -+ struct rt_mutex rtmutex; -+ atomic_t readers; -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ struct lockdep_map dep_map; -+#endif -+}; -+ -+#define READER_BIAS (1U << 31) -+#define WRITER_BIAS (1U << 30) -+ -+#define __RWLOCK_RT_INITIALIZER(name) \ -+{ \ -+ .readers = ATOMIC_INIT(READER_BIAS), \ -+ .rtmutex = __RT_MUTEX_INITIALIZER_SAVE_STATE(name.rtmutex), \ -+ RW_DEP_MAP_INIT(name) \ -+} -+ -+void __rwlock_biased_rt_init(struct rt_rw_lock *lock, const char *name, -+ struct lock_class_key *key); -+ -+#define rwlock_biased_rt_init(rwlock) \ -+ do { \ -+ static struct lock_class_key __key; \ -+ \ -+ __rwlock_biased_rt_init((rwlock), #rwlock, &__key); \ -+ } while (0) -+ -+#endif -diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks -index 3de8fd11873b..4198f0273ecd 100644 ---- a/kernel/Kconfig.locks -+++ b/kernel/Kconfig.locks -@@ -251,7 +251,7 @@ config ARCH_USE_QUEUED_RWLOCKS - - config QUEUED_RWLOCKS - def_bool y if ARCH_USE_QUEUED_RWLOCKS -- depends on SMP -+ depends on SMP && !PREEMPT_RT - - config ARCH_HAS_MMIOWB - bool -diff --git a/kernel/locking/rwlock-rt.c b/kernel/locking/rwlock-rt.c -new file mode 100644 -index 000000000000..64c4f5728b11 ---- /dev/null -+++ b/kernel/locking/rwlock-rt.c -@@ -0,0 +1,334 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#include <linux/sched/debug.h> -+#include <linux/export.h> -+ -+#include "rtmutex_common.h" -+#include <linux/rwlock_types_rt.h> -+ -+/* -+ * RT-specific reader/writer locks -+ * -+ * write_lock() -+ * 1) Lock lock->rtmutex -+ * 2) Remove the reader BIAS to force readers into the slow path -+ * 3) Wait until all readers have left the critical region -+ * 4) Mark it write locked -+ * -+ * write_unlock() -+ * 1) Remove the write locked marker -+ * 2) Set the reader BIAS so readers can use the fast path again -+ * 3) Unlock lock->rtmutex to release blocked readers -+ * -+ * read_lock() -+ * 1) Try fast path acquisition (reader BIAS is set) -+ * 2) Take lock->rtmutex.wait_lock which protects the writelocked flag -+ * 3) If !writelocked, acquire it for read -+ * 4) If writelocked, block on lock->rtmutex -+ * 5) unlock lock->rtmutex, goto 1) -+ * -+ * read_unlock() -+ * 1) Try fast path release (reader count != 1) -+ * 2) Wake the writer waiting in write_lock()#3 -+ * -+ * read_lock()#3 has the consequence, that rw locks on RT are not writer -+ * fair, but writers, which should be avoided in RT tasks (think tasklist -+ * lock), are subject to the rtmutex priority/DL inheritance mechanism. -+ * -+ * It's possible to make the rw locks writer fair by keeping a list of -+ * active readers. A blocked writer would force all newly incoming readers -+ * to block on the rtmutex, but the rtmutex would have to be proxy locked -+ * for one reader after the other. We can't use multi-reader inheritance -+ * because there is no way to support that with -+ * SCHED_DEADLINE. Implementing the one by one reader boosting/handover -+ * mechanism is a major surgery for a very dubious value. -+ * -+ * The risk of writer starvation is there, but the pathological use cases -+ * which trigger it are not necessarily the typical RT workloads. -+ */ -+ -+void __rwlock_biased_rt_init(struct rt_rw_lock *lock, const char *name, -+ struct lock_class_key *key) -+{ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ /* -+ * Make sure we are not reinitializing a held semaphore: -+ */ -+ debug_check_no_locks_freed((void *)lock, sizeof(*lock)); -+ lockdep_init_map(&lock->dep_map, name, key, 0); -+#endif -+ atomic_set(&lock->readers, READER_BIAS); -+ rt_mutex_init(&lock->rtmutex); -+ lock->rtmutex.save_state = 1; -+} -+ -+static int __read_rt_trylock(struct rt_rw_lock *lock) -+{ -+ int r, old; -+ -+ /* -+ * Increment reader count, if lock->readers < 0, i.e. READER_BIAS is -+ * set. -+ */ -+ for (r = atomic_read(&lock->readers); r < 0;) { -+ old = atomic_cmpxchg(&lock->readers, r, r + 1); -+ if (likely(old == r)) -+ return 1; -+ r = old; -+ } -+ return 0; -+} -+ -+static void __read_rt_lock(struct rt_rw_lock *lock) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ struct rt_mutex_waiter waiter; -+ unsigned long flags; -+ -+ if (__read_rt_trylock(lock)) -+ return; -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ /* -+ * Allow readers as long as the writer has not completely -+ * acquired the semaphore for write. -+ */ -+ if (atomic_read(&lock->readers) != WRITER_BIAS) { -+ atomic_inc(&lock->readers); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ return; -+ } -+ -+ /* -+ * Call into the slow lock path with the rtmutex->wait_lock -+ * held, so this can't result in the following race: -+ * -+ * Reader1 Reader2 Writer -+ * read_lock() -+ * write_lock() -+ * rtmutex_lock(m) -+ * swait() -+ * read_lock() -+ * unlock(m->wait_lock) -+ * read_unlock() -+ * swake() -+ * lock(m->wait_lock) -+ * lock->writelocked=true -+ * unlock(m->wait_lock) -+ * -+ * write_unlock() -+ * lock->writelocked=false -+ * rtmutex_unlock(m) -+ * read_lock() -+ * write_lock() -+ * rtmutex_lock(m) -+ * swait() -+ * rtmutex_lock(m) -+ * -+ * That would put Reader1 behind the writer waiting on -+ * Reader2 to call read_unlock() which might be unbound. -+ */ -+ rt_mutex_init_waiter(&waiter, true); -+ rt_spin_lock_slowlock_locked(m, &waiter, flags); -+ /* -+ * The slowlock() above is guaranteed to return with the rtmutex is -+ * now held, so there can't be a writer active. Increment the reader -+ * count and immediately drop the rtmutex again. -+ */ -+ atomic_inc(&lock->readers); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ rt_spin_lock_slowunlock(m); -+ -+ debug_rt_mutex_free_waiter(&waiter); -+} -+ -+static void __read_rt_unlock(struct rt_rw_lock *lock) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ struct task_struct *tsk; -+ -+ /* -+ * sem->readers can only hit 0 when a writer is waiting for the -+ * active readers to leave the critical region. -+ */ -+ if (!atomic_dec_and_test(&lock->readers)) -+ return; -+ -+ raw_spin_lock_irq(&m->wait_lock); -+ /* -+ * Wake the writer, i.e. the rtmutex owner. It might release the -+ * rtmutex concurrently in the fast path, but to clean up the rw -+ * lock it needs to acquire m->wait_lock. The worst case which can -+ * happen is a spurious wakeup. -+ */ -+ tsk = rt_mutex_owner(m); -+ if (tsk) -+ wake_up_process(tsk); -+ -+ raw_spin_unlock_irq(&m->wait_lock); -+} -+ -+static void __write_unlock_common(struct rt_rw_lock *lock, int bias, -+ unsigned long flags) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ -+ atomic_add(READER_BIAS - bias, &lock->readers); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ rt_spin_lock_slowunlock(m); -+} -+ -+static void __write_rt_lock(struct rt_rw_lock *lock) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ struct task_struct *self = current; -+ unsigned long flags; -+ -+ /* Take the rtmutex as a first step */ -+ __rt_spin_lock(m); -+ -+ /* Force readers into slow path */ -+ atomic_sub(READER_BIAS, &lock->readers); -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ -+ raw_spin_lock(&self->pi_lock); -+ self->saved_state = self->state; -+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ raw_spin_unlock(&self->pi_lock); -+ -+ for (;;) { -+ /* Have all readers left the critical region? */ -+ if (!atomic_read(&lock->readers)) { -+ atomic_set(&lock->readers, WRITER_BIAS); -+ raw_spin_lock(&self->pi_lock); -+ __set_current_state_no_track(self->saved_state); -+ self->saved_state = TASK_RUNNING; -+ raw_spin_unlock(&self->pi_lock); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ return; -+ } -+ -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ -+ if (atomic_read(&lock->readers) != 0) -+ schedule(); -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ -+ raw_spin_lock(&self->pi_lock); -+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ raw_spin_unlock(&self->pi_lock); -+ } -+} -+ -+static int __write_rt_trylock(struct rt_rw_lock *lock) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ unsigned long flags; -+ -+ if (!__rt_mutex_trylock(m)) -+ return 0; -+ -+ atomic_sub(READER_BIAS, &lock->readers); -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ if (!atomic_read(&lock->readers)) { -+ atomic_set(&lock->readers, WRITER_BIAS); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ return 1; -+ } -+ __write_unlock_common(lock, 0, flags); -+ return 0; -+} -+ -+static void __write_rt_unlock(struct rt_rw_lock *lock) -+{ -+ struct rt_mutex *m = &lock->rtmutex; -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ __write_unlock_common(lock, WRITER_BIAS, flags); -+} -+ -+int __lockfunc rt_read_can_lock(rwlock_t *rwlock) -+{ -+ return atomic_read(&rwlock->readers) < 0; -+} -+ -+int __lockfunc rt_write_can_lock(rwlock_t *rwlock) -+{ -+ return atomic_read(&rwlock->readers) == READER_BIAS; -+} -+ -+/* -+ * The common functions which get wrapped into the rwlock API. -+ */ -+int __lockfunc rt_read_trylock(rwlock_t *rwlock) -+{ -+ int ret; -+ -+ ret = __read_rt_trylock(rwlock); -+ if (ret) { -+ rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); -+ migrate_disable(); -+ } -+ return ret; -+} -+EXPORT_SYMBOL(rt_read_trylock); -+ -+int __lockfunc rt_write_trylock(rwlock_t *rwlock) -+{ -+ int ret; -+ -+ ret = __write_rt_trylock(rwlock); -+ if (ret) { -+ rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); -+ migrate_disable(); -+ } -+ return ret; -+} -+EXPORT_SYMBOL(rt_write_trylock); -+ -+void __lockfunc rt_read_lock(rwlock_t *rwlock) -+{ -+ rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); -+ __read_rt_lock(rwlock); -+ migrate_disable(); -+} -+EXPORT_SYMBOL(rt_read_lock); -+ -+void __lockfunc rt_write_lock(rwlock_t *rwlock) -+{ -+ rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); -+ __write_rt_lock(rwlock); -+ migrate_disable(); -+} -+EXPORT_SYMBOL(rt_write_lock); -+ -+void __lockfunc rt_read_unlock(rwlock_t *rwlock) -+{ -+ rwlock_release(&rwlock->dep_map, _RET_IP_); -+ migrate_enable(); -+ __read_rt_unlock(rwlock); -+} -+EXPORT_SYMBOL(rt_read_unlock); -+ -+void __lockfunc rt_write_unlock(rwlock_t *rwlock) -+{ -+ rwlock_release(&rwlock->dep_map, _RET_IP_); -+ migrate_enable(); -+ __write_rt_unlock(rwlock); -+} -+EXPORT_SYMBOL(rt_write_unlock); -+ -+void __rt_rwlock_init(rwlock_t *rwlock, char *name, struct lock_class_key *key) -+{ -+ __rwlock_biased_rt_init(rwlock, name, key); -+} -+EXPORT_SYMBOL(__rt_rwlock_init); -+ -+int __lockfunc rt_rwlock_is_contended(rwlock_t *rwlock) -+{ -+ return rt_mutex_has_waiters(&rwlock->rtmutex); -+} -+EXPORT_SYMBOL(rt_rwlock_is_contended); --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-add-rwsem-implementation-based-on-rt.patch b/features/rt/locking-rtmutex-add-rwsem-implementation-based-on-rt.patch deleted file mode 100644 index 335f9ac9..00000000 --- a/features/rt/locking-rtmutex-add-rwsem-implementation-based-on-rt.patch +++ /dev/null @@ -1,454 +0,0 @@ -From 94f118173e2b3760d995876193660096e0284c87 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 17:28:34 +0200 -Subject: [PATCH 078/191] locking/rtmutex: add rwsem implementation based on - rtmutex - -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 -priority or budget. - -The single reader restricting is painful in various ways: - - - Performance bottleneck for multi-threaded applications in the page fault - path (mmap sem) - - - Progress blocker for drivers which are carefully crafted to avoid the - potential reader/writer deadlock in mainline. - -The analysis of the writer code paths shows, that properly written RT tasks -should not take them. Syscalls like mmap(), file access which take mmap sem -write locked have unbound latencies which are completely unrelated to mmap -sem. Other R/W sem users like graphics drivers are not suitable for RT tasks -either. - -So there is little risk to hurt RT tasks when the RT rwsem implementation is -changed in the following way: - - - Allow concurrent readers - - - Make writers block until the last reader left the critical section. This - blocking is not subject to priority/budget inheritance. - - - Readers blocked on a writer inherit their priority/budget in the normal - way. - -There is a drawback with this scheme. R/W semaphores become writer unfair -though the applications which have triggered writer starvation (mostly on -mmap_sem) in the past are not really the typical workloads running on a RT -system. So while it's unlikely to hit writer starvation, it's possible. If -there are unexpected workloads on RT systems triggering it, we need to rethink -the approach. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rwsem-rt.h | 70 +++++++++ - kernel/locking/rwsem-rt.c | 318 ++++++++++++++++++++++++++++++++++++++ - 2 files changed, 388 insertions(+) - create mode 100644 include/linux/rwsem-rt.h - create mode 100644 kernel/locking/rwsem-rt.c - -diff --git a/include/linux/rwsem-rt.h b/include/linux/rwsem-rt.h -new file mode 100644 -index 000000000000..0ba8aae9a198 ---- /dev/null -+++ b/include/linux/rwsem-rt.h -@@ -0,0 +1,70 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef _LINUX_RWSEM_RT_H -+#define _LINUX_RWSEM_RT_H -+ -+#ifndef _LINUX_RWSEM_H -+#error "Include rwsem.h" -+#endif -+ -+#include <linux/rtmutex.h> -+#include <linux/swait.h> -+ -+#define READER_BIAS (1U << 31) -+#define WRITER_BIAS (1U << 30) -+ -+struct rw_semaphore { -+ atomic_t readers; -+ struct rt_mutex rtmutex; -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ struct lockdep_map dep_map; -+#endif -+}; -+ -+#define __RWSEM_INITIALIZER(name) \ -+{ \ -+ .readers = ATOMIC_INIT(READER_BIAS), \ -+ .rtmutex = __RT_MUTEX_INITIALIZER(name.rtmutex), \ -+ RW_DEP_MAP_INIT(name) \ -+} -+ -+#define DECLARE_RWSEM(lockname) \ -+ struct rw_semaphore lockname = __RWSEM_INITIALIZER(lockname) -+ -+extern void __rwsem_init(struct rw_semaphore *rwsem, const char *name, -+ struct lock_class_key *key); -+ -+#define __init_rwsem(sem, name, key) \ -+do { \ -+ rt_mutex_init(&(sem)->rtmutex); \ -+ __rwsem_init((sem), (name), (key)); \ -+} while (0) -+ -+#define init_rwsem(sem) \ -+do { \ -+ static struct lock_class_key __key; \ -+ \ -+ __init_rwsem((sem), #sem, &__key); \ -+} while (0) -+ -+static inline int rwsem_is_locked(struct rw_semaphore *sem) -+{ -+ return atomic_read(&sem->readers) != READER_BIAS; -+} -+ -+static inline int rwsem_is_contended(struct rw_semaphore *sem) -+{ -+ return atomic_read(&sem->readers) > 0; -+} -+ -+extern void __down_read(struct rw_semaphore *sem); -+extern int __down_read_interruptible(struct rw_semaphore *sem); -+extern int __down_read_killable(struct rw_semaphore *sem); -+extern int __down_read_trylock(struct rw_semaphore *sem); -+extern void __down_write(struct rw_semaphore *sem); -+extern int __must_check __down_write_killable(struct rw_semaphore *sem); -+extern int __down_write_trylock(struct rw_semaphore *sem); -+extern void __up_read(struct rw_semaphore *sem); -+extern void __up_write(struct rw_semaphore *sem); -+extern void __downgrade_write(struct rw_semaphore *sem); -+ -+#endif -diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c -new file mode 100644 -index 000000000000..a0771c150041 ---- /dev/null -+++ b/kernel/locking/rwsem-rt.c -@@ -0,0 +1,318 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#include <linux/rwsem.h> -+#include <linux/sched/debug.h> -+#include <linux/sched/signal.h> -+#include <linux/export.h> -+#include <linux/blkdev.h> -+ -+#include "rtmutex_common.h" -+ -+/* -+ * RT-specific reader/writer semaphores -+ * -+ * down_write() -+ * 1) Lock sem->rtmutex -+ * 2) Remove the reader BIAS to force readers into the slow path -+ * 3) Wait until all readers have left the critical region -+ * 4) Mark it write locked -+ * -+ * up_write() -+ * 1) Remove the write locked marker -+ * 2) Set the reader BIAS so readers can use the fast path again -+ * 3) Unlock sem->rtmutex to release blocked readers -+ * -+ * down_read() -+ * 1) Try fast path acquisition (reader BIAS is set) -+ * 2) Take sem->rtmutex.wait_lock which protects the writelocked flag -+ * 3) If !writelocked, acquire it for read -+ * 4) If writelocked, block on sem->rtmutex -+ * 5) unlock sem->rtmutex, goto 1) -+ * -+ * up_read() -+ * 1) Try fast path release (reader count != 1) -+ * 2) Wake the writer waiting in down_write()#3 -+ * -+ * down_read()#3 has the consequence, that rw semaphores on RT are not writer -+ * fair, but writers, which should be avoided in RT tasks (think mmap_sem), -+ * are subject to the rtmutex priority/DL inheritance mechanism. -+ * -+ * It's possible to make the rw semaphores writer fair by keeping a list of -+ * active readers. A blocked writer would force all newly incoming readers to -+ * block on the rtmutex, but the rtmutex would have to be proxy locked for one -+ * reader after the other. We can't use multi-reader inheritance because there -+ * is no way to support that with SCHED_DEADLINE. Implementing the one by one -+ * reader boosting/handover mechanism is a major surgery for a very dubious -+ * value. -+ * -+ * The risk of writer starvation is there, but the pathological use cases -+ * which trigger it are not necessarily the typical RT workloads. -+ */ -+ -+void __rwsem_init(struct rw_semaphore *sem, const char *name, -+ struct lock_class_key *key) -+{ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ /* -+ * Make sure we are not reinitializing a held semaphore: -+ */ -+ debug_check_no_locks_freed((void *)sem, sizeof(*sem)); -+ lockdep_init_map(&sem->dep_map, name, key, 0); -+#endif -+ atomic_set(&sem->readers, READER_BIAS); -+} -+EXPORT_SYMBOL(__rwsem_init); -+ -+int __down_read_trylock(struct rw_semaphore *sem) -+{ -+ int r, old; -+ -+ /* -+ * Increment reader count, if sem->readers < 0, i.e. READER_BIAS is -+ * set. -+ */ -+ for (r = atomic_read(&sem->readers); r < 0;) { -+ old = atomic_cmpxchg(&sem->readers, r, r + 1); -+ if (likely(old == r)) -+ return 1; -+ r = old; -+ } -+ return 0; -+} -+ -+static int __sched __down_read_common(struct rw_semaphore *sem, int state) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ struct rt_mutex_waiter waiter; -+ int ret; -+ -+ if (__down_read_trylock(sem)) -+ return 0; -+ -+ /* -+ * Flush blk before ->pi_blocked_on is set. At schedule() time it is too -+ * late if one of the callbacks needs to acquire a sleeping lock. -+ */ -+ if (blk_needs_flush_plug(current)) -+ blk_schedule_flush_plug(current); -+ -+ might_sleep(); -+ raw_spin_lock_irq(&m->wait_lock); -+ /* -+ * Allow readers as long as the writer has not completely -+ * acquired the semaphore for write. -+ */ -+ if (atomic_read(&sem->readers) != WRITER_BIAS) { -+ atomic_inc(&sem->readers); -+ raw_spin_unlock_irq(&m->wait_lock); -+ return 0; -+ } -+ -+ /* -+ * Call into the slow lock path with the rtmutex->wait_lock -+ * held, so this can't result in the following race: -+ * -+ * Reader1 Reader2 Writer -+ * down_read() -+ * down_write() -+ * rtmutex_lock(m) -+ * swait() -+ * down_read() -+ * unlock(m->wait_lock) -+ * up_read() -+ * swake() -+ * lock(m->wait_lock) -+ * sem->writelocked=true -+ * unlock(m->wait_lock) -+ * -+ * up_write() -+ * sem->writelocked=false -+ * rtmutex_unlock(m) -+ * down_read() -+ * down_write() -+ * rtmutex_lock(m) -+ * swait() -+ * rtmutex_lock(m) -+ * -+ * That would put Reader1 behind the writer waiting on -+ * Reader2 to call up_read() which might be unbound. -+ */ -+ rt_mutex_init_waiter(&waiter, false); -+ ret = rt_mutex_slowlock_locked(m, state, NULL, RT_MUTEX_MIN_CHAINWALK, -+ &waiter); -+ /* -+ * The slowlock() above is guaranteed to return with the rtmutex (for -+ * ret = 0) is now held, so there can't be a writer active. Increment -+ * the reader count and immediately drop the rtmutex again. -+ * For ret != 0 we don't hold the rtmutex and need unlock the wait_lock. -+ * We don't own the lock then. -+ */ -+ if (!ret) -+ atomic_inc(&sem->readers); -+ raw_spin_unlock_irq(&m->wait_lock); -+ if (!ret) -+ __rt_mutex_unlock(m); -+ -+ debug_rt_mutex_free_waiter(&waiter); -+ return ret; -+} -+ -+void __down_read(struct rw_semaphore *sem) -+{ -+ int ret; -+ -+ ret = __down_read_common(sem, TASK_UNINTERRUPTIBLE); -+ WARN_ON_ONCE(ret); -+} -+ -+int __down_read_interruptible(struct rw_semaphore *sem) -+{ -+ int ret; -+ -+ ret = __down_read_common(sem, TASK_INTERRUPTIBLE); -+ if (likely(!ret)) -+ return ret; -+ WARN_ONCE(ret != -EINTR, "Unexpected state: %d\n", ret); -+ return -EINTR; -+} -+ -+int __down_read_killable(struct rw_semaphore *sem) -+{ -+ int ret; -+ -+ ret = __down_read_common(sem, TASK_KILLABLE); -+ if (likely(!ret)) -+ return ret; -+ WARN_ONCE(ret != -EINTR, "Unexpected state: %d\n", ret); -+ return -EINTR; -+} -+ -+void __up_read(struct rw_semaphore *sem) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ struct task_struct *tsk; -+ -+ /* -+ * sem->readers can only hit 0 when a writer is waiting for the -+ * active readers to leave the critical region. -+ */ -+ if (!atomic_dec_and_test(&sem->readers)) -+ return; -+ -+ might_sleep(); -+ raw_spin_lock_irq(&m->wait_lock); -+ /* -+ * Wake the writer, i.e. the rtmutex owner. It might release the -+ * rtmutex concurrently in the fast path (due to a signal), but to -+ * clean up the rwsem it needs to acquire m->wait_lock. The worst -+ * case which can happen is a spurious wakeup. -+ */ -+ tsk = rt_mutex_owner(m); -+ if (tsk) -+ wake_up_process(tsk); -+ -+ raw_spin_unlock_irq(&m->wait_lock); -+} -+ -+static void __up_write_unlock(struct rw_semaphore *sem, int bias, -+ unsigned long flags) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ -+ atomic_add(READER_BIAS - bias, &sem->readers); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ __rt_mutex_unlock(m); -+} -+ -+static int __sched __down_write_common(struct rw_semaphore *sem, int state) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ unsigned long flags; -+ -+ /* -+ * Flush blk before ->pi_blocked_on is set. At schedule() time it is too -+ * late if one of the callbacks needs to acquire a sleeping lock. -+ */ -+ if (blk_needs_flush_plug(current)) -+ blk_schedule_flush_plug(current); -+ -+ /* Take the rtmutex as a first step */ -+ if (__rt_mutex_lock_state(m, state)) -+ return -EINTR; -+ -+ /* Force readers into slow path */ -+ atomic_sub(READER_BIAS, &sem->readers); -+ might_sleep(); -+ -+ set_current_state(state); -+ for (;;) { -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ /* Have all readers left the critical region? */ -+ if (!atomic_read(&sem->readers)) { -+ atomic_set(&sem->readers, WRITER_BIAS); -+ __set_current_state(TASK_RUNNING); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ return 0; -+ } -+ -+ if (signal_pending_state(state, current)) { -+ __set_current_state(TASK_RUNNING); -+ __up_write_unlock(sem, 0, flags); -+ return -EINTR; -+ } -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ -+ if (atomic_read(&sem->readers) != 0) { -+ schedule(); -+ set_current_state(state); -+ } -+ } -+} -+ -+void __sched __down_write(struct rw_semaphore *sem) -+{ -+ __down_write_common(sem, TASK_UNINTERRUPTIBLE); -+} -+ -+int __sched __down_write_killable(struct rw_semaphore *sem) -+{ -+ return __down_write_common(sem, TASK_KILLABLE); -+} -+ -+int __down_write_trylock(struct rw_semaphore *sem) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ unsigned long flags; -+ -+ if (!__rt_mutex_trylock(m)) -+ return 0; -+ -+ atomic_sub(READER_BIAS, &sem->readers); -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ if (!atomic_read(&sem->readers)) { -+ atomic_set(&sem->readers, WRITER_BIAS); -+ raw_spin_unlock_irqrestore(&m->wait_lock, flags); -+ return 1; -+ } -+ __up_write_unlock(sem, 0, flags); -+ return 0; -+} -+ -+void __up_write(struct rw_semaphore *sem) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ __up_write_unlock(sem, WRITER_BIAS, flags); -+} -+ -+void __downgrade_write(struct rw_semaphore *sem) -+{ -+ struct rt_mutex *m = &sem->rtmutex; -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&m->wait_lock, flags); -+ /* Release it and account current as reader */ -+ __up_write_unlock(sem, WRITER_BIAS - 1, flags); -+} --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-add-sleeping-lock-implementation.patch b/features/rt/locking-rtmutex-add-sleeping-lock-implementation.patch deleted file mode 100644 index 91588d81..00000000 --- a/features/rt/locking-rtmutex-add-sleeping-lock-implementation.patch +++ /dev/null @@ -1,1232 +0,0 @@ -From 479dce6155bca792fbc3d2907d5d576e0d38c554 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 17:11:19 +0200 -Subject: [PATCH 075/191] locking/rtmutex: add sleeping lock implementation - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/kernel.h | 5 + - include/linux/preempt.h | 4 + - include/linux/rtmutex.h | 19 +- - include/linux/sched.h | 7 + - include/linux/sched/wake_q.h | 13 +- - include/linux/spinlock_rt.h | 155 ++++++++++ - include/linux/spinlock_types_rt.h | 38 +++ - kernel/fork.c | 1 + - kernel/futex.c | 10 +- - kernel/locking/rtmutex.c | 451 +++++++++++++++++++++++++++--- - kernel/locking/rtmutex_common.h | 14 +- - kernel/sched/core.c | 39 ++- - 12 files changed, 698 insertions(+), 58 deletions(-) - create mode 100644 include/linux/spinlock_rt.h - create mode 100644 include/linux/spinlock_types_rt.h - -diff --git a/include/linux/kernel.h b/include/linux/kernel.h -index 5b7ed6dc99ac..0f9315891c17 100644 ---- a/include/linux/kernel.h -+++ b/include/linux/kernel.h -@@ -122,6 +122,10 @@ extern void __cant_migrate(const char *file, int line); - */ - # define might_sleep() \ - do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) -+ -+# define might_sleep_no_state_check() \ -+ do { ___might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) -+ - /** - * cant_sleep - annotation for functions that cannot sleep - * -@@ -165,6 +169,7 @@ extern void __cant_migrate(const char *file, int line); - static inline void __might_sleep(const char *file, int line, - int preempt_offset) { } - # define might_sleep() do { might_resched(); } while (0) -+# define might_sleep_no_state_check() do { might_resched(); } while (0) - # define cant_sleep() do { } while (0) - # define cant_migrate() do { } while (0) - # define sched_annotate_sleep() do { } while (0) -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index 9881eac0698f..4d244e295e85 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -121,7 +121,11 @@ - /* - * The preempt_count offset after spin_lock() - */ -+#if !defined(CONFIG_PREEMPT_RT) - #define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET -+#else -+#define PREEMPT_LOCK_OFFSET 0 -+#endif - - /* - * The preempt_count offset needed for things like: -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index b828b938c876..b02009f53026 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -19,6 +19,10 @@ - - extern int max_lock_depth; /* for sysctl */ - -+#ifdef CONFIG_DEBUG_MUTEXES -+#include <linux/debug_locks.h> -+#endif -+ - /** - * The rt_mutex structure - * -@@ -31,6 +35,7 @@ struct rt_mutex { - raw_spinlock_t wait_lock; - struct rb_root_cached waiters; - struct task_struct *owner; -+ int save_state; - #ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; - #endif -@@ -67,11 +72,19 @@ do { \ - #define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) - #endif - --#define __RT_MUTEX_INITIALIZER(mutexname) \ -- { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ -+#define __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \ -+ .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ - , .waiters = RB_ROOT_CACHED \ - , .owner = NULL \ -- __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)} -+ __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) -+ -+#define __RT_MUTEX_INITIALIZER(mutexname) \ -+ { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \ -+ , .save_state = 0 } -+ -+#define __RT_MUTEX_INITIALIZER_SAVE_STATE(mutexname) \ -+ { __RT_MUTEX_INITIALIZER_PLAIN(mutexname) \ -+ , .save_state = 1 } - - #define DEFINE_RT_MUTEX(mutexname) \ - struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname) -diff --git a/include/linux/sched.h b/include/linux/sched.h -index 3f05b8c29132..fb5350358bc8 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -141,6 +141,9 @@ struct task_group; - smp_store_mb(current->state, (state_value)); \ - } while (0) - -+#define __set_current_state_no_track(state_value) \ -+ current->state = (state_value); -+ - #define set_special_state(state_value) \ - do { \ - unsigned long flags; /* may shadow */ \ -@@ -194,6 +197,9 @@ struct task_group; - #define set_current_state(state_value) \ - smp_store_mb(current->state, (state_value)) - -+#define __set_current_state_no_track(state_value) \ -+ __set_current_state(state_value) -+ - /* - * set_special_state() should be used for those states when the blocking task - * can not use the regular condition based wait-loop. In that case we must -@@ -1018,6 +1024,7 @@ struct task_struct { - raw_spinlock_t pi_lock; - - struct wake_q_node wake_q; -+ struct wake_q_node wake_q_sleeper; - - #ifdef CONFIG_RT_MUTEXES - /* PI waiters blocked on a rt_mutex held by this task: */ -diff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h -index 26a2013ac39c..6e2dff721547 100644 ---- a/include/linux/sched/wake_q.h -+++ b/include/linux/sched/wake_q.h -@@ -58,6 +58,17 @@ static inline bool wake_q_empty(struct wake_q_head *head) - - extern void wake_q_add(struct wake_q_head *head, struct task_struct *task); - extern void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task); --extern void wake_up_q(struct wake_q_head *head); -+extern void wake_q_add_sleeper(struct wake_q_head *head, struct task_struct *task); -+extern void __wake_up_q(struct wake_q_head *head, bool sleeper); -+ -+static inline void wake_up_q(struct wake_q_head *head) -+{ -+ __wake_up_q(head, false); -+} -+ -+static inline void wake_up_q_sleeper(struct wake_q_head *head) -+{ -+ __wake_up_q(head, true); -+} - - #endif /* _LINUX_SCHED_WAKE_Q_H */ -diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h -new file mode 100644 -index 000000000000..3085132eae38 ---- /dev/null -+++ b/include/linux/spinlock_rt.h -@@ -0,0 +1,155 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef __LINUX_SPINLOCK_RT_H -+#define __LINUX_SPINLOCK_RT_H -+ -+#ifndef __LINUX_SPINLOCK_H -+#error Do not include directly. Use spinlock.h -+#endif -+ -+#include <linux/bug.h> -+ -+extern void -+__rt_spin_lock_init(spinlock_t *lock, const char *name, struct lock_class_key *key); -+ -+#define spin_lock_init(slock) \ -+do { \ -+ static struct lock_class_key __key; \ -+ \ -+ rt_mutex_init(&(slock)->lock); \ -+ __rt_spin_lock_init(slock, #slock, &__key); \ -+} while (0) -+ -+extern void __lockfunc rt_spin_lock(spinlock_t *lock); -+extern void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass); -+extern void __lockfunc rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock); -+extern void __lockfunc rt_spin_unlock(spinlock_t *lock); -+extern void __lockfunc rt_spin_lock_unlock(spinlock_t *lock); -+extern int __lockfunc rt_spin_trylock_irqsave(spinlock_t *lock, unsigned long *flags); -+extern int __lockfunc rt_spin_trylock_bh(spinlock_t *lock); -+extern int __lockfunc rt_spin_trylock(spinlock_t *lock); -+extern int atomic_dec_and_spin_lock(atomic_t *atomic, spinlock_t *lock); -+ -+/* -+ * lockdep-less calls, for derived types like rwlock: -+ * (for trylock they can use rt_mutex_trylock() directly. -+ * Migrate disable handling must be done at the call site. -+ */ -+extern void __lockfunc __rt_spin_lock(struct rt_mutex *lock); -+extern void __lockfunc __rt_spin_trylock(struct rt_mutex *lock); -+extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); -+ -+#define spin_lock(lock) rt_spin_lock(lock) -+ -+#define spin_lock_bh(lock) \ -+ do { \ -+ local_bh_disable(); \ -+ rt_spin_lock(lock); \ -+ } while (0) -+ -+#define spin_lock_irq(lock) spin_lock(lock) -+ -+#define spin_do_trylock(lock) __cond_lock(lock, rt_spin_trylock(lock)) -+ -+#define spin_trylock(lock) \ -+({ \ -+ int __locked; \ -+ __locked = spin_do_trylock(lock); \ -+ __locked; \ -+}) -+ -+#ifdef CONFIG_LOCKDEP -+# define spin_lock_nested(lock, subclass) \ -+ do { \ -+ rt_spin_lock_nested(lock, subclass); \ -+ } while (0) -+ -+#define spin_lock_bh_nested(lock, subclass) \ -+ do { \ -+ local_bh_disable(); \ -+ rt_spin_lock_nested(lock, subclass); \ -+ } while (0) -+ -+# define spin_lock_nest_lock(lock, subclass) \ -+ do { \ -+ typecheck(struct lockdep_map *, &(subclass)->dep_map); \ -+ rt_spin_lock_nest_lock(lock, &(subclass)->dep_map); \ -+ } while (0) -+ -+# define spin_lock_irqsave_nested(lock, flags, subclass) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ flags = 0; \ -+ rt_spin_lock_nested(lock, subclass); \ -+ } while (0) -+#else -+# define spin_lock_nested(lock, subclass) spin_lock(((void)(subclass), (lock))) -+# define spin_lock_nest_lock(lock, subclass) spin_lock(((void)(subclass), (lock))) -+# define spin_lock_bh_nested(lock, subclass) spin_lock_bh(((void)(subclass), (lock))) -+ -+# define spin_lock_irqsave_nested(lock, flags, subclass) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ flags = 0; \ -+ spin_lock(((void)(subclass), (lock))); \ -+ } while (0) -+#endif -+ -+#define spin_lock_irqsave(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ flags = 0; \ -+ spin_lock(lock); \ -+ } while (0) -+ -+#define spin_unlock(lock) rt_spin_unlock(lock) -+ -+#define spin_unlock_bh(lock) \ -+ do { \ -+ rt_spin_unlock(lock); \ -+ local_bh_enable(); \ -+ } while (0) -+ -+#define spin_unlock_irq(lock) spin_unlock(lock) -+ -+#define spin_unlock_irqrestore(lock, flags) \ -+ do { \ -+ typecheck(unsigned long, flags); \ -+ (void) flags; \ -+ spin_unlock(lock); \ -+ } while (0) -+ -+#define spin_trylock_bh(lock) __cond_lock(lock, rt_spin_trylock_bh(lock)) -+#define spin_trylock_irq(lock) spin_trylock(lock) -+ -+#define spin_trylock_irqsave(lock, flags) \ -+({ \ -+ int __locked; \ -+ \ -+ typecheck(unsigned long, flags); \ -+ flags = 0; \ -+ __locked = spin_trylock(lock); \ -+ __locked; \ -+}) -+ -+#ifdef CONFIG_GENERIC_LOCKBREAK -+# define spin_is_contended(lock) ((lock)->break_lock) -+#else -+# define spin_is_contended(lock) (((void)(lock), 0)) -+#endif -+ -+static inline int spin_can_lock(spinlock_t *lock) -+{ -+ return !rt_mutex_is_locked(&lock->lock); -+} -+ -+static inline int spin_is_locked(spinlock_t *lock) -+{ -+ return rt_mutex_is_locked(&lock->lock); -+} -+ -+static inline void assert_spin_locked(spinlock_t *lock) -+{ -+ BUG_ON(!spin_is_locked(lock)); -+} -+ -+#endif -diff --git a/include/linux/spinlock_types_rt.h b/include/linux/spinlock_types_rt.h -new file mode 100644 -index 000000000000..446da786e5d5 ---- /dev/null -+++ b/include/linux/spinlock_types_rt.h -@@ -0,0 +1,38 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+#ifndef __LINUX_SPINLOCK_TYPES_RT_H -+#define __LINUX_SPINLOCK_TYPES_RT_H -+ -+#ifndef __LINUX_SPINLOCK_TYPES_H -+#error "Do not include directly. Include spinlock_types.h instead" -+#endif -+ -+#include <linux/cache.h> -+ -+/* -+ * PREEMPT_RT: spinlocks - an RT mutex plus lock-break field: -+ */ -+typedef struct spinlock { -+ struct rt_mutex lock; -+ unsigned int break_lock; -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ struct lockdep_map dep_map; -+#endif -+} spinlock_t; -+ -+#define __RT_SPIN_INITIALIZER(name) \ -+ { \ -+ .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ -+ .save_state = 1, \ -+ } -+/* -+.wait_list = PLIST_HEAD_INIT_RAW((name).lock.wait_list, (name).lock.wait_lock) -+*/ -+ -+#define __SPIN_LOCK_UNLOCKED(name) \ -+ { .lock = __RT_SPIN_INITIALIZER(name.lock), \ -+ SPIN_DEP_MAP_INIT(name) } -+ -+#define DEFINE_SPINLOCK(name) \ -+ spinlock_t name = __SPIN_LOCK_UNLOCKED(name) -+ -+#endif -diff --git a/kernel/fork.c b/kernel/fork.c -index 882c91a52aa5..c0cfae6e545c 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -927,6 +927,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) - tsk->splice_pipe = NULL; - tsk->task_frag.page = NULL; - tsk->wake_q.next = NULL; -+ tsk->wake_q_sleeper.next = NULL; - - account_kernel_stack(tsk, 1); - -diff --git a/kernel/futex.c b/kernel/futex.c -index 0315333c0587..93961549dc4c 100644 ---- a/kernel/futex.c -+++ b/kernel/futex.c -@@ -1497,6 +1497,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ - struct task_struct *new_owner; - bool postunlock = false; - DEFINE_WAKE_Q(wake_q); -+ DEFINE_WAKE_Q(wake_sleeper_q); - int ret = 0; - - new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); -@@ -1546,14 +1547,15 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_ - * not fail. - */ - pi_state_update_owner(pi_state, new_owner); -- postunlock = __rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q); -+ postunlock = __rt_mutex_futex_unlock(&pi_state->pi_mutex, &wake_q, -+ &wake_sleeper_q); - } - - out_unlock: - raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); - - if (postunlock) -- rt_mutex_postunlock(&wake_q); -+ rt_mutex_postunlock(&wake_q, &wake_sleeper_q); - - return ret; - } -@@ -2857,7 +2859,7 @@ static int futex_lock_pi(u32 __user *uaddr, unsigned int flags, - goto no_block; - } - -- rt_mutex_init_waiter(&rt_waiter); -+ rt_mutex_init_waiter(&rt_waiter, false); - - /* - * On PREEMPT_RT_FULL, when hb->lock becomes an rt_mutex, we must not -@@ -3202,7 +3204,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, - * The waiter is allocated on our stack, manipulated by the requeue - * code while we sleep on uaddr. - */ -- rt_mutex_init_waiter(&rt_waiter); -+ rt_mutex_init_waiter(&rt_waiter, false); - - ret = get_futex_key(uaddr2, flags & FLAGS_SHARED, &key2, FUTEX_WRITE); - if (unlikely(ret != 0)) -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 86012b16f0c2..03ffb955b286 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -8,6 +8,11 @@ - * Copyright (C) 2005-2006 Timesys Corp., Thomas Gleixner <tglx@timesys.com> - * Copyright (C) 2005 Kihon Technologies Inc., Steven Rostedt - * Copyright (C) 2006 Esben Nielsen -+ * Adaptive Spinlocks: -+ * Copyright (C) 2008 Novell, Inc., Gregory Haskins, Sven Dietrich, -+ * and Peter Morreale, -+ * Adaptive Spinlocks simplification: -+ * Copyright (C) 2008 Red Hat, Inc., Steven Rostedt <srostedt@redhat.com> - * - * See Documentation/locking/rt-mutex-design.rst for details. - */ -@@ -233,7 +238,7 @@ static inline bool unlock_rt_mutex_safe(struct rt_mutex *lock, - * Only use with rt_mutex_waiter_{less,equal}() - */ - #define task_to_waiter(p) \ -- &(struct rt_mutex_waiter){ .prio = (p)->prio, .deadline = (p)->dl.deadline } -+ &(struct rt_mutex_waiter){ .prio = (p)->prio, .deadline = (p)->dl.deadline, .task = (p) } - - static inline int - rt_mutex_waiter_less(struct rt_mutex_waiter *left, -@@ -273,6 +278,27 @@ rt_mutex_waiter_equal(struct rt_mutex_waiter *left, - return 1; - } - -+#define STEAL_NORMAL 0 -+#define STEAL_LATERAL 1 -+ -+static inline int -+rt_mutex_steal(struct rt_mutex *lock, struct rt_mutex_waiter *waiter, int mode) -+{ -+ struct rt_mutex_waiter *top_waiter = rt_mutex_top_waiter(lock); -+ -+ if (waiter == top_waiter || rt_mutex_waiter_less(waiter, top_waiter)) -+ return 1; -+ -+ /* -+ * Note that RT tasks are excluded from lateral-steals -+ * to prevent the introduction of an unbounded latency. -+ */ -+ if (mode == STEAL_NORMAL || rt_task(waiter->task)) -+ return 0; -+ -+ return rt_mutex_waiter_equal(waiter, top_waiter); -+} -+ - #define __node_2_waiter(node) \ - rb_entry((node), struct rt_mutex_waiter, tree_entry) - -@@ -359,6 +385,14 @@ static bool rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter, - return debug_rt_mutex_detect_deadlock(waiter, chwalk); - } - -+static void rt_mutex_wake_waiter(struct rt_mutex_waiter *waiter) -+{ -+ if (waiter->savestate) -+ wake_up_lock_sleeper(waiter->task); -+ else -+ wake_up_process(waiter->task); -+} -+ - /* - * Max number of times we'll walk the boosting chain: - */ -@@ -682,13 +716,16 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * follow here. This is the end of the chain we are walking. - */ - if (!rt_mutex_owner(lock)) { -+ struct rt_mutex_waiter *lock_top_waiter; -+ - /* - * If the requeue [7] above changed the top waiter, - * then we need to wake the new top waiter up to try - * to get the lock. - */ -- if (prerequeue_top_waiter != rt_mutex_top_waiter(lock)) -- wake_up_process(rt_mutex_top_waiter(lock)->task); -+ lock_top_waiter = rt_mutex_top_waiter(lock); -+ if (prerequeue_top_waiter != lock_top_waiter) -+ rt_mutex_wake_waiter(lock_top_waiter); - raw_spin_unlock_irq(&lock->wait_lock); - return 0; - } -@@ -789,9 +826,11 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, - * @task: The task which wants to acquire the lock - * @waiter: The waiter that is queued to the lock's wait tree if the - * callsite called task_blocked_on_lock(), otherwise NULL -+ * @mode: Lock steal mode (STEAL_NORMAL, STEAL_LATERAL) - */ --static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, -- struct rt_mutex_waiter *waiter) -+static int __try_to_take_rt_mutex(struct rt_mutex *lock, -+ struct task_struct *task, -+ struct rt_mutex_waiter *waiter, int mode) - { - lockdep_assert_held(&lock->wait_lock); - -@@ -827,12 +866,11 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, - */ - if (waiter) { - /* -- * If waiter is not the highest priority waiter of -- * @lock, give up. -+ * If waiter is not the highest priority waiter of @lock, -+ * or its peer when lateral steal is allowed, give up. - */ -- if (waiter != rt_mutex_top_waiter(lock)) -+ if (!rt_mutex_steal(lock, waiter, mode)) - return 0; -- - /* - * We can acquire the lock. Remove the waiter from the - * lock waiters tree. -@@ -850,14 +888,12 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, - */ - if (rt_mutex_has_waiters(lock)) { - /* -- * If @task->prio is greater than or equal to -- * the top waiter priority (kernel view), -- * @task lost. -+ * If @task->prio is greater than the top waiter -+ * priority (kernel view), or equal to it when a -+ * lateral steal is forbidden, @task lost. - */ -- if (!rt_mutex_waiter_less(task_to_waiter(task), -- rt_mutex_top_waiter(lock))) -+ if (!rt_mutex_steal(lock, task_to_waiter(task), mode)) - return 0; -- - /* - * The current top waiter stays enqueued. We - * don't have to change anything in the lock -@@ -904,6 +940,289 @@ static int try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, - return 1; - } - -+#ifdef CONFIG_PREEMPT_RT -+/* -+ * preemptible spin_lock functions: -+ */ -+static inline void rt_spin_lock_fastlock(struct rt_mutex *lock, -+ void (*slowfn)(struct rt_mutex *lock)) -+{ -+ might_sleep_no_state_check(); -+ -+ if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) -+ return; -+ else -+ slowfn(lock); -+} -+ -+static inline void rt_spin_lock_fastunlock(struct rt_mutex *lock, -+ void (*slowfn)(struct rt_mutex *lock)) -+{ -+ if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) -+ return; -+ else -+ slowfn(lock); -+} -+#ifdef CONFIG_SMP -+/* -+ * Note that owner is a speculative pointer and dereferencing relies -+ * on rcu_read_lock() and the check against the lock owner. -+ */ -+static int adaptive_wait(struct rt_mutex *lock, -+ struct task_struct *owner) -+{ -+ int res = 0; -+ -+ rcu_read_lock(); -+ for (;;) { -+ if (owner != rt_mutex_owner(lock)) -+ break; -+ /* -+ * Ensure that owner->on_cpu is dereferenced _after_ -+ * checking the above to be valid. -+ */ -+ barrier(); -+ if (!owner->on_cpu) { -+ res = 1; -+ break; -+ } -+ cpu_relax(); -+ } -+ rcu_read_unlock(); -+ return res; -+} -+#else -+static int adaptive_wait(struct rt_mutex *lock, -+ struct task_struct *orig_owner) -+{ -+ return 1; -+} -+#endif -+ -+static int task_blocks_on_rt_mutex(struct rt_mutex *lock, -+ struct rt_mutex_waiter *waiter, -+ struct task_struct *task, -+ enum rtmutex_chainwalk chwalk); -+/* -+ * Slow path lock function spin_lock style: this variant is very -+ * careful not to miss any non-lock wakeups. -+ * -+ * We store the current state under p->pi_lock in p->saved_state and -+ * the try_to_wake_up() code handles this accordingly. -+ */ -+void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, -+ struct rt_mutex_waiter *waiter, -+ unsigned long flags) -+{ -+ struct task_struct *lock_owner, *self = current; -+ struct rt_mutex_waiter *top_waiter; -+ int ret; -+ -+ if (__try_to_take_rt_mutex(lock, self, NULL, STEAL_LATERAL)) -+ return; -+ -+ BUG_ON(rt_mutex_owner(lock) == self); -+ -+ /* -+ * We save whatever state the task is in and we'll restore it -+ * after acquiring the lock taking real wakeups into account -+ * as well. We are serialized via pi_lock against wakeups. See -+ * try_to_wake_up(). -+ */ -+ raw_spin_lock(&self->pi_lock); -+ self->saved_state = self->state; -+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ raw_spin_unlock(&self->pi_lock); -+ -+ ret = task_blocks_on_rt_mutex(lock, waiter, self, RT_MUTEX_MIN_CHAINWALK); -+ BUG_ON(ret); -+ -+ for (;;) { -+ /* Try to acquire the lock again. */ -+ if (__try_to_take_rt_mutex(lock, self, waiter, STEAL_LATERAL)) -+ break; -+ -+ top_waiter = rt_mutex_top_waiter(lock); -+ lock_owner = rt_mutex_owner(lock); -+ -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -+ -+ if (top_waiter != waiter || adaptive_wait(lock, lock_owner)) -+ schedule(); -+ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); -+ -+ raw_spin_lock(&self->pi_lock); -+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ raw_spin_unlock(&self->pi_lock); -+ } -+ -+ /* -+ * Restore the task state to current->saved_state. We set it -+ * to the original state above and the try_to_wake_up() code -+ * has possibly updated it when a real (non-rtmutex) wakeup -+ * happened while we were blocked. Clear saved_state so -+ * try_to_wakeup() does not get confused. -+ */ -+ raw_spin_lock(&self->pi_lock); -+ __set_current_state_no_track(self->saved_state); -+ self->saved_state = TASK_RUNNING; -+ raw_spin_unlock(&self->pi_lock); -+ -+ /* -+ * try_to_take_rt_mutex() sets the waiter bit -+ * unconditionally. We might have to fix that up: -+ */ -+ fixup_rt_mutex_waiters(lock); -+ -+ BUG_ON(rt_mutex_has_waiters(lock) && waiter == rt_mutex_top_waiter(lock)); -+ BUG_ON(!RB_EMPTY_NODE(&waiter->tree_entry)); -+} -+ -+static void noinline __sched rt_spin_lock_slowlock(struct rt_mutex *lock) -+{ -+ struct rt_mutex_waiter waiter; -+ unsigned long flags; -+ -+ rt_mutex_init_waiter(&waiter, true); -+ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); -+ rt_spin_lock_slowlock_locked(lock, &waiter, flags); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -+ debug_rt_mutex_free_waiter(&waiter); -+} -+ -+static bool __sched __rt_mutex_unlock_common(struct rt_mutex *lock, -+ struct wake_q_head *wake_q, -+ struct wake_q_head *wq_sleeper); -+/* -+ * Slow path to release a rt_mutex spin_lock style -+ */ -+void __sched rt_spin_lock_slowunlock(struct rt_mutex *lock) -+{ -+ unsigned long flags; -+ DEFINE_WAKE_Q(wake_q); -+ DEFINE_WAKE_Q(wake_sleeper_q); -+ bool postunlock; -+ -+ raw_spin_lock_irqsave(&lock->wait_lock, flags); -+ postunlock = __rt_mutex_unlock_common(lock, &wake_q, &wake_sleeper_q); -+ raw_spin_unlock_irqrestore(&lock->wait_lock, flags); -+ -+ if (postunlock) -+ rt_mutex_postunlock(&wake_q, &wake_sleeper_q); -+} -+ -+void __lockfunc rt_spin_lock(spinlock_t *lock) -+{ -+ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ migrate_disable(); -+} -+EXPORT_SYMBOL(rt_spin_lock); -+ -+void __lockfunc __rt_spin_lock(struct rt_mutex *lock) -+{ -+ rt_spin_lock_fastlock(lock, rt_spin_lock_slowlock); -+} -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+void __lockfunc rt_spin_lock_nested(spinlock_t *lock, int subclass) -+{ -+ spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ migrate_disable(); -+} -+EXPORT_SYMBOL(rt_spin_lock_nested); -+ -+void __lockfunc rt_spin_lock_nest_lock(spinlock_t *lock, -+ struct lockdep_map *nest_lock) -+{ -+ spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); -+ rt_spin_lock_fastlock(&lock->lock, rt_spin_lock_slowlock); -+ migrate_disable(); -+} -+EXPORT_SYMBOL(rt_spin_lock_nest_lock); -+#endif -+ -+void __lockfunc rt_spin_unlock(spinlock_t *lock) -+{ -+ /* NOTE: we always pass in '1' for nested, for simplicity */ -+ spin_release(&lock->dep_map, _RET_IP_); -+ migrate_enable(); -+ rt_spin_lock_fastunlock(&lock->lock, rt_spin_lock_slowunlock); -+} -+EXPORT_SYMBOL(rt_spin_unlock); -+ -+void __lockfunc __rt_spin_unlock(struct rt_mutex *lock) -+{ -+ rt_spin_lock_fastunlock(lock, rt_spin_lock_slowunlock); -+} -+EXPORT_SYMBOL(__rt_spin_unlock); -+ -+/* -+ * Wait for the lock to get unlocked: instead of polling for an unlock -+ * (like raw spinlocks do), we lock and unlock, to force the kernel to -+ * schedule if there's contention: -+ */ -+void __lockfunc rt_spin_lock_unlock(spinlock_t *lock) -+{ -+ spin_lock(lock); -+ spin_unlock(lock); -+} -+EXPORT_SYMBOL(rt_spin_lock_unlock); -+ -+int __lockfunc rt_spin_trylock(spinlock_t *lock) -+{ -+ int ret; -+ -+ ret = __rt_mutex_trylock(&lock->lock); -+ if (ret) { -+ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ migrate_disable(); -+ } -+ return ret; -+} -+EXPORT_SYMBOL(rt_spin_trylock); -+ -+int __lockfunc rt_spin_trylock_bh(spinlock_t *lock) -+{ -+ int ret; -+ -+ local_bh_disable(); -+ ret = __rt_mutex_trylock(&lock->lock); -+ if (ret) { -+ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); -+ migrate_disable(); -+ } else { -+ local_bh_enable(); -+ } -+ return ret; -+} -+EXPORT_SYMBOL(rt_spin_trylock_bh); -+ -+void -+__rt_spin_lock_init(spinlock_t *lock, const char *name, struct lock_class_key *key) -+{ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ /* -+ * Make sure we are not reinitializing a held lock: -+ */ -+ debug_check_no_locks_freed((void *)lock, sizeof(*lock)); -+ lockdep_init_map(&lock->dep_map, name, key, 0); -+#endif -+} -+EXPORT_SYMBOL(__rt_spin_lock_init); -+ -+#endif /* PREEMPT_RT */ -+ -+static inline int -+try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, -+ struct rt_mutex_waiter *waiter) -+{ -+ return __try_to_take_rt_mutex(lock, task, waiter, STEAL_NORMAL); -+} -+ - /* - * Task blocks on lock. - * -@@ -1017,6 +1336,7 @@ static int task_blocks_on_rt_mutex(struct rt_mutex *lock, - * Called with lock->wait_lock held and interrupts disabled. - */ - static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, -+ struct wake_q_head *wake_sleeper_q, - struct rt_mutex *lock) - { - struct rt_mutex_waiter *waiter; -@@ -1056,7 +1376,10 @@ static void mark_wakeup_next_waiter(struct wake_q_head *wake_q, - * Pairs with preempt_enable() in rt_mutex_postunlock(); - */ - preempt_disable(); -- wake_q_add(wake_q, waiter->task); -+ if (waiter->savestate) -+ wake_q_add_sleeper(wake_sleeper_q, waiter->task); -+ else -+ wake_q_add(wake_q, waiter->task); - raw_spin_unlock(¤t->pi_lock); - } - -@@ -1140,21 +1463,22 @@ void rt_mutex_adjust_pi(struct task_struct *task) - return; - } - next_lock = waiter->lock; -- raw_spin_unlock_irqrestore(&task->pi_lock, flags); - - /* gets dropped in rt_mutex_adjust_prio_chain()! */ - get_task_struct(task); - -+ raw_spin_unlock_irqrestore(&task->pi_lock, flags); - rt_mutex_adjust_prio_chain(task, RT_MUTEX_MIN_CHAINWALK, NULL, - next_lock, NULL, task); - } - --void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter) -+void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter, bool savestate) - { - debug_rt_mutex_init_waiter(waiter); - RB_CLEAR_NODE(&waiter->pi_tree_entry); - RB_CLEAR_NODE(&waiter->tree_entry); - waiter->task = NULL; -+ waiter->savestate = savestate; - } - - /** -@@ -1265,7 +1589,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - unsigned long flags; - int ret = 0; - -- rt_mutex_init_waiter(&waiter); -+ rt_mutex_init_waiter(&waiter, false); - - /* - * Technically we could use raw_spin_[un]lock_irq() here, but this can -@@ -1338,7 +1662,8 @@ static inline int rt_mutex_slowtrylock(struct rt_mutex *lock) - * Return whether the current task needs to call rt_mutex_postunlock(). - */ - static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, -- struct wake_q_head *wake_q) -+ struct wake_q_head *wake_q, -+ struct wake_q_head *wake_sleeper_q) - { - unsigned long flags; - -@@ -1392,7 +1717,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, - * - * Queue the next waiter for wakeup once we release the wait_lock. - */ -- mark_wakeup_next_waiter(wake_q, lock); -+ mark_wakeup_next_waiter(wake_q, wake_sleeper_q, lock); - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - return true; /* call rt_mutex_postunlock() */ -@@ -1429,9 +1754,11 @@ rt_mutex_fasttrylock(struct rt_mutex *lock, - /* - * Performs the wakeup of the top-waiter and re-enables preemption. - */ --void rt_mutex_postunlock(struct wake_q_head *wake_q) -+void rt_mutex_postunlock(struct wake_q_head *wake_q, -+ struct wake_q_head *wake_sleeper_q) - { - wake_up_q(wake_q); -+ wake_up_q_sleeper(wake_sleeper_q); - - /* Pairs with preempt_disable() in rt_mutex_slowunlock() */ - preempt_enable(); -@@ -1440,15 +1767,17 @@ void rt_mutex_postunlock(struct wake_q_head *wake_q) - static inline void - rt_mutex_fastunlock(struct rt_mutex *lock, - bool (*slowfn)(struct rt_mutex *lock, -- struct wake_q_head *wqh)) -+ struct wake_q_head *wqh, -+ struct wake_q_head *wq_sleeper)) - { - DEFINE_WAKE_Q(wake_q); -+ DEFINE_WAKE_Q(wake_sleeper_q); - - if (likely(rt_mutex_cmpxchg_release(lock, current, NULL))) - return; - -- if (slowfn(lock, &wake_q)) -- rt_mutex_postunlock(&wake_q); -+ if (slowfn(lock, &wake_q, &wake_sleeper_q)) -+ rt_mutex_postunlock(&wake_q, &wake_sleeper_q); - } - - int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) -@@ -1579,19 +1908,13 @@ void __sched __rt_mutex_unlock(struct rt_mutex *lock) - void __sched rt_mutex_unlock(struct rt_mutex *lock) - { - mutex_release(&lock->dep_map, _RET_IP_); -- rt_mutex_fastunlock(lock, rt_mutex_slowunlock); -+ __rt_mutex_unlock(lock); - } - EXPORT_SYMBOL_GPL(rt_mutex_unlock); - --/** -- * __rt_mutex_futex_unlock - Futex variant, that since futex variants -- * do not use the fast-path, can be simple and will not need to retry. -- * -- * @lock: The rt_mutex to be unlocked -- * @wake_q: The wake queue head from which to get the next lock waiter -- */ --bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, -- struct wake_q_head *wake_q) -+static bool __sched __rt_mutex_unlock_common(struct rt_mutex *lock, -+ struct wake_q_head *wake_q, -+ struct wake_q_head *wq_sleeper) - { - lockdep_assert_held(&lock->wait_lock); - -@@ -1608,23 +1931,39 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, - * avoid inversion prior to the wakeup. preempt_disable() - * therein pairs with rt_mutex_postunlock(). - */ -- mark_wakeup_next_waiter(wake_q, lock); -+ mark_wakeup_next_waiter(wake_q, wq_sleeper, lock); - - return true; /* call postunlock() */ - } - -+/** -+ * __rt_mutex_futex_unlock - Futex variant, that since futex variants -+ * do not use the fast-path, can be simple and will not need to retry. -+ * -+ * @lock: The rt_mutex to be unlocked -+ * @wake_q: The wake queue head from which to get the next lock waiter -+ * @wq_sleeper: The sleeper wake queue head from which to get the next lock waiter -+ */ -+bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock, -+ struct wake_q_head *wake_q, -+ struct wake_q_head *wq_sleeper) -+{ -+ return __rt_mutex_unlock_common(lock, wake_q, wq_sleeper); -+} -+ - void __sched rt_mutex_futex_unlock(struct rt_mutex *lock) - { - DEFINE_WAKE_Q(wake_q); -+ DEFINE_WAKE_Q(wake_sleeper_q); - unsigned long flags; - bool postunlock; - - raw_spin_lock_irqsave(&lock->wait_lock, flags); -- postunlock = __rt_mutex_futex_unlock(lock, &wake_q); -+ postunlock = __rt_mutex_futex_unlock(lock, &wake_q, &wake_sleeper_q); - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - - if (postunlock) -- rt_mutex_postunlock(&wake_q); -+ rt_mutex_postunlock(&wake_q, &wake_sleeper_q); - } - - /** -@@ -1662,7 +2001,7 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name, - if (name && key) - debug_rt_mutex_init(lock, name, key); - } --EXPORT_SYMBOL_GPL(__rt_mutex_init); -+EXPORT_SYMBOL(__rt_mutex_init); - - /** - * rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a -@@ -1682,6 +2021,14 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock, - struct task_struct *proxy_owner) - { - __rt_mutex_init(lock, NULL, NULL); -+#ifdef CONFIG_DEBUG_SPINLOCK -+ /* -+ * get another key class for the wait_lock. LOCK_PI and UNLOCK_PI is -+ * holding the ->wait_lock of the proxy_lock while unlocking a sleeping -+ * lock. -+ */ -+ raw_spin_lock_init(&lock->wait_lock); -+#endif - debug_rt_mutex_proxy_lock(lock, proxy_owner); - rt_mutex_set_owner(lock, proxy_owner); - } -@@ -1704,6 +2051,26 @@ void rt_mutex_proxy_unlock(struct rt_mutex *lock) - rt_mutex_set_owner(lock, NULL); - } - -+static void fixup_rt_mutex_blocked(struct rt_mutex *lock) -+{ -+ struct task_struct *tsk = current; -+ /* -+ * RT has a problem here when the wait got interrupted by a timeout -+ * or a signal. task->pi_blocked_on is still set. The task must -+ * acquire the hash bucket lock when returning from this function. -+ * -+ * If the hash bucket lock is contended then the -+ * BUG_ON(rt_mutex_real_waiter(task->pi_blocked_on)) in -+ * task_blocks_on_rt_mutex() will trigger. This can be avoided by -+ * clearing task->pi_blocked_on which removes the task from the -+ * boosting chain of the rtmutex. That's correct because the task -+ * is not longer blocked on it. -+ */ -+ raw_spin_lock(&tsk->pi_lock); -+ tsk->pi_blocked_on = NULL; -+ raw_spin_unlock(&tsk->pi_lock); -+} -+ - /** - * __rt_mutex_start_proxy_lock() - Start lock acquisition for another task - * @lock: the rt_mutex to take -@@ -1776,6 +2143,9 @@ int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, - ret = 0; - } - -+ if (ret) -+ fixup_rt_mutex_blocked(lock); -+ - return ret; - } - -@@ -1865,6 +2235,9 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, - * have to fix that up. - */ - fixup_rt_mutex_waiters(lock); -+ if (ret) -+ fixup_rt_mutex_blocked(lock); -+ - raw_spin_unlock_irq(&lock->wait_lock); - - return ret; -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index 9d1e974ca9c3..c1a280167e3c 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -31,6 +31,7 @@ struct rt_mutex_waiter { - struct task_struct *task; - struct rt_mutex *lock; - int prio; -+ bool savestate; - u64 deadline; - }; - -@@ -133,7 +134,7 @@ extern struct task_struct *rt_mutex_next_owner(struct rt_mutex *lock); - extern void rt_mutex_init_proxy_locked(struct rt_mutex *lock, - struct task_struct *proxy_owner); - extern void rt_mutex_proxy_unlock(struct rt_mutex *lock); --extern void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter); -+extern void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter, bool savetate); - extern int __rt_mutex_start_proxy_lock(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter, - struct task_struct *task); -@@ -151,9 +152,12 @@ extern int __rt_mutex_futex_trylock(struct rt_mutex *l); - - extern void rt_mutex_futex_unlock(struct rt_mutex *lock); - extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, -- struct wake_q_head *wqh); -+ struct wake_q_head *wqh, -+ struct wake_q_head *wq_sleeper); -+ -+extern void rt_mutex_postunlock(struct wake_q_head *wake_q, -+ struct wake_q_head *wake_sleeper_q); - --extern void rt_mutex_postunlock(struct wake_q_head *wake_q); - /* RW semaphore special interface */ - - extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); -@@ -163,6 +167,10 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, - enum rtmutex_chainwalk chwalk, - struct rt_mutex_waiter *waiter); -+void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, -+ struct rt_mutex_waiter *waiter, -+ unsigned long flags); -+void __sched rt_spin_lock_slowunlock(struct rt_mutex *lock); - - #ifdef CONFIG_DEBUG_RT_MUTEXES - # include "rtmutex-debug.h" -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 4efe6fd72719..46e7db92b343 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -502,9 +502,15 @@ static bool set_nr_if_polling(struct task_struct *p) - #endif - #endif - --static bool __wake_q_add(struct wake_q_head *head, struct task_struct *task) -+static bool __wake_q_add(struct wake_q_head *head, struct task_struct *task, -+ bool sleeper) - { -- struct wake_q_node *node = &task->wake_q; -+ struct wake_q_node *node; -+ -+ if (sleeper) -+ node = &task->wake_q_sleeper; -+ else -+ node = &task->wake_q; - - /* - * Atomically grab the task, if ->wake_q is !nil already it means -@@ -540,7 +546,13 @@ static bool __wake_q_add(struct wake_q_head *head, struct task_struct *task) - */ - void wake_q_add(struct wake_q_head *head, struct task_struct *task) - { -- if (__wake_q_add(head, task)) -+ if (__wake_q_add(head, task, false)) -+ get_task_struct(task); -+} -+ -+void wake_q_add_sleeper(struct wake_q_head *head, struct task_struct *task) -+{ -+ if (__wake_q_add(head, task, true)) - get_task_struct(task); - } - -@@ -563,28 +575,39 @@ void wake_q_add(struct wake_q_head *head, struct task_struct *task) - */ - void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task) - { -- if (!__wake_q_add(head, task)) -+ if (!__wake_q_add(head, task, false)) - put_task_struct(task); - } - --void wake_up_q(struct wake_q_head *head) -+void __wake_up_q(struct wake_q_head *head, bool sleeper) - { - struct wake_q_node *node = head->first; - - while (node != WAKE_Q_TAIL) { - struct task_struct *task; - -- task = container_of(node, struct task_struct, wake_q); -+ if (sleeper) -+ task = container_of(node, struct task_struct, wake_q_sleeper); -+ else -+ task = container_of(node, struct task_struct, wake_q); -+ - BUG_ON(!task); - /* Task can safely be re-inserted now: */ - node = node->next; -- task->wake_q.next = NULL; - -+ if (sleeper) -+ task->wake_q_sleeper.next = NULL; -+ else -+ task->wake_q.next = NULL; - /* - * wake_up_process() executes a full barrier, which pairs with - * the queueing in wake_q_add() so as not to miss wakeups. - */ -- wake_up_process(task); -+ if (sleeper) -+ wake_up_lock_sleeper(task); -+ else -+ wake_up_process(task); -+ - put_task_struct(task); - } - } --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch b/features/rt/locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch deleted file mode 100644 index 4453ee0a..00000000 --- a/features/rt/locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch +++ /dev/null @@ -1,455 +0,0 @@ -From 301251ee29aa4e2fc60f83f4826f4c1d15ad6bdc Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 12 Oct 2017 17:34:38 +0200 -Subject: [PATCH 081/191] locking/rtmutex: add ww_mutex addon for mutex-rt - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/mutex.h | 8 - - include/linux/ww_mutex.h | 8 + - kernel/locking/rtmutex.c | 262 ++++++++++++++++++++++++++++++-- - kernel/locking/rtmutex_common.h | 2 + - kernel/locking/rwsem-rt.c | 2 +- - 5 files changed, 262 insertions(+), 20 deletions(-) - -diff --git a/include/linux/mutex.h b/include/linux/mutex.h -index 50c873744ab0..d7cfc5dc817b 100644 ---- a/include/linux/mutex.h -+++ b/include/linux/mutex.h -@@ -82,14 +82,6 @@ struct mutex { - struct ww_class; - struct ww_acquire_ctx; - --struct ww_mutex { -- struct mutex base; -- struct ww_acquire_ctx *ctx; --#ifdef CONFIG_DEBUG_MUTEXES -- struct ww_class *ww_class; --#endif --}; -- - /* - * This is the control structure for tasks blocked on mutex, - * which resides on the blocked task's kernel stack: -diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h -index 850424e5d030..8ef2feb0d8fe 100644 ---- a/include/linux/ww_mutex.h -+++ b/include/linux/ww_mutex.h -@@ -28,6 +28,14 @@ struct ww_class { - unsigned int is_wait_die; - }; - -+struct ww_mutex { -+ struct mutex base; -+ struct ww_acquire_ctx *ctx; -+#ifdef CONFIG_DEBUG_MUTEXES -+ struct ww_class *ww_class; -+#endif -+}; -+ - struct ww_acquire_ctx { - struct task_struct *task; - unsigned long stamp; -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index f0bc7fcae441..3fc947dd2e60 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -24,6 +24,7 @@ - #include <linux/sched/wake_q.h> - #include <linux/sched/debug.h> - #include <linux/timer.h> -+#include <linux/ww_mutex.h> - - #include "rtmutex_common.h" - -@@ -1216,6 +1217,40 @@ EXPORT_SYMBOL(__rt_spin_lock_init); - - #endif /* PREEMPT_RT */ - -+#ifdef CONFIG_PREEMPT_RT -+ static inline int __sched -+__mutex_lock_check_stamp(struct rt_mutex *lock, struct ww_acquire_ctx *ctx) -+{ -+ struct ww_mutex *ww = container_of(lock, struct ww_mutex, base.lock); -+ struct ww_acquire_ctx *hold_ctx = READ_ONCE(ww->ctx); -+ -+ if (!hold_ctx) -+ return 0; -+ -+ if (unlikely(ctx == hold_ctx)) -+ return -EALREADY; -+ -+ if (ctx->stamp - hold_ctx->stamp <= LONG_MAX && -+ (ctx->stamp != hold_ctx->stamp || ctx > hold_ctx)) { -+#ifdef CONFIG_DEBUG_MUTEXES -+ DEBUG_LOCKS_WARN_ON(ctx->contending_lock); -+ ctx->contending_lock = ww; -+#endif -+ return -EDEADLK; -+ } -+ -+ return 0; -+} -+#else -+ static inline int __sched -+__mutex_lock_check_stamp(struct rt_mutex *lock, struct ww_acquire_ctx *ctx) -+{ -+ BUG(); -+ return 0; -+} -+ -+#endif -+ - static inline int - try_to_take_rt_mutex(struct rt_mutex *lock, struct task_struct *task, - struct rt_mutex_waiter *waiter) -@@ -1494,7 +1529,8 @@ void rt_mutex_init_waiter(struct rt_mutex_waiter *waiter, bool savestate) - static int __sched - __rt_mutex_slowlock(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, -- struct rt_mutex_waiter *waiter) -+ struct rt_mutex_waiter *waiter, -+ struct ww_acquire_ctx *ww_ctx) - { - int ret = 0; - -@@ -1512,6 +1548,12 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, - break; - } - -+ if (ww_ctx && ww_ctx->acquired > 0) { -+ ret = __mutex_lock_check_stamp(lock, ww_ctx); -+ if (ret) -+ break; -+ } -+ - raw_spin_unlock_irq(&lock->wait_lock); - - schedule(); -@@ -1540,16 +1582,106 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock, - } - } - -+static __always_inline void ww_mutex_lock_acquired(struct ww_mutex *ww, -+ struct ww_acquire_ctx *ww_ctx) -+{ -+#ifdef CONFIG_DEBUG_MUTEXES -+ /* -+ * If this WARN_ON triggers, you used ww_mutex_lock to acquire, -+ * but released with a normal mutex_unlock in this call. -+ * -+ * This should never happen, always use ww_mutex_unlock. -+ */ -+ DEBUG_LOCKS_WARN_ON(ww->ctx); -+ -+ /* -+ * Not quite done after calling ww_acquire_done() ? -+ */ -+ DEBUG_LOCKS_WARN_ON(ww_ctx->done_acquire); -+ -+ if (ww_ctx->contending_lock) { -+ /* -+ * After -EDEADLK you tried to -+ * acquire a different ww_mutex? Bad! -+ */ -+ DEBUG_LOCKS_WARN_ON(ww_ctx->contending_lock != ww); -+ -+ /* -+ * You called ww_mutex_lock after receiving -EDEADLK, -+ * but 'forgot' to unlock everything else first? -+ */ -+ DEBUG_LOCKS_WARN_ON(ww_ctx->acquired > 0); -+ ww_ctx->contending_lock = NULL; -+ } -+ -+ /* -+ * Naughty, using a different class will lead to undefined behavior! -+ */ -+ DEBUG_LOCKS_WARN_ON(ww_ctx->ww_class != ww->ww_class); -+#endif -+ ww_ctx->acquired++; -+} -+ -+#ifdef CONFIG_PREEMPT_RT -+static void ww_mutex_account_lock(struct rt_mutex *lock, -+ struct ww_acquire_ctx *ww_ctx) -+{ -+ struct ww_mutex *ww = container_of(lock, struct ww_mutex, base.lock); -+ struct rt_mutex_waiter *waiter, *n; -+ -+ /* -+ * This branch gets optimized out for the common case, -+ * and is only important for ww_mutex_lock. -+ */ -+ ww_mutex_lock_acquired(ww, ww_ctx); -+ ww->ctx = ww_ctx; -+ -+ /* -+ * Give any possible sleeping processes the chance to wake up, -+ * so they can recheck if they have to back off. -+ */ -+ rbtree_postorder_for_each_entry_safe(waiter, n, &lock->waiters.rb_root, -+ tree_entry) { -+ /* XXX debug rt mutex waiter wakeup */ -+ -+ BUG_ON(waiter->lock != lock); -+ rt_mutex_wake_waiter(waiter); -+ } -+} -+ -+#else -+ -+static void ww_mutex_account_lock(struct rt_mutex *lock, -+ struct ww_acquire_ctx *ww_ctx) -+{ -+ BUG(); -+} -+#endif -+ - int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, - enum rtmutex_chainwalk chwalk, -+ struct ww_acquire_ctx *ww_ctx, - struct rt_mutex_waiter *waiter) - { - int ret; - -+#ifdef CONFIG_PREEMPT_RT -+ if (ww_ctx) { -+ struct ww_mutex *ww; -+ -+ ww = container_of(lock, struct ww_mutex, base.lock); -+ if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) -+ return -EALREADY; -+ } -+#endif -+ - /* Try to acquire the lock again: */ -- if (try_to_take_rt_mutex(lock, current, NULL)) -+ if (try_to_take_rt_mutex(lock, current, NULL)) { -+ if (ww_ctx) -+ ww_mutex_account_lock(lock, ww_ctx); - return 0; -+ } - - set_current_state(state); - -@@ -1559,14 +1691,24 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - - ret = task_blocks_on_rt_mutex(lock, waiter, current, chwalk); - -- if (likely(!ret)) -+ if (likely(!ret)) { - /* sleep on the mutex */ -- ret = __rt_mutex_slowlock(lock, state, timeout, waiter); -+ ret = __rt_mutex_slowlock(lock, state, timeout, waiter, -+ ww_ctx); -+ } else if (ww_ctx) { -+ /* ww_mutex received EDEADLK, let it become EALREADY */ -+ ret = __mutex_lock_check_stamp(lock, ww_ctx); -+ BUG_ON(!ret); -+ } - - if (unlikely(ret)) { - __set_current_state(TASK_RUNNING); - remove_waiter(lock, waiter); -- rt_mutex_handle_deadlock(ret, chwalk, waiter); -+ /* ww_mutex wants to report EDEADLK/EALREADY, let it */ -+ if (!ww_ctx) -+ rt_mutex_handle_deadlock(ret, chwalk, waiter); -+ } else if (ww_ctx) { -+ ww_mutex_account_lock(lock, ww_ctx); - } - - /* -@@ -1583,7 +1725,8 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - static int __sched - rt_mutex_slowlock(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, -- enum rtmutex_chainwalk chwalk) -+ enum rtmutex_chainwalk chwalk, -+ struct ww_acquire_ctx *ww_ctx) - { - struct rt_mutex_waiter waiter; - unsigned long flags; -@@ -1601,7 +1744,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, - */ - raw_spin_lock_irqsave(&lock->wait_lock, flags); - -- ret = rt_mutex_slowlock_locked(lock, state, timeout, chwalk, &waiter); -+ ret = rt_mutex_slowlock_locked(lock, state, timeout, chwalk, ww_ctx, -+ &waiter); - - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); - -@@ -1731,14 +1875,16 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock, - */ - static inline int - rt_mutex_fastlock(struct rt_mutex *lock, int state, -+ struct ww_acquire_ctx *ww_ctx, - int (*slowfn)(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, -- enum rtmutex_chainwalk chwalk)) -+ enum rtmutex_chainwalk chwalk, -+ struct ww_acquire_ctx *ww_ctx)) - { - if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) - return 0; - -- return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK); -+ return slowfn(lock, state, NULL, RT_MUTEX_MIN_CHAINWALK, ww_ctx); - } - - static inline int -@@ -1783,7 +1929,7 @@ rt_mutex_fastunlock(struct rt_mutex *lock, - int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) - { - might_sleep(); -- return rt_mutex_fastlock(lock, state, rt_mutex_slowlock); -+ return rt_mutex_fastlock(lock, state, NULL, rt_mutex_slowlock); - } - - /** -@@ -2233,7 +2379,7 @@ int rt_mutex_wait_proxy_lock(struct rt_mutex *lock, - raw_spin_lock_irq(&lock->wait_lock); - /* sleep on the mutex */ - set_current_state(TASK_INTERRUPTIBLE); -- ret = __rt_mutex_slowlock(lock, TASK_INTERRUPTIBLE, to, waiter); -+ ret = __rt_mutex_slowlock(lock, TASK_INTERRUPTIBLE, to, waiter, NULL); - /* - * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might - * have to fix that up. -@@ -2303,3 +2449,97 @@ bool rt_mutex_cleanup_proxy_lock(struct rt_mutex *lock, - - return cleanup; - } -+ -+static inline int -+ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) -+{ -+#ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH -+ unsigned int tmp; -+ -+ if (ctx->deadlock_inject_countdown-- == 0) { -+ tmp = ctx->deadlock_inject_interval; -+ if (tmp > UINT_MAX/4) -+ tmp = UINT_MAX; -+ else -+ tmp = tmp*2 + tmp + tmp/2; -+ -+ ctx->deadlock_inject_interval = tmp; -+ ctx->deadlock_inject_countdown = tmp; -+ ctx->contending_lock = lock; -+ -+ ww_mutex_unlock(lock); -+ -+ return -EDEADLK; -+ } -+#endif -+ -+ return 0; -+} -+ -+#ifdef CONFIG_PREEMPT_RT -+int __sched -+ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) -+{ -+ int ret; -+ -+ might_sleep(); -+ -+ mutex_acquire_nest(&lock->base.dep_map, 0, 0, -+ ctx ? &ctx->dep_map : NULL, _RET_IP_); -+ ret = rt_mutex_slowlock(&lock->base.lock, TASK_INTERRUPTIBLE, NULL, 0, -+ ctx); -+ if (ret) -+ mutex_release(&lock->base.dep_map, _RET_IP_); -+ else if (!ret && ctx && ctx->acquired > 1) -+ return ww_mutex_deadlock_injection(lock, ctx); -+ -+ return ret; -+} -+EXPORT_SYMBOL_GPL(ww_mutex_lock_interruptible); -+ -+int __sched -+ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) -+{ -+ int ret; -+ -+ might_sleep(); -+ -+ mutex_acquire_nest(&lock->base.dep_map, 0, 0, -+ ctx ? &ctx->dep_map : NULL, _RET_IP_); -+ ret = rt_mutex_slowlock(&lock->base.lock, TASK_UNINTERRUPTIBLE, NULL, 0, -+ ctx); -+ if (ret) -+ mutex_release(&lock->base.dep_map, _RET_IP_); -+ else if (!ret && ctx && ctx->acquired > 1) -+ return ww_mutex_deadlock_injection(lock, ctx); -+ -+ return ret; -+} -+EXPORT_SYMBOL_GPL(ww_mutex_lock); -+ -+void __sched ww_mutex_unlock(struct ww_mutex *lock) -+{ -+ /* -+ * The unlocking fastpath is the 0->1 transition from 'locked' -+ * into 'unlocked' state: -+ */ -+ if (lock->ctx) { -+#ifdef CONFIG_DEBUG_MUTEXES -+ DEBUG_LOCKS_WARN_ON(!lock->ctx->acquired); -+#endif -+ if (lock->ctx->acquired > 0) -+ lock->ctx->acquired--; -+ lock->ctx = NULL; -+ } -+ -+ mutex_release(&lock->base.dep_map, _RET_IP_); -+ __rt_mutex_unlock(&lock->base.lock); -+} -+EXPORT_SYMBOL(ww_mutex_unlock); -+ -+int __rt_mutex_owner_current(struct rt_mutex *lock) -+{ -+ return rt_mutex_owner(lock) == current; -+} -+EXPORT_SYMBOL(__rt_mutex_owner_current); -+#endif -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index c1a280167e3c..248a7d91583b 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -159,6 +159,7 @@ extern void rt_mutex_postunlock(struct wake_q_head *wake_q, - struct wake_q_head *wake_sleeper_q); - - /* RW semaphore special interface */ -+struct ww_acquire_ctx; - - extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); - extern int __rt_mutex_trylock(struct rt_mutex *lock); -@@ -166,6 +167,7 @@ extern void __rt_mutex_unlock(struct rt_mutex *lock); - int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, - enum rtmutex_chainwalk chwalk, -+ struct ww_acquire_ctx *ww_ctx, - struct rt_mutex_waiter *waiter); - void __sched rt_spin_lock_slowlock_locked(struct rt_mutex *lock, - struct rt_mutex_waiter *waiter, -diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c -index a0771c150041..274172d5bb3a 100644 ---- a/kernel/locking/rwsem-rt.c -+++ b/kernel/locking/rwsem-rt.c -@@ -138,7 +138,7 @@ static int __sched __down_read_common(struct rw_semaphore *sem, int state) - */ - rt_mutex_init_waiter(&waiter, false); - ret = rt_mutex_slowlock_locked(m, state, NULL, RT_MUTEX_MIN_CHAINWALK, -- &waiter); -+ NULL, &waiter); - /* - * The slowlock() above is guaranteed to return with the rtmutex (for - * ret = 0) is now held, so there can't be a writer active. Increment --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch b/features/rt/locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch deleted file mode 100644 index af6400f3..00000000 --- a/features/rt/locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 9d29157866e3702ace5facd72443ded3418db861 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 16:36:39 +0200 -Subject: [PATCH 073/191] locking/rtmutex: export lockdep-less version of - rt_mutex's lock, trylock and unlock - -Required for lock implementation ontop of rtmutex. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/locking/rtmutex.c | 54 +++++++++++++++++++++++---------- - kernel/locking/rtmutex_common.h | 3 ++ - 2 files changed, 41 insertions(+), 16 deletions(-) - -diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c -index 670c4a577322..86012b16f0c2 100644 ---- a/kernel/locking/rtmutex.c -+++ b/kernel/locking/rtmutex.c -@@ -1451,12 +1451,33 @@ rt_mutex_fastunlock(struct rt_mutex *lock, - rt_mutex_postunlock(&wake_q); - } - --static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass) -+int __sched __rt_mutex_lock_state(struct rt_mutex *lock, int state) - { - might_sleep(); -+ return rt_mutex_fastlock(lock, state, rt_mutex_slowlock); -+} -+ -+/** -+ * rt_mutex_lock_state - lock a rt_mutex with a given state -+ * -+ * @lock: The rt_mutex to be locked -+ * @state: The state to set when blocking on the rt_mutex -+ */ -+static inline int __sched rt_mutex_lock_state(struct rt_mutex *lock, -+ unsigned int subclass, int state) -+{ -+ int ret; - - mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); -- rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); -+ ret = __rt_mutex_lock_state(lock, state); -+ if (ret) -+ mutex_release(&lock->dep_map, _RET_IP_); -+ return ret; -+} -+ -+static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass) -+{ -+ rt_mutex_lock_state(lock, subclass, TASK_UNINTERRUPTIBLE); - } - - #ifdef CONFIG_DEBUG_LOCK_ALLOC -@@ -1497,16 +1518,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_lock); - */ - int __sched rt_mutex_lock_interruptible(struct rt_mutex *lock) - { -- int ret; -- -- might_sleep(); -- -- mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); -- ret = rt_mutex_fastlock(lock, TASK_INTERRUPTIBLE, rt_mutex_slowlock); -- if (ret) -- mutex_release(&lock->dep_map, _RET_IP_); -- -- return ret; -+ return rt_mutex_lock_state(lock, 0, TASK_INTERRUPTIBLE); - } - EXPORT_SYMBOL_GPL(rt_mutex_lock_interruptible); - -@@ -1523,6 +1535,14 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock) - return __rt_mutex_slowtrylock(lock); - } - -+int __sched __rt_mutex_trylock(struct rt_mutex *lock) -+{ -+ if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq())) -+ return 0; -+ -+ return rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); -+} -+ - /** - * rt_mutex_trylock - try to lock a rt_mutex - * -@@ -1538,10 +1558,7 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) - { - int ret; - -- if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq())) -- return 0; -- -- ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock); -+ ret = __rt_mutex_trylock(lock); - if (ret) - mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); - -@@ -1549,6 +1566,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock) - } - EXPORT_SYMBOL_GPL(rt_mutex_trylock); - -+void __sched __rt_mutex_unlock(struct rt_mutex *lock) -+{ -+ rt_mutex_fastunlock(lock, rt_mutex_slowunlock); -+} -+ - /** - * rt_mutex_unlock - unlock a rt_mutex - * -diff --git a/kernel/locking/rtmutex_common.h b/kernel/locking/rtmutex_common.h -index b5a2affa59d5..9d1e974ca9c3 100644 ---- a/kernel/locking/rtmutex_common.h -+++ b/kernel/locking/rtmutex_common.h -@@ -156,6 +156,9 @@ extern bool __rt_mutex_futex_unlock(struct rt_mutex *lock, - extern void rt_mutex_postunlock(struct wake_q_head *wake_q); - /* RW semaphore special interface */ - -+extern int __rt_mutex_lock_state(struct rt_mutex *lock, int state); -+extern int __rt_mutex_trylock(struct rt_mutex *lock); -+extern void __rt_mutex_unlock(struct rt_mutex *lock); - int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state, - struct hrtimer_sleeper *timeout, - enum rtmutex_chainwalk chwalk, --- -2.19.1 - diff --git a/features/rt/locking-rtmutex-wire-up-RT-s-locking.patch b/features/rt/locking-rtmutex-wire-up-RT-s-locking.patch deleted file mode 100644 index c6b001b5..00000000 --- a/features/rt/locking-rtmutex-wire-up-RT-s-locking.patch +++ /dev/null @@ -1,346 +0,0 @@ -From cd8326d4ea23e407e1168cc2c6f1005d5c0ec743 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 12 Oct 2017 17:31:14 +0200 -Subject: [PATCH 080/191] locking/rtmutex: wire up RT's locking - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/mutex.h | 25 +++++++++++++++---------- - include/linux/rwsem.h | 12 ++++++++++++ - include/linux/spinlock.h | 12 +++++++++++- - include/linux/spinlock_api_smp.h | 4 +++- - include/linux/spinlock_types.h | 11 ++++++++--- - include/linux/spinlock_types_up.h | 2 +- - kernel/Kconfig.preempt | 1 + - kernel/locking/Makefile | 10 +++++++--- - kernel/locking/rwsem.c | 6 ++++++ - kernel/locking/spinlock.c | 7 +++++++ - kernel/locking/spinlock_debug.c | 5 +++++ - 11 files changed, 76 insertions(+), 19 deletions(-) - -diff --git a/include/linux/mutex.h b/include/linux/mutex.h -index 0cd631a19727..50c873744ab0 100644 ---- a/include/linux/mutex.h -+++ b/include/linux/mutex.h -@@ -22,6 +22,20 @@ - - struct ww_acquire_ctx; - -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ -+ , .dep_map = { \ -+ .name = #lockname, \ -+ .wait_type_inner = LD_WAIT_SLEEP, \ -+ } -+#else -+# define __DEP_MAP_MUTEX_INITIALIZER(lockname) -+#endif -+ -+#ifdef CONFIG_PREEMPT_RT -+# include <linux/mutex_rt.h> -+#else -+ - /* - * Simple, straightforward mutexes with strict semantics: - * -@@ -119,16 +133,6 @@ do { \ - __mutex_init((mutex), #mutex, &__key); \ - } while (0) - --#ifdef CONFIG_DEBUG_LOCK_ALLOC --# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ -- , .dep_map = { \ -- .name = #lockname, \ -- .wait_type_inner = LD_WAIT_SLEEP, \ -- } --#else --# define __DEP_MAP_MUTEX_INITIALIZER(lockname) --#endif -- - #define __MUTEX_INITIALIZER(lockname) \ - { .owner = ATOMIC_LONG_INIT(0) \ - , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \ -@@ -199,4 +203,5 @@ extern void mutex_unlock(struct mutex *lock); - - extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); - -+#endif /* !PREEMPT_RT */ - #endif /* __LINUX_MUTEX_H */ -diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h -index 4c715be48717..9323af8a9244 100644 ---- a/include/linux/rwsem.h -+++ b/include/linux/rwsem.h -@@ -16,6 +16,11 @@ - #include <linux/spinlock.h> - #include <linux/atomic.h> - #include <linux/err.h> -+ -+#ifdef CONFIG_PREEMPT_RT -+#include <linux/rwsem-rt.h> -+#else /* PREEMPT_RT */ -+ - #ifdef CONFIG_RWSEM_SPIN_ON_OWNER - #include <linux/osq_lock.h> - #endif -@@ -119,6 +124,13 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem) - return !list_empty(&sem->wait_list); - } - -+#endif /* !PREEMPT_RT */ -+ -+/* -+ * The functions below are the same for all rwsem implementations including -+ * the RT specific variant. -+ */ -+ - /* - * lock for reading - */ -diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h -index 79897841a2cc..c3c70291b46c 100644 ---- a/include/linux/spinlock.h -+++ b/include/linux/spinlock.h -@@ -309,7 +309,11 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) - }) - - /* Include rwlock functions */ --#include <linux/rwlock.h> -+#ifdef CONFIG_PREEMPT_RT -+# include <linux/rwlock_rt.h> -+#else -+# include <linux/rwlock.h> -+#endif - - /* - * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: -@@ -320,6 +324,10 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) - # include <linux/spinlock_api_up.h> - #endif - -+#ifdef CONFIG_PREEMPT_RT -+# include <linux/spinlock_rt.h> -+#else /* PREEMPT_RT */ -+ - /* - * Map the spin_lock functions to the raw variants for PREEMPT_RT=n - */ -@@ -454,6 +462,8 @@ static __always_inline int spin_is_contended(spinlock_t *lock) - - #define assert_spin_locked(lock) assert_raw_spin_locked(&(lock)->rlock) - -+#endif /* !PREEMPT_RT */ -+ - /* - * Pull the atomic_t declaration: - * (asm-mips/atomic.h needs above definitions) -diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h -index 19a9be9d97ee..da38149f2843 100644 ---- a/include/linux/spinlock_api_smp.h -+++ b/include/linux/spinlock_api_smp.h -@@ -187,6 +187,8 @@ static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) - return 0; - } - --#include <linux/rwlock_api_smp.h> -+#ifndef CONFIG_PREEMPT_RT -+# include <linux/rwlock_api_smp.h> -+#endif - - #endif /* __LINUX_SPINLOCK_API_SMP_H */ -diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h -index 5c8664d57fb8..8d896d3e1a01 100644 ---- a/include/linux/spinlock_types.h -+++ b/include/linux/spinlock_types.h -@@ -11,8 +11,13 @@ - - #include <linux/spinlock_types_raw.h> - --#include <linux/spinlock_types_nort.h> -- --#include <linux/rwlock_types.h> -+#ifndef CONFIG_PREEMPT_RT -+# include <linux/spinlock_types_nort.h> -+# include <linux/rwlock_types.h> -+#else -+# include <linux/rtmutex.h> -+# include <linux/spinlock_types_rt.h> -+# include <linux/rwlock_types_rt.h> -+#endif - - #endif /* __LINUX_SPINLOCK_TYPES_H */ -diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h -index c09b6407ae1b..d9b371fa13e0 100644 ---- a/include/linux/spinlock_types_up.h -+++ b/include/linux/spinlock_types_up.h -@@ -1,7 +1,7 @@ - #ifndef __LINUX_SPINLOCK_TYPES_UP_H - #define __LINUX_SPINLOCK_TYPES_UP_H - --#ifndef __LINUX_SPINLOCK_TYPES_H -+#if !defined(__LINUX_SPINLOCK_TYPES_H) && !defined(__LINUX_RT_MUTEX_H) - # error "please don't include this file directly" - #endif - -diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt -index 416017301660..c8e516f6db20 100644 ---- a/kernel/Kconfig.preempt -+++ b/kernel/Kconfig.preempt -@@ -60,6 +60,7 @@ config PREEMPT_RT - bool "Fully Preemptible Kernel (Real-Time)" - depends on EXPERT && ARCH_SUPPORTS_RT - select PREEMPTION -+ select RT_MUTEXES - help - This option turns the kernel into a real-time kernel by replacing - various locking primitives (spinlocks, rwlocks, etc.) with -diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile -index 8838f1d7c4a2..b4bdab93e2fc 100644 ---- a/kernel/locking/Makefile -+++ b/kernel/locking/Makefile -@@ -3,7 +3,7 @@ - # and is generally not a function of system call inputs. - KCOV_INSTRUMENT := n - --obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o -+obj-y += semaphore.o rwsem.o percpu-rwsem.o - - # Avoid recursion lockdep -> KCSAN -> ... -> lockdep. - KCSAN_SANITIZE_lockdep.o := n -@@ -16,19 +16,23 @@ CFLAGS_REMOVE_rtmutex-debug.o = $(CC_FLAGS_FTRACE) - endif - - obj-$(CONFIG_DEBUG_IRQFLAGS) += irqflag-debug.o --obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o - obj-$(CONFIG_LOCKDEP) += lockdep.o - ifeq ($(CONFIG_PROC_FS),y) - obj-$(CONFIG_LOCKDEP) += lockdep_proc.o - endif - obj-$(CONFIG_SMP) += spinlock.o --obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o - obj-$(CONFIG_PROVE_LOCKING) += spinlock.o - obj-$(CONFIG_QUEUED_SPINLOCKS) += qspinlock.o - obj-$(CONFIG_RT_MUTEXES) += rtmutex.o - obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o - obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o - obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o -+ifneq ($(CONFIG_PREEMPT_RT),y) -+obj-y += mutex.o -+obj-$(CONFIG_LOCK_SPIN_ON_OWNER) += osq_lock.o -+obj-$(CONFIG_DEBUG_MUTEXES) += mutex-debug.o -+endif -+obj-$(CONFIG_PREEMPT_RT) += mutex-rt.o rwsem-rt.o rwlock-rt.o - obj-$(CONFIG_QUEUED_RWLOCKS) += qrwlock.o - obj-$(CONFIG_LOCK_TORTURE_TEST) += locktorture.o - obj-$(CONFIG_WW_MUTEX_SELFTEST) += test-ww_mutex.o -diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c -index abba5df50006..bed9a5e32a16 100644 ---- a/kernel/locking/rwsem.c -+++ b/kernel/locking/rwsem.c -@@ -28,6 +28,7 @@ - #include <linux/rwsem.h> - #include <linux/atomic.h> - -+#ifndef CONFIG_PREEMPT_RT - #include "lock_events.h" - - /* -@@ -1343,6 +1344,7 @@ static inline void __downgrade_write(struct rw_semaphore *sem) - if (tmp & RWSEM_FLAG_WAITERS) - rwsem_downgrade_wake(sem); - } -+#endif - - /* - * lock for reading -@@ -1506,7 +1508,9 @@ void down_read_non_owner(struct rw_semaphore *sem) - { - might_sleep(); - __down_read(sem); -+#ifndef CONFIG_PREEMPT_RT - __rwsem_set_reader_owned(sem, NULL); -+#endif - } - EXPORT_SYMBOL(down_read_non_owner); - -@@ -1535,7 +1539,9 @@ EXPORT_SYMBOL(down_write_killable_nested); - - void up_read_non_owner(struct rw_semaphore *sem) - { -+#ifndef CONFIG_PREEMPT_RT - DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem); -+#endif - __up_read(sem); - } - EXPORT_SYMBOL(up_read_non_owner); -diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c -index 0ff08380f531..45445a2f1799 100644 ---- a/kernel/locking/spinlock.c -+++ b/kernel/locking/spinlock.c -@@ -124,8 +124,11 @@ void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ - * __[spin|read|write]_lock_bh() - */ - BUILD_LOCK_OPS(spin, raw_spinlock); -+ -+#ifndef CONFIG_PREEMPT_RT - BUILD_LOCK_OPS(read, rwlock); - BUILD_LOCK_OPS(write, rwlock); -+#endif - - #endif - -@@ -209,6 +212,8 @@ void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock) - EXPORT_SYMBOL(_raw_spin_unlock_bh); - #endif - -+#ifndef CONFIG_PREEMPT_RT -+ - #ifndef CONFIG_INLINE_READ_TRYLOCK - int __lockfunc _raw_read_trylock(rwlock_t *lock) - { -@@ -353,6 +358,8 @@ void __lockfunc _raw_write_unlock_bh(rwlock_t *lock) - EXPORT_SYMBOL(_raw_write_unlock_bh); - #endif - -+#endif /* !PREEMPT_RT */ -+ - #ifdef CONFIG_DEBUG_LOCK_ALLOC - - void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass) -diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c -index b9d93087ee66..72e306e0e8a3 100644 ---- a/kernel/locking/spinlock_debug.c -+++ b/kernel/locking/spinlock_debug.c -@@ -31,6 +31,7 @@ void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, - - EXPORT_SYMBOL(__raw_spin_lock_init); - -+#ifndef CONFIG_PREEMPT_RT - void __rwlock_init(rwlock_t *lock, const char *name, - struct lock_class_key *key) - { -@@ -48,6 +49,7 @@ void __rwlock_init(rwlock_t *lock, const char *name, - } - - EXPORT_SYMBOL(__rwlock_init); -+#endif - - static void spin_dump(raw_spinlock_t *lock, const char *msg) - { -@@ -139,6 +141,7 @@ void do_raw_spin_unlock(raw_spinlock_t *lock) - arch_spin_unlock(&lock->raw_lock); - } - -+#ifndef CONFIG_PREEMPT_RT - static void rwlock_bug(rwlock_t *lock, const char *msg) - { - if (!debug_locks_off()) -@@ -228,3 +231,5 @@ void do_raw_write_unlock(rwlock_t *lock) - debug_write_unlock(lock); - arch_write_unlock(&lock->raw_lock); - } -+ -+#endif --- -2.19.1 - diff --git a/features/rt/locking-spinlock-Split-the-lock-types-header.patch b/features/rt/locking-spinlock-Split-the-lock-types-header.patch deleted file mode 100644 index 6dccd49d..00000000 --- a/features/rt/locking-spinlock-Split-the-lock-types-header.patch +++ /dev/null @@ -1,252 +0,0 @@ -From e51cfeec84cee412a53528dc1069ace2ab24ae44 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 29 Jun 2011 19:34:01 +0200 -Subject: [PATCH 068/191] locking/spinlock: Split the lock types header - -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 -spinlocks. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/rwlock_types.h | 4 ++ - include/linux/spinlock_types.h | 87 +---------------------------- - include/linux/spinlock_types_nort.h | 39 +++++++++++++ - include/linux/spinlock_types_raw.h | 65 +++++++++++++++++++++ - 4 files changed, 110 insertions(+), 85 deletions(-) - create mode 100644 include/linux/spinlock_types_nort.h - create mode 100644 include/linux/spinlock_types_raw.h - -diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h -index 3bd03e18061c..0ad226b5d8fd 100644 ---- a/include/linux/rwlock_types.h -+++ b/include/linux/rwlock_types.h -@@ -1,6 +1,10 @@ - #ifndef __LINUX_RWLOCK_TYPES_H - #define __LINUX_RWLOCK_TYPES_H - -+#if !defined(__LINUX_SPINLOCK_TYPES_H) -+# error "Do not include directly, include spinlock_types.h" -+#endif -+ - /* - * include/linux/rwlock_types.h - generic rwlock type definitions - * and initializers -diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h -index b981caafe8bf..5c8664d57fb8 100644 ---- a/include/linux/spinlock_types.h -+++ b/include/linux/spinlock_types.h -@@ -9,92 +9,9 @@ - * Released under the General Public License (GPL). - */ - --#if defined(CONFIG_SMP) --# include <asm/spinlock_types.h> --#else --# include <linux/spinlock_types_up.h> --#endif -+#include <linux/spinlock_types_raw.h> - --#include <linux/lockdep_types.h> -- --typedef struct raw_spinlock { -- arch_spinlock_t raw_lock; --#ifdef CONFIG_DEBUG_SPINLOCK -- unsigned int magic, owner_cpu; -- void *owner; --#endif --#ifdef CONFIG_DEBUG_LOCK_ALLOC -- struct lockdep_map dep_map; --#endif --} raw_spinlock_t; -- --#define SPINLOCK_MAGIC 0xdead4ead -- --#define SPINLOCK_OWNER_INIT ((void *)-1L) -- --#ifdef CONFIG_DEBUG_LOCK_ALLOC --# define RAW_SPIN_DEP_MAP_INIT(lockname) \ -- .dep_map = { \ -- .name = #lockname, \ -- .wait_type_inner = LD_WAIT_SPIN, \ -- } --# define SPIN_DEP_MAP_INIT(lockname) \ -- .dep_map = { \ -- .name = #lockname, \ -- .wait_type_inner = LD_WAIT_CONFIG, \ -- } --#else --# define RAW_SPIN_DEP_MAP_INIT(lockname) --# define SPIN_DEP_MAP_INIT(lockname) --#endif -- --#ifdef CONFIG_DEBUG_SPINLOCK --# define SPIN_DEBUG_INIT(lockname) \ -- .magic = SPINLOCK_MAGIC, \ -- .owner_cpu = -1, \ -- .owner = SPINLOCK_OWNER_INIT, --#else --# define SPIN_DEBUG_INIT(lockname) --#endif -- --#define __RAW_SPIN_LOCK_INITIALIZER(lockname) \ -- { \ -- .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ -- SPIN_DEBUG_INIT(lockname) \ -- RAW_SPIN_DEP_MAP_INIT(lockname) } -- --#define __RAW_SPIN_LOCK_UNLOCKED(lockname) \ -- (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname) -- --#define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x) -- --typedef struct spinlock { -- union { -- struct raw_spinlock rlock; -- --#ifdef CONFIG_DEBUG_LOCK_ALLOC --# define LOCK_PADSIZE (offsetof(struct raw_spinlock, dep_map)) -- struct { -- u8 __padding[LOCK_PADSIZE]; -- struct lockdep_map dep_map; -- }; --#endif -- }; --} spinlock_t; -- --#define ___SPIN_LOCK_INITIALIZER(lockname) \ -- { \ -- .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ -- SPIN_DEBUG_INIT(lockname) \ -- SPIN_DEP_MAP_INIT(lockname) } -- --#define __SPIN_LOCK_INITIALIZER(lockname) \ -- { { .rlock = ___SPIN_LOCK_INITIALIZER(lockname) } } -- --#define __SPIN_LOCK_UNLOCKED(lockname) \ -- (spinlock_t) __SPIN_LOCK_INITIALIZER(lockname) -- --#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) -+#include <linux/spinlock_types_nort.h> - - #include <linux/rwlock_types.h> - -diff --git a/include/linux/spinlock_types_nort.h b/include/linux/spinlock_types_nort.h -new file mode 100644 -index 000000000000..e4549f0dd197 ---- /dev/null -+++ b/include/linux/spinlock_types_nort.h -@@ -0,0 +1,39 @@ -+#ifndef __LINUX_SPINLOCK_TYPES_NORT_H -+#define __LINUX_SPINLOCK_TYPES_NORT_H -+ -+#ifndef __LINUX_SPINLOCK_TYPES_H -+#error "Do not include directly. Include spinlock_types.h instead" -+#endif -+ -+/* -+ * The non RT version maps spinlocks to raw_spinlocks -+ */ -+typedef struct spinlock { -+ union { -+ struct raw_spinlock rlock; -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define LOCK_PADSIZE (offsetof(struct raw_spinlock, dep_map)) -+ struct { -+ u8 __padding[LOCK_PADSIZE]; -+ struct lockdep_map dep_map; -+ }; -+#endif -+ }; -+} spinlock_t; -+ -+#define ___SPIN_LOCK_INITIALIZER(lockname) \ -+{ \ -+ .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ -+ SPIN_DEBUG_INIT(lockname) \ -+ SPIN_DEP_MAP_INIT(lockname) } -+ -+#define __SPIN_LOCK_INITIALIZER(lockname) \ -+ { { .rlock = ___SPIN_LOCK_INITIALIZER(lockname) } } -+ -+#define __SPIN_LOCK_UNLOCKED(lockname) \ -+ (spinlock_t) __SPIN_LOCK_INITIALIZER(lockname) -+ -+#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) -+ -+#endif -diff --git a/include/linux/spinlock_types_raw.h b/include/linux/spinlock_types_raw.h -new file mode 100644 -index 000000000000..1d4a180e983d ---- /dev/null -+++ b/include/linux/spinlock_types_raw.h -@@ -0,0 +1,65 @@ -+#ifndef __LINUX_SPINLOCK_TYPES_RAW_H -+#define __LINUX_SPINLOCK_TYPES_RAW_H -+ -+#include <linux/types.h> -+ -+#if defined(CONFIG_SMP) -+# include <asm/spinlock_types.h> -+#else -+# include <linux/spinlock_types_up.h> -+#endif -+ -+#include <linux/lockdep_types.h> -+ -+typedef struct raw_spinlock { -+ arch_spinlock_t raw_lock; -+#ifdef CONFIG_DEBUG_SPINLOCK -+ unsigned int magic, owner_cpu; -+ void *owner; -+#endif -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+ struct lockdep_map dep_map; -+#endif -+} raw_spinlock_t; -+ -+#define SPINLOCK_MAGIC 0xdead4ead -+ -+#define SPINLOCK_OWNER_INIT ((void *)-1L) -+ -+#ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define RAW_SPIN_DEP_MAP_INIT(lockname) \ -+ .dep_map = { \ -+ .name = #lockname, \ -+ .wait_type_inner = LD_WAIT_SPIN, \ -+ } -+# define SPIN_DEP_MAP_INIT(lockname) \ -+ .dep_map = { \ -+ .name = #lockname, \ -+ .wait_type_inner = LD_WAIT_CONFIG, \ -+ } -+#else -+# define RAW_SPIN_DEP_MAP_INIT(lockname) -+# define SPIN_DEP_MAP_INIT(lockname) -+#endif -+ -+#ifdef CONFIG_DEBUG_SPINLOCK -+# define SPIN_DEBUG_INIT(lockname) \ -+ .magic = SPINLOCK_MAGIC, \ -+ .owner_cpu = -1, \ -+ .owner = SPINLOCK_OWNER_INIT, -+#else -+# define SPIN_DEBUG_INIT(lockname) -+#endif -+ -+#define __RAW_SPIN_LOCK_INITIALIZER(lockname) \ -+{ \ -+ .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \ -+ SPIN_DEBUG_INIT(lockname) \ -+ RAW_SPIN_DEP_MAP_INIT(lockname) } -+ -+#define __RAW_SPIN_LOCK_UNLOCKED(lockname) \ -+ (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname) -+ -+#define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x) -+ -+#endif --- -2.19.1 - diff --git a/features/rt/locking-split-out-the-rbtree-definition.patch b/features/rt/locking-split-out-the-rbtree-definition.patch deleted file mode 100644 index 8af42b5d..00000000 --- a/features/rt/locking-split-out-the-rbtree-definition.patch +++ /dev/null @@ -1,119 +0,0 @@ -From e13218659647185acc44046be640f023fd392f7b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 14 Aug 2020 17:08:41 +0200 -Subject: [PATCH 071/191] locking: split out the rbtree definition - -rtmutex.h needs the definition for rb_root_cached. By including kernel.h -we will get to spinlock.h which requires rtmutex.h again. - -Split out the required struct definition and move it into its own header -file which can be included by rtmutex.h - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rbtree.h | 27 +-------------------------- - include/linux/rbtree_type.h | 31 +++++++++++++++++++++++++++++++ - include/linux/rtmutex.h | 2 +- - 3 files changed, 33 insertions(+), 27 deletions(-) - create mode 100644 include/linux/rbtree_type.h - -diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h -index d31ecaf4fdd3..e711efc2e009 100644 ---- a/include/linux/rbtree.h -+++ b/include/linux/rbtree.h -@@ -19,19 +19,9 @@ - - #include <linux/kernel.h> - #include <linux/stddef.h> -+#include <linux/rbtree_type.h> - #include <linux/rcupdate.h> - --struct rb_node { -- unsigned long __rb_parent_color; -- struct rb_node *rb_right; -- struct rb_node *rb_left; --} __attribute__((aligned(sizeof(long)))); -- /* The alignment might seem pointless, but allegedly CRIS needs it */ -- --struct rb_root { -- struct rb_node *rb_node; --}; -- - #define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3)) - - #define RB_ROOT (struct rb_root) { NULL, } -@@ -112,21 +102,6 @@ static inline void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent - typeof(*pos), field); 1; }); \ - pos = n) - --/* -- * Leftmost-cached rbtrees. -- * -- * We do not cache the rightmost node based on footprint -- * size vs number of potential users that could benefit -- * from O(1) rb_last(). Just not worth it, users that want -- * this feature can always implement the logic explicitly. -- * Furthermore, users that want to cache both pointers may -- * find it a bit asymmetric, but that's ok. -- */ --struct rb_root_cached { -- struct rb_root rb_root; -- struct rb_node *rb_leftmost; --}; -- - #define RB_ROOT_CACHED (struct rb_root_cached) { {NULL, }, NULL } - - /* Same as rb_first(), but O(1) */ -diff --git a/include/linux/rbtree_type.h b/include/linux/rbtree_type.h -new file mode 100644 -index 000000000000..77a89dd2c7c6 ---- /dev/null -+++ b/include/linux/rbtree_type.h -@@ -0,0 +1,31 @@ -+/* SPDX-License-Identifier: GPL-2.0-or-later */ -+#ifndef _LINUX_RBTREE_TYPE_H -+#define _LINUX_RBTREE_TYPE_H -+ -+struct rb_node { -+ unsigned long __rb_parent_color; -+ struct rb_node *rb_right; -+ struct rb_node *rb_left; -+} __attribute__((aligned(sizeof(long)))); -+/* The alignment might seem pointless, but allegedly CRIS needs it */ -+ -+struct rb_root { -+ struct rb_node *rb_node; -+}; -+ -+/* -+ * Leftmost-cached rbtrees. -+ * -+ * We do not cache the rightmost node based on footprint -+ * size vs number of potential users that could benefit -+ * from O(1) rb_last(). Just not worth it, users that want -+ * this feature can always implement the logic explicitly. -+ * Furthermore, users that want to cache both pointers may -+ * find it a bit asymmetric, but that's ok. -+ */ -+struct rb_root_cached { -+ struct rb_root rb_root; -+ struct rb_node *rb_leftmost; -+}; -+ -+#endif -diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h -index add1dab27df5..b828b938c876 100644 ---- a/include/linux/rtmutex.h -+++ b/include/linux/rtmutex.h -@@ -14,7 +14,7 @@ - #define __LINUX_RT_MUTEX_H - - #include <linux/linkage.h> --#include <linux/rbtree.h> -+#include <linux/rbtree_type.h> - #include <linux/spinlock_types_raw.h> - - extern int max_lock_depth; /* for sysctl */ --- -2.19.1 - diff --git a/features/rt/md-raid5-Make-raid5_percpu-handling-RT-aware.patch b/features/rt/md-raid5-Make-raid5_percpu-handling-RT-aware.patch deleted file mode 100644 index 43380924..00000000 --- a/features/rt/md-raid5-Make-raid5_percpu-handling-RT-aware.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 28893cffb6465718d2196b201ec4dc9e41aca776 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 6 Apr 2010 16:51:31 +0200 -Subject: [PATCH 135/191] md: raid5: Make raid5_percpu handling RT aware - -__raid_run_ops() disables preemption with get_cpu() around the access -to the raid5_percpu variables. That causes scheduling while atomic -spews on RT. - -Serialize the access to the percpu data with a lock and keep the code -preemptible. - -Reported-by: Udo van den Heuvel <udovdh@xs4all.nl> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Udo van den Heuvel <udovdh@xs4all.nl> ---- - drivers/md/raid5.c | 7 +++++-- - drivers/md/raid5.h | 1 + - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c -index 5d57a5bd171f..86d6a676a509 100644 ---- a/drivers/md/raid5.c -+++ b/drivers/md/raid5.c -@@ -2216,8 +2216,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) - struct raid5_percpu *percpu; - unsigned long cpu; - -- cpu = get_cpu(); -+ cpu = get_cpu_light(); - percpu = per_cpu_ptr(conf->percpu, cpu); -+ spin_lock(&percpu->lock); - if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { - ops_run_biofill(sh); - overlap_clear++; -@@ -2276,7 +2277,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request) - if (test_and_clear_bit(R5_Overlap, &dev->flags)) - wake_up(&sh->raid_conf->wait_for_overlap); - } -- put_cpu(); -+ spin_unlock(&percpu->lock); -+ put_cpu_light(); - } - - static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) -@@ -7079,6 +7081,7 @@ static int raid456_cpu_up_prepare(unsigned int cpu, struct hlist_node *node) - __func__, cpu); - return -ENOMEM; - } -+ spin_lock_init(&per_cpu_ptr(conf->percpu, cpu)->lock); - return 0; - } - -diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h -index 5c05acf20e1f..665fe138ab4f 100644 ---- a/drivers/md/raid5.h -+++ b/drivers/md/raid5.h -@@ -635,6 +635,7 @@ struct r5conf { - int recovery_disabled; - /* per cpu variables */ - struct raid5_percpu { -+ spinlock_t lock; /* Protection for -RT */ - struct page *spare_page; /* Used when checking P/Q in raid6 */ - void *scribble; /* space for constructing buffer - * lists and performing address --- -2.19.1 - diff --git a/features/rt/mm-Allow-only-SLUB-on-RT.patch b/features/rt/mm-Allow-only-SLUB-on-RT.patch deleted file mode 100644 index 54012244..00000000 --- a/features/rt/mm-Allow-only-SLUB-on-RT.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 3049abb997a5dbe4e0c89c1fd51cb372c85ce15a Mon Sep 17 00:00:00 2001 -From: Ingo Molnar <mingo@elte.hu> -Date: Fri, 3 Jul 2009 08:44:03 -0500 -Subject: [PATCH 094/191] mm: Allow only SLUB on RT - -Memory allocation disables interrupts as part of the allocation and freeing -process. For -RT it is important that this section remain short and don't -depend on the size of the request or an internal state of the memory allocator. -At the beginning the SLAB memory allocator was adopted for RT's needs and it -required substantial changes. Later, with the addition of the SLUB memory -allocator we adopted this one as well and the changes were smaller. More -important, due to the design of the SLUB allocator it performs better and its -worst case latency was smaller. In the end only SLUB remained supported. - -Disable SLAB and SLOB on -RT. Only SLUB is adopted to -RT needs. - -Signed-off-by: Ingo Molnar <mingo@elte.hu> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - init/Kconfig | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/init/Kconfig b/init/Kconfig -index 5f5c776ef192..d51c16a3f355 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1886,6 +1886,7 @@ choice - - config SLAB - bool "SLAB" -+ depends on !PREEMPT_RT - select HAVE_HARDENED_USERCOPY_ALLOCATOR - help - The regular slab allocator that is established and known to work -@@ -1906,6 +1907,7 @@ config SLUB - config SLOB - depends on EXPERT - bool "SLOB (Simple Allocator)" -+ depends on !PREEMPT_RT - help - SLOB replaces the stock allocator with a drastically simpler - allocator. SLOB is generally more space efficient but --- -2.19.1 - diff --git a/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch b/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch deleted file mode 100644 index 077738b2..00000000 --- a/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 96e36ffab463f8f5823778279568a9cdd349c6c3 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 28 Oct 2020 18:15:32 +0100 -Subject: [PATCH 086/191] mm/memcontrol: Disable preemption in - __mod_memcg_lruvec_state() - -The callers expect disabled preemption/interrupts while invoking -__mod_memcg_lruvec_state(). This works mainline because a lock of -somekind is acquired. - -Use preempt_disable_rt() where per-CPU variables are accessed and a -stable pointer is expected. This is also done in __mod_zone_page_state() -for the same reason. - -Cc: stable-rt@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/memcontrol.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index e064ac0d850a..24091f7a64e2 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -809,6 +809,7 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, - pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); - memcg = pn->memcg; - -+ preempt_disable_rt(); - /* Update memcg */ - __mod_memcg_state(memcg, idx, val); - -@@ -828,6 +829,7 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, - x = 0; - } - __this_cpu_write(pn->lruvec_stat_cpu->count[idx], x); -+ preempt_enable_rt(); - } - - /** --- -2.19.1 - diff --git a/features/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch b/features/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch deleted file mode 100644 index bc68ff78..00000000 --- a/features/rt/mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 0951cba216f7340f7bdb138df663828817b3261a Mon Sep 17 00:00:00 2001 -From: Yang Shi <yang.shi@windriver.com> -Date: Wed, 30 Oct 2013 11:48:33 -0700 -Subject: [PATCH 114/191] mm/memcontrol: Don't call schedule_work_on in - preemption disabled context - -The following trace is triggered when running ltp oom test cases: - -BUG: sleeping function called from invalid context at kernel/rtmutex.c:659 -in_atomic(): 1, irqs_disabled(): 0, pid: 17188, name: oom03 -Preemption disabled at:[<ffffffff8112ba70>] mem_cgroup_reclaim+0x90/0xe0 - -CPU: 2 PID: 17188 Comm: oom03 Not tainted 3.10.10-rt3 #2 -Hardware name: Intel Corporation Calpella platform/MATXM-CORE-411-B, BIOS 4.6.3 08/18/2010 -ffff88007684d730 ffff880070df9b58 ffffffff8169918d ffff880070df9b70 -ffffffff8106db31 ffff88007688b4a0 ffff880070df9b88 ffffffff8169d9c0 -ffff88007688b4a0 ffff880070df9bc8 ffffffff81059da1 0000000170df9bb0 -Call Trace: -[<ffffffff8169918d>] dump_stack+0x19/0x1b -[<ffffffff8106db31>] __might_sleep+0xf1/0x170 -[<ffffffff8169d9c0>] rt_spin_lock+0x20/0x50 -[<ffffffff81059da1>] queue_work_on+0x61/0x100 -[<ffffffff8112b361>] drain_all_stock+0xe1/0x1c0 -[<ffffffff8112ba70>] mem_cgroup_reclaim+0x90/0xe0 -[<ffffffff8112beda>] __mem_cgroup_try_charge+0x41a/0xc40 -[<ffffffff810f1c91>] ? release_pages+0x1b1/0x1f0 -[<ffffffff8106f200>] ? sched_exec+0x40/0xb0 -[<ffffffff8112cc87>] mem_cgroup_charge_common+0x37/0x70 -[<ffffffff8112e2c6>] mem_cgroup_newpage_charge+0x26/0x30 -[<ffffffff8110af68>] handle_pte_fault+0x618/0x840 -[<ffffffff8103ecf6>] ? unpin_current_cpu+0x16/0x70 -[<ffffffff81070f94>] ? migrate_enable+0xd4/0x200 -[<ffffffff8110cde5>] handle_mm_fault+0x145/0x1e0 -[<ffffffff810301e1>] __do_page_fault+0x1a1/0x4c0 -[<ffffffff8169c9eb>] ? preempt_schedule_irq+0x4b/0x70 -[<ffffffff8169e3b7>] ? retint_kernel+0x37/0x40 -[<ffffffff8103053e>] do_page_fault+0xe/0x10 -[<ffffffff8169e4c2>] page_fault+0x22/0x30 - -So, to prevent schedule_work_on from being called in preempt disabled context, -replace the pair of get/put_cpu() to get/put_cpu_light(). - -Signed-off-by: Yang Shi <yang.shi@windriver.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/memcontrol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 74a65d87866c..0d741fcf9f53 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -2357,7 +2357,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) - * as well as workers from this path always operate on the local - * per-cpu data. CPU up doesn't touch memcg_stock at all. - */ -- curcpu = get_cpu(); -+ curcpu = get_cpu_light(); - for_each_online_cpu(cpu) { - struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu); - struct mem_cgroup *memcg; -@@ -2380,7 +2380,7 @@ static void drain_all_stock(struct mem_cgroup *root_memcg) - schedule_work_on(cpu, &stock->work); - } - } -- put_cpu(); -+ put_cpu_light(); - mutex_unlock(&percpu_charge_mutex); - } - --- -2.19.1 - diff --git a/features/rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch b/features/rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch deleted file mode 100644 index d85633ab..00000000 --- a/features/rt/mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch +++ /dev/null @@ -1,143 +0,0 @@ -From a597d1d521af35edd6fbb86d1934a0f92bc9d54e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 18 Aug 2020 10:30:00 +0200 -Subject: [PATCH 113/191] mm: memcontrol: Provide a local_lock for per-CPU - memcg_stock - -The interrupts are disabled to ensure CPU-local access to the per-CPU -variable `memcg_stock'. -As the code inside the interrupt disabled section acquires regular -spinlocks, which are converted to 'sleeping' spinlocks on a PREEMPT_RT -kernel, this conflicts with the RT semantics. - -Convert it to a local_lock which allows RT kernels to substitute them with -a real per CPU lock. On non RT kernels this maps to local_irq_save() as -before, but provides also lockdep coverage of the critical region. -No functional change. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/memcontrol.c | 31 ++++++++++++++++++------------- - 1 file changed, 18 insertions(+), 13 deletions(-) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 24091f7a64e2..74a65d87866c 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -2210,6 +2210,7 @@ void unlock_page_memcg(struct page *page) - EXPORT_SYMBOL(unlock_page_memcg); - - struct memcg_stock_pcp { -+ local_lock_t lock; - struct mem_cgroup *cached; /* this never be root cgroup */ - unsigned int nr_pages; - -@@ -2261,7 +2262,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) - if (nr_pages > MEMCG_CHARGE_BATCH) - return ret; - -- local_irq_save(flags); -+ local_lock_irqsave(&memcg_stock.lock, flags); - - stock = this_cpu_ptr(&memcg_stock); - if (memcg == stock->cached && stock->nr_pages >= nr_pages) { -@@ -2269,7 +2270,7 @@ static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) - ret = true; - } - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&memcg_stock.lock, flags); - - return ret; - } -@@ -2304,14 +2305,14 @@ static void drain_local_stock(struct work_struct *dummy) - * The only protection from memory hotplug vs. drain_stock races is - * that we always operate on local CPU stock here with IRQ disabled - */ -- local_irq_save(flags); -+ local_lock_irqsave(&memcg_stock.lock, flags); - - stock = this_cpu_ptr(&memcg_stock); - drain_obj_stock(stock); - drain_stock(stock); - clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags); - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&memcg_stock.lock, flags); - } - - /* -@@ -2323,7 +2324,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) - struct memcg_stock_pcp *stock; - unsigned long flags; - -- local_irq_save(flags); -+ local_lock_irqsave(&memcg_stock.lock, flags); - - stock = this_cpu_ptr(&memcg_stock); - if (stock->cached != memcg) { /* reset if necessary */ -@@ -2336,7 +2337,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) - if (stock->nr_pages > MEMCG_CHARGE_BATCH) - drain_stock(stock); - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&memcg_stock.lock, flags); - } - - /* -@@ -3158,7 +3159,7 @@ static bool consume_obj_stock(struct obj_cgroup *objcg, unsigned int nr_bytes) - unsigned long flags; - bool ret = false; - -- local_irq_save(flags); -+ local_lock_irqsave(&memcg_stock.lock, flags); - - stock = this_cpu_ptr(&memcg_stock); - if (objcg == stock->cached_objcg && stock->nr_bytes >= nr_bytes) { -@@ -3166,7 +3167,7 @@ static bool consume_obj_stock(struct obj_cgroup *objcg, unsigned int nr_bytes) - ret = true; - } - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&memcg_stock.lock, flags); - - return ret; - } -@@ -3225,7 +3226,7 @@ static void refill_obj_stock(struct obj_cgroup *objcg, unsigned int nr_bytes) - struct memcg_stock_pcp *stock; - unsigned long flags; - -- local_irq_save(flags); -+ local_lock_irqsave(&memcg_stock.lock, flags); - - stock = this_cpu_ptr(&memcg_stock); - if (stock->cached_objcg != objcg) { /* reset if necessary */ -@@ -3239,7 +3240,7 @@ static void refill_obj_stock(struct obj_cgroup *objcg, unsigned int nr_bytes) - if (stock->nr_bytes > PAGE_SIZE) - drain_obj_stock(stock); - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&memcg_stock.lock, flags); - } - - int obj_cgroup_charge(struct obj_cgroup *objcg, gfp_t gfp, size_t size) -@@ -7065,9 +7066,13 @@ static int __init mem_cgroup_init(void) - cpuhp_setup_state_nocalls(CPUHP_MM_MEMCQ_DEAD, "mm/memctrl:dead", NULL, - memcg_hotplug_cpu_dead); - -- for_each_possible_cpu(cpu) -- INIT_WORK(&per_cpu_ptr(&memcg_stock, cpu)->work, -- drain_local_stock); -+ for_each_possible_cpu(cpu) { -+ struct memcg_stock_pcp *stock; -+ -+ stock = per_cpu_ptr(&memcg_stock, cpu); -+ INIT_WORK(&stock->work, drain_local_stock); -+ local_lock_init(&stock->lock); -+ } - - for_each_node(node) { - struct mem_cgroup_tree_per_node *rtpn; --- -2.19.1 - diff --git a/features/rt/mm-memcontrol-Replace-local_irq_disable-with-local-l.patch b/features/rt/mm-memcontrol-Replace-local_irq_disable-with-local-l.patch deleted file mode 100644 index 0fd436ea..00000000 --- a/features/rt/mm-memcontrol-Replace-local_irq_disable-with-local-l.patch +++ /dev/null @@ -1,122 +0,0 @@ -From d4e7b31f217ee00026ee090133e88a9bcc33826b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 28 Jan 2015 17:14:16 +0100 -Subject: [PATCH 115/191] mm/memcontrol: Replace local_irq_disable with local - locks - -There are a few local_irq_disable() which then take sleeping locks. This -patch converts them local locks. - -[bigeasy: Move unlock after memcg_check_events() in mem_cgroup_swapout(), - pointed out by Matt Fleming <matt@codeblueprint.co.uk>] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/memcontrol.c | 29 +++++++++++++++++++++-------- - 1 file changed, 21 insertions(+), 8 deletions(-) - -diff --git a/mm/memcontrol.c b/mm/memcontrol.c -index 0d741fcf9f53..ae52cebfecfc 100644 ---- a/mm/memcontrol.c -+++ b/mm/memcontrol.c -@@ -66,6 +66,7 @@ - #include <net/sock.h> - #include <net/ip.h> - #include "slab.h" -+#include <linux/local_lock.h> - - #include <linux/uaccess.h> - -@@ -96,6 +97,13 @@ bool cgroup_memory_noswap __read_mostly; - static DECLARE_WAIT_QUEUE_HEAD(memcg_cgwb_frn_waitq); - #endif - -+struct event_lock { -+ local_lock_t l; -+}; -+static DEFINE_PER_CPU(struct event_lock, event_lock) = { -+ .l = INIT_LOCAL_LOCK(l), -+}; -+ - /* Whether legacy memory+swap accounting is active */ - static bool do_memsw_account(void) - { -@@ -5677,12 +5685,12 @@ static int mem_cgroup_move_account(struct page *page, - - ret = 0; - -- local_irq_disable(); -+ local_lock_irq(&event_lock.l); - mem_cgroup_charge_statistics(to, page, nr_pages); - memcg_check_events(to, page); - mem_cgroup_charge_statistics(from, page, -nr_pages); - memcg_check_events(from, page); -- local_irq_enable(); -+ local_unlock_irq(&event_lock.l); - out_unlock: - unlock_page(page); - out: -@@ -6739,10 +6747,10 @@ int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask) - css_get(&memcg->css); - commit_charge(page, memcg); - -- local_irq_disable(); -+ local_lock_irq(&event_lock.l); - mem_cgroup_charge_statistics(memcg, page, nr_pages); - memcg_check_events(memcg, page); -- local_irq_enable(); -+ local_unlock_irq(&event_lock.l); - - /* - * Cgroup1's unified memory+swap counter has been charged with the -@@ -6798,11 +6806,11 @@ static void uncharge_batch(const struct uncharge_gather *ug) - memcg_oom_recover(ug->memcg); - } - -- local_irq_save(flags); -+ local_lock_irqsave(&event_lock.l, flags); - __count_memcg_events(ug->memcg, PGPGOUT, ug->pgpgout); - __this_cpu_add(ug->memcg->vmstats_percpu->nr_page_events, ug->nr_pages); - memcg_check_events(ug->memcg, ug->dummy_page); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&event_lock.l, flags); - - /* drop reference from uncharge_page */ - css_put(&ug->memcg->css); -@@ -6935,10 +6943,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) - css_get(&memcg->css); - commit_charge(newpage, memcg); - -- local_irq_save(flags); -+ local_lock_irqsave(&event_lock.l, flags); - mem_cgroup_charge_statistics(memcg, newpage, nr_pages); - memcg_check_events(memcg, newpage); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&event_lock.l, flags); - } - - DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); -@@ -7121,6 +7129,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) - struct mem_cgroup *memcg, *swap_memcg; - unsigned int nr_entries; - unsigned short oldid; -+ unsigned long flags; - - VM_BUG_ON_PAGE(PageLRU(page), page); - VM_BUG_ON_PAGE(page_count(page), page); -@@ -7169,9 +7178,13 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) - * important here to have the interrupts disabled because it is the - * only synchronisation we have for updating the per-CPU variables. - */ -+ local_lock_irqsave(&event_lock.l, flags); -+#ifndef CONFIG_PREEMPT_RT - VM_BUG_ON(!irqs_disabled()); -+#endif - mem_cgroup_charge_statistics(memcg, page, -nr_entries); - memcg_check_events(memcg, page); -+ local_unlock_irqrestore(&event_lock.l, flags); - - css_put(&memcg->css); - } --- -2.19.1 - diff --git a/features/rt/mm-page_alloc-Use-a-local_lock-instead-of-explicit-l.patch b/features/rt/mm-page_alloc-Use-a-local_lock-instead-of-explicit-l.patch deleted file mode 100644 index 619ba657..00000000 --- a/features/rt/mm-page_alloc-Use-a-local_lock-instead-of-explicit-l.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 1398d3c431f6fd53914f1b71dd30732092e6baa7 Mon Sep 17 00:00:00 2001 -From: Ingo Molnar <mingo@elte.hu> -Date: Fri, 3 Jul 2009 08:29:37 -0500 -Subject: [PATCH 111/191] mm: page_alloc: Use a local_lock instead of explicit - local_irq_save(). - -The page-allocator disables interrupts for a few reasons: -- Decouple interrupt the irqsave operation from spin_lock() so it can be - extended over the actual lock region and cover other areas. Areas like - counters increments where the preemptible version can be avoided. - -- Access to the per-CPU pcp from struct zone. - -Replace the irqsave with a local-lock. The counters are expected to be -always modified with disabled preemption and no access from interrupt -context. - -Contains fixes from: - Peter Zijlstra <a.p.zijlstra@chello.nl> - Thomas Gleixner <tglx@linutronix.de> - -Signed-off-by: Ingo Molnar <mingo@elte.hu> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/page_alloc.c | 49 ++++++++++++++++++++++++++++++------------------- - 1 file changed, 30 insertions(+), 19 deletions(-) - -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index db713dd3e08e..72993fb19c99 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -62,6 +62,7 @@ - #include <linux/hugetlb.h> - #include <linux/sched/rt.h> - #include <linux/sched/mm.h> -+#include <linux/local_lock.h> - #include <linux/page_owner.h> - #include <linux/kthread.h> - #include <linux/memcontrol.h> -@@ -363,6 +364,13 @@ EXPORT_SYMBOL(nr_online_nodes); - - int page_group_by_mobility_disabled __read_mostly; - -+struct pa_lock { -+ local_lock_t l; -+}; -+static DEFINE_PER_CPU(struct pa_lock, pa_lock) = { -+ .l = INIT_LOCAL_LOCK(l), -+}; -+ - #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT - /* - * During boot we initialize deferred pages on-demand, as needed, but once -@@ -1541,11 +1549,11 @@ static void __free_pages_ok(struct page *page, unsigned int order, - return; - - migratetype = get_pfnblock_migratetype(page, pfn); -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - __count_vm_events(PGFREE, 1 << order); - free_one_page(page_zone(page), page, pfn, order, migratetype, - fpi_flags); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - - void __free_pages_core(struct page *page, unsigned int order) -@@ -2962,12 +2970,12 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp) - unsigned long flags; - int to_drain, batch; - -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - batch = READ_ONCE(pcp->batch); - to_drain = min(pcp->count, batch); - if (to_drain > 0) - free_pcppages_bulk(zone, to_drain, pcp); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - #endif - -@@ -2984,13 +2992,13 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone) - struct per_cpu_pageset *pset; - struct per_cpu_pages *pcp; - -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - pset = per_cpu_ptr(zone->pageset, cpu); - - pcp = &pset->pcp; - if (pcp->count) - free_pcppages_bulk(zone, pcp->count, pcp); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - - /* -@@ -3253,9 +3261,9 @@ void free_unref_page(struct page *page) - if (!free_unref_page_prepare(page, pfn)) - return; - -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - free_unref_page_commit(page, pfn); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - - /* -@@ -3275,7 +3283,7 @@ void free_unref_page_list(struct list_head *list) - set_page_private(page, pfn); - } - -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - list_for_each_entry_safe(page, next, list, lru) { - unsigned long pfn = page_private(page); - -@@ -3288,12 +3296,12 @@ void free_unref_page_list(struct list_head *list) - * a large list of pages to free. - */ - if (++batch_count == SWAP_CLUSTER_MAX) { -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - batch_count = 0; -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - } - } -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - - /* -@@ -3449,7 +3457,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, - struct page *page; - unsigned long flags; - -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - pcp = &this_cpu_ptr(zone->pageset)->pcp; - list = &pcp->lists[migratetype]; - page = __rmqueue_pcplist(zone, migratetype, alloc_flags, pcp, list); -@@ -3457,7 +3465,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, - __count_zid_vm_events(PGALLOC, page_zonenum(page), 1); - zone_statistics(preferred_zone, zone); - } -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - return page; - } - -@@ -3491,7 +3499,9 @@ struct page *rmqueue(struct zone *preferred_zone, - * allocate greater than order-1 page units with __GFP_NOFAIL. - */ - WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); -- spin_lock_irqsave(&zone->lock, flags); -+ -+ local_lock_irqsave(&pa_lock.l, flags); -+ spin_lock(&zone->lock); - - do { - page = NULL; -@@ -3512,12 +3522,13 @@ struct page *rmqueue(struct zone *preferred_zone, - spin_unlock(&zone->lock); - if (!page) - goto failed; -+ - __mod_zone_freepage_state(zone, -(1 << order), - get_pcppage_migratetype(page)); - - __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); - zone_statistics(preferred_zone, zone); -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - - out: - /* Separate test+clear to avoid unnecessary atomics */ -@@ -3530,7 +3541,7 @@ struct page *rmqueue(struct zone *preferred_zone, - return page; - - failed: -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - return NULL; - } - -@@ -8810,7 +8821,7 @@ void zone_pcp_reset(struct zone *zone) - struct per_cpu_pageset *pset; - - /* avoid races with drain_pages() */ -- local_irq_save(flags); -+ local_lock_irqsave(&pa_lock.l, flags); - if (zone->pageset != &boot_pageset) { - for_each_online_cpu(cpu) { - pset = per_cpu_ptr(zone->pageset, cpu); -@@ -8819,7 +8830,7 @@ void zone_pcp_reset(struct zone *zone) - free_percpu(zone->pageset); - zone->pageset = &boot_pageset; - } -- local_irq_restore(flags); -+ local_unlock_irqrestore(&pa_lock.l, flags); - } - - #ifdef CONFIG_MEMORY_HOTREMOVE --- -2.19.1 - diff --git a/features/rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch b/features/rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch deleted file mode 100644 index 3d068182..00000000 --- a/features/rt/mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 6e618c2aeb0d445978c2cbdec84fc15eea6edb82 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 2 Jul 2020 14:27:23 +0200 -Subject: [PATCH 110/191] mm: page_alloc: Use migrate_disable() in - drain_local_pages_wq() - -drain_local_pages_wq() disables preemption to avoid CPU migration during -CPU hotplug and can't use cpus_read_lock(). - -Using migrate_disable() works here, too. The scheduler won't take the -CPU offline until the task left the migrate-disable section. - -Use migrate_disable() in drain_local_pages_wq(). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/page_alloc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index cfc72873961d..db713dd3e08e 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -3038,9 +3038,9 @@ static void drain_local_pages_wq(struct work_struct *work) - * cpu which is allright but we also have to make sure to not move to - * a different one. - */ -- preempt_disable(); -+ migrate_disable(); - drain_local_pages(drain->zone); -- preempt_enable(); -+ migrate_enable(); - } - - /* --- -2.19.1 - diff --git a/features/rt/mm-scatterlist-Do-not-disable-irqs-on-RT.patch b/features/rt/mm-scatterlist-Do-not-disable-irqs-on-RT.patch deleted file mode 100644 index de9d9047..00000000 --- a/features/rt/mm-scatterlist-Do-not-disable-irqs-on-RT.patch +++ /dev/null @@ -1,29 +0,0 @@ -From e548a9846277b0cf05cd81fc6441d578728d20f3 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 3 Jul 2009 08:44:34 -0500 -Subject: [PATCH 162/191] mm/scatterlist: Do not disable irqs on RT - -For -RT it is enough to keep pagefault disabled (which is currently handled by -kmap_atomic()). - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - lib/scatterlist.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/scatterlist.c b/lib/scatterlist.c -index a59778946404..907f59045998 100644 ---- a/lib/scatterlist.c -+++ b/lib/scatterlist.c -@@ -892,7 +892,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter) - flush_kernel_dcache_page(miter->page); - - if (miter->__flags & SG_MITER_ATOMIC) { -- WARN_ON_ONCE(preemptible()); -+ WARN_ON_ONCE(!pagefault_disabled()); - kunmap_atomic(miter->addr); - } else - kunmap(miter->page); --- -2.19.1 - diff --git a/features/rt/mm-sl-au-b-Change-list_lock-to-raw_spinlock_t.patch b/features/rt/mm-sl-au-b-Change-list_lock-to-raw_spinlock_t.patch deleted file mode 100644 index c6c7ab42..00000000 --- a/features/rt/mm-sl-au-b-Change-list_lock-to-raw_spinlock_t.patch +++ /dev/null @@ -1,602 +0,0 @@ -From 8583607fe6b30d9952332612f6093f40282d0906 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 28 May 2018 15:24:22 +0200 -Subject: [PATCH 104/191] mm: sl[au]b: Change list_lock to raw_spinlock_t - -The list_lock is used with used with IRQs off on PREEMPT_RT. Make it a -raw_spinlock_t otherwise the interrupts won't be disabled on PREEMPT_RT. -The locking rules remain unchanged. -The lock is updated for SLAB and SLUB since both share the same header -file for struct kmem_cache_node defintion. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slab.c | 90 +++++++++++++++++++++++++++---------------------------- - mm/slab.h | 2 +- - mm/slub.c | 50 +++++++++++++++---------------- - 3 files changed, 71 insertions(+), 71 deletions(-) - -diff --git a/mm/slab.c b/mm/slab.c -index ae651bf540b7..afe196fcf579 100644 ---- a/mm/slab.c -+++ b/mm/slab.c -@@ -234,7 +234,7 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent) - parent->shared = NULL; - parent->alien = NULL; - parent->colour_next = 0; -- spin_lock_init(&parent->list_lock); -+ raw_spin_lock_init(&parent->list_lock); - parent->free_objects = 0; - parent->free_touched = 0; - } -@@ -559,9 +559,9 @@ static noinline void cache_free_pfmemalloc(struct kmem_cache *cachep, - page_node = page_to_nid(page); - n = get_node(cachep, page_node); - -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - free_block(cachep, &objp, 1, page_node, &list); -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - - slabs_destroy(cachep, &list); - } -@@ -699,7 +699,7 @@ static void __drain_alien_cache(struct kmem_cache *cachep, - struct kmem_cache_node *n = get_node(cachep, node); - - if (ac->avail) { -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - /* - * Stuff objects into the remote nodes shared array first. - * That way we could avoid the overhead of putting the objects -@@ -710,7 +710,7 @@ static void __drain_alien_cache(struct kmem_cache *cachep, - - free_block(cachep, ac->entry, ac->avail, node, list); - ac->avail = 0; -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - } - } - -@@ -783,9 +783,9 @@ static int __cache_free_alien(struct kmem_cache *cachep, void *objp, - slabs_destroy(cachep, &list); - } else { - n = get_node(cachep, page_node); -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - free_block(cachep, &objp, 1, page_node, &list); -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - slabs_destroy(cachep, &list); - } - return 1; -@@ -826,10 +826,10 @@ static int init_cache_node(struct kmem_cache *cachep, int node, gfp_t gfp) - */ - n = get_node(cachep, node); - if (n) { -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - n->free_limit = (1 + nr_cpus_node(node)) * cachep->batchcount + - cachep->num; -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - - return 0; - } -@@ -908,7 +908,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, - goto fail; - - n = get_node(cachep, node); -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - if (n->shared && force_change) { - free_block(cachep, n->shared->entry, - n->shared->avail, node, &list); -@@ -926,7 +926,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, - new_alien = NULL; - } - -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - slabs_destroy(cachep, &list); - - /* -@@ -965,7 +965,7 @@ static void cpuup_canceled(long cpu) - if (!n) - continue; - -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - - /* Free limit for this kmem_cache_node */ - n->free_limit -= cachep->batchcount; -@@ -976,7 +976,7 @@ static void cpuup_canceled(long cpu) - nc->avail = 0; - - if (!cpumask_empty(mask)) { -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - goto free_slab; - } - -@@ -990,7 +990,7 @@ static void cpuup_canceled(long cpu) - alien = n->alien; - n->alien = NULL; - -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - - kfree(shared); - if (alien) { -@@ -1174,7 +1174,7 @@ static void __init init_list(struct kmem_cache *cachep, struct kmem_cache_node * - /* - * Do not assume that spinlocks can be initialized via memcpy: - */ -- spin_lock_init(&ptr->list_lock); -+ raw_spin_lock_init(&ptr->list_lock); - - MAKE_ALL_LISTS(cachep, ptr, nodeid); - cachep->node[nodeid] = ptr; -@@ -1345,11 +1345,11 @@ slab_out_of_memory(struct kmem_cache *cachep, gfp_t gfpflags, int nodeid) - for_each_kmem_cache_node(cachep, node, n) { - unsigned long total_slabs, free_slabs, free_objs; - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - total_slabs = n->total_slabs; - free_slabs = n->free_slabs; - free_objs = n->free_objects; -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - - pr_warn(" node %d: slabs: %ld/%ld, objs: %ld/%ld\n", - node, total_slabs - free_slabs, total_slabs, -@@ -2107,7 +2107,7 @@ static void check_spinlock_acquired(struct kmem_cache *cachep) - { - #ifdef CONFIG_SMP - check_irq_off(); -- assert_spin_locked(&get_node(cachep, numa_mem_id())->list_lock); -+ assert_raw_spin_locked(&get_node(cachep, numa_mem_id())->list_lock); - #endif - } - -@@ -2115,7 +2115,7 @@ static void check_spinlock_acquired_node(struct kmem_cache *cachep, int node) - { - #ifdef CONFIG_SMP - check_irq_off(); -- assert_spin_locked(&get_node(cachep, node)->list_lock); -+ assert_raw_spin_locked(&get_node(cachep, node)->list_lock); - #endif - } - -@@ -2155,9 +2155,9 @@ static void do_drain(void *arg) - check_irq_off(); - ac = cpu_cache_get(cachep); - n = get_node(cachep, node); -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - free_block(cachep, ac->entry, ac->avail, node, &list); -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - ac->avail = 0; - slabs_destroy(cachep, &list); - } -@@ -2175,9 +2175,9 @@ static void drain_cpu_caches(struct kmem_cache *cachep) - drain_alien_cache(cachep, n->alien); - - for_each_kmem_cache_node(cachep, node, n) { -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - drain_array_locked(cachep, n->shared, node, true, &list); -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - - slabs_destroy(cachep, &list); - } -@@ -2199,10 +2199,10 @@ static int drain_freelist(struct kmem_cache *cache, - nr_freed = 0; - while (nr_freed < tofree && !list_empty(&n->slabs_free)) { - -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - p = n->slabs_free.prev; - if (p == &n->slabs_free) { -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - goto out; - } - -@@ -2215,7 +2215,7 @@ static int drain_freelist(struct kmem_cache *cache, - * to the cache. - */ - n->free_objects -= cache->num; -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - slab_destroy(cache, page); - nr_freed++; - } -@@ -2651,7 +2651,7 @@ static void cache_grow_end(struct kmem_cache *cachep, struct page *page) - INIT_LIST_HEAD(&page->slab_list); - n = get_node(cachep, page_to_nid(page)); - -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - n->total_slabs++; - if (!page->active) { - list_add_tail(&page->slab_list, &n->slabs_free); -@@ -2661,7 +2661,7 @@ static void cache_grow_end(struct kmem_cache *cachep, struct page *page) - - STATS_INC_GROWN(cachep); - n->free_objects += cachep->num - page->active; -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - - fixup_objfreelist_debug(cachep, &list); - } -@@ -2827,7 +2827,7 @@ static struct page *get_first_slab(struct kmem_cache_node *n, bool pfmemalloc) - { - struct page *page; - -- assert_spin_locked(&n->list_lock); -+ assert_raw_spin_locked(&n->list_lock); - page = list_first_entry_or_null(&n->slabs_partial, struct page, - slab_list); - if (!page) { -@@ -2854,10 +2854,10 @@ static noinline void *cache_alloc_pfmemalloc(struct kmem_cache *cachep, - if (!gfp_pfmemalloc_allowed(flags)) - return NULL; - -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - page = get_first_slab(n, true); - if (!page) { -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - return NULL; - } - -@@ -2866,7 +2866,7 @@ static noinline void *cache_alloc_pfmemalloc(struct kmem_cache *cachep, - - fixup_slab_list(cachep, n, page, &list); - -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - fixup_objfreelist_debug(cachep, &list); - - return obj; -@@ -2925,7 +2925,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) - if (!n->free_objects && (!shared || !shared->avail)) - goto direct_grow; - -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - shared = READ_ONCE(n->shared); - - /* See if we can refill from the shared array */ -@@ -2949,7 +2949,7 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) - must_grow: - n->free_objects -= ac->avail; - alloc_done: -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - fixup_objfreelist_debug(cachep, &list); - - direct_grow: -@@ -3174,7 +3174,7 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, - BUG_ON(!n); - - check_irq_off(); -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - page = get_first_slab(n, false); - if (!page) - goto must_grow; -@@ -3192,12 +3192,12 @@ static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, - - fixup_slab_list(cachep, n, page, &list); - -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - fixup_objfreelist_debug(cachep, &list); - return obj; - - must_grow: -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - page = cache_grow_begin(cachep, gfp_exact_node(flags), nodeid); - if (page) { - /* This slab isn't counted yet so don't update free_objects */ -@@ -3385,7 +3385,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) - - check_irq_off(); - n = get_node(cachep, node); -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - if (n->shared) { - struct array_cache *shared_array = n->shared; - int max = shared_array->limit - shared_array->avail; -@@ -3414,7 +3414,7 @@ static void cache_flusharray(struct kmem_cache *cachep, struct array_cache *ac) - STATS_SET_FREEABLE(cachep, i); - } - #endif -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - ac->avail -= batchcount; - memmove(ac->entry, &(ac->entry[batchcount]), sizeof(void *)*ac->avail); - slabs_destroy(cachep, &list); -@@ -3870,9 +3870,9 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, - - node = cpu_to_mem(cpu); - n = get_node(cachep, node); -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - free_block(cachep, ac->entry, ac->avail, node, &list); -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - slabs_destroy(cachep, &list); - } - free_percpu(prev); -@@ -3967,9 +3967,9 @@ static void drain_array(struct kmem_cache *cachep, struct kmem_cache_node *n, - return; - } - -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - drain_array_locked(cachep, ac, node, false, &list); -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - - slabs_destroy(cachep, &list); - } -@@ -4053,7 +4053,7 @@ void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) - - for_each_kmem_cache_node(cachep, node, n) { - check_irq_on(); -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - - total_slabs += n->total_slabs; - free_slabs += n->free_slabs; -@@ -4062,7 +4062,7 @@ void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo) - if (n->shared) - shared_avail += n->shared->avail; - -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - } - num_objs = total_slabs * cachep->num; - active_slabs = total_slabs - free_slabs; -diff --git a/mm/slab.h b/mm/slab.h -index 076582f58f68..21c670da13ac 100644 ---- a/mm/slab.h -+++ b/mm/slab.h -@@ -527,7 +527,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s, - * The slab lists for all objects. - */ - struct kmem_cache_node { -- spinlock_t list_lock; -+ raw_spinlock_t list_lock; - - #ifdef CONFIG_SLAB - struct list_head slabs_partial; /* partial list first, better asm code */ -diff --git a/mm/slub.c b/mm/slub.c -index 3021ce9bf1b3..07e662d2aef0 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -1225,7 +1225,7 @@ static noinline int free_debug_processing( - unsigned long flags; - int ret = 0; - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - slab_lock(page); - - if (s->flags & SLAB_CONSISTENCY_CHECKS) { -@@ -1260,7 +1260,7 @@ static noinline int free_debug_processing( - bulk_cnt, cnt); - - slab_unlock(page); -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - if (!ret) - slab_fix(s, "Object at 0x%p not freed", object); - return ret; -@@ -1984,7 +1984,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, - if (!n || !n->nr_partial) - return NULL; - -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - list_for_each_entry_safe(page, page2, &n->partial, slab_list) { - void *t; - -@@ -2009,7 +2009,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, - break; - - } -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - return object; - } - -@@ -2252,7 +2252,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, - * that acquire_slab() will see a slab page that - * is frozen - */ -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - } - } else { - m = M_FULL; -@@ -2263,7 +2263,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, - * slabs from diagnostic functions will not see - * any frozen slabs. - */ -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - } - } - -@@ -2287,7 +2287,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, - goto redo; - - if (lock) -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - - if (m == M_PARTIAL) - stat(s, tail); -@@ -2326,10 +2326,10 @@ static void unfreeze_partials(struct kmem_cache *s, - n2 = get_node(s, page_to_nid(page)); - if (n != n2) { - if (n) -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - - n = n2; -- spin_lock(&n->list_lock); -+ raw_spin_lock(&n->list_lock); - } - - do { -@@ -2358,7 +2358,7 @@ static void unfreeze_partials(struct kmem_cache *s, - } - - if (n) -- spin_unlock(&n->list_lock); -+ raw_spin_unlock(&n->list_lock); - - while (discard_page) { - page = discard_page; -@@ -2525,10 +2525,10 @@ static unsigned long count_partial(struct kmem_cache_node *n, - unsigned long x = 0; - struct page *page; - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - list_for_each_entry(page, &n->partial, slab_list) - x += get_count(page); -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - return x; - } - #endif /* CONFIG_SLUB_DEBUG || CONFIG_SYSFS */ -@@ -2997,7 +2997,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, - - do { - if (unlikely(n)) { -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - n = NULL; - } - prior = page->freelist; -@@ -3029,7 +3029,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, - * Otherwise the list_lock will synchronize with - * other processors updating the list of slabs. - */ -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - - } - } -@@ -3071,7 +3071,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, - add_partial(n, page, DEACTIVATE_TO_TAIL); - stat(s, FREE_ADD_PARTIAL); - } -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - return; - - slab_empty: -@@ -3086,7 +3086,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page, - remove_full(s, n, page); - } - -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - stat(s, FREE_SLAB); - discard_slab(s, page); - } -@@ -3518,7 +3518,7 @@ static void - init_kmem_cache_node(struct kmem_cache_node *n) - { - n->nr_partial = 0; -- spin_lock_init(&n->list_lock); -+ raw_spin_lock_init(&n->list_lock); - INIT_LIST_HEAD(&n->partial); - #ifdef CONFIG_SLUB_DEBUG - atomic_long_set(&n->nr_slabs, 0); -@@ -3918,7 +3918,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) - struct page *page, *h; - - BUG_ON(irqs_disabled()); -- spin_lock_irq(&n->list_lock); -+ raw_spin_lock_irq(&n->list_lock); - list_for_each_entry_safe(page, h, &n->partial, slab_list) { - if (!page->inuse) { - remove_partial(n, page); -@@ -3928,7 +3928,7 @@ static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n) - "Objects remaining in %s on __kmem_cache_shutdown()"); - } - } -- spin_unlock_irq(&n->list_lock); -+ raw_spin_unlock_irq(&n->list_lock); - - list_for_each_entry_safe(page, h, &discard, slab_list) - discard_slab(s, page); -@@ -4243,7 +4243,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) - for (i = 0; i < SHRINK_PROMOTE_MAX; i++) - INIT_LIST_HEAD(promote + i); - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - - /* - * Build lists of slabs to discard or promote. -@@ -4274,7 +4274,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) - for (i = SHRINK_PROMOTE_MAX - 1; i >= 0; i--) - list_splice(promote + i, &n->partial); - -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - - /* Release empty slabs */ - list_for_each_entry_safe(page, t, &discard, slab_list) -@@ -4644,7 +4644,7 @@ static int validate_slab_node(struct kmem_cache *s, - struct page *page; - unsigned long flags; - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - - list_for_each_entry(page, &n->partial, slab_list) { - validate_slab(s, page); -@@ -4666,7 +4666,7 @@ static int validate_slab_node(struct kmem_cache *s, - s->name, count, atomic_long_read(&n->nr_slabs)); - - out: -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - return count; - } - -@@ -4845,12 +4845,12 @@ static int list_locations(struct kmem_cache *s, char *buf, - if (!atomic_long_read(&n->nr_slabs)) - continue; - -- spin_lock_irqsave(&n->list_lock, flags); -+ raw_spin_lock_irqsave(&n->list_lock, flags); - list_for_each_entry(page, &n->partial, slab_list) - process_slab(&t, s, page, alloc); - list_for_each_entry(page, &n->full, slab_list) - process_slab(&t, s, page, alloc); -- spin_unlock_irqrestore(&n->list_lock, flags); -+ raw_spin_unlock_irqrestore(&n->list_lock, flags); - } - - for (i = 0; i < t.count; i++) { --- -2.19.1 - diff --git a/features/rt/mm-slub-Don-t-enable-partial-CPU-caches-on-PREEMPT_R.patch b/features/rt/mm-slub-Don-t-enable-partial-CPU-caches-on-PREEMPT_R.patch deleted file mode 100644 index d3c75a7e..00000000 --- a/features/rt/mm-slub-Don-t-enable-partial-CPU-caches-on-PREEMPT_R.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b49dbaa0391f05adefc6384ea61cb9e60c4a452a Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 2 Mar 2021 18:58:04 +0100 -Subject: [PATCH 112/191] mm: slub: Don't enable partial CPU caches on - PREEMPT_RT by default - -SLUB's partial CPU caches lead to higher latencies in a hackbench -benchmark. - -Don't enable partial CPU caches by default on PREEMPT_RT. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - init/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/init/Kconfig b/init/Kconfig -index 37686a22a769..45f2231c7131 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1974,7 +1974,7 @@ config SHUFFLE_PAGE_ALLOCATOR - Say Y if unsure. - - config SLUB_CPU_PARTIAL -- default y -+ default y if !PREEMPT_RT - depends on SLUB && SMP - bool "SLUB per cpu partial cache" - help --- -2.19.1 - diff --git a/features/rt/mm-slub-Don-t-resize-the-location-tracking-cache-on-.patch b/features/rt/mm-slub-Don-t-resize-the-location-tracking-cache-on-.patch deleted file mode 100644 index 601403f6..00000000 --- a/features/rt/mm-slub-Don-t-resize-the-location-tracking-cache-on-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From cc489539ca4480363e75c1f71bf9e47f835fb2ef Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 26 Feb 2021 17:26:04 +0100 -Subject: [PATCH 109/191] mm: slub: Don't resize the location tracking cache on - PREEMPT_RT - -The location tracking cache has a size of a page and is resized if its -current size is too small. -This allocation happens with disabled interrupts and can't happen on -PREEMPT_RT. -Should one page be too small, then we have to allocate more at the -beginning. The only downside is that less callers will be visible. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slub.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/mm/slub.c b/mm/slub.c -index ec608c1d5fdb..26cf2872a7ff 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -4819,6 +4819,9 @@ static int alloc_loc_track(struct loc_track *t, unsigned long max, gfp_t flags) - struct location *l; - int order; - -+ if (IS_ENABLED(CONFIG_PREEMPT_RT) && flags == GFP_ATOMIC) -+ return 0; -+ - order = get_order(sizeof(struct location) * max); - - l = (void *)__get_free_pages(flags, order); --- -2.19.1 - diff --git a/features/rt/mm-slub-Enable-irqs-for-__GFP_WAIT.patch b/features/rt/mm-slub-Enable-irqs-for-__GFP_WAIT.patch deleted file mode 100644 index 82d38ebf..00000000 --- a/features/rt/mm-slub-Enable-irqs-for-__GFP_WAIT.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 9a1bfa7cf125b54a5ad856c32adf4a21359db777 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 9 Jan 2013 12:08:15 +0100 -Subject: [PATCH 106/191] mm: slub: Enable irqs for __GFP_WAIT - -SYSTEM_RUNNING might be too late for enabling interrupts. Allocations -with GFP_WAIT can happen before that. So use this as an indicator. - -[bigeasy: Add warning on RT for allocations in atomic context. - Don't enable interrupts on allocations during SYSTEM_SUSPEND. This is done - during suspend by ACPI, noticed by Liwei Song <liwei.song@windriver.com> -] - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slub.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/mm/slub.c b/mm/slub.c -index 863b0304b229..1382845c3802 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -1759,10 +1759,18 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) - void *start, *p, *next; - int idx; - bool shuffle; -+ bool enableirqs = false; - - flags &= gfp_allowed_mask; - - if (gfpflags_allow_blocking(flags)) -+ enableirqs = true; -+ -+#ifdef CONFIG_PREEMPT_RT -+ if (system_state > SYSTEM_BOOTING && system_state < SYSTEM_SUSPEND) -+ enableirqs = true; -+#endif -+ if (enableirqs) - local_irq_enable(); - - flags |= s->allocflags; -@@ -1823,7 +1831,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) - page->frozen = 1; - - out: -- if (gfpflags_allow_blocking(flags)) -+ if (enableirqs) - local_irq_disable(); - if (!page) - return NULL; -@@ -2823,6 +2831,10 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, - unsigned long tid; - struct obj_cgroup *objcg = NULL; - -+ if (IS_ENABLED(CONFIG_PREEMPT_RT) && IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP)) -+ WARN_ON_ONCE(!preemptible() && -+ (system_state > SYSTEM_BOOTING && system_state < SYSTEM_SUSPEND)); -+ - s = slab_pre_alloc_hook(s, &objcg, 1, gfpflags); - if (!s) - return NULL; -@@ -3304,6 +3316,10 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, - int i; - struct obj_cgroup *objcg = NULL; - -+ if (IS_ENABLED(CONFIG_PREEMPT_RT) && IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP)) -+ WARN_ON_ONCE(!preemptible() && -+ (system_state > SYSTEM_BOOTING && system_state < SYSTEM_SUSPEND)); -+ - /* memcg and kmem_cache debug support */ - s = slab_pre_alloc_hook(s, &objcg, size, flags); - if (unlikely(!s)) --- -2.19.1 - diff --git a/features/rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch b/features/rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch deleted file mode 100644 index c2597842..00000000 --- a/features/rt/mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch +++ /dev/null @@ -1,49 +0,0 @@ -From ebdeb55b60cffd57cc349a1a5c657c5905bc01ab Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 16 Jul 2020 18:47:50 +0200 -Subject: [PATCH 105/191] mm: slub: Make object_map_lock a raw_spinlock_t - -The variable object_map is protected by object_map_lock. The lock is always -acquired in debug code and within already atomic context - -Make object_map_lock a raw_spinlock_t. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slub.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/mm/slub.c b/mm/slub.c -index 07e662d2aef0..863b0304b229 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -445,7 +445,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page, - - #ifdef CONFIG_SLUB_DEBUG - static unsigned long object_map[BITS_TO_LONGS(MAX_OBJS_PER_PAGE)]; --static DEFINE_SPINLOCK(object_map_lock); -+static DEFINE_RAW_SPINLOCK(object_map_lock); - - /* - * Determine a map of object in use on a page. -@@ -461,7 +461,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page) - - VM_BUG_ON(!irqs_disabled()); - -- spin_lock(&object_map_lock); -+ raw_spin_lock(&object_map_lock); - - bitmap_zero(object_map, page->objects); - -@@ -474,7 +474,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page) - static void put_map(unsigned long *map) __releases(&object_map_lock) - { - VM_BUG_ON(map != object_map); -- spin_unlock(&object_map_lock); -+ raw_spin_unlock(&object_map_lock); - } - - static inline unsigned int size_from_object(struct kmem_cache *s) --- -2.19.1 - diff --git a/features/rt/mm-slub-Move-discard_slab-invocations-out-of-IRQ-off.patch b/features/rt/mm-slub-Move-discard_slab-invocations-out-of-IRQ-off.patch deleted file mode 100644 index 9f53a2dd..00000000 --- a/features/rt/mm-slub-Move-discard_slab-invocations-out-of-IRQ-off.patch +++ /dev/null @@ -1,416 +0,0 @@ -From a554a721d714cba4bf3c8eb17e25913fa593a6bf Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 26 Feb 2021 15:14:15 +0100 -Subject: [PATCH 107/191] mm: slub: Move discard_slab() invocations out of - IRQ-off sections - -discard_slab() gives the memory back to the page-allocator. Some of its -invocation occur from IRQ-disabled sections which were disabled by SLUB. -An example is the deactivate_slab() invocation from within -___slab_alloc() or put_cpu_partial(). - -Instead of giving the memory back directly, put the pages on a list and -process it once the caller is out of the known IRQ-off region. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slub.c | 114 +++++++++++++++++++++++++++++++++++++----------------- - 1 file changed, 78 insertions(+), 36 deletions(-) - -diff --git a/mm/slub.c b/mm/slub.c -index 1382845c3802..af9c0fbe2cf5 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -1889,12 +1889,29 @@ static void free_slab(struct kmem_cache *s, struct page *page) - __free_slab(s, page); - } - -+static void discard_slab_delayed(struct kmem_cache *s, struct page *page, -+ struct list_head *delayed_free) -+{ -+ dec_slabs_node(s, page_to_nid(page), page->objects); -+ list_add(&page->lru, delayed_free); -+} -+ - static void discard_slab(struct kmem_cache *s, struct page *page) - { - dec_slabs_node(s, page_to_nid(page), page->objects); - free_slab(s, page); - } - -+static void discard_delayed(struct list_head *l) -+{ -+ while (!list_empty(l)) { -+ struct page *page = list_first_entry(l, struct page, lru); -+ -+ list_del(&page->lru); -+ __free_slab(page->slab_cache, page); -+ } -+} -+ - /* - * Management of partially allocated slabs. - */ -@@ -1968,15 +1985,16 @@ static inline void *acquire_slab(struct kmem_cache *s, - WARN_ON(!freelist); - return freelist; - } -- --static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain); -+static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain, -+ struct list_head *delayed_free); - static inline bool pfmemalloc_match(struct page *page, gfp_t gfpflags); - - /* - * Try to allocate a partial slab from a specific node. - */ - static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, -- struct kmem_cache_cpu *c, gfp_t flags) -+ struct kmem_cache_cpu *c, gfp_t flags, -+ struct list_head *delayed_free) - { - struct page *page, *page2; - void *object = NULL; -@@ -2009,7 +2027,7 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, - stat(s, ALLOC_FROM_PARTIAL); - object = t; - } else { -- put_cpu_partial(s, page, 0); -+ put_cpu_partial(s, page, 0, delayed_free); - stat(s, CPU_PARTIAL_NODE); - } - if (!kmem_cache_has_cpu_partial(s) -@@ -2025,7 +2043,8 @@ static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, - * Get a page from somewhere. Search in increasing NUMA distances. - */ - static void *get_any_partial(struct kmem_cache *s, gfp_t flags, -- struct kmem_cache_cpu *c) -+ struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - #ifdef CONFIG_NUMA - struct zonelist *zonelist; -@@ -2067,7 +2086,7 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, - - if (n && cpuset_zone_allowed(zone, flags) && - n->nr_partial > s->min_partial) { -- object = get_partial_node(s, n, c, flags); -+ object = get_partial_node(s, n, c, flags, delayed_free); - if (object) { - /* - * Don't check read_mems_allowed_retry() -@@ -2089,7 +2108,8 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags, - * Get a partial page, lock it and return it. - */ - static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, -- struct kmem_cache_cpu *c) -+ struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - void *object; - int searchnode = node; -@@ -2097,11 +2117,12 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, - if (node == NUMA_NO_NODE) - searchnode = numa_mem_id(); - -- object = get_partial_node(s, get_node(s, searchnode), c, flags); -+ object = get_partial_node(s, get_node(s, searchnode), c, flags, -+ delayed_free); - if (object || node != NUMA_NO_NODE) - return object; - -- return get_any_partial(s, flags, c); -+ return get_any_partial(s, flags, c, delayed_free); - } - - #ifdef CONFIG_PREEMPTION -@@ -2177,7 +2198,8 @@ static void init_kmem_cache_cpus(struct kmem_cache *s) - * Remove the cpu slab - */ - static void deactivate_slab(struct kmem_cache *s, struct page *page, -- void *freelist, struct kmem_cache_cpu *c) -+ void *freelist, struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - enum slab_modes { M_NONE, M_PARTIAL, M_FULL, M_FREE }; - struct kmem_cache_node *n = get_node(s, page_to_nid(page)); -@@ -2303,7 +2325,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, - stat(s, DEACTIVATE_FULL); - else if (m == M_FREE) { - stat(s, DEACTIVATE_EMPTY); -- discard_slab(s, page); -+ discard_slab_delayed(s, page, delayed_free); - stat(s, FREE_SLAB); - } - -@@ -2318,8 +2340,8 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page, - * for the cpu using c (or some other guarantee must be there - * to guarantee no concurrent accesses). - */ --static void unfreeze_partials(struct kmem_cache *s, -- struct kmem_cache_cpu *c) -+static void unfreeze_partials(struct kmem_cache *s, struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - #ifdef CONFIG_SLUB_CPU_PARTIAL - struct kmem_cache_node *n = NULL, *n2 = NULL; -@@ -2373,7 +2395,7 @@ static void unfreeze_partials(struct kmem_cache *s, - discard_page = discard_page->next; - - stat(s, DEACTIVATE_EMPTY); -- discard_slab(s, page); -+ discard_slab_delayed(s, page, delayed_free); - stat(s, FREE_SLAB); - } - #endif /* CONFIG_SLUB_CPU_PARTIAL */ -@@ -2386,7 +2408,8 @@ static void unfreeze_partials(struct kmem_cache *s, - * If we did not find a slot then simply move all the partials to the - * per node partial list. - */ --static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) -+static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain, -+ struct list_head *delayed_free) - { - #ifdef CONFIG_SLUB_CPU_PARTIAL - struct page *oldpage; -@@ -2409,7 +2432,8 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) - * set to the per node partial list. - */ - local_irq_save(flags); -- unfreeze_partials(s, this_cpu_ptr(s->cpu_slab)); -+ unfreeze_partials(s, this_cpu_ptr(s->cpu_slab), -+ delayed_free); - local_irq_restore(flags); - oldpage = NULL; - pobjects = 0; -@@ -2431,17 +2455,18 @@ static void put_cpu_partial(struct kmem_cache *s, struct page *page, int drain) - unsigned long flags; - - local_irq_save(flags); -- unfreeze_partials(s, this_cpu_ptr(s->cpu_slab)); -+ unfreeze_partials(s, this_cpu_ptr(s->cpu_slab), delayed_free); - local_irq_restore(flags); - } - preempt_enable(); - #endif /* CONFIG_SLUB_CPU_PARTIAL */ - } - --static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) -+static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - stat(s, CPUSLAB_FLUSH); -- deactivate_slab(s, c->page, c->freelist, c); -+ deactivate_slab(s, c->page, c->freelist, c, delayed_free); - - c->tid = next_tid(c->tid); - } -@@ -2451,21 +2476,24 @@ static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c) - * - * Called from IPI handler with interrupts disabled. - */ --static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu) -+static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu, -+ struct list_head *delayed_free) - { - struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); - - if (c->page) -- flush_slab(s, c); -+ flush_slab(s, c, delayed_free); - -- unfreeze_partials(s, c); -+ unfreeze_partials(s, c, delayed_free); - } - - static void flush_cpu_slab(void *d) - { - struct kmem_cache *s = d; -+ LIST_HEAD(delayed_free); - -- __flush_cpu_slab(s, smp_processor_id()); -+ __flush_cpu_slab(s, smp_processor_id(), &delayed_free); -+ discard_delayed(&delayed_free); - } - - static bool has_cpu_slab(int cpu, void *info) -@@ -2489,13 +2517,15 @@ static int slub_cpu_dead(unsigned int cpu) - { - struct kmem_cache *s; - unsigned long flags; -+ LIST_HEAD(delayed_free); - - mutex_lock(&slab_mutex); - list_for_each_entry(s, &slab_caches, list) { - local_irq_save(flags); -- __flush_cpu_slab(s, cpu); -+ __flush_cpu_slab(s, cpu, &delayed_free); - local_irq_restore(flags); - } -+ discard_delayed(&delayed_free); - mutex_unlock(&slab_mutex); - return 0; - } -@@ -2579,7 +2609,8 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid) - } - - static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, -- int node, struct kmem_cache_cpu **pc) -+ int node, struct kmem_cache_cpu **pc, -+ struct list_head *delayed_free) - { - void *freelist; - struct kmem_cache_cpu *c = *pc; -@@ -2587,7 +2618,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, - - WARN_ON_ONCE(s->ctor && (flags & __GFP_ZERO)); - -- freelist = get_partial(s, flags, node, c); -+ freelist = get_partial(s, flags, node, c, delayed_free); - - if (freelist) - return freelist; -@@ -2596,7 +2627,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags, - if (page) { - c = raw_cpu_ptr(s->cpu_slab); - if (c->page) -- flush_slab(s, c); -+ flush_slab(s, c, delayed_free); - - /* - * No other reference to the page yet so we can -@@ -2675,7 +2706,8 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page) - * already disabled (which is the case for bulk allocation). - */ - static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, -- unsigned long addr, struct kmem_cache_cpu *c) -+ unsigned long addr, struct kmem_cache_cpu *c, -+ struct list_head *delayed_free) - { - void *freelist; - struct page *page; -@@ -2705,7 +2737,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - goto redo; - } else { - stat(s, ALLOC_NODE_MISMATCH); -- deactivate_slab(s, page, c->freelist, c); -+ deactivate_slab(s, page, c->freelist, c, delayed_free); - goto new_slab; - } - } -@@ -2716,7 +2748,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - * information when the page leaves the per-cpu allocator - */ - if (unlikely(!pfmemalloc_match(page, gfpflags))) { -- deactivate_slab(s, page, c->freelist, c); -+ deactivate_slab(s, page, c->freelist, c, delayed_free); - goto new_slab; - } - -@@ -2755,7 +2787,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - goto redo; - } - -- freelist = new_slab_objects(s, gfpflags, node, &c); -+ freelist = new_slab_objects(s, gfpflags, node, &c, delayed_free); - - if (unlikely(!freelist)) { - slab_out_of_memory(s, gfpflags, node); -@@ -2771,7 +2803,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - !alloc_debug_processing(s, page, freelist, addr)) - goto new_slab; /* Slab failed checks. Next slab needed */ - -- deactivate_slab(s, page, get_freepointer(s, freelist), c); -+ deactivate_slab(s, page, get_freepointer(s, freelist), c, delayed_free); - return freelist; - } - -@@ -2784,6 +2816,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - { - void *p; - unsigned long flags; -+ LIST_HEAD(delayed_free); - - local_irq_save(flags); - #ifdef CONFIG_PREEMPTION -@@ -2795,8 +2828,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, - c = this_cpu_ptr(s->cpu_slab); - #endif - -- p = ___slab_alloc(s, gfpflags, node, addr, c); -+ p = ___slab_alloc(s, gfpflags, node, addr, c, &delayed_free); - local_irq_restore(flags); -+ discard_delayed(&delayed_free); - return p; - } - -@@ -3060,11 +3094,13 @@ static void __slab_free(struct kmem_cache *s, struct page *page, - */ - stat(s, FREE_FROZEN); - } else if (new.frozen) { -+ LIST_HEAD(delayed_free); - /* - * If we just froze the page then put it onto the - * per cpu partial list. - */ -- put_cpu_partial(s, page, 1); -+ put_cpu_partial(s, page, 1, &delayed_free); -+ discard_delayed(&delayed_free); - stat(s, CPU_PARTIAL_FREE); - } - -@@ -3315,6 +3351,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, - struct kmem_cache_cpu *c; - int i; - struct obj_cgroup *objcg = NULL; -+ LIST_HEAD(delayed_free); - - if (IS_ENABLED(CONFIG_PREEMPT_RT) && IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP)) - WARN_ON_ONCE(!preemptible() && -@@ -3356,7 +3393,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, - * of re-populating per CPU c->freelist - */ - p[i] = ___slab_alloc(s, flags, NUMA_NO_NODE, -- _RET_IP_, c); -+ _RET_IP_, c, &delayed_free); - if (unlikely(!p[i])) - goto error; - -@@ -3372,6 +3409,8 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, - c->tid = next_tid(c->tid); - local_irq_enable(); - -+ discard_delayed(&delayed_free); -+ - /* Clear memory outside IRQ disabled fastpath loop */ - if (unlikely(slab_want_init_on_alloc(flags, s))) { - int j; -@@ -3385,6 +3424,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, - return i; - error: - local_irq_enable(); -+ discard_delayed(&delayed_free); - slab_post_alloc_hook(s, objcg, flags, i, p); - __kmem_cache_free_bulk(s, i, p); - return 0; -@@ -4437,6 +4477,7 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache) - int node; - struct kmem_cache *s = kmem_cache_zalloc(kmem_cache, GFP_NOWAIT); - struct kmem_cache_node *n; -+ LIST_HEAD(delayed_free); - - memcpy(s, static_cache, kmem_cache->object_size); - -@@ -4445,7 +4486,8 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache) - * up. Even if it weren't true, IRQs are not up so we couldn't fire - * IPIs around. - */ -- __flush_cpu_slab(s, smp_processor_id()); -+ __flush_cpu_slab(s, smp_processor_id(), &delayed_free); -+ discard_delayed(&delayed_free); - for_each_kmem_cache_node(s, node, n) { - struct page *p; - --- -2.19.1 - diff --git a/features/rt/mm-slub-Move-flush_cpu_slab-invocations-__free_slab-.patch b/features/rt/mm-slub-Move-flush_cpu_slab-invocations-__free_slab-.patch deleted file mode 100644 index 119f020a..00000000 --- a/features/rt/mm-slub-Move-flush_cpu_slab-invocations-__free_slab-.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 3bd87df897f0a51299da79bf24091cc937f1706e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 26 Feb 2021 17:11:55 +0100 -Subject: [PATCH 108/191] mm: slub: Move flush_cpu_slab() invocations - __free_slab() invocations out of IRQ context - -flush_all() flushes a specific SLAB cache on each CPU (where the cache -is present). The discard_delayed()/__free_slab() invocation happens -within IPI handler and is problematic for PREEMPT_RT. - -The flush operation is not a frequent operation or a hot path. The -per-CPU flush operation can be moved to within a workqueue. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/slub.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++-------- - 1 file changed, 52 insertions(+), 8 deletions(-) - -diff --git a/mm/slub.c b/mm/slub.c -index af9c0fbe2cf5..ec608c1d5fdb 100644 ---- a/mm/slub.c -+++ b/mm/slub.c -@@ -2487,26 +2487,70 @@ static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu, - unfreeze_partials(s, c, delayed_free); - } - --static void flush_cpu_slab(void *d) -+struct slub_flush_work { -+ struct work_struct work; -+ struct kmem_cache *s; -+ bool skip; -+}; -+ -+static void flush_cpu_slab(struct work_struct *w) - { -- struct kmem_cache *s = d; -+ struct slub_flush_work *sfw; - LIST_HEAD(delayed_free); - -- __flush_cpu_slab(s, smp_processor_id(), &delayed_free); -+ sfw = container_of(w, struct slub_flush_work, work); -+ -+ local_irq_disable(); -+ __flush_cpu_slab(sfw->s, smp_processor_id(), &delayed_free); -+ local_irq_enable(); -+ - discard_delayed(&delayed_free); - } - --static bool has_cpu_slab(int cpu, void *info) -+static bool has_cpu_slab(int cpu, struct kmem_cache *s) - { -- struct kmem_cache *s = info; - struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); - - return c->page || slub_percpu_partial(c); - } - -+static DEFINE_MUTEX(flush_lock); -+static DEFINE_PER_CPU(struct slub_flush_work, slub_flush); -+ -+static void flush_all_locked(struct kmem_cache *s) -+{ -+ struct slub_flush_work *sfw; -+ unsigned int cpu; -+ -+ mutex_lock(&flush_lock); -+ -+ for_each_online_cpu(cpu) { -+ sfw = &per_cpu(slub_flush, cpu); -+ if (!has_cpu_slab(cpu, s)) { -+ sfw->skip = true; -+ continue; -+ } -+ INIT_WORK(&sfw->work, flush_cpu_slab); -+ sfw->skip = false; -+ sfw->s = s; -+ schedule_work_on(cpu, &sfw->work); -+ } -+ -+ for_each_online_cpu(cpu) { -+ sfw = &per_cpu(slub_flush, cpu); -+ if (sfw->skip) -+ continue; -+ flush_work(&sfw->work); -+ } -+ -+ mutex_unlock(&flush_lock); -+} -+ - static void flush_all(struct kmem_cache *s) - { -- on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1); -+ cpus_read_lock(); -+ flush_all_locked(s); -+ cpus_read_unlock(); - } - - /* -@@ -4009,7 +4053,7 @@ int __kmem_cache_shutdown(struct kmem_cache *s) - int node; - struct kmem_cache_node *n; - -- flush_all(s); -+ flush_all_locked(s); - /* Attempt to free all objects */ - for_each_kmem_cache_node(s, node, n) { - free_partial(s, n); -@@ -4293,7 +4337,7 @@ int __kmem_cache_shrink(struct kmem_cache *s) - unsigned long flags; - int ret = 0; - -- flush_all(s); -+ flush_all_locked(s); - for_each_kmem_cache_node(s, node, n) { - INIT_LIST_HEAD(&discard); - for (i = 0; i < SHRINK_PROMOTE_MAX; i++) --- -2.19.1 - diff --git a/features/rt/mm-vmalloc-Another-preempt-disable-region-which-suck.patch b/features/rt/mm-vmalloc-Another-preempt-disable-region-which-suck.patch deleted file mode 100644 index 18978e06..00000000 --- a/features/rt/mm-vmalloc-Another-preempt-disable-region-which-suck.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 9834be9d8d752c94f6c88a3a380898da34cf003b Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 12 Jul 2011 11:39:36 +0200 -Subject: [PATCH 133/191] mm/vmalloc: Another preempt disable region which - sucks - -Avoid the preempt disable version of get_cpu_var(). The inner-lock should -provide enough serialisation. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - mm/vmalloc.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/mm/vmalloc.c b/mm/vmalloc.c -index 4f5f8c907897..e6cd482a11b9 100644 ---- a/mm/vmalloc.c -+++ b/mm/vmalloc.c -@@ -1558,7 +1558,7 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) - struct vmap_block *vb; - struct vmap_area *va; - unsigned long vb_idx; -- int node, err; -+ int node, err, cpu; - void *vaddr; - - node = numa_node_id(); -@@ -1595,11 +1595,12 @@ static void *new_vmap_block(unsigned int order, gfp_t gfp_mask) - return ERR_PTR(err); - } - -- vbq = &get_cpu_var(vmap_block_queue); -+ cpu = get_cpu_light(); -+ vbq = this_cpu_ptr(&vmap_block_queue); - spin_lock(&vbq->lock); - list_add_tail_rcu(&vb->free_list, &vbq->free); - spin_unlock(&vbq->lock); -- put_cpu_var(vmap_block_queue); -+ put_cpu_light(); - - return vaddr; - } -@@ -1664,6 +1665,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) - struct vmap_block *vb; - void *vaddr = NULL; - unsigned int order; -+ int cpu; - - BUG_ON(offset_in_page(size)); - BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); -@@ -1678,7 +1680,8 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) - order = get_order(size); - - rcu_read_lock(); -- vbq = &get_cpu_var(vmap_block_queue); -+ cpu = get_cpu_light(); -+ vbq = this_cpu_ptr(&vmap_block_queue); - list_for_each_entry_rcu(vb, &vbq->free, free_list) { - unsigned long pages_off; - -@@ -1701,7 +1704,7 @@ static void *vb_alloc(unsigned long size, gfp_t gfp_mask) - break; - } - -- put_cpu_var(vmap_block_queue); -+ put_cpu_light(); - rcu_read_unlock(); - - /* Allocate new block if nothing was found */ --- -2.19.1 - diff --git a/features/rt/mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch b/features/rt/mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch deleted file mode 100644 index cdffd95d..00000000 --- a/features/rt/mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 3032c5b7a5a91389d663bd54367df7ed1a92a7a6 Mon Sep 17 00:00:00 2001 -From: Ingo Molnar <mingo@elte.hu> -Date: Fri, 3 Jul 2009 08:30:13 -0500 -Subject: [PATCH 085/191] mm/vmstat: Protect per cpu variables with preempt - disable on RT - -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 -same ressources is not updated in parallel due to preemption. - -Signed-off-by: Ingo Molnar <mingo@elte.hu> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/vmstat.h | 4 ++++ - mm/vmstat.c | 12 ++++++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h -index 506d625163a1..09a7e4c714b8 100644 ---- a/include/linux/vmstat.h -+++ b/include/linux/vmstat.h -@@ -63,7 +63,9 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states); - */ - static inline void __count_vm_event(enum vm_event_item item) - { -+ preempt_disable_rt(); - raw_cpu_inc(vm_event_states.event[item]); -+ preempt_enable_rt(); - } - - static inline void count_vm_event(enum vm_event_item item) -@@ -73,7 +75,9 @@ static inline void count_vm_event(enum vm_event_item item) - - static inline void __count_vm_events(enum vm_event_item item, long delta) - { -+ preempt_disable_rt(); - raw_cpu_add(vm_event_states.event[item], delta); -+ preempt_enable_rt(); - } - - static inline void count_vm_events(enum vm_event_item item, long delta) -diff --git a/mm/vmstat.c b/mm/vmstat.c -index 74b2c374b86c..4ef7b8a8f5ce 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -321,6 +321,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, - long x; - long t; - -+ preempt_disable_rt(); - x = delta + __this_cpu_read(*p); - - t = __this_cpu_read(pcp->stat_threshold); -@@ -330,6 +331,7 @@ void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item, - x = 0; - } - __this_cpu_write(*p, x); -+ preempt_enable_rt(); - } - EXPORT_SYMBOL(__mod_zone_page_state); - -@@ -352,6 +354,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, - delta >>= PAGE_SHIFT; - } - -+ preempt_disable_rt(); - x = delta + __this_cpu_read(*p); - - t = __this_cpu_read(pcp->stat_threshold); -@@ -361,6 +364,7 @@ void __mod_node_page_state(struct pglist_data *pgdat, enum node_stat_item item, - x = 0; - } - __this_cpu_write(*p, x); -+ preempt_enable_rt(); - } - EXPORT_SYMBOL(__mod_node_page_state); - -@@ -393,6 +397,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) - s8 __percpu *p = pcp->vm_stat_diff + item; - s8 v, t; - -+ preempt_disable_rt(); - v = __this_cpu_inc_return(*p); - t = __this_cpu_read(pcp->stat_threshold); - if (unlikely(v > t)) { -@@ -401,6 +406,7 @@ void __inc_zone_state(struct zone *zone, enum zone_stat_item item) - zone_page_state_add(v + overstep, zone, item); - __this_cpu_write(*p, -overstep); - } -+ preempt_enable_rt(); - } - - void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -411,6 +417,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) - - VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); - -+ preempt_disable_rt(); - v = __this_cpu_inc_return(*p); - t = __this_cpu_read(pcp->stat_threshold); - if (unlikely(v > t)) { -@@ -419,6 +426,7 @@ void __inc_node_state(struct pglist_data *pgdat, enum node_stat_item item) - node_page_state_add(v + overstep, pgdat, item); - __this_cpu_write(*p, -overstep); - } -+ preempt_enable_rt(); - } - - void __inc_zone_page_state(struct page *page, enum zone_stat_item item) -@@ -439,6 +447,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) - s8 __percpu *p = pcp->vm_stat_diff + item; - s8 v, t; - -+ preempt_disable_rt(); - v = __this_cpu_dec_return(*p); - t = __this_cpu_read(pcp->stat_threshold); - if (unlikely(v < - t)) { -@@ -447,6 +456,7 @@ void __dec_zone_state(struct zone *zone, enum zone_stat_item item) - zone_page_state_add(v - overstep, zone, item); - __this_cpu_write(*p, overstep); - } -+ preempt_enable_rt(); - } - - void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) -@@ -457,6 +467,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) - - VM_WARN_ON_ONCE(vmstat_item_in_bytes(item)); - -+ preempt_disable_rt(); - v = __this_cpu_dec_return(*p); - t = __this_cpu_read(pcp->stat_threshold); - if (unlikely(v < - t)) { -@@ -465,6 +476,7 @@ void __dec_node_state(struct pglist_data *pgdat, enum node_stat_item item) - node_page_state_add(v - overstep, pgdat, item); - __this_cpu_write(*p, overstep); - } -+ preempt_enable_rt(); - } - - void __dec_zone_page_state(struct page *page, enum zone_stat_item item) --- -2.19.1 - diff --git a/features/rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch b/features/rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch deleted file mode 100644 index d2cd6abd..00000000 --- a/features/rt/mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f8847b3d3ebc1ea59be319e5833c585bacd2d5f2 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 11 Feb 2019 10:40:46 +0100 -Subject: [PATCH 036/191] mm: workingset: replace IRQ-off check with a lockdep - assert. - -Commit - - 68d48e6a2df57 ("mm: workingset: add vmstat counter for shadow nodes") - -introduced an IRQ-off check to ensure that a lock is held which also -disabled interrupts. This does not work the same way on -RT because none -of the locks, that are held, disable interrupts. -Replace this check with a lockdep assert which ensures that the lock is -held. - -Cc: Peter Zijlstra <peterz@infradead.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/workingset.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/mm/workingset.c b/mm/workingset.c -index cd39902c1062..3d34c1309f54 100644 ---- a/mm/workingset.c -+++ b/mm/workingset.c -@@ -430,6 +430,8 @@ static struct list_lru shadow_nodes; - - void workingset_update_node(struct xa_node *node) - { -+ struct address_space *mapping; -+ - /* - * Track non-empty nodes that contain only shadow entries; - * unlink those that contain pages or are being freed. -@@ -438,7 +440,8 @@ void workingset_update_node(struct xa_node *node) - * already where they should be. The list_empty() test is safe - * as node->private_list is protected by the i_pages lock. - */ -- VM_WARN_ON_ONCE(!irqs_disabled()); /* For __inc_lruvec_page_state */ -+ mapping = container_of(node->array, struct address_space, i_pages); -+ lockdep_assert_held(&mapping->i_pages.xa_lock); - - if (node->count && node->count == node->nr_values) { - if (list_empty(&node->private_list)) { --- -2.19.1 - diff --git a/features/rt/mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch b/features/rt/mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch deleted file mode 100644 index 20da73a1..00000000 --- a/features/rt/mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 58041154aa39fc127b4c5d0f6179c606403ced5d Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <umgwanakikbuti@gmail.com> -Date: Tue, 22 Mar 2016 11:16:09 +0100 -Subject: [PATCH 116/191] mm/zsmalloc: copy with get_cpu_var() and locking - -get_cpu_var() disables preemption and triggers a might_sleep() splat later. -This is replaced with get_locked_var(). -This bitspinlocks are replaced with a proper mutex which requires a slightly -larger struct to allocate. - -Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> -[bigeasy: replace the bitspin_lock() with a mutex, get_locked_var(). Mike then -fixed the size magic] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - mm/zsmalloc.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 79 insertions(+), 6 deletions(-) - -diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c -index 30c358b72025..6177b736d018 100644 ---- a/mm/zsmalloc.c -+++ b/mm/zsmalloc.c -@@ -57,6 +57,7 @@ - #include <linux/wait.h> - #include <linux/pagemap.h> - #include <linux/fs.h> -+#include <linux/local_lock.h> - - #define ZSPAGE_MAGIC 0x58 - -@@ -77,6 +78,20 @@ - - #define ZS_HANDLE_SIZE (sizeof(unsigned long)) - -+#ifdef CONFIG_PREEMPT_RT -+ -+struct zsmalloc_handle { -+ unsigned long addr; -+ struct mutex lock; -+}; -+ -+#define ZS_HANDLE_ALLOC_SIZE (sizeof(struct zsmalloc_handle)) -+ -+#else -+ -+#define ZS_HANDLE_ALLOC_SIZE (sizeof(unsigned long)) -+#endif -+ - /* - * Object location (<PFN>, <obj_idx>) is encoded as - * a single (unsigned long) handle value. -@@ -293,6 +308,7 @@ struct zspage { - }; - - struct mapping_area { -+ local_lock_t lock; - char *vm_buf; /* copy buffer for objects that span pages */ - char *vm_addr; /* address of kmap_atomic()'ed pages */ - enum zs_mapmode vm_mm; /* mapping mode */ -@@ -322,7 +338,7 @@ static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage) {} - - static int create_cache(struct zs_pool *pool) - { -- pool->handle_cachep = kmem_cache_create("zs_handle", ZS_HANDLE_SIZE, -+ pool->handle_cachep = kmem_cache_create("zs_handle", ZS_HANDLE_ALLOC_SIZE, - 0, 0, NULL); - if (!pool->handle_cachep) - return 1; -@@ -346,9 +362,26 @@ static void destroy_cache(struct zs_pool *pool) - - static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp) - { -- return (unsigned long)kmem_cache_alloc(pool->handle_cachep, -- gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE)); -+ void *p; -+ -+ p = kmem_cache_alloc(pool->handle_cachep, -+ gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE)); -+#ifdef CONFIG_PREEMPT_RT -+ if (p) { -+ struct zsmalloc_handle *zh = p; -+ -+ mutex_init(&zh->lock); -+ } -+#endif -+ return (unsigned long)p; -+} -+ -+#ifdef CONFIG_PREEMPT_RT -+static struct zsmalloc_handle *zs_get_pure_handle(unsigned long handle) -+{ -+ return (void *)(handle &~((1 << OBJ_TAG_BITS) - 1)); - } -+#endif - - static void cache_free_handle(struct zs_pool *pool, unsigned long handle) - { -@@ -368,12 +401,18 @@ static void cache_free_zspage(struct zs_pool *pool, struct zspage *zspage) - - static void record_obj(unsigned long handle, unsigned long obj) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ WRITE_ONCE(zh->addr, obj); -+#else - /* - * lsb of @obj represents handle lock while other bits - * represent object value the handle is pointing so - * updating shouldn't do store tearing. - */ - WRITE_ONCE(*(unsigned long *)handle, obj); -+#endif - } - - /* zpool driver */ -@@ -455,7 +494,10 @@ MODULE_ALIAS("zpool-zsmalloc"); - #endif /* CONFIG_ZPOOL */ - - /* per-cpu VM mapping areas for zspage accesses that cross page boundaries */ --static DEFINE_PER_CPU(struct mapping_area, zs_map_area); -+static DEFINE_PER_CPU(struct mapping_area, zs_map_area) = { -+ /* XXX remove this and use a spin_lock_t in pin_tag() */ -+ .lock = INIT_LOCAL_LOCK(lock), -+}; - - static bool is_zspage_isolated(struct zspage *zspage) - { -@@ -862,7 +904,13 @@ static unsigned long location_to_obj(struct page *page, unsigned int obj_idx) - - static unsigned long handle_to_obj(unsigned long handle) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ return zh->addr; -+#else - return *(unsigned long *)handle; -+#endif - } - - static unsigned long obj_to_head(struct page *page, void *obj) -@@ -876,22 +924,46 @@ static unsigned long obj_to_head(struct page *page, void *obj) - - static inline int testpin_tag(unsigned long handle) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ return mutex_is_locked(&zh->lock); -+#else - return bit_spin_is_locked(HANDLE_PIN_BIT, (unsigned long *)handle); -+#endif - } - - static inline int trypin_tag(unsigned long handle) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ return mutex_trylock(&zh->lock); -+#else - return bit_spin_trylock(HANDLE_PIN_BIT, (unsigned long *)handle); -+#endif - } - - static void pin_tag(unsigned long handle) __acquires(bitlock) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ return mutex_lock(&zh->lock); -+#else - bit_spin_lock(HANDLE_PIN_BIT, (unsigned long *)handle); -+#endif - } - - static void unpin_tag(unsigned long handle) __releases(bitlock) - { -+#ifdef CONFIG_PREEMPT_RT -+ struct zsmalloc_handle *zh = zs_get_pure_handle(handle); -+ -+ return mutex_unlock(&zh->lock); -+#else - bit_spin_unlock(HANDLE_PIN_BIT, (unsigned long *)handle); -+#endif - } - - static void reset_page(struct page *page) -@@ -1274,7 +1346,8 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, - class = pool->size_class[class_idx]; - off = (class->size * obj_idx) & ~PAGE_MASK; - -- area = &get_cpu_var(zs_map_area); -+ local_lock(&zs_map_area.lock); -+ area = this_cpu_ptr(&zs_map_area); - area->vm_mm = mm; - if (off + class->size <= PAGE_SIZE) { - /* this object is contained entirely within a page */ -@@ -1328,7 +1401,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle) - - __zs_unmap_object(area, pages, off, class->size); - } -- put_cpu_var(zs_map_area); -+ local_unlock(&zs_map_area.lock); - - migrate_read_unlock(zspage); - unpin_tag(handle); --- -2.19.1 - diff --git a/features/rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch b/features/rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch deleted file mode 100644 index 81ff8d7a..00000000 --- a/features/rt/net-Dequeue-in-dev_cpu_dead-without-the-lock.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 792214a4ddc6c2bca52779e1665f52c5587868f9 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 16 Sep 2020 16:15:39 +0200 -Subject: [PATCH 142/191] net: Dequeue in dev_cpu_dead() without the lock - -Upstream uses skb_dequeue() to acquire lock of `input_pkt_queue'. The reason is -to synchronize against a remote CPU which still thinks that the CPU is online -enqueues packets to this CPU. -There are no guarantees that the packet is enqueued before the callback is run, -it just hope. -RT however complains about an not initialized lock because it uses another lock -for `input_pkt_queue' due to the IRQ-off nature of the context. - -Use the unlocked dequeue version for `input_pkt_queue'. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/core/dev.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 16c9aa19ede2..aab963be5655 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -11162,7 +11162,7 @@ static int dev_cpu_dead(unsigned int oldcpu) - netif_rx_ni(skb); - input_queue_head_incr(oldsd); - } -- while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) { -+ while ((skb = __skb_dequeue(&oldsd->input_pkt_queue))) { - netif_rx_ni(skb); - input_queue_head_incr(oldsd); - } --- -2.19.1 - diff --git a/features/rt/net-Move-lockdep-where-it-belongs.patch b/features/rt/net-Move-lockdep-where-it-belongs.patch deleted file mode 100644 index d6d1ff0d..00000000 --- a/features/rt/net-Move-lockdep-where-it-belongs.patch +++ /dev/null @@ -1,46 +0,0 @@ -From abf7b145f704064b5de40759c313fe711a89234f Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 8 Sep 2020 07:32:20 +0200 -Subject: [PATCH 038/191] net: Move lockdep where it belongs - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - net/core/sock.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/net/core/sock.c b/net/core/sock.c -index 0ed98f20448a..f1d1cee0dddd 100644 ---- a/net/core/sock.c -+++ b/net/core/sock.c -@@ -3064,12 +3064,11 @@ void lock_sock_nested(struct sock *sk, int subclass) - if (sk->sk_lock.owned) - __lock_sock(sk); - sk->sk_lock.owned = 1; -- spin_unlock(&sk->sk_lock.slock); -+ spin_unlock_bh(&sk->sk_lock.slock); - /* - * The sk_lock has mutex_lock() semantics here: - */ - mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_); -- local_bh_enable(); - } - EXPORT_SYMBOL(lock_sock_nested); - -@@ -3118,13 +3117,12 @@ bool lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock) - - __lock_sock(sk); - sk->sk_lock.owned = 1; -- spin_unlock(&sk->sk_lock.slock); -+ spin_unlock_bh(&sk->sk_lock.slock); - /* - * The sk_lock has mutex_lock() semantics here: - */ - mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_); - __acquire(&sk->sk_lock.slock); -- local_bh_enable(); - return true; - } - EXPORT_SYMBOL(lock_sock_fast); --- -2.19.1 - diff --git a/features/rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch b/features/rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch deleted file mode 100644 index 59f37318..00000000 --- a/features/rt/net-Properly-annotate-the-try-lock-for-the-seqlock.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 363d9082c806cbde11d4468cfaaac47e4b529c82 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 8 Sep 2020 16:57:11 +0200 -Subject: [PATCH 092/191] net: Properly annotate the try-lock for the seqlock - -In patch - ("net/Qdisc: use a seqlock instead seqcount") - -the seqcount has been replaced with a seqlock to allow to reader to -boost the preempted writer. -The try_write_seqlock() acquired the lock with a try-lock but the -seqcount annotation was "lock". - -Opencode write_seqcount_t_begin() and use the try-lock annotation for -lockdep. - -Reported-by: Mike Galbraith <efault@gmx.de> -Cc: stable-rt@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/net/net_seq_lock.h | 9 --------- - include/net/sch_generic.h | 10 +++++++++- - 2 files changed, 9 insertions(+), 10 deletions(-) - -diff --git a/include/net/net_seq_lock.h b/include/net/net_seq_lock.h -index 95a497a72e51..67710bace741 100644 ---- a/include/net/net_seq_lock.h -+++ b/include/net/net_seq_lock.h -@@ -6,15 +6,6 @@ - # define net_seq_begin(__r) read_seqbegin(__r) - # define net_seq_retry(__r, __s) read_seqretry(__r, __s) - --static inline int try_write_seqlock(seqlock_t *sl) --{ -- if (spin_trylock(&sl->lock)) { -- write_seqcount_begin(&sl->seqcount); -- return 1; -- } -- return 0; --} -- - #else - # define net_seqlock_t seqcount_t - # define net_seq_begin(__r) read_seqcount_begin(__r) -diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index 1650446d3bfa..bf0865d642f5 100644 ---- a/include/net/sch_generic.h -+++ b/include/net/sch_generic.h -@@ -171,8 +171,16 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) - return false; - } - #ifdef CONFIG_PREEMPT_RT -- if (try_write_seqlock(&qdisc->running)) -+ if (spin_trylock(&qdisc->running.lock)) { -+ seqcount_t *s = &qdisc->running.seqcount.seqcount; -+ /* -+ * Variant of write_seqcount_t_begin() telling lockdep that a -+ * trylock was attempted. -+ */ -+ do_raw_write_seqcount_begin(s); -+ seqcount_acquire(&s->dep_map, 0, 1, _RET_IP_); - return true; -+ } - return false; - #else - /* Variant of write_seqcount_begin() telling lockdep a trylock --- -2.19.1 - diff --git a/features/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch b/features/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch deleted file mode 100644 index 7ef9f7ad..00000000 --- a/features/rt/net-Qdisc-use-a-seqlock-instead-seqcount.patch +++ /dev/null @@ -1,298 +0,0 @@ -From 0532faba565e7c8cf62950d7f1a9a7bc7ab9840b Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 14 Sep 2016 17:36:35 +0200 -Subject: [PATCH 091/191] net/Qdisc: use a seqlock instead seqcount - -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 -scheduled out. The seqlock on the other hand will serialize / sleep on -the lock while writer is active. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/net/gen_stats.h | 11 ++++++----- - include/net/net_seq_lock.h | 24 ++++++++++++++++++++++++ - include/net/sch_generic.h | 19 +++++++++++++++++-- - net/core/gen_estimator.c | 6 +++--- - net/core/gen_stats.c | 12 ++++++------ - net/sched/sch_api.c | 2 +- - net/sched/sch_generic.c | 10 ++++++++++ - 7 files changed, 67 insertions(+), 17 deletions(-) - create mode 100644 include/net/net_seq_lock.h - -diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h -index 1424e02cef90..163f8415e5db 100644 ---- a/include/net/gen_stats.h -+++ b/include/net/gen_stats.h -@@ -6,6 +6,7 @@ - #include <linux/socket.h> - #include <linux/rtnetlink.h> - #include <linux/pkt_sched.h> -+#include <net/net_seq_lock.h> - - /* Note: this used to be in include/uapi/linux/gen_stats.h */ - struct gnet_stats_basic_packed { -@@ -42,15 +43,15 @@ int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, - spinlock_t *lock, struct gnet_dump *d, - int padattr); - --int gnet_stats_copy_basic(const seqcount_t *running, -+int gnet_stats_copy_basic(net_seqlock_t *running, - struct gnet_dump *d, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b); --void __gnet_stats_copy_basic(const seqcount_t *running, -+void __gnet_stats_copy_basic(net_seqlock_t *running, - struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b); --int gnet_stats_copy_basic_hw(const seqcount_t *running, -+int gnet_stats_copy_basic_hw(net_seqlock_t *running, - struct gnet_dump *d, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b); -@@ -70,13 +71,13 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu_bstats, - struct net_rate_estimator __rcu **rate_est, - spinlock_t *lock, -- seqcount_t *running, struct nlattr *opt); -+ net_seqlock_t *running, struct nlattr *opt); - void gen_kill_estimator(struct net_rate_estimator __rcu **ptr); - int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu_bstats, - struct net_rate_estimator __rcu **ptr, - spinlock_t *lock, -- seqcount_t *running, struct nlattr *opt); -+ net_seqlock_t *running, struct nlattr *opt); - bool gen_estimator_active(struct net_rate_estimator __rcu **ptr); - bool gen_estimator_read(struct net_rate_estimator __rcu **ptr, - struct gnet_stats_rate_est64 *sample); -diff --git a/include/net/net_seq_lock.h b/include/net/net_seq_lock.h -new file mode 100644 -index 000000000000..95a497a72e51 ---- /dev/null -+++ b/include/net/net_seq_lock.h -@@ -0,0 +1,24 @@ -+#ifndef __NET_NET_SEQ_LOCK_H__ -+#define __NET_NET_SEQ_LOCK_H__ -+ -+#ifdef CONFIG_PREEMPT_RT -+# define net_seqlock_t seqlock_t -+# define net_seq_begin(__r) read_seqbegin(__r) -+# define net_seq_retry(__r, __s) read_seqretry(__r, __s) -+ -+static inline int try_write_seqlock(seqlock_t *sl) -+{ -+ if (spin_trylock(&sl->lock)) { -+ write_seqcount_begin(&sl->seqcount); -+ return 1; -+ } -+ return 0; -+} -+ -+#else -+# define net_seqlock_t seqcount_t -+# define net_seq_begin(__r) read_seqcount_begin(__r) -+# define net_seq_retry(__r, __s) read_seqcount_retry(__r, __s) -+#endif -+ -+#endif -diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h -index 2d6eb60c58c8..1650446d3bfa 100644 ---- a/include/net/sch_generic.h -+++ b/include/net/sch_generic.h -@@ -10,6 +10,7 @@ - #include <linux/percpu.h> - #include <linux/dynamic_queue_limits.h> - #include <linux/list.h> -+#include <net/net_seq_lock.h> - #include <linux/refcount.h> - #include <linux/workqueue.h> - #include <linux/mutex.h> -@@ -100,7 +101,7 @@ struct Qdisc { - struct sk_buff_head gso_skb ____cacheline_aligned_in_smp; - struct qdisc_skb_head q; - struct gnet_stats_basic_packed bstats; -- seqcount_t running; -+ net_seqlock_t running; - struct gnet_stats_queue qstats; - unsigned long state; - struct Qdisc *next_sched; -@@ -141,7 +142,11 @@ static inline bool qdisc_is_running(struct Qdisc *qdisc) - { - if (qdisc->flags & TCQ_F_NOLOCK) - return spin_is_locked(&qdisc->seqlock); -+#ifdef CONFIG_PREEMPT_RT -+ return spin_is_locked(&qdisc->running.lock) ? true : false; -+#else - return (raw_read_seqcount(&qdisc->running) & 1) ? true : false; -+#endif - } - - static inline bool qdisc_is_percpu_stats(const struct Qdisc *q) -@@ -165,17 +170,27 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc) - } else if (qdisc_is_running(qdisc)) { - return false; - } -+#ifdef CONFIG_PREEMPT_RT -+ if (try_write_seqlock(&qdisc->running)) -+ return true; -+ return false; -+#else - /* Variant of write_seqcount_begin() telling lockdep a trylock - * was attempted. - */ - raw_write_seqcount_begin(&qdisc->running); - seqcount_acquire(&qdisc->running.dep_map, 0, 1, _RET_IP_); - return true; -+#endif - } - - static inline void qdisc_run_end(struct Qdisc *qdisc) - { -+#ifdef CONFIG_PREEMPT_RT -+ write_sequnlock(&qdisc->running); -+#else - write_seqcount_end(&qdisc->running); -+#endif - if (qdisc->flags & TCQ_F_NOLOCK) - spin_unlock(&qdisc->seqlock); - } -@@ -540,7 +555,7 @@ static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) - return qdisc_lock(root); - } - --static inline seqcount_t *qdisc_root_sleeping_running(const struct Qdisc *qdisc) -+static inline net_seqlock_t *qdisc_root_sleeping_running(const struct Qdisc *qdisc) - { - struct Qdisc *root = qdisc_root_sleeping(qdisc); - -diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c -index 8e582e29a41e..e51f4854d8b2 100644 ---- a/net/core/gen_estimator.c -+++ b/net/core/gen_estimator.c -@@ -42,7 +42,7 @@ - struct net_rate_estimator { - struct gnet_stats_basic_packed *bstats; - spinlock_t *stats_lock; -- seqcount_t *running; -+ net_seqlock_t *running; - struct gnet_stats_basic_cpu __percpu *cpu_bstats; - u8 ewma_log; - u8 intvl_log; /* period : (250ms << intvl_log) */ -@@ -125,7 +125,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu_bstats, - struct net_rate_estimator __rcu **rate_est, - spinlock_t *lock, -- seqcount_t *running, -+ net_seqlock_t *running, - struct nlattr *opt) - { - struct gnet_estimator *parm = nla_data(opt); -@@ -226,7 +226,7 @@ int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu_bstats, - struct net_rate_estimator __rcu **rate_est, - spinlock_t *lock, -- seqcount_t *running, struct nlattr *opt) -+ net_seqlock_t *running, struct nlattr *opt) - { - return gen_new_estimator(bstats, cpu_bstats, rate_est, - lock, running, opt); -diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c -index e491b083b348..ef432cea2e10 100644 ---- a/net/core/gen_stats.c -+++ b/net/core/gen_stats.c -@@ -137,7 +137,7 @@ __gnet_stats_copy_basic_cpu(struct gnet_stats_basic_packed *bstats, - } - - void --__gnet_stats_copy_basic(const seqcount_t *running, -+__gnet_stats_copy_basic(net_seqlock_t *running, - struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b) -@@ -150,15 +150,15 @@ __gnet_stats_copy_basic(const seqcount_t *running, - } - do { - if (running) -- seq = read_seqcount_begin(running); -+ seq = net_seq_begin(running); - bstats->bytes = b->bytes; - bstats->packets = b->packets; -- } while (running && read_seqcount_retry(running, seq)); -+ } while (running && net_seq_retry(running, seq)); - } - EXPORT_SYMBOL(__gnet_stats_copy_basic); - - static int --___gnet_stats_copy_basic(const seqcount_t *running, -+___gnet_stats_copy_basic(net_seqlock_t *running, - struct gnet_dump *d, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b, -@@ -204,7 +204,7 @@ ___gnet_stats_copy_basic(const seqcount_t *running, - * if the room in the socket buffer was not sufficient. - */ - int --gnet_stats_copy_basic(const seqcount_t *running, -+gnet_stats_copy_basic(net_seqlock_t *running, - struct gnet_dump *d, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b) -@@ -228,7 +228,7 @@ EXPORT_SYMBOL(gnet_stats_copy_basic); - * if the room in the socket buffer was not sufficient. - */ - int --gnet_stats_copy_basic_hw(const seqcount_t *running, -+gnet_stats_copy_basic_hw(net_seqlock_t *running, - struct gnet_dump *d, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b) -diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c -index f87d07736a14..7a627b208393 100644 ---- a/net/sched/sch_api.c -+++ b/net/sched/sch_api.c -@@ -1258,7 +1258,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev, - rcu_assign_pointer(sch->stab, stab); - } - if (tca[TCA_RATE]) { -- seqcount_t *running; -+ net_seqlock_t *running; - - err = -EOPNOTSUPP; - if (sch->flags & TCQ_F_MQROOT) { -diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c -index 49eae93d1489..512a39d6edec 100644 ---- a/net/sched/sch_generic.c -+++ b/net/sched/sch_generic.c -@@ -553,7 +553,11 @@ struct Qdisc noop_qdisc = { - .ops = &noop_qdisc_ops, - .q.lock = __SPIN_LOCK_UNLOCKED(noop_qdisc.q.lock), - .dev_queue = &noop_netdev_queue, -+#ifdef CONFIG_PREEMPT_RT -+ .running = __SEQLOCK_UNLOCKED(noop_qdisc.running), -+#else - .running = SEQCNT_ZERO(noop_qdisc.running), -+#endif - .busylock = __SPIN_LOCK_UNLOCKED(noop_qdisc.busylock), - .gso_skb = { - .next = (struct sk_buff *)&noop_qdisc.gso_skb, -@@ -845,9 +849,15 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, - lockdep_set_class(&sch->busylock, - dev->qdisc_tx_busylock ?: &qdisc_tx_busylock); - -+#ifdef CONFIG_PREEMPT_RT -+ seqlock_init(&sch->running); -+ lockdep_set_class(&sch->running.lock, -+ dev->qdisc_running_key ?: &qdisc_running_key); -+#else - seqcount_init(&sch->running); - lockdep_set_class(&sch->running, - dev->qdisc_running_key ?: &qdisc_running_key); -+#endif - - sch->ops = ops; - sch->flags = ops->static_flags; --- -2.19.1 - diff --git a/features/rt/net-Remove-preemption-disabling-in-netif_rx.patch b/features/rt/net-Remove-preemption-disabling-in-netif_rx.patch deleted file mode 100644 index b92de5fc..00000000 --- a/features/rt/net-Remove-preemption-disabling-in-netif_rx.patch +++ /dev/null @@ -1,67 +0,0 @@ -From efa7c96f4b8dec2a51711a6eef658093b42a6d91 Mon Sep 17 00:00:00 2001 -From: Priyanka Jain <Priyanka.Jain@freescale.com> -Date: Thu, 17 May 2012 09:35:11 +0530 -Subject: [PATCH 150/191] net: Remove preemption disabling in netif_rx() - -1)enqueue_to_backlog() (called from netif_rx) should be - bind to a particluar CPU. This can be achieved by - disabling migration. No need to disable preemption - -2)Fixes crash "BUG: scheduling while atomic: ksoftirqd" - in case of RT. - If preemption is disabled, enqueue_to_backog() is called - in atomic context. And if backlog exceeds its count, - kfree_skb() is called. But in RT, kfree_skb() might - gets scheduled out, so it expects non atomic context. - --Replace preempt_enable(), preempt_disable() with - migrate_enable(), migrate_disable() respectively --Replace get_cpu(), put_cpu() with get_cpu_light(), - put_cpu_light() respectively - -Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com> -Acked-by: Rajan Srivastava <Rajan.Srivastava@freescale.com> -Cc: <rostedt@goodmis.orgn> -Link: http://lkml.kernel.org/r/1337227511-2271-1-git-send-email-Priyanka.Jain@freescale.com - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -[bigeasy: Remove assumption about migrate_disable() from the description.] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/core/dev.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 52c928940167..ca150f02eed1 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4837,7 +4837,7 @@ static int netif_rx_internal(struct sk_buff *skb) - struct rps_dev_flow voidflow, *rflow = &voidflow; - int cpu; - -- preempt_disable(); -+ migrate_disable(); - rcu_read_lock(); - - cpu = get_rps_cpu(skb->dev, skb, &rflow); -@@ -4847,14 +4847,14 @@ static int netif_rx_internal(struct sk_buff *skb) - ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); - - rcu_read_unlock(); -- preempt_enable(); -+ migrate_enable(); - } else - #endif - { - unsigned int qtail; - -- ret = enqueue_to_backlog(skb, get_cpu(), &qtail); -- put_cpu(); -+ ret = enqueue_to_backlog(skb, get_cpu_light(), &qtail); -+ put_cpu_light(); - } - return ret; - } --- -2.19.1 - diff --git a/features/rt/net-Use-skbufhead-with-raw-lock.patch b/features/rt/net-Use-skbufhead-with-raw-lock.patch deleted file mode 100644 index 3309dda6..00000000 --- a/features/rt/net-Use-skbufhead-with-raw-lock.patch +++ /dev/null @@ -1,73 +0,0 @@ -From d7ca8b65392672151fbaaa0c0ec93b3be0dd2d51 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 12 Jul 2011 15:38:34 +0200 -Subject: [PATCH 141/191] net: Use skbufhead with raw lock - -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 -to the softirq and use the tofree_queue list for it (similar to process_queue). - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/skbuff.h | 7 +++++++ - net/core/dev.c | 6 +++--- - 2 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h -index 6d0a33d1c0db..3402903b5cf0 100644 ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -295,6 +295,7 @@ struct sk_buff_head { - - __u32 qlen; - spinlock_t lock; -+ raw_spinlock_t raw_lock; - }; - - struct sk_buff; -@@ -1902,6 +1903,12 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) - __skb_queue_head_init(list); - } - -+static inline void skb_queue_head_init_raw(struct sk_buff_head *list) -+{ -+ raw_spin_lock_init(&list->raw_lock); -+ __skb_queue_head_init(list); -+} -+ - static inline void skb_queue_head_init_class(struct sk_buff_head *list, - struct lock_class_key *class) - { -diff --git a/net/core/dev.c b/net/core/dev.c -index 2d6ee43e02b8..16c9aa19ede2 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -223,14 +223,14 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex) - static inline void rps_lock(struct softnet_data *sd) - { - #ifdef CONFIG_RPS -- spin_lock(&sd->input_pkt_queue.lock); -+ raw_spin_lock(&sd->input_pkt_queue.raw_lock); - #endif - } - - static inline void rps_unlock(struct softnet_data *sd) - { - #ifdef CONFIG_RPS -- spin_unlock(&sd->input_pkt_queue.lock); -+ raw_spin_unlock(&sd->input_pkt_queue.raw_lock); - #endif - } - -@@ -11478,7 +11478,7 @@ static int __init net_dev_init(void) - - INIT_WORK(flush, flush_backlog); - -- skb_queue_head_init(&sd->input_pkt_queue); -+ skb_queue_head_init_raw(&sd->input_pkt_queue); - skb_queue_head_init(&sd->process_queue); - #ifdef CONFIG_XFRM_OFFLOAD - skb_queue_head_init(&sd->xfrm_backlog); --- -2.19.1 - diff --git a/features/rt/net-core-disable-NET_RX_BUSY_POLL-on-RT.patch b/features/rt/net-core-disable-NET_RX_BUSY_POLL-on-RT.patch deleted file mode 100644 index 4612f762..00000000 --- a/features/rt/net-core-disable-NET_RX_BUSY_POLL-on-RT.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 116e028b98d7a297eccf815f0a734e80154b53c3 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Sat, 27 May 2017 19:02:06 +0200 -Subject: [PATCH 096/191] net/core: disable NET_RX_BUSY_POLL on RT - -napi_busy_loop() disables preemption and performs a NAPI poll. We can't acquire -sleeping locks with disabled preemption so we would have to work around this -and add explicit locking for synchronisation against ksoftirqd. -Without explicit synchronisation a low priority process would "own" the NAPI -state (by setting NAPIF_STATE_SCHED) and could be scheduled out (no -preempt_disable() and BH is preemptible on RT). -In case a network packages arrives then the interrupt handler would set -NAPIF_STATE_MISSED and the system would wait until the task owning the NAPI -would be scheduled in again. -Should a task with RT priority busy poll then it would consume the CPU instead -allowing tasks with lower priority to run. - -The NET_RX_BUSY_POLL is disabled by default (the system wide sysctls for -poll/read are set to zero) so disable NET_RX_BUSY_POLL on RT to avoid wrong -locking context on RT. Should this feature be considered useful on RT systems -then it could be enabled again with proper locking and synchronisation. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/Kconfig b/net/Kconfig -index 8cea808ad9e8..32f101108361 100644 ---- a/net/Kconfig -+++ b/net/Kconfig -@@ -286,7 +286,7 @@ config CGROUP_NET_CLASSID - - config NET_RX_BUSY_POLL - bool -- default y -+ default y if !PREEMPT_RT - - config BQL - bool --- -2.19.1 - diff --git a/features/rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch b/features/rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch deleted file mode 100644 index ba6256a3..00000000 --- a/features/rt/net-core-use-local_bh_disable-in-netif_rx_ni.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 44a59612611dac7147b1bc47494ed5e8aa95855e Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 16 Jun 2017 19:03:16 +0200 -Subject: [PATCH 126/191] net/core: use local_bh_disable() in netif_rx_ni() - -In 2004 netif_rx_ni() gained a preempt_disable() section around -netif_rx() and its do_softirq() + testing for it. The do_softirq() part -is required because netif_rx() raises the softirq but does not invoke -it. The preempt_disable() is required to remain on the same CPU which added the -skb to the per-CPU list. -All this can be avoided be putting this into a local_bh_disable()ed -section. The local_bh_enable() part will invoke do_softirq() if -required. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/core/dev.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/net/core/dev.c b/net/core/dev.c -index 86a599a41062..2d6ee43e02b8 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4889,11 +4889,9 @@ int netif_rx_ni(struct sk_buff *skb) - - trace_netif_rx_ni_entry(skb); - -- preempt_disable(); -+ local_bh_disable(); - err = netif_rx_internal(skb); -- if (local_softirq_pending()) -- do_softirq(); -- preempt_enable(); -+ local_bh_enable(); - trace_netif_rx_ni_exit(err); - - return err; --- -2.19.1 - diff --git a/features/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch b/features/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch deleted file mode 100644 index 75ccf34f..00000000 --- a/features/rt/net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 2e3722be67eda134ba0ed9bc8507e6f3ca3e0011 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 30 Mar 2016 13:36:29 +0200 -Subject: [PATCH 143/191] net: dev: always take qdisc's busylock in - __dev_xmit_skb() - -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 -by a task with a higher priority then the task with the higher priority -won't be able to submit packets to the NIC directly instead they will be -enqueued into the Qdisc. The NIC will remain idle until the task(s) with -higher priority leave the CPU and the task with lower priority gets back -and finishes the job. - -If we take always the busylock we ensure that the RT task can boost the -low-prio task and submit the packet. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/core/dev.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/net/core/dev.c b/net/core/dev.c -index aab963be5655..52c928940167 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3807,7 +3807,11 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, - * This permits qdisc->running owner to get the lock more - * often and dequeue packets faster. - */ -+#ifdef CONFIG_PREEMPT_RT -+ contended = true; -+#else - contended = qdisc_is_running(q); -+#endif - if (unlikely(contended)) - spin_lock(&q->busylock); - --- -2.19.1 - diff --git a/features/rt/net-jme-Replace-link-change-tasklet-with-work.patch b/features/rt/net-jme-Replace-link-change-tasklet-with-work.patch deleted file mode 100644 index 8373eb7f..00000000 --- a/features/rt/net-jme-Replace-link-change-tasklet-with-work.patch +++ /dev/null @@ -1,87 +0,0 @@ -From f5a683610df7d5b147cf18ed631f98f1813afec5 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:11 +0100 -Subject: [PATCH 048/191] net: jme: Replace link-change tasklet with work - -The link change tasklet disables the tasklets for tx/rx processing while -upating hw parameters and then enables the tasklets again. - -This update can also be pushed into a workqueue where it can be performed -in preemptible context. This allows tasklet_disable() to become sleeping. - -Replace the linkch_task tasklet with a work. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/net/ethernet/jme.c | 10 +++++----- - drivers/net/ethernet/jme.h | 2 +- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c -index e9efe074edc1..f1b9284e0bea 100644 ---- a/drivers/net/ethernet/jme.c -+++ b/drivers/net/ethernet/jme.c -@@ -1265,9 +1265,9 @@ jme_stop_shutdown_timer(struct jme_adapter *jme) - jwrite32f(jme, JME_APMC, apmc); - } - --static void jme_link_change_tasklet(struct tasklet_struct *t) -+static void jme_link_change_work(struct work_struct *work) - { -- struct jme_adapter *jme = from_tasklet(jme, t, linkch_task); -+ struct jme_adapter *jme = container_of(work, struct jme_adapter, linkch_task); - struct net_device *netdev = jme->dev; - int rc; - -@@ -1510,7 +1510,7 @@ jme_intr_msi(struct jme_adapter *jme, u32 intrstat) - * all other events are ignored - */ - jwrite32(jme, JME_IEVE, intrstat); -- tasklet_schedule(&jme->linkch_task); -+ schedule_work(&jme->linkch_task); - goto out_reenable; - } - -@@ -1832,7 +1832,6 @@ jme_open(struct net_device *netdev) - jme_clear_pm_disable_wol(jme); - JME_NAPI_ENABLE(jme); - -- tasklet_setup(&jme->linkch_task, jme_link_change_tasklet); - tasklet_setup(&jme->txclean_task, jme_tx_clean_tasklet); - tasklet_setup(&jme->rxclean_task, jme_rx_clean_tasklet); - tasklet_setup(&jme->rxempty_task, jme_rx_empty_tasklet); -@@ -1920,7 +1919,7 @@ jme_close(struct net_device *netdev) - - JME_NAPI_DISABLE(jme); - -- tasklet_kill(&jme->linkch_task); -+ cancel_work_sync(&jme->linkch_task); - tasklet_kill(&jme->txclean_task); - tasklet_kill(&jme->rxclean_task); - tasklet_kill(&jme->rxempty_task); -@@ -3035,6 +3034,7 @@ jme_init_one(struct pci_dev *pdev, - atomic_set(&jme->rx_empty, 1); - - tasklet_setup(&jme->pcc_task, jme_pcc_tasklet); -+ INIT_WORK(&jme->linkch_task, jme_link_change_work); - jme->dpi.cur = PCC_P1; - - jme->reg_ghc = 0; -diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h -index a2c3b00d939d..2af76329b4a2 100644 ---- a/drivers/net/ethernet/jme.h -+++ b/drivers/net/ethernet/jme.h -@@ -411,7 +411,7 @@ struct jme_adapter { - struct tasklet_struct rxempty_task; - struct tasklet_struct rxclean_task; - struct tasklet_struct txclean_task; -- struct tasklet_struct linkch_task; -+ struct work_struct linkch_task; - struct tasklet_struct pcc_task; - unsigned long flags; - u32 reg_txcs; --- -2.19.1 - diff --git a/features/rt/net-sundance-Use-tasklet_disable_in_atomic.patch b/features/rt/net-sundance-Use-tasklet_disable_in_atomic.patch deleted file mode 100644 index 93713951..00000000 --- a/features/rt/net-sundance-Use-tasklet_disable_in_atomic.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8281edf5e8fa71507a09c7511ea11da232e373af Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:12 +0100 -Subject: [PATCH 049/191] net: sundance: Use tasklet_disable_in_atomic(). - -tasklet_disable() is used in the timer callback. This might be distangled, -but without access to the hardware that's a bit risky. - -Replace it with tasklet_disable_in_atomic() so tasklet_disable() can be -changed to a sleep wait once all remaining atomic users are converted. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Cc: Denis Kirjanov <kda@linux-powerpc.org> -Cc: "David S. Miller" <davem@davemloft.net> -Cc: Jakub Kicinski <kuba@kernel.org> -Cc: netdev@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/net/ethernet/dlink/sundance.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c -index e3a8858915b3..df0eab479d51 100644 ---- a/drivers/net/ethernet/dlink/sundance.c -+++ b/drivers/net/ethernet/dlink/sundance.c -@@ -963,7 +963,7 @@ static void tx_timeout(struct net_device *dev, unsigned int txqueue) - unsigned long flag; - - netif_stop_queue(dev); -- tasklet_disable(&np->tx_tasklet); -+ tasklet_disable_in_atomic(&np->tx_tasklet); - iowrite16(0, ioaddr + IntrEnable); - printk(KERN_WARNING "%s: Transmit timed out, TxStatus %2.2x " - "TxFrameId %2.2x," --- -2.19.1 - diff --git a/features/rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch b/features/rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch deleted file mode 100644 index 9defbe15..00000000 --- a/features/rt/notifier-Make-atomic_notifiers-use-raw_spinlock.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 074172587a9dfb0bae37a5663abb7e439376abfc Mon Sep 17 00:00:00 2001 -From: Valentin Schneider <valentin.schneider@arm.com> -Date: Sun, 22 Nov 2020 20:19:04 +0000 -Subject: [PATCH 005/191] notifier: Make atomic_notifiers use raw_spinlock - -Booting a recent PREEMPT_RT kernel (v5.10-rc3-rt7-rebase) on my arm64 Juno -leads to the idle task blocking on an RT sleeping spinlock down some -notifier path: - - [ 1.809101] BUG: scheduling while atomic: swapper/5/0/0x00000002 - [ 1.809116] Modules linked in: - [ 1.809123] Preemption disabled at: - [ 1.809125] secondary_start_kernel (arch/arm64/kernel/smp.c:227) - [ 1.809146] CPU: 5 PID: 0 Comm: swapper/5 Tainted: G W 5.10.0-rc3-rt7 #168 - [ 1.809153] Hardware name: ARM Juno development board (r0) (DT) - [ 1.809158] Call trace: - [ 1.809160] dump_backtrace (arch/arm64/kernel/stacktrace.c:100 (discriminator 1)) - [ 1.809170] show_stack (arch/arm64/kernel/stacktrace.c:198) - [ 1.809178] dump_stack (lib/dump_stack.c:122) - [ 1.809188] __schedule_bug (kernel/sched/core.c:4886) - [ 1.809197] __schedule (./arch/arm64/include/asm/preempt.h:18 kernel/sched/core.c:4913 kernel/sched/core.c:5040) - [ 1.809204] preempt_schedule_lock (kernel/sched/core.c:5365 (discriminator 1)) - [ 1.809210] rt_spin_lock_slowlock_locked (kernel/locking/rtmutex.c:1072) - [ 1.809217] rt_spin_lock_slowlock (kernel/locking/rtmutex.c:1110) - [ 1.809224] rt_spin_lock (./include/linux/rcupdate.h:647 kernel/locking/rtmutex.c:1139) - [ 1.809231] atomic_notifier_call_chain_robust (kernel/notifier.c:71 kernel/notifier.c:118 kernel/notifier.c:186) - [ 1.809240] cpu_pm_enter (kernel/cpu_pm.c:39 kernel/cpu_pm.c:93) - [ 1.809249] psci_enter_idle_state (drivers/cpuidle/cpuidle-psci.c:52 drivers/cpuidle/cpuidle-psci.c:129) - [ 1.809258] cpuidle_enter_state (drivers/cpuidle/cpuidle.c:238) - [ 1.809267] cpuidle_enter (drivers/cpuidle/cpuidle.c:353) - [ 1.809275] do_idle (kernel/sched/idle.c:132 kernel/sched/idle.c:213 kernel/sched/idle.c:273) - [ 1.809282] cpu_startup_entry (kernel/sched/idle.c:368 (discriminator 1)) - [ 1.809288] secondary_start_kernel (arch/arm64/kernel/smp.c:273) - -Two points worth noting: - -1) That this is conceptually the same issue as pointed out in: - 313c8c16ee62 ("PM / CPU: replace raw_notifier with atomic_notifier") -2) Only the _robust() variant of atomic_notifier callchains suffer from - this - -AFAICT only the cpu_pm_notifier_chain really needs to be changed, but -singling it out would mean introducing a new (truly) non-blocking API. At -the same time, callers that are fine with any blocking within the call -chain should use blocking notifiers, so patching up all atomic_notifier's -doesn't seem *too* crazy to me. - -Fixes: 70d932985757 ("notifier: Fix broken error handling pattern") -Signed-off-by: Valentin Schneider <valentin.schneider@arm.com> -Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> -Link: https://lkml.kernel.org/r/20201122201904.30940-1-valentin.schneider@arm.com -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/notifier.h | 6 +++--- - kernel/notifier.c | 12 ++++++------ - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/include/linux/notifier.h b/include/linux/notifier.h -index 2fb373a5c1ed..723bc2df6388 100644 ---- a/include/linux/notifier.h -+++ b/include/linux/notifier.h -@@ -58,7 +58,7 @@ struct notifier_block { - }; - - struct atomic_notifier_head { -- spinlock_t lock; -+ raw_spinlock_t lock; - struct notifier_block __rcu *head; - }; - -@@ -78,7 +78,7 @@ struct srcu_notifier_head { - }; - - #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ -- spin_lock_init(&(name)->lock); \ -+ raw_spin_lock_init(&(name)->lock); \ - (name)->head = NULL; \ - } while (0) - #define BLOCKING_INIT_NOTIFIER_HEAD(name) do { \ -@@ -95,7 +95,7 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); - cleanup_srcu_struct(&(name)->srcu); - - #define ATOMIC_NOTIFIER_INIT(name) { \ -- .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ -+ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \ - .head = NULL } - #define BLOCKING_NOTIFIER_INIT(name) { \ - .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ -diff --git a/kernel/notifier.c b/kernel/notifier.c -index 1b019cbca594..c20782f07643 100644 ---- a/kernel/notifier.c -+++ b/kernel/notifier.c -@@ -142,9 +142,9 @@ int atomic_notifier_chain_register(struct atomic_notifier_head *nh, - unsigned long flags; - int ret; - -- spin_lock_irqsave(&nh->lock, flags); -+ raw_spin_lock_irqsave(&nh->lock, flags); - ret = notifier_chain_register(&nh->head, n); -- spin_unlock_irqrestore(&nh->lock, flags); -+ raw_spin_unlock_irqrestore(&nh->lock, flags); - return ret; - } - EXPORT_SYMBOL_GPL(atomic_notifier_chain_register); -@@ -164,9 +164,9 @@ int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, - unsigned long flags; - int ret; - -- spin_lock_irqsave(&nh->lock, flags); -+ raw_spin_lock_irqsave(&nh->lock, flags); - ret = notifier_chain_unregister(&nh->head, n); -- spin_unlock_irqrestore(&nh->lock, flags); -+ raw_spin_unlock_irqrestore(&nh->lock, flags); - synchronize_rcu(); - return ret; - } -@@ -182,9 +182,9 @@ int atomic_notifier_call_chain_robust(struct atomic_notifier_head *nh, - * Musn't use RCU; because then the notifier list can - * change between the up and down traversal. - */ -- spin_lock_irqsave(&nh->lock, flags); -+ raw_spin_lock_irqsave(&nh->lock, flags); - ret = notifier_call_chain_robust(&nh->head, val_up, val_down, v); -- spin_unlock_irqrestore(&nh->lock, flags); -+ raw_spin_unlock_irqrestore(&nh->lock, flags); - - return ret; - } --- -2.19.1 - diff --git a/features/rt/panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch b/features/rt/panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch deleted file mode 100644 index b8f71482..00000000 --- a/features/rt/panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 487bb91d3835707e8324dfddf3a2a524072e62ef Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 147/191] panic: skip get_random_bytes for RT_FULL in - init_oops_id - -Disable on -RT. If this is invoked from irq-context we will have problems -to acquire the sleeping lock. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/panic.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/kernel/panic.c b/kernel/panic.c -index 678529917d5d..14017d1b77b0 100644 ---- a/kernel/panic.c -+++ b/kernel/panic.c -@@ -544,9 +544,11 @@ static u64 oops_id; - - static int init_oops_id(void) - { -+#ifndef CONFIG_PREEMPT_RT - if (!oops_id) - get_random_bytes(&oops_id, sizeof(oops_id)); - else -+#endif - oops_id++; - - return 0; --- -2.19.1 - diff --git a/features/rt/pid.h-include-atomic.h.patch b/features/rt/pid.h-include-atomic.h.patch deleted file mode 100644 index abe97a5c..00000000 --- a/features/rt/pid.h-include-atomic.h.patch +++ /dev/null @@ -1,42 +0,0 @@ -From e1d5c19b4e1fffa27d74e71fc8e15d416b2e15ea Mon Sep 17 00:00:00 2001 -From: Grygorii Strashko <Grygorii.Strashko@linaro.org> -Date: Tue, 21 Jul 2015 19:43:56 +0300 -Subject: [PATCH 127/191] pid.h: include atomic.h - -This patch fixes build error: - CC kernel/pid_namespace.o -In file included from kernel/pid_namespace.c:11:0: -include/linux/pid.h: In function 'get_pid': -include/linux/pid.h:78:3: error: implicit declaration of function 'atomic_inc' [-Werror=implicit-function-declaration] - atomic_inc(&pid->count); - ^ -which happens when - CONFIG_PROVE_LOCKING=n - CONFIG_DEBUG_SPINLOCK=n - CONFIG_DEBUG_MUTEXES=n - CONFIG_DEBUG_LOCK_ALLOC=n - CONFIG_PID_NS=y - -Vanilla gets this via spinlock.h. - -Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/pid.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/linux/pid.h b/include/linux/pid.h -index fa10acb8d6a4..2f86f84e9fc1 100644 ---- a/include/linux/pid.h -+++ b/include/linux/pid.h -@@ -3,6 +3,7 @@ - #define _LINUX_PID_H - - #include <linux/rculist.h> -+#include <linux/atomic.h> - #include <linux/wait.h> - #include <linux/refcount.h> - --- -2.19.1 - diff --git a/features/rt/powerpc-Add-support-for-lazy-preemption.patch b/features/rt/powerpc-Add-support-for-lazy-preemption.patch deleted file mode 100644 index 4cc73824..00000000 --- a/features/rt/powerpc-Add-support-for-lazy-preemption.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 2525cb41cb38be3c1639aed5deb00823f5a472f4 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 1 Nov 2012 10:14:11 +0100 -Subject: [PATCH 167/191] powerpc: Add support for lazy preemption - -Implement the powerpc pieces for lazy preempt. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/powerpc/Kconfig | 1 + - arch/powerpc/include/asm/thread_info.h | 7 +++++++ - arch/powerpc/kernel/asm-offsets.c | 1 + - arch/powerpc/kernel/entry_32.S | 11 +++++++++-- - arch/powerpc/kernel/exceptions-64e.S | 16 ++++++++++++---- - arch/powerpc/kernel/interrupt.c | 10 +++++++--- - 6 files changed, 37 insertions(+), 9 deletions(-) - -diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index 386ae12d8523..bbee9b2f2bc7 100644 ---- a/arch/powerpc/Kconfig -+++ b/arch/powerpc/Kconfig -@@ -231,6 +231,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 -+ select HAVE_PREEMPT_LAZY - select MMU_GATHER_RCU_TABLE_FREE - select MMU_GATHER_PAGE_SIZE - select HAVE_REGS_AND_STACK_ACCESS_API -diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h -index 386d576673a1..730ce15944ce 100644 ---- a/arch/powerpc/include/asm/thread_info.h -+++ b/arch/powerpc/include/asm/thread_info.h -@@ -48,6 +48,8 @@ - struct thread_info { - int preempt_count; /* 0 => preemptable, - <0 => BUG */ -+ int preempt_lazy_count; /* 0 => preemptable, -+ <0 => BUG */ - unsigned long local_flags; /* private flags for thread */ - #ifdef CONFIG_LIVEPATCH - unsigned long *livepatch_sp; -@@ -94,6 +96,7 @@ void arch_setup_new_exec(void); - #define TIF_PATCH_PENDING 6 /* pending live patching update */ - #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ - #define TIF_SINGLESTEP 8 /* singlestepping active */ -+#define TIF_NEED_RESCHED_LAZY 9 /* lazy rescheduling necessary */ - #define TIF_SECCOMP 10 /* secure computing */ - #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ - #define TIF_NOERROR 12 /* Force successful syscall return */ -@@ -109,6 +112,7 @@ void arch_setup_new_exec(void); - #define TIF_POLLING_NRFLAG 19 /* true if poll_idle() is polling TIF_NEED_RESCHED */ - #define TIF_32BIT 20 /* 32 bit binary */ - -+ - /* as above, but as bit values */ - #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) - #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) -@@ -120,6 +124,7 @@ void arch_setup_new_exec(void); - #define _TIF_PATCH_PENDING (1<<TIF_PATCH_PENDING) - #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) - #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) -+#define _TIF_NEED_RESCHED_LAZY (1<<TIF_NEED_RESCHED_LAZY) - #define _TIF_SECCOMP (1<<TIF_SECCOMP) - #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) - #define _TIF_NOERROR (1<<TIF_NOERROR) -@@ -133,10 +138,12 @@ void arch_setup_new_exec(void); - _TIF_SYSCALL_EMU) - - #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ -+ _TIF_NEED_RESCHED_LAZY | \ - _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ - _TIF_RESTORE_TM | _TIF_PATCH_PENDING | \ - _TIF_NOTIFY_SIGNAL) - #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) -+#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) - - /* Bits in local_flags */ - /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ -diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c -index f3a662201a9f..1202c9c2e5b5 100644 ---- a/arch/powerpc/kernel/asm-offsets.c -+++ b/arch/powerpc/kernel/asm-offsets.c -@@ -191,6 +191,7 @@ int main(void) - OFFSET(TI_FLAGS, thread_info, flags); - OFFSET(TI_LOCAL_FLAGS, thread_info, local_flags); - OFFSET(TI_PREEMPT, thread_info, preempt_count); -+ OFFSET(TI_PREEMPT_LAZY, thread_info, preempt_lazy_count); - - #ifdef CONFIG_PPC64 - OFFSET(DCACHEL1BLOCKSIZE, ppc64_caches, l1d.block_size); -diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S -index 78c430b7f9d9..b778938b4a5b 100644 ---- a/arch/powerpc/kernel/entry_32.S -+++ b/arch/powerpc/kernel/entry_32.S -@@ -674,7 +674,14 @@ resume_kernel: - cmpwi 0,r0,0 /* if non-zero, just restore regs and return */ - bne restore_kuap - andi. r8,r8,_TIF_NEED_RESCHED -+ bne+ 1f -+ lwz r0,TI_PREEMPT_LAZY(r2) -+ cmpwi 0,r0,0 /* if non-zero, just restore regs and return */ -+ bne restore_kuap -+ lwz r0,TI_FLAGS(r2) -+ andi. r0,r0,_TIF_NEED_RESCHED_LAZY - beq+ restore_kuap -+1: - lwz r3,_MSR(r1) - andi. r0,r3,MSR_EE /* interrupts off? */ - beq restore_kuap /* don't schedule if so */ -@@ -989,7 +996,7 @@ global_dbcr0: - #endif /* !(CONFIG_4xx || CONFIG_BOOKE) */ - - do_work: /* r10 contains MSR_KERNEL here */ -- andi. r0,r9,_TIF_NEED_RESCHED -+ andi. r0,r9,_TIF_NEED_RESCHED_MASK - beq do_user_signal - - do_resched: /* r10 contains MSR_KERNEL here */ -@@ -1008,7 +1015,7 @@ recheck: - LOAD_REG_IMMEDIATE(r10,MSR_KERNEL) - mtmsr r10 /* disable interrupts */ - lwz r9,TI_FLAGS(r2) -- andi. r0,r9,_TIF_NEED_RESCHED -+ andi. r0,r9,_TIF_NEED_RESCHED_MASK - bne- do_resched - andi. r0,r9,_TIF_USER_WORK_MASK - beq restore_user -diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S -index e8eb9992a270..6eb9599a3262 100644 ---- a/arch/powerpc/kernel/exceptions-64e.S -+++ b/arch/powerpc/kernel/exceptions-64e.S -@@ -1074,7 +1074,7 @@ _GLOBAL(ret_from_except_lite) - li r10, -1 - mtspr SPRN_DBSR,r10 - b restore --1: andi. r0,r4,_TIF_NEED_RESCHED -+1: andi. r0,r4,_TIF_NEED_RESCHED_MASK - beq 2f - bl restore_interrupts - SCHEDULE_USER -@@ -1126,12 +1126,20 @@ resume_kernel: - bne- 0b - 1: - --#ifdef CONFIG_PREEMPT -+#ifdef CONFIG_PREEMPTION - /* Check if we need to preempt */ -+ lwz r8,TI_PREEMPT(r9) -+ cmpwi 0,r8,0 /* if non-zero, just restore regs and return */ -+ bne restore - andi. r0,r4,_TIF_NEED_RESCHED -+ bne+ check_count -+ -+ andi. r0,r4,_TIF_NEED_RESCHED_LAZY - beq+ restore -+ lwz r8,TI_PREEMPT_LAZY(r9) -+ - /* Check that preempt_count() == 0 and interrupts are enabled */ -- lwz r8,TI_PREEMPT(r9) -+check_count: - cmpwi cr0,r8,0 - bne restore - ld r0,SOFTE(r1) -@@ -1152,7 +1160,7 @@ resume_kernel: - * interrupted after loading SRR0/1. - */ - wrteei 0 --#endif /* CONFIG_PREEMPT */ -+#endif /* CONFIG_PREEMPTION */ - - restore: - /* -diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c -index c475a229a42a..d6b69de1284c 100644 ---- a/arch/powerpc/kernel/interrupt.c -+++ b/arch/powerpc/kernel/interrupt.c -@@ -286,7 +286,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3, - ti_flags = READ_ONCE(current_thread_info()->flags); - while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) { - local_irq_enable(); -- if (ti_flags & _TIF_NEED_RESCHED) { -+ if (ti_flags & _TIF_NEED_RESCHED_MASK) { - schedule(); - } else { - /* -@@ -381,7 +381,7 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned - ti_flags = READ_ONCE(current_thread_info()->flags); - while (unlikely(ti_flags & (_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM))) { - local_irq_enable(); /* returning to user: may enable */ -- if (ti_flags & _TIF_NEED_RESCHED) { -+ if (ti_flags & _TIF_NEED_RESCHED_MASK) { - schedule(); - } else { - if (ti_flags & _TIF_SIGPENDING) -@@ -473,11 +473,15 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsign - /* Returning to a kernel context with local irqs enabled. */ - WARN_ON_ONCE(!(regs->msr & MSR_EE)); - again: -- if (IS_ENABLED(CONFIG_PREEMPT)) { -+ if (IS_ENABLED(CONFIG_PREEMPTION)) { - /* Return to preemptible kernel context */ - if (unlikely(current_thread_info()->flags & _TIF_NEED_RESCHED)) { - if (preempt_count() == 0) - preempt_schedule_irq(); -+ } else if (unlikely(current_thread_info()->flags & _TIF_NEED_RESCHED_LAZY)) { -+ if ((preempt_count() == 0) && -+ (current_thread_info()->preempt_lazy_count == 0)) -+ preempt_schedule_irq(); - } - } - --- -2.19.1 - diff --git a/features/rt/powerpc-Avoid-recursive-header-includes.patch b/features/rt/powerpc-Avoid-recursive-header-includes.patch deleted file mode 100644 index cfecd330..00000000 --- a/features/rt/powerpc-Avoid-recursive-header-includes.patch +++ /dev/null @@ -1,47 +0,0 @@ -From b8c2c7090ec3f3373205ff4b223ac447159c4c96 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 8 Jan 2021 19:48:21 +0100 -Subject: [PATCH 184/191] powerpc: Avoid recursive header includes - -- The include of bug.h leads to an include of printk.h which gets back - to spinlock.h and complains then about missing xchg(). - Remove bug.h and add bits.h which is needed for BITS_PER_BYTE. - -- Avoid the "please don't include this file directly" error from - rwlock-rt. Allow an include from/with rtmutex.h. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/include/asm/cmpxchg.h | 2 +- - arch/powerpc/include/asm/simple_spinlock_types.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/powerpc/include/asm/cmpxchg.h b/arch/powerpc/include/asm/cmpxchg.h -index cf091c4c22e5..7371f7e23c35 100644 ---- a/arch/powerpc/include/asm/cmpxchg.h -+++ b/arch/powerpc/include/asm/cmpxchg.h -@@ -5,7 +5,7 @@ - #ifdef __KERNEL__ - #include <linux/compiler.h> - #include <asm/synch.h> --#include <linux/bug.h> -+#include <linux/bits.h> - - #ifdef __BIG_ENDIAN - #define BITOFF_CAL(size, off) ((sizeof(u32) - size - off) * BITS_PER_BYTE) -diff --git a/arch/powerpc/include/asm/simple_spinlock_types.h b/arch/powerpc/include/asm/simple_spinlock_types.h -index 0f3cdd8faa95..d45561e9e6ba 100644 ---- a/arch/powerpc/include/asm/simple_spinlock_types.h -+++ b/arch/powerpc/include/asm/simple_spinlock_types.h -@@ -2,7 +2,7 @@ - #ifndef _ASM_POWERPC_SIMPLE_SPINLOCK_TYPES_H - #define _ASM_POWERPC_SIMPLE_SPINLOCK_TYPES_H - --#ifndef __LINUX_SPINLOCK_TYPES_H -+#if !defined(__LINUX_SPINLOCK_TYPES_H) && !defined(__LINUX_RT_MUTEX_H) - # error "please don't include this file directly" - #endif - --- -2.19.1 - diff --git a/features/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch b/features/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch deleted file mode 100644 index bc6061ec..00000000 --- a/features/rt/powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4496674f6fc7117a30d0c2ea5c994c9675808e69 Mon Sep 17 00:00:00 2001 -From: Bogdan Purcareata <bogdan.purcareata@freescale.com> -Date: Fri, 24 Apr 2015 15:53:13 +0000 -Subject: [PATCH 182/191] powerpc/kvm: Disable in-kernel MPIC emulation for - PREEMPT_RT - -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 -directed delivery mode with a multiple CPU mask, the emulated openpic will loop -through all of the VCPUs, and for each VCPUs, it call IRQ_check, which will loop -through all the pending interrupts for that VCPU. This is done while holding the -raw_lock, meaning that in all this time the interrupts and preemption are -disabled on the host Linux. A malicious user app can max both these number and -cause a DoS. - -This temporary fix is sent for two reasons. First is so that users who want to -use the in-kernel MPIC emulation are aware of the potential latencies, thus -making sure that the hardware MPIC and their usage scenario does not involve -interrupts sent in directed delivery mode, and the number of possible pending -interrupts is kept small. Secondly, this should incentivize the development of a -proper openpic emulation that would be better suited for RT. - -Acked-by: Scott Wood <scottwood@freescale.com> -Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/kvm/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig -index e45644657d49..b826174ce983 100644 ---- a/arch/powerpc/kvm/Kconfig -+++ b/arch/powerpc/kvm/Kconfig -@@ -179,6 +179,7 @@ config KVM_E500MC - config KVM_MPIC - bool "KVM in-kernel MPIC emulation" - depends on KVM && E500 -+ depends on !PREEMPT_RT - select HAVE_KVM_IRQCHIP - select HAVE_KVM_IRQFD - select HAVE_KVM_IRQ_ROUTING --- -2.19.1 - diff --git a/features/rt/powerpc-mm-Move-the-linear_mapping_mutex-to-the-ifde.patch b/features/rt/powerpc-mm-Move-the-linear_mapping_mutex-to-the-ifde.patch deleted file mode 100644 index 9f28057d..00000000 --- a/features/rt/powerpc-mm-Move-the-linear_mapping_mutex-to-the-ifde.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 36035164cb4bbf6cc044ff5d6f481c528ec34fb3 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 19 Feb 2021 17:51:07 +0100 -Subject: [PATCH 006/191] powerpc/mm: Move the linear_mapping_mutex to the - ifdef where it is used - -The mutex linear_mapping_mutex is defined at the of the file while its -only two user are within the CONFIG_MEMORY_HOTPLUG block. -A compile without CONFIG_MEMORY_HOTPLUG set fails on PREEMPT_RT because -its mutex implementation is smart enough to realize that it is unused. - -Move the definition of linear_mapping_mutex to ifdef block where it is -used. - -Fixes: 1f73ad3e8d755 ("powerpc/mm: print warning in arch_remove_linear_mapping()") -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/mm/mem.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c -index 4e8ce6d85232..7a59a5c9aa5d 100644 ---- a/arch/powerpc/mm/mem.c -+++ b/arch/powerpc/mm/mem.c -@@ -54,7 +54,6 @@ - - #include <mm/mmu_decl.h> - --static DEFINE_MUTEX(linear_mapping_mutex); - unsigned long long memory_limit; - bool init_mem_is_free; - -@@ -72,6 +71,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, - EXPORT_SYMBOL(phys_mem_access_prot); - - #ifdef CONFIG_MEMORY_HOTPLUG -+static DEFINE_MUTEX(linear_mapping_mutex); - - #ifdef CONFIG_NUMA - int memory_add_physaddr_to_nid(u64 start) --- -2.19.1 - diff --git a/features/rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch b/features/rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch deleted file mode 100644 index d3850690..00000000 --- a/features/rt/powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 4478a8edce91a9ecc083e0a1c892bc61e03debb5 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 26 Mar 2019 18:31:54 +0100 -Subject: [PATCH 181/191] powerpc/pseries/iommu: Use a locallock instead - local_irq_save() - -The locallock protects the per-CPU variable tce_page. The function -attempts to allocate memory while tce_page is protected (by disabling -interrupts). - -Use local_irq_save() instead of local_irq_disable(). - -Cc: stable-rt@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/platforms/pseries/iommu.c | 31 +++++++++++++++++--------- - 1 file changed, 20 insertions(+), 11 deletions(-) - -diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c -index 9fc5217f0c8e..4fdb9370b913 100644 ---- a/arch/powerpc/platforms/pseries/iommu.c -+++ b/arch/powerpc/platforms/pseries/iommu.c -@@ -24,6 +24,7 @@ - #include <linux/of.h> - #include <linux/iommu.h> - #include <linux/rculist.h> -+#include <linux/local_lock.h> - #include <asm/io.h> - #include <asm/prom.h> - #include <asm/rtas.h> -@@ -190,7 +191,13 @@ static int tce_build_pSeriesLP(unsigned long liobn, long tcenum, long tceshift, - return ret; - } - --static DEFINE_PER_CPU(__be64 *, tce_page); -+struct tce_page { -+ __be64 * page; -+ local_lock_t lock; -+}; -+static DEFINE_PER_CPU(struct tce_page, tce_page) = { -+ .lock = INIT_LOCAL_LOCK(lock), -+}; - - static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, - long npages, unsigned long uaddr, -@@ -212,9 +219,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, - direction, attrs); - } - -- local_irq_save(flags); /* to protect tcep and the page behind it */ -+ /* to protect tcep and the page behind it */ -+ local_lock_irqsave(&tce_page.lock, flags); - -- tcep = __this_cpu_read(tce_page); -+ tcep = __this_cpu_read(tce_page.page); - - /* This is safe to do since interrupts are off when we're called - * from iommu_alloc{,_sg}() -@@ -223,12 +231,12 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, - tcep = (__be64 *)__get_free_page(GFP_ATOMIC); - /* If allocation fails, fall back to the loop implementation */ - if (!tcep) { -- local_irq_restore(flags); -+ local_unlock_irqrestore(&tce_page.lock, flags); - return tce_build_pSeriesLP(tbl->it_index, tcenum, - tbl->it_page_shift, - npages, uaddr, direction, attrs); - } -- __this_cpu_write(tce_page, tcep); -+ __this_cpu_write(tce_page.page, tcep); - } - - rpn = __pa(uaddr) >> TCE_SHIFT; -@@ -258,7 +266,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, - tcenum += limit; - } while (npages > 0 && !rc); - -- local_irq_restore(flags); -+ local_unlock_irqrestore(&tce_page.lock, flags); - - if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) { - ret = (int)rc; -@@ -429,16 +437,17 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, - DMA_BIDIRECTIONAL, 0); - } - -- local_irq_disable(); /* to protect tcep and the page behind it */ -- tcep = __this_cpu_read(tce_page); -+ /* to protect tcep and the page behind it */ -+ local_lock_irq(&tce_page.lock); -+ tcep = __this_cpu_read(tce_page.page); - - if (!tcep) { - tcep = (__be64 *)__get_free_page(GFP_ATOMIC); - if (!tcep) { -- local_irq_enable(); -+ local_unlock_irq(&tce_page.lock); - return -ENOMEM; - } -- __this_cpu_write(tce_page, tcep); -+ __this_cpu_write(tce_page.page, tcep); - } - - proto_tce = TCE_PCI_READ | TCE_PCI_WRITE; -@@ -481,7 +490,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, - - /* error cleanup: caller will clear whole range */ - -- local_irq_enable(); -+ local_unlock_irq(&tce_page.lock); - return rc; - } - --- -2.19.1 - diff --git a/features/rt/powerpc-stackprotector-work-around-stack-guard-init-.patch b/features/rt/powerpc-stackprotector-work-around-stack-guard-init-.patch deleted file mode 100644 index 4d3d3734..00000000 --- a/features/rt/powerpc-stackprotector-work-around-stack-guard-init-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 77000da2f2cf79d495a6d07abfbe32ebf4cd279f Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 26 Mar 2019 18:31:29 +0100 -Subject: [PATCH 183/191] powerpc/stackprotector: work around stack-guard init - from atomic - -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 -as the initial value. - -Cc: stable-rt@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/include/asm/stackprotector.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/powerpc/include/asm/stackprotector.h b/arch/powerpc/include/asm/stackprotector.h -index 1c8460e23583..b1653c160bab 100644 ---- a/arch/powerpc/include/asm/stackprotector.h -+++ b/arch/powerpc/include/asm/stackprotector.h -@@ -24,7 +24,11 @@ static __always_inline void boot_init_stack_canary(void) - unsigned long canary; - - /* Try to get a semi random initial value. */ -+#ifdef CONFIG_PREEMPT_RT -+ canary = (unsigned long)&canary; -+#else - canary = get_random_canary(); -+#endif - canary ^= mftb(); - canary ^= LINUX_VERSION_CODE; - canary &= CANARY_MASK; --- -2.19.1 - diff --git a/features/rt/powerpc-traps-Use-PREEMPT_RT.patch b/features/rt/powerpc-traps-Use-PREEMPT_RT.patch deleted file mode 100644 index 63c650aa..00000000 --- a/features/rt/powerpc-traps-Use-PREEMPT_RT.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3411ea60697a880d9c13ccedd06aa313a384b569 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 26 Jul 2019 11:30:49 +0200 -Subject: [PATCH 180/191] powerpc: traps: Use PREEMPT_RT - -Add PREEMPT_RT to the backtrace if enabled. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/kernel/traps.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c -index 5828c83eaca6..6d0f70abed87 100644 ---- a/arch/powerpc/kernel/traps.c -+++ b/arch/powerpc/kernel/traps.c -@@ -260,12 +260,17 @@ static char *get_mmu_str(void) - - static int __die(const char *str, struct pt_regs *regs, long err) - { -+ const char *pr = ""; -+ - printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); - -+ if (IS_ENABLED(CONFIG_PREEMPTION)) -+ pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; -+ - printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n", - IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", - PAGE_SIZE / 1024, get_mmu_str(), -- IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", -+ pr, - IS_ENABLED(CONFIG_SMP) ? " SMP" : "", - IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", - debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", --- -2.19.1 - diff --git a/features/rt/preempt-Provide-preempt_-_-no-rt-variants.patch b/features/rt/preempt-Provide-preempt_-_-no-rt-variants.patch deleted file mode 100644 index c186b8ae..00000000 --- a/features/rt/preempt-Provide-preempt_-_-no-rt-variants.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 6151dd51e19fcd371b8b3690f38f5065c8ce383b Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 24 Jul 2009 12:38:56 +0200 -Subject: [PATCH 084/191] preempt: Provide preempt_*_(no)rt variants - -RT needs a few preempt_disable/enable points which are not necessary -otherwise. Implement variants to avoid #ifdeffery. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/preempt.h | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index 4d244e295e85..5ceac863e729 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -188,7 +188,11 @@ do { \ - preempt_count_dec(); \ - } while (0) - --#define preempt_enable_no_resched() sched_preempt_enable_no_resched() -+#ifdef CONFIG_PREEMPT_RT -+# define preempt_enable_no_resched() sched_preempt_enable_no_resched() -+#else -+# define preempt_enable_no_resched() preempt_enable() -+#endif - - #define preemptible() (preempt_count() == 0 && !irqs_disabled()) - -@@ -282,6 +286,18 @@ do { \ - set_preempt_need_resched(); \ - } while (0) - -+#ifdef CONFIG_PREEMPT_RT -+# define preempt_disable_rt() preempt_disable() -+# define preempt_enable_rt() preempt_enable() -+# define preempt_disable_nort() barrier() -+# define preempt_enable_nort() barrier() -+#else -+# define preempt_disable_rt() barrier() -+# define preempt_enable_rt() barrier() -+# define preempt_disable_nort() preempt_disable() -+# define preempt_enable_nort() preempt_enable() -+#endif -+ - #ifdef CONFIG_PREEMPT_NOTIFIERS - - struct preempt_notifier; --- -2.19.1 - diff --git a/features/rt/printk-add-console-handover.patch b/features/rt/printk-add-console-handover.patch deleted file mode 100644 index bb55e3b1..00000000 --- a/features/rt/printk-add-console-handover.patch +++ /dev/null @@ -1,75 +0,0 @@ -From a87105bd119478687e8f73298fd74f6594f922ad Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:09 +0106 -Subject: [PATCH 032/191] printk: add console handover - -If earlyprintk is used, a boot console will print directly to the -console immediately. The boot console will unregister itself as soon -as a non-boot console registers. However, the non-boot console does -not begin printing until its kthread has started. Since this happens -much later, there is a long pause in the console output. If the -ringbuffer is small, messages could even be dropped during the -pause. - -Add a new CON_HANDOVER console flag to be used internally by printk -in order to track which non-boot console took over from a boot -console. If handover consoles have implemented write_atomic(), they -are allowed to print directly to the console until their kthread can -take over. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/console.h | 1 + - kernel/printk/printk.c | 8 +++++++- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/include/linux/console.h b/include/linux/console.h -index b370e37a6d49..69bfff368294 100644 ---- a/include/linux/console.h -+++ b/include/linux/console.h -@@ -137,6 +137,7 @@ static inline int con_debug_leave(void) - #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ - #define CON_BRL (32) /* Used for a braille device */ - #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ -+#define CON_HANDOVER (128) /* Device was previously a boot console. */ - - struct console { - char name[16]; -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index d1b25ac5c73b..ee34245bf08a 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1726,6 +1726,8 @@ static bool console_can_sync(struct console *con) - return false; - if (con->write_atomic && kernel_sync_mode()) - return true; -+ if (con->write_atomic && (con->flags & CON_HANDOVER) && !con->thread) -+ return true; - if (con->write && (con->flags & CON_BOOT) && !con->thread) - return true; - return false; -@@ -1737,6 +1739,8 @@ static bool call_sync_console_driver(struct console *con, const char *text, size - return false; - if (con->write_atomic && kernel_sync_mode()) - con->write_atomic(con, text, text_len); -+ else if (con->write_atomic && (con->flags & CON_HANDOVER) && !con->thread) -+ con->write_atomic(con, text, text_len); - else if (con->write && (con->flags & CON_BOOT) && !con->thread) - con->write(con, text, text_len); - else -@@ -2829,8 +2833,10 @@ void register_console(struct console *newcon) - * the real console are the same physical device, it's annoying to - * see the beginning boot messages twice - */ -- if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) -+ if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV)) { - newcon->flags &= ~CON_PRINTBUFFER; -+ newcon->flags |= CON_HANDOVER; -+ } - - /* - * Put this console in the list - keep the --- -2.19.1 - diff --git a/features/rt/printk-add-pr_flush.patch b/features/rt/printk-add-pr_flush.patch deleted file mode 100644 index 727a046d..00000000 --- a/features/rt/printk-add-pr_flush.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 36974665afc2e7e5cfc1e1d802fbb1d9eb17a510 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:10 +0106 -Subject: [PATCH 033/191] printk: add pr_flush() - -Provide a function to allow waiting for console printers to catch -up to the latest logged message. - -Use pr_flush() to give console printers a chance to finish in -critical situations if no atomic console is available. For now -pr_flush() is only used in the most common error paths: -panic(), print_oops_end_marker(), report_bug(), kmsg_dump(). - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/printk.h | 2 ++ - kernel/panic.c | 28 +++++++++------ - kernel/printk/printk.c | 79 ++++++++++++++++++++++++++++++++++++++++++ - lib/bug.c | 1 + - 4 files changed, 99 insertions(+), 11 deletions(-) - -diff --git a/include/linux/printk.h b/include/linux/printk.h -index 153212445b68..7e4352467d83 100644 ---- a/include/linux/printk.h -+++ b/include/linux/printk.h -@@ -481,6 +481,8 @@ extern int kptr_restrict; - no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) - #endif - -+bool pr_flush(int timeout_ms, bool reset_on_progress); -+ - /* - * ratelimited messages with local ratelimit_state, - * no local ratelimit_state used in the !PRINTK case -diff --git a/kernel/panic.c b/kernel/panic.c -index c722faaae44b..678529917d5d 100644 ---- a/kernel/panic.c -+++ b/kernel/panic.c -@@ -177,12 +177,28 @@ static void panic_print_sys_info(void) - void panic(const char *fmt, ...) - { - static char buf[1024]; -+ va_list args2; - va_list args; - long i, i_next = 0, len; - int state = 0; - int old_cpu, this_cpu; - bool _crash_kexec_post_notifiers = crash_kexec_post_notifiers; - -+ console_verbose(); -+ pr_emerg("Kernel panic - not syncing:\n"); -+ va_start(args2, fmt); -+ va_copy(args, args2); -+ vprintk(fmt, args2); -+ va_end(args2); -+#ifdef CONFIG_DEBUG_BUGVERBOSE -+ /* -+ * Avoid nested stack-dumping if a panic occurs during oops processing -+ */ -+ if (!test_taint(TAINT_DIE) && oops_in_progress <= 1) -+ dump_stack(); -+#endif -+ pr_flush(1000, true); -+ - /* - * Disable local interrupts. This will prevent panic_smp_self_stop - * from deadlocking the first cpu that invokes the panic, since -@@ -213,24 +229,13 @@ void panic(const char *fmt, ...) - if (old_cpu != PANIC_CPU_INVALID && old_cpu != this_cpu) - panic_smp_self_stop(); - -- console_verbose(); - bust_spinlocks(1); -- va_start(args, fmt); - len = vscnprintf(buf, sizeof(buf), fmt, args); - va_end(args); - - if (len && buf[len - 1] == '\n') - buf[len - 1] = '\0'; - -- pr_emerg("Kernel panic - not syncing: %s\n", buf); --#ifdef CONFIG_DEBUG_BUGVERBOSE -- /* -- * Avoid nested stack-dumping if a panic occurs during oops processing -- */ -- if (!test_taint(TAINT_DIE) && oops_in_progress <= 1) -- dump_stack(); --#endif -- - /* - * If kgdb is enabled, give it a chance to run before we stop all - * the other CPUs or else we won't be able to debug processes left -@@ -552,6 +557,7 @@ static void print_oops_end_marker(void) - { - init_oops_id(); - pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id); -+ pr_flush(1000, true); - } - - /* -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index ee34245bf08a..a5fc854977bb 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3228,6 +3228,12 @@ void kmsg_dump(enum kmsg_dump_reason reason) - sync_mode = true; - pr_info("enabled sync mode\n"); - } -+ -+ /* -+ * Give the printing threads time to flush, allowing up to -+ * 1s of no printing forward progress before giving up. -+ */ -+ pr_flush(1000, true); - } - - rcu_read_lock(); -@@ -3507,3 +3513,76 @@ void console_atomic_unlock(unsigned int flags) - prb_unlock(&printk_cpulock, flags); - } - EXPORT_SYMBOL(console_atomic_unlock); -+ -+static void pr_msleep(bool may_sleep, int ms) -+{ -+ if (may_sleep) { -+ msleep(ms); -+ } else { -+ while (ms--) -+ udelay(1000); -+ } -+} -+ -+/** -+ * pr_flush() - Wait for printing threads to catch up. -+ * -+ * @timeout_ms: The maximum time (in ms) to wait. -+ * @reset_on_progress: Reset the timeout if forward progress is seen. -+ * -+ * A value of 0 for @timeout_ms means no waiting will occur. A value of -1 -+ * represents infinite waiting. -+ * -+ * If @reset_on_progress is true, the timeout will be reset whenever any -+ * printer has been seen to make some forward progress. -+ * -+ * Context: Any context. -+ * Return: true if all enabled printers are caught up. -+ */ -+bool pr_flush(int timeout_ms, bool reset_on_progress) -+{ -+ int remaining = timeout_ms; -+ struct console *con; -+ u64 last_diff = 0; -+ bool may_sleep; -+ u64 printk_seq; -+ u64 diff; -+ u64 seq; -+ -+ may_sleep = (preemptible() && !in_softirq()); -+ -+ seq = prb_next_seq(prb); -+ -+ for (;;) { -+ diff = 0; -+ -+ for_each_console(con) { -+ if (!(con->flags & CON_ENABLED)) -+ continue; -+ printk_seq = atomic64_read(&con->printk_seq); -+ if (printk_seq < seq) -+ diff += seq - printk_seq; -+ } -+ -+ if (diff != last_diff && reset_on_progress) -+ remaining = timeout_ms; -+ -+ if (!diff || remaining == 0) -+ break; -+ -+ if (remaining < 0) { -+ pr_msleep(may_sleep, 100); -+ } else if (remaining < 100) { -+ pr_msleep(may_sleep, remaining); -+ remaining = 0; -+ } else { -+ pr_msleep(may_sleep, 100); -+ remaining -= 100; -+ } -+ -+ last_diff = diff; -+ } -+ -+ return (diff == 0); -+} -+EXPORT_SYMBOL(pr_flush); -diff --git a/lib/bug.c b/lib/bug.c -index 8f9d537bfb2a..8696908372d2 100644 ---- a/lib/bug.c -+++ b/lib/bug.c -@@ -202,6 +202,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) - else - pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n", - (void *)bugaddr); -+ pr_flush(1000, true); - - return BUG_TRAP_TYPE_BUG; - } --- -2.19.1 - diff --git a/features/rt/printk-add-syslog_lock.patch b/features/rt/printk-add-syslog_lock.patch deleted file mode 100644 index 741d96e2..00000000 --- a/features/rt/printk-add-syslog_lock.patch +++ /dev/null @@ -1,158 +0,0 @@ -From 2b8baa6554441c2caba94ff88245cf653796b8cf Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Thu, 10 Dec 2020 16:58:02 +0106 -Subject: [PATCH 014/191] printk: add syslog_lock - -The global variables @syslog_seq, @syslog_partial, @syslog_time -and write access to @clear_seq are protected by @logbuf_lock. -Once @logbuf_lock is removed, these variables will need their -own synchronization method. Introduce @syslog_lock for this -purpose. - -@syslog_lock is a raw_spin_lock for now. This simplifies the -transition to removing @logbuf_lock. Once @logbuf_lock and the -safe buffers are removed, @syslog_lock can change to spin_lock. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 41 +++++++++++++++++++++++++++++++++++++---- - 1 file changed, 37 insertions(+), 4 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 0031bb2156d1..713d09843d23 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -390,8 +390,12 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); - printk_safe_exit_irqrestore(flags); \ - } while (0) - -+/* syslog_lock protects syslog_* variables and write access to clear_seq. */ -+static DEFINE_RAW_SPINLOCK(syslog_lock); -+ - #ifdef CONFIG_PRINTK - DECLARE_WAIT_QUEUE_HEAD(log_wait); -+/* All 3 protected by @syslog_lock. */ - /* the next printk record to read by syslog(READ) or /proc/kmsg */ - static u64 syslog_seq; - static size_t syslog_partial; -@@ -410,7 +414,7 @@ struct latched_seq { - /* - * The next printk record to read after the last 'clear' command. There are - * two copies (updated with seqcount_latch) so that reads can locklessly -- * access a valid value. Writers are synchronized by @logbuf_lock. -+ * access a valid value. Writers are synchronized by @syslog_lock. - */ - static struct latched_seq clear_seq = { - .latch = SEQCNT_LATCH_ZERO(clear_seq.latch), -@@ -470,7 +474,7 @@ bool printk_percpu_data_ready(void) - return __printk_percpu_data_ready; - } - --/* Must be called under logbuf_lock. */ -+/* Must be called under syslog_lock. */ - static void latched_seq_write(struct latched_seq *ls, u64 val) - { - raw_write_seqcount_latch(&ls->latch); -@@ -1529,7 +1533,9 @@ static int syslog_print(char __user *buf, int size) - size_t skip; - - logbuf_lock_irq(); -+ raw_spin_lock(&syslog_lock); - if (!prb_read_valid(prb, syslog_seq, &r)) { -+ raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - break; - } -@@ -1559,6 +1565,7 @@ static int syslog_print(char __user *buf, int size) - syslog_partial += n; - } else - n = 0; -+ raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - - if (!n) -@@ -1625,8 +1632,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - break; - } - -- if (clear) -+ if (clear) { -+ raw_spin_lock(&syslog_lock); - latched_seq_write(&clear_seq, seq); -+ raw_spin_unlock(&syslog_lock); -+ } - logbuf_unlock_irq(); - - kfree(text); -@@ -1636,10 +1646,24 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - static void syslog_clear(void) - { - logbuf_lock_irq(); -+ raw_spin_lock(&syslog_lock); - latched_seq_write(&clear_seq, prb_next_seq(prb)); -+ raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - } - -+/* Return a consistent copy of @syslog_seq. */ -+static u64 read_syslog_seq_irq(void) -+{ -+ u64 seq; -+ -+ raw_spin_lock_irq(&syslog_lock); -+ seq = syslog_seq; -+ raw_spin_unlock_irq(&syslog_lock); -+ -+ return seq; -+} -+ - int do_syslog(int type, char __user *buf, int len, int source) - { - struct printk_info info; -@@ -1663,8 +1687,9 @@ int do_syslog(int type, char __user *buf, int len, int source) - return 0; - if (!access_ok(buf, len)) - return -EFAULT; -+ - error = wait_event_interruptible(log_wait, -- prb_read_valid(prb, syslog_seq, NULL)); -+ prb_read_valid(prb, read_syslog_seq_irq(), NULL)); - if (error) - return error; - error = syslog_print(buf, len); -@@ -1713,8 +1738,10 @@ int do_syslog(int type, char __user *buf, int len, int source) - /* Number of chars in the log buffer */ - case SYSLOG_ACTION_SIZE_UNREAD: - logbuf_lock_irq(); -+ raw_spin_lock(&syslog_lock); - if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { - /* No unread messages. */ -+ raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - return 0; - } -@@ -1743,6 +1770,7 @@ int do_syslog(int type, char __user *buf, int len, int source) - } - error -= syslog_partial; - } -+ raw_spin_unlock(&syslog_lock); - logbuf_unlock_irq(); - break; - /* Size of the log buffer */ -@@ -2992,7 +3020,12 @@ void register_console(struct console *newcon) - */ - exclusive_console = newcon; - exclusive_console_stop_seq = console_seq; -+ -+ /* Get a consistent copy of @syslog_seq. */ -+ raw_spin_lock(&syslog_lock); - console_seq = syslog_seq; -+ raw_spin_unlock(&syslog_lock); -+ - logbuf_unlock_irqrestore(flags); - } - console_unlock(); --- -2.19.1 - diff --git a/features/rt/printk-change-console_seq-to-atomic64_t.patch b/features/rt/printk-change-console_seq-to-atomic64_t.patch deleted file mode 100644 index 36f793a1..00000000 --- a/features/rt/printk-change-console_seq-to-atomic64_t.patch +++ /dev/null @@ -1,131 +0,0 @@ -From b90a5d78be04a9b45524b66bd55a22e56f247633 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:05 +0106 -Subject: [PATCH 028/191] printk: change @console_seq to atomic64_t - -In preparation for atomic printing, change @console_seq to atomic -so that it can be accessed without requiring @console_sem. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 34 +++++++++++++++++++--------------- - 1 file changed, 19 insertions(+), 15 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 2b13deb971b9..28bd7a7807bc 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -366,12 +366,13 @@ static u64 syslog_seq; - static size_t syslog_partial; - static bool syslog_time; - --/* All 3 protected by @console_sem. */ --/* the next printk record to write to the console */ --static u64 console_seq; -+/* Both protected by @console_sem. */ - static u64 exclusive_console_stop_seq; - static unsigned long console_dropped; - -+/* the next printk record to write to the console */ -+static atomic64_t console_seq = ATOMIC64_INIT(0); -+ - struct latched_seq { - seqcount_latch_t latch; - u64 val[2]; -@@ -2270,7 +2271,7 @@ EXPORT_SYMBOL(printk); - #define prb_first_valid_seq(rb) 0 - - static u64 syslog_seq; --static u64 console_seq; -+static atomic64_t console_seq = ATOMIC64_INIT(0); - static u64 exclusive_console_stop_seq; - static unsigned long console_dropped; - -@@ -2585,6 +2586,7 @@ void console_unlock(void) - bool do_cond_resched, retry; - struct printk_info info; - struct printk_record r; -+ u64 seq; - - if (console_suspended) { - up_console_sem(); -@@ -2627,12 +2629,14 @@ void console_unlock(void) - size_t len; - - skip: -- if (!prb_read_valid(prb, console_seq, &r)) -+ seq = atomic64_read(&console_seq); -+ if (!prb_read_valid(prb, seq, &r)) - break; - -- if (console_seq != r.info->seq) { -- console_dropped += r.info->seq - console_seq; -- console_seq = r.info->seq; -+ if (seq != r.info->seq) { -+ console_dropped += r.info->seq - seq; -+ atomic64_set(&console_seq, r.info->seq); -+ seq = r.info->seq; - } - - if (suppress_message_printing(r.info->level)) { -@@ -2641,13 +2645,13 @@ void console_unlock(void) - * directly to the console when we received it, and - * record that has level above the console loglevel. - */ -- console_seq++; -+ atomic64_set(&console_seq, seq + 1); - goto skip; - } - - /* Output to all consoles once old messages replayed. */ - if (unlikely(exclusive_console && -- console_seq >= exclusive_console_stop_seq)) { -+ seq >= exclusive_console_stop_seq)) { - exclusive_console = NULL; - } - -@@ -2668,7 +2672,7 @@ void console_unlock(void) - len = record_print_text(&r, - console_msg_format & MSG_FORMAT_SYSLOG, - printk_time); -- console_seq++; -+ atomic64_set(&console_seq, seq + 1); - - /* - * While actively printing out messages, if another printk() -@@ -2699,7 +2703,7 @@ void console_unlock(void) - * there's a new owner and the console_unlock() from them will do the - * flush, no worries. - */ -- retry = prb_read_valid(prb, console_seq, NULL); -+ retry = prb_read_valid(prb, atomic64_read(&console_seq), NULL); - if (retry && console_trylock()) - goto again; - } -@@ -2762,7 +2766,7 @@ void console_flush_on_panic(enum con_flush_mode mode) - console_may_schedule = 0; - - if (mode == CONSOLE_REPLAY_ALL) -- console_seq = prb_first_valid_seq(prb); -+ atomic64_set(&console_seq, prb_first_valid_seq(prb)); - console_unlock(); - } - -@@ -2999,11 +3003,11 @@ void register_console(struct console *newcon) - * ignores console_lock. - */ - exclusive_console = newcon; -- exclusive_console_stop_seq = console_seq; -+ exclusive_console_stop_seq = atomic64_read(&console_seq); - - /* Get a consistent copy of @syslog_seq. */ - spin_lock_irqsave(&syslog_lock, flags); -- console_seq = syslog_seq; -+ atomic64_set(&console_seq, syslog_seq); - spin_unlock_irqrestore(&syslog_lock, flags); - } - console_unlock(); --- -2.19.1 - diff --git a/features/rt/printk-combine-boot_delay_msec-into-printk_delay.patch b/features/rt/printk-combine-boot_delay_msec-into-printk_delay.patch deleted file mode 100644 index 727ce601..00000000 --- a/features/rt/printk-combine-boot_delay_msec-into-printk_delay.patch +++ /dev/null @@ -1,43 +0,0 @@ -From e26bd5bb048a90ae9dbb91191947709c0bfd7050 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:04 +0106 -Subject: [PATCH 027/191] printk: combine boot_delay_msec() into printk_delay() - -boot_delay_msec() is always called immediately before printk_delay() -so just combine the two. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 84fae4f08634..2b13deb971b9 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1727,8 +1727,10 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) - - int printk_delay_msec __read_mostly; - --static inline void printk_delay(void) -+static inline void printk_delay(int level) - { -+ boot_delay_msec(level); -+ - if (unlikely(printk_delay_msec)) { - int m = printk_delay_msec; - -@@ -2186,8 +2188,7 @@ asmlinkage int vprintk_emit(int facility, int level, - in_sched = true; - } - -- boot_delay_msec(level); -- printk_delay(); -+ printk_delay(level); - - printed_len = vprintk_store(facility, level, dev_info, fmt, args); - --- -2.19.1 - diff --git a/features/rt/printk-console-remove-unnecessary-safe-buffer-usage.patch b/features/rt/printk-console-remove-unnecessary-safe-buffer-usage.patch deleted file mode 100644 index e6861260..00000000 --- a/features/rt/printk-console-remove-unnecessary-safe-buffer-usage.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 158a782478bdf789c7a1797b742fdfb446e27dde Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Wed, 17 Feb 2021 18:28:05 +0100 -Subject: [PATCH 020/191] printk: console: remove unnecessary safe buffer usage - -Upon registering a console, safe buffers are activated when setting -up the sequence number to replay the log. However, these are already -protected by @console_sem and @syslog_lock. Remove the unnecessary -safe buffer usage. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> ---- - kernel/printk/printk.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 15aed1a7bd05..523621889a72 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -2967,9 +2967,7 @@ void register_console(struct console *newcon) - /* - * console_unlock(); will print out the buffered messages - * for us. -- */ -- printk_safe_enter_irqsave(flags); -- /* -+ * - * We're about to replay the log buffer. Only do this to the - * just-registered console to avoid excessive message spam to - * the already-registered consoles. -@@ -2982,11 +2980,9 @@ void register_console(struct console *newcon) - exclusive_console_stop_seq = console_seq; - - /* Get a consistent copy of @syslog_seq. */ -- raw_spin_lock(&syslog_lock); -+ raw_spin_lock_irqsave(&syslog_lock, flags); - console_seq = syslog_seq; -- raw_spin_unlock(&syslog_lock); -- -- printk_safe_exit_irqrestore(flags); -+ raw_spin_unlock_irqrestore(&syslog_lock, flags); - } - console_unlock(); - console_sysfs_notify(); --- -2.19.1 - diff --git a/features/rt/printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch b/features/rt/printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch deleted file mode 100644 index 97ae80c8..00000000 --- a/features/rt/printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch +++ /dev/null @@ -1,146 +0,0 @@ -From b29f148df0ca450ed3a53ed20ca0bdb921c54c9a Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Wed, 13 Jan 2021 11:29:53 +0106 -Subject: [PATCH 010/191] printk: consolidate - kmsg_dump_get_buffer/syslog_print_all code - -The logic for finding records to fit into a buffer is the same for -kmsg_dump_get_buffer() and syslog_print_all(). Introduce a helper -function find_first_fitting_seq() to handle this logic. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> ---- - kernel/printk/printk.c | 87 ++++++++++++++++++++++++------------------ - 1 file changed, 50 insertions(+), 37 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 3f17ff13fd51..ff16a29aa620 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1421,6 +1421,50 @@ static size_t get_record_print_text_size(struct printk_info *info, - return ((prefix_len * line_count) + info->text_len + 1); - } - -+/* -+ * Beginning with @start_seq, find the first record where it and all following -+ * records up to (but not including) @max_seq fit into @size. -+ * -+ * @max_seq is simply an upper bound and does not need to exist. If the caller -+ * does not require an upper bound, -1 can be used for @max_seq. -+ */ -+static u64 find_first_fitting_seq(u64 start_seq, u64 max_seq, size_t size, -+ bool syslog, bool time) -+{ -+ struct printk_info info; -+ unsigned int line_count; -+ size_t len = 0; -+ u64 seq; -+ -+ /* Determine the size of the records up to @max_seq. */ -+ prb_for_each_info(start_seq, prb, seq, &info, &line_count) { -+ if (info.seq >= max_seq) -+ break; -+ len += get_record_print_text_size(&info, line_count, syslog, time); -+ } -+ -+ /* -+ * Adjust the upper bound for the next loop to avoid subtracting -+ * lengths that were never added. -+ */ -+ if (seq < max_seq) -+ max_seq = seq; -+ -+ /* -+ * Move first record forward until length fits into the buffer. Ignore -+ * newest messages that were not counted in the above cycle. Messages -+ * might appear and get lost in the meantime. This is a best effort -+ * that prevents an infinite loop that could occur with a retry. -+ */ -+ prb_for_each_info(start_seq, prb, seq, &info, &line_count) { -+ if (len <= size || info.seq >= max_seq) -+ break; -+ len -= get_record_print_text_size(&info, line_count, syslog, time); -+ } -+ -+ return seq; -+} -+ - static int syslog_print(char __user *buf, int size) - { - struct printk_info info; -@@ -1492,9 +1536,7 @@ static int syslog_print(char __user *buf, int size) - static int syslog_print_all(char __user *buf, int size, bool clear) - { - struct printk_info info; -- unsigned int line_count; - struct printk_record r; -- u64 max_seq; - char *text; - int len = 0; - u64 seq; -@@ -1510,21 +1552,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - * Find first record that fits, including all following records, - * into the user-provided buffer for this dump. - */ -- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) -- len += get_record_print_text_size(&info, line_count, true, time); -- -- /* -- * Set an upper bound for the next loop to avoid subtracting lengths -- * that were never added. -- */ -- max_seq = seq; -- -- /* move first record forward until length fits into the buffer */ -- prb_for_each_info(clear_seq, prb, seq, &info, &line_count) { -- if (len <= size || info.seq >= max_seq) -- break; -- len -= get_record_print_text_size(&info, line_count, true, time); -- } -+ seq = find_first_fitting_seq(clear_seq, -1, size, true, time); - - prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); - -@@ -3427,7 +3455,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - char *buf, size_t size, size_t *len_out) - { - struct printk_info info; -- unsigned int line_count; - struct printk_record r; - unsigned long flags; - u64 seq; -@@ -3455,26 +3482,12 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - - /* - * Find first record that fits, including all following records, -- * into the user-provided buffer for this dump. -+ * into the user-provided buffer for this dump. Pass in size-1 -+ * because this function (by way of record_print_text()) will -+ * not write more than size-1 bytes of text into @buf. - */ -- -- prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { -- if (info.seq >= dumper->next_seq) -- break; -- len += get_record_print_text_size(&info, line_count, syslog, time); -- } -- -- /* -- * Move first record forward until length fits into the buffer. Ignore -- * newest messages that were not counted in the above cycle. Messages -- * might appear and get lost in the meantime. This is the best effort -- * that prevents an infinite loop. -- */ -- prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { -- if (len < size || info.seq >= dumper->next_seq) -- break; -- len -= get_record_print_text_size(&info, line_count, syslog, time); -- } -+ seq = find_first_fitting_seq(dumper->cur_seq, dumper->next_seq, -+ size - 1, syslog, time); - - /* - * Next kmsg_dump_get_buffer() invocation will dump block of --- -2.19.1 - diff --git a/features/rt/printk-convert-syslog_lock-to-spin_lock.patch b/features/rt/printk-convert-syslog_lock-to-spin_lock.patch deleted file mode 100644 index 611e45b5..00000000 --- a/features/rt/printk-convert-syslog_lock-to-spin_lock.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 3fe6df2a782687f96ec4e6eb1dcaa4b9dcc018ef Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Thu, 18 Feb 2021 17:37:41 +0100 -Subject: [PATCH 023/191] printk: convert @syslog_lock to spin_lock - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 274d4ef05a90..3e0b9bf28e12 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -356,7 +356,7 @@ enum log_flags { - }; - - /* syslog_lock protects syslog_* variables and write access to clear_seq. */ --static DEFINE_RAW_SPINLOCK(syslog_lock); -+static DEFINE_SPINLOCK(syslog_lock); - - #ifdef CONFIG_PRINTK - DECLARE_WAIT_QUEUE_HEAD(log_wait); -@@ -1479,9 +1479,9 @@ static int syslog_print(char __user *buf, int size) - size_t n; - size_t skip; - -- raw_spin_lock_irq(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - if (!prb_read_valid(prb, syslog_seq, &r)) { -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - break; - } - if (r.info->seq != syslog_seq) { -@@ -1510,7 +1510,7 @@ static int syslog_print(char __user *buf, int size) - syslog_partial += n; - } else - n = 0; -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - - if (!n) - break; -@@ -1574,9 +1574,9 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - } - - if (clear) { -- raw_spin_lock_irq(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - latched_seq_write(&clear_seq, seq); -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - } - - kfree(text); -@@ -1585,9 +1585,9 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - - static void syslog_clear(void) - { -- raw_spin_lock_irq(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - latched_seq_write(&clear_seq, prb_next_seq(prb)); -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - } - - /* Return a consistent copy of @syslog_seq. */ -@@ -1595,9 +1595,9 @@ static u64 read_syslog_seq_irq(void) - { - u64 seq; - -- raw_spin_lock_irq(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - seq = syslog_seq; -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - - return seq; - } -@@ -1675,10 +1675,10 @@ int do_syslog(int type, char __user *buf, int len, int source) - break; - /* Number of chars in the log buffer */ - case SYSLOG_ACTION_SIZE_UNREAD: -- raw_spin_lock_irq(&syslog_lock); -+ spin_lock_irq(&syslog_lock); - if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { - /* No unread messages. */ -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - return 0; - } - if (info.seq != syslog_seq) { -@@ -1706,7 +1706,7 @@ int do_syslog(int type, char __user *buf, int len, int source) - } - error -= syslog_partial; - } -- raw_spin_unlock_irq(&syslog_lock); -+ spin_unlock_irq(&syslog_lock); - break; - /* Size of the log buffer */ - case SYSLOG_ACTION_SIZE_BUFFER: -@@ -3001,9 +3001,9 @@ void register_console(struct console *newcon) - exclusive_console_stop_seq = console_seq; - - /* Get a consistent copy of @syslog_seq. */ -- raw_spin_lock_irqsave(&syslog_lock, flags); -+ spin_lock_irqsave(&syslog_lock, flags); - console_seq = syslog_seq; -- raw_spin_unlock_irqrestore(&syslog_lock, flags); -+ spin_unlock_irqrestore(&syslog_lock, flags); - } - console_unlock(); - console_sysfs_notify(); --- -2.19.1 - diff --git a/features/rt/printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch b/features/rt/printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch deleted file mode 100644 index 70b8eafb..00000000 --- a/features/rt/printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch +++ /dev/null @@ -1,94 +0,0 @@ -From f0d983447bd8059038b24361b5698ffec757f812 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Thu, 10 Dec 2020 12:48:01 +0106 -Subject: [PATCH 011/191] printk: introduce CONSOLE_LOG_MAX for improved - multi-line support - -Instead of using "LOG_LINE_MAX + PREFIX_MAX" for temporary buffer -sizes, introduce CONSOLE_LOG_MAX. This represents the maximum size -that is allowed to be printed to the console for a single record. - -Rather than setting CONSOLE_LOG_MAX to "LOG_LINE_MAX + PREFIX_MAX" -(1024), increase it to 4096. With a larger buffer size, multi-line -records that are nearly LOG_LINE_MAX in length will have a better -chance of being fully printed. (When formatting a record for the -console, each line of a multi-line record is prepended with a copy -of the prefix.) - -Signed-off-by: John Ogness <john.ogness@linutronix.de> ---- - kernel/printk/printk.c | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index ff16a29aa620..8a903faaec4e 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -410,8 +410,13 @@ static u64 clear_seq; - #else - #define PREFIX_MAX 32 - #endif -+ -+/* the maximum size allowed to be reserved for a record */ - #define LOG_LINE_MAX (1024 - PREFIX_MAX) - -+/* the maximum size of a formatted record (i.e. with prefix added per line) */ -+#define CONSOLE_LOG_MAX 4096 -+ - #define LOG_LEVEL(v) ((v) & 0x07) - #define LOG_FACILITY(v) ((v) >> 3 & 0xff) - -@@ -1472,11 +1477,11 @@ static int syslog_print(char __user *buf, int size) - char *text; - int len = 0; - -- text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); -+ text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL); - if (!text) - return -ENOMEM; - -- prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); -+ prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX); - - while (size > 0) { - size_t n; -@@ -1542,7 +1547,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - u64 seq; - bool time; - -- text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); -+ text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL); - if (!text) - return -ENOMEM; - -@@ -1554,7 +1559,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - */ - seq = find_first_fitting_seq(clear_seq, -1, size, true, time); - -- prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); -+ prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX); - - len = 0; - prb_for_each_record(seq, prb, seq, &r) { -@@ -2187,8 +2192,7 @@ EXPORT_SYMBOL(printk); - - #else /* CONFIG_PRINTK */ - --#define LOG_LINE_MAX 0 --#define PREFIX_MAX 0 -+#define CONSOLE_LOG_MAX 0 - #define printk_time false - - #define prb_read_valid(rb, seq, r) false -@@ -2506,7 +2510,7 @@ static inline int can_use_console(void) - void console_unlock(void) - { - static char ext_text[CONSOLE_EXT_LOG_MAX]; -- static char text[LOG_LINE_MAX + PREFIX_MAX]; -+ static char text[CONSOLE_LOG_MAX]; - unsigned long flags; - bool do_cond_resched, retry; - struct printk_info info; --- -2.19.1 - diff --git a/features/rt/printk-introduce-a-kmsg_dump-iterator.patch b/features/rt/printk-introduce-a-kmsg_dump-iterator.patch deleted file mode 100644 index cab5a8ea..00000000 --- a/features/rt/printk-introduce-a-kmsg_dump-iterator.patch +++ /dev/null @@ -1,560 +0,0 @@ -From b20f5eb741807f3e89ae444f82f7a4f3d76affb1 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Fri, 18 Dec 2020 11:40:08 +0000 -Subject: [PATCH 015/191] printk: introduce a kmsg_dump iterator - -Rather than store the iterator information into the registered -kmsg_dump structure, create a separate iterator structure. The -kmsg_dump_iter structure can reside on the stack of the caller, -thus allowing lockless use of the kmsg_dump functions. - -This is in preparation for removal of @logbuf_lock. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/kernel/nvram_64.c | 12 ++-- - arch/powerpc/platforms/powernv/opal-kmsg.c | 3 +- - arch/powerpc/xmon/xmon.c | 6 +- - arch/um/kernel/kmsg_dump.c | 5 +- - drivers/hv/vmbus_drv.c | 5 +- - drivers/mtd/mtdoops.c | 5 +- - fs/pstore/platform.c | 5 +- - include/linux/kmsg_dump.h | 43 +++++++------- - kernel/debug/kdb/kdb_main.c | 10 ++-- - kernel/printk/printk.c | 65 +++++++++++----------- - 10 files changed, 84 insertions(+), 75 deletions(-) - -diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c -index 532f22637783..1ef55f4b389a 100644 ---- a/arch/powerpc/kernel/nvram_64.c -+++ b/arch/powerpc/kernel/nvram_64.c -@@ -73,7 +73,8 @@ static const char *nvram_os_partitions[] = { - }; - - static void oops_to_nvram(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason); -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter); - - static struct kmsg_dumper nvram_kmsg_dumper = { - .dump = oops_to_nvram -@@ -643,7 +644,8 @@ void __init nvram_init_oops_partition(int rtas_partition_exists) - * partition. If that's too much, go back and capture uncompressed text. - */ - static void oops_to_nvram(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - struct oops_log_info *oops_hdr = (struct oops_log_info *)oops_buf; - static unsigned int oops_count = 0; -@@ -681,13 +683,13 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, - return; - - if (big_oops_buf) { -- kmsg_dump_get_buffer(dumper, false, -+ kmsg_dump_get_buffer(iter, false, - big_oops_buf, big_oops_buf_sz, &text_len); - rc = zip_oops(text_len); - } - if (rc != 0) { -- kmsg_dump_rewind(dumper); -- kmsg_dump_get_buffer(dumper, false, -+ kmsg_dump_rewind(iter); -+ kmsg_dump_get_buffer(iter, false, - oops_data, oops_data_sz, &text_len); - err_type = ERR_TYPE_KERNEL_PANIC; - oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); -diff --git a/arch/powerpc/platforms/powernv/opal-kmsg.c b/arch/powerpc/platforms/powernv/opal-kmsg.c -index 6c3bc4b4da98..ec862846bc82 100644 ---- a/arch/powerpc/platforms/powernv/opal-kmsg.c -+++ b/arch/powerpc/platforms/powernv/opal-kmsg.c -@@ -20,7 +20,8 @@ - * message, it just ensures that OPAL completely flushes the console buffer. - */ - static void kmsg_dump_opal_console_flush(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - /* - * Outside of a panic context the pollers will continue to run, -diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c -index 3fe37495f63d..900882f90431 100644 ---- a/arch/powerpc/xmon/xmon.c -+++ b/arch/powerpc/xmon/xmon.c -@@ -3001,7 +3001,7 @@ print_address(unsigned long addr) - static void - dump_log_buf(void) - { -- struct kmsg_dumper dumper = { .active = 1 }; -+ struct kmsg_dumper_iter iter = { .active = 1 }; - unsigned char buf[128]; - size_t len; - -@@ -3013,9 +3013,9 @@ dump_log_buf(void) - catch_memory_errors = 1; - sync(); - -- kmsg_dump_rewind_nolock(&dumper); -+ kmsg_dump_rewind_nolock(&iter); - xmon_start_pagination(); -- while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) { -+ while (kmsg_dump_get_line_nolock(&iter, false, buf, sizeof(buf), &len)) { - buf[len] = '\0'; - printf("%s", buf); - } -diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c -index 6516ef1f8274..78befecb79d2 100644 ---- a/arch/um/kernel/kmsg_dump.c -+++ b/arch/um/kernel/kmsg_dump.c -@@ -7,7 +7,8 @@ - #include <os.h> - - static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - static char line[1024]; - struct console *con; -@@ -30,7 +31,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, - return; - - printf("kmsg_dump:\n"); -- while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) { -+ while (kmsg_dump_get_line(iter, true, line, sizeof(line), &len)) { - line[len] = '\0'; - printf("%s", line); - } -diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c -index 10dce9f91216..806950bc3c1d 100644 ---- a/drivers/hv/vmbus_drv.c -+++ b/drivers/hv/vmbus_drv.c -@@ -1389,7 +1389,8 @@ static void vmbus_isr(void) - * buffer and call into Hyper-V to transfer the data. - */ - static void hv_kmsg_dump(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - size_t bytes_written; - phys_addr_t panic_pa; -@@ -1404,7 +1405,7 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, - * Write dump contents to the page. No need to synchronize; panic should - * be single-threaded. - */ -- kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE, -+ kmsg_dump_get_buffer(iter, false, hv_panic_page, HV_HYP_PAGE_SIZE, - &bytes_written); - if (bytes_written) - hyperv_report_panic_msg(panic_pa, bytes_written); -diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c -index 774970bfcf85..6bc2c728adb7 100644 ---- a/drivers/mtd/mtdoops.c -+++ b/drivers/mtd/mtdoops.c -@@ -267,7 +267,8 @@ static void find_next_position(struct mtdoops_context *cxt) - } - - static void mtdoops_do_dump(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - struct mtdoops_context *cxt = container_of(dumper, - struct mtdoops_context, dump); -@@ -276,7 +277,7 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper, - if (reason == KMSG_DUMP_OOPS && !dump_oops) - return; - -- kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, -+ kmsg_dump_get_buffer(iter, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, - record_size - MTDOOPS_HEADER_SIZE, NULL); - - if (reason != KMSG_DUMP_OOPS) { -diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c -index d963ae7902f9..b90fedcc1716 100644 ---- a/fs/pstore/platform.c -+++ b/fs/pstore/platform.c -@@ -383,7 +383,8 @@ void pstore_record_init(struct pstore_record *record, - * end of the buffer. - */ - static void pstore_dump(struct kmsg_dumper *dumper, -- enum kmsg_dump_reason reason) -+ enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter) - { - unsigned long total = 0; - const char *why; -@@ -435,7 +436,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, - dst_size -= header_size; - - /* Write dump contents. */ -- if (!kmsg_dump_get_buffer(dumper, true, dst + header_size, -+ if (!kmsg_dump_get_buffer(iter, true, dst + header_size, - dst_size, &dump_size)) - break; - -diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h -index 4095a34db0fa..2fdb10ab1799 100644 ---- a/include/linux/kmsg_dump.h -+++ b/include/linux/kmsg_dump.h -@@ -29,6 +29,18 @@ enum kmsg_dump_reason { - KMSG_DUMP_MAX - }; - -+/** -+ * struct kmsg_dumper_iter - iterator for kernel crash message dumper -+ * @active: Flag that specifies if this is currently dumping -+ * @cur_seq: Points to the oldest message to dump (private) -+ * @next_seq: Points after the newest message to dump (private) -+ */ -+struct kmsg_dumper_iter { -+ bool active; -+ u64 cur_seq; -+ u64 next_seq; -+}; -+ - /** - * struct kmsg_dumper - kernel crash message dumper structure - * @list: Entry in the dumper list (private) -@@ -36,37 +48,30 @@ enum kmsg_dump_reason { - * through the record iterator - * @max_reason: filter for highest reason number that should be dumped - * @registered: Flag that specifies if this is already registered -- * @active: Flag that specifies if this is currently dumping -- * @cur_seq: Points to the oldest message to dump (private) -- * @next_seq: Points after the newest message to dump (private) - */ - struct kmsg_dumper { - struct list_head list; -- void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason); -+ void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason, -+ struct kmsg_dumper_iter *iter); - enum kmsg_dump_reason max_reason; -- bool active; - bool registered; -- -- /* private state of the kmsg iterator */ -- u64 cur_seq; -- u64 next_seq; - }; - - #ifdef CONFIG_PRINTK - void kmsg_dump(enum kmsg_dump_reason reason); - --bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, - char *line, size_t size, size_t *len); - --bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - char *line, size_t size, size_t *len); - --bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - char *buf, size_t size, size_t *len_out); - --void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); -+void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter); - --void kmsg_dump_rewind(struct kmsg_dumper *dumper); -+void kmsg_dump_rewind(struct kmsg_dumper_iter *dumper_iter); - - int kmsg_dump_register(struct kmsg_dumper *dumper); - -@@ -78,30 +83,30 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason) - { - } - --static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, -+static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, - bool syslog, const char *line, - size_t size, size_t *len) - { - return false; - } - --static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, -+static inline bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - const char *line, size_t size, size_t *len) - { - return false; - } - --static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, -+static inline bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - char *buf, size_t size, size_t *len) - { - return false; - } - --static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) -+static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) - { - } - --static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) -+static inline void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - { - } - -diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c -index 930ac1b25ec7..7ae9da245e4b 100644 ---- a/kernel/debug/kdb/kdb_main.c -+++ b/kernel/debug/kdb/kdb_main.c -@@ -2101,7 +2101,7 @@ static int kdb_dmesg(int argc, const char **argv) - int adjust = 0; - int n = 0; - int skip = 0; -- struct kmsg_dumper dumper = { .active = 1 }; -+ struct kmsg_dumper_iter iter = { .active = 1 }; - size_t len; - char buf[201]; - -@@ -2126,8 +2126,8 @@ static int kdb_dmesg(int argc, const char **argv) - kdb_set(2, setargs); - } - -- kmsg_dump_rewind_nolock(&dumper); -- while (kmsg_dump_get_line_nolock(&dumper, 1, NULL, 0, NULL)) -+ kmsg_dump_rewind_nolock(&iter); -+ while (kmsg_dump_get_line_nolock(&iter, 1, NULL, 0, NULL)) - n++; - - if (lines < 0) { -@@ -2159,8 +2159,8 @@ static int kdb_dmesg(int argc, const char **argv) - if (skip >= n || skip < 0) - return 0; - -- kmsg_dump_rewind_nolock(&dumper); -- while (kmsg_dump_get_line_nolock(&dumper, 1, buf, sizeof(buf), &len)) { -+ kmsg_dump_rewind_nolock(&iter); -+ while (kmsg_dump_get_line_nolock(&iter, 1, buf, sizeof(buf), &len)) { - if (skip) { - skip--; - continue; -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 713d09843d23..7d426c5dcec6 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3389,6 +3389,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_reason_str); - */ - void kmsg_dump(enum kmsg_dump_reason reason) - { -+ struct kmsg_dumper_iter iter; - struct kmsg_dumper *dumper; - unsigned long flags; - -@@ -3408,25 +3409,21 @@ void kmsg_dump(enum kmsg_dump_reason reason) - continue; - - /* initialize iterator with data about the stored records */ -- dumper->active = true; -- -+ iter.active = true; - logbuf_lock_irqsave(flags); -- dumper->cur_seq = latched_seq_read_nolock(&clear_seq); -- dumper->next_seq = prb_next_seq(prb); -+ iter.cur_seq = latched_seq_read_nolock(&clear_seq); -+ iter.next_seq = prb_next_seq(prb); - logbuf_unlock_irqrestore(flags); - - /* invoke dumper which will iterate over records */ -- dumper->dump(dumper, reason); -- -- /* reset iterator */ -- dumper->active = false; -+ dumper->dump(dumper, reason, &iter); - } - rcu_read_unlock(); - } - - /** - * kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version) -- * @dumper: registered kmsg dumper -+ * @iter: kmsg dumper iterator - * @syslog: include the "<4>" prefixes - * @line: buffer to copy the line to - * @size: maximum size of the buffer -@@ -3443,7 +3440,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) - * - * The function is similar to kmsg_dump_get_line(), but grabs no locks. - */ --bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, - char *line, size_t size, size_t *len) - { - struct printk_info info; -@@ -3454,16 +3451,16 @@ bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, - - prb_rec_init_rd(&r, &info, line, size); - -- if (!dumper->active) -+ if (!iter->active) - goto out; - - /* Read text or count text lines? */ - if (line) { -- if (!prb_read_valid(prb, dumper->cur_seq, &r)) -+ if (!prb_read_valid(prb, iter->cur_seq, &r)) - goto out; - l = record_print_text(&r, syslog, printk_time); - } else { -- if (!prb_read_valid_info(prb, dumper->cur_seq, -+ if (!prb_read_valid_info(prb, iter->cur_seq, - &info, &line_count)) { - goto out; - } -@@ -3472,7 +3469,7 @@ bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, - - } - -- dumper->cur_seq = r.info->seq + 1; -+ iter->cur_seq = r.info->seq + 1; - ret = true; - out: - if (len) -@@ -3482,7 +3479,7 @@ bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, - - /** - * kmsg_dump_get_line - retrieve one kmsg log line -- * @dumper: registered kmsg dumper -+ * @iter: kmsg dumper iterator - * @syslog: include the "<4>" prefixes - * @line: buffer to copy the line to - * @size: maximum size of the buffer -@@ -3497,14 +3494,14 @@ bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, - * A return value of FALSE indicates that there are no more records to - * read. - */ --bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - char *line, size_t size, size_t *len) - { - unsigned long flags; - bool ret; - - logbuf_lock_irqsave(flags); -- ret = kmsg_dump_get_line_nolock(dumper, syslog, line, size, len); -+ ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); - logbuf_unlock_irqrestore(flags); - - return ret; -@@ -3513,7 +3510,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); - - /** - * kmsg_dump_get_buffer - copy kmsg log lines -- * @dumper: registered kmsg dumper -+ * @iter: kmsg dumper iterator - * @syslog: include the "<4>" prefixes - * @buf: buffer to copy the line to - * @size: maximum size of the buffer -@@ -3530,7 +3527,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); - * A return value of FALSE indicates that there are no more records to - * read. - */ --bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, -+bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - char *buf, size_t size, size_t *len_out) - { - struct printk_info info; -@@ -3542,19 +3539,19 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - bool ret = false; - bool time = printk_time; - -- if (!dumper->active || !buf || !size) -+ if (!iter->active || !buf || !size) - goto out; - - logbuf_lock_irqsave(flags); -- if (prb_read_valid_info(prb, dumper->cur_seq, &info, NULL)) { -- if (info.seq != dumper->cur_seq) { -+ if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { -+ if (info.seq != iter->cur_seq) { - /* messages are gone, move to first available one */ -- dumper->cur_seq = info.seq; -+ iter->cur_seq = info.seq; - } - } - - /* last entry */ -- if (dumper->cur_seq >= dumper->next_seq) { -+ if (iter->cur_seq >= iter->next_seq) { - logbuf_unlock_irqrestore(flags); - goto out; - } -@@ -3565,7 +3562,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - * because this function (by way of record_print_text()) will - * not write more than size-1 bytes of text into @buf. - */ -- seq = find_first_fitting_seq(dumper->cur_seq, dumper->next_seq, -+ seq = find_first_fitting_seq(iter->cur_seq, iter->next_seq, - size - 1, syslog, time); - - /* -@@ -3578,7 +3575,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - - len = 0; - prb_for_each_record(seq, prb, seq, &r) { -- if (r.info->seq >= dumper->next_seq) -+ if (r.info->seq >= iter->next_seq) - break; - - len += record_print_text(&r, syslog, time); -@@ -3587,7 +3584,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - prb_rec_init_rd(&r, &info, buf + len, size - len); - } - -- dumper->next_seq = next_seq; -+ iter->next_seq = next_seq; - ret = true; - logbuf_unlock_irqrestore(flags); - out: -@@ -3599,7 +3596,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); - - /** - * kmsg_dump_rewind_nolock - reset the iterator (unlocked version) -- * @dumper: registered kmsg dumper -+ * @iter: kmsg dumper iterator - * - * Reset the dumper's iterator so that kmsg_dump_get_line() and - * kmsg_dump_get_buffer() can be called again and used multiple -@@ -3607,26 +3604,26 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); - * - * The function is similar to kmsg_dump_rewind(), but grabs no locks. - */ --void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) -+void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) - { -- dumper->cur_seq = latched_seq_read_nolock(&clear_seq); -- dumper->next_seq = prb_next_seq(prb); -+ iter->cur_seq = latched_seq_read_nolock(&clear_seq); -+ iter->next_seq = prb_next_seq(prb); - } - - /** - * kmsg_dump_rewind - reset the iterator -- * @dumper: registered kmsg dumper -+ * @iter: kmsg dumper iterator - * - * Reset the dumper's iterator so that kmsg_dump_get_line() and - * kmsg_dump_get_buffer() can be called again and used multiple - * times within the same dumper.dump() callback. - */ --void kmsg_dump_rewind(struct kmsg_dumper *dumper) -+void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - { - unsigned long flags; - - logbuf_lock_irqsave(flags); -- kmsg_dump_rewind_nolock(dumper); -+ kmsg_dump_rewind_nolock(iter); - logbuf_unlock_irqrestore(flags); - } - EXPORT_SYMBOL_GPL(kmsg_dump_rewind); --- -2.19.1 - diff --git a/features/rt/printk-introduce-kernel-sync-mode.patch b/features/rt/printk-introduce-kernel-sync-mode.patch deleted file mode 100644 index c307bc7e..00000000 --- a/features/rt/printk-introduce-kernel-sync-mode.patch +++ /dev/null @@ -1,308 +0,0 @@ -From 9707df2d67d37317d4ab73abea7213f09100ed53 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:06 +0106 -Subject: [PATCH 029/191] printk: introduce kernel sync mode - -When the kernel performs an OOPS, enter into "sync mode": - -- only atomic consoles (write_atomic() callback) will print -- printing occurs within vprintk_store() instead of console_unlock() - -CONSOLE_LOG_MAX is moved to printk.h to support the per-console -buffer used in sync mode. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/console.h | 4 ++ - include/linux/printk.h | 6 ++ - kernel/printk/printk.c | 133 ++++++++++++++++++++++++++++++++++++++-- - 3 files changed, 137 insertions(+), 6 deletions(-) - -diff --git a/include/linux/console.h b/include/linux/console.h -index 919c8d43d986..1d699d02e99a 100644 ---- a/include/linux/console.h -+++ b/include/linux/console.h -@@ -16,6 +16,7 @@ - - #include <linux/atomic.h> - #include <linux/types.h> -+#include <linux/printk.h> - - struct vc_data; - struct console_font_op; -@@ -150,6 +151,9 @@ struct console { - short flags; - short index; - int cflag; -+#ifdef CONFIG_PRINTK -+ char sync_buf[CONSOLE_LOG_MAX]; -+#endif - void *data; - struct console *next; - }; -diff --git a/include/linux/printk.h b/include/linux/printk.h -index 2476796c1150..1ebd93581acc 100644 ---- a/include/linux/printk.h -+++ b/include/linux/printk.h -@@ -46,6 +46,12 @@ static inline const char *printk_skip_headers(const char *buffer) - - #define CONSOLE_EXT_LOG_MAX 8192 - -+/* -+ * The maximum size of a record formatted for console printing -+ * (i.e. with the prefix prepended to every line). -+ */ -+#define CONSOLE_LOG_MAX 4096 -+ - /* printk's without a loglevel use this.. */ - #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 28bd7a7807bc..4aa402d2df55 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -44,6 +44,7 @@ - #include <linux/irq_work.h> - #include <linux/ctype.h> - #include <linux/uio.h> -+#include <linux/clocksource.h> - #include <linux/sched/clock.h> - #include <linux/sched/debug.h> - #include <linux/sched/task_stack.h> -@@ -359,6 +360,9 @@ enum log_flags { - static DEFINE_SPINLOCK(syslog_lock); - - #ifdef CONFIG_PRINTK -+/* Set to enable sync mode. Once set, it is never cleared. */ -+static bool sync_mode; -+ - DECLARE_WAIT_QUEUE_HEAD(log_wait); - /* All 3 protected by @syslog_lock. */ - /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -398,9 +402,6 @@ static struct latched_seq clear_seq = { - /* the maximum size allowed to be reserved for a record */ - #define LOG_LINE_MAX (1024 - PREFIX_MAX) - --/* the maximum size of a formatted record (i.e. with prefix added per line) */ --#define CONSOLE_LOG_MAX 4096 -- - #define LOG_LEVEL(v) ((v) & 0x07) - #define LOG_FACILITY(v) ((v) >> 3 & 0xff) - -@@ -1742,6 +1743,91 @@ static inline void printk_delay(int level) - } - } - -+static bool kernel_sync_mode(void) -+{ -+ return (oops_in_progress || sync_mode); -+} -+ -+static bool console_can_sync(struct console *con) -+{ -+ if (!(con->flags & CON_ENABLED)) -+ return false; -+ if (con->write_atomic && kernel_sync_mode()) -+ return true; -+ return false; -+} -+ -+static bool call_sync_console_driver(struct console *con, const char *text, size_t text_len) -+{ -+ if (!(con->flags & CON_ENABLED)) -+ return false; -+ if (con->write_atomic && kernel_sync_mode()) -+ con->write_atomic(con, text, text_len); -+ else -+ return false; -+ -+ return true; -+} -+ -+static bool have_atomic_console(void) -+{ -+ struct console *con; -+ -+ for_each_console(con) { -+ if (!(con->flags & CON_ENABLED)) -+ continue; -+ if (con->write_atomic) -+ return true; -+ } -+ return false; -+} -+ -+static bool print_sync(struct console *con, u64 *seq) -+{ -+ struct printk_info info; -+ struct printk_record r; -+ size_t text_len; -+ -+ prb_rec_init_rd(&r, &info, &con->sync_buf[0], sizeof(con->sync_buf)); -+ -+ if (!prb_read_valid(prb, *seq, &r)) -+ return false; -+ -+ text_len = record_print_text(&r, console_msg_format & MSG_FORMAT_SYSLOG, printk_time); -+ -+ if (!call_sync_console_driver(con, &con->sync_buf[0], text_len)) -+ return false; -+ -+ *seq = r.info->seq; -+ -+ touch_softlockup_watchdog_sync(); -+ clocksource_touch_watchdog(); -+ rcu_cpu_stall_reset(); -+ touch_nmi_watchdog(); -+ -+ if (text_len) -+ printk_delay(r.info->level); -+ -+ return true; -+} -+ -+static void print_sync_until(struct console *con, u64 seq) -+{ -+ unsigned int flags; -+ u64 printk_seq; -+ -+ console_atomic_lock(&flags); -+ for (;;) { -+ printk_seq = atomic64_read(&console_seq); -+ if (printk_seq >= seq) -+ break; -+ if (!print_sync(con, &printk_seq)) -+ break; -+ atomic64_set(&console_seq, printk_seq + 1); -+ } -+ console_atomic_unlock(flags); -+} -+ - /* - * Special console_lock variants that help to reduce the risk of soft-lockups. - * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1916,6 +2002,8 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, - if (!cpu_online(smp_processor_id()) && - !(con->flags & CON_ANYTIME)) - continue; -+ if (kernel_sync_mode()) -+ continue; - if (con->flags & CON_EXTENDED) - con->write(con, ext_text, ext_len); - else { -@@ -2070,6 +2158,7 @@ int vprintk_store(int facility, int level, - const u32 caller_id = printk_caller_id(); - struct prb_reserved_entry e; - enum log_flags lflags = 0; -+ bool final_commit = false; - struct printk_record r; - unsigned long irqflags; - u16 trunc_msg_len = 0; -@@ -2079,6 +2168,7 @@ int vprintk_store(int facility, int level, - u16 text_len; - int ret = 0; - u64 ts_nsec; -+ u64 seq; - - /* - * Since the duration of printk() can vary depending on the message -@@ -2117,6 +2207,7 @@ int vprintk_store(int facility, int level, - if (lflags & LOG_CONT) { - prb_rec_init_wr(&r, reserve_size); - if (prb_reserve_in_last(&e, prb, &r, caller_id, LOG_LINE_MAX)) { -+ seq = r.info->seq; - text_len = printk_sprint(&r.text_buf[r.info->text_len], reserve_size, - facility, &lflags, fmt, args); - r.info->text_len += text_len; -@@ -2124,6 +2215,7 @@ int vprintk_store(int facility, int level, - if (lflags & LOG_NEWLINE) { - r.info->flags |= LOG_NEWLINE; - prb_final_commit(&e); -+ final_commit = true; - } else { - prb_commit(&e); - } -@@ -2148,6 +2240,8 @@ int vprintk_store(int facility, int level, - goto out; - } - -+ seq = r.info->seq; -+ - /* fill message */ - text_len = printk_sprint(&r.text_buf[0], reserve_size, facility, &lflags, fmt, args); - if (trunc_msg_len) -@@ -2162,13 +2256,25 @@ int vprintk_store(int facility, int level, - memcpy(&r.info->dev_info, dev_info, sizeof(r.info->dev_info)); - - /* A message without a trailing newline can be continued. */ -- if (!(lflags & LOG_NEWLINE)) -+ if (!(lflags & LOG_NEWLINE)) { - prb_commit(&e); -- else -+ } else { - prb_final_commit(&e); -+ final_commit = true; -+ } - - ret = text_len + trunc_msg_len; - out: -+ /* only the kernel may perform synchronous printing */ -+ if (facility == 0 && final_commit) { -+ struct console *con; -+ -+ for_each_console(con) { -+ if (console_can_sync(con)) -+ print_sync_until(con, seq + 1); -+ } -+ } -+ - printk_exit_irqrestore(irqflags); - return ret; - } -@@ -2264,12 +2370,13 @@ EXPORT_SYMBOL(printk); - - #else /* CONFIG_PRINTK */ - --#define CONSOLE_LOG_MAX 0 - #define printk_time false - - #define prb_read_valid(rb, seq, r) false - #define prb_first_valid_seq(rb) 0 - -+#define kernel_sync_mode() false -+ - static u64 syslog_seq; - static atomic64_t console_seq = ATOMIC64_INIT(0); - static u64 exclusive_console_stop_seq; -@@ -2562,6 +2669,8 @@ static int have_callable_console(void) - */ - static inline int can_use_console(void) - { -+ if (kernel_sync_mode()) -+ return false; - return cpu_online(raw_smp_processor_id()) || have_callable_console(); - } - -@@ -3374,6 +3483,18 @@ void kmsg_dump(enum kmsg_dump_reason reason) - struct kmsg_dumper_iter iter; - struct kmsg_dumper *dumper; - -+ if (!oops_in_progress) { -+ /* -+ * If atomic consoles are available, activate kernel sync mode -+ * to make sure any final messages are visible. The trailing -+ * printk message is important to flush any pending messages. -+ */ -+ if (have_atomic_console()) { -+ sync_mode = true; -+ pr_info("enabled sync mode\n"); -+ } -+ } -+ - rcu_read_lock(); - list_for_each_entry_rcu(dumper, &dump_list, list) { - enum kmsg_dump_reason max_reason = dumper->max_reason; --- -2.19.1 - diff --git a/features/rt/printk-kmsg_dump-remove-_nolock-variants.patch b/features/rt/printk-kmsg_dump-remove-_nolock-variants.patch deleted file mode 100644 index f527d6dc..00000000 --- a/features/rt/printk-kmsg_dump-remove-_nolock-variants.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 3635a853f4118c42ffc7e537ed64c9ab04de93d8 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 21 Dec 2020 10:27:58 +0106 -Subject: [PATCH 018/191] printk: kmsg_dump: remove _nolock() variants - -kmsg_dump_rewind() and kmsg_dump_get_line() are lockless, so there is -no need for _nolock() variants. Remove these functions and switch all -callers of the _nolock() variants. - -The functions without _nolock() were chosen because they are already -exported to kernel modules. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> ---- - arch/powerpc/xmon/xmon.c | 4 +-- - include/linux/kmsg_dump.h | 18 +---------- - kernel/debug/kdb/kdb_main.c | 8 ++--- - kernel/printk/printk.c | 60 +++++-------------------------------- - 4 files changed, 15 insertions(+), 75 deletions(-) - -diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c -index 900882f90431..be2413890bda 100644 ---- a/arch/powerpc/xmon/xmon.c -+++ b/arch/powerpc/xmon/xmon.c -@@ -3013,9 +3013,9 @@ dump_log_buf(void) - catch_memory_errors = 1; - sync(); - -- kmsg_dump_rewind_nolock(&iter); -+ kmsg_dump_rewind(&iter); - xmon_start_pagination(); -- while (kmsg_dump_get_line_nolock(&iter, false, buf, sizeof(buf), &len)) { -+ while (kmsg_dump_get_line(&iter, false, buf, sizeof(buf), &len)) { - buf[len] = '\0'; - printf("%s", buf); - } -diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h -index 2fdb10ab1799..86673930c8ea 100644 ---- a/include/linux/kmsg_dump.h -+++ b/include/linux/kmsg_dump.h -@@ -60,18 +60,13 @@ struct kmsg_dumper { - #ifdef CONFIG_PRINTK - void kmsg_dump(enum kmsg_dump_reason reason); - --bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, -- char *line, size_t size, size_t *len); -- - bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - char *line, size_t size, size_t *len); - - bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - char *buf, size_t size, size_t *len_out); - --void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter); -- --void kmsg_dump_rewind(struct kmsg_dumper_iter *dumper_iter); -+void kmsg_dump_rewind(struct kmsg_dumper_iter *iter); - - int kmsg_dump_register(struct kmsg_dumper *dumper); - -@@ -83,13 +78,6 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason) - { - } - --static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, -- bool syslog, const char *line, -- size_t size, size_t *len) --{ -- return false; --} -- - static inline bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - const char *line, size_t size, size_t *len) - { -@@ -102,10 +90,6 @@ static inline bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool sysl - return false; - } - --static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) --{ --} -- - static inline void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - { - } -diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c -index 7ae9da245e4b..dbf1d126ac5e 100644 ---- a/kernel/debug/kdb/kdb_main.c -+++ b/kernel/debug/kdb/kdb_main.c -@@ -2126,8 +2126,8 @@ static int kdb_dmesg(int argc, const char **argv) - kdb_set(2, setargs); - } - -- kmsg_dump_rewind_nolock(&iter); -- while (kmsg_dump_get_line_nolock(&iter, 1, NULL, 0, NULL)) -+ kmsg_dump_rewind(&iter); -+ while (kmsg_dump_get_line(&iter, 1, NULL, 0, NULL)) - n++; - - if (lines < 0) { -@@ -2159,8 +2159,8 @@ static int kdb_dmesg(int argc, const char **argv) - if (skip >= n || skip < 0) - return 0; - -- kmsg_dump_rewind_nolock(&iter); -- while (kmsg_dump_get_line_nolock(&iter, 1, buf, sizeof(buf), &len)) { -+ kmsg_dump_rewind(&iter); -+ while (kmsg_dump_get_line(&iter, 1, buf, sizeof(buf), &len)) { - if (skip) { - skip--; - continue; -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 32b2d763aef7..fbb9f2f30430 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3382,7 +3382,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) - } - - /** -- * kmsg_dump_get_line_nolock - retrieve one kmsg log line (unlocked version) -+ * kmsg_dump_get_line - retrieve one kmsg log line - * @iter: kmsg dumper iterator - * @syslog: include the "<4>" prefixes - * @line: buffer to copy the line to -@@ -3397,18 +3397,18 @@ void kmsg_dump(enum kmsg_dump_reason reason) - * - * A return value of FALSE indicates that there are no more records to - * read. -- * -- * The function is similar to kmsg_dump_get_line(), but grabs no locks. - */ --bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, -- char *line, size_t size, size_t *len) -+bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, -+ char *line, size_t size, size_t *len) - { - struct printk_info info; - unsigned int line_count; - struct printk_record r; -+ unsigned long flags; - size_t l = 0; - bool ret = false; - -+ printk_safe_enter_irqsave(flags); - prb_rec_init_rd(&r, &info, line, size); - - if (!iter->active) -@@ -3432,40 +3432,11 @@ bool kmsg_dump_get_line_nolock(struct kmsg_dumper_iter *iter, bool syslog, - iter->cur_seq = r.info->seq + 1; - ret = true; - out: -+ printk_safe_exit_irqrestore(flags); - if (len) - *len = l; - return ret; - } -- --/** -- * kmsg_dump_get_line - retrieve one kmsg log line -- * @iter: kmsg dumper iterator -- * @syslog: include the "<4>" prefixes -- * @line: buffer to copy the line to -- * @size: maximum size of the buffer -- * @len: length of line placed into buffer -- * -- * Start at the beginning of the kmsg buffer, with the oldest kmsg -- * record, and copy one record into the provided buffer. -- * -- * Consecutive calls will return the next available record moving -- * towards the end of the buffer with the youngest messages. -- * -- * A return value of FALSE indicates that there are no more records to -- * read. -- */ --bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, -- char *line, size_t size, size_t *len) --{ -- unsigned long flags; -- bool ret; -- -- printk_safe_enter_irqsave(flags); -- ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); -- printk_safe_exit_irqrestore(flags); -- -- return ret; --} - EXPORT_SYMBOL_GPL(kmsg_dump_get_line); - - /** -@@ -3554,22 +3525,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - } - EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); - --/** -- * kmsg_dump_rewind_nolock - reset the iterator (unlocked version) -- * @iter: kmsg dumper iterator -- * -- * Reset the dumper's iterator so that kmsg_dump_get_line() and -- * kmsg_dump_get_buffer() can be called again and used multiple -- * times within the same dumper.dump() callback. -- * -- * The function is similar to kmsg_dump_rewind(), but grabs no locks. -- */ --void kmsg_dump_rewind_nolock(struct kmsg_dumper_iter *iter) --{ -- iter->cur_seq = latched_seq_read_nolock(&clear_seq); -- iter->next_seq = prb_next_seq(prb); --} -- - /** - * kmsg_dump_rewind - reset the iterator - * @iter: kmsg dumper iterator -@@ -3583,7 +3538,8 @@ void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - unsigned long flags; - - printk_safe_enter_irqsave(flags); -- kmsg_dump_rewind_nolock(iter); -+ iter->cur_seq = latched_seq_read_nolock(&clear_seq); -+ iter->next_seq = prb_next_seq(prb); - printk_safe_exit_irqrestore(flags); - } - EXPORT_SYMBOL_GPL(kmsg_dump_rewind); --- -2.19.1 - diff --git a/features/rt/printk-kmsg_dump-remove-unused-fields.patch b/features/rt/printk-kmsg_dump-remove-unused-fields.patch deleted file mode 100644 index eee152e1..00000000 --- a/features/rt/printk-kmsg_dump-remove-unused-fields.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 978c2a2d02d76dfd23c87cf04b8d502030dc66f8 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 21 Dec 2020 11:19:39 +0106 -Subject: [PATCH 008/191] printk: kmsg_dump: remove unused fields - -struct kmsg_dumper still contains some fields that were used to -iterate the old ringbuffer. They are no longer used. Remove them -and update the struct documentation. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Reviewed-by: Petr Mladek <pmladek@suse.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/kmsg_dump.h | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h -index 3378bcbe585e..235c50982c2d 100644 ---- a/include/linux/kmsg_dump.h -+++ b/include/linux/kmsg_dump.h -@@ -36,6 +36,9 @@ enum kmsg_dump_reason { - * through the record iterator - * @max_reason: filter for highest reason number that should be dumped - * @registered: Flag that specifies if this is already registered -+ * @active: Flag that specifies if this is currently dumping -+ * @cur_seq: Points to the oldest message to dump (private) -+ * @next_seq: Points after the newest message to dump (private) - */ - struct kmsg_dumper { - struct list_head list; -@@ -45,8 +48,6 @@ struct kmsg_dumper { - bool registered; - - /* private state of the kmsg iterator */ -- u32 cur_idx; -- u32 next_idx; - u64 cur_seq; - u64 next_seq; - }; --- -2.19.1 - diff --git a/features/rt/printk-kmsg_dump-use-kmsg_dump_rewind.patch b/features/rt/printk-kmsg_dump-use-kmsg_dump_rewind.patch deleted file mode 100644 index d63957e3..00000000 --- a/features/rt/printk-kmsg_dump-use-kmsg_dump_rewind.patch +++ /dev/null @@ -1,41 +0,0 @@ -From bc6b56661c0c00b39b105f6c1c2166c89f60070c Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Wed, 17 Feb 2021 18:23:16 +0100 -Subject: [PATCH 019/191] printk: kmsg_dump: use kmsg_dump_rewind - -kmsg_dump() is open coding the kmsg_dump_rewind(). Call -kmsg_dump_rewind() instead. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index fbb9f2f30430..15aed1a7bd05 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3351,7 +3351,6 @@ void kmsg_dump(enum kmsg_dump_reason reason) - { - struct kmsg_dumper_iter iter; - struct kmsg_dumper *dumper; -- unsigned long flags; - - rcu_read_lock(); - list_for_each_entry_rcu(dumper, &dump_list, list) { -@@ -3370,10 +3369,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) - - /* initialize iterator with data about the stored records */ - iter.active = true; -- printk_safe_enter_irqsave(flags); -- iter.cur_seq = latched_seq_read_nolock(&clear_seq); -- iter.next_seq = prb_next_seq(prb); -- printk_safe_exit_irqrestore(flags); -+ kmsg_dump_rewind(&iter); - - /* invoke dumper which will iterate over records */ - dumper->dump(dumper, reason, &iter); --- -2.19.1 - diff --git a/features/rt/printk-limit-second-loop-of-syslog_print_all.patch b/features/rt/printk-limit-second-loop-of-syslog_print_all.patch deleted file mode 100644 index 1ca5451b..00000000 --- a/features/rt/printk-limit-second-loop-of-syslog_print_all.patch +++ /dev/null @@ -1,55 +0,0 @@ -From a8c89ca2edd1f674c9fc18b64fe9c67454d5b8c6 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Wed, 17 Feb 2021 16:15:31 +0100 -Subject: [PATCH 007/191] printk: limit second loop of syslog_print_all - -The second loop of syslog_print_all() subtracts lengths that were -added in the first loop. With commit b031a684bfd0 ("printk: remove -logbuf_lock writer-protection of ringbuffer") it is possible that -records are (over)written during syslog_print_all(). This allows the -possibility of the second loop subtracting lengths that were never -added in the first loop. - -This situation can result in syslog_print_all() filling the buffer -starting from a later record, even though there may have been room -to fit the earlier record(s) as well. - -Fixes: b031a684bfd0 ("printk: remove logbuf_lock writer-protection of ringbuffer") -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Reviewed-by: Petr Mladek <pmladek@suse.com> ---- - kernel/printk/printk.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 575a34b88936..77ae2704e979 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1494,6 +1494,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - struct printk_info info; - unsigned int line_count; - struct printk_record r; -+ u64 max_seq; - char *text; - int len = 0; - u64 seq; -@@ -1512,9 +1513,15 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - prb_for_each_info(clear_seq, prb, seq, &info, &line_count) - len += get_record_print_text_size(&info, line_count, true, time); - -+ /* -+ * Set an upper bound for the next loop to avoid subtracting lengths -+ * that were never added. -+ */ -+ max_seq = seq; -+ - /* move first record forward until length fits into the buffer */ - prb_for_each_info(clear_seq, prb, seq, &info, &line_count) { -- if (len <= size) -+ if (len <= size || info.seq >= max_seq) - break; - len -= get_record_print_text_size(&info, line_count, true, time); - } --- -2.19.1 - diff --git a/features/rt/printk-move-console-printing-to-kthreads.patch b/features/rt/printk-move-console-printing-to-kthreads.patch deleted file mode 100644 index 942fcb13..00000000 --- a/features/rt/printk-move-console-printing-to-kthreads.patch +++ /dev/null @@ -1,846 +0,0 @@ -From acce83424770494715634141b1a06a8e17f128e1 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:07 +0106 -Subject: [PATCH 030/191] printk: move console printing to kthreads - -Create a kthread for each console to perform console printing. Now -all console printing is fully asynchronous except for the boot -console and when the kernel enters sync mode (and there are atomic -consoles available). - -The console_lock() and console_unlock() functions now only do what -their name says... locking and unlocking of the console. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/console.h | 2 + - kernel/printk/printk.c | 625 ++++++++++++---------------------------- - 2 files changed, 186 insertions(+), 441 deletions(-) - -diff --git a/include/linux/console.h b/include/linux/console.h -index 1d699d02e99a..b370e37a6d49 100644 ---- a/include/linux/console.h -+++ b/include/linux/console.h -@@ -154,6 +154,8 @@ struct console { - #ifdef CONFIG_PRINTK - char sync_buf[CONSOLE_LOG_MAX]; - #endif -+ atomic64_t printk_seq; -+ struct task_struct *thread; - void *data; - struct console *next; - }; -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 4aa402d2df55..e2dd2abfb855 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -44,6 +44,7 @@ - #include <linux/irq_work.h> - #include <linux/ctype.h> - #include <linux/uio.h> -+#include <linux/kthread.h> - #include <linux/clocksource.h> - #include <linux/sched/clock.h> - #include <linux/sched/debug.h> -@@ -267,11 +268,6 @@ static void __up_console_sem(unsigned long ip) - */ - static int console_locked, console_suspended; - --/* -- * If exclusive_console is non-NULL then only this console is to be printed to. -- */ --static struct console *exclusive_console; -- - /* - * Array of consoles built from command line options (console=) - */ -@@ -356,10 +352,10 @@ enum log_flags { - LOG_CONT = 8, /* text is a fragment of a continuation line */ - }; - -+#ifdef CONFIG_PRINTK - /* syslog_lock protects syslog_* variables and write access to clear_seq. */ - static DEFINE_SPINLOCK(syslog_lock); - --#ifdef CONFIG_PRINTK - /* Set to enable sync mode. Once set, it is never cleared. */ - static bool sync_mode; - -@@ -370,13 +366,6 @@ static u64 syslog_seq; - static size_t syslog_partial; - static bool syslog_time; - --/* Both protected by @console_sem. */ --static u64 exclusive_console_stop_seq; --static unsigned long console_dropped; -- --/* the next printk record to write to the console */ --static atomic64_t console_seq = ATOMIC64_INIT(0); -- - struct latched_seq { - seqcount_latch_t latch; - u64 val[2]; -@@ -1754,6 +1743,8 @@ static bool console_can_sync(struct console *con) - return false; - if (con->write_atomic && kernel_sync_mode()) - return true; -+ if (con->write && (con->flags & CON_BOOT) && !con->thread) -+ return true; - return false; - } - -@@ -1763,6 +1754,8 @@ static bool call_sync_console_driver(struct console *con, const char *text, size - return false; - if (con->write_atomic && kernel_sync_mode()) - con->write_atomic(con, text, text_len); -+ else if (con->write && (con->flags & CON_BOOT) && !con->thread) -+ con->write(con, text, text_len); - else - return false; - -@@ -1818,202 +1811,16 @@ static void print_sync_until(struct console *con, u64 seq) - - console_atomic_lock(&flags); - for (;;) { -- printk_seq = atomic64_read(&console_seq); -+ printk_seq = atomic64_read(&con->printk_seq); - if (printk_seq >= seq) - break; - if (!print_sync(con, &printk_seq)) - break; -- atomic64_set(&console_seq, printk_seq + 1); -+ atomic64_set(&con->printk_seq, printk_seq + 1); - } - console_atomic_unlock(flags); - } - --/* -- * Special console_lock variants that help to reduce the risk of soft-lockups. -- * They allow to pass console_lock to another printk() call using a busy wait. -- */ -- --#ifdef CONFIG_LOCKDEP --static struct lockdep_map console_owner_dep_map = { -- .name = "console_owner" --}; --#endif -- --static DEFINE_RAW_SPINLOCK(console_owner_lock); --static struct task_struct *console_owner; --static bool console_waiter; -- --/** -- * console_lock_spinning_enable - mark beginning of code where another -- * thread might safely busy wait -- * -- * This basically converts console_lock into a spinlock. This marks -- * the section where the console_lock owner can not sleep, because -- * there may be a waiter spinning (like a spinlock). Also it must be -- * ready to hand over the lock at the end of the section. -- */ --static void console_lock_spinning_enable(void) --{ -- raw_spin_lock(&console_owner_lock); -- console_owner = current; -- raw_spin_unlock(&console_owner_lock); -- -- /* The waiter may spin on us after setting console_owner */ -- spin_acquire(&console_owner_dep_map, 0, 0, _THIS_IP_); --} -- --/** -- * console_lock_spinning_disable_and_check - mark end of code where another -- * thread was able to busy wait and check if there is a waiter -- * -- * This is called at the end of the section where spinning is allowed. -- * It has two functions. First, it is a signal that it is no longer -- * safe to start busy waiting for the lock. Second, it checks if -- * there is a busy waiter and passes the lock rights to her. -- * -- * Important: Callers lose the lock if there was a busy waiter. -- * They must not touch items synchronized by console_lock -- * in this case. -- * -- * Return: 1 if the lock rights were passed, 0 otherwise. -- */ --static int console_lock_spinning_disable_and_check(void) --{ -- int waiter; -- -- raw_spin_lock(&console_owner_lock); -- waiter = READ_ONCE(console_waiter); -- console_owner = NULL; -- raw_spin_unlock(&console_owner_lock); -- -- if (!waiter) { -- spin_release(&console_owner_dep_map, _THIS_IP_); -- return 0; -- } -- -- /* The waiter is now free to continue */ -- WRITE_ONCE(console_waiter, false); -- -- spin_release(&console_owner_dep_map, _THIS_IP_); -- -- /* -- * Hand off console_lock to waiter. The waiter will perform -- * the up(). After this, the waiter is the console_lock owner. -- */ -- mutex_release(&console_lock_dep_map, _THIS_IP_); -- return 1; --} -- --/** -- * console_trylock_spinning - try to get console_lock by busy waiting -- * -- * This allows to busy wait for the console_lock when the current -- * owner is running in specially marked sections. It means that -- * the current owner is running and cannot reschedule until it -- * is ready to lose the lock. -- * -- * Return: 1 if we got the lock, 0 othrewise -- */ --static int console_trylock_spinning(void) --{ -- struct task_struct *owner = NULL; -- bool waiter; -- bool spin = false; -- unsigned long flags; -- -- if (console_trylock()) -- return 1; -- -- printk_safe_enter_irqsave(flags); -- -- raw_spin_lock(&console_owner_lock); -- owner = READ_ONCE(console_owner); -- waiter = READ_ONCE(console_waiter); -- if (!waiter && owner && owner != current) { -- WRITE_ONCE(console_waiter, true); -- spin = true; -- } -- raw_spin_unlock(&console_owner_lock); -- -- /* -- * If there is an active printk() writing to the -- * consoles, instead of having it write our data too, -- * see if we can offload that load from the active -- * printer, and do some printing ourselves. -- * Go into a spin only if there isn't already a waiter -- * spinning, and there is an active printer, and -- * that active printer isn't us (recursive printk?). -- */ -- if (!spin) { -- printk_safe_exit_irqrestore(flags); -- return 0; -- } -- -- /* We spin waiting for the owner to release us */ -- spin_acquire(&console_owner_dep_map, 0, 0, _THIS_IP_); -- /* Owner will clear console_waiter on hand off */ -- while (READ_ONCE(console_waiter)) -- cpu_relax(); -- spin_release(&console_owner_dep_map, _THIS_IP_); -- -- printk_safe_exit_irqrestore(flags); -- /* -- * The owner passed the console lock to us. -- * Since we did not spin on console lock, annotate -- * this as a trylock. Otherwise lockdep will -- * complain. -- */ -- mutex_acquire(&console_lock_dep_map, 0, 1, _THIS_IP_); -- -- return 1; --} -- --/* -- * Call the console drivers, asking them to write out -- * log_buf[start] to log_buf[end - 1]. -- * The console_lock must be held. -- */ --static void call_console_drivers(const char *ext_text, size_t ext_len, -- const char *text, size_t len) --{ -- static char dropped_text[64]; -- size_t dropped_len = 0; -- struct console *con; -- -- trace_console_rcuidle(text, len); -- -- if (!console_drivers) -- return; -- -- if (console_dropped) { -- dropped_len = snprintf(dropped_text, sizeof(dropped_text), -- "** %lu printk messages dropped **\n", -- console_dropped); -- console_dropped = 0; -- } -- -- for_each_console(con) { -- if (exclusive_console && con != exclusive_console) -- continue; -- if (!(con->flags & CON_ENABLED)) -- continue; -- if (!con->write) -- continue; -- if (!cpu_online(smp_processor_id()) && -- !(con->flags & CON_ANYTIME)) -- continue; -- if (kernel_sync_mode()) -- continue; -- if (con->flags & CON_EXTENDED) -- con->write(con, ext_text, ext_len); -- else { -- if (dropped_len) -- con->write(con, dropped_text, dropped_len); -- con->write(con, text, len); -- } -- } --} -- - #ifdef CONFIG_PRINTK_NMI - #define NUM_RECURSION_CTX 2 - #else -@@ -2284,39 +2091,16 @@ asmlinkage int vprintk_emit(int facility, int level, - const char *fmt, va_list args) - { - int printed_len; -- bool in_sched = false; - - /* Suppress unimportant messages after panic happens */ - if (unlikely(suppress_printk)) - return 0; - -- if (level == LOGLEVEL_SCHED) { -+ if (level == LOGLEVEL_SCHED) - level = LOGLEVEL_DEFAULT; -- in_sched = true; -- } -- -- printk_delay(level); - - printed_len = vprintk_store(facility, level, dev_info, fmt, args); - -- /* If called from the scheduler, we can not call up(). */ -- if (!in_sched) { -- /* -- * Disable preemption to avoid being preempted while holding -- * console_sem which would prevent anyone from printing to -- * console -- */ -- preempt_disable(); -- /* -- * Try to acquire and then immediately release the console -- * semaphore. The release will print out buffers and wake up -- * /dev/kmsg and syslog() users. -- */ -- if (console_trylock_spinning()) -- console_unlock(); -- preempt_enable(); -- } -- - wake_up_klogd(); - return printed_len; - } -@@ -2368,38 +2152,158 @@ asmlinkage __visible int printk(const char *fmt, ...) - } - EXPORT_SYMBOL(printk); - --#else /* CONFIG_PRINTK */ -+static int printk_kthread_func(void *data) -+{ -+ struct console *con = data; -+ unsigned long dropped = 0; -+ char *dropped_text = NULL; -+ struct printk_info info; -+ struct printk_record r; -+ char *ext_text = NULL; -+ size_t dropped_len; -+ int ret = -ENOMEM; -+ char *text = NULL; -+ char *write_text; -+ u64 printk_seq; -+ size_t len; -+ int error; -+ u64 seq; - --#define printk_time false -+ if (con->flags & CON_EXTENDED) { -+ ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL); -+ if (!ext_text) -+ goto out; -+ } -+ text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL); -+ dropped_text = kmalloc(64, GFP_KERNEL); -+ if (!text || !dropped_text) -+ goto out; - --#define prb_read_valid(rb, seq, r) false --#define prb_first_valid_seq(rb) 0 -+ if (con->flags & CON_EXTENDED) -+ write_text = ext_text; -+ else -+ write_text = text; - --#define kernel_sync_mode() false -+ seq = atomic64_read(&con->printk_seq); - --static u64 syslog_seq; --static atomic64_t console_seq = ATOMIC64_INIT(0); --static u64 exclusive_console_stop_seq; --static unsigned long console_dropped; -+ prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX); -+ -+ for (;;) { -+ error = wait_event_interruptible(log_wait, -+ prb_read_valid(prb, seq, &r) || kthread_should_stop()); -+ -+ if (kthread_should_stop()) -+ break; -+ -+ if (error) -+ continue; -+ -+ if (seq != r.info->seq) { -+ dropped += r.info->seq - seq; -+ seq = r.info->seq; -+ } -+ -+ seq++; -+ -+ if (!(con->flags & CON_ENABLED)) -+ continue; -+ -+ if (suppress_message_printing(r.info->level)) -+ continue; -+ -+ if (con->flags & CON_EXTENDED) { -+ len = info_print_ext_header(ext_text, -+ CONSOLE_EXT_LOG_MAX, -+ r.info); -+ len += msg_print_ext_body(ext_text + len, -+ CONSOLE_EXT_LOG_MAX - len, -+ &r.text_buf[0], r.info->text_len, -+ &r.info->dev_info); -+ } else { -+ len = record_print_text(&r, -+ console_msg_format & MSG_FORMAT_SYSLOG, -+ printk_time); -+ } -+ -+ printk_seq = atomic64_read(&con->printk_seq); - --static size_t record_print_text(const struct printk_record *r, -- bool syslog, bool time) -+ console_lock(); -+ console_may_schedule = 0; -+ -+ if (kernel_sync_mode() && con->write_atomic) { -+ console_unlock(); -+ break; -+ } -+ -+ if (!(con->flags & CON_EXTENDED) && dropped) { -+ dropped_len = snprintf(dropped_text, 64, -+ "** %lu printk messages dropped **\n", -+ dropped); -+ dropped = 0; -+ -+ con->write(con, dropped_text, dropped_len); -+ printk_delay(r.info->level); -+ } -+ -+ con->write(con, write_text, len); -+ if (len) -+ printk_delay(r.info->level); -+ -+ atomic64_cmpxchg_relaxed(&con->printk_seq, printk_seq, seq); -+ -+ console_unlock(); -+ } -+out: -+ kfree(dropped_text); -+ kfree(text); -+ kfree(ext_text); -+ pr_info("%sconsole [%s%d]: printing thread stopped\n", -+ (con->flags & CON_BOOT) ? "boot" : "", -+ con->name, con->index); -+ return ret; -+} -+ -+/* Must be called within console_lock(). */ -+static void start_printk_kthread(struct console *con) - { -- return 0; -+ con->thread = kthread_run(printk_kthread_func, con, -+ "pr/%s%d", con->name, con->index); -+ if (IS_ERR(con->thread)) { -+ pr_err("%sconsole [%s%d]: unable to start printing thread\n", -+ (con->flags & CON_BOOT) ? "boot" : "", -+ con->name, con->index); -+ return; -+ } -+ pr_info("%sconsole [%s%d]: printing thread started\n", -+ (con->flags & CON_BOOT) ? "boot" : "", -+ con->name, con->index); - } --static ssize_t info_print_ext_header(char *buf, size_t size, -- struct printk_info *info) -+ -+/* protected by console_lock */ -+static bool kthreads_started; -+ -+/* Must be called within console_lock(). */ -+static void console_try_thread(struct console *con) - { -- return 0; -+ if (kthreads_started) { -+ start_printk_kthread(con); -+ return; -+ } -+ -+ /* -+ * The printing threads have not been started yet. If this console -+ * can print synchronously, print all unprinted messages. -+ */ -+ if (console_can_sync(con)) -+ print_sync_until(con, prb_next_seq(prb)); - } --static ssize_t msg_print_ext_body(char *buf, size_t size, -- char *text, size_t text_len, -- struct dev_printk_info *dev_info) { return 0; } --static void console_lock_spinning_enable(void) { } --static int console_lock_spinning_disable_and_check(void) { return 0; } --static void call_console_drivers(const char *ext_text, size_t ext_len, -- const char *text, size_t len) {} --static bool suppress_message_printing(int level) { return false; } -+ -+#else /* CONFIG_PRINTK */ -+ -+#define prb_first_valid_seq(rb) 0 -+#define prb_next_seq(rb) 0 -+ -+#define console_try_thread(con) - - #endif /* CONFIG_PRINTK */ - -@@ -2644,36 +2548,6 @@ int is_console_locked(void) - } - EXPORT_SYMBOL(is_console_locked); - --/* -- * Check if we have any console that is capable of printing while cpu is -- * booting or shutting down. Requires console_sem. -- */ --static int have_callable_console(void) --{ -- struct console *con; -- -- for_each_console(con) -- if ((con->flags & CON_ENABLED) && -- (con->flags & CON_ANYTIME)) -- return 1; -- -- return 0; --} -- --/* -- * Can we actually use the console at this time on this cpu? -- * -- * Console drivers may assume that per-cpu resources have been allocated. So -- * unless they're explicitly marked as being able to cope (CON_ANYTIME) don't -- * call them until this CPU is officially up. -- */ --static inline int can_use_console(void) --{ -- if (kernel_sync_mode()) -- return false; -- return cpu_online(raw_smp_processor_id()) || have_callable_console(); --} -- - /** - * console_unlock - unlock the console system - * -@@ -2690,131 +2564,14 @@ static inline int can_use_console(void) - */ - void console_unlock(void) - { -- static char ext_text[CONSOLE_EXT_LOG_MAX]; -- static char text[CONSOLE_LOG_MAX]; -- bool do_cond_resched, retry; -- struct printk_info info; -- struct printk_record r; -- u64 seq; -- - if (console_suspended) { - up_console_sem(); - return; - } - -- prb_rec_init_rd(&r, &info, text, sizeof(text)); -- -- /* -- * Console drivers are called with interrupts disabled, so -- * @console_may_schedule should be cleared before; however, we may -- * end up dumping a lot of lines, for example, if called from -- * console registration path, and should invoke cond_resched() -- * between lines if allowable. Not doing so can cause a very long -- * scheduling stall on a slow console leading to RCU stall and -- * softlockup warnings which exacerbate the issue with more -- * messages practically incapacitating the system. -- * -- * console_trylock() is not able to detect the preemptive -- * context reliably. Therefore the value must be stored before -- * and cleared after the "again" goto label. -- */ -- do_cond_resched = console_may_schedule; --again: -- console_may_schedule = 0; -- -- /* -- * We released the console_sem lock, so we need to recheck if -- * cpu is online and (if not) is there at least one CON_ANYTIME -- * console. -- */ -- if (!can_use_console()) { -- console_locked = 0; -- up_console_sem(); -- return; -- } -- -- for (;;) { -- size_t ext_len = 0; -- size_t len; -- --skip: -- seq = atomic64_read(&console_seq); -- if (!prb_read_valid(prb, seq, &r)) -- break; -- -- if (seq != r.info->seq) { -- console_dropped += r.info->seq - seq; -- atomic64_set(&console_seq, r.info->seq); -- seq = r.info->seq; -- } -- -- if (suppress_message_printing(r.info->level)) { -- /* -- * Skip record we have buffered and already printed -- * directly to the console when we received it, and -- * record that has level above the console loglevel. -- */ -- atomic64_set(&console_seq, seq + 1); -- goto skip; -- } -- -- /* Output to all consoles once old messages replayed. */ -- if (unlikely(exclusive_console && -- seq >= exclusive_console_stop_seq)) { -- exclusive_console = NULL; -- } -- -- /* -- * Handle extended console text first because later -- * record_print_text() will modify the record buffer in-place. -- */ -- if (nr_ext_console_drivers) { -- ext_len = info_print_ext_header(ext_text, -- sizeof(ext_text), -- r.info); -- ext_len += msg_print_ext_body(ext_text + ext_len, -- sizeof(ext_text) - ext_len, -- &r.text_buf[0], -- r.info->text_len, -- &r.info->dev_info); -- } -- len = record_print_text(&r, -- console_msg_format & MSG_FORMAT_SYSLOG, -- printk_time); -- atomic64_set(&console_seq, seq + 1); -- -- /* -- * While actively printing out messages, if another printk() -- * were to occur on another CPU, it may wait for this one to -- * finish. This task can not be preempted if there is a -- * waiter waiting to take over. -- */ -- console_lock_spinning_enable(); -- -- stop_critical_timings(); /* don't trace print latency */ -- call_console_drivers(ext_text, ext_len, text, len); -- start_critical_timings(); -- -- if (console_lock_spinning_disable_and_check()) -- return; -- -- if (do_cond_resched) -- cond_resched(); -- } -- - console_locked = 0; - - up_console_sem(); -- -- /* -- * Someone could have filled up the buffer again, so re-check if there's -- * something to flush. In case we cannot trylock the console_sem again, -- * there's a new owner and the console_unlock() from them will do the -- * flush, no worries. -- */ -- retry = prb_read_valid(prb, atomic64_read(&console_seq), NULL); -- if (retry && console_trylock()) -- goto again; - } - EXPORT_SYMBOL(console_unlock); - -@@ -2864,18 +2621,20 @@ void console_unblank(void) - */ - void console_flush_on_panic(enum con_flush_mode mode) - { -- /* -- * If someone else is holding the console lock, trylock will fail -- * and may_schedule may be set. Ignore and proceed to unlock so -- * that messages are flushed out. As this can be called from any -- * context and we don't want to get preempted while flushing, -- * ensure may_schedule is cleared. -- */ -- console_trylock(); -+ struct console *c; -+ u64 seq; -+ -+ if (!console_trylock()) -+ return; -+ - console_may_schedule = 0; - -- if (mode == CONSOLE_REPLAY_ALL) -- atomic64_set(&console_seq, prb_first_valid_seq(prb)); -+ if (mode == CONSOLE_REPLAY_ALL) { -+ seq = prb_first_valid_seq(prb); -+ for_each_console(c) -+ atomic64_set(&c->printk_seq, seq); -+ } -+ - console_unlock(); - } - -@@ -3010,7 +2769,6 @@ static int try_enable_new_console(struct console *newcon, bool user_specified) - */ - void register_console(struct console *newcon) - { -- unsigned long flags; - struct console *bcon = NULL; - int err; - -@@ -3034,6 +2792,8 @@ void register_console(struct console *newcon) - } - } - -+ newcon->thread = NULL; -+ - if (console_drivers && console_drivers->flags & CON_BOOT) - bcon = console_drivers; - -@@ -3098,27 +2858,12 @@ void register_console(struct console *newcon) - if (newcon->flags & CON_EXTENDED) - nr_ext_console_drivers++; - -- if (newcon->flags & CON_PRINTBUFFER) { -- /* -- * console_unlock(); will print out the buffered messages -- * for us. -- * -- * We're about to replay the log buffer. Only do this to the -- * just-registered console to avoid excessive message spam to -- * the already-registered consoles. -- * -- * Set exclusive_console with disabled interrupts to reduce -- * race window with eventual console_flush_on_panic() that -- * ignores console_lock. -- */ -- exclusive_console = newcon; -- exclusive_console_stop_seq = atomic64_read(&console_seq); -+ if (newcon->flags & CON_PRINTBUFFER) -+ atomic64_set(&newcon->printk_seq, 0); -+ else -+ atomic64_set(&newcon->printk_seq, prb_next_seq(prb)); - -- /* Get a consistent copy of @syslog_seq. */ -- spin_lock_irqsave(&syslog_lock, flags); -- atomic64_set(&console_seq, syslog_seq); -- spin_unlock_irqrestore(&syslog_lock, flags); -- } -+ console_try_thread(newcon); - console_unlock(); - console_sysfs_notify(); - -@@ -3192,6 +2937,9 @@ int unregister_console(struct console *console) - console_unlock(); - console_sysfs_notify(); - -+ if (console->thread && !IS_ERR(console->thread)) -+ kthread_stop(console->thread); -+ - if (console->exit) - res = console->exit(console); - -@@ -3274,6 +3022,15 @@ static int __init printk_late_init(void) - unregister_console(con); - } - } -+ -+#ifdef CONFIG_PRINTK -+ console_lock(); -+ for_each_console(con) -+ start_printk_kthread(con); -+ kthreads_started = true; -+ console_unlock(); -+#endif -+ - ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL, - console_cpu_notify); - WARN_ON(ret < 0); -@@ -3289,7 +3046,6 @@ late_initcall(printk_late_init); - * Delayed printk version, for scheduler-internal messages: - */ - #define PRINTK_PENDING_WAKEUP 0x01 --#define PRINTK_PENDING_OUTPUT 0x02 - - static DEFINE_PER_CPU(int, printk_pending); - -@@ -3297,14 +3053,8 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work) - { - int pending = __this_cpu_xchg(printk_pending, 0); - -- if (pending & PRINTK_PENDING_OUTPUT) { -- /* If trylock fails, someone else is doing the printing */ -- if (console_trylock()) -- console_unlock(); -- } -- - if (pending & PRINTK_PENDING_WAKEUP) -- wake_up_interruptible(&log_wait); -+ wake_up_interruptible_all(&log_wait); - } - - static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = -@@ -3325,13 +3075,6 @@ void wake_up_klogd(void) - - void defer_console_output(void) - { -- if (!printk_percpu_data_ready()) -- return; -- -- preempt_disable(); -- __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); -- irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); -- preempt_enable(); - } - - int vprintk_deferred(const char *fmt, va_list args) --- -2.19.1 - diff --git a/features/rt/printk-refactor-kmsg_dump_get_buffer.patch b/features/rt/printk-refactor-kmsg_dump_get_buffer.patch deleted file mode 100644 index 3ac51cf4..00000000 --- a/features/rt/printk-refactor-kmsg_dump_get_buffer.patch +++ /dev/null @@ -1,144 +0,0 @@ -From d90ed552b2dc6bf64d8c0858f712deb58825fb95 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:41:56 +0106 -Subject: [PATCH 009/191] printk: refactor kmsg_dump_get_buffer() - -kmsg_dump_get_buffer() requires nearly the same logic as -syslog_print_all(), but uses different variable names and -does not make use of the ringbuffer loop macros. Modify -kmsg_dump_get_buffer() so that the implementation is as similar -to syslog_print_all() as possible. - -A follow-up commit will move this common logic into a -separate helper function. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Reviewed-by: Petr Mladek <pmladek@suse.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/kmsg_dump.h | 2 +- - kernel/printk/printk.c | 60 +++++++++++++++++++++------------------ - 2 files changed, 33 insertions(+), 29 deletions(-) - -diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h -index 235c50982c2d..4095a34db0fa 100644 ---- a/include/linux/kmsg_dump.h -+++ b/include/linux/kmsg_dump.h -@@ -62,7 +62,7 @@ bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, - char *line, size_t size, size_t *len); - - bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, -- char *buf, size_t size, size_t *len); -+ char *buf, size_t size, size_t *len_out); - - void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 77ae2704e979..3f17ff13fd51 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -3424,7 +3424,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line); - * read. - */ - bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, -- char *buf, size_t size, size_t *len) -+ char *buf, size_t size, size_t *len_out) - { - struct printk_info info; - unsigned int line_count; -@@ -3432,12 +3432,10 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - unsigned long flags; - u64 seq; - u64 next_seq; -- size_t l = 0; -+ size_t len = 0; - bool ret = false; - bool time = printk_time; - -- prb_rec_init_rd(&r, &info, buf, size); -- - if (!dumper->active || !buf || !size) - goto out; - -@@ -3455,48 +3453,54 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, - goto out; - } - -- /* calculate length of entire buffer */ -- seq = dumper->cur_seq; -- while (prb_read_valid_info(prb, seq, &info, &line_count)) { -- if (r.info->seq >= dumper->next_seq) -+ /* -+ * Find first record that fits, including all following records, -+ * into the user-provided buffer for this dump. -+ */ -+ -+ prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { -+ if (info.seq >= dumper->next_seq) - break; -- l += get_record_print_text_size(&info, line_count, syslog, time); -- seq = r.info->seq + 1; -+ len += get_record_print_text_size(&info, line_count, syslog, time); - } - -- /* move first record forward until length fits into the buffer */ -- seq = dumper->cur_seq; -- while (l >= size && prb_read_valid_info(prb, seq, -- &info, &line_count)) { -- if (r.info->seq >= dumper->next_seq) -+ /* -+ * Move first record forward until length fits into the buffer. Ignore -+ * newest messages that were not counted in the above cycle. Messages -+ * might appear and get lost in the meantime. This is the best effort -+ * that prevents an infinite loop. -+ */ -+ prb_for_each_info(dumper->cur_seq, prb, seq, &info, &line_count) { -+ if (len < size || info.seq >= dumper->next_seq) - break; -- l -= get_record_print_text_size(&info, line_count, syslog, time); -- seq = r.info->seq + 1; -+ len -= get_record_print_text_size(&info, line_count, syslog, time); - } - -- /* last message in next interation */ -+ /* -+ * Next kmsg_dump_get_buffer() invocation will dump block of -+ * older records stored right before this one. -+ */ - next_seq = seq; - -- /* actually read text into the buffer now */ -- l = 0; -- while (prb_read_valid(prb, seq, &r)) { -+ prb_rec_init_rd(&r, &info, buf, size); -+ -+ len = 0; -+ prb_for_each_record(seq, prb, seq, &r) { - if (r.info->seq >= dumper->next_seq) - break; - -- l += record_print_text(&r, syslog, time); -- -- /* adjust record to store to remaining buffer space */ -- prb_rec_init_rd(&r, &info, buf + l, size - l); -+ len += record_print_text(&r, syslog, time); - -- seq = r.info->seq + 1; -+ /* Adjust record to store to remaining buffer space. */ -+ prb_rec_init_rd(&r, &info, buf + len, size - len); - } - - dumper->next_seq = next_seq; - ret = true; - logbuf_unlock_irqrestore(flags); - out: -- if (len) -- *len = l; -+ if (len_out) -+ *len_out = len; - return ret; - } - EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); --- -2.19.1 - diff --git a/features/rt/printk-relocate-printk_delay-and-vprintk_default.patch b/features/rt/printk-relocate-printk_delay-and-vprintk_default.patch deleted file mode 100644 index 3e26bd6f..00000000 --- a/features/rt/printk-relocate-printk_delay-and-vprintk_default.patch +++ /dev/null @@ -1,88 +0,0 @@ -From d517c77fcda22109a0cfd3bd55312c4404eb3206 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:03 +0106 -Subject: [PATCH 026/191] printk: relocate printk_delay() and vprintk_default() - -Move printk_delay() and vprintk_default() "as is" further up so that -they can be used by new functions in an upcoming commit. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 40 ++++++++++++++++++++-------------------- - 1 file changed, 20 insertions(+), 20 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 5af6f757818f..84fae4f08634 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1725,6 +1725,20 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) - return do_syslog(type, buf, len, SYSLOG_FROM_READER); - } - -+int printk_delay_msec __read_mostly; -+ -+static inline void printk_delay(void) -+{ -+ if (unlikely(printk_delay_msec)) { -+ int m = printk_delay_msec; -+ -+ while (m--) { -+ mdelay(1); -+ touch_nmi_watchdog(); -+ } -+ } -+} -+ - /* - * Special console_lock variants that help to reduce the risk of soft-lockups. - * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1968,20 +1982,6 @@ static void printk_exit_irqrestore(unsigned long flags) - local_irq_restore(flags); - } - --int printk_delay_msec __read_mostly; -- --static inline void printk_delay(void) --{ -- if (unlikely(printk_delay_msec)) { -- int m = printk_delay_msec; -- -- while (m--) { -- mdelay(1); -- touch_nmi_watchdog(); -- } -- } --} -- - static inline u32 printk_caller_id(void) - { - return in_task() ? task_pid_nr(current) : -@@ -2214,18 +2214,18 @@ asmlinkage int vprintk_emit(int facility, int level, - } - EXPORT_SYMBOL(vprintk_emit); - --asmlinkage int vprintk(const char *fmt, va_list args) --{ -- return vprintk_func(fmt, args); --} --EXPORT_SYMBOL(vprintk); -- - int vprintk_default(const char *fmt, va_list args) - { - return vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, fmt, args); - } - EXPORT_SYMBOL_GPL(vprintk_default); - -+asmlinkage int vprintk(const char *fmt, va_list args) -+{ -+ return vprintk_func(fmt, args); -+} -+EXPORT_SYMBOL(vprintk); -+ - /** - * printk - print a kernel message - * @fmt: format string --- -2.19.1 - diff --git a/features/rt/printk-remove-deferred-printing.patch b/features/rt/printk-remove-deferred-printing.patch deleted file mode 100644 index 2777df6c..00000000 --- a/features/rt/printk-remove-deferred-printing.patch +++ /dev/null @@ -1,432 +0,0 @@ -From 67ba4172040ce8b57495aabc320404e9e7379e7a Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:08 +0106 -Subject: [PATCH 031/191] printk: remove deferred printing - -Since printing occurs either atomically or from the printing -kthread, there is no need for any deferring or tracking possible -recursion paths. Remove all printk context tracking. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/arm/kernel/smp.c | 2 - - arch/powerpc/kexec/crash.c | 3 -- - include/linux/hardirq.h | 2 - - include/linux/printk.h | 12 ----- - kernel/printk/Makefile | 1 - - kernel/printk/internal.h | 70 ----------------------------- - kernel/printk/printk.c | 58 +++++++++--------------- - kernel/printk/printk_safe.c | 89 ------------------------------------- - kernel/trace/trace.c | 2 - - 9 files changed, 22 insertions(+), 217 deletions(-) - delete mode 100644 kernel/printk/internal.h - delete mode 100644 kernel/printk/printk_safe.c - -diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c -index 74679240a9d8..0dd2d733ad62 100644 ---- a/arch/arm/kernel/smp.c -+++ b/arch/arm/kernel/smp.c -@@ -668,9 +668,7 @@ static void do_handle_IPI(int ipinr) - break; - - case IPI_CPU_BACKTRACE: -- printk_nmi_enter(); - nmi_cpu_backtrace(get_irq_regs()); -- printk_nmi_exit(); - break; - - default: -diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c -index c9a889880214..d488311efab1 100644 ---- a/arch/powerpc/kexec/crash.c -+++ b/arch/powerpc/kexec/crash.c -@@ -311,9 +311,6 @@ void default_machine_crash_shutdown(struct pt_regs *regs) - unsigned int i; - int (*old_handler)(struct pt_regs *regs); - -- /* Avoid hardlocking with irresponsive CPU holding logbuf_lock */ -- printk_nmi_enter(); -- - /* - * This function is only called after the system - * has panicked or is otherwise in a critical state. -diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h -index 7c9d6a2d7e90..0926e9ca4d85 100644 ---- a/include/linux/hardirq.h -+++ b/include/linux/hardirq.h -@@ -115,7 +115,6 @@ extern void rcu_nmi_exit(void); - do { \ - lockdep_off(); \ - arch_nmi_enter(); \ -- printk_nmi_enter(); \ - BUG_ON(in_nmi() == NMI_MASK); \ - __preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \ - } while (0) -@@ -134,7 +133,6 @@ extern void rcu_nmi_exit(void); - do { \ - BUG_ON(!in_nmi()); \ - __preempt_count_sub(NMI_OFFSET + HARDIRQ_OFFSET); \ -- printk_nmi_exit(); \ - arch_nmi_exit(); \ - lockdep_on(); \ - } while (0) -diff --git a/include/linux/printk.h b/include/linux/printk.h -index 1ebd93581acc..153212445b68 100644 ---- a/include/linux/printk.h -+++ b/include/linux/printk.h -@@ -155,18 +155,6 @@ static inline __printf(1, 2) __cold - void early_printk(const char *s, ...) { } - #endif - --#ifdef CONFIG_PRINTK_NMI --extern void printk_nmi_enter(void); --extern void printk_nmi_exit(void); --extern void printk_nmi_direct_enter(void); --extern void printk_nmi_direct_exit(void); --#else --static inline void printk_nmi_enter(void) { } --static inline void printk_nmi_exit(void) { } --static inline void printk_nmi_direct_enter(void) { } --static inline void printk_nmi_direct_exit(void) { } --#endif /* PRINTK_NMI */ -- - struct dev_printk_info; - - #ifdef CONFIG_PRINTK -diff --git a/kernel/printk/Makefile b/kernel/printk/Makefile -index eee3dc9b60a9..59cb24e25f00 100644 ---- a/kernel/printk/Makefile -+++ b/kernel/printk/Makefile -@@ -1,5 +1,4 @@ - # SPDX-License-Identifier: GPL-2.0-only - obj-y = printk.o --obj-$(CONFIG_PRINTK) += printk_safe.o - obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o - obj-$(CONFIG_PRINTK) += printk_ringbuffer.o -diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h -deleted file mode 100644 -index e108b2ece8c7..000000000000 ---- a/kernel/printk/internal.h -+++ /dev/null -@@ -1,70 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0-or-later */ --/* -- * internal.h - printk internal definitions -- */ --#include <linux/percpu.h> -- --#ifdef CONFIG_PRINTK -- --#define PRINTK_SAFE_CONTEXT_MASK 0x007ffffff --#define PRINTK_NMI_DIRECT_CONTEXT_MASK 0x008000000 --#define PRINTK_NMI_CONTEXT_MASK 0xff0000000 -- --#define PRINTK_NMI_CONTEXT_OFFSET 0x010000000 -- --__printf(4, 0) --int vprintk_store(int facility, int level, -- const struct dev_printk_info *dev_info, -- const char *fmt, va_list args); -- --__printf(1, 0) int vprintk_default(const char *fmt, va_list args); --__printf(1, 0) int vprintk_deferred(const char *fmt, va_list args); --__printf(1, 0) int vprintk_func(const char *fmt, va_list args); --void __printk_safe_enter(void); --void __printk_safe_exit(void); -- --bool printk_percpu_data_ready(void); -- --#define printk_safe_enter_irqsave(flags) \ -- do { \ -- local_irq_save(flags); \ -- __printk_safe_enter(); \ -- } while (0) -- --#define printk_safe_exit_irqrestore(flags) \ -- do { \ -- __printk_safe_exit(); \ -- local_irq_restore(flags); \ -- } while (0) -- --#define printk_safe_enter_irq() \ -- do { \ -- local_irq_disable(); \ -- __printk_safe_enter(); \ -- } while (0) -- --#define printk_safe_exit_irq() \ -- do { \ -- __printk_safe_exit(); \ -- local_irq_enable(); \ -- } while (0) -- --void defer_console_output(void); -- --#else -- --__printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; } -- --/* -- * In !PRINTK builds we still export console_sem -- * semaphore and some of console functions (console_unlock()/etc.), so -- * printk-safe must preserve the existing local IRQ guarantees. -- */ --#define printk_safe_enter_irqsave(flags) local_irq_save(flags) --#define printk_safe_exit_irqrestore(flags) local_irq_restore(flags) -- --#define printk_safe_enter_irq() local_irq_disable() --#define printk_safe_exit_irq() local_irq_enable() -- --static inline bool printk_percpu_data_ready(void) { return false; } --#endif /* CONFIG_PRINTK */ -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index e2dd2abfb855..d1b25ac5c73b 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -45,6 +45,7 @@ - #include <linux/ctype.h> - #include <linux/uio.h> - #include <linux/kthread.h> -+#include <linux/kdb.h> - #include <linux/clocksource.h> - #include <linux/sched/clock.h> - #include <linux/sched/debug.h> -@@ -60,7 +61,6 @@ - #include "printk_ringbuffer.h" - #include "console_cmdline.h" - #include "braille.h" --#include "internal.h" - - int console_printk[4] = { - CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */ -@@ -227,19 +227,7 @@ static int nr_ext_console_drivers; - - static int __down_trylock_console_sem(unsigned long ip) - { -- int lock_failed; -- unsigned long flags; -- -- /* -- * Here and in __up_console_sem() we need to be in safe mode, -- * because spindump/WARN/etc from under console ->lock will -- * deadlock in printk()->down_trylock_console_sem() otherwise. -- */ -- printk_safe_enter_irqsave(flags); -- lock_failed = down_trylock(&console_sem); -- printk_safe_exit_irqrestore(flags); -- -- if (lock_failed) -+ if (down_trylock(&console_sem)) - return 1; - mutex_acquire(&console_lock_dep_map, 0, 1, ip); - return 0; -@@ -248,13 +236,9 @@ static int __down_trylock_console_sem(unsigned long ip) - - static void __up_console_sem(unsigned long ip) - { -- unsigned long flags; -- - mutex_release(&console_lock_dep_map, ip); - -- printk_safe_enter_irqsave(flags); - up(&console_sem); -- printk_safe_exit_irqrestore(flags); - } - #define up_console_sem() __up_console_sem(_RET_IP_) - -@@ -426,7 +410,7 @@ static struct printk_ringbuffer *prb = &printk_rb_static; - */ - static bool __printk_percpu_data_ready __read_mostly; - --bool printk_percpu_data_ready(void) -+static bool printk_percpu_data_ready(void) - { - return __printk_percpu_data_ready; - } -@@ -1060,7 +1044,6 @@ void __init setup_log_buf(int early) - struct printk_record r; - size_t new_descs_size; - size_t new_infos_size; -- unsigned long flags; - char *new_log_buf; - unsigned int free; - u64 seq; -@@ -1958,9 +1941,9 @@ static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lfl - } - - __printf(4, 0) --int vprintk_store(int facility, int level, -- const struct dev_printk_info *dev_info, -- const char *fmt, va_list args) -+static int vprintk_store(int facility, int level, -+ const struct dev_printk_info *dev_info, -+ const char *fmt, va_list args) - { - const u32 caller_id = printk_caller_id(); - struct prb_reserved_entry e; -@@ -2106,11 +2089,22 @@ asmlinkage int vprintk_emit(int facility, int level, - } - EXPORT_SYMBOL(vprintk_emit); - --int vprintk_default(const char *fmt, va_list args) -+__printf(1, 0) -+static int vprintk_default(const char *fmt, va_list args) - { - return vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, fmt, args); - } --EXPORT_SYMBOL_GPL(vprintk_default); -+ -+__printf(1, 0) -+static int vprintk_func(const char *fmt, va_list args) -+{ -+#ifdef CONFIG_KGDB_KDB -+ /* Allow to pass printk() to kdb but avoid a recursion. */ -+ if (unlikely(kdb_trap_printk && kdb_printf_cpu < 0)) -+ return vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args); -+#endif -+ return vprintk_default(fmt, args); -+} - - asmlinkage int vprintk(const char *fmt, va_list args) - { -@@ -3073,18 +3067,10 @@ void wake_up_klogd(void) - preempt_enable(); - } - --void defer_console_output(void) --{ --} -- --int vprintk_deferred(const char *fmt, va_list args) -+__printf(1, 0) -+static int vprintk_deferred(const char *fmt, va_list args) - { -- int r; -- -- r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, fmt, args); -- defer_console_output(); -- -- return r; -+ return vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, fmt, args); - } - - int printk_deferred(const char *fmt, ...) -diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c -deleted file mode 100644 -index 3ee2d62e80ef..000000000000 ---- a/kernel/printk/printk_safe.c -+++ /dev/null -@@ -1,89 +0,0 @@ --// SPDX-License-Identifier: GPL-2.0-or-later --/* -- * printk_safe.c - Safe printk for printk-deadlock-prone contexts -- */ -- --#include <linux/preempt.h> --#include <linux/spinlock.h> --#include <linux/debug_locks.h> --#include <linux/kdb.h> --#include <linux/smp.h> --#include <linux/cpumask.h> --#include <linux/irq_work.h> --#include <linux/printk.h> --#include <linux/kprobes.h> -- --#include "internal.h" -- --static DEFINE_PER_CPU(int, printk_context); -- --#ifdef CONFIG_PRINTK_NMI -- --void noinstr printk_nmi_enter(void) --{ -- this_cpu_add(printk_context, PRINTK_NMI_CONTEXT_OFFSET); --} -- --void noinstr printk_nmi_exit(void) --{ -- this_cpu_sub(printk_context, PRINTK_NMI_CONTEXT_OFFSET); --} -- --/* -- * Marks a code that might produce many messages in NMI context -- * and the risk of losing them is more critical than eventual -- * reordering. -- */ --void printk_nmi_direct_enter(void) --{ -- if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) -- this_cpu_or(printk_context, PRINTK_NMI_DIRECT_CONTEXT_MASK); --} -- --void printk_nmi_direct_exit(void) --{ -- this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); --} -- --#endif /* CONFIG_PRINTK_NMI */ -- --/* Can be preempted by NMI. */ --void __printk_safe_enter(void) --{ -- this_cpu_inc(printk_context); --} -- --/* Can be preempted by NMI. */ --void __printk_safe_exit(void) --{ -- this_cpu_dec(printk_context); --} -- --__printf(1, 0) int vprintk_func(const char *fmt, va_list args) --{ --#ifdef CONFIG_KGDB_KDB -- /* Allow to pass printk() to kdb but avoid a recursion. */ -- if (unlikely(kdb_trap_printk && kdb_printf_cpu < 0)) -- return vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args); --#endif -- -- /* -- * Use the main logbuf even in NMI. But avoid calling console -- * drivers that might have their own locks. -- */ -- if (this_cpu_read(printk_context) & -- (PRINTK_NMI_DIRECT_CONTEXT_MASK | -- PRINTK_NMI_CONTEXT_MASK | -- PRINTK_SAFE_CONTEXT_MASK)) { -- int len; -- -- printk_safe_enter_irqsave(flags); -- len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); -- printk_safe_exit_irqrestore(flags); -- defer_console_output(); -- return len; -- } -- -- /* No obstacles. */ -- return vprintk_default(fmt, args); --} -diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index eccb4e1187cc..a6baa9b174e4 100644 ---- a/kernel/trace/trace.c -+++ b/kernel/trace/trace.c -@@ -9404,7 +9404,6 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) - tracing_off(); - - local_irq_save(flags); -- printk_nmi_direct_enter(); - - /* Simulate the iterator */ - trace_init_global_iter(&iter); -@@ -9486,7 +9485,6 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) - atomic_dec(&per_cpu_ptr(iter.array_buffer->data, cpu)->disabled); - } - atomic_dec(&dump_running); -- printk_nmi_direct_exit(); - local_irq_restore(flags); - } - EXPORT_SYMBOL_GPL(ftrace_dump); --- -2.19.1 - diff --git a/features/rt/printk-remove-logbuf_lock.patch b/features/rt/printk-remove-logbuf_lock.patch deleted file mode 100644 index 9c211ab8..00000000 --- a/features/rt/printk-remove-logbuf_lock.patch +++ /dev/null @@ -1,485 +0,0 @@ -From e2710afdb8e86bd9c77ab1c3ca433719dc087b64 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Tue, 26 Jan 2021 17:43:19 +0106 -Subject: [PATCH 017/191] printk: remove logbuf_lock - -Since the ringbuffer is lockless, there is no need for it to be -protected by @logbuf_lock. Remove @logbuf_lock. - -This means that printk_nmi_direct and printk_safe_flush_on_panic() -no longer need to acquire any lock to run. - -@console_seq, @exclusive_console_stop_seq, @console_dropped are -protected by @console_lock. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/internal.h | 4 +- - kernel/printk/printk.c | 118 ++++++++++++------------------------ - kernel/printk/printk_safe.c | 29 +++------ - 3 files changed, 48 insertions(+), 103 deletions(-) - -diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h -index 3a8fd491758c..e7acc2888c8e 100644 ---- a/kernel/printk/internal.h -+++ b/kernel/printk/internal.h -@@ -12,8 +12,6 @@ - - #define PRINTK_NMI_CONTEXT_OFFSET 0x010000000 - --extern raw_spinlock_t logbuf_lock; -- - __printf(4, 0) - int vprintk_store(int facility, int level, - const struct dev_printk_info *dev_info, -@@ -59,7 +57,7 @@ void defer_console_output(void); - __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; } - - /* -- * In !PRINTK builds we still export logbuf_lock spin_lock, console_sem -+ * In !PRINTK builds we still export console_sem - * semaphore and some of console functions (console_unlock()/etc.), so - * printk-safe must preserve the existing local IRQ guarantees. - */ -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 7d426c5dcec6..32b2d763aef7 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -355,41 +355,6 @@ enum log_flags { - LOG_CONT = 8, /* text is a fragment of a continuation line */ - }; - --/* -- * The logbuf_lock protects kmsg buffer, indices, counters. This can be taken -- * within the scheduler's rq lock. It must be released before calling -- * console_unlock() or anything else that might wake up a process. -- */ --DEFINE_RAW_SPINLOCK(logbuf_lock); -- --/* -- * Helper macros to lock/unlock logbuf_lock and switch between -- * printk-safe/unsafe modes. -- */ --#define logbuf_lock_irq() \ -- do { \ -- printk_safe_enter_irq(); \ -- raw_spin_lock(&logbuf_lock); \ -- } while (0) -- --#define logbuf_unlock_irq() \ -- do { \ -- raw_spin_unlock(&logbuf_lock); \ -- printk_safe_exit_irq(); \ -- } while (0) -- --#define logbuf_lock_irqsave(flags) \ -- do { \ -- printk_safe_enter_irqsave(flags); \ -- raw_spin_lock(&logbuf_lock); \ -- } while (0) -- --#define logbuf_unlock_irqrestore(flags) \ -- do { \ -- raw_spin_unlock(&logbuf_lock); \ -- printk_safe_exit_irqrestore(flags); \ -- } while (0) -- - /* syslog_lock protects syslog_* variables and write access to clear_seq. */ - static DEFINE_RAW_SPINLOCK(syslog_lock); - -@@ -401,6 +366,7 @@ static u64 syslog_seq; - static size_t syslog_partial; - static bool syslog_time; - -+/* All 3 protected by @console_sem. */ - /* the next printk record to write to the console */ - static u64 console_seq; - static u64 exclusive_console_stop_seq; -@@ -766,27 +732,27 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - if (ret) - return ret; - -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { - if (file->f_flags & O_NONBLOCK) { - ret = -EAGAIN; -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - goto out; - } - -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - ret = wait_event_interruptible(log_wait, - prb_read_valid(prb, atomic64_read(&user->seq), r)); - if (ret) - goto out; -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - } - - if (r->info->seq != atomic64_read(&user->seq)) { - /* our last seen message is gone, return error and reset */ - atomic64_set(&user->seq, r->info->seq); - ret = -EPIPE; -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - goto out; - } - -@@ -796,7 +762,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - &r->info->dev_info); - - atomic64_set(&user->seq, r->info->seq + 1); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - - if (len > count) { - ret = -EINVAL; -@@ -831,7 +797,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - if (offset) - return -ESPIPE; - -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - switch (whence) { - case SEEK_SET: - /* the first record */ -@@ -852,7 +818,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - default: - ret = -EINVAL; - } -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - return ret; - } - -@@ -867,15 +833,15 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait) - - poll_wait(file, &log_wait, wait); - -- logbuf_lock_irq(); -- if (prb_read_valid_info(prb, user->seq, &info, NULL)) { -+ printk_safe_enter_irq(); -+ if (prb_read_valid_info(prb, atomic64_read(&user->seq), &info, NULL)) { - /* return error when data has vanished underneath us */ - if (info.seq != atomic64_read(&user->seq)) - ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI; - else - ret = EPOLLIN|EPOLLRDNORM; - } -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - - return ret; - } -@@ -908,9 +874,9 @@ static int devkmsg_open(struct inode *inode, struct file *file) - prb_rec_init_rd(&user->record, &user->info, - &user->text_buf[0], sizeof(user->text_buf)); - -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - atomic64_set(&user->seq, prb_first_valid_seq(prb)); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - - file->private_data = user; - return 0; -@@ -1532,11 +1498,11 @@ static int syslog_print(char __user *buf, int size) - size_t n; - size_t skip; - -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - raw_spin_lock(&syslog_lock); - if (!prb_read_valid(prb, syslog_seq, &r)) { - raw_spin_unlock(&syslog_lock); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - break; - } - if (r.info->seq != syslog_seq) { -@@ -1566,7 +1532,7 @@ static int syslog_print(char __user *buf, int size) - } else - n = 0; - raw_spin_unlock(&syslog_lock); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - - if (!n) - break; -@@ -1600,7 +1566,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - return -ENOMEM; - - time = printk_time; -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - /* - * Find first record that fits, including all following records, - * into the user-provided buffer for this dump. -@@ -1621,12 +1587,12 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - break; - } - -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - if (copy_to_user(buf + len, text, textlen)) - len = -EFAULT; - else - len += textlen; -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - - if (len < 0) - break; -@@ -1637,7 +1603,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - latched_seq_write(&clear_seq, seq); - raw_spin_unlock(&syslog_lock); - } -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - - kfree(text); - return len; -@@ -1645,11 +1611,11 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - - static void syslog_clear(void) - { -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - raw_spin_lock(&syslog_lock); - latched_seq_write(&clear_seq, prb_next_seq(prb)); - raw_spin_unlock(&syslog_lock); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - } - - /* Return a consistent copy of @syslog_seq. */ -@@ -1737,12 +1703,12 @@ int do_syslog(int type, char __user *buf, int len, int source) - break; - /* Number of chars in the log buffer */ - case SYSLOG_ACTION_SIZE_UNREAD: -- logbuf_lock_irq(); -+ printk_safe_enter_irq(); - raw_spin_lock(&syslog_lock); - if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { - /* No unread messages. */ - raw_spin_unlock(&syslog_lock); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - return 0; - } - if (info.seq != syslog_seq) { -@@ -1771,7 +1737,7 @@ int do_syslog(int type, char __user *buf, int len, int source) - error -= syslog_partial; - } - raw_spin_unlock(&syslog_lock); -- logbuf_unlock_irq(); -+ printk_safe_exit_irq(); - break; - /* Size of the log buffer */ - case SYSLOG_ACTION_SIZE_BUFFER: -@@ -2627,7 +2593,6 @@ void console_unlock(void) - size_t len; - - printk_safe_enter_irqsave(flags); -- raw_spin_lock(&logbuf_lock); - skip: - if (!prb_read_valid(prb, console_seq, &r)) - break; -@@ -2671,7 +2636,6 @@ void console_unlock(void) - console_msg_format & MSG_FORMAT_SYSLOG, - printk_time); - console_seq++; -- raw_spin_unlock(&logbuf_lock); - - /* - * While actively printing out messages, if another printk() -@@ -2698,8 +2662,6 @@ void console_unlock(void) - - console_locked = 0; - -- raw_spin_unlock(&logbuf_lock); -- - up_console_sem(); - - /* -@@ -2708,9 +2670,7 @@ void console_unlock(void) - * there's a new owner and the console_unlock() from them will do the - * flush, no worries. - */ -- raw_spin_lock(&logbuf_lock); - retry = prb_read_valid(prb, console_seq, NULL); -- raw_spin_unlock(&logbuf_lock); - printk_safe_exit_irqrestore(flags); - - if (retry && console_trylock()) -@@ -2777,9 +2737,9 @@ void console_flush_on_panic(enum con_flush_mode mode) - if (mode == CONSOLE_REPLAY_ALL) { - unsigned long flags; - -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - console_seq = prb_first_valid_seq(prb); -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - } - console_unlock(); - } -@@ -3008,7 +2968,7 @@ void register_console(struct console *newcon) - * console_unlock(); will print out the buffered messages - * for us. - */ -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - /* - * We're about to replay the log buffer. Only do this to the - * just-registered console to avoid excessive message spam to -@@ -3026,7 +2986,7 @@ void register_console(struct console *newcon) - console_seq = syslog_seq; - raw_spin_unlock(&syslog_lock); - -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - } - console_unlock(); - console_sysfs_notify(); -@@ -3410,10 +3370,10 @@ void kmsg_dump(enum kmsg_dump_reason reason) - - /* initialize iterator with data about the stored records */ - iter.active = true; -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - iter.cur_seq = latched_seq_read_nolock(&clear_seq); - iter.next_seq = prb_next_seq(prb); -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - - /* invoke dumper which will iterate over records */ - dumper->dump(dumper, reason, &iter); -@@ -3500,9 +3460,9 @@ bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - unsigned long flags; - bool ret; - -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - ret = kmsg_dump_get_line_nolock(iter, syslog, line, size, len); -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - - return ret; - } -@@ -3542,7 +3502,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - if (!iter->active || !buf || !size) - goto out; - -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { - if (info.seq != iter->cur_seq) { - /* messages are gone, move to first available one */ -@@ -3552,7 +3512,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - - /* last entry */ - if (iter->cur_seq >= iter->next_seq) { -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - goto out; - } - -@@ -3586,7 +3546,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - - iter->next_seq = next_seq; - ret = true; -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - out: - if (len_out) - *len_out = len; -@@ -3622,9 +3582,9 @@ void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - { - unsigned long flags; - -- logbuf_lock_irqsave(flags); -+ printk_safe_enter_irqsave(flags); - kmsg_dump_rewind_nolock(iter); -- logbuf_unlock_irqrestore(flags); -+ printk_safe_exit_irqrestore(flags); - } - EXPORT_SYMBOL_GPL(kmsg_dump_rewind); - -diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c -index 2e9e3ed7d63e..7df8a88d4115 100644 ---- a/kernel/printk/printk_safe.c -+++ b/kernel/printk/printk_safe.c -@@ -16,7 +16,7 @@ - #include "internal.h" - - /* -- * printk() could not take logbuf_lock in NMI context. Instead, -+ * In NMI and safe mode, printk() avoids taking locks. Instead, - * it uses an alternative implementation that temporary stores - * the strings into a per-CPU buffer. The content of the buffer - * is later flushed into the main ring buffer via IRQ work. -@@ -266,18 +266,6 @@ void printk_safe_flush(void) - */ - void printk_safe_flush_on_panic(void) - { -- /* -- * Make sure that we could access the main ring buffer. -- * Do not risk a double release when more CPUs are up. -- */ -- if (raw_spin_is_locked(&logbuf_lock)) { -- if (num_online_cpus() > 1) -- return; -- -- debug_locks_off(); -- raw_spin_lock_init(&logbuf_lock); -- } -- - if (raw_spin_is_locked(&safe_read_lock)) { - if (num_online_cpus() > 1) - return; -@@ -319,9 +307,7 @@ void noinstr printk_nmi_exit(void) - * reordering. - * - * It has effect only when called in NMI context. Then printk() -- * will try to store the messages into the main logbuf directly -- * and use the per-CPU buffers only as a fallback when the lock -- * is not available. -+ * will store the messages into the main logbuf directly. - */ - void printk_nmi_direct_enter(void) - { -@@ -376,20 +362,21 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) - #endif - - /* -- * Try to use the main logbuf even in NMI. But avoid calling console -+ * Use the main logbuf even in NMI. But avoid calling console - * drivers that might have their own locks. - */ -- if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) && -- raw_spin_trylock(&logbuf_lock)) { -+ if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) { -+ unsigned long flags; - int len; - -+ printk_safe_enter_irqsave(flags); - len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args); -- raw_spin_unlock(&logbuf_lock); -+ printk_safe_exit_irqrestore(flags); - defer_console_output(); - return len; - } - -- /* Use extra buffer in NMI when logbuf_lock is taken or in safe mode. */ -+ /* Use extra buffer in NMI. */ - if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) - return vprintk_nmi(fmt, args); - --- -2.19.1 - diff --git a/features/rt/printk-remove-safe-buffers.patch b/features/rt/printk-remove-safe-buffers.patch deleted file mode 100644 index 66ca3843..00000000 --- a/features/rt/printk-remove-safe-buffers.patch +++ /dev/null @@ -1,875 +0,0 @@ -From 5d9a7df0372d8da92a5260fd9a4cd756a0b31fb0 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:00 +0106 -Subject: [PATCH 022/191] printk: remove safe buffers - -With @logbuf_lock removed, the high level printk functions for -storing messages are lockless. Messages can be stored from any -context, so there is no need for the NMI and safe buffers anymore. - -Remove the NMI and safe buffers. In NMI or safe contexts, store -the message immediately but still use irq_work to defer the console -printing. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/powerpc/kernel/traps.c | 1 - - arch/powerpc/kernel/watchdog.c | 5 - - include/linux/printk.h | 10 - - kernel/kexec_core.c | 1 - - kernel/panic.c | 3 - - kernel/printk/internal.h | 2 - - kernel/printk/printk.c | 85 ++------- - kernel/printk/printk_safe.c | 328 +-------------------------------- - lib/nmi_backtrace.c | 6 - - 9 files changed, 17 insertions(+), 424 deletions(-) - -diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c -index a44a30b0688c..5828c83eaca6 100644 ---- a/arch/powerpc/kernel/traps.c -+++ b/arch/powerpc/kernel/traps.c -@@ -171,7 +171,6 @@ extern void panic_flush_kmsg_start(void) - - extern void panic_flush_kmsg_end(void) - { -- printk_safe_flush_on_panic(); - kmsg_dump(KMSG_DUMP_PANIC); - bust_spinlocks(0); - debug_locks_off(); -diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c -index c9a8f4781a10..dc17d8903d4f 100644 ---- a/arch/powerpc/kernel/watchdog.c -+++ b/arch/powerpc/kernel/watchdog.c -@@ -183,11 +183,6 @@ static void watchdog_smp_panic(int cpu, u64 tb) - - wd_smp_unlock(&flags); - -- printk_safe_flush(); -- /* -- * printk_safe_flush() seems to require another print -- * before anything actually goes out to console. -- */ - if (sysctl_hardlockup_all_cpu_backtrace) - trigger_allbutself_cpu_backtrace(); - -diff --git a/include/linux/printk.h b/include/linux/printk.h -index fe7eb2351610..2476796c1150 100644 ---- a/include/linux/printk.h -+++ b/include/linux/printk.h -@@ -207,8 +207,6 @@ __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...); - void dump_stack_print_info(const char *log_lvl); - void show_regs_print_info(const char *log_lvl); - extern asmlinkage void dump_stack(void) __cold; --extern void printk_safe_flush(void); --extern void printk_safe_flush_on_panic(void); - #else - static inline __printf(1, 0) - int vprintk(const char *s, va_list args) -@@ -272,14 +270,6 @@ static inline void show_regs_print_info(const char *log_lvl) - static inline void dump_stack(void) - { - } -- --static inline void printk_safe_flush(void) --{ --} -- --static inline void printk_safe_flush_on_panic(void) --{ --} - #endif - - extern int kptr_restrict; -diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c -index a0b6780740c8..480d5f77ef4f 100644 ---- a/kernel/kexec_core.c -+++ b/kernel/kexec_core.c -@@ -977,7 +977,6 @@ void crash_kexec(struct pt_regs *regs) - old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, this_cpu); - if (old_cpu == PANIC_CPU_INVALID) { - /* This is the 1st CPU which comes here, so go ahead. */ -- printk_safe_flush_on_panic(); - __crash_kexec(regs); - - /* -diff --git a/kernel/panic.c b/kernel/panic.c -index 21d59a508272..c722faaae44b 100644 ---- a/kernel/panic.c -+++ b/kernel/panic.c -@@ -247,7 +247,6 @@ void panic(const char *fmt, ...) - * Bypass the panic_cpu check and call __crash_kexec directly. - */ - if (!_crash_kexec_post_notifiers) { -- printk_safe_flush_on_panic(); - __crash_kexec(NULL); - - /* -@@ -271,8 +270,6 @@ void panic(const char *fmt, ...) - */ - atomic_notifier_call_chain(&panic_notifier_list, 0, buf); - -- /* Call flush even twice. It tries harder with a single online CPU */ -- printk_safe_flush_on_panic(); - kmsg_dump(KMSG_DUMP_PANIC); - - /* -diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h -index e7acc2888c8e..e108b2ece8c7 100644 ---- a/kernel/printk/internal.h -+++ b/kernel/printk/internal.h -@@ -23,7 +23,6 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args); - void __printk_safe_enter(void); - void __printk_safe_exit(void); - --void printk_safe_init(void); - bool printk_percpu_data_ready(void); - - #define printk_safe_enter_irqsave(flags) \ -@@ -67,6 +66,5 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; } - #define printk_safe_enter_irq() local_irq_disable() - #define printk_safe_exit_irq() local_irq_enable() - --static inline void printk_safe_init(void) { } - static inline bool printk_percpu_data_ready(void) { return false; } - #endif /* CONFIG_PRINTK */ -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 008a0ede8b05..274d4ef05a90 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -732,27 +732,22 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - if (ret) - return ret; - -- printk_safe_enter_irq(); - if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { - if (file->f_flags & O_NONBLOCK) { - ret = -EAGAIN; -- printk_safe_exit_irq(); - goto out; - } - -- printk_safe_exit_irq(); - ret = wait_event_interruptible(log_wait, - prb_read_valid(prb, atomic64_read(&user->seq), r)); - if (ret) - goto out; -- printk_safe_enter_irq(); - } - - if (r->info->seq != atomic64_read(&user->seq)) { - /* our last seen message is gone, return error and reset */ - atomic64_set(&user->seq, r->info->seq); - ret = -EPIPE; -- printk_safe_exit_irq(); - goto out; - } - -@@ -762,7 +757,6 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - &r->info->dev_info); - - atomic64_set(&user->seq, r->info->seq + 1); -- printk_safe_exit_irq(); - - if (len > count) { - ret = -EINVAL; -@@ -797,7 +791,6 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - if (offset) - return -ESPIPE; - -- printk_safe_enter_irq(); - switch (whence) { - case SEEK_SET: - /* the first record */ -@@ -818,7 +811,6 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - default: - ret = -EINVAL; - } -- printk_safe_exit_irq(); - return ret; - } - -@@ -833,7 +825,6 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait) - - poll_wait(file, &log_wait, wait); - -- printk_safe_enter_irq(); - if (prb_read_valid_info(prb, atomic64_read(&user->seq), &info, NULL)) { - /* return error when data has vanished underneath us */ - if (info.seq != atomic64_read(&user->seq)) -@@ -841,7 +832,6 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait) - else - ret = EPOLLIN|EPOLLRDNORM; - } -- printk_safe_exit_irq(); - - return ret; - } -@@ -874,9 +864,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) - prb_rec_init_rd(&user->record, &user->info, - &user->text_buf[0], sizeof(user->text_buf)); - -- printk_safe_enter_irq(); - atomic64_set(&user->seq, prb_first_valid_seq(prb)); -- printk_safe_exit_irq(); - - file->private_data = user; - return 0; -@@ -1042,9 +1030,6 @@ static inline void log_buf_add_cpu(void) {} - - static void __init set_percpu_data_ready(void) - { -- printk_safe_init(); -- /* Make sure we set this flag only after printk_safe() init is done */ -- barrier(); - __printk_percpu_data_ready = true; - } - -@@ -1142,8 +1127,6 @@ void __init setup_log_buf(int early) - new_descs, ilog2(new_descs_count), - new_infos); - -- printk_safe_enter_irqsave(flags); -- - log_buf_len = new_log_buf_len; - log_buf = new_log_buf; - new_log_buf_len = 0; -@@ -1159,8 +1142,6 @@ void __init setup_log_buf(int early) - */ - prb = &printk_rb_dynamic; - -- printk_safe_exit_irqrestore(flags); -- - if (seq != prb_next_seq(&printk_rb_static)) { - pr_err("dropped %llu messages\n", - prb_next_seq(&printk_rb_static) - seq); -@@ -1498,11 +1479,9 @@ static int syslog_print(char __user *buf, int size) - size_t n; - size_t skip; - -- printk_safe_enter_irq(); -- raw_spin_lock(&syslog_lock); -+ raw_spin_lock_irq(&syslog_lock); - if (!prb_read_valid(prb, syslog_seq, &r)) { -- raw_spin_unlock(&syslog_lock); -- printk_safe_exit_irq(); -+ raw_spin_unlock_irq(&syslog_lock); - break; - } - if (r.info->seq != syslog_seq) { -@@ -1531,8 +1510,7 @@ static int syslog_print(char __user *buf, int size) - syslog_partial += n; - } else - n = 0; -- raw_spin_unlock(&syslog_lock); -- printk_safe_exit_irq(); -+ raw_spin_unlock_irq(&syslog_lock); - - if (!n) - break; -@@ -1566,7 +1544,6 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - return -ENOMEM; - - time = printk_time; -- printk_safe_enter_irq(); - /* - * Find first record that fits, including all following records, - * into the user-provided buffer for this dump. -@@ -1587,23 +1564,20 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - break; - } - -- printk_safe_exit_irq(); - if (copy_to_user(buf + len, text, textlen)) - len = -EFAULT; - else - len += textlen; -- printk_safe_enter_irq(); - - if (len < 0) - break; - } - - if (clear) { -- raw_spin_lock(&syslog_lock); -+ raw_spin_lock_irq(&syslog_lock); - latched_seq_write(&clear_seq, seq); -- raw_spin_unlock(&syslog_lock); -+ raw_spin_unlock_irq(&syslog_lock); - } -- printk_safe_exit_irq(); - - kfree(text); - return len; -@@ -1611,11 +1585,9 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - - static void syslog_clear(void) - { -- printk_safe_enter_irq(); -- raw_spin_lock(&syslog_lock); -+ raw_spin_lock_irq(&syslog_lock); - latched_seq_write(&clear_seq, prb_next_seq(prb)); -- raw_spin_unlock(&syslog_lock); -- printk_safe_exit_irq(); -+ raw_spin_unlock_irq(&syslog_lock); - } - - /* Return a consistent copy of @syslog_seq. */ -@@ -1703,12 +1675,10 @@ int do_syslog(int type, char __user *buf, int len, int source) - break; - /* Number of chars in the log buffer */ - case SYSLOG_ACTION_SIZE_UNREAD: -- printk_safe_enter_irq(); -- raw_spin_lock(&syslog_lock); -+ raw_spin_lock_irq(&syslog_lock); - if (!prb_read_valid_info(prb, syslog_seq, &info, NULL)) { - /* No unread messages. */ -- raw_spin_unlock(&syslog_lock); -- printk_safe_exit_irq(); -+ raw_spin_unlock_irq(&syslog_lock); - return 0; - } - if (info.seq != syslog_seq) { -@@ -1736,8 +1706,7 @@ int do_syslog(int type, char __user *buf, int len, int source) - } - error -= syslog_partial; - } -- raw_spin_unlock(&syslog_lock); -- printk_safe_exit_irq(); -+ raw_spin_unlock_irq(&syslog_lock); - break; - /* Size of the log buffer */ - case SYSLOG_ACTION_SIZE_BUFFER: -@@ -2207,7 +2176,6 @@ asmlinkage int vprintk_emit(int facility, int level, - { - int printed_len; - bool in_sched = false; -- unsigned long flags; - - /* Suppress unimportant messages after panic happens */ - if (unlikely(suppress_printk)) -@@ -2221,9 +2189,7 @@ asmlinkage int vprintk_emit(int facility, int level, - boot_delay_msec(level); - printk_delay(); - -- printk_safe_enter_irqsave(flags); - printed_len = vprintk_store(facility, level, dev_info, fmt, args); -- printk_safe_exit_irqrestore(flags); - - /* If called from the scheduler, we can not call up(). */ - if (!in_sched) { -@@ -2615,7 +2581,6 @@ void console_unlock(void) - { - static char ext_text[CONSOLE_EXT_LOG_MAX]; - static char text[CONSOLE_LOG_MAX]; -- unsigned long flags; - bool do_cond_resched, retry; - struct printk_info info; - struct printk_record r; -@@ -2660,7 +2625,6 @@ void console_unlock(void) - size_t ext_len = 0; - size_t len; - -- printk_safe_enter_irqsave(flags); - skip: - if (!prb_read_valid(prb, console_seq, &r)) - break; -@@ -2717,12 +2681,8 @@ void console_unlock(void) - call_console_drivers(ext_text, ext_len, text, len); - start_critical_timings(); - -- if (console_lock_spinning_disable_and_check()) { -- printk_safe_exit_irqrestore(flags); -+ if (console_lock_spinning_disable_and_check()) - return; -- } -- -- printk_safe_exit_irqrestore(flags); - - if (do_cond_resched) - cond_resched(); -@@ -2739,8 +2699,6 @@ void console_unlock(void) - * flush, no worries. - */ - retry = prb_read_valid(prb, console_seq, NULL); -- printk_safe_exit_irqrestore(flags); -- - if (retry && console_trylock()) - goto again; - } -@@ -2802,13 +2760,8 @@ void console_flush_on_panic(enum con_flush_mode mode) - console_trylock(); - console_may_schedule = 0; - -- if (mode == CONSOLE_REPLAY_ALL) { -- unsigned long flags; -- -- printk_safe_enter_irqsave(flags); -+ if (mode == CONSOLE_REPLAY_ALL) - console_seq = prb_first_valid_seq(prb); -- printk_safe_exit_irqrestore(flags); -- } - console_unlock(); - } - -@@ -3464,11 +3417,9 @@ bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - struct printk_info info; - unsigned int line_count; - struct printk_record r; -- unsigned long flags; - size_t l = 0; - bool ret = false; - -- printk_safe_enter_irqsave(flags); - prb_rec_init_rd(&r, &info, line, size); - - if (!iter->active) -@@ -3492,7 +3443,6 @@ bool kmsg_dump_get_line(struct kmsg_dumper_iter *iter, bool syslog, - iter->cur_seq = r.info->seq + 1; - ret = true; - out: -- printk_safe_exit_irqrestore(flags); - if (len) - *len = l; - return ret; -@@ -3523,7 +3473,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - { - struct printk_info info; - struct printk_record r; -- unsigned long flags; - u64 seq; - u64 next_seq; - size_t len = 0; -@@ -3533,7 +3482,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - if (!iter->active || !buf || !size) - goto out; - -- printk_safe_enter_irqsave(flags); - if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { - if (info.seq != iter->cur_seq) { - /* messages are gone, move to first available one */ -@@ -3542,10 +3490,8 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - } - - /* last entry */ -- if (iter->cur_seq >= iter->next_seq) { -- printk_safe_exit_irqrestore(flags); -+ if (iter->cur_seq >= iter->next_seq) - goto out; -- } - - /* - * Find first record that fits, including all following records, -@@ -3577,7 +3523,6 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper_iter *iter, bool syslog, - - iter->next_seq = next_seq; - ret = true; -- printk_safe_exit_irqrestore(flags); - out: - if (len_out) - *len_out = len; -@@ -3595,12 +3540,8 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); - */ - void kmsg_dump_rewind(struct kmsg_dumper_iter *iter) - { -- unsigned long flags; -- -- printk_safe_enter_irqsave(flags); - iter->cur_seq = latched_seq_read_nolock(&clear_seq); - iter->next_seq = prb_next_seq(prb); -- printk_safe_exit_irqrestore(flags); - } - EXPORT_SYMBOL_GPL(kmsg_dump_rewind); - -diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c -index 7df8a88d4115..3ee2d62e80ef 100644 ---- a/kernel/printk/printk_safe.c -+++ b/kernel/printk/printk_safe.c -@@ -15,281 +15,9 @@ - - #include "internal.h" - --/* -- * In NMI and safe mode, printk() avoids taking locks. Instead, -- * it uses an alternative implementation that temporary stores -- * the strings into a per-CPU buffer. The content of the buffer -- * is later flushed into the main ring buffer via IRQ work. -- * -- * The alternative implementation is chosen transparently -- * by examining current printk() context mask stored in @printk_context -- * per-CPU variable. -- * -- * The implementation allows to flush the strings also from another CPU. -- * There are situations when we want to make sure that all buffers -- * were handled or when IRQs are blocked. -- */ -- --#define SAFE_LOG_BUF_LEN ((1 << CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT) - \ -- sizeof(atomic_t) - \ -- sizeof(atomic_t) - \ -- sizeof(struct irq_work)) -- --struct printk_safe_seq_buf { -- atomic_t len; /* length of written data */ -- atomic_t message_lost; -- struct irq_work work; /* IRQ work that flushes the buffer */ -- unsigned char buffer[SAFE_LOG_BUF_LEN]; --}; -- --static DEFINE_PER_CPU(struct printk_safe_seq_buf, safe_print_seq); - static DEFINE_PER_CPU(int, printk_context); - --static DEFINE_RAW_SPINLOCK(safe_read_lock); -- - #ifdef CONFIG_PRINTK_NMI --static DEFINE_PER_CPU(struct printk_safe_seq_buf, nmi_print_seq); --#endif -- --/* Get flushed in a more safe context. */ --static void queue_flush_work(struct printk_safe_seq_buf *s) --{ -- if (printk_percpu_data_ready()) -- irq_work_queue(&s->work); --} -- --/* -- * Add a message to per-CPU context-dependent buffer. NMI and printk-safe -- * have dedicated buffers, because otherwise printk-safe preempted by -- * NMI-printk would have overwritten the NMI messages. -- * -- * The messages are flushed from irq work (or from panic()), possibly, -- * from other CPU, concurrently with printk_safe_log_store(). Should this -- * happen, printk_safe_log_store() will notice the buffer->len mismatch -- * and repeat the write. -- */ --static __printf(2, 0) int printk_safe_log_store(struct printk_safe_seq_buf *s, -- const char *fmt, va_list args) --{ -- int add; -- size_t len; -- va_list ap; -- --again: -- len = atomic_read(&s->len); -- -- /* The trailing '\0' is not counted into len. */ -- if (len >= sizeof(s->buffer) - 1) { -- atomic_inc(&s->message_lost); -- queue_flush_work(s); -- return 0; -- } -- -- /* -- * Make sure that all old data have been read before the buffer -- * was reset. This is not needed when we just append data. -- */ -- if (!len) -- smp_rmb(); -- -- va_copy(ap, args); -- add = vscnprintf(s->buffer + len, sizeof(s->buffer) - len, fmt, ap); -- va_end(ap); -- if (!add) -- return 0; -- -- /* -- * Do it once again if the buffer has been flushed in the meantime. -- * Note that atomic_cmpxchg() is an implicit memory barrier that -- * makes sure that the data were written before updating s->len. -- */ -- if (atomic_cmpxchg(&s->len, len, len + add) != len) -- goto again; -- -- queue_flush_work(s); -- return add; --} -- --static inline void printk_safe_flush_line(const char *text, int len) --{ -- /* -- * Avoid any console drivers calls from here, because we may be -- * in NMI or printk_safe context (when in panic). The messages -- * must go only into the ring buffer at this stage. Consoles will -- * get explicitly called later when a crashdump is not generated. -- */ -- printk_deferred("%.*s", len, text); --} -- --/* printk part of the temporary buffer line by line */ --static int printk_safe_flush_buffer(const char *start, size_t len) --{ -- const char *c, *end; -- bool header; -- -- c = start; -- end = start + len; -- header = true; -- -- /* Print line by line. */ -- while (c < end) { -- if (*c == '\n') { -- printk_safe_flush_line(start, c - start + 1); -- start = ++c; -- header = true; -- continue; -- } -- -- /* Handle continuous lines or missing new line. */ -- if ((c + 1 < end) && printk_get_level(c)) { -- if (header) { -- c = printk_skip_level(c); -- continue; -- } -- -- printk_safe_flush_line(start, c - start); -- start = c++; -- header = true; -- continue; -- } -- -- header = false; -- c++; -- } -- -- /* Check if there was a partial line. Ignore pure header. */ -- if (start < end && !header) { -- static const char newline[] = KERN_CONT "\n"; -- -- printk_safe_flush_line(start, end - start); -- printk_safe_flush_line(newline, strlen(newline)); -- } -- -- return len; --} -- --static void report_message_lost(struct printk_safe_seq_buf *s) --{ -- int lost = atomic_xchg(&s->message_lost, 0); -- -- if (lost) -- printk_deferred("Lost %d message(s)!\n", lost); --} -- --/* -- * Flush data from the associated per-CPU buffer. The function -- * can be called either via IRQ work or independently. -- */ --static void __printk_safe_flush(struct irq_work *work) --{ -- struct printk_safe_seq_buf *s = -- container_of(work, struct printk_safe_seq_buf, work); -- unsigned long flags; -- size_t len; -- int i; -- -- /* -- * The lock has two functions. First, one reader has to flush all -- * available message to make the lockless synchronization with -- * writers easier. Second, we do not want to mix messages from -- * different CPUs. This is especially important when printing -- * a backtrace. -- */ -- raw_spin_lock_irqsave(&safe_read_lock, flags); -- -- i = 0; --more: -- len = atomic_read(&s->len); -- -- /* -- * This is just a paranoid check that nobody has manipulated -- * the buffer an unexpected way. If we printed something then -- * @len must only increase. Also it should never overflow the -- * buffer size. -- */ -- if ((i && i >= len) || len > sizeof(s->buffer)) { -- const char *msg = "printk_safe_flush: internal error\n"; -- -- printk_safe_flush_line(msg, strlen(msg)); -- len = 0; -- } -- -- if (!len) -- goto out; /* Someone else has already flushed the buffer. */ -- -- /* Make sure that data has been written up to the @len */ -- smp_rmb(); -- i += printk_safe_flush_buffer(s->buffer + i, len - i); -- -- /* -- * Check that nothing has got added in the meantime and truncate -- * the buffer. Note that atomic_cmpxchg() is an implicit memory -- * barrier that makes sure that the data were copied before -- * updating s->len. -- */ -- if (atomic_cmpxchg(&s->len, len, 0) != len) -- goto more; -- --out: -- report_message_lost(s); -- raw_spin_unlock_irqrestore(&safe_read_lock, flags); --} -- --/** -- * printk_safe_flush - flush all per-cpu nmi buffers. -- * -- * The buffers are flushed automatically via IRQ work. This function -- * is useful only when someone wants to be sure that all buffers have -- * been flushed at some point. -- */ --void printk_safe_flush(void) --{ -- int cpu; -- -- for_each_possible_cpu(cpu) { --#ifdef CONFIG_PRINTK_NMI -- __printk_safe_flush(&per_cpu(nmi_print_seq, cpu).work); --#endif -- __printk_safe_flush(&per_cpu(safe_print_seq, cpu).work); -- } --} -- --/** -- * printk_safe_flush_on_panic - flush all per-cpu nmi buffers when the system -- * goes down. -- * -- * Similar to printk_safe_flush() but it can be called even in NMI context when -- * the system goes down. It does the best effort to get NMI messages into -- * the main ring buffer. -- * -- * Note that it could try harder when there is only one CPU online. -- */ --void printk_safe_flush_on_panic(void) --{ -- if (raw_spin_is_locked(&safe_read_lock)) { -- if (num_online_cpus() > 1) -- return; -- -- debug_locks_off(); -- raw_spin_lock_init(&safe_read_lock); -- } -- -- printk_safe_flush(); --} -- --#ifdef CONFIG_PRINTK_NMI --/* -- * Safe printk() for NMI context. It uses a per-CPU buffer to -- * store the message. NMIs are not nested, so there is always only -- * one writer running. But the buffer might get flushed from another -- * CPU, so we need to be careful. -- */ --static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args) --{ -- struct printk_safe_seq_buf *s = this_cpu_ptr(&nmi_print_seq); -- -- return printk_safe_log_store(s, fmt, args); --} - - void noinstr printk_nmi_enter(void) - { -@@ -305,9 +33,6 @@ void noinstr printk_nmi_exit(void) - * Marks a code that might produce many messages in NMI context - * and the risk of losing them is more critical than eventual - * reordering. -- * -- * It has effect only when called in NMI context. Then printk() -- * will store the messages into the main logbuf directly. - */ - void printk_nmi_direct_enter(void) - { -@@ -320,27 +45,8 @@ void printk_nmi_direct_exit(void) - this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); - } - --#else -- --static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args) --{ -- return 0; --} -- - #endif /* CONFIG_PRINTK_NMI */ - --/* -- * Lock-less printk(), to avoid deadlocks should the printk() recurse -- * into itself. It uses a per-CPU buffer to store the message, just like -- * NMI. -- */ --static __printf(1, 0) int vprintk_safe(const char *fmt, va_list args) --{ -- struct printk_safe_seq_buf *s = this_cpu_ptr(&safe_print_seq); -- -- return printk_safe_log_store(s, fmt, args); --} -- - /* Can be preempted by NMI. */ - void __printk_safe_enter(void) - { -@@ -365,8 +71,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) - * Use the main logbuf even in NMI. But avoid calling console - * drivers that might have their own locks. - */ -- if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) { -- unsigned long flags; -+ if (this_cpu_read(printk_context) & -+ (PRINTK_NMI_DIRECT_CONTEXT_MASK | -+ PRINTK_NMI_CONTEXT_MASK | -+ PRINTK_SAFE_CONTEXT_MASK)) { - int len; - - printk_safe_enter_irqsave(flags); -@@ -376,34 +84,6 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) - return len; - } - -- /* Use extra buffer in NMI. */ -- if (this_cpu_read(printk_context) & PRINTK_NMI_CONTEXT_MASK) -- return vprintk_nmi(fmt, args); -- -- /* Use extra buffer to prevent a recursion deadlock in safe mode. */ -- if (this_cpu_read(printk_context) & PRINTK_SAFE_CONTEXT_MASK) -- return vprintk_safe(fmt, args); -- - /* No obstacles. */ - return vprintk_default(fmt, args); - } -- --void __init printk_safe_init(void) --{ -- int cpu; -- -- for_each_possible_cpu(cpu) { -- struct printk_safe_seq_buf *s; -- -- s = &per_cpu(safe_print_seq, cpu); -- init_irq_work(&s->work, __printk_safe_flush); -- --#ifdef CONFIG_PRINTK_NMI -- s = &per_cpu(nmi_print_seq, cpu); -- init_irq_work(&s->work, __printk_safe_flush); --#endif -- } -- -- /* Flush pending messages that did not have scheduled IRQ works. */ -- printk_safe_flush(); --} -diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c -index 8abe1870dba4..b09a490f5f70 100644 ---- a/lib/nmi_backtrace.c -+++ b/lib/nmi_backtrace.c -@@ -75,12 +75,6 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask, - touch_softlockup_watchdog(); - } - -- /* -- * Force flush any remote buffers that might be stuck in IRQ context -- * and therefore could not run their irq_work. -- */ -- printk_safe_flush(); -- - clear_bit_unlock(0, &backtrace_flag); - put_cpu(); - } --- -2.19.1 - diff --git a/features/rt/printk-track-limit-recursion.patch b/features/rt/printk-track-limit-recursion.patch deleted file mode 100644 index 0eba8c25..00000000 --- a/features/rt/printk-track-limit-recursion.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 23b2babe079f76add633021e717676da7f238ff8 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Fri, 11 Dec 2020 00:55:25 +0106 -Subject: [PATCH 021/191] printk: track/limit recursion - -Limit printk() recursion to 1 level. This is enough to print a -stacktrace for the printk call, should a WARN or BUG occur. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 74 ++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 71 insertions(+), 3 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 523621889a72..008a0ede8b05 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -1940,6 +1940,65 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, - } - } - -+#ifdef CONFIG_PRINTK_NMI -+#define NUM_RECURSION_CTX 2 -+#else -+#define NUM_RECURSION_CTX 1 -+#endif -+ -+struct printk_recursion { -+ char count[NUM_RECURSION_CTX]; -+}; -+ -+static DEFINE_PER_CPU(struct printk_recursion, percpu_printk_recursion); -+static char printk_recursion_count[NUM_RECURSION_CTX]; -+ -+static char *printk_recursion_counter(void) -+{ -+ struct printk_recursion *rec; -+ char *count; -+ -+ if (!printk_percpu_data_ready()) { -+ count = &printk_recursion_count[0]; -+ } else { -+ rec = this_cpu_ptr(&percpu_printk_recursion); -+ -+ count = &rec->count[0]; -+ } -+ -+#ifdef CONFIG_PRINTK_NMI -+ if (in_nmi()) -+ count++; -+#endif -+ -+ return count; -+} -+ -+static bool printk_enter_irqsave(unsigned long *flags) -+{ -+ char *count; -+ -+ local_irq_save(*flags); -+ count = printk_recursion_counter(); -+ /* Only 1 level of recursion allowed. */ -+ if (*count > 1) { -+ local_irq_restore(*flags); -+ return false; -+ } -+ (*count)++; -+ -+ return true; -+} -+ -+static void printk_exit_irqrestore(unsigned long flags) -+{ -+ char *count; -+ -+ count = printk_recursion_counter(); -+ (*count)--; -+ local_irq_restore(flags); -+} -+ - int printk_delay_msec __read_mostly; - - static inline void printk_delay(void) -@@ -2040,11 +2099,13 @@ int vprintk_store(int facility, int level, - struct prb_reserved_entry e; - enum log_flags lflags = 0; - struct printk_record r; -+ unsigned long irqflags; - u16 trunc_msg_len = 0; - char prefix_buf[8]; - u16 reserve_size; - va_list args2; - u16 text_len; -+ int ret = 0; - u64 ts_nsec; - - /* -@@ -2055,6 +2116,9 @@ int vprintk_store(int facility, int level, - */ - ts_nsec = local_clock(); - -+ if (!printk_enter_irqsave(&irqflags)) -+ return 0; -+ - /* - * The sprintf needs to come first since the syslog prefix might be - * passed in as a parameter. An extra byte must be reserved so that -@@ -2092,7 +2156,8 @@ int vprintk_store(int facility, int level, - prb_commit(&e); - } - -- return text_len; -+ ret = text_len; -+ goto out; - } - } - -@@ -2108,7 +2173,7 @@ int vprintk_store(int facility, int level, - - prb_rec_init_wr(&r, reserve_size + trunc_msg_len); - if (!prb_reserve(&e, prb, &r)) -- return 0; -+ goto out; - } - - /* fill message */ -@@ -2130,7 +2195,10 @@ int vprintk_store(int facility, int level, - else - prb_final_commit(&e); - -- return (text_len + trunc_msg_len); -+ ret = text_len + trunc_msg_len; -+out: -+ printk_exit_irqrestore(irqflags); -+ return ret; - } - - asmlinkage int vprintk_emit(int facility, int level, --- -2.19.1 - diff --git a/features/rt/printk-use-atomic64_t-for-devkmsg_user.seq.patch b/features/rt/printk-use-atomic64_t-for-devkmsg_user.seq.patch deleted file mode 100644 index 2c798ea0..00000000 --- a/features/rt/printk-use-atomic64_t-for-devkmsg_user.seq.patch +++ /dev/null @@ -1,111 +0,0 @@ -From ce5e82552c7e13c881911a386426cf474a77ae70 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Thu, 10 Dec 2020 15:33:40 +0106 -Subject: [PATCH 013/191] printk: use atomic64_t for devkmsg_user.seq - -@user->seq is indirectly protected by @logbuf_lock. Once @logbuf_lock -is removed, @user->seq will be no longer safe from an atomicity point -of view. - -In preparation for the removal of @logbuf_lock, change it to -atomic64_t to provide this safety. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> ---- - kernel/printk/printk.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index b764222b325b..0031bb2156d1 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -662,7 +662,7 @@ static ssize_t msg_print_ext_body(char *buf, size_t size, - - /* /dev/kmsg - userspace message inject/listen interface */ - struct devkmsg_user { -- u64 seq; -+ atomic64_t seq; - struct ratelimit_state rs; - struct mutex lock; - char buf[CONSOLE_EXT_LOG_MAX]; -@@ -763,7 +763,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - return ret; - - logbuf_lock_irq(); -- if (!prb_read_valid(prb, user->seq, r)) { -+ if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { - if (file->f_flags & O_NONBLOCK) { - ret = -EAGAIN; - logbuf_unlock_irq(); -@@ -772,15 +772,15 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - - logbuf_unlock_irq(); - ret = wait_event_interruptible(log_wait, -- prb_read_valid(prb, user->seq, r)); -+ prb_read_valid(prb, atomic64_read(&user->seq), r)); - if (ret) - goto out; - logbuf_lock_irq(); - } - -- if (r->info->seq != user->seq) { -+ if (r->info->seq != atomic64_read(&user->seq)) { - /* our last seen message is gone, return error and reset */ -- user->seq = r->info->seq; -+ atomic64_set(&user->seq, r->info->seq); - ret = -EPIPE; - logbuf_unlock_irq(); - goto out; -@@ -791,7 +791,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - &r->text_buf[0], r->info->text_len, - &r->info->dev_info); - -- user->seq = r->info->seq + 1; -+ atomic64_set(&user->seq, r->info->seq + 1); - logbuf_unlock_irq(); - - if (len > count) { -@@ -831,7 +831,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - switch (whence) { - case SEEK_SET: - /* the first record */ -- user->seq = prb_first_valid_seq(prb); -+ atomic64_set(&user->seq, prb_first_valid_seq(prb)); - break; - case SEEK_DATA: - /* -@@ -839,11 +839,11 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - * like issued by 'dmesg -c'. Reading /dev/kmsg itself - * changes no global state, and does not clear anything. - */ -- user->seq = latched_seq_read_nolock(&clear_seq); -+ atomic64_set(&user->seq, latched_seq_read_nolock(&clear_seq)); - break; - case SEEK_END: - /* after the last record */ -- user->seq = prb_next_seq(prb); -+ atomic64_set(&user->seq, prb_next_seq(prb)); - break; - default: - ret = -EINVAL; -@@ -866,7 +866,7 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait) - logbuf_lock_irq(); - if (prb_read_valid_info(prb, user->seq, &info, NULL)) { - /* return error when data has vanished underneath us */ -- if (info.seq != user->seq) -+ if (info.seq != atomic64_read(&user->seq)) - ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI; - else - ret = EPOLLIN|EPOLLRDNORM; -@@ -905,7 +905,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) - &user->text_buf[0], sizeof(user->text_buf)); - - logbuf_lock_irq(); -- user->seq = prb_first_valid_seq(prb); -+ atomic64_set(&user->seq, prb_first_valid_seq(prb)); - logbuf_unlock_irq(); - - file->private_data = user; --- -2.19.1 - diff --git a/features/rt/printk-use-seqcount_latch-for-clear_seq.patch b/features/rt/printk-use-seqcount_latch-for-clear_seq.patch deleted file mode 100644 index 35a9bd69..00000000 --- a/features/rt/printk-use-seqcount_latch-for-clear_seq.patch +++ /dev/null @@ -1,146 +0,0 @@ -From e6a23cb5f39c0c3e2cbaef3af7b0ab41fd2104ae Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:41:58 +0106 -Subject: [PATCH 012/191] printk: use seqcount_latch for clear_seq - -kmsg_dump_rewind_nolock() locklessly reads @clear_seq. However, -this is not done atomically. Since @clear_seq is 64-bit, this -cannot be an atomic operation for all platforms. Therefore, use -a seqcount_latch to allow readers to always read a consistent -value. - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Reviewed-by: Petr Mladek <pmladek@suse.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/printk/printk.c | 58 ++++++++++++++++++++++++++++++++++++------ - 1 file changed, 50 insertions(+), 8 deletions(-) - -diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index 8a903faaec4e..b764222b325b 100644 ---- a/kernel/printk/printk.c -+++ b/kernel/printk/printk.c -@@ -402,8 +402,21 @@ static u64 console_seq; - static u64 exclusive_console_stop_seq; - static unsigned long console_dropped; - --/* the next printk record to read after the last 'clear' command */ --static u64 clear_seq; -+struct latched_seq { -+ seqcount_latch_t latch; -+ u64 val[2]; -+}; -+ -+/* -+ * The next printk record to read after the last 'clear' command. There are -+ * two copies (updated with seqcount_latch) so that reads can locklessly -+ * access a valid value. Writers are synchronized by @logbuf_lock. -+ */ -+static struct latched_seq clear_seq = { -+ .latch = SEQCNT_LATCH_ZERO(clear_seq.latch), -+ .val[0] = 0, -+ .val[1] = 0, -+}; - - #ifdef CONFIG_PRINTK_CALLER - #define PREFIX_MAX 48 -@@ -457,6 +470,31 @@ bool printk_percpu_data_ready(void) - return __printk_percpu_data_ready; - } - -+/* Must be called under logbuf_lock. */ -+static void latched_seq_write(struct latched_seq *ls, u64 val) -+{ -+ raw_write_seqcount_latch(&ls->latch); -+ ls->val[0] = val; -+ raw_write_seqcount_latch(&ls->latch); -+ ls->val[1] = val; -+} -+ -+/* Can be called from any context. */ -+static u64 latched_seq_read_nolock(struct latched_seq *ls) -+{ -+ unsigned int seq; -+ unsigned int idx; -+ u64 val; -+ -+ do { -+ seq = raw_read_seqcount_latch(&ls->latch); -+ idx = seq & 0x1; -+ val = ls->val[idx]; -+ } while (read_seqcount_latch_retry(&ls->latch, seq)); -+ -+ return val; -+} -+ - /* Return log buffer address */ - char *log_buf_addr_get(void) - { -@@ -801,7 +839,7 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence) - * like issued by 'dmesg -c'. Reading /dev/kmsg itself - * changes no global state, and does not clear anything. - */ -- user->seq = clear_seq; -+ user->seq = latched_seq_read_nolock(&clear_seq); - break; - case SEEK_END: - /* after the last record */ -@@ -960,6 +998,9 @@ void log_buf_vmcoreinfo_setup(void) - - VMCOREINFO_SIZE(atomic_long_t); - VMCOREINFO_TYPE_OFFSET(atomic_long_t, counter); -+ -+ VMCOREINFO_STRUCT_SIZE(latched_seq); -+ VMCOREINFO_OFFSET(latched_seq, val); - } - #endif - -@@ -1557,7 +1598,8 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - * Find first record that fits, including all following records, - * into the user-provided buffer for this dump. - */ -- seq = find_first_fitting_seq(clear_seq, -1, size, true, time); -+ seq = find_first_fitting_seq(latched_seq_read_nolock(&clear_seq), -1, -+ size, true, time); - - prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX); - -@@ -1584,7 +1626,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - } - - if (clear) -- clear_seq = seq; -+ latched_seq_write(&clear_seq, seq); - logbuf_unlock_irq(); - - kfree(text); -@@ -1594,7 +1636,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear) - static void syslog_clear(void) - { - logbuf_lock_irq(); -- clear_seq = prb_next_seq(prb); -+ latched_seq_write(&clear_seq, prb_next_seq(prb)); - logbuf_unlock_irq(); - } - -@@ -3336,7 +3378,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) - dumper->active = true; - - logbuf_lock_irqsave(flags); -- dumper->cur_seq = clear_seq; -+ dumper->cur_seq = latched_seq_read_nolock(&clear_seq); - dumper->next_seq = prb_next_seq(prb); - logbuf_unlock_irqrestore(flags); - -@@ -3534,7 +3576,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_buffer); - */ - void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) - { -- dumper->cur_seq = clear_seq; -+ dumper->cur_seq = latched_seq_read_nolock(&clear_seq); - dumper->next_seq = prb_next_seq(prb); - } - --- -2.19.1 - diff --git a/features/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch b/features/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch deleted file mode 100644 index fb15eefc..00000000 --- a/features/rt/ptrace-fix-ptrace-vs-tasklist_lock-race.patch +++ /dev/null @@ -1,165 +0,0 @@ -From e49cfce7661aafc70145d7647cace3b08a5cff26 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 29 Aug 2013 18:21:04 +0200 -Subject: [PATCH 128/191] ptrace: fix ptrace vs tasklist_lock race - -As explained by Alexander Fyodorov <halcy@yandex.ru>: - -|read_lock(&tasklist_lock) in ptrace_stop() is converted to mutex on RT kernel, -|and it can remove __TASK_TRACED from task->state (by moving it to -|task->saved_state). If parent does wait() on child followed by a sys_ptrace -|call, the following race can happen: -| -|- child sets __TASK_TRACED in ptrace_stop() -|- parent does wait() which eventually calls wait_task_stopped() and returns -| child's pid -|- child blocks on read_lock(&tasklist_lock) in ptrace_stop() and moves -| __TASK_TRACED flag to saved_state -|- parent calls sys_ptrace, which calls ptrace_check_attach() and wait_task_inactive() - -The patch is based on his initial patch where an additional check is -added in case the __TASK_TRACED moved to ->saved_state. The pi_lock is -taken in case the caller is interrupted between looking into ->state and -->saved_state. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/sched.h | 49 +++++++++++++++++++++++++++++++++++++++---- - kernel/ptrace.c | 9 +++++++- - kernel/sched/core.c | 17 +++++++++++++-- - 3 files changed, 68 insertions(+), 7 deletions(-) - -diff --git a/include/linux/sched.h b/include/linux/sched.h -index 1d85cfa28fe6..dab770a030bd 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -112,12 +112,8 @@ struct task_group; - __TASK_TRACED | EXIT_DEAD | EXIT_ZOMBIE | \ - TASK_PARKED) - --#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) -- - #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) - --#define task_is_stopped_or_traced(task) ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) -- - #ifdef CONFIG_DEBUG_ATOMIC_SLEEP - - /* -@@ -1884,6 +1880,51 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) - return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); - } - -+static inline bool __task_is_stopped_or_traced(struct task_struct *task) -+{ -+ if (task->state & (__TASK_STOPPED | __TASK_TRACED)) -+ return true; -+#ifdef CONFIG_PREEMPT_RT -+ if (task->saved_state & (__TASK_STOPPED | __TASK_TRACED)) -+ return true; -+#endif -+ return false; -+} -+ -+static inline bool task_is_stopped_or_traced(struct task_struct *task) -+{ -+ bool traced_stopped; -+ -+#ifdef CONFIG_PREEMPT_RT -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&task->pi_lock, flags); -+ traced_stopped = __task_is_stopped_or_traced(task); -+ raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+#else -+ traced_stopped = __task_is_stopped_or_traced(task); -+#endif -+ return traced_stopped; -+} -+ -+static inline bool task_is_traced(struct task_struct *task) -+{ -+ bool traced = false; -+ -+ if (task->state & __TASK_TRACED) -+ return true; -+#ifdef CONFIG_PREEMPT_RT -+ /* in case the task is sleeping on tasklist_lock */ -+ raw_spin_lock_irq(&task->pi_lock); -+ if (task->state & __TASK_TRACED) -+ traced = true; -+ else if (task->saved_state & __TASK_TRACED) -+ traced = true; -+ raw_spin_unlock_irq(&task->pi_lock); -+#endif -+ return traced; -+} -+ - /* - * cond_resched() and cond_resched_lock(): latency reduction via - * explicit rescheduling in places that are safe. The return -diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index 821cf1723814..3bb0ec669997 100644 ---- a/kernel/ptrace.c -+++ b/kernel/ptrace.c -@@ -180,7 +180,14 @@ static bool ptrace_freeze_traced(struct task_struct *task) - - spin_lock_irq(&task->sighand->siglock); - if (task_is_traced(task) && !__fatal_signal_pending(task)) { -- task->state = __TASK_TRACED; -+ unsigned long flags; -+ -+ raw_spin_lock_irqsave(&task->pi_lock, flags); -+ if (task->state & __TASK_TRACED) -+ task->state = __TASK_TRACED; -+ else -+ task->saved_state = __TASK_TRACED; -+ raw_spin_unlock_irqrestore(&task->pi_lock, flags); - ret = true; - } - spin_unlock_irq(&task->sighand->siglock); -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index c05455d4f034..5dc7a8edf093 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -2596,6 +2596,18 @@ int migrate_swap(struct task_struct *cur, struct task_struct *p, - } - #endif /* CONFIG_NUMA_BALANCING */ - -+static bool check_task_state(struct task_struct *p, long match_state) -+{ -+ bool match = false; -+ -+ raw_spin_lock_irq(&p->pi_lock); -+ if (p->state == match_state || p->saved_state == match_state) -+ match = true; -+ raw_spin_unlock_irq(&p->pi_lock); -+ -+ return match; -+} -+ - /* - * wait_task_inactive - wait for a thread to unschedule. - * -@@ -2640,7 +2652,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) - * is actually now running somewhere else! - */ - while (task_running(rq, p)) { -- if (match_state && unlikely(p->state != match_state)) -+ if (match_state && !check_task_state(p, match_state)) - return 0; - cpu_relax(); - } -@@ -2655,7 +2667,8 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state) - running = task_running(rq, p); - queued = task_on_rq_queued(p); - ncsw = 0; -- if (!match_state || p->state == match_state) -+ if (!match_state || p->state == match_state || -+ p->saved_state == match_state) - ncsw = p->nvcsw | LONG_MIN; /* sets MSB */ - task_rq_unlock(rq, p, &rf); - --- -2.19.1 - diff --git a/features/rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch b/features/rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch deleted file mode 100644 index 03d44b47..00000000 --- a/features/rt/ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 543c77838755c4c7554a11241e89298a8aae0679 Mon Sep 17 00:00:00 2001 -From: Oleg Nesterov <oleg@redhat.com> -Date: Tue, 3 Nov 2020 12:39:01 +0100 -Subject: [PATCH 129/191] ptrace: fix ptrace_unfreeze_traced() race with - rt-lock - -The patch "ptrace: fix ptrace vs tasklist_lock race" changed -ptrace_freeze_traced() to take task->saved_state into account, but -ptrace_unfreeze_traced() has the same problem and needs a similar fix: -it should check/update both ->state and ->saved_state. - -Reported-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> -Fixes: "ptrace: fix ptrace vs tasklist_lock race" -Signed-off-by: Oleg Nesterov <oleg@redhat.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Cc: stable-rt@vger.kernel.org ---- - kernel/ptrace.c | 23 +++++++++++++++-------- - 1 file changed, 15 insertions(+), 8 deletions(-) - -diff --git a/kernel/ptrace.c b/kernel/ptrace.c -index 3bb0ec669997..95025b90810f 100644 ---- a/kernel/ptrace.c -+++ b/kernel/ptrace.c -@@ -197,8 +197,8 @@ static bool ptrace_freeze_traced(struct task_struct *task) - - static void ptrace_unfreeze_traced(struct task_struct *task) - { -- if (task->state != __TASK_TRACED) -- return; -+ unsigned long flags; -+ bool frozen = true; - - WARN_ON(!task->ptrace || task->parent != current); - -@@ -207,12 +207,19 @@ static void ptrace_unfreeze_traced(struct task_struct *task) - * Recheck state under the lock to close this race. - */ - spin_lock_irq(&task->sighand->siglock); -- if (task->state == __TASK_TRACED) { -- if (__fatal_signal_pending(task)) -- wake_up_state(task, __TASK_TRACED); -- else -- task->state = TASK_TRACED; -- } -+ -+ raw_spin_lock_irqsave(&task->pi_lock, flags); -+ if (task->state == __TASK_TRACED) -+ task->state = TASK_TRACED; -+ else if (task->saved_state == __TASK_TRACED) -+ task->saved_state = TASK_TRACED; -+ else -+ frozen = false; -+ raw_spin_unlock_irqrestore(&task->pi_lock, flags); -+ -+ if (frozen && __fatal_signal_pending(task)) -+ wake_up_state(task, __TASK_TRACED); -+ - spin_unlock_irq(&task->sighand->siglock); - } - --- -2.19.1 - diff --git a/features/rt/random-Make-it-work-on-rt.patch b/features/rt/random-Make-it-work-on-rt.patch deleted file mode 100644 index 1362346f..00000000 --- a/features/rt/random-Make-it-work-on-rt.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 39bd47e442b4654f824987ebaff05ce1dfaa1af0 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 21 Aug 2012 20:38:50 +0200 -Subject: [PATCH 149/191] random: Make it work on rt - -Delegate the random insertion to the forced threaded interrupt -handler. Store the return IP of the hard interrupt handler in the irq -descriptor and feed it into the random generator as a source of -entropy. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/x86/kernel/cpu/mshyperv.c | 3 ++- - drivers/char/random.c | 11 +++++------ - drivers/hv/hyperv_vmbus.h | 1 + - drivers/hv/vmbus_drv.c | 5 ++++- - include/linux/irqdesc.h | 1 + - include/linux/random.h | 2 +- - kernel/irq/handle.c | 8 +++++++- - kernel/irq/manage.c | 6 ++++++ - 8 files changed, 27 insertions(+), 10 deletions(-) - -diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c -index e88bc296afca..73a2494a0b2e 100644 ---- a/arch/x86/kernel/cpu/mshyperv.c -+++ b/arch/x86/kernel/cpu/mshyperv.c -@@ -85,11 +85,12 @@ EXPORT_SYMBOL_GPL(hv_remove_vmbus_irq); - DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_stimer0) - { - struct pt_regs *old_regs = set_irq_regs(regs); -+ u64 ip = regs ? instruction_pointer(regs) : 0; - - inc_irq_stat(hyperv_stimer0_count); - if (hv_stimer0_handler) - hv_stimer0_handler(); -- add_interrupt_randomness(HYPERV_STIMER0_VECTOR, 0); -+ add_interrupt_randomness(HYPERV_STIMER0_VECTOR, 0, ip); - ack_APIC_irq(); - - set_irq_regs(old_regs); -diff --git a/drivers/char/random.c b/drivers/char/random.c -index 0fe9e200e4c8..da0a1ef9615c 100644 ---- a/drivers/char/random.c -+++ b/drivers/char/random.c -@@ -1252,26 +1252,25 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs) - return *ptr; - } - --void add_interrupt_randomness(int irq, int irq_flags) -+void add_interrupt_randomness(int irq, int irq_flags, __u64 ip) - { - struct entropy_store *r; - struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness); -- struct pt_regs *regs = get_irq_regs(); - unsigned long now = jiffies; - cycles_t cycles = random_get_entropy(); - __u32 c_high, j_high; -- __u64 ip; - - if (cycles == 0) -- cycles = get_reg(fast_pool, regs); -+ cycles = get_reg(fast_pool, NULL); - c_high = (sizeof(cycles) > 4) ? cycles >> 32 : 0; - j_high = (sizeof(now) > 4) ? now >> 32 : 0; - fast_pool->pool[0] ^= cycles ^ j_high ^ irq; - fast_pool->pool[1] ^= now ^ c_high; -- ip = regs ? instruction_pointer(regs) : _RET_IP_; -+ if (!ip) -+ ip = _RET_IP_; - fast_pool->pool[2] ^= ip; - fast_pool->pool[3] ^= (sizeof(ip) > 4) ? ip >> 32 : -- get_reg(fast_pool, regs); -+ get_reg(fast_pool, NULL); - - fast_mix(fast_pool); - add_interrupt_bench(cycles); -diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h -index 9416e09ebd58..4a5767a15544 100644 ---- a/drivers/hv/hyperv_vmbus.h -+++ b/drivers/hv/hyperv_vmbus.h -@@ -18,6 +18,7 @@ - #include <linux/atomic.h> - #include <linux/hyperv.h> - #include <linux/interrupt.h> -+#include <linux/irq.h> - - #include "hv_trace.h" - -diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c -index 806950bc3c1d..e0afa5031cc4 100644 ---- a/drivers/hv/vmbus_drv.c -+++ b/drivers/hv/vmbus_drv.c -@@ -22,6 +22,7 @@ - #include <linux/clockchips.h> - #include <linux/cpu.h> - #include <linux/sched/task_stack.h> -+#include <linux/irq.h> - - #include <linux/delay.h> - #include <linux/notifier.h> -@@ -1337,6 +1338,8 @@ static void vmbus_isr(void) - void *page_addr = hv_cpu->synic_event_page; - struct hv_message *msg; - union hv_synic_event_flags *event; -+ struct pt_regs *regs = get_irq_regs(); -+ u64 ip = regs ? instruction_pointer(regs) : 0; - bool handled = false; - - if (unlikely(page_addr == NULL)) -@@ -1381,7 +1384,7 @@ static void vmbus_isr(void) - tasklet_schedule(&hv_cpu->msg_dpc); - } - -- add_interrupt_randomness(hv_get_vector(), 0); -+ add_interrupt_randomness(hv_get_vector(), 0, ip); - } - - /* -diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h -index 891b323266df..45d8bda8fd53 100644 ---- a/include/linux/irqdesc.h -+++ b/include/linux/irqdesc.h -@@ -68,6 +68,7 @@ struct irq_desc { - unsigned int irqs_unhandled; - atomic_t threads_handled; - int threads_handled_last; -+ u64 random_ip; - raw_spinlock_t lock; - struct cpumask *percpu_enabled; - const struct cpumask *percpu_affinity; -diff --git a/include/linux/random.h b/include/linux/random.h -index f45b8be3e3c4..0e41d0527809 100644 ---- a/include/linux/random.h -+++ b/include/linux/random.h -@@ -35,7 +35,7 @@ static inline void add_latent_entropy(void) {} - - extern void add_input_randomness(unsigned int type, unsigned int code, - unsigned int value) __latent_entropy; --extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy; -+extern void add_interrupt_randomness(int irq, int irq_flags, __u64 ip) __latent_entropy; - - extern void get_random_bytes(void *buf, int nbytes); - extern int wait_for_random_bytes(void); -diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c -index 762a928e18f9..7929fcdb7817 100644 ---- a/kernel/irq/handle.c -+++ b/kernel/irq/handle.c -@@ -192,10 +192,16 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc) - { - irqreturn_t retval; - unsigned int flags = 0; -+ struct pt_regs *regs = get_irq_regs(); -+ u64 ip = regs ? instruction_pointer(regs) : 0; - - retval = __handle_irq_event_percpu(desc, &flags); - -- add_interrupt_randomness(desc->irq_data.irq, flags); -+#ifdef CONFIG_PREEMPT_RT -+ desc->random_ip = ip; -+#else -+ add_interrupt_randomness(desc->irq_data.irq, flags, ip); -+#endif - - if (!noirqdebug) - note_interrupt(desc, retval); -diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c -index ac2c57429750..f4d18858d079 100644 ---- a/kernel/irq/manage.c -+++ b/kernel/irq/manage.c -@@ -1247,6 +1247,12 @@ static int irq_thread(void *data) - if (action_ret == IRQ_WAKE_THREAD) - irq_wake_secondary(desc, action); - -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { -+ migrate_disable(); -+ add_interrupt_randomness(action->irq, 0, -+ desc->random_ip ^ (unsigned long) action); -+ migrate_enable(); -+ } - wake_threads_waitq(desc); - } - --- -2.19.1 - diff --git a/features/rt/rcu-Delay-RCU-selftests.patch b/features/rt/rcu-Delay-RCU-selftests.patch deleted file mode 100644 index e6df57ca..00000000 --- a/features/rt/rcu-Delay-RCU-selftests.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 520c1da6a6bdb335171681b90eacfe32d394f358 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 10 Mar 2021 15:09:02 +0100 -Subject: [PATCH 130/191] rcu: Delay RCU-selftests - -Delay RCU-selftests until ksoftirqd is up and running. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - init/main.c | 7 +++++++ - kernel/rcu/tasks.h | 9 ++------- - 2 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/init/main.c b/init/main.c -index 608a8b27fabe..5bb42b4bbf59 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -1511,6 +1511,12 @@ void __init console_on_rootfs(void) - fput(file); - } - -+#ifdef CONFIG_PROVE_RCU -+void rcu_tasks_initiate_self_tests(void); -+#else -+static inline void rcu_tasks_initiate_self_tests(void) {} -+#endif -+ - static noinline void __init kernel_init_freeable(void) - { - #ifndef CONFIG_BLK_DEV_INITRD -@@ -1539,6 +1545,7 @@ static noinline void __init kernel_init_freeable(void) - - rcu_init_tasks_generic(); - do_pre_smp_initcalls(); -+ rcu_tasks_initiate_self_tests(); - lockup_detector_init(); - - smp_init(); -diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h -index af7c19439f4e..3384c0bc6b21 100644 ---- a/kernel/rcu/tasks.h -+++ b/kernel/rcu/tasks.h -@@ -1259,7 +1259,7 @@ static void test_rcu_tasks_callback(struct rcu_head *rhp) - rttd->notrun = true; - } - --static void rcu_tasks_initiate_self_tests(void) -+void rcu_tasks_initiate_self_tests(void) - { - pr_info("Running RCU-tasks wait API self tests\n"); - #ifdef CONFIG_TASKS_RCU -@@ -1296,9 +1296,7 @@ static int rcu_tasks_verify_self_tests(void) - return ret; - } - late_initcall(rcu_tasks_verify_self_tests); --#else /* #ifdef CONFIG_PROVE_RCU */ --static void rcu_tasks_initiate_self_tests(void) { } --#endif /* #else #ifdef CONFIG_PROVE_RCU */ -+#endif /* #ifdef CONFIG_PROVE_RCU */ - - void __init rcu_init_tasks_generic(void) - { -@@ -1313,9 +1311,6 @@ void __init rcu_init_tasks_generic(void) - #ifdef CONFIG_TASKS_TRACE_RCU - rcu_spawn_tasks_trace_kthread(); - #endif -- -- // Run the self-tests. -- rcu_tasks_initiate_self_tests(); - } - - #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */ --- -2.19.1 - diff --git a/features/rt/rcu-Prevent-false-positive-softirq-warning-on-RT.patch b/features/rt/rcu-Prevent-false-positive-softirq-warning-on-RT.patch deleted file mode 100644 index 5efbe3e1..00000000 --- a/features/rt/rcu-Prevent-false-positive-softirq-warning-on-RT.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6d20c55d64b7184c04dacaf5fb0b46d3ae3f9554 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:58 +0100 -Subject: [PATCH 060/191] rcu: Prevent false positive softirq warning on RT - -Soft interrupt disabled sections can legitimately be preempted or schedule -out when blocking on a lock on RT enabled kernels so the RCU preempt check -warning has to be disabled for RT kernels. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Paul E. McKenney <paulmck@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/rcupdate.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index bd04f722714f..6d855ef091ba 100644 ---- a/include/linux/rcupdate.h -+++ b/include/linux/rcupdate.h -@@ -334,7 +334,8 @@ static inline void rcu_preempt_sleep_check(void) { } - #define rcu_sleep_check() \ - do { \ - rcu_preempt_sleep_check(); \ -- RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) \ -+ RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map), \ - "Illegal context switch in RCU-bh read-side critical section"); \ - RCU_LOCKDEP_WARN(lock_is_held(&rcu_sched_lock_map), \ - "Illegal context switch in RCU-sched read-side critical section"); \ --- -2.19.1 - diff --git a/features/rt/rcutorture-Avoid-problematic-critical-section-nestin.patch b/features/rt/rcutorture-Avoid-problematic-critical-section-nestin.patch deleted file mode 100644 index 59d4b8a1..00000000 --- a/features/rt/rcutorture-Avoid-problematic-critical-section-nestin.patch +++ /dev/null @@ -1,195 +0,0 @@ -From 46cd674891358a7e6bf74242122b648fb85f6bcc Mon Sep 17 00:00:00 2001 -From: Scott Wood <swood@redhat.com> -Date: Wed, 11 Sep 2019 17:57:29 +0100 -Subject: [PATCH 132/191] rcutorture: Avoid problematic critical section - nesting on RT - -rcutorture was generating some nesting scenarios that are not -reasonable. Constrain the state selection to avoid them. - -Example #1: - -1. preempt_disable() -2. local_bh_disable() -3. preempt_enable() -4. local_bh_enable() - -On PREEMPT_RT, BH disabling takes a local lock only when called in -non-atomic context. Thus, atomic context must be retained until after BH -is re-enabled. Likewise, if BH is initially disabled in non-atomic -context, it cannot be re-enabled in atomic context. - -Example #2: - -1. rcu_read_lock() -2. local_irq_disable() -3. rcu_read_unlock() -4. local_irq_enable() - -If the thread is preempted between steps 1 and 2, -rcu_read_unlock_special.b.blocked will be set, but it won't be -acted on in step 3 because IRQs are disabled. Thus, reporting of the -quiescent state will be delayed beyond the local_irq_enable(). - -For now, these scenarios will continue to be tested on non-PREEMPT_RT -kernels, until debug checks are added to ensure that they are not -happening elsewhere. - -Signed-off-by: Scott Wood <swood@redhat.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/rcu/rcutorture.c | 97 +++++++++++++++++++++++++++++++++++------ - 1 file changed, 83 insertions(+), 14 deletions(-) - -diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c -index 99657ffa6688..d41a13e09185 100644 ---- a/kernel/rcu/rcutorture.c -+++ b/kernel/rcu/rcutorture.c -@@ -61,10 +61,13 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.ibm.com> and Josh Triplett <josh@ - #define RCUTORTURE_RDR_RBH 0x08 /* ... rcu_read_lock_bh(). */ - #define RCUTORTURE_RDR_SCHED 0x10 /* ... rcu_read_lock_sched(). */ - #define RCUTORTURE_RDR_RCU 0x20 /* ... entering another RCU reader. */ --#define RCUTORTURE_RDR_NBITS 6 /* Number of bits defined above. */ -+#define RCUTORTURE_RDR_ATOM_BH 0x40 /* ... disabling bh while atomic */ -+#define RCUTORTURE_RDR_ATOM_RBH 0x80 /* ... RBH while atomic */ -+#define RCUTORTURE_RDR_NBITS 8 /* Number of bits defined above. */ - #define RCUTORTURE_MAX_EXTEND \ - (RCUTORTURE_RDR_BH | RCUTORTURE_RDR_IRQ | RCUTORTURE_RDR_PREEMPT | \ -- RCUTORTURE_RDR_RBH | RCUTORTURE_RDR_SCHED) -+ RCUTORTURE_RDR_RBH | RCUTORTURE_RDR_SCHED | \ -+ RCUTORTURE_RDR_ATOM_BH | RCUTORTURE_RDR_ATOM_RBH) - #define RCUTORTURE_RDR_MAX_LOOPS 0x7 /* Maximum reader extensions. */ - /* Must be power of two minus one. */ - #define RCUTORTURE_RDR_MAX_SEGS (RCUTORTURE_RDR_MAX_LOOPS + 3) -@@ -1418,31 +1421,53 @@ static void rcutorture_one_extend(int *readstate, int newstate, - WARN_ON_ONCE((idxold >> RCUTORTURE_RDR_SHIFT) > 1); - rtrsp->rt_readstate = newstate; - -- /* First, put new protection in place to avoid critical-section gap. */ -+ /* -+ * First, put new protection in place to avoid critical-section gap. -+ * Disable preemption around the ATOM disables to ensure that -+ * in_atomic() is true. -+ */ - if (statesnew & RCUTORTURE_RDR_BH) - local_bh_disable(); -+ if (statesnew & RCUTORTURE_RDR_RBH) -+ rcu_read_lock_bh(); - if (statesnew & RCUTORTURE_RDR_IRQ) - local_irq_disable(); - if (statesnew & RCUTORTURE_RDR_PREEMPT) - preempt_disable(); -- if (statesnew & RCUTORTURE_RDR_RBH) -- rcu_read_lock_bh(); - if (statesnew & RCUTORTURE_RDR_SCHED) - rcu_read_lock_sched(); -+ preempt_disable(); -+ if (statesnew & RCUTORTURE_RDR_ATOM_BH) -+ local_bh_disable(); -+ if (statesnew & RCUTORTURE_RDR_ATOM_RBH) -+ rcu_read_lock_bh(); -+ preempt_enable(); - if (statesnew & RCUTORTURE_RDR_RCU) - idxnew = cur_ops->readlock() << RCUTORTURE_RDR_SHIFT; - -- /* Next, remove old protection, irq first due to bh conflict. */ -+ /* -+ * Next, remove old protection, in decreasing order of strength -+ * to avoid unlock paths that aren't safe in the stronger -+ * context. Disable preemption around the ATOM enables in -+ * case the context was only atomic due to IRQ disabling. -+ */ -+ preempt_disable(); - if (statesold & RCUTORTURE_RDR_IRQ) - local_irq_enable(); -- if (statesold & RCUTORTURE_RDR_BH) -+ if (statesold & RCUTORTURE_RDR_ATOM_BH) - local_bh_enable(); -+ if (statesold & RCUTORTURE_RDR_ATOM_RBH) -+ rcu_read_unlock_bh(); -+ preempt_enable(); - if (statesold & RCUTORTURE_RDR_PREEMPT) - preempt_enable(); -- if (statesold & RCUTORTURE_RDR_RBH) -- rcu_read_unlock_bh(); - if (statesold & RCUTORTURE_RDR_SCHED) - rcu_read_unlock_sched(); -+ if (statesold & RCUTORTURE_RDR_BH) -+ local_bh_enable(); -+ if (statesold & RCUTORTURE_RDR_RBH) -+ rcu_read_unlock_bh(); -+ - if (statesold & RCUTORTURE_RDR_RCU) { - bool lockit = !statesnew && !(torture_random(trsp) & 0xffff); - -@@ -1485,6 +1510,12 @@ rcutorture_extend_mask(int oldmask, struct torture_random_state *trsp) - int mask = rcutorture_extend_mask_max(); - unsigned long randmask1 = torture_random(trsp) >> 8; - unsigned long randmask2 = randmask1 >> 3; -+ unsigned long preempts = RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED; -+ unsigned long preempts_irq = preempts | RCUTORTURE_RDR_IRQ; -+ unsigned long nonatomic_bhs = RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH; -+ unsigned long atomic_bhs = RCUTORTURE_RDR_ATOM_BH | -+ RCUTORTURE_RDR_ATOM_RBH; -+ unsigned long tmp; - - WARN_ON_ONCE(mask >> RCUTORTURE_RDR_SHIFT); - /* Mostly only one bit (need preemption!), sometimes lots of bits. */ -@@ -1492,11 +1523,49 @@ rcutorture_extend_mask(int oldmask, struct torture_random_state *trsp) - mask = mask & randmask2; - else - mask = mask & (1 << (randmask2 % RCUTORTURE_RDR_NBITS)); -- /* Can't enable bh w/irq disabled. */ -- if ((mask & RCUTORTURE_RDR_IRQ) && -- ((!(mask & RCUTORTURE_RDR_BH) && (oldmask & RCUTORTURE_RDR_BH)) || -- (!(mask & RCUTORTURE_RDR_RBH) && (oldmask & RCUTORTURE_RDR_RBH)))) -- mask |= RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH; -+ -+ /* -+ * Can't enable bh w/irq disabled. -+ */ -+ tmp = atomic_bhs | nonatomic_bhs; -+ if (mask & RCUTORTURE_RDR_IRQ) -+ mask |= oldmask & tmp; -+ -+ /* -+ * Ideally these sequences would be detected in debug builds -+ * (regardless of RT), but until then don't stop testing -+ * them on non-RT. -+ */ -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { -+ /* -+ * Can't release the outermost rcu lock in an irq disabled -+ * section without preemption also being disabled, if irqs -+ * had ever been enabled during this RCU critical section -+ * (could leak a special flag and delay reporting the qs). -+ */ -+ if ((oldmask & RCUTORTURE_RDR_RCU) && -+ (mask & RCUTORTURE_RDR_IRQ) && -+ !(mask & preempts)) -+ mask |= RCUTORTURE_RDR_RCU; -+ -+ /* Can't modify atomic bh in non-atomic context */ -+ if ((oldmask & atomic_bhs) && (mask & atomic_bhs) && -+ !(mask & preempts_irq)) { -+ mask |= oldmask & preempts_irq; -+ if (mask & RCUTORTURE_RDR_IRQ) -+ mask |= oldmask & tmp; -+ } -+ if ((mask & atomic_bhs) && !(mask & preempts_irq)) -+ mask |= RCUTORTURE_RDR_PREEMPT; -+ -+ /* Can't modify non-atomic bh in atomic context */ -+ tmp = nonatomic_bhs; -+ if (oldmask & preempts_irq) -+ mask &= ~tmp; -+ if ((oldmask | mask) & preempts_irq) -+ mask |= oldmask & tmp; -+ } -+ - return mask ?: RCUTORTURE_RDR_RCU; - } - --- -2.19.1 - diff --git a/features/rt/rt-Add-local-irq-locks.patch b/features/rt/rt-Add-local-irq-locks.patch deleted file mode 100644 index 0ffdcac6..00000000 --- a/features/rt/rt-Add-local-irq-locks.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 751ab616fb58a462f6d5a1ac6fc31662d58e33e4 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 20 Jun 2011 09:03:47 +0200 -Subject: [PATCH 099/191] rt: Add local irq locks - -Introduce locallock. For !RT this maps to preempt_disable()/ -local_irq_disable() so there is not much that changes. For RT this will -map to a spinlock. This makes preemption possible and locked "ressource" -gets the lockdep anotation it wouldn't have otherwise. The locks are -recursive for owner == current. Also, all locks user migrate_disable() -which ensures that the task is not migrated to another CPU while the lock -is held and the owner is preempted. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/local_lock_internal.h | 129 +++++++++++++++++++++++++--- - 1 file changed, 115 insertions(+), 14 deletions(-) - -diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h -index ded90b097e6e..7162dcd0a847 100644 ---- a/include/linux/local_lock_internal.h -+++ b/include/linux/local_lock_internal.h -@@ -7,36 +7,94 @@ - #include <linux/lockdep.h> - - typedef struct { --#ifdef CONFIG_DEBUG_LOCK_ALLOC -+#ifdef CONFIG_PREEMPT_RT -+ spinlock_t lock; -+ struct task_struct *owner; -+ int nestcnt; -+ -+#elif defined(CONFIG_DEBUG_LOCK_ALLOC) - struct lockdep_map dep_map; - struct task_struct *owner; - #endif - } local_lock_t; - --#ifdef CONFIG_DEBUG_LOCK_ALLOC --# define LL_DEP_MAP_INIT(lockname) \ -+#ifdef CONFIG_PREEMPT_RT -+ -+#define INIT_LOCAL_LOCK(lockname) { \ -+ __SPIN_LOCK_UNLOCKED((lockname).lock), \ -+ .owner = NULL, \ -+ .nestcnt = 0, \ -+ } -+#else -+ -+# ifdef CONFIG_DEBUG_LOCK_ALLOC -+# define LL_DEP_MAP_INIT(lockname) \ - .dep_map = { \ - .name = #lockname, \ - .wait_type_inner = LD_WAIT_CONFIG, \ -- .lock_type = LD_LOCK_PERCPU, \ -+ .lock_type = LD_LOCK_PERCPU, \ - } --#else --# define LL_DEP_MAP_INIT(lockname) --#endif -+# else -+# define LL_DEP_MAP_INIT(lockname) -+# endif - - #define INIT_LOCAL_LOCK(lockname) { LL_DEP_MAP_INIT(lockname) } - --#define __local_lock_init(lock) \ -+#endif -+ -+#ifdef CONFIG_PREEMPT_RT -+ -+static inline void ___local_lock_init(local_lock_t *l) -+{ -+ l->owner = NULL; -+ l->nestcnt = 0; -+} -+ -+#define __local_lock_init(l) \ -+do { \ -+ spin_lock_init(&(l)->lock); \ -+ ___local_lock_init(l); \ -+} while (0) -+ -+#else -+ -+#define __local_lock_init(l) \ - do { \ - static struct lock_class_key __key; \ - \ -- debug_check_no_locks_freed((void *)lock, sizeof(*lock));\ -- lockdep_init_map_type(&(lock)->dep_map, #lock, &__key, 0, \ -+ debug_check_no_locks_freed((void *)l, sizeof(*l)); \ -+ lockdep_init_map_type(&(l)->dep_map, #l, &__key, 0, \ - LD_WAIT_CONFIG, LD_WAIT_INV, \ - LD_LOCK_PERCPU); \ - } while (0) -+#endif -+ -+#ifdef CONFIG_PREEMPT_RT -+ -+static inline void local_lock_acquire(local_lock_t *l) -+{ -+ if (l->owner != current) { -+ spin_lock(&l->lock); -+ DEBUG_LOCKS_WARN_ON(l->owner); -+ DEBUG_LOCKS_WARN_ON(l->nestcnt); -+ l->owner = current; -+ } -+ l->nestcnt++; -+} -+ -+static inline void local_lock_release(local_lock_t *l) -+{ -+ DEBUG_LOCKS_WARN_ON(l->nestcnt == 0); -+ DEBUG_LOCKS_WARN_ON(l->owner != current); -+ if (--l->nestcnt) -+ return; -+ -+ l->owner = NULL; -+ spin_unlock(&l->lock); -+} -+ -+#elif defined(CONFIG_DEBUG_LOCK_ALLOC) - --#ifdef CONFIG_DEBUG_LOCK_ALLOC - static inline void local_lock_acquire(local_lock_t *l) - { - lock_map_acquire(&l->dep_map); -@@ -56,21 +114,50 @@ static inline void local_lock_acquire(local_lock_t *l) { } - static inline void local_lock_release(local_lock_t *l) { } - #endif /* !CONFIG_DEBUG_LOCK_ALLOC */ - -+#ifdef CONFIG_PREEMPT_RT -+ - #define __local_lock(lock) \ - do { \ -- preempt_disable(); \ -+ migrate_disable(); \ - local_lock_acquire(this_cpu_ptr(lock)); \ - } while (0) - -+#define __local_unlock(lock) \ -+ do { \ -+ local_lock_release(this_cpu_ptr(lock)); \ -+ migrate_enable(); \ -+ } while (0) -+ - #define __local_lock_irq(lock) \ - do { \ -- local_irq_disable(); \ -+ migrate_disable(); \ - local_lock_acquire(this_cpu_ptr(lock)); \ - } while (0) - - #define __local_lock_irqsave(lock, flags) \ - do { \ -- local_irq_save(flags); \ -+ migrate_disable(); \ -+ flags = 0; \ -+ local_lock_acquire(this_cpu_ptr(lock)); \ -+ } while (0) -+ -+#define __local_unlock_irq(lock) \ -+ do { \ -+ local_lock_release(this_cpu_ptr(lock)); \ -+ migrate_enable(); \ -+ } while (0) -+ -+#define __local_unlock_irqrestore(lock, flags) \ -+ do { \ -+ local_lock_release(this_cpu_ptr(lock)); \ -+ migrate_enable(); \ -+ } while (0) -+ -+#else -+ -+#define __local_lock(lock) \ -+ do { \ -+ preempt_disable(); \ - local_lock_acquire(this_cpu_ptr(lock)); \ - } while (0) - -@@ -80,6 +167,18 @@ static inline void local_lock_release(local_lock_t *l) { } - preempt_enable(); \ - } while (0) - -+#define __local_lock_irq(lock) \ -+ do { \ -+ local_irq_disable(); \ -+ local_lock_acquire(this_cpu_ptr(lock)); \ -+ } while (0) -+ -+#define __local_lock_irqsave(lock, flags) \ -+ do { \ -+ local_irq_save(flags); \ -+ local_lock_acquire(this_cpu_ptr(lock)); \ -+ } while (0) -+ - #define __local_unlock_irq(lock) \ - do { \ - local_lock_release(this_cpu_ptr(lock)); \ -@@ -91,3 +190,5 @@ static inline void local_lock_release(local_lock_t *l) { } - local_lock_release(this_cpu_ptr(lock)); \ - local_irq_restore(flags); \ - } while (0) -+ -+#endif --- -2.19.1 - diff --git a/features/rt/rt-Introduce-cpu_chill.patch b/features/rt/rt-Introduce-cpu_chill.patch deleted file mode 100644 index 2a837661..00000000 --- a/features/rt/rt-Introduce-cpu_chill.patch +++ /dev/null @@ -1,121 +0,0 @@ -From fccac47c4972dfaef50b0e080c60879a9d97bd25 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 7 Mar 2012 20:51:03 +0100 -Subject: [PATCH 138/191] rt: Introduce cpu_chill() - -Retry loops on RT might loop forever when the modifying side was -preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() -defaults to cpu_relax() for non RT. On RT it puts the looping task to -sleep for a tick so the preempted task can make progress. - -Steven Rostedt changed it to use a hrtimer instead of msleep(): -| -|Ulrich Obergfell pointed out that cpu_chill() calls msleep() which is woken -|up by the ksoftirqd running the TIMER softirq. But as the cpu_chill() is -|called from softirq context, it may block the ksoftirqd() from running, in -|which case, it may never wake up the msleep() causing the deadlock. - -+ bigeasy later changed to schedule_hrtimeout() -|If a task calls cpu_chill() and gets woken up by a regular or spurious -|wakeup and has a signal pending, then it exits the sleep loop in -|do_nanosleep() and sets up the restart block. If restart->nanosleep.type is -|not TI_NONE then this results in accessing a stale user pointer from a -|previously interrupted syscall and a copy to user based on the stale -|pointer or a BUG() when 'type' is not supported in nanosleep_copyout(). - -+ bigeasy: add PF_NOFREEZE: -| [....] Waiting for /dev to be fully populated... -| ===================================== -| [ BUG: udevd/229 still has locks held! ] -| 3.12.11-rt17 #23 Not tainted -| ------------------------------------- -| 1 lock held by udevd/229: -| #0: (&type->i_mutex_dir_key#2){+.+.+.}, at: lookup_slow+0x28/0x98 -| -| stack backtrace: -| CPU: 0 PID: 229 Comm: udevd Not tainted 3.12.11-rt17 #23 -| (unwind_backtrace+0x0/0xf8) from (show_stack+0x10/0x14) -| (show_stack+0x10/0x14) from (dump_stack+0x74/0xbc) -| (dump_stack+0x74/0xbc) from (do_nanosleep+0x120/0x160) -| (do_nanosleep+0x120/0x160) from (hrtimer_nanosleep+0x90/0x110) -| (hrtimer_nanosleep+0x90/0x110) from (cpu_chill+0x30/0x38) -| (cpu_chill+0x30/0x38) from (dentry_kill+0x158/0x1ec) -| (dentry_kill+0x158/0x1ec) from (dput+0x74/0x15c) -| (dput+0x74/0x15c) from (lookup_real+0x4c/0x50) -| (lookup_real+0x4c/0x50) from (__lookup_hash+0x34/0x44) -| (__lookup_hash+0x34/0x44) from (lookup_slow+0x38/0x98) -| (lookup_slow+0x38/0x98) from (path_lookupat+0x208/0x7fc) -| (path_lookupat+0x208/0x7fc) from (filename_lookup+0x20/0x60) -| (filename_lookup+0x20/0x60) from (user_path_at_empty+0x50/0x7c) -| (user_path_at_empty+0x50/0x7c) from (user_path_at+0x14/0x1c) -| (user_path_at+0x14/0x1c) from (vfs_fstatat+0x48/0x94) -| (vfs_fstatat+0x48/0x94) from (SyS_stat64+0x14/0x30) -| (SyS_stat64+0x14/0x30) from (ret_fast_syscall+0x0/0x48) - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Steven Rostedt <rostedt@goodmis.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/hrtimer.h | 6 ++++++ - kernel/time/hrtimer.c | 30 ++++++++++++++++++++++++++++++ - 2 files changed, 36 insertions(+) - -diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h -index bb5e7b0a4274..e425a26a5ed8 100644 ---- a/include/linux/hrtimer.h -+++ b/include/linux/hrtimer.h -@@ -540,4 +540,10 @@ int hrtimers_dead_cpu(unsigned int cpu); - #define hrtimers_dead_cpu NULL - #endif - -+#ifdef CONFIG_PREEMPT_RT -+extern void cpu_chill(void); -+#else -+# define cpu_chill() cpu_relax() -+#endif -+ - #endif -diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 788b9d137de4..3fa18a01f5b2 100644 ---- a/kernel/time/hrtimer.c -+++ b/kernel/time/hrtimer.c -@@ -2006,6 +2006,36 @@ SYSCALL_DEFINE2(nanosleep_time32, struct old_timespec32 __user *, rqtp, - } - #endif - -+#ifdef CONFIG_PREEMPT_RT -+/* -+ * Sleep for 1 ms in hope whoever holds what we want will let it go. -+ */ -+void cpu_chill(void) -+{ -+ unsigned int freeze_flag = current->flags & PF_NOFREEZE; -+ struct task_struct *self = current; -+ ktime_t chill_time; -+ -+ raw_spin_lock_irq(&self->pi_lock); -+ self->saved_state = self->state; -+ __set_current_state_no_track(TASK_UNINTERRUPTIBLE); -+ raw_spin_unlock_irq(&self->pi_lock); -+ -+ chill_time = ktime_set(0, NSEC_PER_MSEC); -+ -+ current->flags |= PF_NOFREEZE; -+ schedule_hrtimeout(&chill_time, HRTIMER_MODE_REL_HARD); -+ if (!freeze_flag) -+ current->flags &= ~PF_NOFREEZE; -+ -+ raw_spin_lock_irq(&self->pi_lock); -+ __set_current_state_no_track(self->saved_state); -+ self->saved_state = TASK_RUNNING; -+ raw_spin_unlock_irq(&self->pi_lock); -+} -+EXPORT_SYMBOL(cpu_chill); -+#endif -+ - /* - * Functions related to boot-time initialization: - */ --- -2.19.1 - diff --git a/features/rt/rt.scc b/features/rt/rt.scc index f00f2eb5..4cc0cb9a 100644 --- a/features/rt/rt.scc +++ b/features/rt/rt.scc @@ -1,194 +1,3 @@ # SPDX-License-Identifier: MIT # -patch highmem-Don-t-disable-preemption-on-RT-in-kmap_atomi.patch -patch timers-Move-clearing-of-base-timer_running-under-bas.patch -patch kthread-Move-prio-affinite-change-into-the-newly-cre.patch -patch genirq-Move-prio-assignment-into-the-newly-created-t.patch -patch notifier-Make-atomic_notifiers-use-raw_spinlock.patch -patch powerpc-mm-Move-the-linear_mapping_mutex-to-the-ifde.patch -patch printk-limit-second-loop-of-syslog_print_all.patch -patch printk-kmsg_dump-remove-unused-fields.patch -patch printk-refactor-kmsg_dump_get_buffer.patch -patch printk-consolidate-kmsg_dump_get_buffer-syslog_print.patch -patch printk-introduce-CONSOLE_LOG_MAX-for-improved-multi-.patch -patch printk-use-seqcount_latch-for-clear_seq.patch -patch printk-use-atomic64_t-for-devkmsg_user.seq.patch -patch printk-add-syslog_lock.patch -patch printk-introduce-a-kmsg_dump-iterator.patch -patch um-synchronize-kmsg_dumper.patch -patch printk-remove-logbuf_lock.patch -patch printk-kmsg_dump-remove-_nolock-variants.patch -patch printk-kmsg_dump-use-kmsg_dump_rewind.patch -patch printk-console-remove-unnecessary-safe-buffer-usage.patch -patch printk-track-limit-recursion.patch -patch printk-remove-safe-buffers.patch -patch printk-convert-syslog_lock-to-spin_lock.patch -patch console-add-write_atomic-interface.patch -patch serial-8250-implement-write_atomic.patch -patch printk-relocate-printk_delay-and-vprintk_default.patch -patch printk-combine-boot_delay_msec-into-printk_delay.patch -patch printk-change-console_seq-to-atomic64_t.patch -patch printk-introduce-kernel-sync-mode.patch -patch printk-move-console-printing-to-kthreads.patch -patch printk-remove-deferred-printing.patch -patch printk-add-console-handover.patch -patch printk-add-pr_flush.patch -patch kcov-Remove-kcov-include-from-sched.h-and-move-it-to.patch -patch cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch -patch mm-workingset-replace-IRQ-off-check-with-a-lockdep-a.patch -patch shmem-Use-raw_spinlock_t-for-stat_lock.patch -patch net-Move-lockdep-where-it-belongs.patch -patch tcp-Remove-superfluous-BH-disable-around-listening_h.patch -patch smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch -patch tasklets-Replace-barrier-with-cpu_relax-in-tasklet_u.patch -patch tasklets-Use-static-inlines-for-stub-implementations.patch -patch tasklets-Provide-tasklet_disable_in_atomic.patch -patch tasklets-Use-spin-wait-in-tasklet_disable-temporaril.patch -patch tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch -patch tasklets-Replace-spin-wait-in-tasklet_kill.patch -patch tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch -patch net-jme-Replace-link-change-tasklet-with-work.patch -patch net-sundance-Use-tasklet_disable_in_atomic.patch -patch ath9k-Use-tasklet_disable_in_atomic.patch -patch atm-eni-Use-tasklet_disable_in_atomic-in-the-send-ca.patch -patch PCI-hv-Use-tasklet_disable_in_atomic.patch -patch firewire-ohci-Use-tasklet_disable_in_atomic-where-re.patch -patch tasklets-Switch-tasklet_disable-to-the-sleep-wait-va.patch -patch softirq-Add-RT-specific-softirq-accounting.patch -patch irqtime-Make-accounting-correct-on-RT.patch -patch softirq-Move-various-protections-into-inline-helpers.patch -patch softirq-Make-softirq-control-and-processing-RT-aware.patch -patch tick-sched-Prevent-false-positive-softirq-pending-wa.patch -patch rcu-Prevent-false-positive-softirq-warning-on-RT.patch -patch locking-rtmutex-Remove-cruft.patch -patch locking-rtmutex-Remove-output-from-deadlock-detector.patch -patch locking-rtmutex-Move-rt_mutex_init-outside-of-CONFIG.patch -patch locking-rtmutex-Remove-rt_mutex_timed_lock.patch -patch locking-rtmutex-Handle-the-various-new-futex-race-co.patch -patch futex-Fix-bug-on-when-a-requeued-RT-task-times-out.patch -patch locking-rtmutex-Make-lock_killable-work.patch -patch locking-spinlock-Split-the-lock-types-header.patch -patch locking-rtmutex-Avoid-include-hell.patch -patch lockdep-Reduce-header-files-in-debug_locks.h.patch -patch locking-split-out-the-rbtree-definition.patch -patch locking-rtmutex-Provide-rt_mutex_slowlock_locked.patch -patch locking-rtmutex-export-lockdep-less-version-of-rt_mu.patch -patch sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch -patch locking-rtmutex-add-sleeping-lock-implementation.patch -patch locking-rtmutex-Allow-rt_mutex_trylock-on-PREEMPT_RT.patch -patch locking-rtmutex-add-mutex-implementation-based-on-rt.patch -patch locking-rtmutex-add-rwsem-implementation-based-on-rt.patch -patch locking-rtmutex-add-rwlock-implementation-based-on-r.patch -patch locking-rtmutex-wire-up-RT-s-locking.patch -patch locking-rtmutex-add-ww_mutex-addon-for-mutex-rt.patch -patch locking-rtmutex-Use-custom-scheduling-function-for-s.patch -patch signal-Revert-ptrace-preempt-magic.patch -patch preempt-Provide-preempt_-_-no-rt-variants.patch -patch mm-vmstat-Protect-per-cpu-variables-with-preempt-dis.patch -patch mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch -patch xfrm-Use-sequence-counter-with-associated-spinlock.patch -patch u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch -patch fs-dcache-use-swait_queue-instead-of-waitqueue.patch -patch fs-dcache-disable-preemption-on-i_dir_seq-s-write-si.patch -patch net-Qdisc-use-a-seqlock-instead-seqcount.patch -patch net-Properly-annotate-the-try-lock-for-the-seqlock.patch -patch kconfig-Disable-config-options-which-are-not-RT-comp.patch -patch mm-Allow-only-SLUB-on-RT.patch -patch sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch -patch net-core-disable-NET_RX_BUSY_POLL-on-RT.patch -patch efi-Disable-runtime-services-on-RT.patch -patch efi-Allow-efi-runtime.patch -patch rt-Add-local-irq-locks.patch -patch signal-x86-Delay-calling-signals-in-atomic.patch -patch kernel-sched-add-put-get-_cpu_light.patch -patch trace-Add-migrate-disabled-counter-to-tracing-output.patch -patch locking-don-t-check-for-__LINUX_SPINLOCK_TYPES_H-on-.patch -patch mm-sl-au-b-Change-list_lock-to-raw_spinlock_t.patch -patch mm-slub-Make-object_map_lock-a-raw_spinlock_t.patch -patch mm-slub-Enable-irqs-for-__GFP_WAIT.patch -patch mm-slub-Move-discard_slab-invocations-out-of-IRQ-off.patch -patch mm-slub-Move-flush_cpu_slab-invocations-__free_slab-.patch -patch mm-slub-Don-t-resize-the-location-tracking-cache-on-.patch -patch mm-page_alloc-Use-migrate_disable-in-drain_local_pag.patch -patch mm-page_alloc-Use-a-local_lock-instead-of-explicit-l.patch -patch mm-slub-Don-t-enable-partial-CPU-caches-on-PREEMPT_R.patch -patch mm-memcontrol-Provide-a-local_lock-for-per-CPU-memcg.patch -patch mm-memcontrol-Don-t-call-schedule_work_on-in-preempt.patch -patch mm-memcontrol-Replace-local_irq_disable-with-local-l.patch -patch mm-zsmalloc-copy-with-get_cpu_var-and-locking.patch -patch x86-kvm-Require-const-tsc-for-RT.patch -patch wait.h-include-atomic.h.patch -patch sched-Limit-the-number-of-task-migrations-per-batch.patch -patch sched-Move-mmdrop-to-RCU-on-RT.patch -patch kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch -patch sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch -patch sched-Disable-TTWU_QUEUE-on-RT.patch -patch softirq-Check-preemption-after-reenabling-interrupts.patch -patch softirq-Disable-softirq-stacks-for-RT.patch -patch net-core-use-local_bh_disable-in-netif_rx_ni.patch -patch pid.h-include-atomic.h.patch -patch ptrace-fix-ptrace-vs-tasklist_lock-race.patch -patch ptrace-fix-ptrace_unfreeze_traced-race-with-rt-lock.patch -patch rcu-Delay-RCU-selftests.patch -patch locking-Make-spinlock_t-and-rwlock_t-a-RCU-section-o.patch -patch rcutorture-Avoid-problematic-critical-section-nestin.patch -patch mm-vmalloc-Another-preempt-disable-region-which-suck.patch -patch block-mq-do-not-invoke-preempt_disable.patch -patch md-raid5-Make-raid5_percpu-handling-RT-aware.patch -patch scsi-fcoe-Make-RT-aware.patch -patch sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch -patch rt-Introduce-cpu_chill.patch -patch fs-namespace-Use-cpu_chill-in-trylock-loops.patch -patch debugobjects-Make-RT-aware.patch -patch net-Use-skbufhead-with-raw-lock.patch -patch net-Dequeue-in-dev_cpu_dead-without-the-lock.patch -patch net-dev-always-take-qdisc-s-busylock-in-__dev_xmit_s.patch -patch irqwork-push-most-work-into-softirq-context.patch -patch crypto-limit-more-FPU-enabled-sections.patch -patch crypto-cryptd-add-a-lock-instead-preempt_disable-loc.patch -patch panic-skip-get_random_bytes-for-RT_FULL-in-init_oops.patch -patch x86-stackprotector-Avoid-random-pool-on-rt.patch -patch random-Make-it-work-on-rt.patch -patch net-Remove-preemption-disabling-in-netif_rx.patch -patch lockdep-Make-it-RT-aware.patch -patch lockdep-selftest-Only-do-hardirq-context-test-for-ra.patch -patch lockdep-selftest-fix-warnings-due-to-missing-PREEMPT.patch -patch lockdep-disable-self-test.patch -patch drm-radeon-i915-Use-preempt_disable-enable_rt-where-.patch -patch drm-i915-Don-t-disable-interrupts-on-PREEMPT_RT-duri.patch -patch drm-i915-disable-tracing-on-RT.patch -patch drm-i915-skip-DRM_I915_LOW_LEVEL_TRACEPOINTS-with-NO.patch -patch drm-i915-gt-Only-disable-interrupts-for-the-timeline.patch -patch cpuset-Convert-callback_lock-to-raw_spinlock_t.patch -patch x86-Allow-to-enable-RT.patch -patch mm-scatterlist-Do-not-disable-irqs-on-RT.patch -patch sched-Add-support-for-lazy-preemption.patch -patch x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch -patch x86-Support-for-lazy-preemption.patch -patch arm-Add-support-for-lazy-preemption.patch -patch powerpc-Add-support-for-lazy-preemption.patch -patch arch-arm64-Add-lazy-preempt-support.patch -patch jump-label-disable-if-stop_machine-is-used.patch -patch leds-trigger-disable-CPU-trigger-on-RT.patch -patch tty-serial-omap-Make-the-locking-RT-aware.patch -patch tty-serial-pl011-Make-the-locking-work-on-RT.patch -patch ARM-enable-irq-in-translation-section-permission-fau.patch -patch genirq-update-irq_set_irqchip_state-documentation.patch -patch KVM-arm-arm64-downgrade-preempt_disable-d-region-to-.patch -patch arm64-fpsimd-Delay-freeing-memory-in-fpsimd_flush_th.patch -patch x86-Enable-RT-also-on-32bit.patch -patch ARM-Allow-to-enable-RT.patch -patch ARM64-Allow-to-enable-RT.patch -patch powerpc-traps-Use-PREEMPT_RT.patch -patch powerpc-pseries-iommu-Use-a-locallock-instead-local_.patch -patch powerpc-kvm-Disable-in-kernel-MPIC-emulation-for-PRE.patch -patch powerpc-stackprotector-work-around-stack-guard-init-.patch -patch powerpc-Avoid-recursive-header-includes.patch -patch POWERPC-Allow-to-enable-RT.patch -patch drivers-block-zram-Replace-bit-spinlocks-with-rtmute.patch -patch tpm_tis-fix-stall-after-iowrite-s.patch -patch signals-Allow-RT-tasks-to-cache-one-sigqueue-struct.patch -patch genirq-Disable-irqpoll-on-rt.patch -patch sysfs-Add-sys-kernel-realtime-entry.patch -patch Add-localversion-for-RT-release.patch diff --git a/features/rt/sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch b/features/rt/sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch deleted file mode 100644 index 8de24806..00000000 --- a/features/rt/sched-Add-saved_state-for-tasks-blocked-on-sleeping-.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 34b399662682e7d121a12d7f11c06f809c60d085 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sat, 25 Jun 2011 09:21:04 +0200 -Subject: [PATCH 074/191] sched: Add saved_state for tasks blocked on sleeping - locks - -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 -the lock contention. If a regular wakeup (not a RTmutex related -wakeup) happens, the saved_state is updated to running. When the lock -sleep is done, the saved state is restored. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/sched.h | 3 +++ - kernel/sched/core.c | 34 ++++++++++++++++++++++++++++++++-- - kernel/sched/sched.h | 1 + - 3 files changed, 36 insertions(+), 2 deletions(-) - -diff --git a/include/linux/sched.h b/include/linux/sched.h -index c8998312d7bc..3f05b8c29132 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -655,6 +655,8 @@ struct task_struct { - #endif - /* -1 unrunnable, 0 runnable, >0 stopped: */ - volatile long state; -+ /* saved state for "spinlock sleepers" */ -+ volatile long saved_state; - - /* - * This begins the randomizable portion of task_struct. Only -@@ -1780,6 +1782,7 @@ extern struct task_struct *find_get_task_by_vpid(pid_t nr); - - extern int wake_up_state(struct task_struct *tsk, unsigned int state); - extern int wake_up_process(struct task_struct *tsk); -+extern int wake_up_lock_sleeper(struct task_struct *tsk); - extern void wake_up_new_task(struct task_struct *tsk); - - #ifdef CONFIG_SMP -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 98191218d891..4efe6fd72719 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -3314,7 +3314,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) - int cpu, success = 0; - - preempt_disable(); -- if (p == current) { -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT) && p == current) { - /* - * We're waking current, this means 'p->on_rq' and 'task_cpu(p) - * == smp_processor_id()'. Together this means we can special -@@ -3344,8 +3344,26 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) - */ - raw_spin_lock_irqsave(&p->pi_lock, flags); - smp_mb__after_spinlock(); -- if (!(p->state & state)) -+ if (!(p->state & state)) { -+ /* -+ * The task might be running due to a spinlock sleeper -+ * wakeup. Check the saved state and set it to running -+ * if the wakeup condition is true. -+ */ -+ if (!(wake_flags & WF_LOCK_SLEEPER)) { -+ if (p->saved_state & state) { -+ p->saved_state = TASK_RUNNING; -+ success = 1; -+ } -+ } - goto unlock; -+ } -+ /* -+ * If this is a regular wakeup, then we can unconditionally -+ * clear the saved state of a "lock sleeper". -+ */ -+ if (!(wake_flags & WF_LOCK_SLEEPER)) -+ p->saved_state = TASK_RUNNING; - - trace_sched_waking(p); - -@@ -3534,6 +3552,18 @@ int wake_up_process(struct task_struct *p) - } - EXPORT_SYMBOL(wake_up_process); - -+/** -+ * wake_up_lock_sleeper - Wake up a specific process blocked on a "sleeping lock" -+ * @p: The process to be woken up. -+ * -+ * Same as wake_up_process() above, but wake_flags=WF_LOCK_SLEEPER to indicate -+ * the nature of the wakeup. -+ */ -+int wake_up_lock_sleeper(struct task_struct *p) -+{ -+ return try_to_wake_up(p, TASK_UNINTERRUPTIBLE, WF_LOCK_SLEEPER); -+} -+ - int wake_up_state(struct task_struct *p, unsigned int state) - { - return try_to_wake_up(p, state, 0); -diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 10a1522b1e30..b65a4e244a77 100644 ---- a/kernel/sched/sched.h -+++ b/kernel/sched/sched.h -@@ -1751,6 +1751,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) - #define WF_SYNC 0x10 /* Waker goes to sleep after wakeup */ - #define WF_MIGRATED 0x20 /* Internal use, task got migrated */ - #define WF_ON_CPU 0x40 /* Wakee is on_cpu */ -+#define WF_LOCK_SLEEPER 0x80 /* Wakeup spinlock "sleeper" */ - - #ifdef CONFIG_SMP - static_assert(WF_EXEC == SD_BALANCE_EXEC); --- -2.19.1 - diff --git a/features/rt/sched-Add-support-for-lazy-preemption.patch b/features/rt/sched-Add-support-for-lazy-preemption.patch deleted file mode 100644 index e3b28534..00000000 --- a/features/rt/sched-Add-support-for-lazy-preemption.patch +++ /dev/null @@ -1,690 +0,0 @@ -From 4ea3d1a1ba58c951bbfc4f5e3592823f3fcd2d4a Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 26 Oct 2012 18:50:54 +0100 -Subject: [PATCH 163/191] sched: Add support for lazy preemption - -It has become an obsession to mitigate the determinism vs. throughput -loss of RT. Looking at the mainline semantics of preemption points -gives a hint why RT sucks throughput wise for ordinary SCHED_OTHER -tasks. One major issue is the wakeup of tasks which are right away -preempting the waking task while the waking task holds a lock on which -the woken task will block right after having preempted the wakee. In -mainline this is prevented due to the implicit preemption disable of -spin/rw_lock held regions. On RT this is not possible due to the fully -preemptible nature of sleeping spinlocks. - -Though for a SCHED_OTHER task preempting another SCHED_OTHER task this -is really not a correctness issue. RT folks are concerned about -SCHED_FIFO/RR tasks preemption and not about the purely fairness -driven SCHED_OTHER preemption latencies. - -So I introduced a lazy preemption mechanism which only applies to -SCHED_OTHER tasks preempting another SCHED_OTHER task. Aside of the -existing preempt_count each tasks sports now a preempt_lazy_count -which is manipulated on lock acquiry and release. This is slightly -incorrect as for lazyness reasons I coupled this on -migrate_disable/enable so some other mechanisms get the same treatment -(e.g. get_cpu_light). - -Now on the scheduler side instead of setting NEED_RESCHED this sets -NEED_RESCHED_LAZY in case of a SCHED_OTHER/SCHED_OTHER preemption and -therefor allows to exit the waking task the lock held region before -the woken task preempts. That also works better for cross CPU wakeups -as the other side can stay in the adaptive spinning loop. - -For RT class preemption there is no change. This simply sets -NEED_RESCHED and forgoes the lazy preemption counter. - - Initial test do not expose any observable latency increasement, but -history shows that I've been proven wrong before :) - -The lazy preemption mode is per default on, but with -CONFIG_SCHED_DEBUG enabled it can be disabled via: - - # echo NO_PREEMPT_LAZY >/sys/kernel/debug/sched_features - -and reenabled via - - # echo PREEMPT_LAZY >/sys/kernel/debug/sched_features - -The test results so far are very machine and workload dependent, but -there is a clear trend that it enhances the non RT workload -performance. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/preempt.h | 54 ++++++++++++++++++++++-- - include/linux/sched.h | 38 +++++++++++++++++ - include/linux/thread_info.h | 12 +++++- - include/linux/trace_events.h | 5 ++- - kernel/Kconfig.preempt | 6 +++ - kernel/sched/core.c | 82 +++++++++++++++++++++++++++++++++++- - kernel/sched/fair.c | 16 +++---- - kernel/sched/features.h | 3 ++ - kernel/sched/sched.h | 9 ++++ - kernel/trace/trace.c | 50 +++++++++++++--------- - kernel/trace/trace_events.c | 1 + - kernel/trace/trace_output.c | 14 +++++- - 12 files changed, 254 insertions(+), 36 deletions(-) - -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index fb140e00f74d..af39859f02ee 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -174,6 +174,20 @@ extern void preempt_count_sub(int val); - #define preempt_count_inc() preempt_count_add(1) - #define preempt_count_dec() preempt_count_sub(1) - -+#ifdef CONFIG_PREEMPT_LAZY -+#define add_preempt_lazy_count(val) do { preempt_lazy_count() += (val); } while (0) -+#define sub_preempt_lazy_count(val) do { preempt_lazy_count() -= (val); } while (0) -+#define inc_preempt_lazy_count() add_preempt_lazy_count(1) -+#define dec_preempt_lazy_count() sub_preempt_lazy_count(1) -+#define preempt_lazy_count() (current_thread_info()->preempt_lazy_count) -+#else -+#define add_preempt_lazy_count(val) do { } while (0) -+#define sub_preempt_lazy_count(val) do { } while (0) -+#define inc_preempt_lazy_count() do { } while (0) -+#define dec_preempt_lazy_count() do { } while (0) -+#define preempt_lazy_count() (0) -+#endif -+ - #ifdef CONFIG_PREEMPT_COUNT - - #define preempt_disable() \ -@@ -182,6 +196,12 @@ do { \ - barrier(); \ - } while (0) - -+#define preempt_lazy_disable() \ -+do { \ -+ inc_preempt_lazy_count(); \ -+ barrier(); \ -+} while (0) -+ - #define sched_preempt_enable_no_resched() \ - do { \ - barrier(); \ -@@ -219,6 +239,18 @@ do { \ - __preempt_schedule(); \ - } while (0) - -+/* -+ * open code preempt_check_resched() because it is not exported to modules and -+ * used by local_unlock() or bpf_enable_instrumentation(). -+ */ -+#define preempt_lazy_enable() \ -+do { \ -+ dec_preempt_lazy_count(); \ -+ barrier(); \ -+ if (should_resched(0)) \ -+ __preempt_schedule(); \ -+} while (0) -+ - #else /* !CONFIG_PREEMPTION */ - #define preempt_enable() \ - do { \ -@@ -226,6 +258,12 @@ do { \ - preempt_count_dec(); \ - } while (0) - -+#define preempt_lazy_enable() \ -+do { \ -+ dec_preempt_lazy_count(); \ -+ barrier(); \ -+} while (0) -+ - #define preempt_enable_notrace() \ - do { \ - barrier(); \ -@@ -267,6 +305,9 @@ do { \ - #define preempt_check_resched_rt() barrier() - #define preemptible() 0 - -+#define preempt_lazy_disable() barrier() -+#define preempt_lazy_enable() barrier() -+ - #endif /* CONFIG_PREEMPT_COUNT */ - - #ifdef MODULE -@@ -285,7 +326,7 @@ do { \ - } while (0) - #define preempt_fold_need_resched() \ - do { \ -- if (tif_need_resched()) \ -+ if (tif_need_resched_now()) \ - set_preempt_need_resched(); \ - } while (0) - -@@ -413,8 +454,15 @@ extern void migrate_enable(void); - - #else - --static inline void migrate_disable(void) { } --static inline void migrate_enable(void) { } -+static inline void migrate_disable(void) -+{ -+ preempt_lazy_disable(); -+} -+ -+static inline void migrate_enable(void) -+{ -+ preempt_lazy_enable(); -+} - - #endif /* CONFIG_SMP */ - -diff --git a/include/linux/sched.h b/include/linux/sched.h -index dab770a030bd..8e566b8049aa 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1880,6 +1880,44 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) - return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); - } - -+#ifdef CONFIG_PREEMPT_LAZY -+static inline void set_tsk_need_resched_lazy(struct task_struct *tsk) -+{ -+ set_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY); -+} -+ -+static inline void clear_tsk_need_resched_lazy(struct task_struct *tsk) -+{ -+ clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY); -+} -+ -+static inline int test_tsk_need_resched_lazy(struct task_struct *tsk) -+{ -+ return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED_LAZY)); -+} -+ -+static inline int need_resched_lazy(void) -+{ -+ return test_thread_flag(TIF_NEED_RESCHED_LAZY); -+} -+ -+static inline int need_resched_now(void) -+{ -+ return test_thread_flag(TIF_NEED_RESCHED); -+} -+ -+#else -+static inline void clear_tsk_need_resched_lazy(struct task_struct *tsk) { } -+static inline int need_resched_lazy(void) { return 0; } -+ -+static inline int need_resched_now(void) -+{ -+ return test_thread_flag(TIF_NEED_RESCHED); -+} -+ -+#endif -+ -+ - static inline bool __task_is_stopped_or_traced(struct task_struct *task) - { - if (task->state & (__TASK_STOPPED | __TASK_TRACED)) -diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h -index 9b2158c69275..8d1cac4052f2 100644 ---- a/include/linux/thread_info.h -+++ b/include/linux/thread_info.h -@@ -149,7 +149,17 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) - clear_ti_thread_flag(task_thread_info(t), TIF_##fl) - #endif /* !CONFIG_GENERIC_ENTRY */ - --#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) -+#ifdef CONFIG_PREEMPT_LAZY -+#define tif_need_resched() (test_thread_flag(TIF_NEED_RESCHED) || \ -+ test_thread_flag(TIF_NEED_RESCHED_LAZY)) -+#define tif_need_resched_now() (test_thread_flag(TIF_NEED_RESCHED)) -+#define tif_need_resched_lazy() test_thread_flag(TIF_NEED_RESCHED_LAZY) -+ -+#else -+#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) -+#define tif_need_resched_now() test_thread_flag(TIF_NEED_RESCHED) -+#define tif_need_resched_lazy() 0 -+#endif - - #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES - static inline int arch_within_stack_frames(const void * const stack, -diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h -index 1048965a8750..9e4bc12bb826 100644 ---- a/include/linux/trace_events.h -+++ b/include/linux/trace_events.h -@@ -70,6 +70,7 @@ struct trace_entry { - unsigned char preempt_count; - int pid; - unsigned char migrate_disable; -+ unsigned char preempt_lazy_count; - }; - - #define TRACE_EVENT_TYPE_MAX \ -@@ -159,9 +160,10 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry, - { - entry->preempt_count = trace_ctx & 0xff; - entry->migrate_disable = (trace_ctx >> 8) & 0xff; -+ entry->preempt_lazy_count = (trace_ctx >> 16) & 0xff; - entry->pid = current->pid; - entry->type = type; -- entry->flags = trace_ctx >> 16; -+ entry->flags = trace_ctx >> 24; - } - - unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); -@@ -174,6 +176,7 @@ enum trace_flag_type { - TRACE_FLAG_SOFTIRQ = 0x10, - TRACE_FLAG_PREEMPT_RESCHED = 0x20, - TRACE_FLAG_NMI = 0x40, -+ TRACE_FLAG_NEED_RESCHED_LAZY = 0x80, - }; - - #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT -diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt -index c8e516f6db20..90837a6cb2e8 100644 ---- a/kernel/Kconfig.preempt -+++ b/kernel/Kconfig.preempt -@@ -1,5 +1,11 @@ - # SPDX-License-Identifier: GPL-2.0-only - -+config HAVE_PREEMPT_LAZY -+ bool -+ -+config PREEMPT_LAZY -+ def_bool y if HAVE_PREEMPT_LAZY && PREEMPT_RT -+ - choice - prompt "Preemption Model" - default PREEMPT_NONE -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 5dc7a8edf093..46f2d26a7108 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -647,6 +647,48 @@ void resched_curr(struct rq *rq) - trace_sched_wake_idle_without_ipi(cpu); - } - -+#ifdef CONFIG_PREEMPT_LAZY -+ -+static int tsk_is_polling(struct task_struct *p) -+{ -+#ifdef TIF_POLLING_NRFLAG -+ return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); -+#else -+ return 0; -+#endif -+} -+ -+void resched_curr_lazy(struct rq *rq) -+{ -+ struct task_struct *curr = rq->curr; -+ int cpu; -+ -+ if (!sched_feat(PREEMPT_LAZY)) { -+ resched_curr(rq); -+ return; -+ } -+ -+ lockdep_assert_held(&rq->lock); -+ -+ if (test_tsk_need_resched(curr)) -+ return; -+ -+ if (test_tsk_need_resched_lazy(curr)) -+ return; -+ -+ set_tsk_need_resched_lazy(curr); -+ -+ cpu = cpu_of(rq); -+ if (cpu == smp_processor_id()) -+ return; -+ -+ /* NEED_RESCHED_LAZY must be visible before we test polling */ -+ smp_mb(); -+ if (!tsk_is_polling(curr)) -+ smp_send_reschedule(cpu); -+} -+#endif -+ - void resched_cpu(int cpu) - { - struct rq *rq = cpu_rq(cpu); -@@ -1778,6 +1820,7 @@ void migrate_disable(void) - preempt_disable(); - this_rq()->nr_pinned++; - p->migration_disabled = 1; -+ preempt_lazy_disable(); - preempt_enable(); - } - EXPORT_SYMBOL_GPL(migrate_disable); -@@ -1806,6 +1849,7 @@ void migrate_enable(void) - barrier(); - p->migration_disabled = 0; - this_rq()->nr_pinned--; -+ preempt_lazy_enable(); - preempt_enable(); - } - EXPORT_SYMBOL_GPL(migrate_enable); -@@ -3851,6 +3895,9 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) - p->on_cpu = 0; - #endif - init_task_preempt_count(p); -+#ifdef CONFIG_HAVE_PREEMPT_LAZY -+ task_thread_info(p)->preempt_lazy_count = 0; -+#endif - #ifdef CONFIG_SMP - plist_node_init(&p->pushable_tasks, MAX_PRIO); - RB_CLEAR_NODE(&p->pushable_dl_tasks); -@@ -5104,6 +5151,7 @@ static void __sched notrace __schedule(bool preempt, bool spinning_lock) - - next = pick_next_task(rq, prev, &rf); - clear_tsk_need_resched(prev); -+ clear_tsk_need_resched_lazy(prev); - clear_preempt_need_resched(); - - if (likely(prev != next)) { -@@ -5303,6 +5351,30 @@ static void __sched notrace preempt_schedule_common(void) - } while (need_resched()); - } - -+#ifdef CONFIG_PREEMPT_LAZY -+/* -+ * If TIF_NEED_RESCHED is then we allow to be scheduled away since this is -+ * set by a RT task. Oterwise we try to avoid beeing scheduled out as long as -+ * preempt_lazy_count counter >0. -+ */ -+static __always_inline int preemptible_lazy(void) -+{ -+ if (test_thread_flag(TIF_NEED_RESCHED)) -+ return 1; -+ if (current_thread_info()->preempt_lazy_count) -+ return 0; -+ return 1; -+} -+ -+#else -+ -+static inline int preemptible_lazy(void) -+{ -+ return 1; -+} -+ -+#endif -+ - #ifdef CONFIG_PREEMPTION - /* - * This is the entry point to schedule() from in-kernel preemption -@@ -5316,7 +5388,8 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) - */ - if (likely(!preemptible())) - return; -- -+ if (!preemptible_lazy()) -+ return; - preempt_schedule_common(); - } - NOKPROBE_SYMBOL(preempt_schedule); -@@ -5362,6 +5435,9 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) - if (likely(!preemptible())) - return; - -+ if (!preemptible_lazy()) -+ return; -+ - do { - /* - * Because the function tracer can trace preempt_count_sub() -@@ -7554,7 +7630,9 @@ void init_idle(struct task_struct *idle, int cpu) - - /* Set the preempt count _outside_ the spinlocks! */ - init_idle_preempt_count(idle, cpu); -- -+#ifdef CONFIG_HAVE_PREEMPT_LAZY -+ task_thread_info(idle)->preempt_lazy_count = 0; -+#endif - /* - * The idle tasks have their own, simple scheduling class: - */ -diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index 794c2cb945f8..f354c6d370d7 100644 ---- a/kernel/sched/fair.c -+++ b/kernel/sched/fair.c -@@ -4365,7 +4365,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) - ideal_runtime = sched_slice(cfs_rq, curr); - delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; - if (delta_exec > ideal_runtime) { -- resched_curr(rq_of(cfs_rq)); -+ resched_curr_lazy(rq_of(cfs_rq)); - /* - * The current task ran long enough, ensure it doesn't get - * re-elected due to buddy favours. -@@ -4389,7 +4389,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) - return; - - if (delta > ideal_runtime) -- resched_curr(rq_of(cfs_rq)); -+ resched_curr_lazy(rq_of(cfs_rq)); - } - - static void -@@ -4532,7 +4532,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) - * validating it and just reschedule. - */ - if (queued) { -- resched_curr(rq_of(cfs_rq)); -+ resched_curr_lazy(rq_of(cfs_rq)); - return; - } - /* -@@ -4669,7 +4669,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) - * hierarchy can be throttled - */ - if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) -- resched_curr(rq_of(cfs_rq)); -+ resched_curr_lazy(rq_of(cfs_rq)); - } - - static __always_inline -@@ -5413,7 +5413,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) - - if (delta < 0) { - if (task_current(rq, p)) -- resched_curr(rq); -+ resched_curr_lazy(rq); - return; - } - hrtick_start(rq, delta); -@@ -6988,7 +6988,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ - return; - - preempt: -- resched_curr(rq); -+ resched_curr_lazy(rq); - /* - * Only set the backward buddy when the current task is still - * on the rq. This can happen when a wakeup gets interleaved -@@ -10775,7 +10775,7 @@ static void task_fork_fair(struct task_struct *p) - * 'current' within the tree based on its new key value. - */ - swap(curr->vruntime, se->vruntime); -- resched_curr(rq); -+ resched_curr_lazy(rq); - } - - se->vruntime -= cfs_rq->min_vruntime; -@@ -10802,7 +10802,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) - */ - if (task_current(rq, p)) { - if (p->prio > oldprio) -- resched_curr(rq); -+ resched_curr_lazy(rq); - } else - check_preempt_curr(rq, p, 0); - } -diff --git a/kernel/sched/features.h b/kernel/sched/features.h -index b47967d00570..c490f2c902ae 100644 ---- a/kernel/sched/features.h -+++ b/kernel/sched/features.h -@@ -48,6 +48,9 @@ SCHED_FEAT(NONTASK_CAPACITY, true) - - #ifdef CONFIG_PREEMPT_RT - SCHED_FEAT(TTWU_QUEUE, false) -+# ifdef CONFIG_PREEMPT_LAZY -+SCHED_FEAT(PREEMPT_LAZY, true) -+# endif - #else - - /* -diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index b65a4e244a77..178fe64154e7 100644 ---- a/kernel/sched/sched.h -+++ b/kernel/sched/sched.h -@@ -2015,6 +2015,15 @@ extern void reweight_task(struct task_struct *p, int prio); - extern void resched_curr(struct rq *rq); - extern void resched_cpu(int cpu); - -+#ifdef CONFIG_PREEMPT_LAZY -+extern void resched_curr_lazy(struct rq *rq); -+#else -+static inline void resched_curr_lazy(struct rq *rq) -+{ -+ resched_curr(rq); -+} -+#endif -+ - extern struct rt_bandwidth def_rt_bandwidth; - extern void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime); - -diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 55bcdaedf7a8..9836ab9d22bb 100644 ---- a/kernel/trace/trace.c -+++ b/kernel/trace/trace.c -@@ -2614,8 +2614,16 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) - trace_flags |= TRACE_FLAG_NEED_RESCHED; - if (test_preempt_need_resched()) - trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; -- return (trace_flags << 16) | (pc & 0xff) | -- (migration_disable_value() & 0xff) << 8; -+ -+#ifdef CONFIG_PREEMPT_LAZY -+ if (need_resched_lazy()) -+ trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY; -+#endif -+ -+ return (pc & 0xff) | -+ (migration_disable_value() & 0xff) << 8 | -+ (preempt_lazy_count() & 0xff) << 16 | -+ (trace_flags << 24); - } - - struct ring_buffer_event * -@@ -3875,15 +3883,17 @@ unsigned long trace_total_entries(struct trace_array *tr) - - static void print_lat_help_header(struct seq_file *m) - { -- seq_puts(m, "# _------=> CPU# \n" -- "# / _-----=> irqs-off \n" -- "# | / _----=> need-resched \n" -- "# || / _---=> hardirq/softirq \n" -- "# ||| / _--=> preempt-depth \n" -- "# |||| / _-=> migrate-disable \n" -- "# ||||| / delay \n" -- "# cmd pid |||||| time | caller \n" -- "# \\ / |||||| \\ | / \n"); -+ seq_puts(m, "# _--------=> CPU# \n" -+ "# / _-------=> irqs-off \n" -+ "# | / _------=> need-resched \n" -+ "# || / _-----=> need-resched-lazy\n" -+ "# ||| / _----=> hardirq/softirq \n" -+ "# |||| / _---=> preempt-depth \n" -+ "# ||||| / _--=> preempt-lazy-depth\n" -+ "# |||||| / _-=> migrate-disable \n" -+ "# ||||||| / delay \n" -+ "# cmd pid |||||||| time | caller \n" -+ "# \\ / |||||||| \\ | / \n"); - } - - static void print_event_info(struct array_buffer *buf, struct seq_file *m) -@@ -3917,14 +3927,16 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file - - print_event_info(buf, m); - -- seq_printf(m, "# %.*s _-----=> irqs-off\n", prec, space); -- seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space); -- seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space); -- seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space); -- seq_printf(m, "# %.*s||| / _-=> migrate-disable\n", prec, space); -- seq_printf(m, "# %.*s|||| / delay\n", prec, space); -- seq_printf(m, "# TASK-PID %.*s CPU# ||||| TIMESTAMP FUNCTION\n", prec, " TGID "); -- seq_printf(m, "# | | %.*s | ||||| | |\n", prec, " | "); -+ seq_printf(m, "# %.*s _-------=> irqs-off\n", prec, space); -+ seq_printf(m, "# %.*s / _------=> need-resched\n", prec, space); -+ seq_printf(m, "# %.*s| / _-----=> need-resched-lazy\n", prec, space); -+ seq_printf(m, "# %.*s|| / _----=> hardirq/softirq\n", prec, space); -+ seq_printf(m, "# %.*s||| / _---=> preempt-depth\n", prec, space); -+ seq_printf(m, "# %.*s|||| / _--=> preempt-lazy-depth\n", prec, space); -+ seq_printf(m, "# %.*s||||| / _-=> migrate-disable\n", prec, space); -+ seq_printf(m, "# %.*s|||||| / delay\n", prec, space); -+ seq_printf(m, "# TASK-PID %.*s CPU# ||||||| TIMESTAMP FUNCTION\n", prec, " TGID "); -+ seq_printf(m, "# | | %.*s | ||||||| | |\n", prec, " | "); - } - - void -diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index ba0b9edd652d..39fa2a7a8b03 100644 ---- a/kernel/trace/trace_events.c -+++ b/kernel/trace/trace_events.c -@@ -184,6 +184,7 @@ static int trace_define_common_fields(void) - __common_field(unsigned char, preempt_count); - __common_field(int, pid); - __common_field(unsigned char, migrate_disable); -+ __common_field(unsigned char, preempt_lazy_count); - - return ret; - } -diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c -index 5e32edb8a90a..af85aec1e887 100644 ---- a/kernel/trace/trace_output.c -+++ b/kernel/trace/trace_output.c -@@ -451,6 +451,7 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) - { - char hardsoft_irq; - char need_resched; -+ char need_resched_lazy; - char irqs_off; - int hardirq; - int softirq; -@@ -481,6 +482,9 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) - break; - } - -+ need_resched_lazy = -+ (entry->flags & TRACE_FLAG_NEED_RESCHED_LAZY) ? 'L' : '.'; -+ - hardsoft_irq = - (nmi && hardirq) ? 'Z' : - nmi ? 'z' : -@@ -489,14 +493,20 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) - softirq ? 's' : - '.' ; - -- trace_seq_printf(s, "%c%c%c", -- irqs_off, need_resched, hardsoft_irq); -+ trace_seq_printf(s, "%c%c%c%c", -+ irqs_off, need_resched, need_resched_lazy, -+ hardsoft_irq); - - if (entry->preempt_count) - trace_seq_printf(s, "%x", entry->preempt_count); - else - trace_seq_putc(s, '.'); - -+ if (entry->preempt_lazy_count) -+ trace_seq_printf(s, "%x", entry->preempt_lazy_count); -+ else -+ trace_seq_putc(s, '.'); -+ - if (entry->migrate_disable) - trace_seq_printf(s, "%x", entry->migrate_disable); - else --- -2.19.1 - diff --git a/features/rt/sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch b/features/rt/sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch deleted file mode 100644 index f99140d4..00000000 --- a/features/rt/sched-Disable-CONFIG_RT_GROUP_SCHED-on-RT.patch +++ /dev/null @@ -1,34 +0,0 @@ -From bcd494d279a6e818f31d1073dd429d3c0301940d Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 18 Jul 2011 17:03:52 +0200 -Subject: [PATCH 095/191] sched: Disable CONFIG_RT_GROUP_SCHED on RT - -Carsten reported problems when running: - - taskset 01 chrt -f 1 sleep 1 - -from within rc.local on a F15 machine. The task stays running and -never gets on the run queue because some of the run queues have -rt_throttled=1 which does not go away. Works nice from a ssh login -shell. Disabling CONFIG_RT_GROUP_SCHED solves that as well. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - init/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/init/Kconfig b/init/Kconfig -index d51c16a3f355..37686a22a769 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -973,6 +973,7 @@ config CFS_BANDWIDTH - config RT_GROUP_SCHED - bool "Group scheduling for SCHED_RR/FIFO" - depends on CGROUP_SCHED -+ depends on !PREEMPT_RT - default n - help - This feature lets you explicitly allocate real CPU bandwidth --- -2.19.1 - diff --git a/features/rt/sched-Disable-TTWU_QUEUE-on-RT.patch b/features/rt/sched-Disable-TTWU_QUEUE-on-RT.patch deleted file mode 100644 index d8a5054d..00000000 --- a/features/rt/sched-Disable-TTWU_QUEUE-on-RT.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1b8c8ade10b0b08dd7f7c2068683a78571967037 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 13 Sep 2011 16:42:35 +0200 -Subject: [PATCH 123/191] sched: Disable TTWU_QUEUE on RT - -The queued remote wakeup mechanism can introduce rather large -latencies if the number of migrated tasks is high. Disable it for RT. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/sched/features.h | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/kernel/sched/features.h b/kernel/sched/features.h -index 1bc2b158fc51..b47967d00570 100644 ---- a/kernel/sched/features.h -+++ b/kernel/sched/features.h -@@ -46,11 +46,16 @@ SCHED_FEAT(DOUBLE_TICK, false) - */ - SCHED_FEAT(NONTASK_CAPACITY, true) - -+#ifdef CONFIG_PREEMPT_RT -+SCHED_FEAT(TTWU_QUEUE, false) -+#else -+ - /* - * Queue remote wakeups on the target CPU and process them - * using the scheduler IPI. Reduces rq->lock contention/bounces. - */ - SCHED_FEAT(TTWU_QUEUE, true) -+#endif - - /* - * When doing wakeups, attempt to limit superfluous scans of the LLC domain. --- -2.19.1 - diff --git a/features/rt/sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch b/features/rt/sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch deleted file mode 100644 index 3e3b66a4..00000000 --- a/features/rt/sched-Do-not-account-rcu_preempt_depth-on-RT-in-migh.patch +++ /dev/null @@ -1,56 +0,0 @@ -From b3451220b4d08d1f80b2e4c10a2cd5d8bc9724e5 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 7 Jun 2011 09:19:06 +0200 -Subject: [PATCH 122/191] sched: Do not account rcu_preempt_depth on RT in - might_sleep() - -RT changes the rcu_preempt_depth semantics, so we cannot check for it -in might_sleep(). - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/rcupdate.h | 7 +++++++ - kernel/sched/core.c | 2 +- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h -index 6d855ef091ba..8b18be4c38ce 100644 ---- a/include/linux/rcupdate.h -+++ b/include/linux/rcupdate.h -@@ -54,6 +54,11 @@ void __rcu_read_unlock(void); - * types of kernel builds, the rcu_read_lock() nesting depth is unknowable. - */ - #define rcu_preempt_depth() (current->rcu_read_lock_nesting) -+#ifndef CONFIG_PREEMPT_RT -+#define sched_rcu_preempt_depth() rcu_preempt_depth() -+#else -+static inline int sched_rcu_preempt_depth(void) { return 0; } -+#endif - - #else /* #ifdef CONFIG_PREEMPT_RCU */ - -@@ -79,6 +84,8 @@ static inline int rcu_preempt_depth(void) - return 0; - } - -+#define sched_rcu_preempt_depth() rcu_preempt_depth() -+ - #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ - - /* Internal to kernel */ -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 2069022bdce5..c05455d4f034 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -8323,7 +8323,7 @@ void __init sched_init(void) - #ifdef CONFIG_DEBUG_ATOMIC_SLEEP - static inline int preempt_count_equals(int preempt_offset) - { -- int nested = preempt_count() + rcu_preempt_depth(); -+ int nested = preempt_count() + sched_rcu_preempt_depth(); - - return (nested == preempt_offset); - } --- -2.19.1 - diff --git a/features/rt/sched-Limit-the-number-of-task-migrations-per-batch.patch b/features/rt/sched-Limit-the-number-of-task-migrations-per-batch.patch deleted file mode 100644 index 2acfbe0a..00000000 --- a/features/rt/sched-Limit-the-number-of-task-migrations-per-batch.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 8a4c33943f124f335c73fac2e3000c83073dd389 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 6 Jun 2011 12:12:51 +0200 -Subject: [PATCH 119/191] sched: Limit the number of task migrations per batch - -Put an upper limit on the number of tasks which are migrated per batch -to avoid large latencies. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/sched/core.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 59fb8b18799f..aefac1f2e324 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -64,7 +64,11 @@ const_debug unsigned int sysctl_sched_features = - * Number of tasks to iterate in a single balance run. - * Limited because this is done with IRQs disabled. - */ -+#ifdef CONFIG_PREEMPT_RT -+const_debug unsigned int sysctl_sched_nr_migrate = 8; -+#else - const_debug unsigned int sysctl_sched_nr_migrate = 32; -+#endif - - /* - * period over which we measure -rt task CPU usage in us. --- -2.19.1 - diff --git a/features/rt/sched-Move-mmdrop-to-RCU-on-RT.patch b/features/rt/sched-Move-mmdrop-to-RCU-on-RT.patch deleted file mode 100644 index f6267f74..00000000 --- a/features/rt/sched-Move-mmdrop-to-RCU-on-RT.patch +++ /dev/null @@ -1,114 +0,0 @@ -From b36ded84e3c469fb806a75722808dc89a93a76ef Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 6 Jun 2011 12:20:33 +0200 -Subject: [PATCH 120/191] sched: Move mmdrop to RCU on RT - -Takes sleeping locks and calls into the memory allocator, so nothing -we want to do in task switch and oder atomic contexts. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/mm_types.h | 4 ++++ - include/linux/sched/mm.h | 11 +++++++++++ - kernel/fork.c | 13 +++++++++++++ - kernel/sched/core.c | 7 ++++++- - 4 files changed, 34 insertions(+), 1 deletion(-) - -diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index e94df45b5483..bb3ebe46a9db 100644 ---- a/include/linux/mm_types.h -+++ b/include/linux/mm_types.h -@@ -12,6 +12,7 @@ - #include <linux/completion.h> - #include <linux/cpumask.h> - #include <linux/uprobes.h> -+#include <linux/rcupdate.h> - #include <linux/page-flags-layout.h> - #include <linux/workqueue.h> - #include <linux/seqlock.h> -@@ -556,6 +557,9 @@ struct mm_struct { - bool tlb_flush_batched; - #endif - struct uprobes_state uprobes_state; -+#ifdef CONFIG_PREEMPT_RT -+ struct rcu_head delayed_drop; -+#endif - #ifdef CONFIG_HUGETLB_PAGE - atomic_long_t hugetlb_usage; - #endif -diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h -index 90b2a0bce11c..22af69051d1c 100644 ---- a/include/linux/sched/mm.h -+++ b/include/linux/sched/mm.h -@@ -49,6 +49,17 @@ static inline void mmdrop(struct mm_struct *mm) - __mmdrop(mm); - } - -+#ifdef CONFIG_PREEMPT_RT -+extern void __mmdrop_delayed(struct rcu_head *rhp); -+static inline void mmdrop_delayed(struct mm_struct *mm) -+{ -+ if (atomic_dec_and_test(&mm->mm_count)) -+ call_rcu(&mm->delayed_drop, __mmdrop_delayed); -+} -+#else -+# define mmdrop_delayed(mm) mmdrop(mm) -+#endif -+ - /** - * mmget() - Pin the address space associated with a &struct mm_struct. - * @mm: The address space to pin. -diff --git a/kernel/fork.c b/kernel/fork.c -index c0cfae6e545c..da1b307cbf73 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -689,6 +689,19 @@ void __mmdrop(struct mm_struct *mm) - } - EXPORT_SYMBOL_GPL(__mmdrop); - -+#ifdef CONFIG_PREEMPT_RT -+/* -+ * RCU callback for delayed mm drop. Not strictly rcu, but we don't -+ * want another facility to make this work. -+ */ -+void __mmdrop_delayed(struct rcu_head *rhp) -+{ -+ struct mm_struct *mm = container_of(rhp, struct mm_struct, delayed_drop); -+ -+ __mmdrop(mm); -+} -+#endif -+ - static void mmdrop_async_fn(struct work_struct *work) - { - struct mm_struct *mm; -diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index aefac1f2e324..9ec24e4188f4 100644 ---- a/kernel/sched/core.c -+++ b/kernel/sched/core.c -@@ -4270,9 +4270,13 @@ static struct rq *finish_task_switch(struct task_struct *prev) - * provided by mmdrop(), - * - a sync_core for SYNC_CORE. - */ -+ /* -+ * We use mmdrop_delayed() here so we don't have to do the -+ * full __mmdrop() when we are the last user. -+ */ - if (mm) { - membarrier_mm_sync_core_before_usermode(mm); -- mmdrop(mm); -+ mmdrop_delayed(mm); - } - if (unlikely(prev_state == TASK_DEAD)) { - if (prev->sched_class->task_dead) -@@ -7651,6 +7655,7 @@ void sched_setnuma(struct task_struct *p, int nid) - #endif /* CONFIG_NUMA_BALANCING */ - - #ifdef CONFIG_HOTPLUG_CPU -+ - /* - * Ensure that the idle task is using init_mm right before its CPU goes - * offline. --- -2.19.1 - diff --git a/features/rt/scsi-fcoe-Make-RT-aware.patch b/features/rt/scsi-fcoe-Make-RT-aware.patch deleted file mode 100644 index e9dd145e..00000000 --- a/features/rt/scsi-fcoe-Make-RT-aware.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 6b5015f29677cba625aa0e8204b629ef95d78fa3 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sat, 12 Nov 2011 14:00:48 +0100 -Subject: [PATCH 136/191] scsi/fcoe: Make RT aware. - -Do not disable preemption while taking sleeping locks. All user look safe -for migrate_diable() only. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - drivers/scsi/fcoe/fcoe.c | 16 ++++++++-------- - drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- - drivers/scsi/libfc/fc_exch.c | 4 ++-- - 3 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c -index 03bf49adaafe..52e0a2486b43 100644 ---- a/drivers/scsi/fcoe/fcoe.c -+++ b/drivers/scsi/fcoe/fcoe.c -@@ -1452,11 +1452,11 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, - static int fcoe_alloc_paged_crc_eof(struct sk_buff *skb, int tlen) - { - struct fcoe_percpu_s *fps; -- int rc; -+ int rc, cpu = get_cpu_light(); - -- fps = &get_cpu_var(fcoe_percpu); -+ fps = &per_cpu(fcoe_percpu, cpu); - rc = fcoe_get_paged_crc_eof(skb, tlen, fps); -- put_cpu_var(fcoe_percpu); -+ put_cpu_light(); - - return rc; - } -@@ -1641,11 +1641,11 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, - return 0; - } - -- stats = per_cpu_ptr(lport->stats, get_cpu()); -+ stats = per_cpu_ptr(lport->stats, get_cpu_light()); - stats->InvalidCRCCount++; - if (stats->InvalidCRCCount < 5) - printk(KERN_WARNING "fcoe: dropping frame with CRC error\n"); -- put_cpu(); -+ put_cpu_light(); - return -EINVAL; - } - -@@ -1686,7 +1686,7 @@ static void fcoe_recv_frame(struct sk_buff *skb) - */ - hp = (struct fcoe_hdr *) skb_network_header(skb); - -- stats = per_cpu_ptr(lport->stats, get_cpu()); -+ stats = per_cpu_ptr(lport->stats, get_cpu_light()); - if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) { - if (stats->ErrorFrames < 5) - printk(KERN_WARNING "fcoe: FCoE version " -@@ -1718,13 +1718,13 @@ static void fcoe_recv_frame(struct sk_buff *skb) - goto drop; - - if (!fcoe_filter_frames(lport, fp)) { -- put_cpu(); -+ put_cpu_light(); - fc_exch_recv(lport, fp); - return; - } - drop: - stats->ErrorFrames++; -- put_cpu(); -+ put_cpu_light(); - kfree_skb(skb); - } - -diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c -index 5ea426effa60..0d6b9acc7cf8 100644 ---- a/drivers/scsi/fcoe/fcoe_ctlr.c -+++ b/drivers/scsi/fcoe/fcoe_ctlr.c -@@ -828,7 +828,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) - - INIT_LIST_HEAD(&del_list); - -- stats = per_cpu_ptr(fip->lp->stats, get_cpu()); -+ stats = per_cpu_ptr(fip->lp->stats, get_cpu_light()); - - list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { - deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; -@@ -864,7 +864,7 @@ static unsigned long fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip) - sel_time = fcf->time; - } - } -- put_cpu(); -+ put_cpu_light(); - - list_for_each_entry_safe(fcf, next, &del_list, list) { - /* Removes fcf from current list */ -diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c -index 841000445b9a..26d661ddc950 100644 ---- a/drivers/scsi/libfc/fc_exch.c -+++ b/drivers/scsi/libfc/fc_exch.c -@@ -825,10 +825,10 @@ static struct fc_exch *fc_exch_em_alloc(struct fc_lport *lport, - } - memset(ep, 0, sizeof(*ep)); - -- cpu = get_cpu(); -+ cpu = get_cpu_light(); - pool = per_cpu_ptr(mp->pool, cpu); - spin_lock_bh(&pool->lock); -- put_cpu(); -+ put_cpu_light(); - - /* peek cache of free slot */ - if (pool->left != FC_XID_UNKNOWN) { --- -2.19.1 - diff --git a/features/rt/serial-8250-implement-write_atomic.patch b/features/rt/serial-8250-implement-write_atomic.patch deleted file mode 100644 index 37294b37..00000000 --- a/features/rt/serial-8250-implement-write_atomic.patch +++ /dev/null @@ -1,499 +0,0 @@ -From 4c5b59250c842f7a609e5581ce10f7d7967b8ec0 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 30 Nov 2020 01:42:02 +0106 -Subject: [PATCH 025/191] serial: 8250: implement write_atomic - -Implement a non-sleeping NMI-safe write_atomic() console function in -order to support emergency console printing. - -Since interrupts need to be disabled during transmit, all usage of -the IER register is wrapped with access functions that use the -console_atomic_lock() function to synchronize register access while -tracking the state of the interrupts. This is necessary because -write_atomic() can be called from an NMI context that has preempted -write_atomic(). - -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/tty/serial/8250/8250.h | 47 ++++++++++++- - drivers/tty/serial/8250/8250_core.c | 17 +++-- - drivers/tty/serial/8250/8250_fsl.c | 9 +++ - drivers/tty/serial/8250/8250_ingenic.c | 7 ++ - drivers/tty/serial/8250/8250_mtk.c | 29 +++++++- - drivers/tty/serial/8250/8250_port.c | 92 ++++++++++++++++---------- - include/linux/serial_8250.h | 5 ++ - 7 files changed, 162 insertions(+), 44 deletions(-) - -diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h -index 52bb21205bb6..5cbcaafbb4aa 100644 ---- a/drivers/tty/serial/8250/8250.h -+++ b/drivers/tty/serial/8250/8250.h -@@ -130,12 +130,55 @@ static inline void serial_dl_write(struct uart_8250_port *up, int value) - up->dl_write(up, value); - } - -+static inline void serial8250_set_IER(struct uart_8250_port *up, -+ unsigned char ier) -+{ -+ struct uart_port *port = &up->port; -+ unsigned int flags; -+ bool is_console; -+ -+ is_console = uart_console(port); -+ -+ if (is_console) -+ console_atomic_lock(&flags); -+ -+ serial_out(up, UART_IER, ier); -+ -+ if (is_console) -+ console_atomic_unlock(flags); -+} -+ -+static inline unsigned char serial8250_clear_IER(struct uart_8250_port *up) -+{ -+ struct uart_port *port = &up->port; -+ unsigned int clearval = 0; -+ unsigned int prior; -+ unsigned int flags; -+ bool is_console; -+ -+ is_console = uart_console(port); -+ -+ if (up->capabilities & UART_CAP_UUE) -+ clearval = UART_IER_UUE; -+ -+ if (is_console) -+ console_atomic_lock(&flags); -+ -+ prior = serial_port_in(port, UART_IER); -+ serial_port_out(port, UART_IER, clearval); -+ -+ if (is_console) -+ console_atomic_unlock(flags); -+ -+ return prior; -+} -+ - static inline bool serial8250_set_THRI(struct uart_8250_port *up) - { - if (up->ier & UART_IER_THRI) - return false; - up->ier |= UART_IER_THRI; -- serial_out(up, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - return true; - } - -@@ -144,7 +187,7 @@ static inline bool serial8250_clear_THRI(struct uart_8250_port *up) - if (!(up->ier & UART_IER_THRI)) - return false; - up->ier &= ~UART_IER_THRI; -- serial_out(up, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - return true; - } - -diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index cae61d1ebec5..47dd23056271 100644 ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -274,10 +274,8 @@ static void serial8250_backup_timeout(struct timer_list *t) - * Must disable interrupts or else we risk racing with the interrupt - * based handler. - */ -- if (up->port.irq) { -- ier = serial_in(up, UART_IER); -- serial_out(up, UART_IER, 0); -- } -+ if (up->port.irq) -+ ier = serial8250_clear_IER(up); - - iir = serial_in(up, UART_IIR); - -@@ -300,7 +298,7 @@ static void serial8250_backup_timeout(struct timer_list *t) - serial8250_tx_chars(up); - - if (up->port.irq) -- serial_out(up, UART_IER, ier); -+ serial8250_set_IER(up, ier); - - spin_unlock_irqrestore(&up->port.lock, flags); - -@@ -578,6 +576,14 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) - - #ifdef CONFIG_SERIAL_8250_CONSOLE - -+static void univ8250_console_write_atomic(struct console *co, const char *s, -+ unsigned int count) -+{ -+ struct uart_8250_port *up = &serial8250_ports[co->index]; -+ -+ serial8250_console_write_atomic(up, s, count); -+} -+ - static void univ8250_console_write(struct console *co, const char *s, - unsigned int count) - { -@@ -671,6 +677,7 @@ static int univ8250_console_match(struct console *co, char *name, int idx, - - static struct console univ8250_console = { - .name = "ttyS", -+ .write_atomic = univ8250_console_write_atomic, - .write = univ8250_console_write, - .device = uart_console_device, - .setup = univ8250_console_setup, -diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c -index fbcc90c31ca1..b33cb454ce03 100644 ---- a/drivers/tty/serial/8250/8250_fsl.c -+++ b/drivers/tty/serial/8250/8250_fsl.c -@@ -60,9 +60,18 @@ int fsl8250_handle_irq(struct uart_port *port) - - /* Stop processing interrupts on input overrun */ - if ((orig_lsr & UART_LSR_OE) && (up->overrun_backoff_time_ms > 0)) { -+ unsigned int ca_flags; - unsigned long delay; -+ bool is_console; - -+ is_console = uart_console(port); -+ -+ if (is_console) -+ console_atomic_lock(&ca_flags); - up->ier = port->serial_in(port, UART_IER); -+ if (is_console) -+ console_atomic_unlock(ca_flags); -+ - if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { - port->ops->stop_rx(port); - } else { -diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c -index 988bf6bcce42..bcd26d672539 100644 ---- a/drivers/tty/serial/8250/8250_ingenic.c -+++ b/drivers/tty/serial/8250/8250_ingenic.c -@@ -146,6 +146,8 @@ OF_EARLYCON_DECLARE(x1000_uart, "ingenic,x1000-uart", - - static void ingenic_uart_serial_out(struct uart_port *p, int offset, int value) - { -+ unsigned int flags; -+ bool is_console; - int ier; - - switch (offset) { -@@ -167,7 +169,12 @@ static void ingenic_uart_serial_out(struct uart_port *p, int offset, int value) - * If we have enabled modem status IRQs we should enable - * modem mode. - */ -+ is_console = uart_console(p); -+ if (is_console) -+ console_atomic_lock(&flags); - ier = p->serial_in(p, UART_IER); -+ if (is_console) -+ console_atomic_unlock(flags); - - if (ier & UART_IER_MSI) - value |= UART_MCR_MDCE | UART_MCR_FCM; -diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c -index f7d3023f860f..8133713dcf5e 100644 ---- a/drivers/tty/serial/8250/8250_mtk.c -+++ b/drivers/tty/serial/8250/8250_mtk.c -@@ -213,12 +213,37 @@ static void mtk8250_shutdown(struct uart_port *port) - - static void mtk8250_disable_intrs(struct uart_8250_port *up, int mask) - { -- serial_out(up, UART_IER, serial_in(up, UART_IER) & (~mask)); -+ struct uart_port *port = &up->port; -+ unsigned int flags; -+ unsigned int ier; -+ bool is_console; -+ -+ is_console = uart_console(port); -+ -+ if (is_console) -+ console_atomic_lock(&flags); -+ -+ ier = serial_in(up, UART_IER); -+ serial_out(up, UART_IER, ier & (~mask)); -+ -+ if (is_console) -+ console_atomic_unlock(flags); - } - - static void mtk8250_enable_intrs(struct uart_8250_port *up, int mask) - { -- serial_out(up, UART_IER, serial_in(up, UART_IER) | mask); -+ struct uart_port *port = &up->port; -+ unsigned int flags; -+ unsigned int ier; -+ -+ if (uart_console(port)) -+ console_atomic_lock(&flags); -+ -+ ier = serial_in(up, UART_IER); -+ serial_out(up, UART_IER, ier | mask); -+ -+ if (uart_console(port)) -+ console_atomic_unlock(flags); - } - - static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index b0af13074cd3..b05f8c34b291 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -757,7 +757,7 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) - serial_out(p, UART_EFR, UART_EFR_ECB); - serial_out(p, UART_LCR, 0); - } -- serial_out(p, UART_IER, sleep ? UART_IERX_SLEEP : 0); -+ serial8250_set_IER(p, sleep ? UART_IERX_SLEEP : 0); - if (p->capabilities & UART_CAP_EFR) { - serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B); - serial_out(p, UART_EFR, efr); -@@ -1429,7 +1429,7 @@ static void serial8250_stop_rx(struct uart_port *port) - - up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); - up->port.read_status_mask &= ~UART_LSR_DR; -- serial_port_out(port, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - - serial8250_rpm_put(up); - } -@@ -1459,7 +1459,7 @@ void serial8250_em485_stop_tx(struct uart_8250_port *p) - serial8250_clear_and_reinit_fifos(p); - - p->ier |= UART_IER_RLSI | UART_IER_RDI; -- serial_port_out(&p->port, UART_IER, p->ier); -+ serial8250_set_IER(p, p->ier); - } - } - EXPORT_SYMBOL_GPL(serial8250_em485_stop_tx); -@@ -1687,7 +1687,7 @@ static void serial8250_disable_ms(struct uart_port *port) - mctrl_gpio_disable_ms(up->gpios); - - up->ier &= ~UART_IER_MSI; -- serial_port_out(port, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - } - - static void serial8250_enable_ms(struct uart_port *port) -@@ -1703,7 +1703,7 @@ static void serial8250_enable_ms(struct uart_port *port) - up->ier |= UART_IER_MSI; - - serial8250_rpm_get(up); -- serial_port_out(port, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - serial8250_rpm_put(up); - } - -@@ -2118,14 +2118,7 @@ static void serial8250_put_poll_char(struct uart_port *port, - struct uart_8250_port *up = up_to_u8250p(port); - - serial8250_rpm_get(up); -- /* -- * First save the IER then disable the interrupts -- */ -- ier = serial_port_in(port, UART_IER); -- if (up->capabilities & UART_CAP_UUE) -- serial_port_out(port, UART_IER, UART_IER_UUE); -- else -- serial_port_out(port, UART_IER, 0); -+ ier = serial8250_clear_IER(up); - - wait_for_xmitr(up, BOTH_EMPTY); - /* -@@ -2138,7 +2131,7 @@ static void serial8250_put_poll_char(struct uart_port *port, - * and restore the IER - */ - wait_for_xmitr(up, BOTH_EMPTY); -- serial_port_out(port, UART_IER, ier); -+ serial8250_set_IER(up, ier); - serial8250_rpm_put(up); - } - -@@ -2441,7 +2434,7 @@ void serial8250_do_shutdown(struct uart_port *port) - */ - spin_lock_irqsave(&port->lock, flags); - up->ier = 0; -- serial_port_out(port, UART_IER, 0); -+ serial8250_set_IER(up, 0); - spin_unlock_irqrestore(&port->lock, flags); - - synchronize_irq(port->irq); -@@ -2771,7 +2764,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, - if (up->capabilities & UART_CAP_RTOIE) - up->ier |= UART_IER_RTOIE; - -- serial_port_out(port, UART_IER, up->ier); -+ serial8250_set_IER(up, up->ier); - - if (up->capabilities & UART_CAP_EFR) { - unsigned char efr = 0; -@@ -3237,7 +3230,7 @@ EXPORT_SYMBOL_GPL(serial8250_set_defaults); - - #ifdef CONFIG_SERIAL_8250_CONSOLE - --static void serial8250_console_putchar(struct uart_port *port, int ch) -+static void serial8250_console_putchar_locked(struct uart_port *port, int ch) - { - struct uart_8250_port *up = up_to_u8250p(port); - -@@ -3245,6 +3238,18 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) - serial_port_out(port, UART_TX, ch); - } - -+static void serial8250_console_putchar(struct uart_port *port, int ch) -+{ -+ struct uart_8250_port *up = up_to_u8250p(port); -+ unsigned int flags; -+ -+ wait_for_xmitr(up, UART_LSR_THRE); -+ -+ console_atomic_lock(&flags); -+ serial8250_console_putchar_locked(port, ch); -+ console_atomic_unlock(flags); -+} -+ - /* - * Restore serial console when h/w power-off detected - */ -@@ -3266,6 +3271,32 @@ static void serial8250_console_restore(struct uart_8250_port *up) - serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS); - } - -+void serial8250_console_write_atomic(struct uart_8250_port *up, -+ const char *s, unsigned int count) -+{ -+ struct uart_port *port = &up->port; -+ unsigned int flags; -+ unsigned int ier; -+ -+ console_atomic_lock(&flags); -+ -+ touch_nmi_watchdog(); -+ -+ ier = serial8250_clear_IER(up); -+ -+ if (atomic_fetch_inc(&up->console_printing)) { -+ uart_console_write(port, "\n", 1, -+ serial8250_console_putchar_locked); -+ } -+ uart_console_write(port, s, count, serial8250_console_putchar_locked); -+ atomic_dec(&up->console_printing); -+ -+ wait_for_xmitr(up, BOTH_EMPTY); -+ serial8250_set_IER(up, ier); -+ -+ console_atomic_unlock(flags); -+} -+ - /* - * Print a string to the serial port trying not to disturb - * any possible real use of the port... -@@ -3282,24 +3313,12 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, - struct uart_port *port = &up->port; - unsigned long flags; - unsigned int ier; -- int locked = 1; - - touch_nmi_watchdog(); - -- if (oops_in_progress) -- locked = spin_trylock_irqsave(&port->lock, flags); -- else -- spin_lock_irqsave(&port->lock, flags); -- -- /* -- * First save the IER then disable the interrupts -- */ -- ier = serial_port_in(port, UART_IER); -+ spin_lock_irqsave(&port->lock, flags); - -- if (up->capabilities & UART_CAP_UUE) -- serial_port_out(port, UART_IER, UART_IER_UUE); -- else -- serial_port_out(port, UART_IER, 0); -+ ier = serial8250_clear_IER(up); - - /* check scratch reg to see if port powered off during system sleep */ - if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { -@@ -3313,7 +3332,9 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, - mdelay(port->rs485.delay_rts_before_send); - } - -+ atomic_inc(&up->console_printing); - uart_console_write(port, s, count, serial8250_console_putchar); -+ atomic_dec(&up->console_printing); - - /* - * Finally, wait for transmitter to become empty -@@ -3326,8 +3347,7 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, - if (em485->tx_stopped) - up->rs485_stop_tx(up); - } -- -- serial_port_out(port, UART_IER, ier); -+ serial8250_set_IER(up, ier); - - /* - * The receive handling will happen properly because the -@@ -3339,8 +3359,7 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, - if (up->msr_saved_flags) - serial8250_modem_status(up); - -- if (locked) -- spin_unlock_irqrestore(&port->lock, flags); -+ spin_unlock_irqrestore(&port->lock, flags); - } - - static unsigned int probe_baud(struct uart_port *port) -@@ -3360,6 +3379,7 @@ static unsigned int probe_baud(struct uart_port *port) - - int serial8250_console_setup(struct uart_port *port, char *options, bool probe) - { -+ struct uart_8250_port *up = up_to_u8250p(port); - int baud = 9600; - int bits = 8; - int parity = 'n'; -@@ -3369,6 +3389,8 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) - if (!port->iobase && !port->membase) - return -ENODEV; - -+ atomic_set(&up->console_printing, 0); -+ - if (options) - uart_parse_options(options, &baud, &parity, &bits, &flow); - else if (probe) -diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h -index 9e655055112d..ffef674deda7 100644 ---- a/include/linux/serial_8250.h -+++ b/include/linux/serial_8250.h -@@ -7,6 +7,7 @@ - #ifndef _LINUX_SERIAL_8250_H - #define _LINUX_SERIAL_8250_H - -+#include <linux/atomic.h> - #include <linux/serial_core.h> - #include <linux/serial_reg.h> - #include <linux/platform_device.h> -@@ -125,6 +126,8 @@ struct uart_8250_port { - #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA - unsigned char msr_saved_flags; - -+ atomic_t console_printing; -+ - struct uart_8250_dma *dma; - const struct uart_8250_ops *ops; - -@@ -180,6 +183,8 @@ void serial8250_init_port(struct uart_8250_port *up); - void serial8250_set_defaults(struct uart_8250_port *up); - void serial8250_console_write(struct uart_8250_port *up, const char *s, - unsigned int count); -+void serial8250_console_write_atomic(struct uart_8250_port *up, const char *s, -+ unsigned int count); - int serial8250_console_setup(struct uart_port *port, char *options, bool probe); - int serial8250_console_exit(struct uart_port *port); - --- -2.19.1 - diff --git a/features/rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch b/features/rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch deleted file mode 100644 index 509bc7e7..00000000 --- a/features/rt/shmem-Use-raw_spinlock_t-for-stat_lock.patch +++ /dev/null @@ -1,146 +0,0 @@ -From 214fdbf6532b39b266f6a6f836fb4ff5e8eb8458 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Fri, 14 Aug 2020 18:53:34 +0200 -Subject: [PATCH 037/191] shmem: Use raw_spinlock_t for ->stat_lock - -Each CPU has SHMEM_INO_BATCH inodes available in `->ino_batch' which is -per-CPU. Access here is serialized by disabling preemption. If the pool is -empty, it gets reloaded from `->next_ino'. Access here is serialized by -->stat_lock which is a spinlock_t and can not be acquired with disabled -preemption. -One way around it would make per-CPU ino_batch struct containing the inode -number a local_lock_t. -Another sollution is to promote ->stat_lock to a raw_spinlock_t. The critical -sections are short. The mpol_put() should be moved outside of the critical -section to avoid invoking the destrutor with disabled preemption. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/shmem_fs.h | 2 +- - mm/shmem.c | 31 +++++++++++++++++-------------- - 2 files changed, 18 insertions(+), 15 deletions(-) - -diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h -index d82b6f396588..12b2e41d8f47 100644 ---- a/include/linux/shmem_fs.h -+++ b/include/linux/shmem_fs.h -@@ -31,7 +31,7 @@ struct shmem_sb_info { - struct percpu_counter used_blocks; /* How many are allocated */ - unsigned long max_inodes; /* How many inodes are allowed */ - unsigned long free_inodes; /* How many are left for allocation */ -- spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ -+ raw_spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ - umode_t mode; /* Mount mode for root directory */ - unsigned char huge; /* Whether to try for hugepages */ - kuid_t uid; /* Mount uid for root directory */ -diff --git a/mm/shmem.c b/mm/shmem.c -index b2db4ed0fbc7..b85dafef6529 100644 ---- a/mm/shmem.c -+++ b/mm/shmem.c -@@ -278,10 +278,10 @@ static int shmem_reserve_inode(struct super_block *sb, ino_t *inop) - ino_t ino; - - if (!(sb->s_flags & SB_KERNMOUNT)) { -- spin_lock(&sbinfo->stat_lock); -+ raw_spin_lock(&sbinfo->stat_lock); - if (sbinfo->max_inodes) { - if (!sbinfo->free_inodes) { -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - return -ENOSPC; - } - sbinfo->free_inodes--; -@@ -304,7 +304,7 @@ static int shmem_reserve_inode(struct super_block *sb, ino_t *inop) - } - *inop = ino; - } -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - } else if (inop) { - /* - * __shmem_file_setup, one of our callers, is lock-free: it -@@ -319,13 +319,14 @@ static int shmem_reserve_inode(struct super_block *sb, ino_t *inop) - * to worry about things like glibc compatibility. - */ - ino_t *next_ino; -+ - next_ino = per_cpu_ptr(sbinfo->ino_batch, get_cpu()); - ino = *next_ino; - if (unlikely(ino % SHMEM_INO_BATCH == 0)) { -- spin_lock(&sbinfo->stat_lock); -+ raw_spin_lock(&sbinfo->stat_lock); - ino = sbinfo->next_ino; - sbinfo->next_ino += SHMEM_INO_BATCH; -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - if (unlikely(is_zero_ino(ino))) - ino++; - } -@@ -341,9 +342,9 @@ static void shmem_free_inode(struct super_block *sb) - { - struct shmem_sb_info *sbinfo = SHMEM_SB(sb); - if (sbinfo->max_inodes) { -- spin_lock(&sbinfo->stat_lock); -+ raw_spin_lock(&sbinfo->stat_lock); - sbinfo->free_inodes++; -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - } - } - -@@ -1453,10 +1454,10 @@ static struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo) - { - struct mempolicy *mpol = NULL; - if (sbinfo->mpol) { -- spin_lock(&sbinfo->stat_lock); /* prevent replace/use races */ -+ raw_spin_lock(&sbinfo->stat_lock); /* prevent replace/use races */ - mpol = sbinfo->mpol; - mpol_get(mpol); -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - } - return mpol; - } -@@ -3533,9 +3534,10 @@ static int shmem_reconfigure(struct fs_context *fc) - struct shmem_options *ctx = fc->fs_private; - struct shmem_sb_info *sbinfo = SHMEM_SB(fc->root->d_sb); - unsigned long inodes; -+ struct mempolicy *mpol = NULL; - const char *err; - -- spin_lock(&sbinfo->stat_lock); -+ raw_spin_lock(&sbinfo->stat_lock); - inodes = sbinfo->max_inodes - sbinfo->free_inodes; - if ((ctx->seen & SHMEM_SEEN_BLOCKS) && ctx->blocks) { - if (!sbinfo->max_blocks) { -@@ -3580,14 +3582,15 @@ static int shmem_reconfigure(struct fs_context *fc) - * Preserve previous mempolicy unless mpol remount option was specified. - */ - if (ctx->mpol) { -- mpol_put(sbinfo->mpol); -+ mpol = sbinfo->mpol; - sbinfo->mpol = ctx->mpol; /* transfers initial ref */ - ctx->mpol = NULL; - } -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); -+ mpol_put(mpol); - return 0; - out: -- spin_unlock(&sbinfo->stat_lock); -+ raw_spin_unlock(&sbinfo->stat_lock); - return invalfc(fc, "%s", err); - } - -@@ -3704,7 +3707,7 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) - sbinfo->mpol = ctx->mpol; - ctx->mpol = NULL; - -- spin_lock_init(&sbinfo->stat_lock); -+ raw_spin_lock_init(&sbinfo->stat_lock); - if (percpu_counter_init(&sbinfo->used_blocks, 0, GFP_KERNEL)) - goto failed; - spin_lock_init(&sbinfo->shrinklist_lock); --- -2.19.1 - diff --git a/features/rt/signal-Revert-ptrace-preempt-magic.patch b/features/rt/signal-Revert-ptrace-preempt-magic.patch deleted file mode 100644 index 2408f040..00000000 --- a/features/rt/signal-Revert-ptrace-preempt-magic.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 06589e25a1763adbe6ac70a0cb1ab769704163ec Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Wed, 21 Sep 2011 19:57:12 +0200 -Subject: [PATCH 083/191] signal: Revert ptrace preempt magic - -Upstream commit '53da1d9456fe7f8 fix ptrace slowness' is nothing more -than a bandaid around the ptrace design trainwreck. It's not a -correctness issue, it's merily a cosmetic bandaid. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - kernel/signal.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/kernel/signal.c b/kernel/signal.c -index ba4d1ef39a9e..98c48e1ea82e 100644 ---- a/kernel/signal.c -+++ b/kernel/signal.c -@@ -2203,16 +2203,8 @@ static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t - if (gstop_done && ptrace_reparented(current)) - do_notify_parent_cldstop(current, false, why); - -- /* -- * Don't want to allow preemption here, because -- * sys_ptrace() needs this task to be inactive. -- * -- * XXX: implement read_unlock_no_resched(). -- */ -- preempt_disable(); - read_unlock(&tasklist_lock); - cgroup_enter_frozen(); -- preempt_enable_no_resched(); - freezable_schedule(); - cgroup_leave_frozen(true); - } else { --- -2.19.1 - diff --git a/features/rt/signal-x86-Delay-calling-signals-in-atomic.patch b/features/rt/signal-x86-Delay-calling-signals-in-atomic.patch deleted file mode 100644 index 6e4be111..00000000 --- a/features/rt/signal-x86-Delay-calling-signals-in-atomic.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 3cbbc9627110b6a4140d688a54c57711d3ba8560 Mon Sep 17 00:00:00 2001 -From: Oleg Nesterov <oleg@redhat.com> -Date: Tue, 14 Jul 2015 14:26:34 +0200 -Subject: [PATCH 100/191] signal/x86: Delay calling signals in atomic - -On x86_64 we must disable preemption before we enable interrupts -for stack faults, int3 and debugging, because the current task is using -a per CPU debug stack defined by the IST. If we schedule out, another task -can come in and use the same stack and cause the stack to be corrupted -and crash the kernel on return. - -When CONFIG_PREEMPT_RT is enabled, spin_locks become mutexes, and -one of these is the spin lock used in signal handling. - -Some of the debug code (int3) causes do_trap() to send a signal. -This function calls a spin lock that has been converted to a mutex -and has the possibility to sleep. If this happens, the above issues with -the corrupted stack is possible. - -Instead of calling the signal right away, for PREEMPT_RT and x86_64, -the signal information is stored on the stacks task_struct and -TIF_NOTIFY_RESUME is set. Then on exit of the trap, the signal resume -code will send the signal when preemption is enabled. - -[ rostedt: Switched from #ifdef CONFIG_PREEMPT_RT to - ARCH_RT_DELAYS_SIGNAL_SEND and added comments to the code. ] - -Signed-off-by: Oleg Nesterov <oleg@redhat.com> -Signed-off-by: Steven Rostedt <rostedt@goodmis.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -[bigeasy: also needed on 32bit as per Yang Shi <yang.shi@linaro.org>] -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/x86/include/asm/signal.h | 13 +++++++++++++ - include/linux/sched.h | 4 ++++ - kernel/entry/common.c | 8 ++++++++ - kernel/signal.c | 28 ++++++++++++++++++++++++++++ - 4 files changed, 53 insertions(+) - -diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h -index 6fd8410a3910..f3bf2f515edb 100644 ---- a/arch/x86/include/asm/signal.h -+++ b/arch/x86/include/asm/signal.h -@@ -28,6 +28,19 @@ typedef struct { - #define SA_IA32_ABI 0x02000000u - #define SA_X32_ABI 0x01000000u - -+/* -+ * Because some traps use the IST stack, we must keep preemption -+ * disabled while calling do_trap(), but do_trap() may call -+ * force_sig_info() which will grab the signal spin_locks for the -+ * task, which in PREEMPT_RT are mutexes. By defining -+ * ARCH_RT_DELAYS_SIGNAL_SEND the force_sig_info() will set -+ * TIF_NOTIFY_RESUME and set up the signal to be sent on exit of the -+ * trap. -+ */ -+#if defined(CONFIG_PREEMPT_RT) -+#define ARCH_RT_DELAYS_SIGNAL_SEND -+#endif -+ - #ifndef CONFIG_COMPAT - typedef sigset_t compat_sigset_t; - #endif -diff --git a/include/linux/sched.h b/include/linux/sched.h -index fb5350358bc8..1d85cfa28fe6 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -997,6 +997,10 @@ struct task_struct { - /* Restored if set_restore_sigmask() was used: */ - sigset_t saved_sigmask; - struct sigpending pending; -+#ifdef CONFIG_PREEMPT_RT -+ /* TODO: move me into ->restart_block ? */ -+ struct kernel_siginfo forced_info; -+#endif - unsigned long sas_ss_sp; - size_t sas_ss_size; - unsigned int sas_ss_flags; -diff --git a/kernel/entry/common.c b/kernel/entry/common.c -index 8442e5c9cfa2..2a7bcc744033 100644 ---- a/kernel/entry/common.c -+++ b/kernel/entry/common.c -@@ -161,6 +161,14 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, - if (ti_work & _TIF_NEED_RESCHED) - schedule(); - -+#ifdef ARCH_RT_DELAYS_SIGNAL_SEND -+ if (unlikely(current->forced_info.si_signo)) { -+ struct task_struct *t = current; -+ force_sig_info(&t->forced_info); -+ t->forced_info.si_signo = 0; -+ } -+#endif -+ - if (ti_work & _TIF_UPROBE) - uprobe_notify_resume(regs); - -diff --git a/kernel/signal.c b/kernel/signal.c -index 98c48e1ea82e..a5d16084f54c 100644 ---- a/kernel/signal.c -+++ b/kernel/signal.c -@@ -1314,6 +1314,34 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t) - struct k_sigaction *action; - int sig = info->si_signo; - -+ /* -+ * On some archs, PREEMPT_RT has to delay sending a signal from a trap -+ * since it can not enable preemption, and the signal code's spin_locks -+ * turn into mutexes. Instead, it must set TIF_NOTIFY_RESUME which will -+ * send the signal on exit of the trap. -+ */ -+#ifdef ARCH_RT_DELAYS_SIGNAL_SEND -+ if (in_atomic()) { -+ struct task_struct *t = current; -+ -+ if (WARN_ON_ONCE(t->forced_info.si_signo)) -+ return 0; -+ -+ if (is_si_special(info)) { -+ WARN_ON_ONCE(info != SEND_SIG_PRIV); -+ t->forced_info.si_signo = info->si_signo; -+ t->forced_info.si_errno = 0; -+ t->forced_info.si_code = SI_KERNEL; -+ t->forced_info.si_pid = 0; -+ t->forced_info.si_uid = 0; -+ } else { -+ t->forced_info = *info; -+ } -+ -+ set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); -+ return 0; -+ } -+#endif - spin_lock_irqsave(&t->sighand->siglock, flags); - action = &t->sighand->action[sig-1]; - ignored = action->sa.sa_handler == SIG_IGN; --- -2.19.1 - diff --git a/features/rt/signals-Allow-RT-tasks-to-cache-one-sigqueue-struct.patch b/features/rt/signals-Allow-RT-tasks-to-cache-one-sigqueue-struct.patch deleted file mode 100644 index ae43826e..00000000 --- a/features/rt/signals-Allow-RT-tasks-to-cache-one-sigqueue-struct.patch +++ /dev/null @@ -1,216 +0,0 @@ -From 7f989d7d619da9e6ad512bc325d36b0055fca72c Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Fri, 3 Jul 2009 08:44:56 -0500 -Subject: [PATCH 188/191] signals: Allow RT tasks to cache one sigqueue struct - -Allow realtime tasks to cache one sigqueue in task struct. This avoids an -allocation which can cause latencies or fail. -Ideally the sigqueue is cached after first sucessfull delivery and will be -available for next signal delivery. This works under the assumption that the RT -task has never an unprocessed singal while one is about to be queued. -The caching is not used for SIGQUEUE_PREALLOC because this kind of sigqueue is -handled differently (and not used for regular signal delivery). - -[bigeasy: With a fix from Matt Fleming <matt@codeblueprint.co.uk>] -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/sched.h | 1 + - include/linux/signal.h | 1 + - kernel/exit.c | 2 +- - kernel/fork.c | 1 + - kernel/signal.c | 67 +++++++++++++++++++++++++++++++++++++++--- - 5 files changed, 67 insertions(+), 5 deletions(-) - -diff --git a/include/linux/sched.h b/include/linux/sched.h -index 8e566b8049aa..635e08a5aa71 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -988,6 +988,7 @@ struct task_struct { - /* Signal handlers: */ - struct signal_struct *signal; - struct sighand_struct __rcu *sighand; -+ struct sigqueue *sigqueue_cache; - sigset_t blocked; - sigset_t real_blocked; - /* Restored if set_restore_sigmask() was used: */ -diff --git a/include/linux/signal.h b/include/linux/signal.h -index 205526c4003a..d47a86790edc 100644 ---- a/include/linux/signal.h -+++ b/include/linux/signal.h -@@ -265,6 +265,7 @@ static inline void init_sigpending(struct sigpending *sig) - } - - extern void flush_sigqueue(struct sigpending *queue); -+extern void flush_task_sigqueue(struct task_struct *tsk); - - /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ - static inline int valid_signal(unsigned long sig) -diff --git a/kernel/exit.c b/kernel/exit.c -index 04029e35e69a..346f7b76ceca 100644 ---- a/kernel/exit.c -+++ b/kernel/exit.c -@@ -152,7 +152,7 @@ static void __exit_signal(struct task_struct *tsk) - * Do this under ->siglock, we can race with another thread - * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals. - */ -- flush_sigqueue(&tsk->pending); -+ flush_task_sigqueue(tsk); - tsk->sighand = NULL; - spin_unlock(&sighand->siglock); - -diff --git a/kernel/fork.c b/kernel/fork.c -index 5fdb0a1bbad8..146a019df72a 100644 ---- a/kernel/fork.c -+++ b/kernel/fork.c -@@ -2027,6 +2027,7 @@ static __latent_entropy struct task_struct *copy_process( - spin_lock_init(&p->alloc_lock); - - init_sigpending(&p->pending); -+ p->sigqueue_cache = NULL; - - p->utime = p->stime = p->gtime = 0; - #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME -diff --git a/kernel/signal.c b/kernel/signal.c -index a5d16084f54c..5baac8c5d2e9 100644 ---- a/kernel/signal.c -+++ b/kernel/signal.c -@@ -20,6 +20,7 @@ - #include <linux/sched/task.h> - #include <linux/sched/task_stack.h> - #include <linux/sched/cputime.h> -+#include <linux/sched/rt.h> - #include <linux/file.h> - #include <linux/fs.h> - #include <linux/proc_fs.h> -@@ -404,13 +405,30 @@ void task_join_group_stop(struct task_struct *task) - task_set_jobctl_pending(task, mask | JOBCTL_STOP_PENDING); - } - -+static struct sigqueue *sigqueue_from_cache(struct task_struct *t) -+{ -+ struct sigqueue *q = t->sigqueue_cache; -+ -+ if (q && cmpxchg(&t->sigqueue_cache, q, NULL) == q) -+ return q; -+ return NULL; -+} -+ -+static bool sigqueue_add_cache(struct task_struct *t, struct sigqueue *q) -+{ -+ if (!t->sigqueue_cache && cmpxchg(&t->sigqueue_cache, NULL, q) == NULL) -+ return true; -+ return false; -+} -+ - /* - * allocate a new signal queue record - * - this may be called without locks if and only if t == current, otherwise an - * appropriate lock must be held to stop the target task from exiting - */ - static struct sigqueue * --__sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimit) -+__sigqueue_do_alloc(int sig, struct task_struct *t, gfp_t flags, -+ int override_rlimit, bool fromslab) - { - struct sigqueue *q = NULL; - struct user_struct *user; -@@ -432,7 +450,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi - rcu_read_unlock(); - - if (override_rlimit || likely(sigpending <= task_rlimit(t, RLIMIT_SIGPENDING))) { -- q = kmem_cache_alloc(sigqueue_cachep, flags); -+ if (!fromslab) -+ q = sigqueue_from_cache(t); -+ if (!q) -+ q = kmem_cache_alloc(sigqueue_cachep, flags); - } else { - print_dropped_signal(sig); - } -@@ -449,6 +470,13 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi - return q; - } - -+static struct sigqueue * -+__sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, -+ int override_rlimit) -+{ -+ return __sigqueue_do_alloc(sig, t, flags, override_rlimit, false); -+} -+ - static void __sigqueue_free(struct sigqueue *q) - { - if (q->flags & SIGQUEUE_PREALLOC) -@@ -458,6 +486,20 @@ static void __sigqueue_free(struct sigqueue *q) - kmem_cache_free(sigqueue_cachep, q); - } - -+static void __sigqueue_cache_or_free(struct sigqueue *q) -+{ -+ struct user_struct *up; -+ -+ if (q->flags & SIGQUEUE_PREALLOC) -+ return; -+ -+ up = q->user; -+ if (atomic_dec_and_test(&up->sigpending)) -+ free_uid(up); -+ if (!task_is_realtime(current) || !sigqueue_add_cache(current, q)) -+ kmem_cache_free(sigqueue_cachep, q); -+} -+ - void flush_sigqueue(struct sigpending *queue) - { - struct sigqueue *q; -@@ -470,6 +512,21 @@ void flush_sigqueue(struct sigpending *queue) - } - } - -+/* -+ * Called from __exit_signal. Flush tsk->pending and -+ * tsk->sigqueue_cache -+ */ -+void flush_task_sigqueue(struct task_struct *tsk) -+{ -+ struct sigqueue *q; -+ -+ flush_sigqueue(&tsk->pending); -+ -+ q = sigqueue_from_cache(tsk); -+ if (q) -+ kmem_cache_free(sigqueue_cachep, q); -+} -+ - /* - * Flush all pending signals for this kthread. - */ -@@ -594,7 +651,7 @@ static void collect_signal(int sig, struct sigpending *list, kernel_siginfo_t *i - (info->si_code == SI_TIMER) && - (info->si_sys_private); - -- __sigqueue_free(first); -+ __sigqueue_cache_or_free(first); - } else { - /* - * Ok, it wasn't in the queue. This must be -@@ -631,6 +688,8 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, kernel_siginfo_t *in - bool resched_timer = false; - int signr; - -+ WARN_ON_ONCE(tsk != current); -+ - /* We only dequeue private signals from ourselves, we don't let - * signalfd steal them - */ -@@ -1835,7 +1894,7 @@ EXPORT_SYMBOL(kill_pid); - */ - struct sigqueue *sigqueue_alloc(void) - { -- struct sigqueue *q = __sigqueue_alloc(-1, current, GFP_KERNEL, 0); -+ struct sigqueue *q = __sigqueue_do_alloc(-1, current, GFP_KERNEL, 0, true); - - if (q) - q->flags |= SIGQUEUE_PREALLOC; --- -2.19.1 - diff --git a/features/rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch b/features/rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch deleted file mode 100644 index 3c937ac4..00000000 --- a/features/rt/smp-Wake-ksoftirqd-on-PREEMPT_RT-instead-do_softirq.patch +++ /dev/null @@ -1,47 +0,0 @@ -From ba932c3063ef622c49da8054b96051fc0ba50a38 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 15 Feb 2021 18:44:12 +0100 -Subject: [PATCH 040/191] smp: Wake ksoftirqd on PREEMPT_RT instead - do_softirq(). - -The softirq implementation on PREEMPT_RT does not provide do_softirq(). -The other user of do_softirq() is replaced with a local_bh_disable() -+ enable() around the possible raise-softirq invocation. This can not be -done here because migration_cpu_stop() is invoked with disabled -preemption. - -Wake the softirq thread on PREEMPT_RT if there are any pending softirqs. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/smp.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/kernel/smp.c b/kernel/smp.c -index aeb0adfa0606..01e9d01d1866 100644 ---- a/kernel/smp.c -+++ b/kernel/smp.c -@@ -450,8 +450,18 @@ void flush_smp_call_function_from_idle(void) - - local_irq_save(flags); - flush_smp_call_function_queue(true); -- if (local_softirq_pending()) -- do_softirq(); -+ -+ if (local_softirq_pending()) { -+ -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { -+ do_softirq(); -+ } else { -+ struct task_struct *ksoftirqd = this_cpu_ksoftirqd(); -+ -+ if (ksoftirqd && ksoftirqd->state != TASK_RUNNING) -+ wake_up_process(ksoftirqd); -+ } -+ } - - local_irq_restore(flags); - } --- -2.19.1 - diff --git a/features/rt/softirq-Add-RT-specific-softirq-accounting.patch b/features/rt/softirq-Add-RT-specific-softirq-accounting.patch deleted file mode 100644 index 2f9c1130..00000000 --- a/features/rt/softirq-Add-RT-specific-softirq-accounting.patch +++ /dev/null @@ -1,74 +0,0 @@ -From e9763da838fb3d678d582b5bbbe56c960a899fb1 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:53 +0100 -Subject: [PATCH 055/191] softirq: Add RT specific softirq accounting - -RT requires the softirq processing and local bottomhalf disabled regions to -be preemptible. Using the normal preempt count based serialization is -therefore not possible because this implicitely disables preemption. - -RT kernels use a per CPU local lock to serialize bottomhalfs. As -local_bh_disable() can nest the lock can only be acquired on the outermost -invocation of local_bh_disable() and released when the nest count becomes -zero. Tasks which hold the local lock can be preempted so its required to -keep track of the nest count per task. - -Add a RT only counter to task struct and adjust the relevant macros in -preempt.h. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Frederic Weisbecker <frederic@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/hardirq.h | 1 + - include/linux/preempt.h | 6 +++++- - include/linux/sched.h | 3 +++ - 3 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h -index 0926e9ca4d85..76878b357ffa 100644 ---- a/include/linux/hardirq.h -+++ b/include/linux/hardirq.h -@@ -6,6 +6,7 @@ - #include <linux/preempt.h> - #include <linux/lockdep.h> - #include <linux/ftrace_irq.h> -+#include <linux/sched.h> - #include <linux/vtime.h> - #include <asm/hardirq.h> - -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index 69cc8b64aa3a..9881eac0698f 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -79,7 +79,11 @@ - - #define nmi_count() (preempt_count() & NMI_MASK) - #define hardirq_count() (preempt_count() & HARDIRQ_MASK) --#define softirq_count() (preempt_count() & SOFTIRQ_MASK) -+#ifdef CONFIG_PREEMPT_RT -+# define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK) -+#else -+# define softirq_count() (preempt_count() & SOFTIRQ_MASK) -+#endif - #define irq_count() (nmi_count() | hardirq_count() | softirq_count()) - - /* -diff --git a/include/linux/sched.h b/include/linux/sched.h -index cf245bc237e7..c8998312d7bc 100644 ---- a/include/linux/sched.h -+++ b/include/linux/sched.h -@@ -1043,6 +1043,9 @@ struct task_struct { - int softirq_context; - int irq_config; - #endif -+#ifdef CONFIG_PREEMPT_RT -+ int softirq_disable_cnt; -+#endif - - #ifdef CONFIG_LOCKDEP - # define MAX_LOCK_DEPTH 48UL --- -2.19.1 - diff --git a/features/rt/softirq-Check-preemption-after-reenabling-interrupts.patch b/features/rt/softirq-Check-preemption-after-reenabling-interrupts.patch deleted file mode 100644 index 21b60936..00000000 --- a/features/rt/softirq-Check-preemption-after-reenabling-interrupts.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 601c56cd3ae5a8d6c944ec0b378e10877f102bdc Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 13 Nov 2011 17:17:09 +0100 -Subject: [PATCH 124/191] softirq: Check preemption after reenabling interrupts - -raise_softirq_irqoff() disables interrupts and wakes the softirq -daemon, but after reenabling interrupts there is no preemption check, -so the execution of the softirq thread might be delayed arbitrarily. - -In principle we could add that check to local_irq_enable/restore, but -that's overkill as the rasie_softirq_irqoff() sections are the only -ones which show this behaviour. - -Reported-by: Carsten Emde <cbe@osadl.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/preempt.h | 3 +++ - lib/irq_poll.c | 5 +++++ - net/core/dev.c | 7 +++++++ - 3 files changed, 15 insertions(+) - -diff --git a/include/linux/preempt.h b/include/linux/preempt.h -index 5ceac863e729..fb140e00f74d 100644 ---- a/include/linux/preempt.h -+++ b/include/linux/preempt.h -@@ -190,8 +190,10 @@ do { \ - - #ifdef CONFIG_PREEMPT_RT - # define preempt_enable_no_resched() sched_preempt_enable_no_resched() -+# define preempt_check_resched_rt() preempt_check_resched() - #else - # define preempt_enable_no_resched() preempt_enable() -+# define preempt_check_resched_rt() barrier(); - #endif - - #define preemptible() (preempt_count() == 0 && !irqs_disabled()) -@@ -262,6 +264,7 @@ do { \ - #define preempt_disable_notrace() barrier() - #define preempt_enable_no_resched_notrace() barrier() - #define preempt_enable_notrace() barrier() -+#define preempt_check_resched_rt() barrier() - #define preemptible() 0 - - #endif /* CONFIG_PREEMPT_COUNT */ -diff --git a/lib/irq_poll.c b/lib/irq_poll.c -index 2f17b488d58e..7557bf7ecf1f 100644 ---- a/lib/irq_poll.c -+++ b/lib/irq_poll.c -@@ -37,6 +37,7 @@ void irq_poll_sched(struct irq_poll *iop) - list_add_tail(&iop->list, this_cpu_ptr(&blk_cpu_iopoll)); - raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); - local_irq_restore(flags); -+ preempt_check_resched_rt(); - } - EXPORT_SYMBOL(irq_poll_sched); - -@@ -72,6 +73,7 @@ void irq_poll_complete(struct irq_poll *iop) - local_irq_save(flags); - __irq_poll_complete(iop); - local_irq_restore(flags); -+ preempt_check_resched_rt(); - } - EXPORT_SYMBOL(irq_poll_complete); - -@@ -96,6 +98,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) - } - - local_irq_enable(); -+ preempt_check_resched_rt(); - - /* Even though interrupts have been re-enabled, this - * access is safe because interrupts can only add new -@@ -133,6 +136,7 @@ static void __latent_entropy irq_poll_softirq(struct softirq_action *h) - __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); - - local_irq_enable(); -+ preempt_check_resched_rt(); - } - - /** -@@ -196,6 +200,7 @@ static int irq_poll_cpu_dead(unsigned int cpu) - this_cpu_ptr(&blk_cpu_iopoll)); - __raise_softirq_irqoff(IRQ_POLL_SOFTIRQ); - local_irq_enable(); -+ preempt_check_resched_rt(); - - return 0; - } -diff --git a/net/core/dev.c b/net/core/dev.c -index 6c5967e80132..86a599a41062 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -3060,6 +3060,7 @@ static void __netif_reschedule(struct Qdisc *q) - sd->output_queue_tailp = &q->next_sched; - raise_softirq_irqoff(NET_TX_SOFTIRQ); - local_irq_restore(flags); -+ preempt_check_resched_rt(); - } - - void __netif_schedule(struct Qdisc *q) -@@ -3122,6 +3123,7 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason) - __this_cpu_write(softnet_data.completion_queue, skb); - raise_softirq_irqoff(NET_TX_SOFTIRQ); - local_irq_restore(flags); -+ preempt_check_resched_rt(); - } - EXPORT_SYMBOL(__dev_kfree_skb_irq); - -@@ -4617,6 +4619,7 @@ static int enqueue_to_backlog(struct sk_buff *skb, int cpu, - rps_unlock(sd); - - local_irq_restore(flags); -+ preempt_check_resched_rt(); - - atomic_long_inc(&skb->dev->rx_dropped); - kfree_skb(skb); -@@ -6306,12 +6309,14 @@ static void net_rps_action_and_irq_enable(struct softnet_data *sd) - sd->rps_ipi_list = NULL; - - local_irq_enable(); -+ preempt_check_resched_rt(); - - /* Send pending IPI's to kick RPS processing on remote cpus. */ - net_rps_send_ipi(remsd); - } else - #endif - local_irq_enable(); -+ preempt_check_resched_rt(); - } - - static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) -@@ -6389,6 +6394,7 @@ void __napi_schedule(struct napi_struct *n) - local_irq_save(flags); - ____napi_schedule(this_cpu_ptr(&softnet_data), n); - local_irq_restore(flags); -+ preempt_check_resched_rt(); - } - EXPORT_SYMBOL(__napi_schedule); - -@@ -11144,6 +11150,7 @@ static int dev_cpu_dead(unsigned int oldcpu) - - raise_softirq_irqoff(NET_TX_SOFTIRQ); - local_irq_enable(); -+ preempt_check_resched_rt(); - - #ifdef CONFIG_RPS - remsd = oldsd->rps_ipi_list; --- -2.19.1 - diff --git a/features/rt/softirq-Disable-softirq-stacks-for-RT.patch b/features/rt/softirq-Disable-softirq-stacks-for-RT.patch deleted file mode 100644 index 17d140e9..00000000 --- a/features/rt/softirq-Disable-softirq-stacks-for-RT.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 9b48938bb80459112366ce3bd8d17212644d58bc Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Mon, 18 Jul 2011 13:59:17 +0200 -Subject: [PATCH 125/191] softirq: Disable softirq stacks for RT - -Disable extra stacks for softirqs. We want to preempt softirqs and -having them on special IRQ-stack does not make this easier. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/powerpc/kernel/irq.c | 2 ++ - arch/powerpc/kernel/misc_32.S | 2 ++ - arch/powerpc/kernel/misc_64.S | 2 ++ - arch/sh/kernel/irq.c | 2 ++ - arch/sparc/kernel/irq_64.c | 2 ++ - arch/x86/include/asm/irq_stack.h | 3 +++ - arch/x86/kernel/irq_32.c | 2 ++ - include/asm-generic/softirq_stack.h | 2 +- - 8 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c -index d71fd10a1dd4..4135f7c44dec 100644 ---- a/arch/powerpc/kernel/irq.c -+++ b/arch/powerpc/kernel/irq.c -@@ -751,10 +751,12 @@ void *mcheckirq_ctx[NR_CPUS] __read_mostly; - void *softirq_ctx[NR_CPUS] __read_mostly; - void *hardirq_ctx[NR_CPUS] __read_mostly; - -+#ifndef CONFIG_PREEMPT_RT - void do_softirq_own_stack(void) - { - call_do_softirq(softirq_ctx[smp_processor_id()]); - } -+#endif - - irq_hw_number_t virq_to_hw(unsigned int virq) - { -diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S -index 717e658b90fd..08ee95ad6593 100644 ---- a/arch/powerpc/kernel/misc_32.S -+++ b/arch/powerpc/kernel/misc_32.S -@@ -31,6 +31,7 @@ - * We store the saved ksp_limit in the unused part - * of the STACK_FRAME_OVERHEAD - */ -+#ifndef CONFIG_PREEMPT_RT - _GLOBAL(call_do_softirq) - mflr r0 - stw r0,4(r1) -@@ -46,6 +47,7 @@ _GLOBAL(call_do_softirq) - stw r10,THREAD+KSP_LIMIT(r2) - mtlr r0 - blr -+#endif - - /* - * void call_do_irq(struct pt_regs *regs, void *sp); -diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S -index 070465825c21..a6b33f7b3264 100644 ---- a/arch/powerpc/kernel/misc_64.S -+++ b/arch/powerpc/kernel/misc_64.S -@@ -27,6 +27,7 @@ - - .text - -+#ifndef CONFIG_PREEMPT_RT - _GLOBAL(call_do_softirq) - mflr r0 - std r0,16(r1) -@@ -37,6 +38,7 @@ _GLOBAL(call_do_softirq) - ld r0,16(r1) - mtlr r0 - blr -+#endif - - _GLOBAL(call_do_irq) - mflr r0 -diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c -index ef0f0827cf57..2d3eca8fee01 100644 ---- a/arch/sh/kernel/irq.c -+++ b/arch/sh/kernel/irq.c -@@ -149,6 +149,7 @@ void irq_ctx_exit(int cpu) - hardirq_ctx[cpu] = NULL; - } - -+#ifndef CONFIG_PREEMPT_RT - void do_softirq_own_stack(void) - { - struct thread_info *curctx; -@@ -176,6 +177,7 @@ void do_softirq_own_stack(void) - "r5", "r6", "r7", "r8", "r9", "r15", "t", "pr" - ); - } -+#endif - #else - static inline void handle_one_irq(unsigned int irq) - { -diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c -index c8848bb681a1..41fa1be980a3 100644 ---- a/arch/sparc/kernel/irq_64.c -+++ b/arch/sparc/kernel/irq_64.c -@@ -855,6 +855,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs) - set_irq_regs(old_regs); - } - -+#ifndef CONFIG_PREEMPT_RT - void do_softirq_own_stack(void) - { - void *orig_sp, *sp = softirq_stack[smp_processor_id()]; -@@ -869,6 +870,7 @@ void do_softirq_own_stack(void) - __asm__ __volatile__("mov %0, %%sp" - : : "r" (orig_sp)); - } -+#endif - - #ifdef CONFIG_HOTPLUG_CPU - void fixup_irqs(void) -diff --git a/arch/x86/include/asm/irq_stack.h b/arch/x86/include/asm/irq_stack.h -index 9b2a0ff76c73..fe12ba2a5c65 100644 ---- a/arch/x86/include/asm/irq_stack.h -+++ b/arch/x86/include/asm/irq_stack.h -@@ -188,6 +188,7 @@ - #define ASM_CALL_SOFTIRQ \ - "call %P[__func] \n" - -+#ifndef CONFIG_PREEMPT_RT - /* - * Macro to invoke __do_softirq on the irq stack. This is only called from - * task context when bottom halfs are about to be reenabled and soft -@@ -201,6 +202,8 @@ - __this_cpu_write(hardirq_stack_inuse, false); \ - } - -+#endif -+ - #else /* CONFIG_X86_64 */ - /* System vector handlers always run on the stack they interrupted. */ - #define run_sysvec_on_irqstack_cond(func, regs) \ -diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c -index 044902d5a3c4..e5dd6da78713 100644 ---- a/arch/x86/kernel/irq_32.c -+++ b/arch/x86/kernel/irq_32.c -@@ -132,6 +132,7 @@ int irq_init_percpu_irqstack(unsigned int cpu) - return 0; - } - -+#ifndef CONFIG_PREEMPT_RT - void do_softirq_own_stack(void) - { - struct irq_stack *irqstk; -@@ -148,6 +149,7 @@ void do_softirq_own_stack(void) - - call_on_stack(__do_softirq, isp); - } -+#endif - - void __handle_irq(struct irq_desc *desc, struct pt_regs *regs) - { -diff --git a/include/asm-generic/softirq_stack.h b/include/asm-generic/softirq_stack.h -index eceeecf6a5bd..d3e2d81656e0 100644 ---- a/include/asm-generic/softirq_stack.h -+++ b/include/asm-generic/softirq_stack.h -@@ -2,7 +2,7 @@ - #ifndef __ASM_GENERIC_SOFTIRQ_STACK_H - #define __ASM_GENERIC_SOFTIRQ_STACK_H - --#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK -+#if defined(CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK) && !defined(CONFIG_PREEMPT_RT) - void do_softirq_own_stack(void); - #else - static inline void do_softirq_own_stack(void) --- -2.19.1 - diff --git a/features/rt/softirq-Make-softirq-control-and-processing-RT-aware.patch b/features/rt/softirq-Make-softirq-control-and-processing-RT-aware.patch deleted file mode 100644 index d5463dab..00000000 --- a/features/rt/softirq-Make-softirq-control-and-processing-RT-aware.patch +++ /dev/null @@ -1,266 +0,0 @@ -From 02c3efe5d766cd7ed6f81c784981b76c91238a21 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:56 +0100 -Subject: [PATCH 058/191] softirq: Make softirq control and processing RT aware - -Provide a local lock based serialization for soft interrupts on RT which -allows the local_bh_disabled() sections and servicing soft interrupts to be -preemptible. - -Provide the necessary inline helpers which allow to reuse the bulk of the -softirq processing code. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Frederic Weisbecker <frederic@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/bottom_half.h | 2 +- - kernel/softirq.c | 188 ++++++++++++++++++++++++++++++++++-- - 2 files changed, 182 insertions(+), 8 deletions(-) - -diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h -index a19519f4241d..e4dd613a070e 100644 ---- a/include/linux/bottom_half.h -+++ b/include/linux/bottom_half.h -@@ -4,7 +4,7 @@ - - #include <linux/preempt.h> - --#ifdef CONFIG_TRACE_IRQFLAGS -+#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS) - extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); - #else - static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 373c6bb84f39..54fd7cc97a4a 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -13,6 +13,7 @@ - #include <linux/kernel_stat.h> - #include <linux/interrupt.h> - #include <linux/init.h> -+#include <linux/local_lock.h> - #include <linux/mm.h> - #include <linux/notifier.h> - #include <linux/percpu.h> -@@ -103,20 +104,189 @@ EXPORT_PER_CPU_SYMBOL_GPL(hardirq_context); - #endif - - /* -- * preempt_count and SOFTIRQ_OFFSET usage: -- * - preempt_count is changed by SOFTIRQ_OFFSET on entering or leaving -- * softirq processing. -- * - preempt_count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET) -+ * SOFTIRQ_OFFSET usage: -+ * -+ * On !RT kernels 'count' is the preempt counter, on RT kernels this applies -+ * to a per CPU counter and to task::softirqs_disabled_cnt. -+ * -+ * - count is changed by SOFTIRQ_OFFSET on entering or leaving softirq -+ * processing. -+ * -+ * - count is changed by SOFTIRQ_DISABLE_OFFSET (= 2 * SOFTIRQ_OFFSET) - * on local_bh_disable or local_bh_enable. -+ * - * This lets us distinguish between whether we are currently processing - * softirq and whether we just have bh disabled. - */ -+#ifdef CONFIG_PREEMPT_RT - --#ifdef CONFIG_TRACE_IRQFLAGS - /* -- * This is for softirq.c-internal use, where hardirqs are disabled -+ * RT accounts for BH disabled sections in task::softirqs_disabled_cnt and -+ * also in per CPU softirq_ctrl::cnt. This is necessary to allow tasks in a -+ * softirq disabled section to be preempted. -+ * -+ * The per task counter is used for softirq_count(), in_softirq() and -+ * in_serving_softirqs() because these counts are only valid when the task -+ * holding softirq_ctrl::lock is running. -+ * -+ * The per CPU counter prevents pointless wakeups of ksoftirqd in case that -+ * the task which is in a softirq disabled section is preempted or blocks. -+ */ -+struct softirq_ctrl { -+ local_lock_t lock; -+ int cnt; -+}; -+ -+static DEFINE_PER_CPU(struct softirq_ctrl, softirq_ctrl) = { -+ .lock = INIT_LOCAL_LOCK(softirq_ctrl.lock), -+}; -+ -+void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) -+{ -+ unsigned long flags; -+ int newcnt; -+ -+ WARN_ON_ONCE(in_hardirq()); -+ -+ /* First entry of a task into a BH disabled section? */ -+ if (!current->softirq_disable_cnt) { -+ if (preemptible()) { -+ local_lock(&softirq_ctrl.lock); -+ /* Required to meet the RCU bottomhalf requirements. */ -+ rcu_read_lock(); -+ } else { -+ DEBUG_LOCKS_WARN_ON(this_cpu_read(softirq_ctrl.cnt)); -+ } -+ } -+ -+ /* -+ * Track the per CPU softirq disabled state. On RT this is per CPU -+ * state to allow preemption of bottom half disabled sections. -+ */ -+ newcnt = __this_cpu_add_return(softirq_ctrl.cnt, cnt); -+ /* -+ * Reflect the result in the task state to prevent recursion on the -+ * local lock and to make softirq_count() & al work. -+ */ -+ current->softirq_disable_cnt = newcnt; -+ -+ if (IS_ENABLED(CONFIG_TRACE_IRQFLAGS) && newcnt == cnt) { -+ raw_local_irq_save(flags); -+ lockdep_softirqs_off(ip); -+ raw_local_irq_restore(flags); -+ } -+} -+EXPORT_SYMBOL(__local_bh_disable_ip); -+ -+static void __local_bh_enable(unsigned int cnt, bool unlock) -+{ -+ unsigned long flags; -+ int newcnt; -+ -+ DEBUG_LOCKS_WARN_ON(current->softirq_disable_cnt != -+ this_cpu_read(softirq_ctrl.cnt)); -+ -+ if (IS_ENABLED(CONFIG_TRACE_IRQFLAGS) && softirq_count() == cnt) { -+ raw_local_irq_save(flags); -+ lockdep_softirqs_on(_RET_IP_); -+ raw_local_irq_restore(flags); -+ } -+ -+ newcnt = __this_cpu_sub_return(softirq_ctrl.cnt, cnt); -+ current->softirq_disable_cnt = newcnt; -+ -+ if (!newcnt && unlock) { -+ rcu_read_unlock(); -+ local_unlock(&softirq_ctrl.lock); -+ } -+} -+ -+void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) -+{ -+ bool preempt_on = preemptible(); -+ unsigned long flags; -+ u32 pending; -+ int curcnt; -+ -+ WARN_ON_ONCE(in_irq()); -+ lockdep_assert_irqs_enabled(); -+ -+ local_irq_save(flags); -+ curcnt = __this_cpu_read(softirq_ctrl.cnt); -+ -+ /* -+ * If this is not reenabling soft interrupts, no point in trying to -+ * run pending ones. -+ */ -+ if (curcnt != cnt) -+ goto out; -+ -+ pending = local_softirq_pending(); -+ if (!pending || ksoftirqd_running(pending)) -+ goto out; -+ -+ /* -+ * If this was called from non preemptible context, wake up the -+ * softirq daemon. -+ */ -+ if (!preempt_on) { -+ wakeup_softirqd(); -+ goto out; -+ } -+ -+ /* -+ * Adjust softirq count to SOFTIRQ_OFFSET which makes -+ * in_serving_softirq() become true. -+ */ -+ cnt = SOFTIRQ_OFFSET; -+ __local_bh_enable(cnt, false); -+ __do_softirq(); -+ -+out: -+ __local_bh_enable(cnt, preempt_on); -+ local_irq_restore(flags); -+} -+EXPORT_SYMBOL(__local_bh_enable_ip); -+ -+/* -+ * Invoked from ksoftirqd_run() outside of the interrupt disabled section -+ * to acquire the per CPU local lock for reentrancy protection. -+ */ -+static inline void ksoftirqd_run_begin(void) -+{ -+ __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); -+ local_irq_disable(); -+} -+ -+/* Counterpart to ksoftirqd_run_begin() */ -+static inline void ksoftirqd_run_end(void) -+{ -+ __local_bh_enable(SOFTIRQ_OFFSET, true); -+ WARN_ON_ONCE(in_interrupt()); -+ local_irq_enable(); -+} -+ -+static inline void softirq_handle_begin(void) { } -+static inline void softirq_handle_end(void) { } -+ -+static inline bool should_wake_ksoftirqd(void) -+{ -+ return !this_cpu_read(softirq_ctrl.cnt); -+} -+ -+static inline void invoke_softirq(void) -+{ -+ if (should_wake_ksoftirqd()) -+ wakeup_softirqd(); -+} -+ -+#else /* CONFIG_PREEMPT_RT */ -+ -+/* -+ * This one is for softirq.c-internal use, where hardirqs are disabled - * legitimately: - */ -+#ifdef CONFIG_TRACE_IRQFLAGS - void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) - { - unsigned long flags; -@@ -277,6 +447,8 @@ asmlinkage __visible void do_softirq(void) - local_irq_restore(flags); - } - -+#endif /* !CONFIG_PREEMPT_RT */ -+ - /* - * We restart softirq processing for at most MAX_SOFTIRQ_RESTART times, - * but break the loop if need_resched() is set or after 2 ms. -@@ -381,8 +553,10 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) - pending >>= softirq_bit; - } - -- if (__this_cpu_read(ksoftirqd) == current) -+ if (!IS_ENABLED(CONFIG_PREEMPT_RT) && -+ __this_cpu_read(ksoftirqd) == current) - rcu_softirq_qs(); -+ - local_irq_disable(); - - pending = local_softirq_pending(); --- -2.19.1 - diff --git a/features/rt/softirq-Move-various-protections-into-inline-helpers.patch b/features/rt/softirq-Move-various-protections-into-inline-helpers.patch deleted file mode 100644 index d8ee863b..00000000 --- a/features/rt/softirq-Move-various-protections-into-inline-helpers.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 8ed4f8ea1246e9edcf2daad3538292712a22620d Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:55 +0100 -Subject: [PATCH 057/191] softirq: Move various protections into inline helpers - -To allow reuse of the bulk of softirq processing code for RT and to avoid -#ifdeffery all over the place, split protections for various code sections -out into inline helpers so the RT variant can just replace them in one go. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Frederic Weisbecker <frederic@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/softirq.c | 39 ++++++++++++++++++++++++++++++++------- - 1 file changed, 32 insertions(+), 7 deletions(-) - -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 47321dde8f32..373c6bb84f39 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -207,6 +207,32 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) - } - EXPORT_SYMBOL(__local_bh_enable_ip); - -+static inline void softirq_handle_begin(void) -+{ -+ __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); -+} -+ -+static inline void softirq_handle_end(void) -+{ -+ __local_bh_enable(SOFTIRQ_OFFSET); -+ WARN_ON_ONCE(in_interrupt()); -+} -+ -+static inline void ksoftirqd_run_begin(void) -+{ -+ local_irq_disable(); -+} -+ -+static inline void ksoftirqd_run_end(void) -+{ -+ local_irq_enable(); -+} -+ -+static inline bool should_wake_ksoftirqd(void) -+{ -+ return true; -+} -+ - static inline void invoke_softirq(void) - { - if (ksoftirqd_running(local_softirq_pending())) -@@ -319,7 +345,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) - - pending = local_softirq_pending(); - -- __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); -+ softirq_handle_begin(); - in_hardirq = lockdep_softirq_start(); - account_softirq_enter(current); - -@@ -370,8 +396,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void) - - account_softirq_exit(current); - lockdep_softirq_end(in_hardirq); -- __local_bh_enable(SOFTIRQ_OFFSET); -- WARN_ON_ONCE(in_interrupt()); -+ softirq_handle_end(); - current_restore_flags(old_flags, PF_MEMALLOC); - } - -@@ -466,7 +491,7 @@ inline void raise_softirq_irqoff(unsigned int nr) - * Otherwise we wake up ksoftirqd to make sure we - * schedule the softirq soon. - */ -- if (!in_interrupt()) -+ if (!in_interrupt() && should_wake_ksoftirqd()) - wakeup_softirqd(); - } - -@@ -694,18 +719,18 @@ static int ksoftirqd_should_run(unsigned int cpu) - - static void run_ksoftirqd(unsigned int cpu) - { -- local_irq_disable(); -+ ksoftirqd_run_begin(); - if (local_softirq_pending()) { - /* - * We can safely run softirq on inline stack, as we are not deep - * in the task stack here. - */ - __do_softirq(); -- local_irq_enable(); -+ ksoftirqd_run_end(); - cond_resched(); - return; - } -- local_irq_enable(); -+ ksoftirqd_run_end(); - } - - #ifdef CONFIG_HOTPLUG_CPU --- -2.19.1 - diff --git a/features/rt/sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch b/features/rt/sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch deleted file mode 100644 index bb5be4d0..00000000 --- a/features/rt/sunrpc-Make-svc_xprt_do_enqueue-use-get_cpu_light.patch +++ /dev/null @@ -1,59 +0,0 @@ -From bea756647716135bea94d786e25a517fd9bb1331 Mon Sep 17 00:00:00 2001 -From: Mike Galbraith <umgwanakikbuti@gmail.com> -Date: Wed, 18 Feb 2015 16:05:28 +0100 -Subject: [PATCH 137/191] sunrpc: Make svc_xprt_do_enqueue() use - get_cpu_light() - -|BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:915 -|in_atomic(): 1, irqs_disabled(): 0, pid: 3194, name: rpc.nfsd -|Preemption disabled at:[<ffffffffa06bf0bb>] svc_xprt_received+0x4b/0xc0 [sunrpc] -|CPU: 6 PID: 3194 Comm: rpc.nfsd Not tainted 3.18.7-rt1 #9 -|Hardware name: MEDION MS-7848/MS-7848, BIOS M7848W08.404 11/06/2014 -| ffff880409630000 ffff8800d9a33c78 ffffffff815bdeb5 0000000000000002 -| 0000000000000000 ffff8800d9a33c98 ffffffff81073c86 ffff880408dd6008 -| ffff880408dd6000 ffff8800d9a33cb8 ffffffff815c3d84 ffff88040b3ac000 -|Call Trace: -| [<ffffffff815bdeb5>] dump_stack+0x4f/0x9e -| [<ffffffff81073c86>] __might_sleep+0xe6/0x150 -| [<ffffffff815c3d84>] rt_spin_lock+0x24/0x50 -| [<ffffffffa06beec0>] svc_xprt_do_enqueue+0x80/0x230 [sunrpc] -| [<ffffffffa06bf0bb>] svc_xprt_received+0x4b/0xc0 [sunrpc] -| [<ffffffffa06c03ed>] svc_add_new_perm_xprt+0x6d/0x80 [sunrpc] -| [<ffffffffa06b2693>] svc_addsock+0x143/0x200 [sunrpc] -| [<ffffffffa072e69c>] write_ports+0x28c/0x340 [nfsd] -| [<ffffffffa072d2ac>] nfsctl_transaction_write+0x4c/0x80 [nfsd] -| [<ffffffff8117ee83>] vfs_write+0xb3/0x1d0 -| [<ffffffff8117f889>] SyS_write+0x49/0xb0 -| [<ffffffff815c4556>] system_call_fastpath+0x16/0x1b - -Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/sunrpc/svc_xprt.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c -index dcc50ae54550..e4a0dc8f8e40 100644 ---- a/net/sunrpc/svc_xprt.c -+++ b/net/sunrpc/svc_xprt.c -@@ -422,7 +422,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) - if (test_and_set_bit(XPT_BUSY, &xprt->xpt_flags)) - return; - -- cpu = get_cpu(); -+ cpu = get_cpu_light(); - pool = svc_pool_for_cpu(xprt->xpt_server, cpu); - - atomic_long_inc(&pool->sp_stats.packets); -@@ -446,7 +446,7 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt) - rqstp = NULL; - out_unlock: - rcu_read_unlock(); -- put_cpu(); -+ put_cpu_light(); - trace_svc_xprt_do_enqueue(xprt, rqstp); - } - EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue); --- -2.19.1 - diff --git a/features/rt/sysfs-Add-sys-kernel-realtime-entry.patch b/features/rt/sysfs-Add-sys-kernel-realtime-entry.patch deleted file mode 100644 index a70552cd..00000000 --- a/features/rt/sysfs-Add-sys-kernel-realtime-entry.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0467137e4e4d875cc0711eaefbd0da8800274d86 Mon Sep 17 00:00:00 2001 -From: Clark Williams <williams@redhat.com> -Date: Sat, 30 Jul 2011 21:55:53 -0500 -Subject: [PATCH 190/191] sysfs: Add /sys/kernel/realtime entry - -Add a /sys/kernel entry to indicate that the kernel is a -realtime kernel. - -Clark says that he needs this for udev rules, udev needs to evaluate -if its a PREEMPT_RT kernel a few thousand times and parsing uname -output is too slow or so. - -Are there better solutions? Should it exist and return 0 on !-rt? - -Signed-off-by: Clark Williams <williams@redhat.com> -Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> ---- - kernel/ksysfs.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c -index 35859da8bd4f..dfff31ed644a 100644 ---- a/kernel/ksysfs.c -+++ b/kernel/ksysfs.c -@@ -138,6 +138,15 @@ KERNEL_ATTR_RO(vmcoreinfo); - - #endif /* CONFIG_CRASH_CORE */ - -+#if defined(CONFIG_PREEMPT_RT) -+static ssize_t realtime_show(struct kobject *kobj, -+ struct kobj_attribute *attr, char *buf) -+{ -+ return sprintf(buf, "%d\n", 1); -+} -+KERNEL_ATTR_RO(realtime); -+#endif -+ - /* whether file capabilities are enabled */ - static ssize_t fscaps_show(struct kobject *kobj, - struct kobj_attribute *attr, char *buf) -@@ -228,6 +237,9 @@ static struct attribute * kernel_attrs[] = { - #ifndef CONFIG_TINY_RCU - &rcu_expedited_attr.attr, - &rcu_normal_attr.attr, -+#endif -+#ifdef CONFIG_PREEMPT_RT -+ &realtime_attr.attr, - #endif - NULL - }; --- -2.19.1 - diff --git a/features/rt/tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch b/features/rt/tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch deleted file mode 100644 index 7f085a8d..00000000 --- a/features/rt/tasklets-Prevent-tasklet_unlock_spin_wait-deadlock-o.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 733206b1d60fe02ac81756b268804c19445362d2 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:10 +0100 -Subject: [PATCH 047/191] tasklets: Prevent tasklet_unlock_spin_wait() deadlock - on RT - -tasklet_unlock_spin_wait() spin waits for the TASKLET_STATE_SCHED bit in -the tasklet state to be cleared. This works on !RT nicely because the -corresponding execution can only happen on a different CPU. - -On RT softirq processing is preemptible, therefore a task preempting the -softirq processing thread can spin forever. - -Prevent this by invoking local_bh_disable()/enable() inside the loop. In -case that the softirq processing thread was preempted by the current task, -current will block on the local lock which yields the CPU to the preempted -softirq processing thread. If the tasklet is processed on a different CPU -then the local_bh_disable()/enable() pair is just a waste of processor -cycles. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 12 ++---------- - kernel/softirq.c | 28 +++++++++++++++++++++++++++- - 2 files changed, 29 insertions(+), 11 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index ee3ce4f852b7..d6876e1aa6c1 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -654,7 +654,7 @@ enum - TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ - }; - --#ifdef CONFIG_SMP -+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) - static inline int tasklet_trylock(struct tasklet_struct *t) - { - return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); -@@ -662,16 +662,8 @@ static inline int tasklet_trylock(struct tasklet_struct *t) - - void tasklet_unlock(struct tasklet_struct *t); - void tasklet_unlock_wait(struct tasklet_struct *t); -+void tasklet_unlock_spin_wait(struct tasklet_struct *t); - --/* -- * Do not use in new code. Waiting for tasklets from atomic contexts is -- * error prone and should be avoided. -- */ --static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) --{ -- while (test_bit(TASKLET_STATE_RUN, &t->state)) -- cpu_relax(); --} - #else - static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } - static inline void tasklet_unlock(struct tasklet_struct *t) { } -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 1d910294faf7..47321dde8f32 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -616,6 +616,32 @@ void tasklet_init(struct tasklet_struct *t, - } - EXPORT_SYMBOL(tasklet_init); - -+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) -+/* -+ * Do not use in new code. Waiting for tasklets from atomic contexts is -+ * error prone and should be avoided. -+ */ -+void tasklet_unlock_spin_wait(struct tasklet_struct *t) -+{ -+ while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { -+ /* -+ * Prevent a live lock when current preempted soft -+ * interrupt processing or prevents ksoftirqd from -+ * running. If the tasklet runs on a different CPU -+ * then this has no effect other than doing the BH -+ * disable/enable dance for nothing. -+ */ -+ local_bh_disable(); -+ local_bh_enable(); -+ } else { -+ cpu_relax(); -+ } -+ } -+} -+EXPORT_SYMBOL(tasklet_unlock_spin_wait); -+#endif -+ - void tasklet_kill(struct tasklet_struct *t) - { - if (in_interrupt()) -@@ -629,7 +655,7 @@ void tasklet_kill(struct tasklet_struct *t) - } - EXPORT_SYMBOL(tasklet_kill); - --#ifdef CONFIG_SMP -+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) - void tasklet_unlock(struct tasklet_struct *t) - { - smp_mb__before_atomic(); --- -2.19.1 - diff --git a/features/rt/tasklets-Provide-tasklet_disable_in_atomic.patch b/features/rt/tasklets-Provide-tasklet_disable_in_atomic.patch deleted file mode 100644 index 89d0730f..00000000 --- a/features/rt/tasklets-Provide-tasklet_disable_in_atomic.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 21b5c4734bb2b5f6e37dad86b2857ac1b2ae1a16 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:06 +0100 -Subject: [PATCH 043/191] tasklets: Provide tasklet_disable_in_atomic() - -Replacing the spin wait loops in tasklet_unlock_wait() with -wait_var_event() is not possible as a handful of tasklet_disable() -invocations are happening in atomic context. All other invocations are in -teardown paths which can sleep. - -Provide tasklet_disable_in_atomic() and tasklet_unlock_spin_wait() to -convert the few atomic use cases over, which allows to change -tasklet_disable() and tasklet_unlock_wait() in a later step. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index b49ac2639b3e..9d9475f7b89f 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -671,10 +671,21 @@ static inline void tasklet_unlock_wait(struct tasklet_struct *t) - while (test_bit(TASKLET_STATE_RUN, &t->state)) - cpu_relax(); - } -+ -+/* -+ * Do not use in new code. Waiting for tasklets from atomic contexts is -+ * error prone and should be avoided. -+ */ -+static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) -+{ -+ while (test_bit(TASKLET_STATE_RUN, &t->state)) -+ cpu_relax(); -+} - #else - static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } - static inline void tasklet_unlock(struct tasklet_struct *t) { } - static inline void tasklet_unlock_wait(struct tasklet_struct *t) { } -+static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) { } - #endif - - extern void __tasklet_schedule(struct tasklet_struct *t); -@@ -699,6 +710,17 @@ static inline void tasklet_disable_nosync(struct tasklet_struct *t) - smp_mb__after_atomic(); - } - -+/* -+ * Do not use in new code. Disabling tasklets from atomic contexts is -+ * error prone and should be avoided. -+ */ -+static inline void tasklet_disable_in_atomic(struct tasklet_struct *t) -+{ -+ tasklet_disable_nosync(t); -+ tasklet_unlock_spin_wait(t); -+ smp_mb(); -+} -+ - static inline void tasklet_disable(struct tasklet_struct *t) - { - tasklet_disable_nosync(t); --- -2.19.1 - diff --git a/features/rt/tasklets-Replace-barrier-with-cpu_relax-in-tasklet_u.patch b/features/rt/tasklets-Replace-barrier-with-cpu_relax-in-tasklet_u.patch deleted file mode 100644 index 1a86c472..00000000 --- a/features/rt/tasklets-Replace-barrier-with-cpu_relax-in-tasklet_u.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5c591a9398a637929ea3593614fadff800e6009f Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:04 +0100 -Subject: [PATCH 041/191] tasklets: Replace barrier() with cpu_relax() in - tasklet_unlock_wait() - -A barrier() in a tight loop which waits for something to happen on a remote -CPU is a pointless exercise. Replace it with cpu_relax() which allows HT -siblings to make progress. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 967e25767153..b4cf773638dc 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -668,7 +668,8 @@ static inline void tasklet_unlock(struct tasklet_struct *t) - - static inline void tasklet_unlock_wait(struct tasklet_struct *t) - { -- while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } -+ while (test_bit(TASKLET_STATE_RUN, &t->state)) -+ cpu_relax(); - } - #else - #define tasklet_trylock(t) 1 --- -2.19.1 - diff --git a/features/rt/tasklets-Replace-spin-wait-in-tasklet_kill.patch b/features/rt/tasklets-Replace-spin-wait-in-tasklet_kill.patch deleted file mode 100644 index 1beafa8d..00000000 --- a/features/rt/tasklets-Replace-spin-wait-in-tasklet_kill.patch +++ /dev/null @@ -1,73 +0,0 @@ -From e7314e8cbafc258fde5e864eafd6661a847790ec Mon Sep 17 00:00:00 2001 -From: Peter Zijlstra <peterz@infradead.org> -Date: Tue, 9 Mar 2021 09:42:09 +0100 -Subject: [PATCH 046/191] tasklets: Replace spin wait in tasklet_kill() - -tasklet_kill() spin waits for TASKLET_STATE_SCHED to be cleared invoking -yield() from inside the loop. yield() is an ill defined mechanism and the -result might still be wasting CPU cycles in a tight loop which is -especially painful in a guest when the CPU running the tasklet is scheduled -out. - -tasklet_kill() is used in teardown paths and not performance critical at -all. Replace the spin wait with wait_var_event(). - -Signed-off-by: Peter Zijlstra <peterz@infradead.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/softirq.c | 23 +++++++++++++++-------- - 1 file changed, 15 insertions(+), 8 deletions(-) - -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 7cd63df59e1c..1d910294faf7 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -532,6 +532,16 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) - } - EXPORT_SYMBOL(__tasklet_hi_schedule); - -+static inline bool tasklet_clear_sched(struct tasklet_struct *t) -+{ -+ if (test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) { -+ wake_up_var(&t->state); -+ return true; -+ } -+ -+ return false; -+} -+ - static void tasklet_action_common(struct softirq_action *a, - struct tasklet_head *tl_head, - unsigned int softirq_nr) -@@ -551,8 +561,7 @@ static void tasklet_action_common(struct softirq_action *a, - - if (tasklet_trylock(t)) { - if (!atomic_read(&t->count)) { -- if (!test_and_clear_bit(TASKLET_STATE_SCHED, -- &t->state)) -+ if (!tasklet_clear_sched(t)) - BUG(); - if (t->use_callback) - t->callback(t); -@@ -612,13 +621,11 @@ void tasklet_kill(struct tasklet_struct *t) - if (in_interrupt()) - pr_notice("Attempt to kill tasklet from interrupt\n"); - -- while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { -- do { -- yield(); -- } while (test_bit(TASKLET_STATE_SCHED, &t->state)); -- } -+ while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) -+ wait_var_event(&t->state, !test_bit(TASKLET_STATE_SCHED, &t->state)); -+ - tasklet_unlock_wait(t); -- clear_bit(TASKLET_STATE_SCHED, &t->state); -+ tasklet_clear_sched(t); - } - EXPORT_SYMBOL(tasklet_kill); - --- -2.19.1 - diff --git a/features/rt/tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch b/features/rt/tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch deleted file mode 100644 index edca165f..00000000 --- a/features/rt/tasklets-Replace-spin-wait-in-tasklet_unlock_wait.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 9c90471b76134571fa2dfddb7423d48c521146ab Mon Sep 17 00:00:00 2001 -From: Peter Zijlstra <peterz@infradead.org> -Date: Tue, 9 Mar 2021 09:42:08 +0100 -Subject: [PATCH 045/191] tasklets: Replace spin wait in tasklet_unlock_wait() - -tasklet_unlock_wait() spin waits for TASKLET_STATE_RUN to be cleared. This -is wasting CPU cycles in a tight loop which is especially painful in a -guest when the CPU running the tasklet is scheduled out. - -tasklet_unlock_wait() is invoked from tasklet_kill() which is used in -teardown paths and not performance critical at all. Replace the spin wait -with wait_var_event(). - -There are no users of tasklet_unlock_wait() which are invoked from atomic -contexts. The usage in tasklet_disable() has been replaced temporarily with -the spin waiting variant until the atomic users are fixed up and will be -converted to the sleep wait variant later. - -Signed-off-by: Peter Zijlstra <peterz@infradead.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 13 ++----------- - kernel/softirq.c | 18 ++++++++++++++++++ - 2 files changed, 20 insertions(+), 11 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index f0b82429950c..ee3ce4f852b7 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -660,17 +660,8 @@ static inline int tasklet_trylock(struct tasklet_struct *t) - return !test_and_set_bit(TASKLET_STATE_RUN, &(t)->state); - } - --static inline void tasklet_unlock(struct tasklet_struct *t) --{ -- smp_mb__before_atomic(); -- clear_bit(TASKLET_STATE_RUN, &(t)->state); --} -- --static inline void tasklet_unlock_wait(struct tasklet_struct *t) --{ -- while (test_bit(TASKLET_STATE_RUN, &t->state)) -- cpu_relax(); --} -+void tasklet_unlock(struct tasklet_struct *t); -+void tasklet_unlock_wait(struct tasklet_struct *t); - - /* - * Do not use in new code. Waiting for tasklets from atomic contexts is -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 9908ec4a9bfe..7cd63df59e1c 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -25,6 +25,7 @@ - #include <linux/smpboot.h> - #include <linux/tick.h> - #include <linux/irq.h> -+#include <linux/wait_bit.h> - - #include <asm/softirq_stack.h> - -@@ -621,6 +622,23 @@ void tasklet_kill(struct tasklet_struct *t) - } - EXPORT_SYMBOL(tasklet_kill); - -+#ifdef CONFIG_SMP -+void tasklet_unlock(struct tasklet_struct *t) -+{ -+ smp_mb__before_atomic(); -+ clear_bit(TASKLET_STATE_RUN, &t->state); -+ smp_mb__after_atomic(); -+ wake_up_var(&t->state); -+} -+EXPORT_SYMBOL_GPL(tasklet_unlock); -+ -+void tasklet_unlock_wait(struct tasklet_struct *t) -+{ -+ wait_var_event(&t->state, !test_bit(TASKLET_STATE_RUN, &t->state)); -+} -+EXPORT_SYMBOL_GPL(tasklet_unlock_wait); -+#endif -+ - void __init softirq_init(void) - { - int cpu; --- -2.19.1 - diff --git a/features/rt/tasklets-Switch-tasklet_disable-to-the-sleep-wait-va.patch b/features/rt/tasklets-Switch-tasklet_disable-to-the-sleep-wait-va.patch deleted file mode 100644 index 22004d44..00000000 --- a/features/rt/tasklets-Switch-tasklet_disable-to-the-sleep-wait-va.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 608657964209120854b4be1d11f6d052f34465a9 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:17 +0100 -Subject: [PATCH 054/191] tasklets: Switch tasklet_disable() to the sleep wait - variant - - -- NOT FOR IMMEDIATE MERGING -- - -Now that all users of tasklet_disable() are invoked from sleepable context, -convert it to use tasklet_unlock_wait() which might sleep. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index d6876e1aa6c1..3b56b73deca2 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -707,8 +707,7 @@ static inline void tasklet_disable_in_atomic(struct tasklet_struct *t) - static inline void tasklet_disable(struct tasklet_struct *t) - { - tasklet_disable_nosync(t); -- /* Spin wait until all atomic users are converted */ -- tasklet_unlock_spin_wait(t); -+ tasklet_unlock_wait(t); - smp_mb(); - } - --- -2.19.1 - diff --git a/features/rt/tasklets-Use-spin-wait-in-tasklet_disable-temporaril.patch b/features/rt/tasklets-Use-spin-wait-in-tasklet_disable-temporaril.patch deleted file mode 100644 index 0847915a..00000000 --- a/features/rt/tasklets-Use-spin-wait-in-tasklet_disable-temporaril.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a627fa5abc3e55cddc704d352ac54b9cae090728 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:07 +0100 -Subject: [PATCH 044/191] tasklets: Use spin wait in tasklet_disable() - temporarily - -To ease the transition use spin waiting in tasklet_disable() until all -usage sites from atomic context have been cleaned up. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 9d9475f7b89f..f0b82429950c 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -724,7 +724,8 @@ static inline void tasklet_disable_in_atomic(struct tasklet_struct *t) - static inline void tasklet_disable(struct tasklet_struct *t) - { - tasklet_disable_nosync(t); -- tasklet_unlock_wait(t); -+ /* Spin wait until all atomic users are converted */ -+ tasklet_unlock_spin_wait(t); - smp_mb(); - } - --- -2.19.1 - diff --git a/features/rt/tasklets-Use-static-inlines-for-stub-implementations.patch b/features/rt/tasklets-Use-static-inlines-for-stub-implementations.patch deleted file mode 100644 index 8c933503..00000000 --- a/features/rt/tasklets-Use-static-inlines-for-stub-implementations.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cc4367c43efdde19bd1a291f56a0327e2b1890ca Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:42:05 +0100 -Subject: [PATCH 042/191] tasklets: Use static inlines for stub implementations - -Inlines exist for a reason. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/interrupt.h | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index b4cf773638dc..b49ac2639b3e 100644 ---- a/include/linux/interrupt.h -+++ b/include/linux/interrupt.h -@@ -672,9 +672,9 @@ static inline void tasklet_unlock_wait(struct tasklet_struct *t) - cpu_relax(); - } - #else --#define tasklet_trylock(t) 1 --#define tasklet_unlock_wait(t) do { } while (0) --#define tasklet_unlock(t) do { } while (0) -+static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } -+static inline void tasklet_unlock(struct tasklet_struct *t) { } -+static inline void tasklet_unlock_wait(struct tasklet_struct *t) { } - #endif - - extern void __tasklet_schedule(struct tasklet_struct *t); --- -2.19.1 - diff --git a/features/rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch b/features/rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch deleted file mode 100644 index 0f158b80..00000000 --- a/features/rt/tcp-Remove-superfluous-BH-disable-around-listening_h.patch +++ /dev/null @@ -1,108 +0,0 @@ -From fcb2e8b29c71939fca604cb4e527c14fd83cc683 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 12 Oct 2020 17:33:54 +0200 -Subject: [PATCH 039/191] tcp: Remove superfluous BH-disable around - listening_hash - -Commit - 9652dc2eb9e40 ("tcp: relax listening_hash operations") - -removed the need to disable bottom half while acquiring -listening_hash.lock. There are still two callers left which disable -bottom half before the lock is acquired. - -Drop local_bh_disable() around __inet_hash() which acquires -listening_hash->lock, invoke inet_ehash_nolisten() with disabled BH. -inet_unhash() conditionally acquires listening_hash->lock. - -Reported-by: Mike Galbraith <efault@gmx.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Link: https://lore.kernel.org/linux-rt-users/12d6f9879a97cd56c09fb53dee343cbb14f7f1f7.camel@gmx.de/ -Link: https://lkml.kernel.org/r/X9CheYjuXWc75Spa@hirez.programming.kicks-ass.net ---- - net/ipv4/inet_hashtables.c | 19 ++++++++++++------- - net/ipv6/inet6_hashtables.c | 5 +---- - 2 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c -index c96866a53a66..388e3ebb7f57 100644 ---- a/net/ipv4/inet_hashtables.c -+++ b/net/ipv4/inet_hashtables.c -@@ -635,7 +635,9 @@ int __inet_hash(struct sock *sk, struct sock *osk) - int err = 0; - - if (sk->sk_state != TCP_LISTEN) { -+ local_bh_disable(); - inet_ehash_nolisten(sk, osk, NULL); -+ local_bh_enable(); - return 0; - } - WARN_ON(!sk_unhashed(sk)); -@@ -667,11 +669,8 @@ int inet_hash(struct sock *sk) - { - int err = 0; - -- if (sk->sk_state != TCP_CLOSE) { -- local_bh_disable(); -+ if (sk->sk_state != TCP_CLOSE) - err = __inet_hash(sk, NULL); -- local_bh_enable(); -- } - - return err; - } -@@ -682,17 +681,20 @@ void inet_unhash(struct sock *sk) - struct inet_hashinfo *hashinfo = sk->sk_prot->h.hashinfo; - struct inet_listen_hashbucket *ilb = NULL; - spinlock_t *lock; -+ bool state_listen; - - if (sk_unhashed(sk)) - return; - - if (sk->sk_state == TCP_LISTEN) { -+ state_listen = true; - ilb = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)]; -- lock = &ilb->lock; -+ spin_lock(&ilb->lock); - } else { -+ state_listen = false; - lock = inet_ehash_lockp(hashinfo, sk->sk_hash); -+ spin_lock_bh(lock); - } -- spin_lock_bh(lock); - if (sk_unhashed(sk)) - goto unlock; - -@@ -705,7 +707,10 @@ void inet_unhash(struct sock *sk) - __sk_nulls_del_node_init_rcu(sk); - sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); - unlock: -- spin_unlock_bh(lock); -+ if (state_listen) -+ spin_unlock(&ilb->lock); -+ else -+ spin_unlock_bh(lock); - } - EXPORT_SYMBOL_GPL(inet_unhash); - -diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c -index 55c290d55605..9bad345cba9a 100644 ---- a/net/ipv6/inet6_hashtables.c -+++ b/net/ipv6/inet6_hashtables.c -@@ -333,11 +333,8 @@ int inet6_hash(struct sock *sk) - { - int err = 0; - -- if (sk->sk_state != TCP_CLOSE) { -- local_bh_disable(); -+ if (sk->sk_state != TCP_CLOSE) - err = __inet_hash(sk, NULL); -- local_bh_enable(); -- } - - return err; - } --- -2.19.1 - diff --git a/features/rt/tick-sched-Prevent-false-positive-softirq-pending-wa.patch b/features/rt/tick-sched-Prevent-false-positive-softirq-pending-wa.patch deleted file mode 100644 index fdb4a427..00000000 --- a/features/rt/tick-sched-Prevent-false-positive-softirq-pending-wa.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 571cd3959f5bd78c55407d18eeb3b1f39d62aac2 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 9 Mar 2021 09:55:57 +0100 -Subject: [PATCH 059/191] tick/sched: Prevent false positive softirq pending - warnings on RT - -On RT a task which has soft interrupts disabled can block on a lock and -schedule out to idle while soft interrupts are pending. This triggers the -warning in the NOHZ idle code which complains about going idle with pending -soft interrupts. But as the task is blocked soft interrupt processing is -temporarily blocked as well which means that such a warning is a false -positive. - -To prevent that check the per CPU state which indicates that a scheduled -out task has soft interrupts disabled. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Reviewed-by: Frederic Weisbecker <frederic@kernel.org> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/bottom_half.h | 6 ++++++ - kernel/softirq.c | 15 +++++++++++++++ - kernel/time/tick-sched.c | 2 +- - 3 files changed, 22 insertions(+), 1 deletion(-) - -diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h -index e4dd613a070e..eed86eb0a1de 100644 ---- a/include/linux/bottom_half.h -+++ b/include/linux/bottom_half.h -@@ -32,4 +32,10 @@ static inline void local_bh_enable(void) - __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); - } - -+#ifdef CONFIG_PREEMPT_RT -+extern bool local_bh_blocked(void); -+#else -+static inline bool local_bh_blocked(void) { return false; } -+#endif -+ - #endif /* _LINUX_BH_H */ -diff --git a/kernel/softirq.c b/kernel/softirq.c -index 54fd7cc97a4a..4e9077577043 100644 ---- a/kernel/softirq.c -+++ b/kernel/softirq.c -@@ -141,6 +141,21 @@ static DEFINE_PER_CPU(struct softirq_ctrl, softirq_ctrl) = { - .lock = INIT_LOCAL_LOCK(softirq_ctrl.lock), - }; - -+/** -+ * local_bh_blocked() - Check for idle whether BH processing is blocked -+ * -+ * Returns false if the per CPU softirq::cnt is 0 otherwise true. -+ * -+ * This is invoked from the idle task to guard against false positive -+ * softirq pending warnings, which would happen when the task which holds -+ * softirq_ctrl::lock was the only running task on the CPU and blocks on -+ * some other lock. -+ */ -+bool local_bh_blocked(void) -+{ -+ return __this_cpu_read(softirq_ctrl.cnt) != 0; -+} -+ - void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) - { - unsigned long flags; -diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index e10a4af88737..0cc55791b2b6 100644 ---- a/kernel/time/tick-sched.c -+++ b/kernel/time/tick-sched.c -@@ -973,7 +973,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) - if (unlikely(local_softirq_pending())) { - static int ratelimit; - -- if (ratelimit < 10 && -+ if (ratelimit < 10 && !local_bh_blocked() && - (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { - pr_warn("NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #%02x!!!\n", - (unsigned int) local_softirq_pending()); --- -2.19.1 - diff --git a/features/rt/timers-Move-clearing-of-base-timer_running-under-bas.patch b/features/rt/timers-Move-clearing-of-base-timer_running-under-bas.patch deleted file mode 100644 index c95178d3..00000000 --- a/features/rt/timers-Move-clearing-of-base-timer_running-under-bas.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 13ae7118b5e43a9fd44640f31eb1df12f580a13e Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 6 Dec 2020 22:40:07 +0100 -Subject: [PATCH 002/191] timers: Move clearing of base::timer_running under - base::lock - -syzbot reported KCSAN data races vs. timer_base::timer_running being set to -NULL without holding base::lock in expire_timers(). - -This looks innocent and most reads are clearly not problematic but for a -non-RT kernel it's completely irrelevant whether the store happens before -or after taking the lock. For an RT kernel moving the store under the lock -requires an extra unlock/lock pair in the case that there is a waiter for -the timer. But that's not the end of the world and definitely not worth the -trouble of adding boatloads of comments and annotations to the code. Famous -last words... - -Reported-by: syzbot+aa7c2385d46c5eba0b89@syzkaller.appspotmail.com -Reported-by: syzbot+abea4558531bae1ba9fe@syzkaller.appspotmail.com -Link: https://lkml.kernel.org/r/87lfea7gw8.fsf@nanos.tec.linutronix.de -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Cc: stable-rt@vger.kernel.org ---- - kernel/time/timer.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/kernel/time/timer.c b/kernel/time/timer.c -index f475f1a027c8..a0ec4450b1d8 100644 ---- a/kernel/time/timer.c -+++ b/kernel/time/timer.c -@@ -1277,8 +1277,10 @@ static inline void timer_base_unlock_expiry(struct timer_base *base) - static void timer_sync_wait_running(struct timer_base *base) - { - if (atomic_read(&base->timer_waiters)) { -+ raw_spin_unlock_irq(&base->lock); - spin_unlock(&base->expiry_lock); - spin_lock(&base->expiry_lock); -+ raw_spin_lock_irq(&base->lock); - } - } - -@@ -1469,14 +1471,14 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) - if (timer->flags & TIMER_IRQSAFE) { - raw_spin_unlock(&base->lock); - call_timer_fn(timer, fn, baseclk); -- base->running_timer = NULL; - raw_spin_lock(&base->lock); -+ base->running_timer = NULL; - } else { - raw_spin_unlock_irq(&base->lock); - call_timer_fn(timer, fn, baseclk); -+ raw_spin_lock_irq(&base->lock); - base->running_timer = NULL; - timer_sync_wait_running(base); -- raw_spin_lock_irq(&base->lock); - } - } - } --- -2.19.1 - diff --git a/features/rt/tpm_tis-fix-stall-after-iowrite-s.patch b/features/rt/tpm_tis-fix-stall-after-iowrite-s.patch deleted file mode 100644 index f18ee11b..00000000 --- a/features/rt/tpm_tis-fix-stall-after-iowrite-s.patch +++ /dev/null @@ -1,83 +0,0 @@ -From fb6a0698c965b81df94b9d9abe384dfdcd7789e7 Mon Sep 17 00:00:00 2001 -From: Haris Okanovic <haris.okanovic@ni.com> -Date: Tue, 15 Aug 2017 15:13:08 -0500 -Subject: [PATCH 187/191] tpm_tis: fix stall after iowrite*()s - -ioread8() operations to TPM MMIO addresses can stall the cpu when -immediately following a sequence of iowrite*()'s to the same region. - -For example, cyclitest measures ~400us latency spikes when a non-RT -usermode application communicates with an SPI-based TPM chip (Intel Atom -E3940 system, PREEMPT_RT kernel). The spikes are caused by a -stalling ioread8() operation following a sequence of 30+ iowrite8()s to -the same address. I believe this happens because the write sequence is -buffered (in cpu or somewhere along the bus), and gets flushed on the -first LOAD instruction (ioread*()) that follows. - -The enclosed change appears to fix this issue: read the TPM chip's -access register (status code) after every iowrite*() operation to -amortize the cost of flushing data to chip across multiple instructions. - -Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - drivers/char/tpm/tpm_tis.c | 29 +++++++++++++++++++++++++++-- - 1 file changed, 27 insertions(+), 2 deletions(-) - -diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c -index 4ed6e660273a..c2bd0d40b5fc 100644 ---- a/drivers/char/tpm/tpm_tis.c -+++ b/drivers/char/tpm/tpm_tis.c -@@ -50,6 +50,31 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da - return container_of(data, struct tpm_tis_tcg_phy, priv); - } - -+#ifdef CONFIG_PREEMPT_RT -+/* -+ * Flushes previous write operations to chip so that a subsequent -+ * ioread*()s won't stall a cpu. -+ */ -+static inline void tpm_tis_flush(void __iomem *iobase) -+{ -+ ioread8(iobase + TPM_ACCESS(0)); -+} -+#else -+#define tpm_tis_flush(iobase) do { } while (0) -+#endif -+ -+static inline void tpm_tis_iowrite8(u8 b, void __iomem *iobase, u32 addr) -+{ -+ iowrite8(b, iobase + addr); -+ tpm_tis_flush(iobase); -+} -+ -+static inline void tpm_tis_iowrite32(u32 b, void __iomem *iobase, u32 addr) -+{ -+ iowrite32(b, iobase + addr); -+ tpm_tis_flush(iobase); -+} -+ - static int interrupts = -1; - module_param(interrupts, int, 0444); - MODULE_PARM_DESC(interrupts, "Enable interrupts"); -@@ -169,7 +194,7 @@ static int tpm_tcg_write_bytes(struct tpm_tis_data *data, u32 addr, u16 len, - struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - - while (len--) -- iowrite8(*value++, phy->iobase + addr); -+ tpm_tis_iowrite8(*value++, phy->iobase, addr); - - return 0; - } -@@ -196,7 +221,7 @@ static int tpm_tcg_write32(struct tpm_tis_data *data, u32 addr, u32 value) - { - struct tpm_tis_tcg_phy *phy = to_tpm_tis_tcg_phy(data); - -- iowrite32(value, phy->iobase + addr); -+ tpm_tis_iowrite32(value, phy->iobase, addr); - - return 0; - } --- -2.19.1 - diff --git a/features/rt/trace-Add-migrate-disabled-counter-to-tracing-output.patch b/features/rt/trace-Add-migrate-disabled-counter-to-tracing-output.patch deleted file mode 100644 index 06042832..00000000 --- a/features/rt/trace-Add-migrate-disabled-counter-to-tracing-output.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 928f16ff0761da409ca9379638e74251da9ab39c Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 17 Jul 2011 21:56:42 +0200 -Subject: [PATCH 102/191] trace: Add migrate-disabled counter to tracing output - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/trace_events.h | 2 ++ - kernel/trace/trace.c | 26 +++++++++++++++++++------- - kernel/trace/trace_events.c | 1 + - kernel/trace/trace_output.c | 5 +++++ - 4 files changed, 27 insertions(+), 7 deletions(-) - -diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h -index 28e7af1406f2..1048965a8750 100644 ---- a/include/linux/trace_events.h -+++ b/include/linux/trace_events.h -@@ -69,6 +69,7 @@ struct trace_entry { - unsigned char flags; - unsigned char preempt_count; - int pid; -+ unsigned char migrate_disable; - }; - - #define TRACE_EVENT_TYPE_MAX \ -@@ -157,6 +158,7 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry, - unsigned int trace_ctx) - { - entry->preempt_count = trace_ctx & 0xff; -+ entry->migrate_disable = (trace_ctx >> 8) & 0xff; - entry->pid = current->pid; - entry->type = type; - entry->flags = trace_ctx >> 16; -diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index a6baa9b174e4..55bcdaedf7a8 100644 ---- a/kernel/trace/trace.c -+++ b/kernel/trace/trace.c -@@ -2587,6 +2587,15 @@ enum print_line_t trace_handle_return(struct trace_seq *s) - } - EXPORT_SYMBOL_GPL(trace_handle_return); - -+static unsigned short migration_disable_value(void) -+{ -+#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT) -+ return current->migration_disabled; -+#else -+ return 0; -+#endif -+} -+ - unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) - { - unsigned int trace_flags = irqs_status; -@@ -2605,7 +2614,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) - trace_flags |= TRACE_FLAG_NEED_RESCHED; - if (test_preempt_need_resched()) - trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; -- return (trace_flags << 16) | (pc & 0xff); -+ return (trace_flags << 16) | (pc & 0xff) | -+ (migration_disable_value() & 0xff) << 8; - } - - struct ring_buffer_event * -@@ -3870,9 +3880,10 @@ static void print_lat_help_header(struct seq_file *m) - "# | / _----=> need-resched \n" - "# || / _---=> hardirq/softirq \n" - "# ||| / _--=> preempt-depth \n" -- "# |||| / delay \n" -- "# cmd pid ||||| time | caller \n" -- "# \\ / ||||| \\ | / \n"); -+ "# |||| / _-=> migrate-disable \n" -+ "# ||||| / delay \n" -+ "# cmd pid |||||| time | caller \n" -+ "# \\ / |||||| \\ | / \n"); - } - - static void print_event_info(struct array_buffer *buf, struct seq_file *m) -@@ -3910,9 +3921,10 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file - seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space); - seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space); - seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space); -- seq_printf(m, "# %.*s||| / delay\n", prec, space); -- seq_printf(m, "# TASK-PID %.*s CPU# |||| TIMESTAMP FUNCTION\n", prec, " TGID "); -- seq_printf(m, "# | | %.*s | |||| | |\n", prec, " | "); -+ seq_printf(m, "# %.*s||| / _-=> migrate-disable\n", prec, space); -+ seq_printf(m, "# %.*s|||| / delay\n", prec, space); -+ seq_printf(m, "# TASK-PID %.*s CPU# ||||| TIMESTAMP FUNCTION\n", prec, " TGID "); -+ seq_printf(m, "# | | %.*s | ||||| | |\n", prec, " | "); - } - - void -diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c -index a3563afd412d..ba0b9edd652d 100644 ---- a/kernel/trace/trace_events.c -+++ b/kernel/trace/trace_events.c -@@ -183,6 +183,7 @@ static int trace_define_common_fields(void) - __common_field(unsigned char, flags); - __common_field(unsigned char, preempt_count); - __common_field(int, pid); -+ __common_field(unsigned char, migrate_disable); - - return ret; - } -diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c -index 61255bad7e01..5e32edb8a90a 100644 ---- a/kernel/trace/trace_output.c -+++ b/kernel/trace/trace_output.c -@@ -497,6 +497,11 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) - else - trace_seq_putc(s, '.'); - -+ if (entry->migrate_disable) -+ trace_seq_printf(s, "%x", entry->migrate_disable); -+ else -+ trace_seq_putc(s, '.'); -+ - return !trace_seq_has_overflowed(s); - } - --- -2.19.1 - diff --git a/features/rt/tty-serial-omap-Make-the-locking-RT-aware.patch b/features/rt/tty-serial-omap-Make-the-locking-RT-aware.patch deleted file mode 100644 index a78020da..00000000 --- a/features/rt/tty-serial-omap-Make-the-locking-RT-aware.patch +++ /dev/null @@ -1,48 +0,0 @@ -From d818b28e0298adb1eeb3b3d722d3bf10318fa90d Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 28 Jul 2011 13:32:57 +0200 -Subject: [PATCH 171/191] tty/serial/omap: Make the locking RT aware - -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. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - drivers/tty/serial/omap-serial.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c -index 76b94d0ff586..80371598efea 100644 ---- a/drivers/tty/serial/omap-serial.c -+++ b/drivers/tty/serial/omap-serial.c -@@ -1301,13 +1301,10 @@ serial_omap_console_write(struct console *co, const char *s, - - pm_runtime_get_sync(up->dev); - -- local_irq_save(flags); -- if (up->port.sysrq) -- locked = 0; -- else if (oops_in_progress) -- locked = spin_trylock(&up->port.lock); -+ if (up->port.sysrq || oops_in_progress) -+ locked = spin_trylock_irqsave(&up->port.lock, flags); - else -- spin_lock(&up->port.lock); -+ spin_lock_irqsave(&up->port.lock, flags); - - /* - * First save the IER then disable the interrupts -@@ -1336,8 +1333,7 @@ serial_omap_console_write(struct console *co, const char *s, - pm_runtime_mark_last_busy(up->dev); - pm_runtime_put_autosuspend(up->dev); - if (locked) -- spin_unlock(&up->port.lock); -- local_irq_restore(flags); -+ spin_unlock_irqrestore(&up->port.lock, flags); - } - - static int __init --- -2.19.1 - diff --git a/features/rt/tty-serial-pl011-Make-the-locking-work-on-RT.patch b/features/rt/tty-serial-pl011-Make-the-locking-work-on-RT.patch deleted file mode 100644 index 8d9cbe4a..00000000 --- a/features/rt/tty-serial-pl011-Make-the-locking-work-on-RT.patch +++ /dev/null @@ -1,59 +0,0 @@ -From c93bc4171de555594d642d4f673d68377fbcc274 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Tue, 8 Jan 2013 21:36:51 +0100 -Subject: [PATCH 172/191] tty/serial/pl011: Make the locking work on RT - -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. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - drivers/tty/serial/amba-pl011.c | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index 4ead0c9048a8..1bbc56263c2d 100644 ---- a/drivers/tty/serial/amba-pl011.c -+++ b/drivers/tty/serial/amba-pl011.c -@@ -2201,18 +2201,24 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) - { - struct uart_amba_port *uap = amba_ports[co->index]; - unsigned int old_cr = 0, new_cr; -- unsigned long flags; -+ unsigned long flags = 0; - int locked = 1; - - clk_enable(uap->clk); - -- local_irq_save(flags); -+ /* -+ * local_irq_save(flags); -+ * -+ * This local_irq_save() is nonsense. If we come in via sysrq -+ * handling then interrupts are already disabled. Aside of -+ * that the port.sysrq check is racy on SMP regardless. -+ */ - if (uap->port.sysrq) - locked = 0; - else if (oops_in_progress) -- locked = spin_trylock(&uap->port.lock); -+ locked = spin_trylock_irqsave(&uap->port.lock, flags); - else -- spin_lock(&uap->port.lock); -+ spin_lock_irqsave(&uap->port.lock, flags); - - /* - * First save the CR then disable the interrupts -@@ -2238,8 +2244,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) - pl011_write(old_cr, uap, REG_CR); - - if (locked) -- spin_unlock(&uap->port.lock); -- local_irq_restore(flags); -+ spin_unlock_irqrestore(&uap->port.lock, flags); - - clk_disable(uap->clk); - } --- -2.19.1 - diff --git a/features/rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch b/features/rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch deleted file mode 100644 index af52aa75..00000000 --- a/features/rt/u64_stats-Disable-preemption-on-32bit-UP-SMP-with-RT.patch +++ /dev/null @@ -1,151 +0,0 @@ -From f134d18cc24a5f4bbd6fa3b658749d22a00136c6 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 17 Aug 2020 12:28:10 +0200 -Subject: [PATCH 088/191] u64_stats: Disable preemption on 32bit-UP/SMP with RT - during updates - -On RT the seqcount_t is required even on UP because the softirq can be -preempted. The IRQ handler is threaded so it is also preemptible. - -Disable preemption on 32bit-RT during value updates. There is no need to -disable interrupts on RT because the handler is run threaded. Therefore -disabling preemption is enough to guarantee that the update is not -interruped. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/u64_stats_sync.h | 42 ++++++++++++++++++++++------------ - 1 file changed, 28 insertions(+), 14 deletions(-) - -diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h -index e81856c0ba13..66eb968a09d4 100644 ---- a/include/linux/u64_stats_sync.h -+++ b/include/linux/u64_stats_sync.h -@@ -66,7 +66,7 @@ - #include <linux/seqlock.h> - - struct u64_stats_sync { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG==32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - seqcount_t seq; - #endif - }; -@@ -115,7 +115,7 @@ static inline void u64_stats_inc(u64_stats_t *p) - } - #endif - --#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - #define u64_stats_init(syncp) seqcount_init(&(syncp)->seq) - #else - static inline void u64_stats_init(struct u64_stats_sync *syncp) -@@ -125,15 +125,19 @@ static inline void u64_stats_init(struct u64_stats_sync *syncp) - - static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) - { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ preempt_disable(); - write_seqcount_begin(&syncp->seq); - #endif - } - - static inline void u64_stats_update_end(struct u64_stats_sync *syncp) - { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - write_seqcount_end(&syncp->seq); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ preempt_enable(); - #endif - } - -@@ -142,8 +146,11 @@ u64_stats_update_begin_irqsave(struct u64_stats_sync *syncp) - { - unsigned long flags = 0; - --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -- local_irq_save(flags); -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ preempt_disable(); -+ else -+ local_irq_save(flags); - write_seqcount_begin(&syncp->seq); - #endif - return flags; -@@ -153,15 +160,18 @@ static inline void - u64_stats_update_end_irqrestore(struct u64_stats_sync *syncp, - unsigned long flags) - { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - write_seqcount_end(&syncp->seq); -- local_irq_restore(flags); -+ if (IS_ENABLED(CONFIG_PREEMPT_RT)) -+ preempt_enable(); -+ else -+ local_irq_restore(flags); - #endif - } - - static inline unsigned int __u64_stats_fetch_begin(const struct u64_stats_sync *syncp) - { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - return read_seqcount_begin(&syncp->seq); - #else - return 0; -@@ -170,7 +180,7 @@ static inline unsigned int __u64_stats_fetch_begin(const struct u64_stats_sync * - - static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp) - { --#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (!defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_RT)) - preempt_disable(); - #endif - return __u64_stats_fetch_begin(syncp); -@@ -179,7 +189,7 @@ static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *sy - static inline bool __u64_stats_fetch_retry(const struct u64_stats_sync *syncp, - unsigned int start) - { --#if BITS_PER_LONG==32 && defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)) - return read_seqcount_retry(&syncp->seq, start); - #else - return false; -@@ -189,7 +199,7 @@ static inline bool __u64_stats_fetch_retry(const struct u64_stats_sync *syncp, - static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, - unsigned int start) - { --#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && (!defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_RT)) - preempt_enable(); - #endif - return __u64_stats_fetch_retry(syncp, start); -@@ -203,7 +213,9 @@ static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, - */ - static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp) - { --#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && defined(CONFIG_PREEMPT_RT) -+ preempt_disable(); -+#elif BITS_PER_LONG == 32 && !defined(CONFIG_SMP) - local_irq_disable(); - #endif - return __u64_stats_fetch_begin(syncp); -@@ -212,7 +224,9 @@ static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync - static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp, - unsigned int start) - { --#if BITS_PER_LONG==32 && !defined(CONFIG_SMP) -+#if BITS_PER_LONG == 32 && defined(CONFIG_PREEMPT_RT) -+ preempt_enable(); -+#elif BITS_PER_LONG == 32 && !defined(CONFIG_SMP) - local_irq_enable(); - #endif - return __u64_stats_fetch_retry(syncp, start); --- -2.19.1 - diff --git a/features/rt/um-synchronize-kmsg_dumper.patch b/features/rt/um-synchronize-kmsg_dumper.patch deleted file mode 100644 index e966e64f..00000000 --- a/features/rt/um-synchronize-kmsg_dumper.patch +++ /dev/null @@ -1,60 +0,0 @@ -From f3906ea0eeb323f758000d9ac28d7c08d769aee5 Mon Sep 17 00:00:00 2001 -From: John Ogness <john.ogness@linutronix.de> -Date: Mon, 21 Dec 2020 11:10:03 +0106 -Subject: [PATCH 016/191] um: synchronize kmsg_dumper - -The kmsg_dumper can be called from any context and CPU, possibly -from multiple CPUs simultaneously. Since a static buffer is used -to retrieve the kernel logs, this buffer must be protected against -simultaneous dumping. - -Cc: Richard Weinberger <richard@nod.at> -Signed-off-by: John Ogness <john.ogness@linutronix.de> -Reviewed-by: Petr Mladek <pmladek@suse.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/um/kernel/kmsg_dump.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/arch/um/kernel/kmsg_dump.c b/arch/um/kernel/kmsg_dump.c -index 78befecb79d2..deab9b56b51f 100644 ---- a/arch/um/kernel/kmsg_dump.c -+++ b/arch/um/kernel/kmsg_dump.c -@@ -1,5 +1,6 @@ - // SPDX-License-Identifier: GPL-2.0 - #include <linux/kmsg_dump.h> -+#include <linux/spinlock.h> - #include <linux/console.h> - #include <linux/string.h> - #include <shared/init.h> -@@ -10,8 +11,10 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, - enum kmsg_dump_reason reason, - struct kmsg_dumper_iter *iter) - { -+ static DEFINE_SPINLOCK(lock); - static char line[1024]; - struct console *con; -+ unsigned long flags; - size_t len = 0; - - /* only dump kmsg when no console is available */ -@@ -30,11 +33,16 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper, - if (con) - return; - -+ if (!spin_trylock_irqsave(&lock, flags)) -+ return; -+ - printf("kmsg_dump:\n"); - while (kmsg_dump_get_line(iter, true, line, sizeof(line), &len)) { - line[len] = '\0'; - printf("%s", line); - } -+ -+ spin_unlock_irqrestore(&lock, flags); - } - - static struct kmsg_dumper kmsg_dumper = { --- -2.19.1 - diff --git a/features/rt/wait.h-include-atomic.h.patch b/features/rt/wait.h-include-atomic.h.patch deleted file mode 100644 index 3b04974c..00000000 --- a/features/rt/wait.h-include-atomic.h.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 185942fe0a67d2f3018d9384faa6f2e3ac0ed9ea Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 28 Oct 2013 12:19:57 +0100 -Subject: [PATCH 118/191] wait.h: include atomic.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -| CC init/main.o -|In file included from include/linux/mmzone.h:9:0, -| from include/linux/gfp.h:4, -| from include/linux/kmod.h:22, -| from include/linux/module.h:13, -| from init/main.c:15: -|include/linux/wait.h: In function ‘wait_on_atomic_t’: -|include/linux/wait.h:982:2: error: implicit declaration of function ‘atomic_read’ [-Werror=implicit-function-declaration] -| if (atomic_read(val) == 0) -| ^ - -This pops up on ARM. Non-RT gets its atomic.h include from spinlock.h - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/wait.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/linux/wait.h b/include/linux/wait.h -index fe10e8570a52..e9ce878a4906 100644 ---- a/include/linux/wait.h -+++ b/include/linux/wait.h -@@ -10,6 +10,7 @@ - - #include <asm/current.h> - #include <uapi/linux/wait.h> -+#include <linux/atomic.h> - - typedef struct wait_queue_entry wait_queue_entry_t; - --- -2.19.1 - diff --git a/features/rt/x86-Allow-to-enable-RT.patch b/features/rt/x86-Allow-to-enable-RT.patch deleted file mode 100644 index 804952e6..00000000 --- a/features/rt/x86-Allow-to-enable-RT.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 923160aecfc3fc15a461c6b706c6f2df869474b0 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Wed, 7 Aug 2019 18:15:38 +0200 -Subject: [PATCH 161/191] x86: Allow to enable RT - -Allow to select RT. - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/x86/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 2792879d398e..bb7b237aaa3d 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -27,6 +27,7 @@ config X86_64 - # Options that are inherently 64-bit kernel only: - select ARCH_HAS_GIGANTIC_PAGE - select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 -+ select ARCH_SUPPORTS_RT - select ARCH_USE_CMPXCHG_LOCKREF - select HAVE_ARCH_SOFT_DIRTY - select MODULES_USE_ELF_RELA --- -2.19.1 - diff --git a/features/rt/x86-Enable-RT-also-on-32bit.patch b/features/rt/x86-Enable-RT-also-on-32bit.patch deleted file mode 100644 index dbf5db26..00000000 --- a/features/rt/x86-Enable-RT-also-on-32bit.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e3fd694fc2bc4be6d9688ba7fe81cafed748d3ae Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Thu, 7 Nov 2019 17:49:20 +0100 -Subject: [PATCH 177/191] x86: Enable RT also on 32bit - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - arch/x86/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 98ba6c71f93b..2f4fd6a7e82e 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -27,7 +27,6 @@ config X86_64 - # Options that are inherently 64-bit kernel only: - select ARCH_HAS_GIGANTIC_PAGE - select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 -- select ARCH_SUPPORTS_RT - select ARCH_USE_CMPXCHG_LOCKREF - select HAVE_ARCH_SOFT_DIRTY - select MODULES_USE_ELF_RELA -@@ -100,6 +99,7 @@ config X86 - select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP if NR_CPUS <= 4096 - select ARCH_SUPPORTS_LTO_CLANG if X86_64 - select ARCH_SUPPORTS_LTO_CLANG_THIN if X86_64 -+ select ARCH_SUPPORTS_RT - select ARCH_USE_BUILTIN_BSWAP - select ARCH_USE_QUEUED_RWLOCKS - select ARCH_USE_QUEUED_SPINLOCKS --- -2.19.1 - diff --git a/features/rt/x86-Support-for-lazy-preemption.patch b/features/rt/x86-Support-for-lazy-preemption.patch deleted file mode 100644 index 41923c12..00000000 --- a/features/rt/x86-Support-for-lazy-preemption.patch +++ /dev/null @@ -1,155 +0,0 @@ -From b9863a8455b93ee2b1fa568a57a16c67fb38bea5 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 1 Nov 2012 11:03:47 +0100 -Subject: [PATCH 165/191] x86: Support for lazy preemption - -Implement the x86 pieces for lazy preempt. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/x86/Kconfig | 1 + - arch/x86/include/asm/preempt.h | 33 +++++++++++++++++++++++++++++- - arch/x86/include/asm/thread_info.h | 7 +++++++ - include/linux/entry-common.h | 2 +- - kernel/entry/common.c | 2 +- - 5 files changed, 42 insertions(+), 3 deletions(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index bb7b237aaa3d..98ba6c71f93b 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -221,6 +221,7 @@ config X86 - select HAVE_PCI - select HAVE_PERF_REGS - select HAVE_PERF_USER_STACK_DUMP -+ select HAVE_PREEMPT_LAZY - select MMU_GATHER_RCU_TABLE_FREE if PARAVIRT - select HAVE_POSIX_CPU_TIMERS_TASK_WORK - select HAVE_REGS_AND_STACK_ACCESS_API -diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h -index 7e0358f99d22..dde8f20cb702 100644 ---- a/arch/x86/include/asm/preempt.h -+++ b/arch/x86/include/asm/preempt.h -@@ -90,17 +90,48 @@ static __always_inline void __preempt_count_sub(int val) - * a decrement which hits zero means we have no preempt_count and should - * reschedule. - */ --static __always_inline bool __preempt_count_dec_and_test(void) -+static __always_inline bool ____preempt_count_dec_and_test(void) - { - return GEN_UNARY_RMWcc("decl", __preempt_count, e, __percpu_arg([var])); - } - -+static __always_inline bool __preempt_count_dec_and_test(void) -+{ -+ 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); -+#else -+ return false; -+#endif -+} -+ - /* - * Returns true when we need to resched and can (barring IRQ state). - */ - static __always_inline bool should_resched(int preempt_offset) - { -+#ifdef CONFIG_PREEMPT_LAZY -+ u32 tmp; -+ tmp = raw_cpu_read_4(__preempt_count); -+ if (tmp == preempt_offset) -+ return true; -+ -+ /* preempt count == 0 ? */ -+ tmp &= ~PREEMPT_NEED_RESCHED; -+ if (tmp != preempt_offset) -+ return false; -+ /* XXX PREEMPT_LOCK_OFFSET */ -+ if (current_thread_info()->preempt_lazy_count) -+ return false; -+ return test_thread_flag(TIF_NEED_RESCHED_LAZY); -+#else - return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset); -+#endif - } - - #ifdef CONFIG_PREEMPTION -diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h -index 0d751d5da702..2e62434951fa 100644 ---- a/arch/x86/include/asm/thread_info.h -+++ b/arch/x86/include/asm/thread_info.h -@@ -57,11 +57,14 @@ struct thread_info { - unsigned long flags; /* low level flags */ - unsigned long syscall_work; /* SYSCALL_WORK_ flags */ - u32 status; /* thread synchronous flags */ -+ int preempt_lazy_count; /* 0 => lazy preemptable -+ <0 => BUG */ - }; - - #define INIT_THREAD_INFO(tsk) \ - { \ - .flags = 0, \ -+ .preempt_lazy_count = 0, \ - } - - #else /* !__ASSEMBLY__ */ -@@ -90,6 +93,7 @@ struct thread_info { - #define TIF_NOTSC 16 /* TSC is not accessible in userland */ - #define TIF_NOTIFY_SIGNAL 17 /* signal notifications exist */ - #define TIF_SLD 18 /* Restore split lock detection on context switch */ -+#define TIF_NEED_RESCHED_LAZY 19 /* lazy rescheduling necessary */ - #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ - #define TIF_POLLING_NRFLAG 21 /* idle is polling for TIF_NEED_RESCHED */ - #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ -@@ -113,6 +117,7 @@ struct thread_info { - #define _TIF_NOTSC (1 << TIF_NOTSC) - #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) - #define _TIF_SLD (1 << TIF_SLD) -+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY) - #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) - #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) - #define _TIF_FORCED_TF (1 << TIF_FORCED_TF) -@@ -143,6 +148,8 @@ struct thread_info { - - #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) - -+#define _TIF_NEED_RESCHED_MASK (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY) -+ - #define STACK_WARN (THREAD_SIZE/8) - - /* -diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h -index 883acef895bc..0aa546532b31 100644 ---- a/include/linux/entry-common.h -+++ b/include/linux/entry-common.h -@@ -59,7 +59,7 @@ - - #define EXIT_TO_USER_MODE_WORK \ - (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ -- _TIF_NEED_RESCHED | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ -+ _TIF_NEED_RESCHED_MASK | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ - ARCH_EXIT_TO_USER_MODE_WORK) - - /** -diff --git a/kernel/entry/common.c b/kernel/entry/common.c -index 162c49016f0f..16b4356494bc 100644 ---- a/kernel/entry/common.c -+++ b/kernel/entry/common.c -@@ -158,7 +158,7 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, - - local_irq_enable_exit_to_user(ti_work); - -- if (ti_work & _TIF_NEED_RESCHED) -+ if (ti_work & _TIF_NEED_RESCHED_MASK) - schedule(); - - #ifdef ARCH_RT_DELAYS_SIGNAL_SEND --- -2.19.1 - diff --git a/features/rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch b/features/rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch deleted file mode 100644 index 2d757aa5..00000000 --- a/features/rt/x86-entry-Use-should_resched-in-idtentry_exit_cond_r.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ea85707dd291bf6df28d3d791e1169e8c9317c24 Mon Sep 17 00:00:00 2001 -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Tue, 30 Jun 2020 11:45:14 +0200 -Subject: [PATCH 164/191] x86/entry: Use should_resched() in - idtentry_exit_cond_resched() - -The TIF_NEED_RESCHED bit is inlined on x86 into the preemption counter. -By using should_resched(0) instead of need_resched() the same check can -be performed which uses the same variable as 'preempt_count()` which was -issued before. - -Use should_resched(0) instead need_resched(). - -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/entry/common.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/entry/common.c b/kernel/entry/common.c -index 2a7bcc744033..162c49016f0f 100644 ---- a/kernel/entry/common.c -+++ b/kernel/entry/common.c -@@ -396,7 +396,7 @@ void irqentry_exit_cond_resched(void) - rcu_irq_exit_check_preempt(); - if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) - WARN_ON_ONCE(!on_thread_stack()); -- if (need_resched()) -+ if (should_resched(0)) - preempt_schedule_irq(); - } - } --- -2.19.1 - diff --git a/features/rt/x86-kvm-Require-const-tsc-for-RT.patch b/features/rt/x86-kvm-Require-const-tsc-for-RT.patch deleted file mode 100644 index 0b9a6b96..00000000 --- a/features/rt/x86-kvm-Require-const-tsc-for-RT.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bc5cb37aa8e610d93aada2612abf77e85d034c75 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Sun, 6 Nov 2011 12:26:18 +0100 -Subject: [PATCH 117/191] x86: kvm Require const tsc for RT - -Non constant TSC is a nightmare on bare metal already, but with -virtualization it becomes a complete disaster because the workarounds -are horrible latency wise. That's also a preliminary for running RT in -a guest on top of a RT host. - -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/x86/kvm/x86.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 47e021bdcc94..891c3239e2b0 100644 ---- a/arch/x86/kvm/x86.c -+++ b/arch/x86/kvm/x86.c -@@ -7979,6 +7979,14 @@ int kvm_arch_init(void *opaque) - goto out; - } - -+#ifdef CONFIG_PREEMPT_RT -+ if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { -+ pr_err("RT requires X86_FEATURE_CONSTANT_TSC\n"); -+ r = -EOPNOTSUPP; -+ goto out; -+ } -+#endif -+ - r = -ENOMEM; - x86_fpu_cache = kmem_cache_create("x86_fpu", sizeof(struct fpu), - __alignof__(struct fpu), SLAB_ACCOUNT, --- -2.19.1 - diff --git a/features/rt/x86-stackprotector-Avoid-random-pool-on-rt.patch b/features/rt/x86-stackprotector-Avoid-random-pool-on-rt.patch deleted file mode 100644 index 6bb99f71..00000000 --- a/features/rt/x86-stackprotector-Avoid-random-pool-on-rt.patch +++ /dev/null @@ -1,50 +0,0 @@ -From f40609f2fbc20bb8d816c6d6a193f66f3d49d267 Mon Sep 17 00:00:00 2001 -From: Thomas Gleixner <tglx@linutronix.de> -Date: Thu, 16 Dec 2010 14:25:18 +0100 -Subject: [PATCH 148/191] x86: stackprotector: Avoid random pool on rt - -CPU bringup calls into the random pool to initialize the stack -canary. During boot that works nicely even on RT as the might sleep -checks are disabled. During CPU hotplug the might sleep checks -trigger. Making the locks in random raw is a major PITA, so avoid the -call on RT is the only sensible solution. This is basically the same -randomness which we get during boot where the random pool has no -entropy and we rely on the TSC randomnness. - -Reported-by: Carsten Emde <carsten.emde@osadl.org> -Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - arch/x86/include/asm/stackprotector.h | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h -index 7fb482f0f25b..3df0a95c9e13 100644 ---- a/arch/x86/include/asm/stackprotector.h -+++ b/arch/x86/include/asm/stackprotector.h -@@ -65,7 +65,7 @@ - */ - static __always_inline void boot_init_stack_canary(void) - { -- u64 canary; -+ u64 canary = 0; - u64 tsc; - - #ifdef CONFIG_X86_64 -@@ -76,8 +76,14 @@ static __always_inline void boot_init_stack_canary(void) - * of randomness. The TSC only matters for very early init, - * there it already has some randomness on most systems. Later - * on during the bootup the random pool has true entropy too. -+ * For preempt-rt we need to weaken the randomness a bit, as -+ * we can't call into the random generator from atomic context -+ * due to locking constraints. We just leave canary -+ * uninitialized and use the TSC based randomness on top of it. - */ -+#ifndef CONFIG_PREEMPT_RT - get_random_bytes(&canary, sizeof(canary)); -+#endif - tsc = rdtsc(); - canary += tsc + (tsc << 32UL); - canary &= CANARY_MASK; --- -2.19.1 - diff --git a/features/rt/xfrm-Use-sequence-counter-with-associated-spinlock.patch b/features/rt/xfrm-Use-sequence-counter-with-associated-spinlock.patch deleted file mode 100644 index 78fb2552..00000000 --- a/features/rt/xfrm-Use-sequence-counter-with-associated-spinlock.patch +++ /dev/null @@ -1,65 +0,0 @@ -From bdb062ede4003ee86bd6c2665b92856d69b14c6a Mon Sep 17 00:00:00 2001 -From: "Ahmed S. Darwish" <a.darwish@linutronix.de> -Date: Wed, 10 Jun 2020 12:53:22 +0200 -Subject: [PATCH 087/191] xfrm: Use sequence counter with associated spinlock - -A sequence counter write side critical section must be protected by some -form of locking to serialize writers. A plain seqcount_t does not -contain the information of which lock must be held when entering a write -side critical section. - -Use the new seqcount_spinlock_t data type, which allows to associate a -spinlock with the sequence counter. This enables lockdep to verify that -the spinlock used for writer serialization is held when the write side -critical section is entered. - -If lockdep is disabled this lock association is compiled out and has -neither storage size nor runtime overhead. - -Upstream-status: The xfrm locking used for seqcoun writer serialization -appears to be broken. If that's the case, a proper fix will need to be -submitted upstream. (e.g. make the seqcount per network namespace?) - -Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/xfrm/xfrm_state.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c -index d01ca1a18418..14059a9051b8 100644 ---- a/net/xfrm/xfrm_state.c -+++ b/net/xfrm/xfrm_state.c -@@ -44,7 +44,7 @@ static void xfrm_state_gc_task(struct work_struct *work); - */ - - static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; --static __read_mostly seqcount_t xfrm_state_hash_generation = SEQCNT_ZERO(xfrm_state_hash_generation); -+static __read_mostly seqcount_spinlock_t xfrm_state_hash_generation; - static struct kmem_cache *xfrm_state_cache __ro_after_init; - - static DECLARE_WORK(xfrm_state_gc_work, xfrm_state_gc_task); -@@ -139,6 +139,11 @@ static void xfrm_hash_resize(struct work_struct *work) - return; - } - -+ /* XXX - the locking which protects the sequence counter appears -+ * to be broken here. The sequence counter is global, but the -+ * spinlock used for the sequence counter write serialization is -+ * per network namespace... -+ */ - spin_lock_bh(&net->xfrm.xfrm_state_lock); - write_seqcount_begin(&xfrm_state_hash_generation); - -@@ -2666,6 +2671,8 @@ int __net_init xfrm_state_init(struct net *net) - net->xfrm.state_num = 0; - INIT_WORK(&net->xfrm.state_hash_work, xfrm_hash_resize); - spin_lock_init(&net->xfrm.xfrm_state_lock); -+ seqcount_spinlock_init(&xfrm_state_hash_generation, -+ &net->xfrm.xfrm_state_lock); - return 0; - - out_byspi: --- -2.19.1 - diff --git a/features/scsi/scsi-debug.cfg b/features/scsi/scsi-debug.cfg index 11dc381f..90e6aa4b 100644 --- a/features/scsi/scsi-debug.cfg +++ b/features/scsi/scsi-debug.cfg @@ -1,2 +1,3 @@ # SPDX-License-Identifier: MIT +CONFIG_SCSI_LOWLEVEL=y CONFIG_SCSI_DEBUG=m diff --git a/features/scsi/scsi-debug.scc b/features/scsi/scsi-debug.scc index 2032872a..f591db62 100644 --- a/features/scsi/scsi-debug.scc +++ b/features/scsi/scsi-debug.scc @@ -5,5 +5,6 @@ define KFEATURE_COMPATIBILITY board # if we are turning on debug support, we need to be sure that core scsi # support is enabled. include scsi.scc +include disk.scc kconf hardware scsi-debug.cfg diff --git a/features/security/security-arm64.cfg b/features/security/security-arm64.cfg new file mode 100644 index 00000000..5222afb3 --- /dev/null +++ b/features/security/security-arm64.cfg @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: MIT + +# Make sure PAN emulation is enabled. +CONFIG_ARM64_SW_TTBR0_PAN=y + +# Enable Kernel Page Table Isolation to remove an entire class of cache timing side-channels. +CONFIG_UNMAP_KERNEL_AT_EL0=y + +# Software Shadow Stack or PAC +CONFIG_SHADOW_CALL_STACK=y + +# Pointer authentication (ARMv8.3 and later). If hardware actually supports it, one can +# turn off CONFIG_STACKPROTECTOR_STRONG with this enabled. +CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_PTR_AUTH_KERNEL=y + +# Available in ARMv8.5 and later. +CONFIG_ARM64_BTI=y +CONFIG_ARM64_BTI_KERNEL=y +CONFIG_ARM64_MTE=y +CONFIG_KASAN_HW_TAGS=y +CONFIG_ARM64_E0PD=y + +# Available in ARMv8.7 and later. +CONFIG_ARM64_EPAN=y + +# Enable Control Flow Integrity +CONFIG_CFI_CLANG=y +# CONFIG_CFI_PERMISSIVE is not set diff --git a/features/security/security-x86_64.cfg b/features/security/security-x86_64.cfg new file mode 100644 index 00000000..1c12034a --- /dev/null +++ b/features/security/security-x86_64.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +# Modern libc no longer needs a fixed-position mapping in userspace, remove it as a possible target. +CONFIG_LEGACY_VSYSCALL_NONE=y diff --git a/features/security/security.cfg b/features/security/security.cfg index 475b647e..336adcc4 100644 --- a/features/security/security.cfg +++ b/features/security/security.cfg @@ -1,7 +1,6 @@ # SPDX-License-Identifier: MIT # Protect against ioctl buffer overflows CONFIG_HARDENED_USERCOPY=y -# CONFIG_HARDENED_USERCOPY_FALLBACK is not set # Check for memory copies that might overflow a structure in str*() and mem*() # functions both at build-time and run-time @@ -16,27 +15,23 @@ CONFIG_STACKPROTECTOR=y CONFIG_STACKPROTECTOR_STRONG=y # Disable to ensure random heap placement to make exploits harder -# CONFIG_COMPAT_BRK is not set +CONFIG_COMPAT_BRK=n # Disable; exposes kernel text image layout -# CONFIG_PROC_KCORE is not set +CONFIG_PROC_KCORE=n # Increases the low-level kernel attack surface. Disable it instead. # Removes the modify_ldt system call. CONFIG_EXPERT=y CONFIG_MODIFY_LDT_SYSCALL=n -# Modern libc no longer needs a fixed-position mapping in userspace, remove it as a possible target. -# CONFIG_LEGACY_VSYSCALL_EMULATE is not set -CONFIG_LEGACY_VSYSCALL_NONE=y - # Prior to v4.1, assists heap memory attacks; best to keep interface disabled. -# CONFIG_INET_DIAG is not set +CONFIG_INET_DIAG=n # Do not allow direct physical memory access (enable only STRICT mode...) # Note that drivers like uvesafb/v86d depending on direct physical memory # access would be affected. -# CONFIG_DEVMEM is not set +CONFIG_DEVMEM=y CONFIG_STRICT_DEVMEM=y CONFIG_IO_STRICT_DEVMEM=y @@ -45,7 +40,6 @@ CONFIG_SCHED_STACK_END_CHECK=y CONFIG_DEBUG_LIST=y CONFIG_DEBUG_SG=y CONFIG_DEBUG_NOTIFIERS=y -CONFIG_DEBUG_CREDENTIALS=y # Information exposure CONFIG_PAGE_POISONING=y @@ -61,3 +55,15 @@ CONFIG_STRICT_MODULE_RWX=y # Meltdown and Spectre CONFIG_PAGE_TABLE_ISOLATION=y CONFIG_RETPOLINE=y + +# Exposing the TPM's Random Number Generator as a hwrng device. +CONFIG_HW_RANDOM_TPM=y + +# Warn on W+X mappings at boot +CONFIG_DEBUG_WX=y + +# Restrict unprivileged access to the kernel syslog +CONFIG_SECURITY_DMESG_RESTRICT=y + +# The kernel will automatically load the module of any line dicipline that is asked for. +CONFIG_LDISC_AUTOLOAD=n diff --git a/features/security/security.scc b/features/security/security.scc index 4abdf457..f3a651c0 100644 --- a/features/security/security.scc +++ b/features/security/security.scc @@ -3,3 +3,11 @@ define KFEATURE_DESCRIPTION "Enable/disable configurations that impact kernel se define KFEATURE_COMPATIBILITY all kconf non-hardware security.cfg + +if [ "$KARCH" = "x86_64" ]; then + kconf non-hardware security-x86_64.cfg +fi + +if [ "$KARCH" = "arm64" ]; then + kconf non-hardware security-arm64.cfg +fi diff --git a/features/soc/baytrail/baytrail.cfg b/features/soc/baytrail/baytrail.cfg index 390ef51b..c1b1120a 100644 --- a/features/soc/baytrail/baytrail.cfg +++ b/features/soc/baytrail/baytrail.cfg @@ -14,7 +14,6 @@ CONFIG_X86_INTEL_LPSS=y # GPIO Support CONFIG_GPIOLIB=y -CONFIG_GPIO_SYSFS=y CONFIG_SERIAL_8250_DW=y diff --git a/features/soc/broxton/broxton.cfg b/features/soc/broxton/broxton.cfg index 15154ba2..4a760f6b 100644 --- a/features/soc/broxton/broxton.cfg +++ b/features/soc/broxton/broxton.cfg @@ -15,7 +15,6 @@ CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_INTEL_IDMA64=y # GPIO support -CONFIG_GPIO_SYSFS=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y diff --git a/features/sound/intel-snd-sof.cfg b/features/sound/intel-snd-sof.cfg new file mode 100644 index 00000000..5efcd0c8 --- /dev/null +++ b/features/sound/intel-snd-sof.cfg @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: MIT +CONFIG_SOUNDWIRE=m +CONFIG_SND_SOC=m +CONFIG_SND_SOC_SOF_TOPLEVEL=y +CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y +CONFIG_SND_SOC_SOF_PCI=m +CONFIG_SND_SOC_SOF_ALDERLAKE=m +CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE=m +CONFIG_SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES=y +CONFIG_SND_SOC_INTEL_SOUNDWIRE_SOF_MACH=m +CONFIG_SND_SOC_SOF_HDA_LINK=y +CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y diff --git a/features/sound/intel-snd-sof.scc b/features/sound/intel-snd-sof.scc new file mode 100644 index 00000000..85632930 --- /dev/null +++ b/features/sound/intel-snd-sof.scc @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable Intel Sound Open Firmware(SOF) support for Intel audio DSPs" + +kconf hardware intel-snd-sof.cfg diff --git a/features/thermal/coretemp-x86_64.cfg b/features/thermal/coretemp-x86_64.cfg new file mode 100644 index 00000000..4a34163a --- /dev/null +++ b/features/thermal/coretemp-x86_64.cfg @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# ACPI INT340X thermal drivers +CONFIG_INT340X_THERMAL=m + diff --git a/features/thermal/coretemp.cfg b/features/thermal/coretemp.cfg index efe4654b..1b89b549 100644 --- a/features/thermal/coretemp.cfg +++ b/features/thermal/coretemp.cfg @@ -8,9 +8,6 @@ CONFIG_SENSORS_CORETEMP=m # Intel SoCs DTS thermal driver CONFIG_INTEL_SOC_DTS_THERMAL=m -# ACPI INT340X thermal drivers -CONFIG_INT340X_THERMAL=m - # Intel PowerClamp idle injection driver CONFIG_INTEL_POWERCLAMP=m diff --git a/features/thermal/coretemp.scc b/features/thermal/coretemp.scc index 272d5578..ded07295 100644 --- a/features/thermal/coretemp.scc +++ b/features/thermal/coretemp.scc @@ -3,3 +3,7 @@ define KFEATURE_DESCRIPTION "Coretemp support for Intel platforms" define KFEATURE_COMPATIBILITY board kconf hardware coretemp.cfg +if [ "$KARCH" = "x86_64" ] ; then + kconf hardware coretemp-x86_64.cfg +fi + diff --git a/features/tpm/tpm-1.2.cfg b/features/tpm/tpm-1.2.cfg new file mode 100644 index 00000000..d1fcf98c --- /dev/null +++ b/features/tpm/tpm-1.2.cfg @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +# Enable TPM 1.2 device drivers. +CONFIG_TCG_TIS_I2C_ATMEL=y +CONFIG_TCG_TIS_I2C_INFINEON=y +CONFIG_TCG_TIS_I2C_NUVOTON=y +CONFIG_TCG_NSC=y +CONFIG_TCG_ATMEL=y +CONFIG_TCG_INFINEON=y +CONFIG_TCG_TIS_ST33ZP24=y +CONFIG_TCG_TIS_ST33ZP24_I2C=y +CONFIG_TCG_TIS_ST33ZP24_SPI=y
\ No newline at end of file diff --git a/features/tpm/tpm-1.2.scc b/features/tpm/tpm-1.2.scc new file mode 100644 index 00000000..74900486 --- /dev/null +++ b/features/tpm/tpm-1.2.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable TCG TPM (Trusted Computing Group Trusted Platform Module) 1.2 drivers" +define KFEATURE_COMPATIBILITY board + +include tpm-common.scc + +kconf hardware tpm-1.2.cfg diff --git a/features/tpm/tpm-2.0-crb.cfg b/features/tpm/tpm-2.0-crb.cfg new file mode 100644 index 00000000..27a1ba25 --- /dev/null +++ b/features/tpm/tpm-2.0-crb.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +# Enable TPM device drivers. +CONFIG_TCG_CRB=y diff --git a/features/tpm/tpm-2.0-crb.scc b/features/tpm/tpm-2.0-crb.scc new file mode 100644 index 00000000..1274b3c7 --- /dev/null +++ b/features/tpm/tpm-2.0-crb.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable TCG CRB TPM (Trusted Computing Group Command Response Buffer Trusted Platform Module) 2.0 driver" +define KFEATURE_COMPATIBILITY board + +include tpm-common.scc + +kconf hardware tpm-2.0-crb.cfg diff --git a/features/tpm/tpm-2.0.cfg b/features/tpm/tpm-2.0.cfg new file mode 100644 index 00000000..9f427afa --- /dev/null +++ b/features/tpm/tpm-2.0.cfg @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# Enable TPM device drivers. +CONFIG_SPI=y +CONFIG_TCG_TIS_SPI=y diff --git a/features/tpm/tpm-2.0.scc b/features/tpm/tpm-2.0.scc new file mode 100644 index 00000000..83440f8b --- /dev/null +++ b/features/tpm/tpm-2.0.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable TCG TPM (Trusted Computing Group Trusted Platform Module) 2.0 drivers" +define KFEATURE_COMPATIBILITY board + +include tpm-common.scc + +kconf hardware tpm-2.0.cfg diff --git a/features/tpm/tpm-common.cfg b/features/tpm/tpm-common.cfg new file mode 100644 index 00000000..7e2ea6c1 --- /dev/null +++ b/features/tpm/tpm-common.cfg @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +# Enable TPM hardware support. +CONFIG_TCG_TPM=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_TPM=y +CONFIG_TCG_TIS_CORE=y +CONFIG_TCG_TIS=y diff --git a/features/tpm/tpm-common.scc b/features/tpm/tpm-common.scc new file mode 100644 index 00000000..31a070c0 --- /dev/null +++ b/features/tpm/tpm-common.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable common TCG TPM (Trusted Computing Group Trusted Platform Module) features" +define KFEATURE_COMPATIBILITY board + +kconf hardware tpm-common.cfg diff --git a/features/tpm/tpm.cfg b/features/tpm/tpm.cfg deleted file mode 100644 index ea10c1fb..00000000 --- a/features/tpm/tpm.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: MIT -# Enable TPM device drivers. -CONFIG_TCG_TPM=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_TPM=y -CONFIG_TCG_TIS_CORE=y -CONFIG_TCG_TIS=y -CONFIG_SPI=y -CONFIG_TCG_TIS_SPI=y -CONFIG_TCG_TIS_I2C_ATMEL=y -CONFIG_TCG_TIS_I2C_INFINEON=y -CONFIG_TCG_TIS_I2C_NUVOTON=y -CONFIG_TCG_NSC=y -CONFIG_TCG_ATMEL=y -CONFIG_TCG_INFINEON=y -CONFIG_TCG_CRB=y -CONFIG_TCG_VTPM_PROXY=y -CONFIG_TCG_TIS_ST33ZP24=y -CONFIG_TCG_TIS_ST33ZP24_I2C=y -CONFIG_TCG_TIS_ST33ZP24_SPI=y diff --git a/features/tpm/tpm.scc b/features/tpm/tpm.scc index a1435480..1f3ba9cf 100644 --- a/features/tpm/tpm.scc +++ b/features/tpm/tpm.scc @@ -1,5 +1,9 @@ # SPDX-License-Identifier: MIT -define KFEATURE_DESCRIPTION "Enable TCG TPM driver (Trusted Computing Group Trusted Platform Module)" +define KFEATURE_DESCRIPTION "Enable TCG TPM (Trusted Computing Group Trusted Platform Module) drivers" define KFEATURE_COMPATIBILITY board -kconf hardware tpm.cfg +include tpm-common.scc +include tpm-1.2.scc +include tpm-2.0.scc +include tpm-2.0-crb.scc +include vtpm.scc diff --git a/features/tpm/vtpm.cfg b/features/tpm/vtpm.cfg new file mode 100644 index 00000000..eeb58e96 --- /dev/null +++ b/features/tpm/vtpm.cfg @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +# Enable vTPM device drivers. +CONFIG_TCG_VTPM_PROXY=y diff --git a/features/tpm/vtpm.scc b/features/tpm/vtpm.scc new file mode 100644 index 00000000..e927ffb6 --- /dev/null +++ b/features/tpm/vtpm.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable virtual TCG TPM (Trusted Computing Group Trusted Platform Module) proxy driver" +define KFEATURE_COMPATIBILITY board + +include tpm-common.scc + +kconf hardware vtpm.cfg diff --git a/bsp/intel-x86/intel-x86-hugepage.cfg b/features/transparent-hugepage/transparent-hugepage.cfg index 1367b519..5079bf3f 100644 --- a/bsp/intel-x86/intel-x86-hugepage.cfg +++ b/features/transparent-hugepage/transparent-hugepage.cfg @@ -1,3 +1,6 @@ # SPDX-License-Identifier: MIT +# +# Memory Management options +# CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y diff --git a/features/transparent-hugepage/transparent-hugepage.scc b/features/transparent-hugepage/transparent-hugepage.scc new file mode 100644 index 00000000..3cad4b3a --- /dev/null +++ b/features/transparent-hugepage/transparent-hugepage.scc @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Transparent Hugepage Support" + +kconf hardware transparent-hugepage.cfg diff --git a/features/tsn/tsn.cfg b/features/tsn/tsn.cfg new file mode 100644 index 00000000..c0cac7db --- /dev/null +++ b/features/tsn/tsn.cfg @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +CONFIG_NET_SCH_ETF=m +CONFIG_NET_SCH_CBS=m +CONFIG_NET_SCH_MQPRIO=m +CONFIG_NET_SCH_TAPRIO=m diff --git a/features/tsn/tsn.scc b/features/tsn/tsn.scc new file mode 100644 index 00000000..0f33451e --- /dev/null +++ b/features/tsn/tsn.scc @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable Time-Sensitive Networking support" +kconf non-hardware tsn.cfg diff --git a/features/tun/tun.cfg b/features/tun/tun.cfg new file mode 100644 index 00000000..b45d3e9b --- /dev/null +++ b/features/tun/tun.cfg @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# dependency +CONFIG_INET=y + +CONFIG_TUN=y diff --git a/features/tun/tun.scc b/features/tun/tun.scc new file mode 100644 index 00000000..5a4cc3bc --- /dev/null +++ b/features/tun/tun.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable universal TUN/TAP device driver support" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware tun.cfg diff --git a/features/usb/usb-dummy-hcd.cfg b/features/usb/usb-dummy-hcd.cfg new file mode 100644 index 00000000..ab7c2143 --- /dev/null +++ b/features/usb/usb-dummy-hcd.cfg @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +CONFIG_USB_DUMMY_HCD=y diff --git a/features/usb/usb-dummy-hcd.scc b/features/usb/usb-dummy-hcd.scc new file mode 100644 index 00000000..6684ed9c --- /dev/null +++ b/features/usb/usb-dummy-hcd.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable emulated USB host and device support (dummy HCD)" +define KFEATURE_COMPATIBILITY all + +include usb-base.scc + +kconf non-hardware usb-dummy-hcd.cfg diff --git a/features/usb/usb-raw-gadget.cfg b/features/usb/usb-raw-gadget.cfg new file mode 100644 index 00000000..6e169ab5 --- /dev/null +++ b/features/usb/usb-raw-gadget.cfg @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# dependency +CONFIG_USB_GADGET=y + +CONFIG_USB_RAW_GADGET=y diff --git a/features/usb/usb-raw-gadget.scc b/features/usb/usb-raw-gadget.scc new file mode 100644 index 00000000..9f0c2eb8 --- /dev/null +++ b/features/usb/usb-raw-gadget.scc @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Enable USB raw gadget" +define KFEATURE_COMPATIBILITY all + +include usb-base.scc + +kconf non-hardware usb-raw-gadget.cfg diff --git a/features/usb/usb-typec.cfg b/features/usb/usb-typec.cfg index eab0a77e..3c5a2312 100644 --- a/features/usb/usb-typec.cfg +++ b/features/usb/usb-typec.cfg @@ -7,3 +7,5 @@ CONFIG_MFD_INTEL_PMC_BXT=m # Intel WhiskeyCove PMIC USB Type-C PHY driver CONFIG_TYPEC_WCOVE=m + +CONFIG_TYPEC_TCPCI=m diff --git a/features/vdso/vdso.cfg b/features/vdso/vdso.cfg index 9b1cdd3d..ba84655b 100644 --- a/features/vdso/vdso.cfg +++ b/features/vdso/vdso.cfg @@ -1,2 +1,2 @@ # SPDX-License-Identifier: MIT -# CONFIG_COMPAT_VDSO is not set +CONFIG_COMPAT_VDSO=n diff --git a/features/vfat/fat-Replace-prandom_u32-with-get_random_u32.patch b/features/vfat/fat-Replace-prandom_u32-with-get_random_u32.patch new file mode 100644 index 00000000..3d4b8092 --- /dev/null +++ b/features/vfat/fat-Replace-prandom_u32-with-get_random_u32.patch @@ -0,0 +1,40 @@ +From 0b07d2478b6baf627d000f7f1901b148f2a6dfc2 Mon Sep 17 00:00:00 2001 +From: Kevin Hao <kexin.hao@windriver.com> +Date: Fri, 7 Apr 2023 21:03:41 +0800 +Subject: [PATCH] fat: Replace prandom_u32() with get_random_u32() + +The prandom_u32() is just wrapper of get_random_u32() and has been +removed by commit de492c83cae0 ("prandom: remove unused functions"). +So use get_random_u32() directly. + +Signed-off-by: Kevin Hao <kexin.hao@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/fat/namei_vfat.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c +index ef5cf74789ca..ef79a242751d 100644 +--- a/fs/fat/namei_vfat.c ++++ b/fs/fat/namei_vfat.c +@@ -616,7 +616,7 @@ static void vfat_build_dummy_83_buffer(struct inode *dir, char *msdos_name, + 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x22, 0x2a, + 0x3a, 0x3c, 0x3e, 0x3f, 0x5b, 0x5d, 0x7c }; + int i, tilde_pos, slash_pos; +- u32 rand_num = prandom_u32(); ++ u32 rand_num = get_random_u32(); + + /* We need a '~' in the prefix to make Win98 happy. */ + tilde_pos = rand_num % 8; +@@ -651,7 +651,7 @@ static void vfat_build_dummy_83_buffer(struct inode *dir, char *msdos_name, + invalidchar[rand_num % sizeof(invalidchar)]; + rand_num /= sizeof(invalidchar); + if (rand_num < sizeof(invalidchar)) +- rand_num = prandom_u32(); ++ rand_num = get_random_u32(); + } + } + } +-- +2.34.1 + diff --git a/features/vfat/vfat.scc b/features/vfat/vfat.scc index cfe1c7d9..24ec7dfd 100644 --- a/features/vfat/vfat.scc +++ b/features/vfat/vfat.scc @@ -3,3 +3,4 @@ patch FAT-Add-CONFIG_VFAT_FS_NO_DUALNAMES-option.patch patch FAT-Add-CONFIG_VFAT_NO_CREATE_WITH_LONGNAMES-option.patch patch FAT-Added-FAT_NO_83NAME.patch patch fat-don-t-use-obsolete-random32-call-in-namei_vfat.patch +patch fat-Replace-prandom_u32-with-get_random_u32.patch diff --git a/features/vfio/vfio.cfg b/features/vfio/vfio.cfg index 267fbaf8..94991365 100644 --- a/features/vfio/vfio.cfg +++ b/features/vfio/vfio.cfg @@ -1,6 +1,5 @@ # SPDX-License-Identifier: MIT CONFIG_VFIO_IOMMU_TYPE1=m -CONFIG_VFIO_VIRQFD=m CONFIG_VFIO=m CONFIG_VFIO_PCI=m CONFIG_VFIO_PCI_VGA=y diff --git a/features/wifi/ralink-pci.cfg b/features/wifi/ralink-pci.cfg index b4639ea0..c7e95040 100644 --- a/features/wifi/ralink-pci.cfg +++ b/features/wifi/ralink-pci.cfg @@ -10,7 +10,7 @@ CONFIG_RT2500PCI=m CONFIG_RT61PCI=m CONFIG_RT2800PCI=m CONFIG_RT2800PCI_RT33XX=y -config RT2800PCI_RT35XX=y -config RT2800PCI_RT53XX=y -config RT2800PCI_RT3290=y +CONFIG_RT2800PCI_RT35XX=y +CONFIG_RT2800PCI_RT53XX=y +CONFIG_RT2800PCI_RT3290=y diff --git a/features/x2apic/x2apic.cfg b/features/x2apic/x2apic.cfg index ca91dc0d..8efa10f8 100644 --- a/features/x2apic/x2apic.cfg +++ b/features/x2apic/x2apic.cfg @@ -1,3 +1,5 @@ # SPDX-License-Identifier: MIT + +CONFIG_IOMMU_SUPPORT=y CONFIG_IRQ_REMAP=y CONFIG_X86_X2APIC=y diff --git a/features/xen/xen-x86.cfg b/features/xen/xen-x86.cfg new file mode 100644 index 00000000..69fcd731 --- /dev/null +++ b/features/xen/xen-x86.cfg @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT + +CONFIG_HYPERVISOR_GUEST=y +CONFIG_PCI_XEN=y +CONFIG_XEN_ACPI_PROCESSOR=m +CONFIG_XEN_DEBUG_FS=n +CONFIG_XEN_MCE_LOG=y +CONFIG_XEN_PCIDEV_BACKEND=m +CONFIG_XEN_PCIDEV_FRONTEND=y +CONFIG_XEN_PVHVM=y +CONFIG_XEN_SAVE_RESTORE=y diff --git a/features/xen/xen.cfg b/features/xen/xen.cfg index 50d5e462..7da87825 100644 --- a/features/xen/xen.cfg +++ b/features/xen/xen.cfg @@ -1,14 +1,8 @@ -CONFIG_HYPERVISOR_GUEST=y CONFIG_PARAVIRT=y CONFIG_XEN=y CONFIG_XEN_DOM0=y -CONFIG_XEN_PVHVM=y -CONFIG_XEN_SAVE_RESTORE=y -# CONFIG_XEN_DEBUG_FS is not set CONFIG_MMU_NOTIFIER=y CONFIG_HIBERNATE_CALLBACKS=y -CONFIG_PCI_XEN=y -CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_SYS_HYPERVISOR=y CONFIG_XEN_BLKDEV_FRONTEND=y CONFIG_XEN_BLKDEV_BACKEND=m @@ -28,7 +22,7 @@ CONFIG_FB_SYS_FOPS=y CONFIG_FB_DEFERRED_IO=y CONFIG_XEN_FBDEV_FRONTEND=y CONFIG_XEN_BALLOON=y -CONFIG_XEN_SCRUB_PAGES=y +CONFIG_XEN_SCRUB_PAGES_DEFAULT=y CONFIG_XEN_DEV_EVTCHN=y CONFIG_XEN_BACKEND=y CONFIG_XENFS=y @@ -38,8 +32,7 @@ CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XEN_GNTDEV=m CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_SWIOTLB_XEN=y -CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_PRIVCMD=y -CONFIG_XEN_ACPI_PROCESSOR=m -CONFIG_XEN_MCE_LOG=y CONFIG_XEN_HAVE_PVMMU=y +CONFIG_XEN_PVCALLS_FRONTEND=y +CONFIG_XEN_PVCALLS_BACKEND=y diff --git a/features/xen/xen.scc b/features/xen/xen.scc index b588e5df..e7c85a1b 100644 --- a/features/xen/xen.scc +++ b/features/xen/xen.scc @@ -2,3 +2,7 @@ define KFEATURE_DESCRIPTION "Xen Kernel Support" define KFEATURE_COMPATIBILITY arch kconf non-hardware xen.cfg + +if [ "$KARCH" = "x86_64" ] || [ "$KARCH" = "i386" ]; then + kconf non-hardware xen-x86.cfg +fi diff --git a/features/xilinx/hdmi-module/hdmi-module.cfg b/features/xilinx/hdmi-module/hdmi-module.cfg index 22290c6e..b0117515 100644 --- a/features/xilinx/hdmi-module/hdmi-module.cfg +++ b/features/xilinx/hdmi-module/hdmi-module.cfg @@ -1,27 +1,27 @@ # SPDX-License-Identifier: MIT -# CONFIG_VIDEO_TDA1997X is not set +CONFIG_VIDEO_TDA1997X=n CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_JACK=y CONFIG_SND_JACK_INPUT_DEV=y -# CONFIG_SND_OSSEMUL is not set +CONFIG_SND_OSSEMUL=n CONFIG_SND_PCM_TIMER=y -# CONFIG_SND_HRTIMER is not set -# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_HRTIMER=n +CONFIG_SND_DYNAMIC_MINORS=n CONFIG_SND_SUPPORT_OLD_API=y CONFIG_SND_PROC_FS=y CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_SEQUENCER is not set +CONFIG_SND_VERBOSE_PRINTK=n +CONFIG_SND_DEBUG=n +CONFIG_SND_SEQUENCER=n CONFIG_SND_DRIVERS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_ALOOP is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set +CONFIG_SND_DUMMY=n +CONFIG_SND_ALOOP=n +CONFIG_SND_MTPAV=n +CONFIG_SND_SERIAL_U16550=n +CONFIG_SND_MPU401=n # # HD-Audio @@ -31,20 +31,20 @@ CONFIG_SND_DRIVERS=y CONFIG_SND_HDA_PREALLOC_SIZE=64 CONFIG_SND_SPI=y CONFIG_SND_USB=y -# CONFIG_SND_USB_AUDIO is not set -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_6FIRE is not set -# CONFIG_SND_USB_HIFACE is not set -# CONFIG_SND_BCD2000 is not set -# CONFIG_SND_USB_POD is not set -# CONFIG_SND_USB_PODHD is not set -# CONFIG_SND_USB_TONEPORT is not set -# CONFIG_SND_USB_VARIAX is not set +CONFIG_SND_USB_AUDIO=n +CONFIG_SND_USB_UA101=n +CONFIG_SND_USB_CAIAQ=n +CONFIG_SND_USB_6FIRE=n +CONFIG_SND_USB_HIFACE=n +CONFIG_SND_BCD2000=n +CONFIG_SND_USB_POD=n +CONFIG_SND_USB_PODHD=n +CONFIG_SND_USB_TONEPORT=n +CONFIG_SND_USB_VARIAX=n CONFIG_SND_SOC=y -# CONFIG_SND_SOC_AMD_ACP is not set -# CONFIG_SND_ATMEL_SOC is not set -# CONFIG_SND_DESIGNWARE_I2S is not set +CONFIG_SND_SOC_AMD_ACP=n +CONFIG_SND_ATMEL_SOC=n +CONFIG_SND_DESIGNWARE_I2S=n # # SoC Audio for Freescale CPUs @@ -53,172 +53,172 @@ CONFIG_SND_SOC=y # # Common SoC Audio options for Freescale CPUs: # -# CONFIG_SND_SOC_FSL_ASRC is not set -# CONFIG_SND_SOC_FSL_SAI is not set -# CONFIG_SND_SOC_FSL_AUDMIX is not set -# CONFIG_SND_SOC_FSL_SSI is not set -# CONFIG_SND_SOC_FSL_SPDIF is not set -# CONFIG_SND_SOC_FSL_ESAI is not set -# CONFIG_SND_SOC_FSL_MICFIL is not set -# CONFIG_SND_SOC_IMX_AUDMUX is not set +CONFIG_SND_SOC_FSL_ASRC=n +CONFIG_SND_SOC_FSL_SAI=n +CONFIG_SND_SOC_FSL_AUDMIX=n +CONFIG_SND_SOC_FSL_SSI=n +CONFIG_SND_SOC_FSL_SPDIF=n +CONFIG_SND_SOC_FSL_ESAI=n +CONFIG_SND_SOC_FSL_MICFIL=n +CONFIG_SND_SOC_IMX_AUDMUX=n # end of SoC Audio for Freescale CPUs -# CONFIG_SND_I2S_HI6210_I2S is not set -# CONFIG_SND_SOC_IMG is not set -# CONFIG_SND_SOC_MTK_BTCVSD is not set -# CONFIG_SND_SOC_SOF_TOPLEVEL is not set +CONFIG_SND_I2S_HI6210_I2S=n +CONFIG_SND_SOC_IMG=n +CONFIG_SND_SOC_MTK_BTCVSD=n +CONFIG_SND_SOC_SOF_TOPLEVEL=n # # STMicroelectronics STM32 SOC audio support # # end of STMicroelectronics STM32 SOC audio support -# CONFIG_SND_SOC_XILINX_DP is not set -# CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER is not set -# CONFIG_SND_SOC_XILINX_SDI is not set -# CONFIG_SND_SOC_XILINX_I2S is not set -# CONFIG_SND_SOC_XILINX_SPDIF is not set -# CONFIG_SND_SOC_XTFPGA_I2S is not set -# CONFIG_ZX_TDM is not set +CONFIG_SND_SOC_XILINX_DP=n +CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER=n +CONFIG_SND_SOC_XILINX_SDI=n +CONFIG_SND_SOC_XILINX_I2S=n +CONFIG_SND_SOC_XILINX_SPDIF=n +CONFIG_SND_SOC_XTFPGA_I2S=n +CONFIG_ZX_TDM=n CONFIG_SND_SOC_I2C_AND_SPI=y # # CODEC drivers # -# CONFIG_SND_SOC_AC97_CODEC is not set -# CONFIG_SND_SOC_ADAU1701 is not set -# CONFIG_SND_SOC_ADAU1761_I2C is not set -# CONFIG_SND_SOC_ADAU1761_SPI is not set -# CONFIG_SND_SOC_ADAU7002 is not set -# CONFIG_SND_SOC_AK4104 is not set -# CONFIG_SND_SOC_AK4118 is not set -# CONFIG_SND_SOC_AK4458 is not set -# CONFIG_SND_SOC_AK4554 is not set -# CONFIG_SND_SOC_AK4613 is not set -# CONFIG_SND_SOC_AK4642 is not set -# CONFIG_SND_SOC_AK5386 is not set -# CONFIG_SND_SOC_AK5558 is not set -# CONFIG_SND_SOC_ALC5623 is not set -# CONFIG_SND_SOC_BD28623 is not set -# CONFIG_SND_SOC_BT_SCO is not set -# CONFIG_SND_SOC_CS35L32 is not set -# CONFIG_SND_SOC_CS35L33 is not set -# CONFIG_SND_SOC_CS35L34 is not set -# CONFIG_SND_SOC_CS35L35 is not set -# CONFIG_SND_SOC_CS35L36 is not set -# CONFIG_SND_SOC_CS42L42 is not set -# CONFIG_SND_SOC_CS42L51_I2C is not set -# CONFIG_SND_SOC_CS42L52 is not set -# CONFIG_SND_SOC_CS42L56 is not set -# CONFIG_SND_SOC_CS42L73 is not set -# CONFIG_SND_SOC_CS4265 is not set -# CONFIG_SND_SOC_CS4270 is not set -# CONFIG_SND_SOC_CS4271_I2C is not set -# CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS43130 is not set -# CONFIG_SND_SOC_CS4341 is not set -# CONFIG_SND_SOC_CS4349 is not set -# CONFIG_SND_SOC_CS53L30 is not set -# CONFIG_SND_SOC_CX2072X is not set -# CONFIG_SND_SOC_DMIC is not set -# CONFIG_SND_SOC_ES7134 is not set -# CONFIG_SND_SOC_ES7241 is not set -# CONFIG_SND_SOC_ES8316 is not set -# CONFIG_SND_SOC_ES8328_I2C is not set -# CONFIG_SND_SOC_ES8328_SPI is not set -# CONFIG_SND_SOC_GTM601 is not set -# CONFIG_SND_SOC_INNO_RK3036 is not set -# CONFIG_SND_SOC_MAX98088 is not set -# CONFIG_SND_SOC_MAX98357A is not set -# CONFIG_SND_SOC_MAX98504 is not set -# CONFIG_SND_SOC_MAX9867 is not set -# CONFIG_SND_SOC_MAX98927 is not set -# CONFIG_SND_SOC_MAX98373 is not set -# CONFIG_SND_SOC_MAX9860 is not set -# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set -# CONFIG_SND_SOC_PCM1681 is not set -# CONFIG_SND_SOC_PCM1789_I2C is not set -# CONFIG_SND_SOC_PCM179X_I2C is not set -# CONFIG_SND_SOC_PCM179X_SPI is not set -# CONFIG_SND_SOC_PCM186X_I2C is not set -# CONFIG_SND_SOC_PCM186X_SPI is not set -# CONFIG_SND_SOC_PCM3060_I2C is not set -# CONFIG_SND_SOC_PCM3060_SPI is not set -# CONFIG_SND_SOC_PCM3168A_I2C is not set -# CONFIG_SND_SOC_PCM3168A_SPI is not set -# CONFIG_SND_SOC_PCM512x_I2C is not set -# CONFIG_SND_SOC_PCM512x_SPI is not set -# CONFIG_SND_SOC_RK3328 is not set -# CONFIG_SND_SOC_RT5616 is not set -# CONFIG_SND_SOC_RT5631 is not set -# CONFIG_SND_SOC_SGTL5000 is not set -# CONFIG_SND_SOC_SIMPLE_AMPLIFIER is not set -# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set -# CONFIG_SND_SOC_SPDIF is not set -# CONFIG_SND_SOC_SSM2305 is not set -# CONFIG_SND_SOC_SSM2602_SPI is not set -# CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM4567 is not set -# CONFIG_SND_SOC_STA32X is not set -# CONFIG_SND_SOC_STA350 is not set -# CONFIG_SND_SOC_STI_SAS is not set -# CONFIG_SND_SOC_TAS2552 is not set -# CONFIG_SND_SOC_TAS5086 is not set -# CONFIG_SND_SOC_TAS571X is not set -# CONFIG_SND_SOC_TAS5720 is not set -# CONFIG_SND_SOC_TAS6424 is not set -# CONFIG_SND_SOC_TDA7419 is not set -# CONFIG_SND_SOC_TFA9879 is not set -# CONFIG_SND_SOC_TLV320AIC23_I2C is not set -# CONFIG_SND_SOC_TLV320AIC23_SPI is not set -# CONFIG_SND_SOC_TLV320AIC31XX is not set -# CONFIG_SND_SOC_TLV320AIC32X4_I2C is not set -# CONFIG_SND_SOC_TLV320AIC32X4_SPI is not set -# CONFIG_SND_SOC_TLV320AIC3X is not set -# CONFIG_SND_SOC_TS3A227E is not set -# CONFIG_SND_SOC_TSCS42XX is not set -# CONFIG_SND_SOC_TSCS454 is not set -# CONFIG_SND_SOC_UDA1334 is not set -# CONFIG_SND_SOC_WM8510 is not set -# CONFIG_SND_SOC_WM8523 is not set -# CONFIG_SND_SOC_WM8524 is not set -# CONFIG_SND_SOC_WM8580 is not set -# CONFIG_SND_SOC_WM8711 is not set -# CONFIG_SND_SOC_WM8728 is not set -# CONFIG_SND_SOC_WM8731 is not set -# CONFIG_SND_SOC_WM8737 is not set -# CONFIG_SND_SOC_WM8741 is not set -# CONFIG_SND_SOC_WM8750 is not set -# CONFIG_SND_SOC_WM8753 is not set -# CONFIG_SND_SOC_WM8770 is not set -# CONFIG_SND_SOC_WM8776 is not set -# CONFIG_SND_SOC_WM8782 is not set -# CONFIG_SND_SOC_WM8804_I2C is not set -# CONFIG_SND_SOC_WM8804_SPI is not set -# CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8904 is not set -# CONFIG_SND_SOC_WM8960 is not set -# CONFIG_SND_SOC_WM8962 is not set -# CONFIG_SND_SOC_WM8974 is not set -# CONFIG_SND_SOC_WM8978 is not set -# CONFIG_SND_SOC_WM8985 is not set -# CONFIG_SND_SOC_ZX_AUD96P22 is not set -# CONFIG_SND_SOC_MAX9759 is not set -# CONFIG_SND_SOC_MT6351 is not set -# CONFIG_SND_SOC_MT6358 is not set -# CONFIG_SND_SOC_NAU8540 is not set -# CONFIG_SND_SOC_NAU8810 is not set -# CONFIG_SND_SOC_NAU8822 is not set -# CONFIG_SND_SOC_NAU8824 is not set -# CONFIG_SND_SOC_TPA6130A2 is not set +CONFIG_SND_SOC_AC97_CODEC=n +CONFIG_SND_SOC_ADAU1701=n +CONFIG_SND_SOC_ADAU1761_I2C=n +CONFIG_SND_SOC_ADAU1761_SPI=n +CONFIG_SND_SOC_ADAU7002=n +CONFIG_SND_SOC_AK4104=n +CONFIG_SND_SOC_AK4118=n +CONFIG_SND_SOC_AK4458=n +CONFIG_SND_SOC_AK4554=n +CONFIG_SND_SOC_AK4613=n +CONFIG_SND_SOC_AK4642=n +CONFIG_SND_SOC_AK5386=n +CONFIG_SND_SOC_AK5558=n +CONFIG_SND_SOC_ALC5623=n +CONFIG_SND_SOC_BD28623=n +CONFIG_SND_SOC_BT_SCO=n +CONFIG_SND_SOC_CS35L32=n +CONFIG_SND_SOC_CS35L33=n +CONFIG_SND_SOC_CS35L34=n +CONFIG_SND_SOC_CS35L35=n +CONFIG_SND_SOC_CS35L36=n +CONFIG_SND_SOC_CS42L42=n +CONFIG_SND_SOC_CS42L51_I2C=n +CONFIG_SND_SOC_CS42L52=n +CONFIG_SND_SOC_CS42L56=n +CONFIG_SND_SOC_CS42L73=n +CONFIG_SND_SOC_CS4265=n +CONFIG_SND_SOC_CS4270=n +CONFIG_SND_SOC_CS4271_I2C=n +CONFIG_SND_SOC_CS4271_SPI=n +CONFIG_SND_SOC_CS42XX8_I2C=n +CONFIG_SND_SOC_CS43130=n +CONFIG_SND_SOC_CS4341=n +CONFIG_SND_SOC_CS4349=n +CONFIG_SND_SOC_CS53L30=n +CONFIG_SND_SOC_CX2072X=n +CONFIG_SND_SOC_DMIC=n +CONFIG_SND_SOC_ES7134=n +CONFIG_SND_SOC_ES7241=n +CONFIG_SND_SOC_ES8316=n +CONFIG_SND_SOC_ES8328_I2C=n +CONFIG_SND_SOC_ES8328_SPI=n +CONFIG_SND_SOC_GTM601=n +CONFIG_SND_SOC_INNO_RK3036=n +CONFIG_SND_SOC_MAX98088=n +CONFIG_SND_SOC_MAX98357A=n +CONFIG_SND_SOC_MAX98504=n +CONFIG_SND_SOC_MAX9867=n +CONFIG_SND_SOC_MAX98927=n +CONFIG_SND_SOC_MAX98373=n +CONFIG_SND_SOC_MAX9860=n +CONFIG_SND_SOC_MSM8916_WCD_DIGITAL=n +CONFIG_SND_SOC_PCM1681=n +CONFIG_SND_SOC_PCM1789_I2C=n +CONFIG_SND_SOC_PCM179X_I2C=n +CONFIG_SND_SOC_PCM179X_SPI=n +CONFIG_SND_SOC_PCM186X_I2C=n +CONFIG_SND_SOC_PCM186X_SPI=n +CONFIG_SND_SOC_PCM3060_I2C=n +CONFIG_SND_SOC_PCM3060_SPI=n +CONFIG_SND_SOC_PCM3168A_I2C=n +CONFIG_SND_SOC_PCM3168A_SPI=n +CONFIG_SND_SOC_PCM512x_I2C=n +CONFIG_SND_SOC_PCM512x_SPI=n +CONFIG_SND_SOC_RK3328=n +CONFIG_SND_SOC_RT5616=n +CONFIG_SND_SOC_RT5631=n +CONFIG_SND_SOC_SGTL5000=n +CONFIG_SND_SOC_SIMPLE_AMPLIFIER=n +CONFIG_SND_SOC_SIRF_AUDIO_CODEC=n +CONFIG_SND_SOC_SPDIF=n +CONFIG_SND_SOC_SSM2305=n +CONFIG_SND_SOC_SSM2602_SPI=n +CONFIG_SND_SOC_SSM2602_I2C=n +CONFIG_SND_SOC_SSM4567=n +CONFIG_SND_SOC_STA32X=n +CONFIG_SND_SOC_STA350=n +CONFIG_SND_SOC_STI_SAS=n +CONFIG_SND_SOC_TAS2552=n +CONFIG_SND_SOC_TAS5086=n +CONFIG_SND_SOC_TAS571X=n +CONFIG_SND_SOC_TAS5720=n +CONFIG_SND_SOC_TAS6424=n +CONFIG_SND_SOC_TDA7419=n +CONFIG_SND_SOC_TFA9879=n +CONFIG_SND_SOC_TLV320AIC23_I2C=n +CONFIG_SND_SOC_TLV320AIC23_SPI=n +CONFIG_SND_SOC_TLV320AIC31XX=n +CONFIG_SND_SOC_TLV320AIC32X4_I2C=n +CONFIG_SND_SOC_TLV320AIC32X4_SPI=n +CONFIG_SND_SOC_TLV320AIC3X=n +CONFIG_SND_SOC_TS3A227E=n +CONFIG_SND_SOC_TSCS42XX=n +CONFIG_SND_SOC_TSCS454=n +CONFIG_SND_SOC_UDA1334=n +CONFIG_SND_SOC_WM8510=n +CONFIG_SND_SOC_WM8523=n +CONFIG_SND_SOC_WM8524=n +CONFIG_SND_SOC_WM8580=n +CONFIG_SND_SOC_WM8711=n +CONFIG_SND_SOC_WM8728=n +CONFIG_SND_SOC_WM8731=n +CONFIG_SND_SOC_WM8737=n +CONFIG_SND_SOC_WM8741=n +CONFIG_SND_SOC_WM8750=n +CONFIG_SND_SOC_WM8753=n +CONFIG_SND_SOC_WM8770=n +CONFIG_SND_SOC_WM8776=n +CONFIG_SND_SOC_WM8782=n +CONFIG_SND_SOC_WM8804_I2C=n +CONFIG_SND_SOC_WM8804_SPI=n +CONFIG_SND_SOC_WM8903=n +CONFIG_SND_SOC_WM8904=n +CONFIG_SND_SOC_WM8960=n +CONFIG_SND_SOC_WM8962=n +CONFIG_SND_SOC_WM8974=n +CONFIG_SND_SOC_WM8978=n +CONFIG_SND_SOC_WM8985=n +CONFIG_SND_SOC_ZX_AUD96P22=n +CONFIG_SND_SOC_MAX9759=n +CONFIG_SND_SOC_MT6351=n +CONFIG_SND_SOC_MT6358=n +CONFIG_SND_SOC_NAU8540=n +CONFIG_SND_SOC_NAU8810=n +CONFIG_SND_SOC_NAU8822=n +CONFIG_SND_SOC_NAU8824=n +CONFIG_SND_SOC_TPA6130A2=n # end of CODEC drivers -# CONFIG_SND_SIMPLE_CARD is not set -# CONFIG_SND_AUDIO_GRAPH_CARD is not set -# CONFIG_SND_XEN_FRONTEND is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_USB_CONFIGFS_F_UAC1 is not set -# CONFIG_USB_CONFIGFS_F_UAC1_LEGACY is not set -# CONFIG_USB_CONFIGFS_F_UAC2 is not set -# CONFIG_USB_CONFIGFS_F_MIDI is not set +CONFIG_SND_SIMPLE_CARD=n +CONFIG_SND_AUDIO_GRAPH_CARD=n +CONFIG_SND_XEN_FRONTEND=n +CONFIG_HID_PRODIKEYS=n +CONFIG_USB_CONFIGFS_F_UAC1=n +CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=n +CONFIG_USB_CONFIGFS_F_UAC2=n +CONFIG_USB_CONFIGFS_F_MIDI=n diff --git a/features/xilinx/v4l2/v4l2.cfg b/features/xilinx/v4l2/v4l2.cfg index c2e684c5..32a948a3 100644 --- a/features/xilinx/v4l2/v4l2.cfg +++ b/features/xilinx/v4l2/v4l2.cfg @@ -7,7 +7,6 @@ CONFIG_MEDIA_CONTROLLER=y # V4L CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEO_DEV=y -CONFIG_VIDEO_V4L2=y CONFIG_VIDEO_V4L2_SUBDEV_API=y # Xilinx Video drivers diff --git a/features/yaffs2/0001-yaffs2-convert-read_page-readfolio.patch b/features/yaffs2/0001-yaffs2-convert-read_page-readfolio.patch new file mode 100644 index 00000000..78a5c311 --- /dev/null +++ b/features/yaffs2/0001-yaffs2-convert-read_page-readfolio.patch @@ -0,0 +1,76 @@ +From a10fa57649a96e7cd87ec4b93badc2b441b06ec5 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 29 Jun 2022 10:51:56 -0400 +Subject: [PATCH] yaffs2: convert read_page -> readfolio + +This is a first pass of changing yaffs2 to use the new read_folio, +versus readpage routines. We also adjust writepage to no longer use +flags, which have been dropped in 5.19+ + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 8ceb66c0d070..52f2d13c7126 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -367,13 +367,13 @@ static int yaffs_readpage_unlock(struct file *f, struct page *pg) + return ret; + } + +-static int yaffs_readpage(struct file *f, struct page *pg) ++static int yaffs_read_folio(struct file *f, struct folio *folio) + { + int ret; + +- yaffs_trace(YAFFS_TRACE_OS, "yaffs_readpage"); +- ret = yaffs_readpage_unlock(f, pg); +- yaffs_trace(YAFFS_TRACE_OS, "yaffs_readpage done"); ++ yaffs_trace(YAFFS_TRACE_OS, "yaffs_read_folio"); ++ ret = yaffs_readpage_unlock(f, &folio->page); ++ yaffs_trace(YAFFS_TRACE_OS, "yaffs_read_folio done"); + return ret; + } + +@@ -548,9 +548,16 @@ static void yaffs_release_space(struct file *f) + } + + #if (YAFFS_USE_WRITE_BEGIN_END > 0) ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) ++static int yaffs_write_begin(struct file *filp, struct address_space *mapping, ++ loff_t pos, unsigned len, ++ struct page **pagep, void **fsdata) ++#else + static int yaffs_write_begin(struct file *filp, struct address_space *mapping, + loff_t pos, unsigned len, unsigned flags, + struct page **pagep, void **fsdata) ++#endif + { + struct page *pg = NULL; + pgoff_t index = pos >> PAGE_CACHE_SHIFT; +@@ -559,7 +566,9 @@ static int yaffs_write_begin(struct file *filp, struct address_space *mapping, + int space_held = 0; + + /* Get a page */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) ++ pg = grab_cache_page_write_begin(mapping, index); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) + pg = grab_cache_page_write_begin(mapping, index, flags); + #else + pg = __grab_cache_page(mapping, index); +@@ -748,7 +757,7 @@ static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset, + #endif + + static struct address_space_operations yaffs_file_address_operations = { +- .readpage = yaffs_readpage, ++ .read_folio = yaffs_read_folio, + .writepage = yaffs_writepage, + #if (YAFFS_USE_WRITE_BEGIN_END > 0) + .write_begin = yaffs_write_begin, +-- +2.19.1 + diff --git a/features/yaffs2/0001-yaffs2-replace-bdevname-call-with-sprintf.patch b/features/yaffs2/0001-yaffs2-replace-bdevname-call-with-sprintf.patch new file mode 100644 index 00000000..b3c829ab --- /dev/null +++ b/features/yaffs2/0001-yaffs2-replace-bdevname-call-with-sprintf.patch @@ -0,0 +1,34 @@ +From ae1445c1cc1cec47fa51f7831cd9110ecd5b2a55 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Mon, 3 Oct 2022 15:16:27 -0400 +Subject: [PATCH] yaffs2: replace bdevname call with sprintf + +commit 900d156bac2bc474cf7c7bee4efbc6c83ec5ae58 [block: remove bdevname] +removed this function, we follow the pattern and use sprintf as a +replacement. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 52f2d13c7126..140f7aa7a1a1 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -117,7 +117,11 @@ + #define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags) + + /* FIXME: use sb->s_id instead ? */ +-#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) ++//#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) ++static inline char* yaffs_devname(struct super_block *sb, char *buf) { ++ snprintf(buf, sizeof(buf), "%pg", sb->s_bdev); ++ return buf; ++} + + #else + +-- +2.19.1 + diff --git a/features/yaffs2/0001-yaffs2-update-VFS-ctime-operations-to-6.6.patch b/features/yaffs2/0001-yaffs2-update-VFS-ctime-operations-to-6.6.patch new file mode 100644 index 00000000..9ea1aa07 --- /dev/null +++ b/features/yaffs2/0001-yaffs2-update-VFS-ctime-operations-to-6.6.patch @@ -0,0 +1,64 @@ +From 70f40841c195a81a8ef8290862adeb86fe264b24 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 21 Sep 2023 17:04:31 -0400 +Subject: [PATCH] yaffs2: update VFS ctime operations to 6.6+ + +In 6.6+ kernels the inode ctime is hidden, and should only +be accessed through accesor routines. We convert one of our +calls to the accesor, but the other, we use the new "hidden" +__ctime. + +We also convert the interator to use the shared iterator and +iterator wrap routines. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 04abeee99ff5..8a9738de8906 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -282,7 +282,7 @@ MODULE_PARM(yaffs_gc_control, "i"); + } while (0) + #else + #define update_dir_time(dir) do {\ +- (dir)->i_ctime = (dir)->i_mtime = current_time(dir); \ ++ (dir)->i_mtime = inode_set_ctime_to_ts( dir, current_time(dir) ); \ + } while (0) + #endif + +@@ -1901,7 +1901,7 @@ static int yaffs_iterate(struct file *f, struct dir_context *dc) + + return ret_val; + } +- ++WRAP_DIR_ITER(yaffs_iterate) + #else + + static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir) +@@ -2018,7 +2018,7 @@ static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir) + static const struct file_operations yaffs_dir_operations = { + .read = generic_read_dir, + #ifdef YAFFS_USE_DIR_ITERATE +- .iterate = yaffs_iterate, ++ .iterate_shared = shared_yaffs_iterate, + #else + .readdir = yaffs_readdir, + #endif +@@ -2079,8 +2079,9 @@ static void yaffs_fill_inode_from_obj(struct inode *inode, + inode->i_atime.tv_nsec = 0; + inode->i_mtime.tv_sec = (time64_t) obj->yst_mtime; + inode->i_mtime.tv_nsec = 0; +- inode->i_ctime.tv_sec = (time64_t) obj->yst_ctime; +- inode->i_ctime.tv_nsec = 0; ++ //inode->i_ctime.tv_sec = (time64_t) obj->yst_ctime; ++ inode->__i_ctime.tv_sec = (time64_t) obj->yst_ctime; ++ inode->__i_ctime.tv_nsec = 0; + #else + inode->i_rdev = obj->yst_rdev; + inode->i_atime = obj->yst_atime; +-- +2.34.1 + diff --git a/features/yaffs2/yaffs-fix-Wstringop-overread-compile-warning-in-yaff.patch b/features/yaffs2/yaffs-fix-Wstringop-overread-compile-warning-in-yaff.patch new file mode 100644 index 00000000..7a47c4a5 --- /dev/null +++ b/features/yaffs2/yaffs-fix-Wstringop-overread-compile-warning-in-yaff.patch @@ -0,0 +1,44 @@ +From ea777841e8ea883bfa160693e650882f86e75167 Mon Sep 17 00:00:00 2001 +From: Quanyang Wang <quanyang.wang@windriver.com> +Date: Sun, 13 Jun 2021 12:08:21 +0800 +Subject: [PATCH] yaffs: fix -Wstringop-overread compile warning in + yaffs_fix_null_name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In yaffs_fix_null_name, "if (strnlen(name, YAFFS_MAX_NAME_LENGTH) == 0)" +is used to judge if the "name" string is zero length. But this is wrong +when the "name" char array size is less than YAFFS_MAX_NAME_LENGTH and +this will trigger compile warnig as below: + +fs/yaffs2/yaffs_guts.c:4501:13: warning: ‘strnlen’ specified bound 255 exceeds source size 16 [-Wstringop-overread] + 4501 | if (strnlen(name, YAFFS_MAX_NAME_LENGTH) == 0) { + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Let's use buffer_size to do this instead of YAFFS_MAX_NAME_LENGTH +because buffer_size is passed to yaffs_fix_null_name by caller with +appropriate value which is fixed to the size of "name" char array. + +Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_guts.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c +index 40a5b46cf6ca..0cc794ebc347 100644 +--- a/fs/yaffs2/yaffs_guts.c ++++ b/fs/yaffs2/yaffs_guts.c +@@ -4498,7 +4498,7 @@ static void yaffs_fix_null_name(struct yaffs_obj *obj, YCHAR *name, + int buffer_size) + { + /* Create an object name if we could not find one. */ +- if (strnlen(name, YAFFS_MAX_NAME_LENGTH) == 0) { ++ if (strnlen(name, buffer_size) == 0) { + YCHAR local_name[20]; + YCHAR num_string[20]; + YCHAR *x = &num_string[19]; +-- +2.19.1 + diff --git a/features/yaffs2/yaffs-fix-mtime-itime-field-access.patch b/features/yaffs2/yaffs-fix-mtime-itime-field-access.patch new file mode 100644 index 00000000..482312a0 --- /dev/null +++ b/features/yaffs2/yaffs-fix-mtime-itime-field-access.patch @@ -0,0 +1,65 @@ +From 7614fa80bc6abefd1450b5c4c3839386ac2b92cc Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 22 Nov 2023 12:04:28 -0500 +Subject: [PATCH] yaffs: fix mtime/itime field access + +Adapting our inode field access to the following upstream +commit: + + commit 12cd44023651666bd44baa36a5c999698890debb + Author: Jeff Layton <jlayton@kernel.org> + Date: Fri Sep 29 09:05:52 2023 -0400 + + fs: rename inode i_atime and i_mtime fields + + Rename these two fields to discourage direct access (and to help ensure + that we mop up any leftover direct accesses). + + Signed-off-by: Jeff Layton <jlayton@kernel.org> + Signed-off-by: Christian Brauner <brauner@kernel.org> + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 8a9738de8906..ec4016cfeedf 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -282,7 +282,7 @@ MODULE_PARM(yaffs_gc_control, "i"); + } while (0) + #else + #define update_dir_time(dir) do {\ +- (dir)->i_mtime = inode_set_ctime_to_ts( dir, current_time(dir) ); \ ++ (dir)->__i_mtime = inode_set_ctime_to_ts( dir, current_time(dir) ); \ + } while (0) + #endif + +@@ -2075,17 +2075,17 @@ static void yaffs_fill_inode_from_obj(struct inode *inode, + #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)) + + inode->i_rdev = old_decode_dev(obj->yst_rdev); +- inode->i_atime.tv_sec = (time64_t) (obj->yst_atime); +- inode->i_atime.tv_nsec = 0; +- inode->i_mtime.tv_sec = (time64_t) obj->yst_mtime; +- inode->i_mtime.tv_nsec = 0; ++ inode->__i_atime.tv_sec = (time64_t) (obj->yst_atime); ++ inode->__i_atime.tv_nsec = 0; ++ inode->__i_mtime.tv_sec = (time64_t) obj->yst_mtime; ++ inode->__i_mtime.tv_nsec = 0; + //inode->i_ctime.tv_sec = (time64_t) obj->yst_ctime; + inode->__i_ctime.tv_sec = (time64_t) obj->yst_ctime; + inode->__i_ctime.tv_nsec = 0; + #else + inode->i_rdev = obj->yst_rdev; +- inode->i_atime = obj->yst_atime; +- inode->i_mtime = obj->yst_mtime; ++ inode->__i_atime = obj->yst_atime; ++ inode->__i_mtime = obj->yst_mtime; + inode->i_ctime = obj->yst_ctime; + #endif + inode->i_size = yaffs_get_obj_length(obj); +-- +2.34.1 + diff --git a/features/yaffs2/yaffs-replace-IS_ERR-with-IS_ERR_OR_NULL-to-check-bo.patch b/features/yaffs2/yaffs-replace-IS_ERR-with-IS_ERR_OR_NULL-to-check-bo.patch new file mode 100644 index 00000000..4956ff5e --- /dev/null +++ b/features/yaffs2/yaffs-replace-IS_ERR-with-IS_ERR_OR_NULL-to-check-bo.patch @@ -0,0 +1,49 @@ +From f3ffb6a61225aa0a89d0edfeb7cdd99b9963faa0 Mon Sep 17 00:00:00 2001 +From: Meng Li <Meng.Li@windriver.com> +Date: Thu, 21 Oct 2021 09:27:20 +0800 +Subject: [PATCH] yaffs: replace IS_ERR with IS_ERR_OR_NULL to check both ERR + and NULL + +When run below command to mount a yaffs2 FS to nor flash, there +is kernel panic as below: +Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 +...... +Internal error: Oops: 96000004 [#1] PREEMPT SMP +Modules linked in: +CPU: 1 PID: 335 Comm: mount Not tainted 5.10.73-yocto-standard #1 +...... +Call trace: + yaffs_internal_read_super.constprop.0+0x24c/0x6fc + yaffs2_internal_read_super_mtd+0x28/0x40 + mount_bdev+0x1cc/0x200 + ...... + el0_sync_handler+0x1a4/0x1b0 + el0_sync+0x180/0x1c0 +Because in function yaffs_get_mtd_device(), it check the type of +mtd device. If it is not NAND flash, NULL will be returned. This +causes kernel panic if the ret value is not checked whether it +is NULL or not. So, replace IS_ERR with IS_ERR_OR_NULL to check +both ERR and NULL. + +Signed-off-by: Meng Li <Meng.Li@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index ee9d6955ed79..8ceb66c0d070 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -2965,7 +2965,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, + + + mtd = yaffs_get_mtd_device(sb->s_dev); +- if (IS_ERR(mtd)) { ++ if (IS_ERR_OR_NULL(mtd)) { + return NULL; + } + +-- +2.19.1 + diff --git a/features/yaffs2/yaffs2-Fix-miscalculation-of-devname-buffer-length.patch b/features/yaffs2/yaffs2-Fix-miscalculation-of-devname-buffer-length.patch new file mode 100644 index 00000000..79deb483 --- /dev/null +++ b/features/yaffs2/yaffs2-Fix-miscalculation-of-devname-buffer-length.patch @@ -0,0 +1,65 @@ +From dded404c66bb87f08216afd1e3c9d84359e80012 Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Wed, 31 May 2023 14:01:07 +0800 +Subject: [PATCH] yaffs2: Fix miscalculation of devname buffer length + +The following build warning helps us find a real mishandling of array length. + +fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' call +is the same expression as the destination; did you mean to provide an explicit +length? [-Wsizeof-pointer-memaccess] + +If an array is passed as a function parameter it'll be treated as a simple +pointer and thus sizeof will return the length of a pointer rather than the +length of the array. + +Add and pass the buffer length to make it work correctly. + +Signed-off-by: He Zhe <zhe.he@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 140f7aa7a1a1..e9e29a41a680 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -118,8 +118,8 @@ + + /* FIXME: use sb->s_id instead ? */ + //#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf) +-static inline char* yaffs_devname(struct super_block *sb, char *buf) { +- snprintf(buf, sizeof(buf), "%pg", sb->s_bdev); ++static inline char* yaffs_devname(struct super_block *sb, char *buf, unsigned long len) { ++ snprintf(buf, len, "%pg", sb->s_bdev); + return buf; + } + +@@ -2944,12 +2944,12 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, + + if (!sb->s_dev) + printk(KERN_INFO "yaffs: sb->s_dev is NULL\n"); +- else if (!yaffs_devname(sb, devname_buf)) ++ else if (!yaffs_devname(sb, devname_buf, sizeof(devname_buf))) + printk(KERN_INFO "yaffs: devname is NULL\n"); + else + printk(KERN_INFO "yaffs: dev is %d name is \"%s\" %s\n", + sb->s_dev, +- yaffs_devname(sb, devname_buf), read_only ? "ro" : "rw"); ++ yaffs_devname(sb, devname_buf, sizeof(devname_buf)), read_only ? "ro" : "rw"); + + if (!data_str) + data_str = ""; +@@ -2974,7 +2974,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, + yaffs_trace(YAFFS_TRACE_ALWAYS, + "yaffs: Attempting MTD mount of %u.%u,\"%s\"", + MAJOR(sb->s_dev), MINOR(sb->s_dev), +- yaffs_devname(sb, devname_buf)); ++ yaffs_devname(sb, devname_buf, sizeof(devname_buf))); + + + mtd = yaffs_get_mtd_device(sb->s_dev); +-- +2.34.1 + diff --git a/features/yaffs2/yaffs2-convert-user_namespace-to-mnt_idmap.patch b/features/yaffs2/yaffs2-convert-user_namespace-to-mnt_idmap.patch new file mode 100644 index 00000000..1a67540b --- /dev/null +++ b/features/yaffs2/yaffs2-convert-user_namespace-to-mnt_idmap.patch @@ -0,0 +1,96 @@ +From 5440769b1bbff51e64557c2a981a6cdfece8adec Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Fri, 17 Mar 2023 22:31:42 -0400 +Subject: [PATCH] yaffs2: convert user_namespace to mnt_idmap + +commit c1632a0f11209338fc300c66252bcc4686e609e8 [fs: port ->setattr() to +pass mnt_idmap] changes the parameters to attr operations to a +mnt_idmap. + +yaffs2 isn't using the user namespace directly, so we switch to the +default map. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 140f7aa7a1a1..3844d542608e 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -910,7 +910,7 @@ static int yaffs_vfs_setsize(struct inode *inode, loff_t newsize) + static int yaffs_vfs_setattr(struct inode *inode, struct iattr *attr) + { + #ifdef YAFFS_USE_SETATTR_COPY +- setattr_copy(&init_user_ns,inode, attr); ++ setattr_copy(&nop_mnt_idmap,inode, attr); + return 0; + #else + return inode_setattr(inode, attr); +@@ -918,7 +918,7 @@ static int yaffs_vfs_setattr(struct inode *inode, struct iattr *attr) + + } + +-static int yaffs_setattr(struct user_namespace *ns, struct dentry *dentry, struct iattr *attr) ++static int yaffs_setattr(struct mnt_idmap *ns, struct dentry *dentry, struct iattr *attr) + { + struct inode *inode = dentry->d_inode; + int error = 0; +@@ -934,7 +934,7 @@ static int yaffs_setattr(struct user_namespace *ns, struct dentry *dentry, struc + #endif + + if (error == 0) +- error = setattr_prepare(&init_user_ns,dentry, attr); ++ error = setattr_prepare(&nop_mnt_idmap,dentry, attr); + if (error == 0) { + int result; + if (!error) { +@@ -1352,7 +1352,7 @@ struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev, + + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) +-static int yaffs_mknod(struct user_namespace *ns, struct inode *dir, struct dentry *dentry, umode_t mode, ++static int yaffs_mknod(struct mnt_idmap *ns, struct inode *dir, struct dentry *dentry, umode_t mode, + dev_t rdev) + #elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)) + static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, +@@ -1446,7 +1446,7 @@ static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, + } + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) +-static int yaffs_mkdir(struct user_namespace *ns, struct inode *dir, struct dentry *dentry, umode_t mode) ++static int yaffs_mkdir(struct mnt_idmap *ns, struct inode *dir, struct dentry *dentry, umode_t mode) + #else + static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode) + #endif +@@ -1459,7 +1459,7 @@ static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode) + + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) +-static int yaffs_create(struct user_namespace *ns, struct inode *dir, struct dentry *dentry, umode_t mode, ++static int yaffs_create(struct mnt_idmap *ns, struct inode *dir, struct dentry *dentry, umode_t mode, + bool dummy) + #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) + static int yaffs_create(struct inode *dir, struct dentry *dentry, umode_t mode, +@@ -1564,7 +1564,7 @@ static int yaffs_link(struct dentry *old_dentry, struct inode *dir, + return -EPERM; + } + +-static int yaffs_symlink(struct user_namespace *ns, ++static int yaffs_symlink(struct mnt_idmap *ns, + struct inode *dir, struct dentry *dentry, + const char *symname) + { +@@ -1611,7 +1611,7 @@ static int yaffs_symlink(struct user_namespace *ns, + * NB: POSIX says you can rename an object over an old object of the same name + */ + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) +-static int yaffs_rename(struct user_namespace *ns, struct inode *old_dir, struct dentry *old_dentry, ++static int yaffs_rename(struct mnt_idmap *ns, struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry, unsigned int unused) + #else + static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry, +-- +2.34.1 + diff --git a/features/yaffs2/yaffs2-v6.5-fixups.patch b/features/yaffs2/yaffs2-v6.5-fixups.patch new file mode 100644 index 00000000..0159a00b --- /dev/null +++ b/features/yaffs2/yaffs2-v6.5-fixups.patch @@ -0,0 +1,26 @@ +From e9ca040537fb905d7a55ee9d20ce0414eed5f10e Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 27 Jul 2023 18:17:32 -0400 +Subject: [PATCH] yaffs2: v6.5 fixups + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + fs/yaffs2/yaffs_vfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c +index 32864c715545..04abeee99ff5 100644 +--- a/fs/yaffs2/yaffs_vfs.c ++++ b/fs/yaffs2/yaffs_vfs.c +@@ -844,7 +844,7 @@ static const struct file_operations yaffs_file_operations = { + .mmap = generic_file_mmap, + .flush = yaffs_file_flush, + .fsync = yaffs_sync_object, +- .splice_read = generic_file_splice_read, ++ .splice_read = copy_splice_read, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) + .splice_write = iter_file_splice_write, + #else +-- +2.34.1 + diff --git a/features/yaffs2/yaffs2.scc b/features/yaffs2/yaffs2.scc index 9b1bd8bc..5b131bd7 100644 --- a/features/yaffs2/yaffs2.scc +++ b/features/yaffs2/yaffs2.scc @@ -13,3 +13,12 @@ patch yaffs2-v5.6-build-fixups.patch patch yaffs-fix-misplaced-variable-declaration.patch patch yaffs-include-blkdev.h.patch patch 0001-yaffs2-v5.12-build-fixups-not-runtime-tested.patch +patch yaffs-fix-Wstringop-overread-compile-warning-in-yaff.patch +patch yaffs-replace-IS_ERR-with-IS_ERR_OR_NULL-to-check-bo.patch +patch 0001-yaffs2-convert-read_page-readfolio.patch +patch 0001-yaffs2-replace-bdevname-call-with-sprintf.patch +patch yaffs2-convert-user_namespace-to-mnt_idmap.patch +patch yaffs2-Fix-miscalculation-of-devname-buffer-length.patch +patch yaffs2-v6.5-fixups.patch +patch 0001-yaffs2-update-VFS-ctime-operations-to-6.6.patch +patch yaffs-fix-mtime-itime-field-access.patch diff --git a/features/zram/zram.cfg b/features/zram/zram.cfg new file mode 100644 index 00000000..9e58fb71 --- /dev/null +++ b/features/zram/zram.cfg @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: MIT +CONFIG_ZSMALLOC=y +CONFIG_ZSMALLOC_STAT=n +CONFIG_ZRAM=y +CONFIG_ZRAM_DEF_COMP_LZORLE=y +CONFIG_ZRAM_DEF_COMP_ZSTD=n +CONFIG_ZRAM_DEF_COMP_LZ4=n +CONFIG_ZRAM_DEF_COMP_LZO=n +CONFIG_ZRAM_DEF_COMP_LZ4HC=n +CONFIG_ZRAM_DEF_COMP_842=n +CONFIG_ZRAM_DEF_COMP="lzo-rle" +CONFIG_ZRAM_WRITEBACK=n +CONFIG_ZRAM_MEMORY_TRACKING=n +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_842=y +CONFIG_CRYPTO_LZ4=y +CONFIG_CRYPTO_LZ4HC=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_842_COMPRESS=y +CONFIG_842_DECOMPRESS=y +CONFIG_LZ4_COMPRESS=y +CONFIG_LZ4HC_COMPRESS=y +CONFIG_ZSTD_COMPRESS=y diff --git a/features/zram/zram.scc b/features/zram/zram.scc new file mode 100644 index 00000000..30388842 --- /dev/null +++ b/features/zram/zram.scc @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +define KFEATURE_DESCRIPTION "Compressed RAM block device support" +define KFEATURE_COMPATIBILITY all + +kconf non-hardware zram.cfg diff --git a/kern-features.rc b/kern-features.rc index 7fa3e0c7..0e83053c 100644 --- a/kern-features.rc +++ b/kern-features.rc @@ -1,237 +1,296 @@ [kernel-options] - config = bsp/xilinx/board-common.scc - config = bsp/xilinx/ultra96-zynqmp/mipi-config-ultra96.scc - config = bsp/xilinx/soc/drivers-softip.scc - config = bsp/xilinx/soc/zynq.scc - config = bsp/xilinx/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.scc - config = bsp/xilinx/kc705-microblazeel-features/kc705-microblazeel-features.scc - config = features/serial/8250.scc - config = features/smack/smack.scc - config = features/kmemcheck/kmemcheck-enable.scc - config = features/ice/ice.scc - config = features/module-signing/signing.scc - config = features/module-signing/force-signing.scc - config = features/intel-vmd/intel-vmd.scc - config = features/bpf/bpf.scc - config = features/mac80211/mac80211.scc - config = features/sound/snd_hda_intel.scc - config = features/iommu/iommu.scc - config = features/pci/pci.scc - config = features/6lowpan/6lowpan.scc - config = features/ima/ima.scc - config = features/ima/modsign.scc - config = features/intel-th/intel-th.scc - config = features/usb/designware-usb3.scc - config = features/usb/serial-all.scc + config = cfg/crypto-obsolete-disable.scc + config = cfg/sound.scc + config = cfg/vmware-guest.scc + config = cfg/fs/btrfs.scc + config = cfg/fs/ext3.scc + config = cfg/fs/flash_fs.scc + config = cfg/fs/vfat.scc + config = cfg/fs/devtmpfs.scc + config = cfg/fs/debugfs.scc + config = cfg/fs/ext2.scc + config = cfg/fs/ext4.scc + config = cfg/8250.scc + config = cfg/usb-mass-storage.scc + config = cfg/paravirt_kvm.scc + config = cfg/debug-kselftest.scc + config = cfg/hv-guest.scc + config = cfg/smp.scc + config = cfg/smp_64.scc + config = cfg/vesafb.scc + config = cfg/boot-live.scc + config = cfg/efi.scc + config = cfg/rbd.scc + config = cfg/dmaengine.scc + config = cfg/net/ip_nf.scc + config = cfg/net/mdio.scc + config = cfg/net/ipv6.scc + config = cfg/net/ipsec.scc + config = cfg/net/ip6_nf.scc + config = cfg/net/bridge.scc + config = cfg/net/ipsec6.scc + config = cfg/virtio.scc + config = cfg/debug/kcov/debug-kcov.scc + config = cfg/debug/kcsan/debug-kcsan.scc + config = cfg/debug/syzkaller/debug-syzkaller.scc + config = cfg/debug/fault-inject/debug-fault-injection-debugfs.scc + config = cfg/x32.scc + config = cfg/timer/hpet.scc + config = cfg/timer/hz_1000.scc + config = cfg/timer/no_hz.scc + config = cfg/timer/rtc.scc + config = cfg/timer/hz_250.scc + config = cfg/timer/hz_100.scc + config = cfg/efi-ext.scc + config = arch/arm/arm64-4kb-pages.scc + config = arch/arm/arm64-64kb-pages.scc + config = arch/arm/arm64-16kb-pages.scc + config = cgl/cfg/scsi_dh_hpsw.scc + config = cgl/cfg/fs/ocfs2.scc + config = cgl/cfg/drbd.scc + config = cgl/cfg/scsi_dh_alua.scc + config = cgl/cfg/scsi_dh_emc.scc + config = cgl/cfg/scsi_dh_rdac.scc + config = cgl/cfg/dmm.scc + config = cgl/cfg/net/l2tp.scc + config = cgl/cfg/net/macvlan.scc + config = cgl/cfg/net/ip_vs.scc + config = cgl/cfg/iscsi.scc + config = cgl/cfg/scsi_dh.scc + config = cgl/features/pstore/pstore.scc + config = cgl/features/mip6/mip6.scc + config = cgl/features/audit/audit.scc + config = cgl/features/selinux/selinux-dev.scc + config = cgl/features/selinux/selinux.scc + config = cgl/features/aoe/aoe.scc + config = cgl/features/quota/quota.scc + config = features/pwm/pwm.scc + config = features/pwm/intel_pwm.scc + config = features/usb-net/usb-net.scc + config = features/hrt/hrt.scc + config = features/tmpfs/tmpfs-posix-acl.scc + config = features/lxc/lxc-enable.scc + config = features/inline/inline.scc + config = features/intel-tco/intel-tco.scc + config = features/ftrace/ftrace-function-tracer-disable.scc + config = features/ftrace/ftrace.scc + config = features/vxlan/vxlan-enable.scc + config = features/i915/i915.scc + config = features/nfc/nfc-generic.scc + config = features/nfc/nfc-vendor.scc + config = features/profiling/profiling.scc + config = features/misc/bosch-pressure-sensor-i2c.scc + config = features/security/security.scc + config = features/kgdb/kgdb.scc + config = features/vrf/vrf.scc config = features/usb/usb-gadgets.scc - config = features/usb/serial.scc - config = features/usb/usb-base.scc - config = features/usb/usb-typec.scc + config = features/usb/serial-all.scc + config = features/usb/designware-usb3.scc + config = features/usb/usb-dummy-hcd.scc + config = features/usb/touchscreen-composite.scc + config = features/usb/uhci-hcd.scc config = features/usb/ehci-hcd.scc - config = features/usb/xhci-hcd.scc config = features/usb/designware-usb2.scc - config = features/usb/uhci-hcd.scc - config = features/usb/touchscreen-composite.scc + config = features/usb/usb-base.scc config = features/usb/ohci-hcd.scc + config = features/usb/usb-typec.scc + config = features/usb/serial.scc + config = features/usb/xhci-hcd.scc + config = features/usb/usb-raw-gadget.scc + config = features/intel-uncore-frequency/intel-uncore-frequency.scc + config = features/mpx/mpx.scc + config = features/igb/igb.scc + config = features/stm/stm.scc + config = features/nf_tables/nf_tables.scc + config = features/nf_tables/nft_test.scc + config = features/cgroups/cgroups.scc + config = features/can/m_can.scc + config = features/can/can.scc + config = features/intel-e1xxxx/intel-e100.scc + config = features/mtd/mtd.scc + config = features/blktrace/blktrace.scc + config = features/landlock/landlock.scc config = features/iwlegacy/iwlegacy.scc - config = features/kvm/qemu-kvm-enable.scc - config = features/pwm/pwm.scc - config = features/pwm/intel_pwm.scc - config = features/intel-sst/intel-sst.scc - config = features/hugetlb/hugetlb.scc - config = features/hrt/hrt.scc - config = features/taskstats/taskstats.scc - config = features/eg20t/eg20t.scc - config = features/ramconsole/ramconsole.scc - config = features/vrf/vrf.scc - config = features/kexec/kexec-enable.scc - config = features/xilinx/hdmi-module/hdmi-module.scc + config = features/kfence/kfence.scc + config = features/latencytop/latencytop.scc + config = features/bpf/bpf.scc config = features/xilinx/v4l2/v4l2.scc config = features/xilinx/overlay_of/overlay_of.scc - config = features/nf_tables/nf_tables.scc - config = features/spi/spidev.scc - config = features/spi/spi.scc - config = features/mmc/mmc-base.scc + config = features/xilinx/hdmi-module/hdmi-module.scc + config = features/kmemcheck/kmemcheck-enable.scc + config = features/uprobe/uprobe-enable.scc + config = features/uprobe/uprobe.scc config = features/mmc/mmc-block.scc config = features/mmc/mmc-sdhci.scc + config = features/mmc/mmc-base.scc config = features/mmc/mmc-realtek.scc - config = features/reproducibility/reproducibility.scc - config = features/tpm/tpm.scc - config = features/igc/igc.scc - config = features/misc/bosch-pressure-sensor-i2c.scc - config = features/numa/numa.scc - config = features/i2c/i2cdbg.scc - config = features/i2c/i2c.scc - config = features/i2c/i2c-ismt.scc - config = features/i2c/i2cdev.scc - config = features/cgroups/cgroups.scc - config = features/pci-iov/pci-iov.scc - config = features/ocicontainer/ebtables.scc - config = features/ocicontainer/xt-checksum.scc - config = features/ocicontainer/cgroup.scc - config = features/nfsd/nfsd.scc - config = features/nfsd/nfsd-enable.scc - config = features/bluetooth/bluetooth-usb.scc - config = features/intel-pmc/intel-pmc-core.scc - config = features/ftrace/ftrace.scc - config = features/ftrace/ftrace-function-tracer-disable.scc - config = features/edac/edac-enable.scc + config = features/scsi/scsi.scc + config = features/scsi/scsi-debug.scc + config = features/scsi/cdrom.scc + config = features/scsi/disk.scc + config = features/intel-idxd/intel-idxd.scc + config = features/tun/tun.scc + config = features/hid/hid.scc config = features/rpmb/rpmb-uapi.scc config = features/rpmb/rpmb-sim.scc config = features/rpmb/rpmb-base.scc - config = features/uprobe/uprobe-enable.scc - config = features/uprobe/uprobe.scc - config = features/powertop/powertop.scc - config = features/i40e/i40e.scc - config = features/kgdb/kgdb.scc - config = features/intel-pinctrl/intel-pinctrl.scc - config = features/yama/yama.scc - config = features/kprobes/kprobes.scc - config = features/apparmor/apparmor.scc + config = features/igc/igc.scc + config = features/iommu/iommu.scc + config = features/systemtap/systemtap.scc + config = features/intel-pmc/intel-pmc-core.scc + config = features/tsn/tsn.scc + config = features/power/bq25890.scc config = features/power/intel.scc config = features/power/intel_pmic.scc - config = features/power/bq25890.scc config = features/power/arm.scc - config = features/x2apic/x2apic.scc - config = features/telemetry/intel-telemetry.scc - config = features/mtd/mtd.scc - config = features/media/media-radio.scc - config = features/media/media.scc - config = features/media/media-tuners.scc - config = features/media/media-rc.scc - config = features/media/media-dvb-frontends.scc - config = features/media/media-pci-capture.scc - config = features/media/media-i2c.scc - config = features/media/media-platform.scc - config = features/media/media-usb-webcams.scc - config = features/media/media-usb-tv.scc - config = features/tmpfs/tmpfs-posix-acl.scc - config = features/vfio/vfio.scc - config = features/mei/mei-spd.scc - config = features/mei/mei.scc - config = features/mei/mei-me.scc + config = features/bluetooth/bluetooth-usb.scc + config = features/bluetooth/bluetooth-vhci.scc + config = features/kexec/kexec-enable.scc + config = features/serial/8250.scc + config = features/intel-sst/intel-sst.scc + config = features/intel-dptf/intel-dptf.scc + config = features/wifi/wifi-all.scc + config = features/wifi/wifi-usb.scc + config = features/wifi/wifi-pci.scc + config = features/wifi/wifi-sdio.scc + config = features/wifi/wifi-common.scc + config = features/gpio/mockup.scc + config = features/gpio/sim.scc + config = features/kprobes/kprobes.scc + config = features/mfd/mfd-intel-lpss.scc + config = features/thunderbolt/thunderbolt.scc + config = features/intel-sgx/intel-sgx.scc + config = features/transparent-hugepage/transparent-hugepage.scc + config = features/netfilter/netfilter.scc config = features/mei/amt.scc + config = features/mei/mei.scc config = features/mei/mei-txe.scc - config = features/blktrace/blktrace.scc - config = features/xen/xen.scc - config = features/gpio/mockup.scc - config = features/lto/lto.scc - config = features/lto/lto-disable.scc - config = features/lto/lto-debug.scc - config = features/full_nohz/full_nohz-enable.scc - config = features/input/keyboard-gpio.scc - config = features/input/touchscreen.scc - config = features/input/input.scc + config = features/mei/mei-spd.scc + config = features/mei/mei-me.scc + config = features/kdump/kdump-enable.scc config = features/intel-persistent-memory/intel-x86-64-pmem.scc config = features/intel-persistent-memory/intel-x86-64-pmem-preempt-rt.scc - config = features/usb-net/usb-net.scc - config = features/ipmi/ipmi.scc - config = features/namespaces/namespaces.scc config = features/ecryptfs/ecryptfs.scc - config = features/mfd/mfd-intel-lpss.scc + config = features/module-signing/signing.scc + config = features/module-signing/force-signing.scc + config = features/docker/docker.scc + config = features/reproducibility/reproducibility.scc + config = features/leds/leds.scc + config = features/apparmor/apparmor.scc + config = features/yama/yama.scc + config = features/criu/criu-enable.scc + config = features/6lowpan/6lowpan.scc + config = features/iio/iio.scc + config = features/i40e/i40e.scc + config = features/pci/pci-of-generic.scc + config = features/pci/pci.scc + config = features/i2c/i2c-ismt.scc + config = features/i2c/i2cdev.scc + config = features/i2c/i2c.scc + config = features/i2c/i2cdbg.scc + config = features/iscsi/iscsi.scc + config = features/firewire/firewire.scc + config = features/iwlwifi/iwlwifi.scc + config = features/spi/spi.scc + config = features/spi/spidev.scc + config = features/kvm/qemu-kvm-enable.scc + config = features/intel-th/intel-th.scc + config = features/mac80211/mac80211-hwsim.scc + config = features/mac80211/mac80211.scc config = features/qat/qat.scc - config = features/scsi/scsi-debug.scc - config = features/scsi/cdrom.scc - config = features/scsi/disk.scc - config = features/scsi/scsi.scc - config = features/intel-tco/intel-tco.scc + config = features/device-mapper/dm-verity.scc + config = features/ieee802154/ieee802154-hwsim.scc + config = features/ima/ima.scc + config = features/ima/modsign.scc + config = features/fuse/fuse.scc + config = features/xen/xen.scc + config = features/powertop/powertop.scc + config = features/full_nohz/full_nohz-enable.scc + config = features/lto/lto.scc + config = features/lto/lto-debug.scc + config = features/lto/lto-disable.scc config = features/thermal/coretemp.scc - config = features/docker/docker.scc + config = features/ice/ice.scc + config = features/ramconsole/ramconsole.scc + config = features/eg20t/eg20t.scc + config = features/edac/edac-enable.scc + config = features/vfio/vfio.scc config = features/vswitch/vswitch.scc - config = features/iwlwifi/iwlwifi.scc - config = features/vxlan/vxlan-enable.scc - config = features/debug/printk.scc + config = features/dca/dca.scc + config = features/hugetlb/hugetlb.scc + config = features/intel-txt/intel-txt.scc + config = features/telemetry/intel-telemetry.scc + config = features/i3c/i3c.scc + config = features/intel-dpdk/intel-dpdk.scc + config = features/ipmi/ipmi.scc + config = features/intel-vmd/intel-vmd.scc + config = features/debug/debug-runtime.scc config = features/debug/debug-kernel.scc config = features/debug/debug-dyndbg.scc - config = features/lxc/lxc-enable.scc - config = features/intel-e1xxxx/intel-e100.scc - config = features/wifi/wifi-usb.scc - config = features/wifi/wifi-sdio.scc - config = features/wifi/wifi-pci.scc - config = features/wifi/wifi-common.scc - config = features/wifi/wifi-all.scc - config = features/intel-dpdk/intel-dpdk.scc - config = features/thunderbolt/thunderbolt.scc + config = features/debug/printk.scc + config = features/debug/debug-btf.scc + config = features/sound/snd_hda_intel.scc + config = features/zram/zram.scc config = features/random/random.scc - config = features/systemtap/systemtap.scc - config = features/firewire/firewire.scc - config = features/security/security.scc - config = features/inline/inline.scc - config = features/uio/uio.scc - config = features/leds/leds.scc - config = features/profiling/profiling.scc - config = features/stm/stm.scc config = features/mgag200/mgag200.scc - config = features/intel-txt/intel-txt.scc - config = features/fuse/fuse.scc - config = features/ciphers/ciphers.scc - config = features/igb/igb.scc - config = features/criu/criu-enable.scc - config = features/latencytop/latencytop.scc - config = features/i915/i915.scc - config = features/netfilter/netfilter.scc - config = features/can/can.scc - config = features/device-mapper/dm-verity.scc - config = features/mpx/mpx.scc - config = features/nfc/nfc-vendor.scc - config = features/nfc/nfc-generic.scc - config = features/iio/iio.scc - config = features/dca/dca.scc - config = features/kdump/kdump-enable.scc + config = features/taskstats/taskstats.scc + config = features/media/media-i2c.scc + config = features/media/media.scc + config = features/media/media-usb-tv.scc + config = features/media/media-rc.scc + config = features/media/media-usb-webcams.scc + config = features/media/media-radio.scc + config = features/media/media-platform.scc + config = features/media/media-dvb-frontends.scc + config = features/media/media-tuners.scc + config = features/media/media-pci-capture.scc + config = features/input/keyboard-gpio.scc + config = features/input/input.scc + config = features/input/touchscreen.scc + config = features/nfsd/nfsd-enable.scc + config = features/nfsd/nfsd.scc + config = features/namespaces/namespaces.scc + config = features/pci-iov/pci-iov.scc + config = features/ocicontainer/xt-checksum.scc + config = features/ocicontainer/ebtables.scc + config = features/ocicontainer/cgroup.scc + config = features/numa/numa.scc + config = features/smack/smack.scc + config = features/tpm/tpm-1.2.scc + config = features/tpm/tpm-common.scc + config = features/tpm/tpm-2.0-crb.scc + config = features/tpm/tpm.scc + config = features/tpm/tpm-2.0.scc + config = features/tpm/vtpm.scc config = features/firmware/firmware.scc - config = cgl/features/pstore/pstore.scc - config = cgl/features/mip6/mip6.scc - config = cgl/features/quota/quota.scc - config = cgl/features/audit/audit.scc - config = cgl/features/aoe/aoe.scc - config = cgl/features/selinux/selinux.scc - config = cgl/features/selinux/selinux-dev.scc - config = cgl/cfg/scsi_dh_emc.scc - config = cgl/cfg/drbd.scc - config = cgl/cfg/dmm.scc - config = cgl/cfg/fs/ocfs2.scc - config = cgl/cfg/iscsi.scc - config = cgl/cfg/scsi_dh_alua.scc - config = cgl/cfg/scsi_dh.scc - config = cgl/cfg/net/l2tp.scc - config = cgl/cfg/net/macvlan.scc - config = cgl/cfg/net/ip_vs.scc - config = cgl/cfg/scsi_dh_hpsw.scc - config = cgl/cfg/scsi_dh_rdac.scc - config = cfg/8250.scc - config = cfg/hv-guest.scc - config = cfg/vmware-guest.scc - config = cfg/rbd.scc - config = cfg/dmaengine.scc - config = cfg/smp.scc - config = cfg/paravirt_kvm.scc - config = cfg/x32.scc - config = cfg/debug-kselftest.scc - config = cfg/boot-live.scc - config = cfg/vesafb.scc - config = cfg/timer/hpet.scc - config = cfg/timer/rtc.scc - config = cfg/timer/no_hz.scc - config = cfg/timer/hz_100.scc - config = cfg/timer/hz_1000.scc - config = cfg/timer/hz_250.scc - config = cfg/sound.scc - config = cfg/fs/btrfs.scc - config = cfg/fs/flash_fs.scc - config = cfg/fs/ext3.scc - config = cfg/fs/ext2.scc - config = cfg/fs/debugfs.scc - config = cfg/fs/ext4.scc - config = cfg/fs/vfat.scc - config = cfg/fs/devtmpfs.scc - config = cfg/virtio.scc - config = cfg/net/ip6_nf.scc - config = cfg/net/ipsec.scc - config = cfg/net/ip_nf.scc - config = cfg/net/bridge.scc - config = cfg/net/ipv6.scc - config = cfg/net/ipsec6.scc - config = cfg/usb-mass-storage.scc - config = cfg/efi-ext.scc - config = cfg/efi.scc - config = cfg/smp_64.scc + config = features/intel-pinctrl/intel-pinctrl.scc + config = features/ciphers/ciphers.scc + config = features/x2apic/x2apic.scc + config = features/uio/uio.scc + config = bsp/xilinx/board-common.scc + config = bsp/xilinx/kc705-microblazeel-features/kc705-microblazeel-features.scc + config = bsp/xilinx/soc/zynq.scc + config = bsp/xilinx/soc/drivers-softip.scc + config = bsp/xilinx/zybo-linux-bd-zynq7/zybo-linux-bd-zynq7.scc + config = bsp/xilinx/ultra96-zynqmp/mipi-config-ultra96.scc + config = bsp/pentagram/sound.scc + config = bsp/pentagram/hw_emmc.scc + config = bsp/pentagram/sensors/hw_thermal.scc + config = bsp/pentagram/hw_pwm.scc + config = bsp/pentagram/usb/usb.scc + config = bsp/pentagram/usb/customers.scc + config = bsp/pentagram/hw_i2c.scc + config = bsp/pentagram/hw_sdio.scc + config = bsp/pentagram/net/hw_net.scc + config = bsp/pentagram/spi/sp_nor.scc + config = bsp/pentagram/spi/sp_nornand.scc + config = bsp/pentagram/spi/sp_nand.scc + config = bsp/pentagram/pm.scc + config = bsp/pentagram/debug/pins9.scc + config = bsp/pentagram/debug/axi_mon.scc + config = bsp/pentagram/1w/1w-gpio.scc + config = bsp/pentagram/1w/1w-slaves.scc + config = bsp/pentagram/media/video_sen.scc + config = bsp/pentagram/media/video_out.scc + config = bsp/pentagram/sdio/sdio.scc + config = bsp/pentagram/hw_nvmem.scc diff --git a/ktypes/base/base.cfg b/ktypes/base/base.cfg index 84d53be2..19bb06d8 100644 --- a/ktypes/base/base.cfg +++ b/ktypes/base/base.cfg @@ -20,13 +20,13 @@ # General setup # CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_LOCALVERSION_AUTO=n CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y -# CONFIG_AUDIT is not set +CONFIG_AUDIT=n CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" @@ -34,9 +34,9 @@ CONFIG_INITRAMFS_SOURCE="" # Resource Groups # CONFIG_SYSCTL=y -# CONFIG_EMBEDDED is not set +CONFIG_EXPERT=n CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_ALL=n CONFIG_FUTEX=y CONFIG_EPOLL=y @@ -183,10 +183,9 @@ CONFIG_SYN_COOKIES=y # TIPC Configuration (EXPERIMENTAL) # -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set +CONFIG_LLC2=n +CONFIG_X25=n +CONFIG_LAPB=n # # QoS and/or fair queueing @@ -203,7 +202,7 @@ CONFIG_SYN_COOKIES=y # # Network testing # -# CONFIG_HAMRADIO is not set +CONFIG_HAMRADIO=n # # Packet Radio protocols @@ -244,7 +243,7 @@ CONFIG_SYN_COOKIES=y # # FIR device drivers # -# CONFIG_BT is not set +CONFIG_BT=n # # Bluetooth device drivers @@ -260,7 +259,7 @@ CONFIG_SYN_COOKIES=y CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=m -# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_DRIVER=n # # Connector - unified userspace <-> kernelspace linker @@ -565,7 +564,7 @@ CONFIG_NETCONSOLE=y # Non-8250 serial port support # CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set +CONFIG_LEGACY_PTYS=n # # IPMI @@ -925,7 +924,7 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_TMPFS=y -# CONFIG_HUGETLB_PAGE is not set +CONFIG_HUGETLB_PAGE=n # # Layered filesystems @@ -934,23 +933,23 @@ CONFIG_TMPFS=y # # Miscellaneous filesystems # -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_SYSV_FS is not set +CONFIG_ADFS_FS=n +CONFIG_AFFS_FS=n +CONFIG_HFS_FS=n +CONFIG_HFSPLUS_FS=n +CONFIG_BEFS_FS=n +CONFIG_BFS_FS=n +CONFIG_EFS_FS=n +CONFIG_VXFS_FS=n +CONFIG_HPFS_FS=n +CONFIG_QNX4FS_FS=n +CONFIG_SYSV_FS=n # # Network File Systems # CONFIG_NFS_FS=y -# CONFIG_NFS_DISABLE_UDP_SUPPORT is not set +CONFIG_NFS_DISABLE_UDP_SUPPORT=n CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_ROOT_NFS=y @@ -964,20 +963,20 @@ CONFIG_RPCSEC_GSS_KRB5=y # # Partition Types # -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set +CONFIG_ACORN_PARTITION=n +CONFIG_OSF_PARTITION=n +CONFIG_AMIGA_PARTITION=n +CONFIG_ATARI_PARTITION=n CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_EFI_PARTITION is not set +CONFIG_BSD_DISKLABEL=n +CONFIG_MINIX_SUBPARTITION=n +CONFIG_SOLARIS_X86_PARTITION=n +CONFIG_UNIXWARE_DISKLABEL=n +CONFIG_LDM_PARTITION=n +CONFIG_SGI_PARTITION=n +CONFIG_ULTRIX_PARTITION=n +CONFIG_SUN_PARTITION=n +CONFIG_EFI_PARTITION=n # # Native Language Support @@ -1004,13 +1003,13 @@ CONFIG_NLS_DEFAULT="iso8859-1" # Kernel hacking # CONFIG_MAGIC_SYSRQ=y -# CONFIG_DEBUG_KERNEL is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_HIGHMEM is not set -# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=n +CONFIG_SCHEDSTATS=n +CONFIG_DEBUG_SLAB=n +CONFIG_DEBUG_SPINLOCK=n +CONFIG_DEBUG_KOBJECT=n +CONFIG_DEBUG_HIGHMEM=n +CONFIG_DEBUG_INFO=n # # Security options @@ -1079,6 +1078,10 @@ CONFIG_CRYPTO=y CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_ARC4=y CONFIG_CRYPTO_LIB_ARC4=y +CONFIG_CRYPTO_USER_API_HASH=m +CONFIG_CRYPTO_USER_API_SKCIPHER=m +CONFIG_CRYPTO_USER_API_RNG=m +CONFIG_CRYPTO_USER_API_AEAD=m # # Hardware crypto devices diff --git a/ktypes/base/base.scc b/ktypes/base/base.scc index b03f7151..bdef6a81 100644 --- a/ktypes/base/base.scc +++ b/ktypes/base/base.scc @@ -1,9 +1,9 @@ # SPDX-License-Identifier: MIT -define KERNEL_VERSION 5.9 +define KERNEL_VERSION 6.9 # Force the base configuration # uncomment this branch line for shared kernel tree builds -# branch v5.5 +branch v6.9 force kconf non-hardware base.cfg diff --git a/ktypes/base/hardware.cfg b/ktypes/base/hardware.cfg index 361ee795..36a109f8 100644 --- a/ktypes/base/hardware.cfg +++ b/ktypes/base/hardware.cfg @@ -1,3 +1,10 @@ # SPDX-License-Identifier: MIT # Items listed in here are explicitly considered as hardware items, regardless # of what Kconfig file they were found in. + +CONFIG_BMIPS_CPUFREQ +CONFIG_LOONGSON2_CPUFREQ +CONFIG_LOONGSON1_CPUFREQ +CONFIG_SPARC_US3_CPUFREQ +CONFIG_SPARC_US2E_CPUFREQ +CONFIG_QORIQ_CPUFREQ diff --git a/ktypes/base/hardware.kcf b/ktypes/base/hardware.kcf index cd79d35b..6cbeb95b 100644 --- a/ktypes/base/hardware.kcf +++ b/ktypes/base/hardware.kcf @@ -16,17 +16,16 @@ arch/arm/Kconfig arch/arm/Kconfig.assembler arch/arm/Kconfig.debug arch/arm/Kconfig-nommu +arch/arm/Kconfig.platforms arch/arm/mach-actions/Kconfig arch/arm/mach-alpine/Kconfig arch/arm/mach-artpec/Kconfig -arch/arm/mach-asm9260/Kconfig arch/arm/mach-aspeed/Kconfig arch/arm/mach-at91/Kconfig arch/arm/mach-axxia/Kconfig arch/arm/mach-bcm/Kconfig arch/arm/mach-berlin/Kconfig arch/arm/mach-clps711x/Kconfig -arch/arm/mach-cns3xxx/Kconfig arch/arm/mach-davinci/Kconfig arch/arm/mach-digicolor/Kconfig arch/arm/mach-dove/Kconfig @@ -36,9 +35,8 @@ arch/arm/mach-footbridge/Kconfig arch/arm/mach-gemini/Kconfig arch/arm/mach-highbank/Kconfig arch/arm/mach-hisi/Kconfig +arch/arm/mach-hpe/Kconfig arch/arm/mach-imx/Kconfig -arch/arm/mach-integrator/Kconfig -arch/arm/mach-iop32x/Kconfig arch/arm/mach-ixp4xx/Kconfig arch/arm/mach-keystone/Kconfig arch/arm/mach-lpc32xx/Kconfig @@ -46,28 +44,21 @@ arch/arm/mach-mediatek/Kconfig arch/arm/mach-meson/Kconfig arch/arm/mach-milbeaut/Kconfig arch/arm/mach-mmp/Kconfig -arch/arm/mach-moxart/Kconfig arch/arm/mach-mstar/Kconfig arch/arm/mach-mv78xx0/Kconfig arch/arm/mach-mvebu/Kconfig arch/arm/mach-mxs/Kconfig arch/arm/mach-nomadik/Kconfig arch/arm/mach-npcm/Kconfig -arch/arm/mach-nspire/Kconfig arch/arm/mach-omap1/Kconfig arch/arm/mach-omap2/Kconfig arch/arm/mach-orion5x/Kconfig -arch/arm/mach-oxnas/Kconfig -arch/arm/mach-picoxcell/Kconfig -arch/arm/mach-prima2/Kconfig arch/arm/mach-pxa/Kconfig arch/arm/mach-qcom/Kconfig -arch/arm/mach-rda/Kconfig arch/arm/mach-realtek/Kconfig -arch/arm/mach-realview/Kconfig arch/arm/mach-rockchip/Kconfig +arch/arm/mach-rpc/Kconfig arch/arm/mach-s3c/Kconfig -arch/arm/mach-s3c/Kconfig.s3c24xx arch/arm/mach-s3c/Kconfig.s3c64xx arch/arm/mach-s5pv210/Kconfig arch/arm/mach-sa1100/Kconfig @@ -77,33 +68,22 @@ arch/arm/mach-spear/Kconfig arch/arm/mach-sti/Kconfig arch/arm/mach-stm32/Kconfig arch/arm/mach-sunxi/Kconfig -arch/arm/mach-tango/Kconfig arch/arm/mach-tegra/Kconfig -arch/arm/mach-u300/Kconfig -arch/arm/mach-uniphier/Kconfig arch/arm/mach-ux500/Kconfig arch/arm/mach-versatile/Kconfig -arch/arm/mach-vexpress/Kconfig arch/arm/mach-vt8500/Kconfig -arch/arm/mach-zx/Kconfig arch/arm/mach-zynq/Kconfig arch/arm/mm/Kconfig -arch/arm/plat-omap/Kconfig -arch/arm/plat-pxa/Kconfig -arch/c6x/Kconfig -arch/c6x/Kconfig.debug -arch/c6x/platforms/Kconfig arch/csky/Kconfig arch/csky/Kconfig.debug arch/csky/Kconfig.platforms -arch/h8300/Kconfig -arch/h8300/Kconfig.cpu -arch/h8300/Kconfig.debug arch/hexagon/Kconfig arch/hexagon/Kconfig.debug -arch/ia64/Kconfig -arch/ia64/Kconfig.debug arch/Kconfig +arch/loongarch/crypto/Kconfig +arch/loongarch/Kconfig +arch/loongarch/Kconfig.debug +arch/loongarch/kvm/Kconfig arch/m68k/Kconfig arch/m68k/Kconfig.bus arch/m68k/Kconfig.cpu @@ -121,6 +101,7 @@ arch/mips/bcm63xx/boards/Kconfig arch/mips/bcm63xx/Kconfig arch/mips/bmips/Kconfig arch/mips/cavium-octeon/Kconfig +arch/mips/crypto/Kconfig arch/mips/generic/Kconfig arch/mips/ingenic/Kconfig arch/mips/jazz/Kconfig @@ -131,18 +112,12 @@ arch/mips/lantiq/Kconfig arch/mips/loongson2ef/Kconfig arch/mips/loongson32/Kconfig arch/mips/loongson64/Kconfig -arch/mips/netlogic/Kconfig arch/mips/pic32/Kconfig -arch/mips/pistachio/Kconfig arch/mips/ralink/Kconfig arch/mips/sgi-ip27/Kconfig arch/mips/sibyte/Kconfig arch/mips/txx9/Kconfig arch/mips/vdso/Kconfig -arch/mips/vr41xx/Kconfig -arch/nds32/Kconfig -arch/nds32/Kconfig.cpu -arch/nds32/Kconfig.debug arch/nios2/Kconfig arch/nios2/Kconfig.debug arch/nios2/platform/Kconfig.platform @@ -150,6 +125,7 @@ arch/openrisc/Kconfig arch/openrisc/Kconfig.debug arch/parisc/Kconfig arch/parisc/Kconfig.debug +arch/powerpc/crypto/Kconfig arch/powerpc/Kconfig arch/powerpc/Kconfig.debug arch/powerpc/kvm/Kconfig @@ -163,12 +139,14 @@ arch/powerpc/platforms/85xx/Kconfig arch/powerpc/platforms/86xx/Kconfig arch/powerpc/platforms/8xx/Kconfig arch/powerpc/platforms/amigaone/Kconfig +arch/powerpc/platforms/book3s/Kconfig arch/powerpc/platforms/cell/Kconfig arch/powerpc/platforms/chrp/Kconfig arch/powerpc/platforms/embedded6xx/Kconfig arch/powerpc/platforms/Kconfig arch/powerpc/platforms/Kconfig.cputype arch/powerpc/platforms/maple/Kconfig +arch/powerpc/platforms/microwatt/Kconfig arch/powerpc/platforms/pasemi/Kconfig arch/powerpc/platforms/powermac/Kconfig arch/powerpc/platforms/powernv/Kconfig @@ -179,7 +157,11 @@ arch/powerpc/sysdev/xics/Kconfig arch/powerpc/sysdev/xive/Kconfig arch/riscv/Kconfig arch/riscv/Kconfig.debug +arch/riscv/Kconfig.errata arch/riscv/Kconfig.socs +arch/riscv/kernel/tests/Kconfig.debug +arch/riscv/kvm/Kconfig +arch/s390/crypto/Kconfig arch/s390/Kconfig arch/s390/Kconfig.debug arch/s390/kvm/Kconfig @@ -196,11 +178,13 @@ arch/sh/Kconfig arch/sh/Kconfig.cpu arch/sh/Kconfig.debug arch/sh/mm/Kconfig +arch/sparc/crypto/Kconfig arch/sparc/Kconfig arch/sparc/Kconfig.debug arch/um/drivers/Kconfig arch/um/Kconfig arch/um/Kconfig.debug +arch/x86/crypto/Kconfig arch/x86/events/Kconfig arch/x86/Kconfig arch/x86/Kconfig.assembler @@ -213,6 +197,10 @@ arch/x86/xen/Kconfig arch/xtensa/Kconfig arch/xtensa/Kconfig.debug crypto/async_tx/Kconfig +drivers/accel/habanalabs/Kconfig +drivers/accel/ivpu/Kconfig +drivers/accel/Kconfig +drivers/accel/qaic/Kconfig drivers/accessibility/Kconfig drivers/accessibility/speakup/Kconfig drivers/acpi/apei/Kconfig @@ -225,6 +213,7 @@ drivers/acpi/pmic/Kconfig drivers/amba/Kconfig drivers/android/Kconfig drivers/ata/Kconfig +drivers/ata/pata_parport/Kconfig drivers/atm/Kconfig drivers/auxdisplay/Kconfig drivers/base/firmware_loader/Kconfig @@ -235,18 +224,22 @@ drivers/bcma/Kconfig drivers/block/drbd/Kconfig drivers/block/Kconfig drivers/block/mtip32xx/Kconfig -drivers/block/paride/Kconfig +drivers/block/null_blk/Kconfig drivers/block/rnbd/Kconfig drivers/block/zram/Kconfig drivers/bluetooth/Kconfig drivers/bus/fsl-mc/Kconfig drivers/bus/Kconfig +drivers/bus/mhi/ep/Kconfig +drivers/bus/mhi/host/Kconfig drivers/bus/mhi/Kconfig +drivers/cache/Kconfig +drivers/cdx/controller/Kconfig +drivers/cdx/Kconfig drivers/char/agp/Kconfig drivers/char/hw_random/Kconfig drivers/char/ipmi/Kconfig drivers/char/Kconfig -drivers/char/pcmcia/Kconfig drivers/char/tpm/Kconfig drivers/char/tpm/st33zp24/Kconfig drivers/char/xillybus/Kconfig @@ -262,22 +255,33 @@ drivers/clk/Kconfig drivers/clk/keystone/Kconfig drivers/clk/mediatek/Kconfig drivers/clk/meson/Kconfig +drivers/clk/microchip/Kconfig +drivers/clk/mstar/Kconfig drivers/clk/mvebu/Kconfig +drivers/clk/nuvoton/Kconfig +drivers/clk/pistachio/Kconfig drivers/clk/qcom/Kconfig +drivers/clk/ralink/Kconfig drivers/clk/renesas/Kconfig drivers/clk/rockchip/Kconfig drivers/clk/samsung/Kconfig drivers/clk/sifive/Kconfig +drivers/clk/socfpga/Kconfig drivers/clk/sprd/Kconfig +drivers/clk/starfive/Kconfig +drivers/clk/stm32/Kconfig drivers/clk/sunxi/Kconfig drivers/clk/sunxi-ng/Kconfig drivers/clk/tegra/Kconfig drivers/clk/ti/Kconfig drivers/clk/uniphier/Kconfig drivers/clk/versatile/Kconfig +drivers/clk/visconti/Kconfig drivers/clk/x86/Kconfig +drivers/clk/xilinx/Kconfig drivers/clk/zynqmp/Kconfig drivers/clocksource/Kconfig +drivers/comedi/Kconfig drivers/connector/Kconfig drivers/counter/Kconfig drivers/cpufreq/Kconfig @@ -288,22 +292,29 @@ drivers/cpuidle/Kconfig drivers/cpuidle/Kconfig.arm drivers/cpuidle/Kconfig.mips drivers/cpuidle/Kconfig.powerpc +drivers/cpuidle/Kconfig.riscv drivers/crypto/allwinner/Kconfig drivers/crypto/amlogic/Kconfig +drivers/crypto/aspeed/Kconfig drivers/crypto/caam/Kconfig drivers/crypto/cavium/cpt/Kconfig drivers/crypto/cavium/nitrox/Kconfig drivers/crypto/ccp/Kconfig drivers/crypto/chelsio/Kconfig drivers/crypto/hisilicon/Kconfig +drivers/crypto/intel/iaa/Kconfig +drivers/crypto/intel/ixp4xx/Kconfig +drivers/crypto/intel/Kconfig +drivers/crypto/intel/keembay/Kconfig +drivers/crypto/intel/qat/Kconfig drivers/crypto/Kconfig drivers/crypto/marvell/Kconfig drivers/crypto/nx/Kconfig -drivers/crypto/qat/Kconfig +drivers/crypto/starfive/Kconfig drivers/crypto/stm32/Kconfig -drivers/crypto/ux500/Kconfig drivers/crypto/virtio/Kconfig drivers/crypto/vmx/Kconfig +drivers/cxl/Kconfig drivers/dax/Kconfig drivers/dca/Kconfig drivers/devfreq/event/Kconfig @@ -316,26 +327,35 @@ drivers/dma/dw/Kconfig drivers/dma/fsl-dpaa2-qdma/Kconfig drivers/dma/hsu/Kconfig drivers/dma/Kconfig +drivers/dma/lgm/Kconfig drivers/dma/mediatek/Kconfig +drivers/dma/ptdma/Kconfig drivers/dma/qcom/Kconfig drivers/dma/sf-pdma/Kconfig drivers/dma/sh/Kconfig drivers/dma/ti/Kconfig +drivers/dpll/Kconfig drivers/edac/Kconfig drivers/eisa/Kconfig drivers/extcon/Kconfig drivers/firewire/Kconfig +drivers/firmware/arm_ffa/Kconfig +drivers/firmware/arm_scmi/Kconfig drivers/firmware/broadcom/Kconfig +drivers/firmware/cirrus/Kconfig drivers/firmware/efi/Kconfig drivers/firmware/google/Kconfig drivers/firmware/imx/Kconfig drivers/firmware/Kconfig drivers/firmware/meson/Kconfig +drivers/firmware/microchip/Kconfig drivers/firmware/psci/Kconfig +drivers/firmware/qcom/Kconfig drivers/firmware/smccc/Kconfig drivers/firmware/tegra/Kconfig drivers/firmware/xilinx/Kconfig drivers/fpga/Kconfig +drivers/fpga/tests/Kconfig drivers/fsi/Kconfig drivers/gnss/Kconfig drivers/gpio/Kconfig @@ -343,23 +363,24 @@ drivers/gpu/drm/amd/acp/Kconfig drivers/gpu/drm/amd/amdgpu/Kconfig drivers/gpu/drm/amd/amdkfd/Kconfig drivers/gpu/drm/amd/display/Kconfig -drivers/gpu/drm/arc/Kconfig drivers/gpu/drm/armada/Kconfig drivers/gpu/drm/arm/display/Kconfig drivers/gpu/drm/arm/Kconfig drivers/gpu/drm/aspeed/Kconfig drivers/gpu/drm/ast/Kconfig drivers/gpu/drm/atmel-hlcdc/Kconfig -drivers/gpu/drm/bochs/Kconfig drivers/gpu/drm/bridge/adv7511/Kconfig drivers/gpu/drm/bridge/analogix/Kconfig drivers/gpu/drm/bridge/cadence/Kconfig +drivers/gpu/drm/bridge/imx/Kconfig drivers/gpu/drm/bridge/Kconfig drivers/gpu/drm/bridge/synopsys/Kconfig +drivers/gpu/drm/display/Kconfig drivers/gpu/drm/etnaviv/Kconfig drivers/gpu/drm/exynos/Kconfig drivers/gpu/drm/fsl-dcu/Kconfig drivers/gpu/drm/gma500/Kconfig +drivers/gpu/drm/gud/Kconfig drivers/gpu/drm/hisilicon/hibmc/Kconfig drivers/gpu/drm/hisilicon/Kconfig drivers/gpu/drm/hisilicon/kirin/Kconfig @@ -367,12 +388,17 @@ drivers/gpu/drm/i2c/Kconfig drivers/gpu/drm/i915/Kconfig drivers/gpu/drm/i915/Kconfig.debug drivers/gpu/drm/i915/Kconfig.profile -drivers/gpu/drm/i915/Kconfig.unstable +drivers/gpu/drm/imagination/Kconfig drivers/gpu/drm/imx/dcss/Kconfig +drivers/gpu/drm/imx/ipuv3/Kconfig drivers/gpu/drm/imx/Kconfig +drivers/gpu/drm/imx/lcdc/Kconfig drivers/gpu/drm/ingenic/Kconfig drivers/gpu/drm/Kconfig +drivers/gpu/drm/kmb/Kconfig drivers/gpu/drm/lima/Kconfig +drivers/gpu/drm/logicvc/Kconfig +drivers/gpu/drm/loongson/Kconfig drivers/gpu/drm/mcde/Kconfig drivers/gpu/drm/mediatek/Kconfig drivers/gpu/drm/meson/Kconfig @@ -380,17 +406,18 @@ drivers/gpu/drm/mgag200/Kconfig drivers/gpu/drm/msm/Kconfig drivers/gpu/drm/mxsfb/Kconfig drivers/gpu/drm/nouveau/Kconfig -drivers/gpu/drm/omapdrm/displays/Kconfig -drivers/gpu/drm/omapdrm/dss/Kconfig drivers/gpu/drm/omapdrm/Kconfig drivers/gpu/drm/panel/Kconfig drivers/gpu/drm/panfrost/Kconfig drivers/gpu/drm/pl111/Kconfig drivers/gpu/drm/qxl/Kconfig drivers/gpu/drm/radeon/Kconfig -drivers/gpu/drm/rcar-du/Kconfig +drivers/gpu/drm/renesas/Kconfig +drivers/gpu/drm/renesas/rcar-du/Kconfig +drivers/gpu/drm/renesas/shmobile/Kconfig drivers/gpu/drm/rockchip/Kconfig -drivers/gpu/drm/shmobile/Kconfig +drivers/gpu/drm/solomon/Kconfig +drivers/gpu/drm/sprd/Kconfig drivers/gpu/drm/sti/Kconfig drivers/gpu/drm/stm/Kconfig drivers/gpu/drm/sun4i/Kconfig @@ -405,29 +432,37 @@ drivers/gpu/drm/vboxvideo/Kconfig drivers/gpu/drm/vc4/Kconfig drivers/gpu/drm/virtio/Kconfig drivers/gpu/drm/vmwgfx/Kconfig +drivers/gpu/drm/xe/Kconfig +drivers/gpu/drm/xe/Kconfig.debug +drivers/gpu/drm/xe/Kconfig.profile drivers/gpu/drm/xen/Kconfig drivers/gpu/drm/xlnx/Kconfig -drivers/gpu/drm/zte/Kconfig drivers/gpu/host1x/Kconfig drivers/gpu/ipu-v3/Kconfig drivers/gpu/trace/Kconfig drivers/gpu/vga/Kconfig drivers/greybus/Kconfig +drivers/hid/amd-sfh-hid/Kconfig +drivers/hid/bpf/Kconfig drivers/hid/i2c-hid/Kconfig drivers/hid/intel-ish-hid/Kconfig drivers/hid/Kconfig +drivers/hid/surface-hid/Kconfig drivers/hid/usbhid/Kconfig drivers/hsi/clients/Kconfig drivers/hsi/controllers/Kconfig drivers/hsi/Kconfig +drivers/hte/Kconfig drivers/hv/Kconfig drivers/hwmon/Kconfig drivers/hwmon/occ/Kconfig +drivers/hwmon/peci/Kconfig drivers/hwmon/pmbus/Kconfig drivers/hwspinlock/Kconfig drivers/hwtracing/coresight/Kconfig drivers/hwtracing/intel_th/Kconfig drivers/hwtracing/Kconfig +drivers/hwtracing/ptt/Kconfig drivers/hwtracing/stm/Kconfig drivers/i2c/algos/Kconfig drivers/i2c/busses/Kconfig @@ -435,31 +470,38 @@ drivers/i2c/Kconfig drivers/i2c/muxes/Kconfig drivers/i3c/Kconfig drivers/i3c/master/Kconfig -drivers/ide/Kconfig drivers/idle/Kconfig drivers/iio/accel/Kconfig drivers/iio/adc/Kconfig +drivers/iio/addac/Kconfig drivers/iio/afe/Kconfig drivers/iio/amplifiers/Kconfig drivers/iio/buffer/Kconfig +drivers/iio/cdc/Kconfig drivers/iio/chemical/Kconfig drivers/iio/common/cros_ec_sensors/Kconfig drivers/iio/common/hid-sensors/Kconfig +drivers/iio/common/inv_sensors/Kconfig drivers/iio/common/Kconfig drivers/iio/common/ms_sensors/Kconfig +drivers/iio/common/scmi_sensors/Kconfig drivers/iio/common/ssp_sensors/Kconfig drivers/iio/common/st_sensors/Kconfig drivers/iio/dac/Kconfig drivers/iio/dummy/Kconfig +drivers/iio/filter/Kconfig drivers/iio/frequency/Kconfig drivers/iio/gyro/Kconfig drivers/iio/health/Kconfig drivers/iio/humidity/Kconfig drivers/iio/imu/bmi160/Kconfig +drivers/iio/imu/bmi323/Kconfig +drivers/iio/imu/bno055/Kconfig drivers/iio/imu/inv_icm42600/Kconfig drivers/iio/imu/inv_mpu6050/Kconfig drivers/iio/imu/Kconfig drivers/iio/imu/st_lsm6dsx/Kconfig +drivers/iio/imu/st_lsm9ds0/Kconfig drivers/iio/Kconfig drivers/iio/light/Kconfig drivers/iio/magnetometer/Kconfig @@ -472,13 +514,16 @@ drivers/iio/pressure/Kconfig drivers/iio/proximity/Kconfig drivers/iio/resolver/Kconfig drivers/iio/temperature/Kconfig +drivers/iio/test/Kconfig drivers/iio/trigger/Kconfig drivers/infiniband/hw/bnxt_re/Kconfig drivers/infiniband/hw/cxgb4/Kconfig drivers/infiniband/hw/efa/Kconfig +drivers/infiniband/hw/erdma/Kconfig drivers/infiniband/hw/hfi1/Kconfig drivers/infiniband/hw/hns/Kconfig -drivers/infiniband/hw/i40iw/Kconfig +drivers/infiniband/hw/irdma/Kconfig +drivers/infiniband/hw/mana/Kconfig drivers/infiniband/hw/mlx4/Kconfig drivers/infiniband/hw/mlx5/Kconfig drivers/infiniband/hw/mthca/Kconfig @@ -512,8 +557,10 @@ drivers/input/touchscreen/Kconfig drivers/interconnect/imx/Kconfig drivers/interconnect/Kconfig drivers/interconnect/qcom/Kconfig +drivers/interconnect/samsung/Kconfig drivers/iommu/amd/Kconfig drivers/iommu/intel/Kconfig +drivers/iommu/iommufd/Kconfig drivers/iommu/Kconfig drivers/ipack/carriers/Kconfig drivers/ipack/devices/Kconfig @@ -524,9 +571,12 @@ drivers/isdn/hardware/mISDN/Kconfig drivers/isdn/Kconfig drivers/isdn/mISDN/Kconfig drivers/Kconfig +drivers/leds/blink/Kconfig +drivers/leds/flash/Kconfig drivers/leds/Kconfig +drivers/leds/rgb/Kconfig +drivers/leds/simple/Kconfig drivers/leds/trigger/Kconfig -drivers/lightnvm/Kconfig drivers/macintosh/Kconfig drivers/mailbox/Kconfig drivers/mcb/Kconfig @@ -550,11 +600,10 @@ drivers/media/dvb-frontends/cxd2880/Kconfig drivers/media/dvb-frontends/drx39xyj/Kconfig drivers/media/dvb-frontends/Kconfig drivers/media/firewire/Kconfig +drivers/media/i2c/ccs/Kconfig drivers/media/i2c/cx25840/Kconfig drivers/media/i2c/et8ek8/Kconfig drivers/media/i2c/Kconfig -drivers/media/i2c/m5mols/Kconfig -drivers/media/i2c/smiapp/Kconfig drivers/media/Kconfig drivers/media/mc/Kconfig drivers/media/mmc/Kconfig @@ -570,10 +619,12 @@ drivers/media/pci/ddbridge/Kconfig drivers/media/pci/dm1105/Kconfig drivers/media/pci/dt3155/Kconfig drivers/media/pci/intel/ipu3/Kconfig +drivers/media/pci/intel/ivsc/Kconfig +drivers/media/pci/intel/Kconfig drivers/media/pci/ivtv/Kconfig drivers/media/pci/Kconfig drivers/media/pci/mantis/Kconfig -drivers/media/pci/meye/Kconfig +drivers/media/pci/mgb4/Kconfig drivers/media/pci/netup_unidvb/Kconfig drivers/media/pci/ngene/Kconfig drivers/media/pci/pluto2/Kconfig @@ -589,19 +640,71 @@ drivers/media/pci/ttpci/Kconfig drivers/media/pci/tw5864/Kconfig drivers/media/pci/tw686x/Kconfig drivers/media/pci/tw68/Kconfig -drivers/media/platform/am437x/Kconfig +drivers/media/pci/zoran/Kconfig +drivers/media/platform/allegro-dvt/Kconfig +drivers/media/platform/amlogic/Kconfig +drivers/media/platform/amlogic/meson-ge2d/Kconfig +drivers/media/platform/amphion/Kconfig +drivers/media/platform/aspeed/Kconfig drivers/media/platform/atmel/Kconfig drivers/media/platform/cadence/Kconfig -drivers/media/platform/davinci/Kconfig -drivers/media/platform/exynos4-is/Kconfig +drivers/media/platform/chips-media/coda/Kconfig +drivers/media/platform/chips-media/Kconfig +drivers/media/platform/chips-media/wave5/Kconfig +drivers/media/platform/intel/Kconfig drivers/media/platform/Kconfig -drivers/media/platform/marvell-ccic/Kconfig -drivers/media/platform/omap/Kconfig -drivers/media/platform/rcar-vin/Kconfig -drivers/media/platform/sti/c8sectpfe/Kconfig +drivers/media/platform/marvell/Kconfig +drivers/media/platform/mediatek/jpeg/Kconfig +drivers/media/platform/mediatek/Kconfig +drivers/media/platform/mediatek/mdp3/Kconfig +drivers/media/platform/mediatek/mdp/Kconfig +drivers/media/platform/mediatek/vcodec/Kconfig +drivers/media/platform/mediatek/vpu/Kconfig +drivers/media/platform/microchip/Kconfig +drivers/media/platform/nuvoton/Kconfig +drivers/media/platform/nvidia/Kconfig +drivers/media/platform/nvidia/tegra-vde/Kconfig +drivers/media/platform/nxp/dw100/Kconfig +drivers/media/platform/nxp/imx8-isi/Kconfig +drivers/media/platform/nxp/imx-jpeg/Kconfig +drivers/media/platform/nxp/Kconfig +drivers/media/platform/qcom/camss/Kconfig +drivers/media/platform/qcom/Kconfig +drivers/media/platform/qcom/venus/Kconfig +drivers/media/platform/renesas/Kconfig +drivers/media/platform/renesas/rcar-vin/Kconfig +drivers/media/platform/renesas/rzg2l-cru/Kconfig +drivers/media/platform/rockchip/Kconfig +drivers/media/platform/rockchip/rga/Kconfig +drivers/media/platform/rockchip/rkisp1/Kconfig +drivers/media/platform/samsung/exynos4-is/Kconfig +drivers/media/platform/samsung/exynos-gsc/Kconfig +drivers/media/platform/samsung/Kconfig +drivers/media/platform/samsung/s3c-camif/Kconfig +drivers/media/platform/samsung/s5p-g2d/Kconfig +drivers/media/platform/samsung/s5p-jpeg/Kconfig +drivers/media/platform/samsung/s5p-mfc/Kconfig +drivers/media/platform/st/Kconfig +drivers/media/platform/st/sti/bdisp/Kconfig +drivers/media/platform/st/sti/c8sectpfe/Kconfig +drivers/media/platform/st/sti/delta/Kconfig +drivers/media/platform/st/sti/hva/Kconfig +drivers/media/platform/st/sti/Kconfig +drivers/media/platform/st/stm32/Kconfig drivers/media/platform/sunxi/Kconfig drivers/media/platform/sunxi/sun4i-csi/Kconfig drivers/media/platform/sunxi/sun6i-csi/Kconfig +drivers/media/platform/sunxi/sun6i-mipi-csi2/Kconfig +drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/Kconfig +drivers/media/platform/sunxi/sun8i-di/Kconfig +drivers/media/platform/sunxi/sun8i-rotate/Kconfig +drivers/media/platform/ti/am437x/Kconfig +drivers/media/platform/ti/davinci/Kconfig +drivers/media/platform/ti/Kconfig +drivers/media/platform/ti/omap3isp/Kconfig +drivers/media/platform/ti/omap/Kconfig +drivers/media/platform/verisilicon/Kconfig +drivers/media/platform/via/Kconfig drivers/media/platform/xilinx/Kconfig drivers/media/radio/Kconfig drivers/media/radio/si470x/Kconfig @@ -615,13 +718,13 @@ drivers/media/test-drivers/Kconfig drivers/media/test-drivers/vicodec/Kconfig drivers/media/test-drivers/vidtv/Kconfig drivers/media/test-drivers/vimc/Kconfig +drivers/media/test-drivers/visl/Kconfig drivers/media/test-drivers/vivid/Kconfig drivers/media/tuners/Kconfig drivers/media/usb/airspy/Kconfig drivers/media/usb/as102/Kconfig drivers/media/usb/au0828/Kconfig drivers/media/usb/b2c2/Kconfig -drivers/media/usb/cpia2/Kconfig drivers/media/usb/cx231xx/Kconfig drivers/media/usb/dvb-usb/Kconfig drivers/media/usb/dvb-usb-v2/Kconfig @@ -640,13 +743,10 @@ drivers/media/usb/pwc/Kconfig drivers/media/usb/s2255/Kconfig drivers/media/usb/siano/Kconfig drivers/media/usb/stk1160/Kconfig -drivers/media/usb/stkwebcam/Kconfig -drivers/media/usb/tm6000/Kconfig drivers/media/usb/ttusb-budget/Kconfig drivers/media/usb/ttusb-dec/Kconfig drivers/media/usb/usbtv/Kconfig drivers/media/usb/uvc/Kconfig -drivers/media/usb/zr364xx/Kconfig drivers/media/v4l2-core/Kconfig drivers/memory/Kconfig drivers/memory/samsung/Kconfig @@ -657,6 +757,7 @@ drivers/memstick/Kconfig drivers/message/fusion/Kconfig drivers/mfd/Kconfig drivers/misc/altera-stapl/Kconfig +drivers/misc/bcm-vk/Kconfig drivers/misc/c2port/Kconfig drivers/misc/cardreader/Kconfig drivers/misc/cb710/Kconfig @@ -664,12 +765,15 @@ drivers/misc/cxl/Kconfig drivers/misc/echo/Kconfig drivers/misc/eeprom/Kconfig drivers/misc/genwqe/Kconfig -drivers/misc/habanalabs/Kconfig drivers/misc/Kconfig drivers/misc/lis3lv02d/Kconfig +drivers/misc/mchp_pci1xxxx/Kconfig +drivers/misc/mei/gsc_proxy/Kconfig drivers/misc/mei/hdcp/Kconfig drivers/misc/mei/Kconfig +drivers/misc/mei/pxp/Kconfig drivers/misc/ocxl/Kconfig +drivers/misc/pvpanic/Kconfig drivers/misc/ti-st/Kconfig drivers/misc/uacce/Kconfig drivers/misc/vmw_vmci/Kconfig @@ -685,6 +789,7 @@ drivers/mtd/lpddr/Kconfig drivers/mtd/maps/Kconfig drivers/mtd/nand/Kconfig drivers/mtd/nand/onenand/Kconfig +drivers/mtd/nand/raw/brcmnand/Kconfig drivers/mtd/nand/raw/ingenic/Kconfig drivers/mtd/nand/raw/Kconfig drivers/mtd/nand/spi/Kconfig @@ -693,11 +798,11 @@ drivers/mtd/spi-nor/controllers/Kconfig drivers/mtd/spi-nor/Kconfig drivers/mtd/ubi/Kconfig drivers/mux/Kconfig -drivers/net/appletalk/Kconfig drivers/net/arcnet/Kconfig drivers/net/caif/Kconfig drivers/net/can/cc770/Kconfig drivers/net/can/c_can/Kconfig +drivers/net/can/ctucanfd/Kconfig drivers/net/can/ifi_canfd/Kconfig drivers/net/can/Kconfig drivers/net/can/m_can/Kconfig @@ -710,15 +815,20 @@ drivers/net/can/spi/Kconfig drivers/net/can/spi/mcp251xfd/Kconfig drivers/net/can/usb/Kconfig drivers/net/dsa/b53/Kconfig +drivers/net/dsa/hirschmann/Kconfig drivers/net/dsa/Kconfig drivers/net/dsa/microchip/Kconfig drivers/net/dsa/mv88e6xxx/Kconfig drivers/net/dsa/ocelot/Kconfig drivers/net/dsa/qca/Kconfig +drivers/net/dsa/realtek/Kconfig drivers/net/dsa/sja1105/Kconfig +drivers/net/dsa/xrs700x/Kconfig drivers/net/ethernet/3com/Kconfig drivers/net/ethernet/8390/Kconfig +drivers/net/ethernet/actions/Kconfig drivers/net/ethernet/adaptec/Kconfig +drivers/net/ethernet/adi/Kconfig drivers/net/ethernet/aeroflex/Kconfig drivers/net/ethernet/agere/Kconfig drivers/net/ethernet/alacritech/Kconfig @@ -733,8 +843,8 @@ drivers/net/ethernet/apm/xgene-v2/Kconfig drivers/net/ethernet/apple/Kconfig drivers/net/ethernet/aquantia/Kconfig drivers/net/ethernet/arc/Kconfig +drivers/net/ethernet/asix/Kconfig drivers/net/ethernet/atheros/Kconfig -drivers/net/ethernet/aurora/Kconfig drivers/net/ethernet/broadcom/Kconfig drivers/net/ethernet/brocade/bna/Kconfig drivers/net/ethernet/brocade/Kconfig @@ -753,6 +863,7 @@ drivers/net/ethernet/dec/tulip/Kconfig drivers/net/ethernet/dlink/Kconfig drivers/net/ethernet/emulex/benet/Kconfig drivers/net/ethernet/emulex/Kconfig +drivers/net/ethernet/engleder/Kconfig drivers/net/ethernet/ezchip/Kconfig drivers/net/ethernet/faraday/Kconfig drivers/net/ethernet/freescale/dpaa2/Kconfig @@ -762,6 +873,8 @@ drivers/net/ethernet/freescale/fman/Kconfig drivers/net/ethernet/freescale/fs_enet/Kconfig drivers/net/ethernet/freescale/Kconfig drivers/net/ethernet/fujitsu/Kconfig +drivers/net/ethernet/fungible/funeth/Kconfig +drivers/net/ethernet/fungible/Kconfig drivers/net/ethernet/google/Kconfig drivers/net/ethernet/hisilicon/Kconfig drivers/net/ethernet/huawei/hinic/Kconfig @@ -771,17 +884,24 @@ drivers/net/ethernet/ibm/emac/Kconfig drivers/net/ethernet/ibm/Kconfig drivers/net/ethernet/intel/Kconfig drivers/net/ethernet/Kconfig +drivers/net/ethernet/litex/Kconfig drivers/net/ethernet/marvell/Kconfig +drivers/net/ethernet/marvell/octeon_ep/Kconfig drivers/net/ethernet/marvell/octeontx2/Kconfig drivers/net/ethernet/marvell/prestera/Kconfig drivers/net/ethernet/mediatek/Kconfig drivers/net/ethernet/mellanox/Kconfig drivers/net/ethernet/mellanox/mlx4/Kconfig drivers/net/ethernet/mellanox/mlx5/core/Kconfig +drivers/net/ethernet/mellanox/mlxbf_gige/Kconfig drivers/net/ethernet/mellanox/mlxfw/Kconfig drivers/net/ethernet/mellanox/mlxsw/Kconfig drivers/net/ethernet/micrel/Kconfig drivers/net/ethernet/microchip/Kconfig +drivers/net/ethernet/microchip/lan966x/Kconfig +drivers/net/ethernet/microchip/sparx5/Kconfig +drivers/net/ethernet/microchip/vcap/Kconfig +drivers/net/ethernet/microsoft/Kconfig drivers/net/ethernet/moxa/Kconfig drivers/net/ethernet/mscc/Kconfig drivers/net/ethernet/myricom/Kconfig @@ -807,6 +927,7 @@ drivers/net/ethernet/samsung/Kconfig drivers/net/ethernet/seeq/Kconfig drivers/net/ethernet/sfc/falcon/Kconfig drivers/net/ethernet/sfc/Kconfig +drivers/net/ethernet/sfc/siena/Kconfig drivers/net/ethernet/sgi/Kconfig drivers/net/ethernet/silan/Kconfig drivers/net/ethernet/sis/Kconfig @@ -815,12 +936,15 @@ drivers/net/ethernet/socionext/Kconfig drivers/net/ethernet/stmicro/Kconfig drivers/net/ethernet/stmicro/stmmac/Kconfig drivers/net/ethernet/sun/Kconfig +drivers/net/ethernet/sunplus/Kconfig drivers/net/ethernet/synopsys/Kconfig drivers/net/ethernet/tehuti/Kconfig drivers/net/ethernet/ti/Kconfig drivers/net/ethernet/toshiba/Kconfig drivers/net/ethernet/tundra/Kconfig +drivers/net/ethernet/vertexcom/Kconfig drivers/net/ethernet/via/Kconfig +drivers/net/ethernet/wangxun/Kconfig drivers/net/ethernet/wiznet/Kconfig drivers/net/ethernet/xilinx/Kconfig drivers/net/ethernet/xircom/Kconfig @@ -832,21 +956,25 @@ drivers/net/hyperv/Kconfig drivers/net/ieee802154/Kconfig drivers/net/ipa/Kconfig drivers/net/Kconfig +drivers/net/mctp/Kconfig drivers/net/mdio/Kconfig drivers/net/pcs/Kconfig +drivers/net/phy/aquantia/Kconfig drivers/net/phy/Kconfig drivers/net/plip/Kconfig drivers/net/ppp/Kconfig +drivers/net/pse-pd/Kconfig drivers/net/slip/Kconfig drivers/net/team/Kconfig +drivers/net/thunderbolt/Kconfig drivers/net/usb/Kconfig +drivers/net/wan/framer/Kconfig drivers/net/wan/Kconfig -drivers/net/wimax/i2400m/Kconfig -drivers/net/wimax/Kconfig drivers/net/wireless/admtek/Kconfig drivers/net/wireless/ath/ar5523/Kconfig drivers/net/wireless/ath/ath10k/Kconfig drivers/net/wireless/ath/ath11k/Kconfig +drivers/net/wireless/ath/ath12k/Kconfig drivers/net/wireless/ath/ath5k/Kconfig drivers/net/wireless/ath/ath6kl/Kconfig drivers/net/wireless/ath/ath9k/Kconfig @@ -860,14 +988,11 @@ drivers/net/wireless/broadcom/b43legacy/Kconfig drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig drivers/net/wireless/broadcom/brcm80211/Kconfig drivers/net/wireless/broadcom/Kconfig -drivers/net/wireless/cisco/Kconfig drivers/net/wireless/intel/ipw2x00/Kconfig drivers/net/wireless/intel/iwlegacy/Kconfig drivers/net/wireless/intel/iwlwifi/Kconfig drivers/net/wireless/intel/Kconfig -drivers/net/wireless/intersil/hostap/Kconfig drivers/net/wireless/intersil/Kconfig -drivers/net/wireless/intersil/orinoco/Kconfig drivers/net/wireless/intersil/p54/Kconfig drivers/net/wireless/Kconfig drivers/net/wireless/marvell/Kconfig @@ -882,8 +1007,13 @@ drivers/net/wireless/mediatek/mt76/mt7615/Kconfig drivers/net/wireless/mediatek/mt76/mt76x0/Kconfig drivers/net/wireless/mediatek/mt76/mt76x2/Kconfig drivers/net/wireless/mediatek/mt76/mt7915/Kconfig +drivers/net/wireless/mediatek/mt76/mt7921/Kconfig +drivers/net/wireless/mediatek/mt76/mt7925/Kconfig +drivers/net/wireless/mediatek/mt76/mt7996/Kconfig drivers/net/wireless/microchip/Kconfig drivers/net/wireless/microchip/wilc1000/Kconfig +drivers/net/wireless/purelifi/Kconfig +drivers/net/wireless/purelifi/plfxlc/Kconfig drivers/net/wireless/quantenna/Kconfig drivers/net/wireless/quantenna/qtnfmac/Kconfig drivers/net/wireless/ralink/Kconfig @@ -893,7 +1023,10 @@ drivers/net/wireless/realtek/rtl818x/Kconfig drivers/net/wireless/realtek/rtl8xxxu/Kconfig drivers/net/wireless/realtek/rtlwifi/Kconfig drivers/net/wireless/realtek/rtw88/Kconfig +drivers/net/wireless/realtek/rtw89/Kconfig drivers/net/wireless/rsi/Kconfig +drivers/net/wireless/silabs/Kconfig +drivers/net/wireless/silabs/wfx/Kconfig drivers/net/wireless/st/cw1200/Kconfig drivers/net/wireless/st/Kconfig drivers/net/wireless/ti/Kconfig @@ -901,8 +1034,10 @@ drivers/net/wireless/ti/wl1251/Kconfig drivers/net/wireless/ti/wl12xx/Kconfig drivers/net/wireless/ti/wl18xx/Kconfig drivers/net/wireless/ti/wlcore/Kconfig +drivers/net/wireless/virtual/Kconfig drivers/net/wireless/zydas/Kconfig drivers/net/wireless/zydas/zd1211rw/Kconfig +drivers/net/wwan/Kconfig drivers/nfc/fdp/Kconfig drivers/nfc/Kconfig drivers/nfc/microread/Kconfig @@ -915,6 +1050,7 @@ drivers/nfc/st21nfca/Kconfig drivers/nfc/st95hf/Kconfig drivers/nfc/st-nci/Kconfig drivers/ntb/hw/amd/Kconfig +drivers/ntb/hw/epf/Kconfig drivers/ntb/hw/idt/Kconfig drivers/ntb/hw/intel/Kconfig drivers/ntb/hw/Kconfig @@ -922,9 +1058,11 @@ drivers/ntb/hw/mscc/Kconfig drivers/ntb/Kconfig drivers/ntb/test/Kconfig drivers/nvdimm/Kconfig +drivers/nvme/common/Kconfig drivers/nvme/host/Kconfig drivers/nvme/Kconfig drivers/nvmem/Kconfig +drivers/nvmem/layouts/Kconfig drivers/nvme/target/Kconfig drivers/of/Kconfig drivers/opp/Kconfig @@ -941,6 +1079,10 @@ drivers/pci/Kconfig drivers/pci/pcie/Kconfig drivers/pci/switch/Kconfig drivers/pcmcia/Kconfig +drivers/peci/controller/Kconfig +drivers/peci/Kconfig +drivers/perf/amlogic/Kconfig +drivers/perf/arm_cspmu/Kconfig drivers/perf/hisilicon/Kconfig drivers/perf/Kconfig drivers/phy/allwinner/Kconfig @@ -949,11 +1091,13 @@ drivers/phy/broadcom/Kconfig drivers/phy/cadence/Kconfig drivers/phy/freescale/Kconfig drivers/phy/hisilicon/Kconfig +drivers/phy/ingenic/Kconfig drivers/phy/intel/Kconfig drivers/phy/Kconfig drivers/phy/lantiq/Kconfig drivers/phy/marvell/Kconfig drivers/phy/mediatek/Kconfig +drivers/phy/microchip/Kconfig drivers/phy/motorola/Kconfig drivers/phy/mscc/Kconfig drivers/phy/qualcomm/Kconfig @@ -962,7 +1106,9 @@ drivers/phy/renesas/Kconfig drivers/phy/rockchip/Kconfig drivers/phy/samsung/Kconfig drivers/phy/socionext/Kconfig +drivers/phy/starfive/Kconfig drivers/phy/st/Kconfig +drivers/phy/sunplus/Kconfig drivers/phy/tegra/Kconfig drivers/phy/ti/Kconfig drivers/phy/xilinx/Kconfig @@ -973,35 +1119,78 @@ drivers/pinctrl/berlin/Kconfig drivers/pinctrl/cirrus/Kconfig drivers/pinctrl/freescale/Kconfig drivers/pinctrl/intel/Kconfig +drivers/pinctrl/intel/Kconfig.tng drivers/pinctrl/Kconfig drivers/pinctrl/mediatek/Kconfig drivers/pinctrl/meson/Kconfig drivers/pinctrl/mvebu/Kconfig drivers/pinctrl/nomadik/Kconfig drivers/pinctrl/nuvoton/Kconfig +drivers/pinctrl/nxp/Kconfig drivers/pinctrl/pxa/Kconfig drivers/pinctrl/qcom/Kconfig +drivers/pinctrl/qcom/Kconfig.msm +drivers/pinctrl/realtek/Kconfig drivers/pinctrl/renesas/Kconfig drivers/pinctrl/samsung/Kconfig drivers/pinctrl/spear/Kconfig drivers/pinctrl/sprd/Kconfig +drivers/pinctrl/starfive/Kconfig drivers/pinctrl/stm32/Kconfig +drivers/pinctrl/sunplus/Kconfig drivers/pinctrl/sunxi/Kconfig drivers/pinctrl/tegra/Kconfig drivers/pinctrl/ti/Kconfig drivers/pinctrl/uniphier/Kconfig drivers/pinctrl/visconti/Kconfig drivers/pinctrl/vt8500/Kconfig -drivers/pinctrl/zte/Kconfig drivers/platform/chrome/Kconfig drivers/platform/chrome/wilco_ec/Kconfig drivers/platform/goldfish/Kconfig drivers/platform/Kconfig +drivers/platform/loongarch/Kconfig drivers/platform/mellanox/Kconfig drivers/platform/mips/Kconfig drivers/platform/olpc/Kconfig -drivers/platform/x86/intel_speed_select_if/Kconfig +drivers/platform/surface/aggregator/Kconfig +drivers/platform/surface/Kconfig +drivers/platform/x86/amd/Kconfig +drivers/platform/x86/amd/pmc/Kconfig +drivers/platform/x86/amd/pmf/Kconfig +drivers/platform/x86/dell/Kconfig +drivers/platform/x86/hp/Kconfig +drivers/platform/x86/intel/atomisp2/Kconfig +drivers/platform/x86/intel/ifs/Kconfig +drivers/platform/x86/intel/int1092/Kconfig +drivers/platform/x86/intel/int3472/Kconfig +drivers/platform/x86/intel/Kconfig +drivers/platform/x86/intel/pmc/Kconfig +drivers/platform/x86/intel/pmt/Kconfig +drivers/platform/x86/intel/speed_select_if/Kconfig +drivers/platform/x86/intel/telemetry/Kconfig +drivers/platform/x86/intel/uncore-frequency/Kconfig +drivers/platform/x86/intel/wmi/Kconfig drivers/platform/x86/Kconfig +drivers/platform/x86/siemens/Kconfig +drivers/platform/x86/x86-android-tablets/Kconfig +drivers/pmdomain/actions/Kconfig +drivers/pmdomain/amlogic/Kconfig +drivers/pmdomain/apple/Kconfig +drivers/pmdomain/arm/Kconfig +drivers/pmdomain/bcm/Kconfig +drivers/pmdomain/imx/Kconfig +drivers/pmdomain/Kconfig +drivers/pmdomain/mediatek/Kconfig +drivers/pmdomain/qcom/Kconfig +drivers/pmdomain/renesas/Kconfig +drivers/pmdomain/rockchip/Kconfig +drivers/pmdomain/samsung/Kconfig +drivers/pmdomain/starfive/Kconfig +drivers/pmdomain/st/Kconfig +drivers/pmdomain/sunxi/Kconfig +drivers/pmdomain/tegra/Kconfig +drivers/pmdomain/ti/Kconfig +drivers/pmdomain/xilinx/Kconfig drivers/pnp/isapnp/Kconfig drivers/pnp/Kconfig drivers/pnp/pnpacpi/Kconfig @@ -1023,6 +1212,7 @@ drivers/regulator/Kconfig drivers/remoteproc/Kconfig drivers/reset/hisilicon/Kconfig drivers/reset/Kconfig +drivers/reset/starfive/Kconfig drivers/reset/sti/Kconfig drivers/reset/tegra/Kconfig drivers/rpmsg/Kconfig @@ -1044,11 +1234,13 @@ drivers/scsi/cxgbi/cxgb4i/Kconfig drivers/scsi/cxgbi/Kconfig drivers/scsi/cxlflash/Kconfig drivers/scsi/device_handler/Kconfig +drivers/scsi/elx/Kconfig drivers/scsi/esas2r/Kconfig drivers/scsi/hisi_sas/Kconfig drivers/scsi/Kconfig drivers/scsi/libsas/Kconfig drivers/scsi/megaraid/Kconfig.megaraid +drivers/scsi/mpi3mr/Kconfig drivers/scsi/mpt3sas/Kconfig drivers/scsi/mvsas/Kconfig drivers/scsi/pcmcia/Kconfig @@ -1057,128 +1249,100 @@ drivers/scsi/qedi/Kconfig drivers/scsi/qla2xxx/Kconfig drivers/scsi/qla4xxx/Kconfig drivers/scsi/smartpqi/Kconfig -drivers/scsi/ufs/Kconfig -drivers/sfi/Kconfig drivers/sh/intc/Kconfig drivers/sh/Kconfig drivers/siox/Kconfig drivers/slimbus/Kconfig -drivers/soc/actions/Kconfig drivers/soc/amlogic/Kconfig +drivers/soc/apple/Kconfig drivers/soc/aspeed/Kconfig drivers/soc/atmel/Kconfig -drivers/soc/bcm/bcm63xx/Kconfig drivers/soc/bcm/brcmstb/Kconfig drivers/soc/bcm/Kconfig +drivers/soc/canaan/Kconfig drivers/soc/fsl/Kconfig drivers/soc/fsl/qbman/Kconfig drivers/soc/fsl/qe/Kconfig +drivers/soc/fujitsu/Kconfig +drivers/soc/hisilicon/Kconfig drivers/soc/imx/Kconfig drivers/soc/ixp4xx/Kconfig drivers/soc/Kconfig -drivers/soc/kendryte/Kconfig +drivers/soc/litex/Kconfig +drivers/soc/loongson/Kconfig drivers/soc/mediatek/Kconfig +drivers/soc/microchip/Kconfig +drivers/soc/nuvoton/Kconfig +drivers/soc/pxa/Kconfig drivers/soc/qcom/Kconfig drivers/soc/renesas/Kconfig drivers/soc/rockchip/Kconfig drivers/soc/samsung/Kconfig -drivers/soc/sifive/Kconfig drivers/soc/sunxi/Kconfig drivers/soc/tegra/Kconfig drivers/soc/ti/Kconfig drivers/soc/ux500/Kconfig drivers/soc/versatile/Kconfig drivers/soc/xilinx/Kconfig -drivers/soc/zte/Kconfig drivers/soundwire/Kconfig drivers/spi/Kconfig drivers/spmi/Kconfig drivers/ssb/Kconfig -drivers/staging/android/ion/Kconfig -drivers/staging/android/Kconfig drivers/staging/axis-fifo/Kconfig drivers/staging/board/Kconfig -drivers/staging/clocking-wizard/Kconfig -drivers/staging/comedi/Kconfig drivers/staging/emxx_udc/Kconfig drivers/staging/fbtft/Kconfig drivers/staging/fieldbus/anybuss/Kconfig drivers/staging/fieldbus/Kconfig -drivers/staging/fsl-dpaa2/Kconfig -drivers/staging/fwserial/Kconfig -drivers/staging/gasket/Kconfig drivers/staging/gdm724x/Kconfig -drivers/staging/goldfish/Kconfig drivers/staging/greybus/Kconfig -drivers/staging/gs_fpgaboot/Kconfig -drivers/staging/hikey9xx/Kconfig drivers/staging/iio/accel/Kconfig drivers/staging/iio/adc/Kconfig drivers/staging/iio/addac/Kconfig -drivers/staging/iio/cdc/Kconfig drivers/staging/iio/frequency/Kconfig drivers/staging/iio/impedance-analyzer/Kconfig drivers/staging/iio/Kconfig -drivers/staging/iio/meter/Kconfig -drivers/staging/iio/resolver/Kconfig drivers/staging/Kconfig -drivers/staging/kpc2000/Kconfig drivers/staging/ks7010/Kconfig -drivers/staging/media/allegro-dvt/Kconfig drivers/staging/media/atomisp/i2c/Kconfig drivers/staging/media/atomisp/Kconfig -drivers/staging/media/hantro/Kconfig +drivers/staging/media/av7110/Kconfig +drivers/staging/media/deprecated/atmel/Kconfig drivers/staging/media/imx/Kconfig drivers/staging/media/ipu3/Kconfig drivers/staging/media/Kconfig +drivers/staging/media/max96712/Kconfig drivers/staging/media/meson/vdec/Kconfig drivers/staging/media/omap4iss/Kconfig -drivers/staging/media/rkisp1/Kconfig drivers/staging/media/rkvdec/Kconfig +drivers/staging/media/starfive/camss/Kconfig +drivers/staging/media/starfive/Kconfig drivers/staging/media/sunxi/cedrus/Kconfig drivers/staging/media/sunxi/Kconfig -drivers/staging/media/tegra-vde/Kconfig +drivers/staging/media/sunxi/sun6i-isp/Kconfig drivers/staging/media/tegra-video/Kconfig -drivers/staging/media/zoran/Kconfig drivers/staging/most/dim2/Kconfig drivers/staging/most/i2c/Kconfig drivers/staging/most/Kconfig drivers/staging/most/net/Kconfig -drivers/staging/most/sound/Kconfig drivers/staging/most/video/Kconfig -drivers/staging/mt7621-dma/Kconfig -drivers/staging/mt7621-dts/Kconfig -drivers/staging/mt7621-pci/Kconfig -drivers/staging/mt7621-pci-phy/Kconfig -drivers/staging/mt7621-pinctrl/Kconfig -drivers/staging/netlogic/Kconfig drivers/staging/nvec/Kconfig drivers/staging/octeon/Kconfig -drivers/staging/octeon-usb/Kconfig drivers/staging/olpc_dcon/Kconfig drivers/staging/pi433/Kconfig -drivers/staging/qlge/Kconfig -drivers/staging/ralink-gdma/Kconfig -drivers/staging/rtl8188eu/Kconfig drivers/staging/rtl8192e/Kconfig drivers/staging/rtl8192e/rtl8192e/Kconfig -drivers/staging/rtl8192u/Kconfig drivers/staging/rtl8712/Kconfig drivers/staging/rtl8723bs/Kconfig drivers/staging/rts5208/Kconfig drivers/staging/sm750fb/Kconfig -drivers/staging/unisys/Kconfig -drivers/staging/unisys/visorhba/Kconfig -drivers/staging/unisys/visorinput/Kconfig -drivers/staging/unisys/visornic/Kconfig drivers/staging/vc04_services/bcm2835-audio/Kconfig drivers/staging/vc04_services/bcm2835-camera/Kconfig drivers/staging/vc04_services/Kconfig drivers/staging/vc04_services/vchiq-mmal/Kconfig -drivers/staging/vme/devices/Kconfig +drivers/staging/vme_user/Kconfig drivers/staging/vt6655/Kconfig drivers/staging/vt6656/Kconfig -drivers/staging/wfx/Kconfig drivers/staging/wlan-ng/Kconfig drivers/target/iscsi/cxgbit/Kconfig drivers/target/iscsi/Kconfig @@ -1186,6 +1350,7 @@ drivers/target/Kconfig drivers/target/loopback/Kconfig drivers/target/sbp/Kconfig drivers/target/tcm_fc/Kconfig +drivers/target/tcm_remote/Kconfig drivers/tee/amdtee/Kconfig drivers/tee/Kconfig drivers/tee/optee/Kconfig @@ -1193,6 +1358,7 @@ drivers/thermal/broadcom/Kconfig drivers/thermal/intel/int340x_thermal/Kconfig drivers/thermal/intel/Kconfig drivers/thermal/Kconfig +drivers/thermal/mediatek/Kconfig drivers/thermal/qcom/Kconfig drivers/thermal/samsung/Kconfig drivers/thermal/st/Kconfig @@ -1204,6 +1370,9 @@ drivers/tty/Kconfig drivers/tty/serdev/Kconfig drivers/tty/serial/8250/Kconfig drivers/tty/serial/Kconfig +drivers/ufs/core/Kconfig +drivers/ufs/host/Kconfig +drivers/ufs/Kconfig drivers/uio/Kconfig drivers/usb/atm/Kconfig drivers/usb/cdns3/Kconfig @@ -1213,10 +1382,12 @@ drivers/usb/common/Kconfig drivers/usb/core/Kconfig drivers/usb/dwc2/Kconfig drivers/usb/dwc3/Kconfig +drivers/usb/fotg210/Kconfig drivers/usb/gadget/Kconfig drivers/usb/gadget/legacy/Kconfig drivers/usb/gadget/udc/aspeed-vhub/Kconfig drivers/usb/gadget/udc/bdc/Kconfig +drivers/usb/gadget/udc/cdns2/Kconfig drivers/usb/gadget/udc/Kconfig drivers/usb/host/Kconfig drivers/usb/image/Kconfig @@ -1236,18 +1407,25 @@ drivers/usb/typec/altmodes/Kconfig drivers/usb/typec/Kconfig drivers/usb/typec/mux/Kconfig drivers/usb/typec/tcpm/Kconfig +drivers/usb/typec/tipd/Kconfig drivers/usb/typec/ucsi/Kconfig drivers/usb/usbip/Kconfig drivers/vdpa/Kconfig +drivers/vfio/cdx/Kconfig drivers/vfio/fsl-mc/Kconfig drivers/vfio/Kconfig drivers/vfio/mdev/Kconfig +drivers/vfio/pci/hisilicon/Kconfig drivers/vfio/pci/Kconfig +drivers/vfio/pci/mlx5/Kconfig +drivers/vfio/pci/pds/Kconfig +drivers/vfio/pci/virtio/Kconfig drivers/vfio/platform/Kconfig drivers/vfio/platform/reset/Kconfig drivers/vhost/Kconfig drivers/video/backlight/Kconfig drivers/video/console/Kconfig +drivers/video/fbdev/core/Kconfig drivers/video/fbdev/geode/Kconfig drivers/video/fbdev/Kconfig drivers/video/fbdev/mmp/fb/Kconfig @@ -1261,21 +1439,22 @@ drivers/video/fbdev/omap2/omapfb/Kconfig drivers/video/fbdev/omap/Kconfig drivers/video/Kconfig drivers/video/logo/Kconfig +drivers/virt/acrn/Kconfig +drivers/virt/coco/efi_secret/Kconfig +drivers/virt/coco/Kconfig +drivers/virt/coco/sev-guest/Kconfig +drivers/virt/coco/tdx-guest/Kconfig drivers/virtio/Kconfig drivers/virt/Kconfig drivers/virt/nitro_enclaves/Kconfig drivers/virt/vboxguest/Kconfig -drivers/visorbus/Kconfig -drivers/vlynq/Kconfig -drivers/vme/boards/Kconfig -drivers/vme/bridges/Kconfig -drivers/vme/Kconfig drivers/w1/Kconfig drivers/w1/masters/Kconfig drivers/w1/slaves/Kconfig drivers/watchdog/Kconfig drivers/xen/Kconfig drivers/zorro/Kconfig +mm/damon/Kconfig mm/Kconfig mm/Kconfig.debug net/can/j1939/Kconfig @@ -1284,7 +1463,6 @@ net/iucv/Kconfig net/nfc/hci/Kconfig net/nfc/Kconfig net/nfc/nci/Kconfig -net/wimax/Kconfig sound/ac97/Kconfig sound/aoa/codecs/Kconfig sound/aoa/fabrics/Kconfig @@ -1308,7 +1486,9 @@ sound/pcmcia/Kconfig sound/ppc/Kconfig sound/sh/Kconfig sound/soc/adi/Kconfig +sound/soc/amd/acp/Kconfig sound/soc/amd/Kconfig +sound/soc/apple/Kconfig sound/soc/atmel/Kconfig sound/soc/au1x/Kconfig sound/soc/bcm/Kconfig @@ -1317,13 +1497,16 @@ sound/soc/codecs/Kconfig sound/soc/dwc/Kconfig sound/soc/fsl/Kconfig sound/soc/generic/Kconfig +sound/soc/google/Kconfig sound/soc/hisilicon/Kconfig sound/soc/img/Kconfig +sound/soc/intel/avs/boards/Kconfig sound/soc/intel/boards/Kconfig sound/soc/intel/Kconfig sound/soc/jz4740/Kconfig sound/soc/Kconfig sound/soc/kirkwood/Kconfig +sound/soc/loongson/Kconfig sound/soc/mediatek/Kconfig sound/soc/meson/Kconfig sound/soc/mxs/Kconfig @@ -1332,28 +1515,29 @@ sound/soc/qcom/Kconfig sound/soc/rockchip/Kconfig sound/soc/samsung/Kconfig sound/soc/sh/Kconfig -sound/soc/sirf/Kconfig +sound/soc/sof/amd/Kconfig sound/soc/sof/imx/Kconfig sound/soc/sof/intel/Kconfig sound/soc/sof/Kconfig +sound/soc/sof/mediatek/Kconfig sound/soc/sof/xtensa/Kconfig sound/soc/spear/Kconfig sound/soc/sprd/Kconfig +sound/soc/starfive/Kconfig sound/soc/sti/Kconfig sound/soc/stm/Kconfig sound/soc/sunxi/Kconfig sound/soc/tegra/Kconfig sound/soc/ti/Kconfig -sound/soc/txx9/Kconfig sound/soc/uniphier/Kconfig sound/soc/ux500/Kconfig sound/soc/xilinx/Kconfig sound/soc/xtensa/Kconfig -sound/soc/zte/Kconfig sound/sparc/Kconfig sound/spi/Kconfig sound/synth/Kconfig sound/usb/Kconfig sound/usb/line6/Kconfig +sound/virtio/Kconfig sound/x86/Kconfig sound/xen/Kconfig diff --git a/ktypes/base/non-hardware.cfg b/ktypes/base/non-hardware.cfg index 1b79c70e..0474699d 100644 --- a/ktypes/base/non-hardware.cfg +++ b/ktypes/base/non-hardware.cfg @@ -8,7 +8,6 @@ # Misc drivers CONFIG_BLK_DEV_LOOP -CONFIG_BLK_DEV_CRYPTOLOOP CONFIG_BLK_DEV_RAM CONFIG_BLK_DEV_NBD @@ -19,12 +18,38 @@ CONFIG_PREEMPT # Network related drivers/items. CONFIG_NET +CONFIG_NET_CORE CONFIG_NETCONSOLE +CONFIG_NETCONSOLE_DYNAMIC CONFIG_NETDEVICES CONFIG_TUN CONFIG_BONDING CONFIG_DUMMY +CONFIG_WIREGUARD +CONFIG_EQUALIZER + +CONFIG_MACVLAN +CONFIG_MACVTAP +CONFIG_IPVLAN +CONFIG_IPVTAP +CONFIG_VXLAN +CONFIG_GENEVE +CONFIG_BAREUDP +CONFIG_GTP + +CONFIG_NETPOLL +CONFIG_NET_POLL_CONTROLLER +CONFIG_NTB_NETDEV + +CONFIG_TAP +CONFIG_TUN +CONFIG_VETH +CONFIG_VIRTIO_NET +CONFIG_NLMON +CONFIG_NET_VRF +CONFIG_VSOCKMON +CONFIG_MHI_NET CONFIG_PPP CONFIG_PPP_ASYNC @@ -50,3 +75,15 @@ CONFIG_LEGACY_PTYS CONFIG_COMMON_CLK CONFIG_COMMON_CLK_DEBUG + +CONFIG_BT_HCIBTUSB +CONFIG_BT_HCIUART +CONFIG_BT_HCIUART_LL +CONFIG_BT_HCIUART_BCM +CONFIG_BT_HCIUART_QCA +CONFIG_LEGACY_PTY_COUNT + +CONFIG_XEN_NETDEV_FRONTEND +CONFIG_XEN_NETDEV_BACKEND +CONFIG_NETDEVSIM + diff --git a/ktypes/base/non-hardware.kcf b/ktypes/base/non-hardware.kcf index 1f0ff839..98a6ddf6 100644 --- a/ktypes/base/non-hardware.kcf +++ b/ktypes/base/non-hardware.kcf @@ -17,6 +17,7 @@ drivers/cpuidle/Kconfig drivers/cpuidle/Kconfig.arm drivers/cpuidle/Kconfig.mips drivers/cpuidle/Kconfig.powerpc +drivers/cpuidle/Kconfig.riscv drivers/firewire/Kconfig drivers/hv/Kconfig drivers/md/bcache/Kconfig @@ -25,93 +26,68 @@ drivers/md/persistent-data/Kconfig drivers/mtd/ubi/Kconfig drivers/remoteproc/Kconfig drivers/rpmsg/Kconfig -drivers/staging/android/ion/Kconfig -drivers/staging/android/Kconfig drivers/staging/axis-fifo/Kconfig drivers/staging/board/Kconfig -drivers/staging/clocking-wizard/Kconfig -drivers/staging/comedi/Kconfig drivers/staging/emxx_udc/Kconfig drivers/staging/fbtft/Kconfig drivers/staging/fieldbus/anybuss/Kconfig drivers/staging/fieldbus/Kconfig -drivers/staging/fsl-dpaa2/Kconfig -drivers/staging/fwserial/Kconfig -drivers/staging/gasket/Kconfig drivers/staging/gdm724x/Kconfig -drivers/staging/goldfish/Kconfig drivers/staging/greybus/Kconfig -drivers/staging/gs_fpgaboot/Kconfig -drivers/staging/hikey9xx/Kconfig drivers/staging/iio/accel/Kconfig drivers/staging/iio/adc/Kconfig drivers/staging/iio/addac/Kconfig -drivers/staging/iio/cdc/Kconfig drivers/staging/iio/frequency/Kconfig drivers/staging/iio/impedance-analyzer/Kconfig drivers/staging/iio/Kconfig -drivers/staging/iio/meter/Kconfig -drivers/staging/iio/resolver/Kconfig drivers/staging/Kconfig -drivers/staging/kpc2000/Kconfig drivers/staging/ks7010/Kconfig -drivers/staging/media/allegro-dvt/Kconfig drivers/staging/media/atomisp/i2c/Kconfig drivers/staging/media/atomisp/Kconfig -drivers/staging/media/hantro/Kconfig +drivers/staging/media/av7110/Kconfig +drivers/staging/media/deprecated/atmel/Kconfig drivers/staging/media/imx/Kconfig drivers/staging/media/ipu3/Kconfig drivers/staging/media/Kconfig +drivers/staging/media/max96712/Kconfig drivers/staging/media/meson/vdec/Kconfig drivers/staging/media/omap4iss/Kconfig -drivers/staging/media/rkisp1/Kconfig drivers/staging/media/rkvdec/Kconfig +drivers/staging/media/starfive/camss/Kconfig +drivers/staging/media/starfive/Kconfig drivers/staging/media/sunxi/cedrus/Kconfig drivers/staging/media/sunxi/Kconfig -drivers/staging/media/tegra-vde/Kconfig +drivers/staging/media/sunxi/sun6i-isp/Kconfig drivers/staging/media/tegra-video/Kconfig -drivers/staging/media/zoran/Kconfig drivers/staging/most/dim2/Kconfig drivers/staging/most/i2c/Kconfig drivers/staging/most/Kconfig drivers/staging/most/net/Kconfig -drivers/staging/most/sound/Kconfig drivers/staging/most/video/Kconfig -drivers/staging/mt7621-dma/Kconfig -drivers/staging/mt7621-dts/Kconfig -drivers/staging/mt7621-pci/Kconfig -drivers/staging/mt7621-pci-phy/Kconfig -drivers/staging/mt7621-pinctrl/Kconfig -drivers/staging/netlogic/Kconfig drivers/staging/nvec/Kconfig drivers/staging/octeon/Kconfig -drivers/staging/octeon-usb/Kconfig drivers/staging/olpc_dcon/Kconfig drivers/staging/pi433/Kconfig -drivers/staging/qlge/Kconfig -drivers/staging/ralink-gdma/Kconfig -drivers/staging/rtl8188eu/Kconfig drivers/staging/rtl8192e/Kconfig drivers/staging/rtl8192e/rtl8192e/Kconfig -drivers/staging/rtl8192u/Kconfig drivers/staging/rtl8712/Kconfig drivers/staging/rtl8723bs/Kconfig drivers/staging/rts5208/Kconfig drivers/staging/sm750fb/Kconfig -drivers/staging/unisys/Kconfig -drivers/staging/unisys/visorhba/Kconfig -drivers/staging/unisys/visorinput/Kconfig -drivers/staging/unisys/visornic/Kconfig drivers/staging/vc04_services/bcm2835-audio/Kconfig drivers/staging/vc04_services/bcm2835-camera/Kconfig drivers/staging/vc04_services/Kconfig drivers/staging/vc04_services/vchiq-mmal/Kconfig -drivers/staging/vme/devices/Kconfig +drivers/staging/vme_user/Kconfig drivers/staging/vt6655/Kconfig drivers/staging/vt6656/Kconfig -drivers/staging/wfx/Kconfig drivers/staging/wlan-ng/Kconfig drivers/vhost/Kconfig +drivers/virt/acrn/Kconfig +drivers/virt/coco/efi_secret/Kconfig +drivers/virt/coco/Kconfig +drivers/virt/coco/sev-guest/Kconfig +drivers/virt/coco/tdx-guest/Kconfig drivers/virtio/Kconfig drivers/virt/Kconfig drivers/virt/nitro_enclaves/Kconfig @@ -123,12 +99,12 @@ fs/affs/Kconfig fs/afs/Kconfig fs/aufs/Kconfig fs/autofs/Kconfig +fs/bcachefs/Kconfig fs/befs/Kconfig fs/bfs/Kconfig fs/btrfs/Kconfig fs/cachefiles/Kconfig fs/ceph/Kconfig -fs/cifs/Kconfig fs/coda/Kconfig fs/configfs/Kconfig fs/cramfs/Kconfig @@ -144,7 +120,6 @@ fs/ext4/Kconfig fs/f2fs/Kconfig fs/fat/Kconfig fs/freevxfs/Kconfig -fs/fscache/Kconfig fs/fuse/Kconfig fs/gfs2/Kconfig fs/hfs/Kconfig @@ -158,15 +133,16 @@ fs/Kconfig fs/Kconfig.binfmt fs/kernfs/Kconfig fs/minix/Kconfig +fs/netfs/Kconfig fs/nfsd/Kconfig fs/nfs/Kconfig -fs/nfs/.Kconfig.swp fs/nilfs2/Kconfig fs/nls/Kconfig fs/notify/dnotify/Kconfig fs/notify/fanotify/Kconfig fs/notify/inotify/Kconfig fs/notify/Kconfig +fs/ntfs3/Kconfig fs/ntfs/Kconfig fs/ocfs2/Kconfig fs/omfs/Kconfig @@ -179,6 +155,9 @@ fs/qnx6/Kconfig fs/quota/Kconfig fs/reiserfs/Kconfig fs/romfs/Kconfig +fs/smb/client/Kconfig +fs/smb/Kconfig +fs/smb/server/Kconfig fs/squashfs/Kconfig fs/sysfs/Kconfig fs/sysv/Kconfig @@ -192,27 +171,33 @@ fs/xfs/Kconfig fs/yaffs2/Kconfig fs/zonefs/Kconfig init/Kconfig +kernel/bpf/Kconfig kernel/bpf/preload/Kconfig kernel/dma/Kconfig kernel/gcov/Kconfig kernel/irq/Kconfig kernel/Kconfig.freezer kernel/Kconfig.hz +kernel/Kconfig.kexec kernel/Kconfig.locks kernel/Kconfig.preempt kernel/livepatch/Kconfig +kernel/module/Kconfig kernel/power/Kconfig kernel/rcu/Kconfig kernel/rcu/Kconfig.debug kernel/time/Kconfig kernel/trace/Kconfig +kernel/trace/rv/Kconfig lib/crypto/Kconfig lib/fonts/Kconfig lib/Kconfig lib/Kconfig.debug lib/Kconfig.kasan lib/Kconfig.kcsan +lib/Kconfig.kfence lib/Kconfig.kgdb +lib/Kconfig.kmsan lib/Kconfig.ubsan lib/kunit/Kconfig lib/math/Kconfig @@ -222,6 +207,7 @@ net/6lowpan/Kconfig net/8021q/Kconfig net/802/Kconfig net/9p/Kconfig +net/appletalk/Kconfig net/atm/Kconfig net/ax25/Kconfig net/batman-adv/Kconfig @@ -230,7 +216,6 @@ net/bluetooth/cmtp/Kconfig net/bluetooth/hidp/Kconfig net/bluetooth/Kconfig net/bluetooth/rfcomm/Kconfig -net/bpfilter/Kconfig net/bridge/Kconfig net/bridge/netfilter/Kconfig net/caif/Kconfig @@ -240,8 +225,6 @@ net/ceph/Kconfig net/dcb/Kconfig net/dccp/ccids/Kconfig net/dccp/Kconfig -net/decnet/Kconfig -net/decnet/netfilter/Kconfig net/dns_resolver/Kconfig net/dsa/Kconfig net/hsr/Kconfig @@ -255,12 +238,14 @@ net/ipv6/netfilter/Kconfig net/iucv/Kconfig net/kcm/Kconfig net/Kconfig +net/Kconfig.debug net/l2tp/Kconfig net/l3mdev/Kconfig net/lapb/Kconfig net/llc/Kconfig net/mac80211/Kconfig net/mac802154/Kconfig +net/mctp/Kconfig net/mpls/Kconfig net/mptcp/Kconfig net/ncsi/Kconfig @@ -291,12 +276,12 @@ net/tipc/Kconfig net/tls/Kconfig net/unix/Kconfig net/vmw_vsock/Kconfig -net/wimax/Kconfig net/wireless/Kconfig net/x25/Kconfig net/xdp/Kconfig net/xfrm/Kconfig samples/Kconfig +samples/rust/Kconfig security/apparmor/Kconfig security/integrity/evm/Kconfig security/integrity/ima/Kconfig @@ -304,6 +289,8 @@ security/integrity/Kconfig security/Kconfig security/Kconfig.hardening security/keys/Kconfig +security/keys/trusted-keys/Kconfig +security/landlock/Kconfig security/loadpin/Kconfig security/lockdown/Kconfig security/safesetid/Kconfig diff --git a/ktypes/developer/developer.cfg b/ktypes/developer/developer.cfg index 2111490e..e541f76a 100644 --- a/ktypes/developer/developer.cfg +++ b/ktypes/developer/developer.cfg @@ -16,7 +16,6 @@ # General setup # CONFIG_EXPERT=y -CONFIG_EMBEDDED=y CONFIG_DEBUG_KERNEL=y # diff --git a/ktypes/preempt-rt/preempt-rt.cfg b/ktypes/preempt-rt/preempt-rt.cfg index fb4e4fcb..3c2f676e 100644 --- a/ktypes/preempt-rt/preempt-rt.cfg +++ b/ktypes/preempt-rt/preempt-rt.cfg @@ -21,7 +21,7 @@ # CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=n # # Resource Groups @@ -157,7 +157,7 @@ CONFIG_SCTP_COOKIE_HMAC_MD5=y # CONFIG_TIPC=m -# CONFIG_ATM is not set +CONFIG_ATM=n CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m @@ -291,7 +291,6 @@ CONFIG_NET_PKTGEN=m # Parallel IDE protocol modules # CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # @@ -902,16 +901,16 @@ CONFIG_SOFT_WATCHDOG=m # # File systems # -# CONFIG_REISERFS_FS is not set -# CONFIG_REISERFS_CHECK is not set -# CONFIG_REISERFS_FS_SECURITY is not set -# CONFIG_JFS_FS is not set +CONFIG_REISERFS_FS=n +CONFIG_REISERFS_CHECK=n +CONFIG_REISERFS_FS_SECURITY=n +CONFIG_JFS_FS=n CONFIG_FS_POSIX_ACL=y -# CONFIG_OCFS2_FS is not set -# CONFIG_MINIX_FS is not set +CONFIG_OCFS2_FS=n +CONFIG_MINIX_FS=n CONFIG_ROMFS_FS=m -# CONFIG_QUOTA is not set -CONFIG_AUTOFS4_FS=y +CONFIG_QUOTA=n +CONFIG_AUTOFS_FS=y # # CD-ROM/DVD Filesystems @@ -942,8 +941,8 @@ CONFIG_CONFIGFS_FS=m # CONFIG_CIFS=m CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set +CONFIG_CODA_FS=n +CONFIG_AFS_FS=n # # Partition Types @@ -1071,7 +1070,7 @@ CONFIG_NLS_UTF8=m # Logging Options # CONFIG_SECURITY=y -# CONFIG_SECURITY_NETWORK is not set +CONFIG_SECURITY_NETWORK=n # # Cryptographic options diff --git a/ktypes/preempt-rt/preempt-rt.scc b/ktypes/preempt-rt/preempt-rt.scc index 0b410474..7ff7c0a8 100644 --- a/ktypes/preempt-rt/preempt-rt.scc +++ b/ktypes/preempt-rt/preempt-rt.scc @@ -4,9 +4,10 @@ branch preempt-rt # feature block include features/blktrace/blktrace.scc -include arch/arm/arm.scc nopatch include features/hrt/hrt.scc include features/ftrace/ftrace.scc +include arch/arm/arm.scc nopatch +include features/tmpfs/tmpfs-posix-acl.scc include features/cgroups/cgroups.scc include features/net_sched/net_sched.scc include features/kprobes/kprobes.scc diff --git a/bsp/common-pc/0001-qemux86-add-configuration-symbol-to-select-values.patch b/ktypes/standard/0001-qemux86-add-configuration-symbol-to-select-values.patch index 084ce9d6..084ce9d6 100644 --- a/bsp/common-pc/0001-qemux86-add-configuration-symbol-to-select-values.patch +++ b/ktypes/standard/0001-qemux86-add-configuration-symbol-to-select-values.patch diff --git a/ktypes/standard/standard.cfg b/ktypes/standard/standard.cfg index dbca1445..2cbeb759 100644 --- a/ktypes/standard/standard.cfg +++ b/ktypes/standard/standard.cfg @@ -21,7 +21,7 @@ # CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=n # # Resource Groups @@ -151,7 +151,7 @@ CONFIG_SCTP_COOKIE_HMAC_MD5=y # CONFIG_TIPC=m -# CONFIG_ATM is not set +CONFIG_ATM=n CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m @@ -285,7 +285,6 @@ CONFIG_NET_PKTGEN=m # Parallel IDE protocol modules # CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # @@ -897,16 +896,16 @@ CONFIG_SOFT_WATCHDOG=m # # File systems # -# CONFIG_REISERFS_FS is not set -# CONFIG_REISERFS_CHECK is not set -# CONFIG_REISERFS_FS_SECURITY is not set -# CONFIG_JFS_FS is not set +CONFIG_REISERFS_FS=n +CONFIG_REISERFS_CHECK=n +CONFIG_REISERFS_FS_SECURITY=n +CONFIG_JFS_FS=n CONFIG_FS_POSIX_ACL=y -# CONFIG_OCFS2_FS is not set -# CONFIG_MINIX_FS is not set +CONFIG_OCFS2_FS=n +CONFIG_MINIX_FS=n CONFIG_ROMFS_FS=m -# CONFIG_QUOTA is not set -CONFIG_AUTOFS4_FS=y +CONFIG_QUOTA=n +CONFIG_AUTOFS_FS=y # # CD-ROM/DVD Filesystems @@ -936,8 +935,8 @@ CONFIG_CONFIGFS_FS=m CONFIG_CIFS=y CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set +CONFIG_CODA_FS=n +CONFIG_AFS_FS=n # # Partition Types @@ -1065,7 +1064,7 @@ CONFIG_NLS_UTF8=m # Logging Options # CONFIG_SECURITY=y -# CONFIG_SECURITY_NETWORK is not set +CONFIG_SECURITY_NETWORK=n # # Cryptographic options @@ -1115,3 +1114,4 @@ CONFIG_LIBCRC32C=y CONFIG_ZLIB_DEFLATE=y CONFIG_SHMEM=y + diff --git a/ktypes/standard/standard.scc b/ktypes/standard/standard.scc index 724f95e5..63a3fb1e 100644 --- a/ktypes/standard/standard.scc +++ b/ktypes/standard/standard.scc @@ -103,3 +103,10 @@ include cfg/systemd.scc include features/rfkill/rfkill.scc include features/bpf/bpf.scc +include features/landlock/landlock.scc + +include features/kfence/kfence.scc + +include cfg/crypto-obsolete-disable.scc + +patch 0001-qemux86-add-configuration-symbol-to-select-values.patch diff --git a/ktypes/tiny/tiny.cfg b/ktypes/tiny/tiny.cfg index 4a7b23df..3dfeaa1a 100644 --- a/ktypes/tiny/tiny.cfg +++ b/ktypes/tiny/tiny.cfg @@ -3,7 +3,6 @@ # RCU Subsystem # CONFIG_EXPERT=y -CONFIG_EMBEDDED=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -11,9 +10,6 @@ CONFIG_SLUB=y CONFIG_BASE_SMALL=1 -CONFIG_PHYSICAL_START=0x1000000 -CONFIG_PHYSICAL_ALIGN=0x1000000 - # -15% of bzImage size over gz CONFIG_KERNEL_LZMA=y @@ -31,3 +27,6 @@ CONFIG_BINFMT_SCRIPT=y # Support /proc/sys CONFIG_PROC_SYSCTL=y + +CONFIG_VT=y +CONFIG_POSIX_TIMERS=y diff --git a/ktypes/tiny/yocto.cfg b/ktypes/tiny/yocto.cfg index 2e51a7d7..e891070b 100644 --- a/ktypes/tiny/yocto.cfg +++ b/ktypes/tiny/yocto.cfg @@ -20,7 +20,6 @@ CONFIG_RT_MUTEXES=y # Basic logging facilities CONFIG_PRINTK=y -CONFIG_EARLY_PRINTK=y CONFIG_PRINTK_TIME=y # Provide a minimal dynamic device fs @@ -1 +1 @@ -v5.12-rc6 +v6.9-rc2 diff --git a/patches/boot/check-console-device-file-on-fs-when-booting.patch b/patches/boot/check-console-device-file-on-fs-when-booting.patch index bbe26659..d1f3a339 100644 --- a/patches/boot/check-console-device-file-on-fs-when-booting.patch +++ b/patches/boot/check-console-device-file-on-fs-when-booting.patch @@ -1,4 +1,4 @@ -From 4a8d1cb76c2a95efbc75659a43ac643f22e8a155 Mon Sep 17 00:00:00 2001 +From 2f9c3e4ee446d66e110973eb5bf9f4f00220f186 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@windriver.com> Date: Thu, 8 Apr 2010 23:44:21 -0700 Subject: [PATCH] check console device file on fs when booting @@ -8,45 +8,45 @@ the tell tale signs is /dev/console not being a character file. To save a whole class of questions, let's just test for the condition and let the user know. +vfs_lstat() which was used previously would fail with certain +configurations. This was likely due to the involved functions being +marked __init at some point in the past. + Signed-off-by: Richard Laroque <rlarocqu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> --- - init/main.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + init/main.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/init/main.c b/init/main.c -index ae78fb68d231..69bc15d35dd0 100644 +index 649d9e4201a8..4e6af76ca199 100644 --- a/init/main.c +++ b/init/main.c -@@ -1463,6 +1463,18 @@ static int __ref kernel_init(void *unused) +@@ -1574,7 +1574,21 @@ static int __ref kernel_init(void *unused) /* Open /dev/console, for stdin/stdout/stderr, this should never fail */ void __init console_on_rootfs(void) { +- struct file *file = filp_open("/dev/console", O_RDWR, 0); ++ struct file *file; ++ +#ifndef CONFIG_BLK_DEV_INITRD -+ /* -+ * Use /dev/console to infer if the rootfs is setup properly. -+ * In case of initrd or initramfs /dev/console might be instantiated -+ * later by /init so don't do this check for CONFIG_BLK_DEV_INITRD -+ */ -+ if (vfs_lstat((char __user *) "/dev/console", (struct kstat __user *) &console_stat) -+ || !S_ISCHR(console_stat.mode)) { ++ /* ++ * Use /dev/console to infer if the rootfs is setup properly. ++ * In case of initrd or initramfs /dev/console might be instantiated ++ * later by /init so don't do this check for CONFIG_BLK_DEV_INITRD ++ */ ++ struct kstat stat; ++ if (init_stat("/dev/console", &stat, 0) || !S_ISCHR(stat.mode)) { + panic("/dev/console is missing or not a character device!\nPlease ensure your rootfs is properly configured\n"); + } +#endif + - struct file *file = filp_open("/dev/console", O_RDWR, 0); ++ file = filp_open("/dev/console", O_RDWR, 0); if (IS_ERR(file)) { -@@ -1477,6 +1489,9 @@ void __init console_on_rootfs(void) - - static noinline void __init kernel_init_freeable(void) - { -+#ifndef CONFIG_BLK_DEV_INITRD -+ struct kstat console_stat; -+#endif - /* - * Wait until kthreadd is all set-up. - */ + pr_err("Warning: unable to open an initial console.\n"); -- 2.19.1 diff --git a/patches/boot/mount_root-clarify-error-messages-for-when-no-rootfs.patch b/patches/boot/mount_root-clarify-error-messages-for-when-no-rootfs.patch index 6e455d05..286993ea 100644 --- a/patches/boot/mount_root-clarify-error-messages-for-when-no-rootfs.patch +++ b/patches/boot/mount_root-clarify-error-messages-for-when-no-rootfs.patch @@ -1,4 +1,4 @@ -From f276dd9842f8ecb7d33fb1fd8a1a0386958774c7 Mon Sep 17 00:00:00 2001 +From ca14e0ea8ac29797e9eedfda5456b818a83626e8 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Thu, 26 Nov 2009 07:32:09 -0800 Subject: [PATCH] mount_root: clarify error messages for when no rootfs found @@ -25,13 +25,13 @@ Signed-off-by: Darren Hart <dvhart@linux.intel.com> 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c -index 29d326b6c29d..882307e6dd90 100644 +index 5fdef94f0864..73d5b89d0c24 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c -@@ -458,7 +458,9 @@ void __init mount_block_root(char *name, int flags) - printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify " - "explicit textual name for \"root=\" boot option.\n"); - #endif +@@ -231,7 +231,9 @@ void __init mount_root_generic(char *name, char *pretty_name, int flags) + pr_err("\n"); + } + - panic("VFS: Unable to mount root fs on %s", b); + printk(KERN_EMERG "VFS: Unable to mount root fs on %s\n", b); + printk(KERN_EMERG "User configuration error - no valid root filesystem found\n"); @@ -39,17 +39,17 @@ index 29d326b6c29d..882307e6dd90 100644 } if (!(flags & SB_RDONLY)) { flags |= SB_RDONLY; -@@ -471,7 +473,9 @@ void __init mount_block_root(char *name, int flags) - for (p = fs_names; *p; p += strlen(p)+1) +@@ -244,7 +246,9 @@ void __init mount_root_generic(char *name, char *pretty_name, int flags) + for (i = 0, p = fs_names; i < num_fs; i++, p += strlen(p)+1) printk(" %s", p); printk("\n"); -- panic("VFS: Unable to mount root fs on %s", b); -+ printk(KERN_EMERG "VFS: Unable to mount root fs on %s\n", b); +- panic("VFS: Unable to mount root fs on \"%s\" or %s", pretty_name, b); ++ printk(KERN_EMERG "VFS: Unable to mount root fs on \"%s\" or %s\n", pretty_name, b); + printk(KERN_EMERG "User configuration error - no valid root filesystem found\n"); + panic("Invalid configuration from end user prevents continuing"); out: put_page(page); } -- -2.19.1 +2.34.1 diff --git a/patches/build/build.scc b/patches/build/build.scc index 181da38c..367c0cc2 100644 --- a/patches/build/build.scc +++ b/patches/build/build.scc @@ -8,3 +8,7 @@ patch kbuild-exclude-meta-directory-from-distclean-processi.patch patch modpost-mask-trivial-warnings.patch patch menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch + +# solved in 6.x by removing the need for ASM_GOTO as an arch dependency +#patch init-Kconfig-fix-CC_HAS_ASM_GOTO_TIED_OUTPUT-test-wi.patch +patch mconf-fix-output-of-cflags-and-libraries.patch diff --git a/patches/build/init-Kconfig-fix-CC_HAS_ASM_GOTO_TIED_OUTPUT-test-wi.patch b/patches/build/init-Kconfig-fix-CC_HAS_ASM_GOTO_TIED_OUTPUT-test-wi.patch new file mode 100644 index 00000000..13bfce6d --- /dev/null +++ b/patches/build/init-Kconfig-fix-CC_HAS_ASM_GOTO_TIED_OUTPUT-test-wi.patch @@ -0,0 +1,103 @@ +From e0e977e1b098d96389f2ab657849456ded9189c9 Mon Sep 17 00:00:00 2001 +From: Alexandre Belloni <alexandre.belloni@bootlin.com> +Date: Thu, 4 Aug 2022 21:03:20 +0200 +Subject: [PATCH] init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When using dash as /bin/sh, the CC_HAS_ASM_GOTO_TIED_OUTPUT test fails +with a syntax error which is not the one we are looking for: + +<stdin>: In function ‘foo’: +<stdin>:1:29: warning: missing terminating " character +<stdin>:1:29: error: missing terminating " character +<stdin>:2:5: error: expected ‘:’ before ‘+’ token +<stdin>:2:7: warning: missing terminating " character +<stdin>:2:7: error: missing terminating " character +<stdin>:2:5: error: expected declaration or statement at end of input + +Move all the CC_HAS_ASM_GOTO tests to scripts/gcc-goto.sh to solve the +escaping issues. + +Fixes: 1aa0e8b144b6 ("Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug") +Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + init/Kconfig | 6 +++--- + scripts/gcc-goto.sh | 31 +++++++++++++++++++++++++++++++ + 2 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/init/Kconfig b/init/Kconfig +index c7900e8975f1..80b252ba58b0 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -71,16 +71,16 @@ config CC_CAN_LINK_STATIC + default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag) -static) + + config CC_HAS_ASM_GOTO +- def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC)) ++ def_bool $(success,$(srctree)/scripts/gcc-goto.sh goto $(CC)) + + config CC_HAS_ASM_GOTO_OUTPUT + depends on CC_HAS_ASM_GOTO +- def_bool $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null) ++ def_bool $(success,$(srctree)/scripts/gcc-goto.sh goto_output $(CC)) + + config CC_HAS_ASM_GOTO_TIED_OUTPUT + depends on CC_HAS_ASM_GOTO_OUTPUT + # Detect buggy gcc and clang, fixed in gcc-11 clang-14. +- def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null) ++ def_bool $(success,$(srctree)/scripts/gcc-goto.sh goto_tied_output $(CC)) + + config TOOLS_SUPPORT_RELR + def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh) +diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh +index 8b980fb2270a..aa9498b74df8 100755 +--- a/scripts/gcc-goto.sh ++++ b/scripts/gcc-goto.sh +@@ -3,6 +3,11 @@ + # Test for gcc 'asm goto' support + # Copyright (C) 2010, Jason Baron <jbaron@redhat.com> + ++TEST=$1 ++shift ++ ++case $TEST in ++ "goto") + cat << "END" | $@ -x c - -fno-PIE -c -o /dev/null + int main(void) + { +@@ -20,3 +25,29 @@ entry: + return 0; + } + END ++ ;; ++ ++ "goto_output") ++cat << "END" | $@ -x c - -c -o /dev/null ++int foo(int x) { ++ asm goto ("": "=r"(x) ::: bar); ++ return x; ++ bar: return 0; ++} ++END ++ ;; ++ ++ "goto_tied_output") ++cat << "END" | $@ -x c - -c -o /dev/null ++int foo(int *x) { ++ asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); ++ return *x; ++ bar: return 0; ++} ++END ++ ;; ++ ++ *) ++ exit -1 ++ ;; ++esac +-- +2.19.1 + diff --git a/patches/build/mconf-fix-output-of-cflags-and-libraries.patch b/patches/build/mconf-fix-output-of-cflags-and-libraries.patch new file mode 100644 index 00000000..565f51dd --- /dev/null +++ b/patches/build/mconf-fix-output-of-cflags-and-libraries.patch @@ -0,0 +1,38 @@ +From dee78ad1963cff9c063fba486d43fc9670285883 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Mon, 17 Jul 2023 17:17:55 -0400 +Subject: [PATCH] mconf: fix output of cflags and libraries + +commit 3122c84409d578a5df8bcb1 [kconfig: refactor Makefile to reduce +process forks] changes the way that flags are detected. They are +no longer just echo'd and captured, they are written to a file and +later read. + +We adjust our CROSS ncurses patch accordingly. + +We'll eventually be able to drop this patch, but not quite yet. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + scripts/kconfig/mconf-cfg.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh +index 38cf8304bb31..a5ae56e08b07 100755 +--- a/scripts/kconfig/mconf-cfg.sh ++++ b/scripts/kconfig/mconf-cfg.sh +@@ -8,9 +8,9 @@ PKG="ncursesw" + PKG2="ncurses" + + if [ "$CROSS_CURSES_LIB" != "" ]; then +- echo libs=\'$CROSS_CURSES_LIB\' ++ echo $CROSS_CURSES_LIB > ${libs} + if [ x"$CROSS_CURSES_INC" != x ]; then +- echo cflags=\'$CROSS_CURSES_INC\' ++ echo $CROSS_CURSES_INC > ${cflags} + fi + exit 0 + fi +-- +2.34.1 + diff --git a/patches/build/menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch b/patches/build/menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch index dde1554d..9a301b63 100644 --- a/patches/build/menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch +++ b/patches/build/menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch @@ -1,4 +1,4 @@ -From b50cad575d2b9d3f8fc0b01e83a5c7fd3cddb684 Mon Sep 17 00:00:00 2001 +From 660178adc3529a6cb06bd0bfdfd22c5cb24cee5c Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@windriver.com> Date: Mon, 2 Jul 2018 23:10:28 -0400 Subject: [PATCH] menuconfig,mconf-cfg: Allow specification of ncurses location @@ -26,9 +26,7 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> mode change 100755 => 100644 scripts/kconfig/mconf-cfg.sh diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh -old mode 100755 -new mode 100644 -index c812872d7f9d..65a9b9e5b8a6 +index 025b565e0b7c..a3c59b360ca3 --- a/scripts/kconfig/mconf-cfg.sh +++ b/scripts/kconfig/mconf-cfg.sh @@ -4,6 +4,14 @@ @@ -43,9 +41,9 @@ index c812872d7f9d..65a9b9e5b8a6 + exit 0 +fi + - if [ -n "$(command -v pkg-config)" ]; then - if pkg-config --exists $PKG; then - echo cflags=\"$(pkg-config --cflags $PKG)\" + if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then + if ${HOSTPKG_CONFIG} --exists $PKG; then + echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\" -- -2.5.0 +2.19.1 diff --git a/patches/build/modpost-mask-trivial-warnings.patch b/patches/build/modpost-mask-trivial-warnings.patch index 08fd5c6d..1b202f5d 100644 --- a/patches/build/modpost-mask-trivial-warnings.patch +++ b/patches/build/modpost-mask-trivial-warnings.patch @@ -1,4 +1,4 @@ -From 2bd4c7ee27258a4fc8cc2a157e44f6119e5bc9e4 Mon Sep 17 00:00:00 2001 +From 14ad0a1925fad537a485227a5d89eb4329975e97 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker <paul.gortmaker@windriver.com> Date: Sun, 25 Jan 2009 17:58:09 -0500 Subject: [PATCH] modpost: mask trivial warnings @@ -11,14 +11,14 @@ once the kernel build kicks off. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- - scripts/mod/modpost.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + scripts/mod/modpost.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c -index 6aea65c65745..53b7061212ae 100644 +index 620dc8c4c814..618c4a9e83ed 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1986,7 +1986,7 @@ static void read_symbols(const char *modname) +@@ -1964,7 +1964,7 @@ static void read_symbols(const char *modname) char *license; char *namespace; struct module *mod; @@ -27,24 +27,15 @@ index 6aea65c65745..53b7061212ae 100644 Elf_Sym *sym; if (!parse_elf(&info, modname)) -@@ -2487,7 +2487,7 @@ static int dump_sym(struct symbol *sym) +@@ -2455,7 +2455,7 @@ static void read_dump(const char *fname) static void write_dump(const char *fname) { - struct buffer buf = { }; + struct buffer buf = { NULL, 0, 0 }; - struct symbol *symbol; - const char *namespace; - int n; -@@ -2541,7 +2541,7 @@ struct dump_list { - int main(int argc, char **argv) - { struct module *mod; -- struct buffer buf = { }; -+ struct buffer buf = { NULL, 0, 0 }; - char *missing_namespace_deps = NULL; - char *dump_write = NULL, *files_source = NULL; - int opt; + struct symbol *sym; + -- 2.19.1 diff --git a/patches/drivers/drivers.scc b/patches/drivers/drivers.scc index 548d2d44..4d7a225e 100644 --- a/patches/drivers/drivers.scc +++ b/patches/drivers/drivers.scc @@ -1 +1,2 @@ # SPDX-License-Identifier: MIT +patch mtd_blkdevs-add-mtd_table_mutex-lock-back-to-blktran.patch diff --git a/patches/drivers/mtd_blkdevs-add-mtd_table_mutex-lock-back-to-blktran.patch b/patches/drivers/mtd_blkdevs-add-mtd_table_mutex-lock-back-to-blktran.patch new file mode 100644 index 00000000..6d36effb --- /dev/null +++ b/patches/drivers/mtd_blkdevs-add-mtd_table_mutex-lock-back-to-blktran.patch @@ -0,0 +1,89 @@ +From 30350f237490eb52050647b2a75f6f4e91b2e44d Mon Sep 17 00:00:00 2001 +From: LiweiSong <liwei.song@windriver.com> +Date: Wed, 31 May 2023 17:31:35 +0800 +Subject: [PATCH] mtd_blkdevs: add mtd_table_mutex lock back to blktrans_{open, + release} to avoid race condition + +without lock mtd_table_mutex in blktrans_{open, release}, there will +be a race condition when access devices /dev/mtd1 and /dev/mtdblock1 +at the same time with a high frequency open and close test: + +kernel BUG at drivers/mtd/mtdcore.c:1221! +Internal error: Oops - BUG: 0 1 PREEMPT_RT SMP +CPU: 0 PID: 15349 Comm: mtd-test Not tainted 5.15.52-rt41-yocto-preempt-rt #1 +Hardware name: SoCFPGA Stratix 10 SoCDK (DT) +pstate: 60000005put_mtd_device+0x4c/0x84 +lr : blktrans_release+0xb0/0x120 +Call trace: +__put_mtd_device+0x4c/0x84 +blktrans_release+0xb0/0x120 +blkdev_put+0xd4/0x210 +blkdev_close+0x34/0x50 +__fput+0x8c/0x240 +____fput+0x1c/0x30 +task_work_run+0x98/00t_64_sync_handler+0xa4/0x130 +el0t_64_sync+0x1a0/0x1a4 + +since the original purpose of commit 799ae31c58ae ("mtd_blkdevs: +don't hold del_mtd_blktrans_dev in blktrans_{open, release}") is +to fix a DEADLOCK issue, here convert mutex_lock to mutex_trylock +and return immediately if failed acquire mtd_table_mutex, then +both race condition and DEADLOCK can be avoided. + +Fixes: 799ae31c58ae ("mtd_blkdevs: don't hold del_mtd_blktrans_dev in blktrans_{open, release}") +Signed-off-by: Liwei Song <liwei.song@windriver.com> +Signed-off-by: He Zhe <zhe.he@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + drivers/mtd/mtd_blkdevs.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c +index 60b222799871..31967ff4b826 100644 +--- a/drivers/mtd/mtd_blkdevs.c ++++ b/drivers/mtd/mtd_blkdevs.c +@@ -189,6 +189,8 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) + + kref_get(&dev->ref); + ++ if (!mutex_trylock(&mtd_table_mutex)) ++ return ret; + mutex_lock(&dev->lock); + + if (dev->open) +@@ -213,6 +215,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) + unlock: + dev->open++; + mutex_unlock(&dev->lock); ++ mutex_unlock(&mtd_table_mutex); + return ret; + + error_release: +@@ -221,6 +224,7 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) + error_put: + module_put(dev->tr->owner); + mutex_unlock(&dev->lock); ++ mutex_unlock(&mtd_table_mutex); + blktrans_dev_put(dev); + return ret; + } +@@ -229,6 +233,8 @@ static void blktrans_release(struct gendisk *disk, fmode_t mode) + { + struct mtd_blktrans_dev *dev = disk->private_data; + ++ if (!mutex_trylock(&mtd_table_mutex)) ++ return; + mutex_lock(&dev->lock); + + if (--dev->open) +@@ -243,6 +249,7 @@ static void blktrans_release(struct gendisk *disk, fmode_t mode) + } + unlock: + mutex_unlock(&dev->lock); ++ mutex_unlock(&mtd_table_mutex); + blktrans_dev_put(dev); + } + +-- +2.34.1 + diff --git a/patches/misc/defconfigs-drop-obselete-options.patch b/patches/misc/defconfigs-drop-obselete-options.patch index ad492896..9005ff6f 100644 --- a/patches/misc/defconfigs-drop-obselete-options.patch +++ b/patches/misc/defconfigs-drop-obselete-options.patch @@ -1,4 +1,4 @@ -From 59220b096dbf3d5f595a15d9399abb04be1e8d0b Mon Sep 17 00:00:00 2001 +From 681badc58988e7d15aaf4b4b239b352b1601c3c2 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield <bruce.ashfield@gmail.com> Date: Mon, 10 Aug 2020 22:40:22 -0400 Subject: [PATCH] defconfigs: drop obselete options @@ -16,16 +16,13 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> arch/arm/configs/axm55xx_defconfig | 1 - arch/arm/configs/davinci_all_defconfig | 1 - arch/arm/configs/dove_defconfig | 1 - - arch/arm/configs/imx_v6_v7_defconfig | 1 - arch/arm/configs/keystone_defconfig | 1 - arch/arm/configs/mvebu_v5_defconfig | 1 - - arch/arm/configs/mvebu_v7_defconfig | 1 - arch/arm/configs/mxs_defconfig | 1 - arch/arm/configs/pxa_defconfig | 1 - arch/arm/configs/qcom_defconfig | 1 - arch/arm/configs/socfpga_defconfig | 1 - - arch/arm/configs/tegra_defconfig | 1 - - 12 files changed, 12 deletions(-) + 9 files changed, 9 deletions(-) diff --git a/arch/arm/configs/axm55xx_defconfig b/arch/arm/configs/axm55xx_defconfig index 46075216ee6d..c731d4ade857 100644 @@ -52,7 +49,7 @@ index e849367c0566..4d8f6f647dc6 100644 CONFIG_MTD_NAND_DAVINCI=m CONFIG_MTD_SPI_NOR=m diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig -index e70c997d5f4c..546afafa63fb 100644 +index 33074fdab2ea..7a548296ea8c 100644 --- a/arch/arm/configs/dove_defconfig +++ b/arch/arm/configs/dove_defconfig @@ -44,7 +44,6 @@ CONFIG_MTD_CFI_GEOMETRY=y @@ -63,18 +60,6 @@ index e70c997d5f4c..546afafa63fb 100644 CONFIG_MTD_SPI_NOR=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y -diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig -index 70928cc48939..2f57610f9ca5 100644 ---- a/arch/arm/configs/imx_v6_v7_defconfig -+++ b/arch/arm/configs/imx_v6_v7_defconfig -@@ -98,7 +98,6 @@ CONFIG_MTD_CFI_AMDSTD=y - CONFIG_MTD_CFI_STAA=y - CONFIG_MTD_PHYSMAP_OF=y - CONFIG_MTD_DATAFLASH=y --CONFIG_MTD_M25P80=y - CONFIG_MTD_SST25L=y - CONFIG_MTD_RAW_NAND=y - CONFIG_MTD_NAND_GPMI_NAND=y diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig index 33c917df7b32..081cd5fa2358 100644 --- a/arch/arm/configs/keystone_defconfig @@ -88,7 +73,7 @@ index 33c917df7b32..081cd5fa2358 100644 CONFIG_MTD_NAND_DAVINCI=y CONFIG_MTD_SPI_NOR=y diff --git a/arch/arm/configs/mvebu_v5_defconfig b/arch/arm/configs/mvebu_v5_defconfig -index 4f16716bfc32..819ba7958528 100644 +index d57ff30dabff..3feef3fbc918 100644 --- a/arch/arm/configs/mvebu_v5_defconfig +++ b/arch/arm/configs/mvebu_v5_defconfig @@ -74,7 +74,6 @@ CONFIG_MTD_CFI_GEOMETRY=y @@ -99,18 +84,6 @@ index 4f16716bfc32..819ba7958528 100644 CONFIG_MTD_RAW_NAND=y CONFIG_MTD_NAND_ORION=y CONFIG_MTD_SPI_NOR=y -diff --git a/arch/arm/configs/mvebu_v7_defconfig b/arch/arm/configs/mvebu_v7_defconfig -index cddce57fe4b9..c8f4723d99c7 100644 ---- a/arch/arm/configs/mvebu_v7_defconfig -+++ b/arch/arm/configs/mvebu_v7_defconfig -@@ -50,7 +50,6 @@ CONFIG_MTD_CFI_INTELEXT=y - CONFIG_MTD_CFI_AMDSTD=y - CONFIG_MTD_CFI_STAA=y - CONFIG_MTD_PHYSMAP_OF=y --CONFIG_MTD_M25P80=y - CONFIG_MTD_RAW_NAND=y - CONFIG_MTD_NAND_MARVELL=y - CONFIG_MTD_SPI_NOR=y diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig index ca32446b187f..bd87306385ad 100644 --- a/arch/arm/configs/mxs_defconfig @@ -124,7 +97,7 @@ index ca32446b187f..bd87306385ad 100644 CONFIG_MTD_RAW_NAND=y CONFIG_MTD_NAND_GPMI_NAND=y diff --git a/arch/arm/configs/pxa_defconfig b/arch/arm/configs/pxa_defconfig -index bd7dd81c9c54..17cd2ffa61be 100644 +index 58f4834289e6..87bbad9b3055 100644 --- a/arch/arm/configs/pxa_defconfig +++ b/arch/arm/configs/pxa_defconfig @@ -178,7 +178,6 @@ CONFIG_MTD_RAM=m @@ -136,7 +109,7 @@ index bd7dd81c9c54..17cd2ffa61be 100644 CONFIG_MTD_DOCG3=m CONFIG_MTD_RAW_NAND=m diff --git a/arch/arm/configs/qcom_defconfig b/arch/arm/configs/qcom_defconfig -index 3f36887e8333..6b013d67e3cf 100644 +index 0daa9c0d298e..f03cf1f465fb 100644 --- a/arch/arm/configs/qcom_defconfig +++ b/arch/arm/configs/qcom_defconfig @@ -61,7 +61,6 @@ CONFIG_DEVTMPFS=y @@ -148,7 +121,7 @@ index 3f36887e8333..6b013d67e3cf 100644 CONFIG_MTD_NAND_QCOM=y CONFIG_MTD_SPI_NOR=y diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig -index 0c60eb382c80..e88865fc7eee 100644 +index 2d9404ea52c6..f7ae6f5867ed 100644 --- a/arch/arm/configs/socfpga_defconfig +++ b/arch/arm/configs/socfpga_defconfig @@ -47,7 +47,6 @@ CONFIG_DEVTMPFS=y @@ -159,18 +132,6 @@ index 0c60eb382c80..e88865fc7eee 100644 CONFIG_MTD_RAW_NAND=y CONFIG_MTD_NAND_DENALI_DT=y CONFIG_MTD_SPI_NOR=y -diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig -index 13ef3e4dcbb7..0fa4a025abdd 100644 ---- a/arch/arm/configs/tegra_defconfig -+++ b/arch/arm/configs/tegra_defconfig -@@ -86,7 +86,6 @@ CONFIG_DEVTMPFS=y - CONFIG_DEVTMPFS_MOUNT=y - CONFIG_TEGRA_GMI=y - CONFIG_MTD=y --CONFIG_MTD_M25P80=y - CONFIG_MTD_SPI_NOR=y - CONFIG_BLK_DEV_LOOP=y - CONFIG_AD525X_DPOT=y -- 2.19.1 diff --git a/patches/misc/iwlwifi-select-MAC80211_LEDS-conditionally.patch b/patches/misc/iwlwifi-select-MAC80211_LEDS-conditionally.patch new file mode 100644 index 00000000..2db53044 --- /dev/null +++ b/patches/misc/iwlwifi-select-MAC80211_LEDS-conditionally.patch @@ -0,0 +1,36 @@ +From 4e50d844ef9f358236e3c711b5a669ca721623e8 Mon Sep 17 00:00:00 2001 +From: Liwei Song <liwei.song@windriver.com> +Date: Mon, 28 Jun 2021 17:04:40 +0800 +Subject: [PATCH] iwlwifi: select MAC80211_LEDS conditionally + +MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211, +add condition to enable it in iwlwifi/Kconfig to avoid below +compile warning when LEDS_CLASS was set to m: + +WARNING: unmet direct dependencies detected for MAC80211_LEDS + Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y]) + Selected by [m]: + - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m]) + +Signed-off-by: Liwei Song <liwei.song@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + drivers/net/wireless/intel/iwlwifi/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig b/drivers/net/wireless/intel/iwlwifi/Kconfig +index 1085afbefba8..0e1de69c259f 100644 +--- a/drivers/net/wireless/intel/iwlwifi/Kconfig ++++ b/drivers/net/wireless/intel/iwlwifi/Kconfig +@@ -50,7 +50,7 @@ config IWLWIFI_LEDS + depends on LEDS_CLASS=y || LEDS_CLASS=IWLWIFI + depends on IWLMVM || IWLDVM + select LEDS_TRIGGERS +- select MAC80211_LEDS ++ select MAC80211_LEDS if (LEDS_CLASS=y || LEDS_CLASS=MAC80211) + default y + + config IWLDVM +-- +2.19.1 + diff --git a/patches/misc/lib-build_OID_registry-fix-reproducibility-issues.patch b/patches/misc/lib-build_OID_registry-fix-reproducibility-issues.patch new file mode 100644 index 00000000..da04c927 --- /dev/null +++ b/patches/misc/lib-build_OID_registry-fix-reproducibility-issues.patch @@ -0,0 +1,43 @@ +From 2fca0fd719812ea2ff67630b01355aa80481623e Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Sun, 10 Jul 2022 22:56:53 -0400 +Subject: [PATCH] lib/build_OID_registry: fix reproducibility issues + +The script build_OID_registry captures the full path of itself +in the generated data. This causes reproduciblity issues as the +path is captured and packaged. + +We use the basename of the script instead, and that allows us +to be reprodicible, with slightly less information captured in +the output data (but the generating script can still easily +be found). + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + lib/build_OID_registry | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/build_OID_registry b/lib/build_OID_registry +index d7fc32ea8ac2..f6de0a7f7457 100755 +--- a/lib/build_OID_registry ++++ b/lib/build_OID_registry +@@ -8,6 +8,7 @@ + # + + use strict; ++use File::Basename; + + my @names = (); + my @oids = (); +@@ -35,7 +36,7 @@ close IN_FILE || die; + # + open C_FILE, ">$ARGV[1]" or die; + print C_FILE "/*\n"; +-print C_FILE " * Automatically generated by ", $0, ". Do not edit\n"; ++print C_FILE " * Automatically generated by ", basename $0, ". Do not edit\n"; + print C_FILE " */\n"; + + # +-- +2.19.1 + diff --git a/patches/misc/linux-yocto-Handle-bin-awk-issues.patch b/patches/misc/linux-yocto-Handle-bin-awk-issues.patch index 88739fb8..6c524699 100644 --- a/patches/misc/linux-yocto-Handle-bin-awk-issues.patch +++ b/patches/misc/linux-yocto-Handle-bin-awk-issues.patch @@ -1,4 +1,4 @@ -From 8bbf2b4e5a9d91bf465b4a370591abec1ba397bb Mon Sep 17 00:00:00 2001 +From 3e7a2ca72d99a2277ac42c578bd8f55ef9ef9141 Mon Sep 17 00:00:00 2001 From: Richard Purdie <richard.purdie@linuxfoundation.org> Date: Tue, 22 Aug 2017 09:50:50 +0100 Subject: [PATCH] linux-yocto: Handle /bin/awk issues @@ -11,14 +11,12 @@ Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> --- - arch/arm/tools/gen-mach-types | 2 +- - arch/sh/tools/gen-mach-types | 2 +- - arch/x86/tools/gen-insn-attr-x86.awk | 2 +- - tools/arch/x86/tools/gen-insn-attr-x86.awk | 2 +- - tools/perf/arch/x86/tests/gen-insn-x86-dat.awk | 2 +- - .../selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk | 0 - 6 files changed, 5 insertions(+), 5 deletions(-) - mode change 100755 => 100644 tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk + arch/arm/tools/gen-mach-types | 2 +- + arch/sh/tools/gen-mach-types | 2 +- + arch/x86/tools/gen-insn-attr-x86.awk | 2 +- + tools/arch/x86/tools/gen-insn-attr-x86.awk | 2 +- + tools/perf/arch/x86/tests/gen-insn-x86-dat.awk | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types index cbe1c33bb871..cb2b69f2a39d 100644 @@ -41,7 +39,7 @@ index 6d7c2d8eaf55..2a4a42a6d70c 100644 # # Awk script to generate include/generated/machtypes.h diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk -index a42015b305f4..1c2832e9f77d 100644 +index af38469afd14..21a7a5db887e 100644 --- a/arch/x86/tools/gen-insn-attr-x86.awk +++ b/arch/x86/tools/gen-insn-attr-x86.awk @@ -1,4 +1,4 @@ @@ -51,7 +49,7 @@ index a42015b305f4..1c2832e9f77d 100644 # gen-insn-attr-x86.awk: Instruction attribute table generator # Written by Masami Hiramatsu <mhiramat@redhat.com> diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk -index a42015b305f4..1c2832e9f77d 100644 +index af38469afd14..21a7a5db887e 100644 --- a/tools/arch/x86/tools/gen-insn-attr-x86.awk +++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk @@ -1,4 +1,4 @@ @@ -70,9 +68,6 @@ index 1a29f6379bde..6285ff7158a5 100644 # SPDX-License-Identifier: GPL-2.0-only # gen-insn-x86-dat.awk: script to convert data for the insn-x86 test # Copyright (c) 2015, Intel Corporation. -diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk -old mode 100755 -new mode 100644 -- -2.19.1 +2.34.1 diff --git a/patches/misc/misc.scc b/patches/misc/misc.scc index c75041f7..904f41c0 100644 --- a/patches/misc/misc.scc +++ b/patches/misc/misc.scc @@ -9,3 +9,9 @@ patch linux-yocto-Handle-bin-awk-issues.patch patch arm64-perf-fix-backtrace-for-AAPCS-with-FP-enabled.patch patch defconfigs-drop-obselete-options.patch patch arm64-perf-Fix-wrong-cast-that-may-cause-wrong-trunc.patch +patch net-dccp-make-it-depend-on-CONFIG_BROKEN-CVE-2020-16.patch +patch iwlwifi-select-MAC80211_LEDS-conditionally.patch +patch vt-conmakehash-improve-reproducibility.patch +patch lib-build_OID_registry-fix-reproducibility-issues.patch +patch tools-use-basename-to-identify-file-in-gen-mach-type.patch +patch pnmtologo-use-relocatable-file-name.patch diff --git a/patches/misc/net-dccp-make-it-depend-on-CONFIG_BROKEN-CVE-2020-16.patch b/patches/misc/net-dccp-make-it-depend-on-CONFIG_BROKEN-CVE-2020-16.patch new file mode 100644 index 00000000..263c6190 --- /dev/null +++ b/patches/misc/net-dccp-make-it-depend-on-CONFIG_BROKEN-CVE-2020-16.patch @@ -0,0 +1,45 @@ +From 56fd8c36614e9aaeadec647ce3d07f1ceb16a0a4 Mon Sep 17 00:00:00 2001 +From: Paul Gortmaker <paul.gortmaker@windriver.com> +Date: Wed, 5 May 2021 00:11:29 -0400 +Subject: [PATCH] net/dccp: make it depend on CONFIG_BROKEN (CVE-2020-16119) + +There were some proposed fixes for this back in 2020, but the discussion +largely fizzled out[1] and never got picked up again. + +We can see other distros are either blacklisting it from user space[2] +or explicitly calling it out as "is not set" in their base config[3] but +that really doesn't bind the workaround to the kernel source in any +robust transportable way. + +So I've done the tried and true "depends on BROKEN" to ensure the +workaround goes wherever the kernel source goes. + +We can revert this if a real fix eventually appears, but given that it +was marked "EXPERIMENTAL" back when we had that, I don't expect we'll +need to. Also note that none of our base ktypes or BSPs enabled it. + +[1] https://lore.kernel.org/netdev/20201013171849.236025-1-kleber.souza@canonical.com/T/ +[2] https://access.redhat.com/security/cve/cve-2020-16119 +[3] https://github.com/archlinux/svntogit-packages/commit/c07751100e1d64d9aa5789881ddc2ef68e43aed4 + +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + net/dccp/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/net/dccp/Kconfig b/net/dccp/Kconfig +index 0c7d2f66ba27..efa01566da0f 100644 +--- a/net/dccp/Kconfig ++++ b/net/dccp/Kconfig +@@ -2,6 +2,7 @@ + menuconfig IP_DCCP + tristate "The DCCP Protocol" + depends on INET ++ depends on BROKEN + help + Datagram Congestion Control Protocol (RFC 4340) + +-- +2.19.1 + diff --git a/patches/misc/pnmtologo-use-relocatable-file-name.patch b/patches/misc/pnmtologo-use-relocatable-file-name.patch new file mode 100644 index 00000000..bcfb5904 --- /dev/null +++ b/patches/misc/pnmtologo-use-relocatable-file-name.patch @@ -0,0 +1,52 @@ +From 4da597cafebb4d6743da1dd54099dadb6c356e08 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Thu, 14 Jul 2022 14:43:46 -0400 +Subject: [PATCH] pnmtologo: use relocatable file name + +The logo generation utility is capturing the source of the logo +in the generated .c file. The source file is absolute (as passed +by make), so the full path is captured. + +This makes the source fail reproducibility tests. + +We use basename() to just get the source file name, and use +that in the generated .c file. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + drivers/video/logo/pnmtologo.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/logo/pnmtologo.c b/drivers/video/logo/pnmtologo.c +index ada5ef6e51b7..7527be845443 100644 +--- a/drivers/video/logo/pnmtologo.c ++++ b/drivers/video/logo/pnmtologo.c +@@ -13,7 +13,7 @@ + #include <stdlib.h> + #include <string.h> + #include <unistd.h> +- ++#include <libgen.h> + + static const char *programname; + static const char *filename; +@@ -223,6 +223,7 @@ static inline int is_equal(struct color c1, struct color c2) + + static void write_header(void) + { ++ char *filename_basename = basename(filename); + /* open logo file */ + if (outputname) { + out = fopen(outputname, "w"); +@@ -235,7 +236,7 @@ static void write_header(void) + fputs("/*\n", out); + fputs(" * DO NOT EDIT THIS FILE!\n", out); + fputs(" *\n", out); +- fprintf(out, " * It was automatically generated from %s\n", filename); ++ fprintf(out, " * It was automatically generated from %s\n", filename_basename); + fputs(" *\n", out); + fprintf(out, " * Linux logo %s\n", logoname); + fputs(" */\n\n", out); +-- +2.34.1 + diff --git a/patches/misc/tools-use-basename-to-identify-file-in-gen-mach-type.patch b/patches/misc/tools-use-basename-to-identify-file-in-gen-mach-type.patch new file mode 100644 index 00000000..cd091361 --- /dev/null +++ b/patches/misc/tools-use-basename-to-identify-file-in-gen-mach-type.patch @@ -0,0 +1,41 @@ +From 6c085baf183868ed45d8c1d44408d7b24724cde5 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Wed, 13 Jul 2022 12:18:15 -0400 +Subject: [PATCH] tools: use basename to identify file in gen-mach-types + +FILENAME is replaced by the full path to the executing script. If +the script is executed via a fully specified path, that is captured +in the output. Although it doesn't impact the output, it does trigger +reproducibility warnings/errors. + +So we introduce a basename() function in the script and use it to +make sure the output file contains only the name of the awk script. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + arch/arm/tools/gen-mach-types | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types +index cb2b69f2a39d..1fcdba948623 100644 +--- a/arch/arm/tools/gen-mach-types ++++ b/arch/arm/tools/gen-mach-types +@@ -21,10 +21,14 @@ NF == 3 { + num[nr] = ""; nr++ + } + ++ function basename(file) { ++ sub(".*/", "", file) ++ return file ++ } + + END { + printf("/*\n"); +- printf(" * This was automagically generated from %s!\n", FILENAME); ++ printf(" * This was automagically generated from %s!\n", basename(FILENAME)); + printf(" * Do NOT edit\n"); + printf(" */\n\n"); + printf("#ifndef __ASM_ARM_MACH_TYPE_H\n"); +-- +2.19.1 + diff --git a/patches/misc/vt-conmakehash-improve-reproducibility.patch b/patches/misc/vt-conmakehash-improve-reproducibility.patch new file mode 100644 index 00000000..cf663271 --- /dev/null +++ b/patches/misc/vt-conmakehash-improve-reproducibility.patch @@ -0,0 +1,53 @@ +From 0f586f4ee8adacac79b64d1f3d47799a5eb7fbea Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@gmail.com> +Date: Sun, 10 Jul 2022 21:37:07 -0400 +Subject: [PATCH] vt/conmakehash: improve reproducibility + +The file generated by conmakehash capture the application +path used to generate the file. While that can be informative, +it varies based on where the kernel was built, as the full +path is captured. + +We tweak the application to use a second input as the "capture +name", and then modify the Makefile to pass the basename of +the source, making it reproducible. + +This could be improved by using some sort of path mapping, +or the application manipualing argv[1] itself, but for now +this solves the reprodicibility issue. + +Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> +--- + drivers/tty/vt/Makefile | 2 +- + drivers/tty/vt/conmakehash.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/tty/vt/Makefile b/drivers/tty/vt/Makefile +index fe30ce512819..cb51c21b58f9 100644 +--- a/drivers/tty/vt/Makefile ++++ b/drivers/tty/vt/Makefile +@@ -15,7 +15,7 @@ clean-files := consolemap_deftbl.c defkeymap.c + hostprogs += conmakehash + + quiet_cmd_conmk = CONMK $@ +- cmd_conmk = $(obj)/conmakehash $< > $@ ++ cmd_conmk = $(obj)/conmakehash $< $(shell basename $<) > $@ + + $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/conmakehash + $(call cmd,conmk) +diff --git a/drivers/tty/vt/conmakehash.c b/drivers/tty/vt/conmakehash.c +index cddd789fe46e..d62510b280e9 100644 +--- a/drivers/tty/vt/conmakehash.c ++++ b/drivers/tty/vt/conmakehash.c +@@ -253,7 +253,7 @@ int main(int argc, char *argv[]) + #include <linux/types.h>\n\ + \n\ + u8 dfont_unicount[%d] = \n\ +-{\n\t", argv[1], fontlen); ++{\n\t", argv[2], fontlen); + + for ( i = 0 ; i < fontlen ; i++ ) + { +-- +2.19.1 + diff --git a/small/small.cfg b/small/small.cfg index d21ab751..0a6df066 100644 --- a/small/small.cfg +++ b/small/small.cfg @@ -19,7 +19,7 @@ # # General setup # -# CONFIG_IKCONFIG is not set +CONFIG_IKCONFIG=n CONFIG_CC_OPTIMIZE_FOR_SIZE=y # @@ -94,15 +94,15 @@ CONFIG_BINFMT_MISC=y # # Networking options # -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_IPV6 is not set +CONFIG_INET_XFRM_MODE_TRANSPORT=n +CONFIG_INET_XFRM_MODE_TUNNEL=n +CONFIG_INET_XFRM_MODE_BEET=n +CONFIG_IPV6=n # # Core Netfilter Configuration # -# CONFIG_NETFILTER is not set +CONFIG_NETFILTER=n # # IP: Netfilter Configuration @@ -115,7 +115,7 @@ CONFIG_BINFMT_MISC=y # # IP: Virtual Server Configuration # -# CONFIG_IP_VS is not set +CONFIG_IP_VS=n # # IPVS transport protocol load balancing support @@ -132,21 +132,21 @@ CONFIG_BINFMT_MISC=y # # DCCP Configuration (EXPERIMENTAL) # -# CONFIG_IP_DCCP is not set +CONFIG_IP_DCCP=n # # SCTP Configuration (EXPERIMENTAL) # -# CONFIG_IP_SCTP is not set +CONFIG_IP_SCTP=n # # TIPC Configuration (EXPERIMENTAL) # -# CONFIG_TIPC is not set +CONFIG_TIPC=n -# CONFIG_ATM is not set -# CONFIG_BRIDGE is not set -# CONFIG_ECONET is not set +CONFIG_ATM=n +CONFIG_BRIDGE=n +CONFIG_ECONET=n # # QoS and/or fair queueing @@ -155,33 +155,31 @@ CONFIG_BINFMT_MISC=y # # Queueing/Scheduling # -# CONFIG_NET_SCH_CBQ is not set -# CONFIG_NET_SCH_HTB is not set -# CONFIG_NET_SCH_HFSC is not set -# CONFIG_NET_SCH_PRIO is not set -# CONFIG_NET_SCH_RED is not set -# CONFIG_NET_SCH_SFQ is not set -# CONFIG_NET_SCH_TEQL is not set -# CONFIG_NET_SCH_TBF is not set -# CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_DSMARK is not set -# CONFIG_NET_SCH_NETEM is not set +CONFIG_NET_SCH_HTB=n +CONFIG_NET_SCH_HFSC=n +CONFIG_NET_SCH_PRIO=n +CONFIG_NET_SCH_RED=n +CONFIG_NET_SCH_SFQ=n +CONFIG_NET_SCH_TEQL=n +CONFIG_NET_SCH_TBF=n +CONFIG_NET_SCH_GRED=n +CONFIG_NET_SCH_NETEM=n # # Classification # -# CONFIG_NET_CLS_BASIC is not set -# CONFIG_NET_CLS_TCINDEX is not set -# CONFIG_NET_CLS_ROUTE4 is not set -# CONFIG_NET_CLS_FW is not set -# CONFIG_NET_CLS_U32 is not set -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set +CONFIG_NET_CLS_BASIC=n +CONFIG_NET_CLS_TCINDEX=n +CONFIG_NET_CLS_ROUTE4=n +CONFIG_NET_CLS_FW=n +CONFIG_NET_CLS_U32=n +CONFIG_NET_CLS_RSVP=n +CONFIG_NET_CLS_RSVP6=n # # Network testing # -# CONFIG_NET_PKTGEN is not set +CONFIG_NET_PKTGEN=n # # Packet Radio protocols @@ -995,13 +993,13 @@ CONFIG_NLS_UTF8=y # # Logging Options # -# CONFIG_SECURITY is not set +CONFIG_SECURITY=n # # Cryptographic options # -# CONFIG_CRYPTO_ECB is not set -# CONFIG_CRYPTO_PCBC is not set +CONFIG_CRYPTO_ECB=n +CONFIG_CRYPTO_PCBC=n # # Hardware crypto devices |