Commit a6b07d82 authored by Michael Neuling's avatar Michael Neuling Committed by Michael Ellerman

cxl: Only check pid for userspace contexts

We only need to check the pid attached to this context for userspace contexts.
Kernel contexts can skip this check.
Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
Acked-by: default avatarIan Munsie <imunsie@au1.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 1a1a94b8
...@@ -172,8 +172,8 @@ void cxl_handle_fault(struct work_struct *fault_work) ...@@ -172,8 +172,8 @@ void cxl_handle_fault(struct work_struct *fault_work)
container_of(fault_work, struct cxl_context, fault_work); container_of(fault_work, struct cxl_context, fault_work);
u64 dsisr = ctx->dsisr; u64 dsisr = ctx->dsisr;
u64 dar = ctx->dar; u64 dar = ctx->dar;
struct task_struct *task; struct task_struct *task = NULL;
struct mm_struct *mm; struct mm_struct *mm = NULL;
if (cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An) != dsisr || if (cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An) != dsisr ||
cxl_p2n_read(ctx->afu, CXL_PSL_DAR_An) != dar || cxl_p2n_read(ctx->afu, CXL_PSL_DAR_An) != dar ||
...@@ -194,6 +194,7 @@ void cxl_handle_fault(struct work_struct *fault_work) ...@@ -194,6 +194,7 @@ void cxl_handle_fault(struct work_struct *fault_work)
pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. " pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. "
"DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar); "DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar);
if (!ctx->kernel) {
if (!(task = get_pid_task(ctx->pid, PIDTYPE_PID))) { if (!(task = get_pid_task(ctx->pid, PIDTYPE_PID))) {
pr_devel("cxl_handle_fault unable to get task %i\n", pr_devel("cxl_handle_fault unable to get task %i\n",
pid_nr(ctx->pid)); pid_nr(ctx->pid));
...@@ -206,6 +207,7 @@ void cxl_handle_fault(struct work_struct *fault_work) ...@@ -206,6 +207,7 @@ void cxl_handle_fault(struct work_struct *fault_work)
cxl_ack_ae(ctx); cxl_ack_ae(ctx);
goto out; goto out;
} }
}
if (dsisr & CXL_PSL_DSISR_An_DS) if (dsisr & CXL_PSL_DSISR_An_DS)
cxl_handle_segment_miss(ctx, mm, dar); cxl_handle_segment_miss(ctx, mm, dar);
...@@ -214,8 +216,10 @@ void cxl_handle_fault(struct work_struct *fault_work) ...@@ -214,8 +216,10 @@ void cxl_handle_fault(struct work_struct *fault_work)
else else
WARN(1, "cxl_handle_fault has nothing to handle\n"); WARN(1, "cxl_handle_fault has nothing to handle\n");
if (mm)
mmput(mm); mmput(mm);
out: out:
if (task)
put_task_struct(task); put_task_struct(task);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment