Unverified Commit 6125ba4e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14177 v2 kabi: restrict the KABI fix to a specific architecture and dist

Merge Pull Request from: @ci-robot 
 
PR sync from: Xie XiuQi <xiexiuqi@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/XDAKVFVYZMRWT36PSKX7EU74CKV4ZKF5/ 
Some distributions need to maintain and fix KABI compatibility so
that drivers do not need to be recompiled during kernel upgrades.
Fixing KABI compatibility is a dangerous and hacking job.
Developers need to know clearly what they are doing and the risks
they may face. KABI fix actions are closely related to the
processor architecture. Fixes may not be appropriate for all
architectures. Improper fix may cause kernel panic or unexpected
error.

Only for expert users, and select N by default.


Xie XiuQi (2):
  kabi: restrict the KABI fix to a specific architecture and dist
  kabi: enable KABI_COMPAT series by default on x86_64 & ARM64


-- 
2.20.1
 
https://gitee.com/openeuler/kernel/issues/IB9FKU 
 
Link:https://gitee.com/openeuler/kernel/pulls/14177

 

Reviewed-by: default avatarLiu Chao <liuchao173@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents ee7a71bd 9ca5f803
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -249,6 +249,9 @@ CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_KABI_COMPAT=y
CONFIG_KABI_RESERVE=y
CONFIG_KABI_SIZE_ALIGN_CHECKS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
@@ -274,8 +277,6 @@ CONFIG_DEBUG_PERF_USE_VMALLOC=y
CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_KABI_RESERVE=y
CONFIG_KABI_SIZE_ALIGN_CHECKS=y

#
# Kexec and crash features
+3 −2
Original line number Diff line number Diff line
@@ -269,6 +269,9 @@ CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_IO_URING=y
CONFIG_ADVISE_SYSCALLS=y
CONFIG_KABI_COMPAT=y
CONFIG_KABI_RESERVE=y
CONFIG_KABI_SIZE_ALIGN_CHECKS=y
CONFIG_MEMBARRIER=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_SELFTEST is not set
@@ -292,8 +295,6 @@ CONFIG_PERF_EVENTS=y
CONFIG_SYSTEM_DATA_VERIFICATION=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_KABI_RESERVE=y
CONFIG_KABI_SIZE_ALIGN_CHECKS=y

#
# Kexec and crash features
+1 −1
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@
 *   the end of the enum.  Before using this macro, make sure this is actually
 *   safe to do.
 */
#ifdef __GENKSYMS__
#if defined(__GENKSYMS__) && IS_ENABLED(CONFIG_KABI_COMPAT)

# define KABI_CONST
# define KABI_ADD_MODIFIER(_new)
+2 −16
Original line number Diff line number Diff line
@@ -1912,6 +1912,8 @@ config KALLSYMS_BASE_RELATIVE

# end of the "standard kernel features (expert users)" menu

source "lib/Kconfig.kabi"

# syscall, maps, verifier

config ARCH_HAS_MEMBARRIER_CALLBACKS
@@ -2095,22 +2097,6 @@ config BINDGEN_VERSION_TEXT
config TRACEPOINTS
	bool

config KABI_RESERVE
	bool "Enable KABI PADDING RESERVE"
	default y
	help
	  This option enables KABI padding reserve.
	  For some embedded system, KABI padding reserve may be not necessary.
	  Disable it on demand.

config KABI_SIZE_ALIGN_CHECKS
	bool "Enables more stringent kabi checks in the macros"
	default y
	depends on KABI_RESERVE
	help
	  This option enables more stringent kabi checks. Those must be disable
	  in case of a debug-build because they allow to change struct sizes.

source "kernel/Kconfig.kexec"

endmenu		# General setup

lib/Kconfig.kabi

0 → 100644
+32 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
config KABI_COMPAT
	bool "Enable kabi compatible fix"
	depends on X86_64 || ARM64
	default n
	help
          Support KABI compatibility fix. Some distributions need to maintain
          and fix KABI compatibility so that drivers do not need to be recompiled
          during kernel upgrades. Fixing KABI compatibility is a dangerous and
          hacking job. Developers need to know clearly what they are doing and
          the risks they may face. Related KABI fix actions are closely related
          to the processor architecture. Fixes may not be appropriate for all
          architectures. Improper use may cause system panic.

	  If unsure, say N.

config KABI_RESERVE
	bool "Enable KABI PADDING RESERVE"
	default y
	depends on KABI_COMPAT
	help
	  This option enables KABI padding reserve.
	  For some embedded system, KABI padding reserve may be not necessary.
	  Disable it on demand.

config KABI_SIZE_ALIGN_CHECKS
	bool "Enable more stringent kabi checks in the macros"
	default y
	depends on KABI_RESERVE
	help
	  This option enables more stringent kabi checks. Those must be disable
	  in case of a debug-build because they allow to change struct sizes.