diff options
Diffstat (limited to 'drivers/misc/cxl/fault.c')
| -rw-r--r-- | drivers/misc/cxl/fault.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c index f8684bca2d79..5286b8b704f5 100644 --- a/drivers/misc/cxl/fault.c +++ b/drivers/misc/cxl/fault.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <asm/mmu.h> | 20 | #include <asm/mmu.h> |
| 21 | 21 | ||
| 22 | #include "cxl.h" | 22 | #include "cxl.h" |
| 23 | #include "trace.h" | ||
| 23 | 24 | ||
| 24 | static bool sste_matches(struct cxl_sste *sste, struct copro_slb *slb) | 25 | static bool sste_matches(struct cxl_sste *sste, struct copro_slb *slb) |
| 25 | { | 26 | { |
| @@ -75,6 +76,7 @@ static void cxl_load_segment(struct cxl_context *ctx, struct copro_slb *slb) | |||
| 75 | 76 | ||
| 76 | pr_devel("CXL Populating SST[%li]: %#llx %#llx\n", | 77 | pr_devel("CXL Populating SST[%li]: %#llx %#llx\n", |
| 77 | sste - ctx->sstp, slb->vsid, slb->esid); | 78 | sste - ctx->sstp, slb->vsid, slb->esid); |
| 79 | trace_cxl_ste_write(ctx, sste - ctx->sstp, slb->esid, slb->vsid); | ||
| 78 | 80 | ||
| 79 | sste->vsid_data = cpu_to_be64(slb->vsid); | 81 | sste->vsid_data = cpu_to_be64(slb->vsid); |
| 80 | sste->esid_data = cpu_to_be64(slb->esid); | 82 | sste->esid_data = cpu_to_be64(slb->esid); |
| @@ -116,6 +118,7 @@ static int cxl_handle_segment_miss(struct cxl_context *ctx, | |||
| 116 | int rc; | 118 | int rc; |
| 117 | 119 | ||
| 118 | pr_devel("CXL interrupt: Segment fault pe: %i ea: %#llx\n", ctx->pe, ea); | 120 | pr_devel("CXL interrupt: Segment fault pe: %i ea: %#llx\n", ctx->pe, ea); |
| 121 | trace_cxl_ste_miss(ctx, ea); | ||
| 119 | 122 | ||
| 120 | if ((rc = cxl_fault_segment(ctx, mm, ea))) | 123 | if ((rc = cxl_fault_segment(ctx, mm, ea))) |
| 121 | cxl_ack_ae(ctx); | 124 | cxl_ack_ae(ctx); |
| @@ -135,6 +138,8 @@ static void cxl_handle_page_fault(struct cxl_context *ctx, | |||
| 135 | int result; | 138 | int result; |
| 136 | unsigned long access, flags, inv_flags = 0; | 139 | unsigned long access, flags, inv_flags = 0; |
| 137 | 140 | ||
| 141 | trace_cxl_pte_miss(ctx, dsisr, dar); | ||
| 142 | |||
| 138 | if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) { | 143 | if ((result = copro_handle_mm_fault(mm, dar, dsisr, &flt))) { |
| 139 | pr_devel("copro_handle_mm_fault failed: %#x\n", result); | 144 | pr_devel("copro_handle_mm_fault failed: %#x\n", result); |
| 140 | return cxl_ack_ae(ctx); | 145 | return cxl_ack_ae(ctx); |
| @@ -180,6 +185,12 @@ void cxl_handle_fault(struct work_struct *fault_work) | |||
| 180 | return; | 185 | return; |
| 181 | } | 186 | } |
| 182 | 187 | ||
| 188 | /* Early return if the context is being / has been detached */ | ||
| 189 | if (ctx->status == CLOSED) { | ||
| 190 | cxl_ack_ae(ctx); | ||
| 191 | return; | ||
| 192 | } | ||
| 193 | |||
| 183 | pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. " | 194 | pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. " |
| 184 | "DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar); | 195 | "DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar); |
| 185 | 196 | ||
