Skip to content

Commit

Permalink
Revert "cxl: Add kernel API to allow a context to operate with reloca…
Browse files Browse the repository at this point in the history
…te 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 7a0d85d.

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>
  • Loading branch information
Alastair D'Silva authored and Michael Ellerman committed Jul 2, 2018
1 parent 7dea6f2 commit c582815
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 32 deletions.
19 changes: 0 additions & 19 deletions drivers/misc/cxl/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,
if (task) {
ctx->pid = get_task_pid(task, PIDTYPE_PID);
kernel = false;
ctx->real_mode = false;

/* acquire a reference to the task's mm */
ctx->mm = get_task_mm(current);
Expand Down Expand Up @@ -388,24 +387,6 @@ void cxl_set_master(struct cxl_context *ctx)
}
EXPORT_SYMBOL_GPL(cxl_set_master);

int cxl_set_translation_mode(struct cxl_context *ctx, bool real_mode)
{
if (ctx->status == STARTED) {
/*
* We could potentially update the PE and issue an update LLCMD
* to support this, but it doesn't seem to have a good use case
* since it's trivial to just create a second kernel context
* with different translation modes, so until someone convinces
* me otherwise:
*/
return -EBUSY;
}

ctx->real_mode = real_mode;
return 0;
}
EXPORT_SYMBOL_GPL(cxl_set_translation_mode);

/* wrappers around afu_* file ops which are EXPORTED */
int cxl_fd_open(struct inode *inode, struct file *file)
{
Expand Down
1 change: 0 additions & 1 deletion drivers/misc/cxl/cxl.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ struct cxl_context {
bool pe_inserted;
bool master;
bool kernel;
bool real_mode;
bool pending_irq;
bool pending_fault;
bool pending_afu_err;
Expand Down
3 changes: 0 additions & 3 deletions drivers/misc/cxl/guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@ static int guest_attach_process(struct cxl_context *ctx, bool kernel, u64 wed, u
{
pr_devel("in %s\n", __func__);

if (ctx->real_mode)
return -EPERM;

ctx->kernel = kernel;
if (ctx->afu->current_mode == CXL_MODE_DIRECTED)
return attach_afu_directed(ctx, wed, amr);
Expand Down
3 changes: 2 additions & 1 deletion drivers/misc/cxl/native.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ u64 cxl_calculate_sr(bool master, bool kernel, bool real_mode, bool p9)
sr |= CXL_PSL_SR_An_MP;
if (mfspr(SPRN_LPCR) & LPCR_TC)
sr |= CXL_PSL_SR_An_TC;

if (kernel) {
if (!real_mode)
sr |= CXL_PSL_SR_An_R;
Expand All @@ -629,7 +630,7 @@ u64 cxl_calculate_sr(bool master, bool kernel, bool real_mode, bool p9)

static u64 calculate_sr(struct cxl_context *ctx)
{
return cxl_calculate_sr(ctx->master, ctx->kernel, ctx->real_mode,
return cxl_calculate_sr(ctx->master, ctx->kernel, false,
cxl_is_power9());
}

Expand Down
8 changes: 0 additions & 8 deletions include/misc/cxl.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,6 @@ int cxl_afu_reset(struct cxl_context *ctx);
*/
void cxl_set_master(struct cxl_context *ctx);

/*
* Sets the context to use real mode memory accesses to operate with
* translation disabled. Note that this only makes sense for kernel contexts
* under bare metal, and will not work with virtualisation. May only be
* performed on stopped contexts.
*/
int cxl_set_translation_mode(struct cxl_context *ctx, bool real_mode);

/*
* Map and unmap the AFU Problem Space area. The amount and location mapped
* depends on if this context is a master or slave.
Expand Down

0 comments on commit c582815

Please sign in to comment.