syscall-emul: Ignore unimplemented system calls

This changeset sets the implementation policy for a subset of
system calls to the ignoreFunc implementation (for x86 only).
The ignored system calls likely will never be implemented and
this allows a warning to be issued instead of the simulation
exiting with a fatal.

Change-Id: I8d9741ad683151e88cc71156d3602e2d0ccb0acf
Reviewed-on: https://gem5-review.googlesource.com/2270
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Brandon Potter 2017-03-01 15:11:50 -06:00
parent 2c1286865f
commit 691a4574b4

View file

@ -244,11 +244,11 @@ static SyscallDesc syscallDescs64[] = {
/* 21 */ SyscallDesc("access", ignoreFunc), /* 21 */ SyscallDesc("access", ignoreFunc),
/* 22 */ SyscallDesc("pipe", pipeFunc), /* 22 */ SyscallDesc("pipe", pipeFunc),
/* 23 */ SyscallDesc("select", unimplementedFunc), /* 23 */ SyscallDesc("select", unimplementedFunc),
/* 24 */ SyscallDesc("sched_yield", unimplementedFunc), /* 24 */ SyscallDesc("sched_yield", ignoreFunc),
/* 25 */ SyscallDesc("mremap", mremapFunc<X86Linux64>), /* 25 */ SyscallDesc("mremap", mremapFunc<X86Linux64>),
/* 26 */ SyscallDesc("msync", unimplementedFunc), /* 26 */ SyscallDesc("msync", unimplementedFunc),
/* 27 */ SyscallDesc("mincore", unimplementedFunc), /* 27 */ SyscallDesc("mincore", unimplementedFunc),
/* 28 */ SyscallDesc("madvise", unimplementedFunc), /* 28 */ SyscallDesc("madvise", ignoreFunc),
/* 29 */ SyscallDesc("shmget", unimplementedFunc), /* 29 */ SyscallDesc("shmget", unimplementedFunc),
/* 30 */ SyscallDesc("shmat", unimplementedFunc), /* 30 */ SyscallDesc("shmat", unimplementedFunc),
/* 31 */ SyscallDesc("shmctl", unimplementedFunc), /* 31 */ SyscallDesc("shmctl", unimplementedFunc),
@ -337,7 +337,7 @@ static SyscallDesc syscallDescs64[] = {
/* 114 */ SyscallDesc("setregid", unimplementedFunc), /* 114 */ SyscallDesc("setregid", unimplementedFunc),
/* 115 */ SyscallDesc("getgroups", unimplementedFunc), /* 115 */ SyscallDesc("getgroups", unimplementedFunc),
/* 116 */ SyscallDesc("setgroups", unimplementedFunc), /* 116 */ SyscallDesc("setgroups", unimplementedFunc),
/* 117 */ SyscallDesc("setresuid", unimplementedFunc), /* 117 */ SyscallDesc("setresuid", ignoreFunc),
/* 118 */ SyscallDesc("getresuid", unimplementedFunc), /* 118 */ SyscallDesc("getresuid", unimplementedFunc),
/* 119 */ SyscallDesc("setresgid", unimplementedFunc), /* 119 */ SyscallDesc("setresgid", unimplementedFunc),
/* 120 */ SyscallDesc("getresgid", unimplementedFunc), /* 120 */ SyscallDesc("getresgid", unimplementedFunc),
@ -361,7 +361,7 @@ static SyscallDesc syscallDescs64[] = {
/* 138 */ SyscallDesc("fstatfs", unimplementedFunc), /* 138 */ SyscallDesc("fstatfs", unimplementedFunc),
/* 139 */ SyscallDesc("sysfs", unimplementedFunc), /* 139 */ SyscallDesc("sysfs", unimplementedFunc),
/* 140 */ SyscallDesc("getpriority", unimplementedFunc), /* 140 */ SyscallDesc("getpriority", unimplementedFunc),
/* 141 */ SyscallDesc("setpriority", unimplementedFunc), /* 141 */ SyscallDesc("setpriority", ignoreFunc),
/* 142 */ SyscallDesc("sched_setparam", unimplementedFunc), /* 142 */ SyscallDesc("sched_setparam", unimplementedFunc),
/* 143 */ SyscallDesc("sched_getparam", unimplementedFunc), /* 143 */ SyscallDesc("sched_getparam", unimplementedFunc),
/* 144 */ SyscallDesc("sched_setscheduler", unimplementedFunc), /* 144 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
@ -424,7 +424,7 @@ static SyscallDesc syscallDescs64[] = {
/* 201 */ SyscallDesc("time", timeFunc<X86Linux64>), /* 201 */ SyscallDesc("time", timeFunc<X86Linux64>),
/* 202 */ SyscallDesc("futex", futexFunc<X86Linux64>), /* 202 */ SyscallDesc("futex", futexFunc<X86Linux64>),
/* 203 */ SyscallDesc("sched_setaffinity", unimplementedFunc), /* 203 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
/* 204 */ SyscallDesc("sched_getaffinity", unimplementedFunc), /* 204 */ SyscallDesc("sched_getaffinity", ignoreFunc),
/* 205 */ SyscallDesc("set_thread_area", unimplementedFunc), /* 205 */ SyscallDesc("set_thread_area", unimplementedFunc),
/* 206 */ SyscallDesc("io_setup", unimplementedFunc), /* 206 */ SyscallDesc("io_setup", unimplementedFunc),
/* 207 */ SyscallDesc("io_destroy", unimplementedFunc), /* 207 */ SyscallDesc("io_destroy", unimplementedFunc),
@ -459,7 +459,7 @@ static SyscallDesc syscallDescs64[] = {
/* 236 */ SyscallDesc("vserver", unimplementedFunc), /* 236 */ SyscallDesc("vserver", unimplementedFunc),
/* 237 */ SyscallDesc("mbind", unimplementedFunc), /* 237 */ SyscallDesc("mbind", unimplementedFunc),
/* 238 */ SyscallDesc("set_mempolicy", unimplementedFunc), /* 238 */ SyscallDesc("set_mempolicy", unimplementedFunc),
/* 239 */ SyscallDesc("get_mempolicy", unimplementedFunc), /* 239 */ SyscallDesc("get_mempolicy", ignoreFunc),
/* 240 */ SyscallDesc("mq_open", unimplementedFunc), /* 240 */ SyscallDesc("mq_open", unimplementedFunc),
/* 241 */ SyscallDesc("mq_unlink", unimplementedFunc), /* 241 */ SyscallDesc("mq_unlink", unimplementedFunc),
/* 242 */ SyscallDesc("mq_timedsend", unimplementedFunc), /* 242 */ SyscallDesc("mq_timedsend", unimplementedFunc),
@ -493,7 +493,7 @@ static SyscallDesc syscallDescs64[] = {
/* 270 */ SyscallDesc("pselect6", unimplementedFunc), /* 270 */ SyscallDesc("pselect6", unimplementedFunc),
/* 271 */ SyscallDesc("ppoll", unimplementedFunc), /* 271 */ SyscallDesc("ppoll", unimplementedFunc),
/* 272 */ SyscallDesc("unshare", unimplementedFunc), /* 272 */ SyscallDesc("unshare", unimplementedFunc),
/* 273 */ SyscallDesc("set_robust_list", unimplementedFunc), /* 273 */ SyscallDesc("set_robust_list", ignoreFunc),
/* 274 */ SyscallDesc("get_robust_list", unimplementedFunc), /* 274 */ SyscallDesc("get_robust_list", unimplementedFunc),
/* 275 */ SyscallDesc("splice", unimplementedFunc), /* 275 */ SyscallDesc("splice", unimplementedFunc),
/* 276 */ SyscallDesc("tee", unimplementedFunc), /* 276 */ SyscallDesc("tee", unimplementedFunc),
@ -646,9 +646,9 @@ static SyscallDesc syscallDescs32[] = {
/* 94 */ SyscallDesc("fchmod", unimplementedFunc), /* 94 */ SyscallDesc("fchmod", unimplementedFunc),
/* 95 */ SyscallDesc("fchown", unimplementedFunc), /* 95 */ SyscallDesc("fchown", unimplementedFunc),
/* 96 */ SyscallDesc("getpriority", unimplementedFunc), /* 96 */ SyscallDesc("getpriority", unimplementedFunc),
/* 97 */ SyscallDesc("setpriority", unimplementedFunc), /* 97 */ SyscallDesc("setpriority", ignoreFunc),
/* 98 */ SyscallDesc("profil", unimplementedFunc), /* 98 */ SyscallDesc("profil", unimplementedFunc),
/* 99 */ SyscallDesc("statfs", unimplementedFunc), /* 99 */ SyscallDesc("statfs", ignoreFunc),
/* 100 */ SyscallDesc("fstatfs", unimplementedFunc), /* 100 */ SyscallDesc("fstatfs", unimplementedFunc),
/* 101 */ SyscallDesc("ioperm", unimplementedFunc), /* 101 */ SyscallDesc("ioperm", unimplementedFunc),
/* 102 */ SyscallDesc("socketcall", unimplementedFunc), /* 102 */ SyscallDesc("socketcall", unimplementedFunc),
@ -707,13 +707,13 @@ static SyscallDesc syscallDescs32[] = {
/* 155 */ SyscallDesc("sched_getparam", unimplementedFunc), /* 155 */ SyscallDesc("sched_getparam", unimplementedFunc),
/* 156 */ SyscallDesc("sched_setscheduler", unimplementedFunc), /* 156 */ SyscallDesc("sched_setscheduler", unimplementedFunc),
/* 157 */ SyscallDesc("sched_getscheduler", unimplementedFunc), /* 157 */ SyscallDesc("sched_getscheduler", unimplementedFunc),
/* 158 */ SyscallDesc("sched_yield", unimplementedFunc), /* 158 */ SyscallDesc("sched_yield", ignoreFunc),
/* 159 */ SyscallDesc("sched_get_priority_max", unimplementedFunc), /* 159 */ SyscallDesc("sched_get_priority_max", unimplementedFunc),
/* 160 */ SyscallDesc("sched_get_priority_min", unimplementedFunc), /* 160 */ SyscallDesc("sched_get_priority_min", unimplementedFunc),
/* 161 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc), /* 161 */ SyscallDesc("sched_rr_get_interval", unimplementedFunc),
/* 162 */ SyscallDesc("nanosleep", unimplementedFunc), /* 162 */ SyscallDesc("nanosleep", ignoreFunc),
/* 163 */ SyscallDesc("mremap", unimplementedFunc), /* 163 */ SyscallDesc("mremap", unimplementedFunc),
/* 164 */ SyscallDesc("setresuid", unimplementedFunc), /* 164 */ SyscallDesc("setresuid", ignoreFunc),
/* 165 */ SyscallDesc("getresuid", unimplementedFunc), /* 165 */ SyscallDesc("getresuid", unimplementedFunc),
/* 166 */ SyscallDesc("vm86", unimplementedFunc), /* 166 */ SyscallDesc("vm86", unimplementedFunc),
/* 167 */ SyscallDesc("query_module", unimplementedFunc), /* 167 */ SyscallDesc("query_module", unimplementedFunc),
@ -768,7 +768,7 @@ static SyscallDesc syscallDescs32[] = {
/* 216 */ SyscallDesc("setfsgid32", unimplementedFunc), /* 216 */ SyscallDesc("setfsgid32", unimplementedFunc),
/* 217 */ SyscallDesc("pivot_root", unimplementedFunc), /* 217 */ SyscallDesc("pivot_root", unimplementedFunc),
/* 218 */ SyscallDesc("mincore", unimplementedFunc), /* 218 */ SyscallDesc("mincore", unimplementedFunc),
/* 219 */ SyscallDesc("madvise", unimplementedFunc), /* 219 */ SyscallDesc("madvise", ignoreFunc),
/* 220 */ SyscallDesc("madvise1", unimplementedFunc), /* 220 */ SyscallDesc("madvise1", unimplementedFunc),
/* 221 */ SyscallDesc("getdents64", unimplementedFunc), /* 221 */ SyscallDesc("getdents64", unimplementedFunc),
/* 222 */ SyscallDesc("fcntl64", unimplementedFunc), /* 222 */ SyscallDesc("fcntl64", unimplementedFunc),
@ -791,7 +791,7 @@ static SyscallDesc syscallDescs32[] = {
/* 239 */ SyscallDesc("sendfile64", unimplementedFunc), /* 239 */ SyscallDesc("sendfile64", unimplementedFunc),
/* 240 */ SyscallDesc("futex", unimplementedFunc), /* 240 */ SyscallDesc("futex", unimplementedFunc),
/* 241 */ SyscallDesc("sched_setaffinity", unimplementedFunc), /* 241 */ SyscallDesc("sched_setaffinity", unimplementedFunc),
/* 242 */ SyscallDesc("sched_getaffinity", unimplementedFunc), /* 242 */ SyscallDesc("sched_getaffinity", ignoreFunc),
/* 243 */ SyscallDesc("set_thread_area", setThreadArea32Func), /* 243 */ SyscallDesc("set_thread_area", setThreadArea32Func),
/* 244 */ SyscallDesc("get_thread_area", unimplementedFunc), /* 244 */ SyscallDesc("get_thread_area", unimplementedFunc),
/* 245 */ SyscallDesc("io_setup", unimplementedFunc), /* 245 */ SyscallDesc("io_setup", unimplementedFunc),
@ -824,7 +824,7 @@ static SyscallDesc syscallDescs32[] = {
/* 272 */ SyscallDesc("fadvise64_64", unimplementedFunc), /* 272 */ SyscallDesc("fadvise64_64", unimplementedFunc),
/* 273 */ SyscallDesc("vserver", unimplementedFunc), /* 273 */ SyscallDesc("vserver", unimplementedFunc),
/* 274 */ SyscallDesc("mbind", unimplementedFunc), /* 274 */ SyscallDesc("mbind", unimplementedFunc),
/* 275 */ SyscallDesc("get_mempolicy", unimplementedFunc), /* 275 */ SyscallDesc("get_mempolicy", ignoreFunc),
/* 276 */ SyscallDesc("set_mempolicy", unimplementedFunc), /* 276 */ SyscallDesc("set_mempolicy", unimplementedFunc),
/* 277 */ SyscallDesc("mq_open", unimplementedFunc), /* 277 */ SyscallDesc("mq_open", unimplementedFunc),
/* 278 */ SyscallDesc("mq_unlink", unimplementedFunc), /* 278 */ SyscallDesc("mq_unlink", unimplementedFunc),
@ -860,8 +860,8 @@ static SyscallDesc syscallDescs32[] = {
/* 308 */ SyscallDesc("pselect6", unimplementedFunc), /* 308 */ SyscallDesc("pselect6", unimplementedFunc),
/* 309 */ SyscallDesc("ppoll", unimplementedFunc), /* 309 */ SyscallDesc("ppoll", unimplementedFunc),
/* 310 */ SyscallDesc("unshare", unimplementedFunc), /* 310 */ SyscallDesc("unshare", unimplementedFunc),
/* 311 */ SyscallDesc("set_robust_list", unimplementedFunc), /* 311 */ SyscallDesc("set_robust_list", ignoreFunc),
/* 312 */ SyscallDesc("get_robust_list", unimplementedFunc), /* 312 */ SyscallDesc("get_robust_list", ignoreFunc),
/* 313 */ SyscallDesc("splice", unimplementedFunc), /* 313 */ SyscallDesc("splice", unimplementedFunc),
/* 314 */ SyscallDesc("sync_file_range", unimplementedFunc), /* 314 */ SyscallDesc("sync_file_range", unimplementedFunc),
/* 315 */ SyscallDesc("tee", unimplementedFunc), /* 315 */ SyscallDesc("tee", unimplementedFunc),