uti: Hook system calls by binary-patching glibc

(1) Add --enable-uti option. The binary-patch library is
    preloaded with this option.
(2) Binary-patching is done by syscall_intercept developed by Intel

This commit includes the following fixes:

(1) Fix do_exit() and terminate() handling
(2) Fix timing of killing mcexec threads when McKernel thread calls terminate()

Change-Id: Iad885e1e5540ed79f0808debd372463e3b8fecea
This commit is contained in:
Masamichi Takagi
2018-09-04 09:29:54 +09:00
parent e613483bee
commit e42c414454
15 changed files with 608 additions and 500 deletions

View File

@@ -305,6 +305,7 @@ struct mcos_handler_info;
static LIST_HEAD(host_threads); /* Used for FS switch */
DEFINE_RWLOCK(host_thread_lock);
/* Info of Linux counterpart of migrated-to-Linux thread */
struct host_thread {
struct list_head list;
struct mcos_handler_info *handler;
@@ -2474,7 +2475,7 @@ mcexec_util_thread2(ihk_os_t os, unsigned long arg, struct file *file)
exiting release_handler()
*/
ppd = mcctrl_get_per_proc_data(usrdata, task_tgid_vnr(current));
pr_ppd("get", task_pid_vnr(current), ppd);
return 0;
}
@@ -2508,8 +2509,7 @@ mcexec_sig_thread(ihk_os_t os, unsigned long arg, struct file *file)
return ret;
}
static long
mcexec_terminate_thread_unsafe(ihk_os_t os, int pid, int tid, long sig, struct task_struct *tsk)
static long mcexec_terminate_thread_unsafe(ihk_os_t os, int pid, int tid, long sig, struct task_struct *tsk)
{
struct ikc_scd_packet *packet;
struct mcctrl_usrdata *usrdata = ihk_host_os_get_usrdata(os);
@@ -2697,6 +2697,7 @@ long mcexec_syscall_thread(ihk_os_t os, unsigned long arg, struct file *file)
(struct syscall_struct __user *)arg;
long rc;
if (copy_from_user(&param, uparam, sizeof param)) {
return -EFAULT;
}