Add CONFIG_KABI_RESERVE to control KABI padding reserve and enable it by default.
Zheng Zengkai (2): KABI: Add CONFIG_KABI_RESERVE to control KABI padding reserve openeuler_defconfig: Enable CONFIG_KABI_RESERVE for x86 and arm64
Kconfig | 8 ++++++++ arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + include/linux/kabi.h | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4K3S5
-----------------------
Add CONFIG_KABI_RESERVE to control KABI padding reserve or not, for some embedded system, KABI padding reserve may be not necessary.
By the way, adjust unsigned long to u64 to unify basic reserve length for both 32bit and 64bit architectures.
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- Kconfig | 8 ++++++++ include/linux/kabi.h | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Kconfig b/Kconfig index bb409bb587b0..9c9b5fedd43c 100644 --- a/Kconfig +++ b/Kconfig @@ -37,3 +37,11 @@ config KABI_SIZE_ALIGN_CHECKS 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. + +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. diff --git a/include/linux/kabi.h b/include/linux/kabi.h index da5e6d71e66b..713f63cf56cb 100644 --- a/include/linux/kabi.h +++ b/include/linux/kabi.h @@ -425,7 +425,11 @@ * leverage those common names making it easier to read and find in the * code. */ -# define _KABI_RESERVE(n) unsigned long kabi_reserved##n +#ifdef CONFIG_KABI_RESERVE + # define _KABI_RESERVE(n) u64 kabi_reserved##n +#else + # define _KABI_RESERVE(n) +#endif # define KABI_RESERVE(n) _KABI_RESERVE(n); /* * Simple wrappers to replace standard openEuler reserved elements.
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4K3S5
---------------------------
Enable CONFIG_KABI_RESERVE for x86 and arm64 architectures in openeuler_defconfig by default.
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index dd1bcf03e61a..0a0508e8a7f1 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -7152,3 +7152,4 @@ CONFIG_GPIO_HISI=y CONFIG_OSNOISE_TRACER=y CONFIG_TIMERLAT_TRACER=y CONFIG_KABI_SIZE_ALIGN_CHECKS=y +CONFIG_KABI_RESERVE=y diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig index 5d403124e49b..0200c289ccec 100644 --- a/arch/x86/configs/openeuler_defconfig +++ b/arch/x86/configs/openeuler_defconfig @@ -8530,3 +8530,4 @@ CONFIG_NET_VENDOR_RAMAXEL=y CONFIG_SPNIC=m CONFIG_SPFC=m CONFIG_KABI_SIZE_ALIGN_CHECKS=y +CONFIG_KABI_RESERVE=y