mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Add support for configurable STRICT_MM_TYPECHECKS. The s390 ABI defines that return values with complex types like structures and unions are returned in a return value buffer allocated by the caller. This is also true for small structures and unions which would fit into a register. On the other hand when such types are passed as arguments to functions they are passed in registers, if they are small enough. This leads to inefficient code when such a return value of a function call is then passed as argument to a subsequent function call. This is especially true for all mm types, like pte_t and others, which are only for type checking reasons defined as a structure. This however can be bypassed with the STRICT_MM_TYPECHECKS feature, which is used by a few other architectures, which seem to have the same problem. Add CONFIG_STRICT_MM_TYPECHECKS which can be used to change the type of pte_t and other structures. If the config option is not enabled the types are defined to unsigned long, allowing for better code generation, however there is no type checking anymore. If it is enabled the types are structures like before so that type checking is performed, but less efficient code is generated. The option is always enabled in debug_defconfig, and for convenience an mmtypes.config topic target is added, which allows to easily enable it, in case memory management code is changed. CONFIG_STRICT_MM_TYPECHECKS and STRICT_MM_TYPECHECKS are kept separate, since STRICT_MM_TYPECHECKS is common across architectures and common code. Therefore use the same define also for s390 code. Add CONFIG_STRICT_MM_TYPECHECKS to make it build time configurable. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
32 lines
956 B
Text
32 lines
956 B
Text
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
config EARLY_PRINTK
|
|
def_bool y
|
|
|
|
config DEBUG_ENTRY
|
|
bool "Debug low-level entry code"
|
|
depends on DEBUG_KERNEL
|
|
help
|
|
This option enables sanity checks in s390 low-level entry code.
|
|
Some of these sanity checks may slow down kernel entries and
|
|
exits or otherwise impact performance.
|
|
|
|
If unsure, say N.
|
|
|
|
config STRICT_MM_TYPECHECKS
|
|
bool "Strict Memory Management Type Checks"
|
|
depends on DEBUG_KERNEL
|
|
help
|
|
Enable strict type checking for memory management types like pte_t
|
|
and pmd_t. This generates slightly worse code and should be used
|
|
for debug builds.
|
|
|
|
If unsure, say N.
|
|
|
|
config CIO_INJECT
|
|
bool "CIO Inject interfaces"
|
|
depends on DEBUG_KERNEL && DEBUG_FS
|
|
help
|
|
This option provides a debugging facility to inject certain artificial events
|
|
and instruction responses to the CIO layer of Linux kernel. The newly created
|
|
debugfs user-interfaces will be at /sys/kernel/debug/s390/cio/*
|