If the length argument to mmap is larger than the arbitrary but reasonable
limit of 4GB, there's a good chance that the value is nonsense and not
intentional. Rather than attempting to satisfy the mmap anyway, this change
makes gem5 warn to make it more apparent what's going wrong.
int tgt_fd = p->getSyscallArg(tc, index);
// int offset = p->getSyscallArg(tc, index);
+ if (length > 0x100000000ULL)
+ warn("mmap length argument %#x is unreasonably large.\n", length);
+
if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
Process::FdMap *fd_map = p->sim_fd_obj(tgt_fd);
if (!fd_map || fd_map->fd < 0) {