Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b00b6289 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

powerpc/vas: Don't set uses_vas for kernel windows



cp_abort is only required for user windows, because kernel context
must not be preempted between a copy/paste pair.

Without this patch, the init task gets used_vas set when it runs the
nx842_powernv_init initcall, which opens windows for kernel usage.

used_vas is then never cleared anywhere, so it gets propagated into
all other tasks. It's a property of the address space, so it should
really be cleared when a new mm is created (or in dup_mmap if the
mmaps are marked as VM_DONTCOPY). For now we seem to have no such
driver, so leave that for another patch.

Fixes: 6c8e6bb2 ("powerpc/vas: Add support for user receive window")
Cc: stable@vger.kernel.org # v4.15+
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Reviewed-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c9dccf1d
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1063,15 +1063,15 @@ struct vas_window *vas_tx_win_open(int vasid, enum vas_cop_type cop,
			rc = PTR_ERR(txwin->paste_kaddr);
			goto free_window;
		}
	}

	} else {
		/*
	 * Now that we have a send window, ensure context switch issues
		 * A user mapping must ensure that context switch issues
		 * CP_ABORT for this thread.
		 */
	rc = -EINVAL;
	if (set_thread_uses_vas() < 0)
		rc = set_thread_uses_vas();
		if (rc)
			goto free_window;
	}

	set_vinst_win(vinst, txwin);