Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_cpuset.c
Show First 20 Lines • Show All 1,737 Lines • ▼ Show 20 Lines | if (IN_CAPABILITY_MODE(td)) { | ||||
if (id != -1 && | if (id != -1 && | ||||
!(which == CPU_WHICH_TID && id == td->td_tid) && | !(which == CPU_WHICH_TID && id == td->td_tid) && | ||||
!(which == CPU_WHICH_PID && id == td->td_proc->p_pid)) | !(which == CPU_WHICH_PID && id == td->td_proc->p_pid)) | ||||
return (ECAPMODE); | return (ECAPMODE); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
#if defined(__powerpc__) | |||||
/* | |||||
* TODO: At least powerpc64 and powerpc64le kernels panic with | |||||
* exception 0x480 (instruction segment exception) when copyin/copyout, | |||||
* are set as a function pointer in cpuset_copy_cb struct and called by | |||||
* an external module (like pfsync). Tip: copyin/copyout have an ifunc | |||||
* resolver function. | |||||
* | |||||
* Bisect of LLVM shows that the behavior changed on LLVM 10.0 with | |||||
* https://reviews.llvm.org/rGdc06b0bc9ad055d06535462d91bfc2a744b2f589 | |||||
* | |||||
* This is a hack/workaround while problem is being discussed with LLVM | |||||
* community | |||||
*/ | |||||
static int | |||||
cpuset_copyin(const void *uaddr, void *kaddr, size_t len) | |||||
{ | |||||
return(copyin(uaddr, kaddr, len)); | |||||
} | |||||
static int | |||||
cpuset_copyout(const void *kaddr, void *uaddr, size_t len) | |||||
{ | |||||
return(copyout(kaddr, uaddr, len)); | |||||
} | |||||
static const struct cpuset_copy_cb copy_set = { | static const struct cpuset_copy_cb copy_set = { | ||||
.cpuset_copyin = cpuset_copyin, | |||||
.cpuset_copyout = cpuset_copyout | |||||
}; | |||||
#else | |||||
static const struct cpuset_copy_cb copy_set = { | |||||
.cpuset_copyin = copyin, | .cpuset_copyin = copyin, | ||||
.cpuset_copyout = copyout | .cpuset_copyout = copyout | ||||
}; | }; | ||||
#endif | |||||
#ifndef _SYS_SYSPROTO_H_ | #ifndef _SYS_SYSPROTO_H_ | ||||
struct cpuset_args { | struct cpuset_args { | ||||
cpusetid_t *setid; | cpusetid_t *setid; | ||||
}; | }; | ||||
#endif | #endif | ||||
int | int | ||||
sys_cpuset(struct thread *td, struct cpuset_args *uap) | sys_cpuset(struct thread *td, struct cpuset_args *uap) | ||||
▲ Show 20 Lines • Show All 763 Lines • Show Last 20 Lines |