arch-arm, sim-se: Fix VPtr bug

Some syscalls were incorrectly using 64 bit
integers instead of VPtr's guest pointers,
causing parameter value corruption. This
commit addresses this issue.

Change-Id: If9e27a7c776b802dda18979d1a83a76c23557359
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Tiberiu Bucur
2024-08-20 15:27:58 +01:00
parent 107e8f3d17
commit 88de81f167
3 changed files with 6 additions and 6 deletions

View File

@@ -272,7 +272,7 @@ class SyscallTable32 : public SyscallDescTable<EmuLinux::SyscallABI32>
{ base + 142, "newselect" },
{ base + 143, "flock" },
{ base + 144, "msync" },
{ base + 145, "readv" },
{ base + 145, "readv", readvFunc<ArmLinux32> },
{ base + 146, "writev", writevFunc<ArmLinux32> },
{ base + 147, "getsid" },
{ base + 148, "fdatasync" },
@@ -570,7 +570,7 @@ class SyscallTable64 : public SyscallDescTable<EmuLinux::SyscallABI64>
{ base + 62, "lseek", lseekFunc<ArmLinux64> },
{ base + 63, "read", readFunc<ArmLinux64> },
{ base + 64, "write", writeFunc<ArmLinux64> },
{ base + 65, "readv" },
{ base + 65, "readv", readvFunc<ArmLinux64> },
{ base + 66, "writev", writevFunc<ArmLinux64> },
{ base + 67, "pread64", pread64Func<ArmLinux64> },
{ base + 68, "pwrite64", pwrite64Func<ArmLinux64> },

View File

@@ -289,7 +289,7 @@ brkFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> new_brk)
}
SyscallReturn
setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, uint64_t tidPtr)
setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc, VPtr<> tidPtr)
{
auto process = tc->getProcessPtr();

View File

@@ -149,7 +149,7 @@ SyscallReturn exitGroupFunc(SyscallDesc *desc, ThreadContext *tc, int status);
/// Target set_tid_address() handler.
SyscallReturn setTidAddressFunc(SyscallDesc *desc, ThreadContext *tc,
uint64_t tidPtr);
VPtr<> tidPtr);
/// Target getpagesize() handler.
SyscallReturn getpagesizeFunc(SyscallDesc *desc, ThreadContext *tc);
@@ -1920,7 +1920,7 @@ fstatfsFunc(SyscallDesc *desc, ThreadContext *tc,
template <class OS>
SyscallReturn
readvFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, uint64_t tiov_base,
int tgt_fd, VPtr<> tiov_base,
typename OS::size_t count)
{
auto p = tc->getProcessPtr();
@@ -1958,7 +1958,7 @@ readvFunc(SyscallDesc *desc, ThreadContext *tc,
template <class OS>
SyscallReturn
writevFunc(SyscallDesc *desc, ThreadContext *tc,
int tgt_fd, uint64_t tiov_base,
int tgt_fd, VPtr<> tiov_base,
typename OS::size_t count)
{
auto p = tc->getProcessPtr();