diff options
author | Alastair D'Silva <alastair@d-silva.org> | 2018-06-28 06:05:00 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-07-02 09:54:30 -0400 |
commit | c5828150067c47a97f30e690a472e0548d3ac97d (patch) | |
tree | 0057a133e3b09a65fb4ced567170e8f689075198 | |
parent | 7dea6f2f053599d90f7894216db0dd0bedeb3a1c (diff) |
Revert "cxl: Add kernel API to allow a context to operate with relocate disabled"
Remove abandonned capi support for the Mellanox CX4.
The symbol 'cxl_set_translation_mode' is never called, so
ctx->real_mode is always false.
This reverts commit 7a0d85d313c2066712e530e668bc02bb741a685c.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | drivers/misc/cxl/api.c | 19 | ||||
-rw-r--r-- | drivers/misc/cxl/cxl.h | 1 | ||||
-rw-r--r-- | drivers/misc/cxl/guest.c | 3 | ||||
-rw-r--r-- | drivers/misc/cxl/native.c | 3 | ||||
-rw-r--r-- | include/misc/cxl.h | 8 |
5 files changed, 2 insertions, 32 deletions
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index 753b1a698fc4..21d620e29fea 100644 --- a/drivers/misc/cxl/api.c +++ b/drivers/misc/cxl/api.c | |||
@@ -324,7 +324,6 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed, | |||
324 | if (task) { | 324 | if (task) { |
325 | ctx->pid = get_task_pid(task, PIDTYPE_PID); | 325 | ctx->pid = get_task_pid(task, PIDTYPE_PID); |
326 | kernel = false; | 326 | kernel = false; |
327 | ctx->real_mode = false; | ||
328 | 327 | ||
329 | /* acquire a reference to the task's mm */ | 328 | /* acquire a reference to the task's mm */ |
330 | ctx->mm = get_task_mm(current); | 329 | ctx->mm = get_task_mm(current); |
@@ -388,24 +387,6 @@ void cxl_set_master(struct cxl_context *ctx) | |||
388 | } | 387 | } |
389 | EXPORT_SYMBOL_GPL(cxl_set_master); | 388 | EXPORT_SYMBOL_GPL(cxl_set_master); |
390 | 389 | ||
391 | int cxl_set_translation_mode(struct cxl_context *ctx, bool real_mode) | ||
392 | { | ||
393 | if (ctx->status == STARTED) { | ||
394 | /* | ||
395 | * We could potentially update the PE and issue an update LLCMD | ||
396 | * to support this, but it doesn't seem to have a good use case | ||
397 | * since it's trivial to just create a second kernel context | ||
398 | * with different translation modes, so until someone convinces | ||
399 | * me otherwise: | ||
400 | */ | ||
401 | return -EBUSY; | ||
402 | } | ||
403 | |||
404 | ctx->real_mode = real_mode; | ||
405 | return 0; | ||
406 | } | ||
407 | EXPORT_SYMBOL_GPL(cxl_set_translation_mode); | ||
408 | |||
409 | /* wrappers around afu_* file ops which are EXPORTED */ | 390 | /* wrappers around afu_* file ops which are EXPORTED */ |
410 | int cxl_fd_open(struct inode *inode, struct file *file) | 391 | int cxl_fd_open(struct inode *inode, struct file *file) |
411 | { | 392 | { |
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h index 918d4fb742d1..af8794719956 100644 --- a/drivers/misc/cxl/cxl.h +++ b/drivers/misc/cxl/cxl.h | |||
@@ -613,7 +613,6 @@ struct cxl_context { | |||
613 | bool pe_inserted; | 613 | bool pe_inserted; |
614 | bool master; | 614 | bool master; |
615 | bool kernel; | 615 | bool kernel; |
616 | bool real_mode; | ||
617 | bool pending_irq; | 616 | bool pending_irq; |
618 | bool pending_fault; | 617 | bool pending_fault; |
619 | bool pending_afu_err; | 618 | bool pending_afu_err; |
diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index 4644f16606a3..f5dc740fcd13 100644 --- a/drivers/misc/cxl/guest.c +++ b/drivers/misc/cxl/guest.c | |||
@@ -623,9 +623,6 @@ static int guest_attach_process(struct cxl_context *ctx, bool kernel, u64 wed, u | |||
623 | { | 623 | { |
624 | pr_devel("in %s\n", __func__); | 624 | pr_devel("in %s\n", __func__); |
625 | 625 | ||
626 | if (ctx->real_mode) | ||
627 | return -EPERM; | ||
628 | |||
629 | ctx->kernel = kernel; | 626 | ctx->kernel = kernel; |
630 | if (ctx->afu->current_mode == CXL_MODE_DIRECTED) | 627 | if (ctx->afu->current_mode == CXL_MODE_DIRECTED) |
631 | return attach_afu_directed(ctx, wed, amr); | 628 | return attach_afu_directed(ctx, wed, amr); |
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index 98f867fcef24..c9d5d82dce8e 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c | |||
@@ -605,6 +605,7 @@ u64 cxl_calculate_sr(bool master, bool kernel, bool real_mode, bool p9) | |||
605 | sr |= CXL_PSL_SR_An_MP; | 605 | sr |= CXL_PSL_SR_An_MP; |
606 | if (mfspr(SPRN_LPCR) & LPCR_TC) | 606 | if (mfspr(SPRN_LPCR) & LPCR_TC) |
607 | sr |= CXL_PSL_SR_An_TC; | 607 | sr |= CXL_PSL_SR_An_TC; |
608 | |||
608 | if (kernel) { | 609 | if (kernel) { |
609 | if (!real_mode) | 610 | if (!real_mode) |
610 | sr |= CXL_PSL_SR_An_R; | 611 | sr |= CXL_PSL_SR_An_R; |
@@ -629,7 +630,7 @@ u64 cxl_calculate_sr(bool master, bool kernel, bool real_mode, bool p9) | |||
629 | 630 | ||
630 | static u64 calculate_sr(struct cxl_context *ctx) | 631 | static u64 calculate_sr(struct cxl_context *ctx) |
631 | { | 632 | { |
632 | return cxl_calculate_sr(ctx->master, ctx->kernel, ctx->real_mode, | 633 | return cxl_calculate_sr(ctx->master, ctx->kernel, false, |
633 | cxl_is_power9()); | 634 | cxl_is_power9()); |
634 | } | 635 | } |
635 | 636 | ||
diff --git a/include/misc/cxl.h b/include/misc/cxl.h index b712be544f8c..82cc6ffafe2d 100644 --- a/include/misc/cxl.h +++ b/include/misc/cxl.h | |||
@@ -174,14 +174,6 @@ int cxl_afu_reset(struct cxl_context *ctx); | |||
174 | void cxl_set_master(struct cxl_context *ctx); | 174 | void cxl_set_master(struct cxl_context *ctx); |
175 | 175 | ||
176 | /* | 176 | /* |
177 | * Sets the context to use real mode memory accesses to operate with | ||
178 | * translation disabled. Note that this only makes sense for kernel contexts | ||
179 | * under bare metal, and will not work with virtualisation. May only be | ||
180 | * performed on stopped contexts. | ||
181 | */ | ||
182 | int cxl_set_translation_mode(struct cxl_context *ctx, bool real_mode); | ||
183 | |||
184 | /* | ||
185 | * Map and unmap the AFU Problem Space area. The amount and location mapped | 177 | * Map and unmap the AFU Problem Space area. The amount and location mapped |
186 | * depends on if this context is a master or slave. | 178 | * depends on if this context is a master or slave. |
187 | */ | 179 | */ |