mcexec: --enable-hfi1 to runtime enable/disable HFI1 driver
Conflicts: executer/user/mcexec.c
This commit is contained in:
@@ -479,6 +479,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
||||
proc->sgid = pn->cred[6];
|
||||
proc->fsgid = pn->cred[7];
|
||||
proc->termsig = SIGCHLD;
|
||||
proc->mcexec_flags = pn->mcexec_flags;
|
||||
proc->mpol_flags = pn->mpol_flags;
|
||||
proc->mpol_threshold = pn->mpol_threshold;
|
||||
proc->nr_processes = pn->nr_processes;
|
||||
|
||||
@@ -552,6 +552,7 @@ struct process {
|
||||
|
||||
long maxrss;
|
||||
long maxrss_children;
|
||||
unsigned long mcexec_flags;
|
||||
/* Memory policy flags and memory specific options */
|
||||
unsigned long mpol_flags;
|
||||
size_t mpol_threshold;
|
||||
|
||||
@@ -166,6 +166,8 @@ typedef unsigned long __cpu_set_unit;
|
||||
#define MPOL_NO_BSS 0x04
|
||||
#define MPOL_SHM_PREMAP 0x08
|
||||
|
||||
#define MCEXEC_HFI1 0x01
|
||||
|
||||
struct program_load_desc {
|
||||
int num_sections;
|
||||
int status;
|
||||
@@ -194,6 +196,7 @@ struct program_load_desc {
|
||||
unsigned long envs_len;
|
||||
struct rlimit rlimit[MCK_RLIM_MAX];
|
||||
unsigned long interp_align;
|
||||
unsigned long mcexec_flags;
|
||||
unsigned long mpol_flags;
|
||||
unsigned long mpol_threshold;
|
||||
unsigned long heap_extension;
|
||||
|
||||
@@ -481,7 +481,8 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
||||
#endif // PROFILE_ENABLE
|
||||
|
||||
if (req->number == __NR_open && rc > 0) {
|
||||
if (res.private_data &&
|
||||
if ((cpu_local_var(current)->proc->mcexec_flags & MCEXEC_HFI1) &&
|
||||
res.private_data &&
|
||||
!strncmp((const char *)req->args[0], "/dev/hfi", 8)) {
|
||||
extern void hfi1_txreq_prealloc(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user