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)
commit41d71fe59cce41237f24f3b7bdc1b414069a34ed
tree9469aec2543453d14747353a53d4b6d74f246378
parentbb250e64e4702774ddee052b57136ab222f59ce1
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