From: Sabrina Dubroca <[email protected]>

redhat: kABI: add missing RH_KABI_SIZE_ALIGN_CHECKS Kconfig option

When the kABI macros were copied from the RHEL kernel to ARK, the
RH_KABI_SIZE_ALIGN_CHECKS config option was dropped. Without it, the
size checks included in some of the kABI macros can't be enabled.

Add the KABI_SIZE_ALIGN_CHECKS config option, enable it on regular
configs, and disable it for debug kernels.

Signed-off-by: Sabrina Dubroca <[email protected]>

diff --git a/Kconfig b/Kconfig
index blahblah..blahblah 100644
--- a/Kconfig
+++ b/Kconfig
@@ -32,3 +32,13 @@ source "lib/Kconfig.debug"
 source "Documentation/Kconfig"
 
 source "Kconfig.redhat"
+
+config RH_KABI_SIZE_ALIGN_CHECKS
+       bool "Enables more stringent kabi checks in the macros"
+       default y
+       help
+         This option enables more stringent kabi checks. Those must
+         be disabled in case of a debug build, because debug builds
+         allow to change struct sizes.
+
+
diff --git a/redhat/configs/common/debug/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS 
b/redhat/configs/common/debug/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/common/debug/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
@@ -0,0 +1 @@
+# CONFIG_RH_KABI_SIZE_ALIGN_CHECKS is not set
diff --git a/redhat/configs/common/generic/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS 
b/redhat/configs/common/generic/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/common/generic/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
@@ -0,0 +1 @@
+CONFIG_RH_KABI_SIZE_ALIGN_CHECKS=y
diff --git a/redhat/configs/common/kgcov/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS 
b/redhat/configs/common/kgcov/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
new file mode 100644
index blahblah..blahblah 100644
--- /dev/null
+++ b/redhat/configs/common/kgcov/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS
@@ -0,0 +1 @@
+# CONFIG_RH_KABI_SIZE_ALIGN_CHECKS is not set

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1619
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to