• Sven Schnelle's avatar
    s390/entry: use assignment to read intcode / asm to copy gprs · af9ad822
    Sven Schnelle authored
    arch/s390/kernel/syscall.c: In function __do_syscall:
    arch/s390/kernel/syscall.c:147:9: warning: memcpy reading 64 bytes from a region of size 0 [-Wstringop-overread]
      147 |         memcpy(&regs->gprs[8], S390_lowcore.save_area_sync, 8 * sizeof(unsigned long));
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/s390/kernel/syscall.c:148:9: warning: memcpy reading 4 bytes from a region of size 0 [-Wstringop-overread]
      148 |         memcpy(&regs->int_code, &S390_lowcore.svc_ilc, sizeof(regs->int_code));
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Fix this by moving the gprs restore from C to assembly, and use a assignment
    for int_code instead of memcpy.
    Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    af9ad822
syscall.c 4.1 KB