Heiko Carstens 41e1992665 s390: workaround invalid gcc-11 out of bounds read warning
GCC 11.1.0 and 11.2.0 generate a wrong warning when compiling the
kernel e.g. with allmodconfig:

arch/s390/kernel/setup.c: In function ‘setup_lowcore_dat_on’:
./include/linux/fortify-string.h:57:33: error: ‘__builtin_memcpy’ reading 128 bytes from a region of size 0 [-Werror=stringop-overread]
...
arch/s390/kernel/setup.c:526:9: note: in expansion of macro ‘memcpy’
  526 |         memcpy(abs_lc->cregs_save_area, S390_lowcore.cregs_save_area,
      |         ^~~~~~

This could be addressed by using absolute_pointer() with the
S390_lowcore macro, but this is not a good idea since this generates
worse code for performance critical paths.

Therefore simply use a for loop to copy the array in question and get
rid of the warning.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2023-01-17 19:00:59 +01:00
..
2022-11-23 16:24:07 +01:00
2021-12-16 19:58:07 +01:00
2021-12-13 12:04:45 -06:00
2022-12-15 11:12:21 -08:00
2022-10-10 12:00:45 -07:00
2022-12-06 16:18:26 +01:00
2022-12-12 15:19:38 -08:00
2022-03-28 17:29:53 -07:00
2022-03-28 17:29:53 -07:00
2022-05-11 14:40:57 +02:00
2022-03-10 15:58:17 +01:00