__NR_gettid: use regular offloading channel (fixes unknown PID bug)
This commit is contained in:
@ -501,9 +501,10 @@ int mcexec_syscall(struct mcctrl_usrdata *ud, struct ikc_scd_packet *packet)
|
|||||||
ppd = mcctrl_get_per_proc_data(ud, pid);
|
ppd = mcctrl_get_per_proc_data(ud, pid);
|
||||||
|
|
||||||
if (unlikely(!ppd)) {
|
if (unlikely(!ppd)) {
|
||||||
kprintf("%s: ERROR: no per-process structure for PID %d??\n",
|
kprintf("%s: ERROR: no per-process structure for PID %d, "
|
||||||
__FUNCTION__, task_tgid_vnr(current));
|
"syscall nr: %d\n",
|
||||||
return 0;
|
__FUNCTION__, pid, packet->req.number);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintk("%s: (packet_handler) rtid: %d, ttid: %d, sys nr: %d\n",
|
dprintk("%s: (packet_handler) rtid: %d, ttid: %d, sys nr: %d\n",
|
||||||
|
|||||||
@ -134,7 +134,6 @@ static void send_syscall(struct syscall_request *req, int cpu, int pid, struct s
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if(req->number == __NR_exit_group ||
|
if(req->number == __NR_exit_group ||
|
||||||
req->number == __NR_gettid ||
|
|
||||||
req->number == __NR_kill){ // interrupt syscall
|
req->number == __NR_kill){ // interrupt syscall
|
||||||
extern int num_processors;
|
extern int num_processors;
|
||||||
|
|
||||||
@ -205,7 +204,6 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(req->number == __NR_exit_group ||
|
if(req->number == __NR_exit_group ||
|
||||||
req->number == __NR_gettid ||
|
|
||||||
req->number == __NR_kill){ // interrupt syscall
|
req->number == __NR_kill){ // interrupt syscall
|
||||||
islock = 1;
|
islock = 1;
|
||||||
irqstate = ihk_mc_spinlock_lock(&syscall_lock);
|
irqstate = ihk_mc_spinlock_lock(&syscall_lock);
|
||||||
@ -1491,6 +1489,7 @@ SYSCALL_DECLARE(getppid)
|
|||||||
|
|
||||||
static void settid(struct thread *thread, int nr_tids, int *tids)
|
static void settid(struct thread *thread, int nr_tids, int *tids)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
struct syscall_request request IHK_DMA_ALIGN;
|
struct syscall_request request IHK_DMA_ALIGN;
|
||||||
|
|
||||||
request.number = __NR_gettid;
|
request.number = __NR_gettid;
|
||||||
@ -1500,7 +1499,11 @@ static void settid(struct thread *thread, int nr_tids, int *tids)
|
|||||||
*/
|
*/
|
||||||
request.args[4] = nr_tids;
|
request.args[4] = nr_tids;
|
||||||
request.args[5] = virt_to_phys(tids);
|
request.args[5] = virt_to_phys(tids);
|
||||||
do_syscall(&request, ihk_mc_get_processor_id(), thread->proc->pid);
|
if ((ret = do_syscall(&request, ihk_mc_get_processor_id(),
|
||||||
|
thread->proc->pid)) < 0) {
|
||||||
|
kprintf("%s: WARNING: do_syscall returns %d\n",
|
||||||
|
__FUNCTION__, ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SYSCALL_DECLARE(gettid)
|
SYSCALL_DECLARE(gettid)
|
||||||
@ -1936,6 +1939,7 @@ unsigned long do_fork(int clone_flags, unsigned long newsp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find an unused TID */
|
/* Find an unused TID */
|
||||||
|
new->tid = 0;
|
||||||
retry_tid:
|
retry_tid:
|
||||||
for (i = 0; i < newproc->nr_tids; ++i) {
|
for (i = 0; i < newproc->nr_tids; ++i) {
|
||||||
if (!newproc->tids[i].thread) {
|
if (!newproc->tids[i].thread) {
|
||||||
|
|||||||
Reference in New Issue
Block a user