]> git.baikalelectronics.ru Git - kernel.git/commit
s390: introduce proper type handling call_on_stack() macro
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 5 Jul 2021 18:16:10 +0000 (20:16 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 8 Jul 2021 20:12:17 +0000 (22:12 +0200)
commit083a64d4c1aa6d4603702b2607c3620d2a60041e
tree9469aec2543453d14747353a53d4b6d74f246378
parent9b734847c4df442c5fe03d4b25b158b2cac64220
s390: introduce proper type handling call_on_stack() macro

The existing CALL_ON_STACK() macro allows for subtle bugs:

- There is no type checking of the function that is being called. That
  is: missing or too many arguments do not cause any compile error or
  warning. The same is true if the return type of the called function
  changes. This can lead to quite random bugs.

- Sign and zero extension of arguments is missing. Given that the s390
  C ABI requires that the caller of a function performs proper sign
  and zero extension this can also lead to subtle bugs.

- If arguments to the CALL_ON_STACK() macros contain functions calls
  register corruption can happen due to register asm constructs being
  used.

Therefore introduce a new call_on_stack() macro which is supposed to
fix all these problems.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/stacktrace.h