On Sun, Sep 29, 2024 at 4:17 PM Thomas Weißschuh <thomas@xxxxxxxx> wrote: > > Hi Guo Ren, > > it seems the values of __NR_rt_sigreturn and __NR_getppid are swapped > between csky qemu-user and the kernel. > > In qemu-user [0, 1]: > (With context to show the disconuity) > > #define TARGET_NR_rt_sigqueueinfo 138 > --> #define TARGET_NR_rt_sigreturn 173 > #define TARGET_NR_setpriority 140 > > #define TARGET_NR_getpid 172 > --> #define TARGET_NR_getppid 139 > #define TARGET_NR_getuid 174 > > The mainline kernel however uses the generic syscall numbers: > > #define __NR_rt_sigreturn 139 > #define __NR_getppid 173 > > Is this intentional? If so, what am I supposed to do about it? Yes, Linux csky has followed the mainline kernel and abandoned csky's custom definition of unistd.h. So I think qemu-user should follow that, too. > > > While we are here: > > Is there a known bug about upstream gcc 14.2.0 (and earlier) loosing > track of registers, especially r4, during optimizations? > It seems to me that this register gets overwritten sometimes before it > is meant to be used. > > > Thanks, > Thomas > > > [0] https://raw.githubusercontent.com/XUANTIE-RV/qemu/refs/heads/xuantie-qemu-6.1.0/linux-user/csky/syscall_nr.h > [1] https://raw.githubusercontent.com/XUANTIE-RV/qemu/refs/heads/xuantie-qemu-8.0/linux-user/csky/syscall_nr.h -- Best Regards Guo Ren