|
From: Petar J. <mip...@gm...> - 2015-04-08 02:40:32
|
Hi Florian, I have just given a second look to this issue. It seems to me that if we want to make sure SysRes is always correctly initialized (i.e. to make sure _valEx and v1 in guest state are set to zero for non-pipe calls or for unsuccessful pipe call, we need to modify several spots for MIPS: - within VG_(do_syscall), after syscall is executed - ML_(do_syscall_for_client_WRK) in syscall-mips64-linux.S - putSyscallStatusIntoGuestState - hack around vki_ucontext and VG_UCONTEXT_SYSCALL_SYSRES And we would be doing it to satisfy condition sr_EQ introduced in r15060 that's used for assert only. Do you think it is worth adding these changes and workarounds? If you believe so, I will make the necessary changes. Regards, Petar On Sat, Apr 4, 2015 at 5:15 AM, Petar Jovanovic <mip...@gm...> wrote: > > On Fri, Apr 3, 2015 at 4:29 PM, Florian Krohm <fl...@ei...> > wrote: > >> Yes. But comparing _valEx makes sense when it has a deterministic value >> (i.e. after a pipe call). So not comparing the _valEx value at all does >> not sound right either. > > > I agree. > > >> How is this (for mips64): >> >> Index: coregrind/m_syscall.c >> =================================================================== >> --- coregrind/m_syscall.c (revision 15062) >> +++ coregrind/m_syscall.c (working copy) >> @@ -859,6 +859,7 @@ >> ULong V0 = do_syscall_WRK(a1,a2,a3,a4,a5,a6,sysno,v1_a3); >> ULong V1 = (ULong)v1_a3[0]; >> ULong A3 = (ULong)v1_a3[1]; >> + if (sysno != _NR_pipe) V1 = 0; // V1 is unused for this syscall >> return VG_(mk_SysRes_mips64_linux)( V0, V1, A3 ); >> >> #else >> >> Does that help? >> >> > I have tested a similar change right away, but it was not sufficient. > I believe I need to modify at least putSyscallStatusIntoGuestState(), > will see if anything else is missing after more testing. > > Petar > |