Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jan 2018 18:10:34 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328409 - head/sys/powerpc/powerpc
Message-ID:  <201801251810.w0PIAYSj093298@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Thu Jan 25 18:10:33 2018
New Revision: 328409
URL: https://svnweb.freebsd.org/changeset/base/328409

Log:
  Avoid all SLB operations in trap handling if the process is not using a
  software-managed SLB.

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==============================================================================
--- head/sys/powerpc/powerpc/trap.c	Thu Jan 25 18:09:26 2018	(r328408)
+++ head/sys/powerpc/powerpc/trap.c	Thu Jan 25 18:10:33 2018	(r328409)
@@ -629,8 +629,9 @@ syscall(struct trapframe *frame)
 	 * Speculatively restore last user SLB segment, which we know is
 	 * invalid already, since we are likely to do copyin()/copyout().
 	 */
-	__asm __volatile ("slbmte %0, %1; isync" ::
-            "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE));
+	if (td->td_pcb->pcb_cpu.aim.usr_vsid != 0)
+		__asm __volatile ("slbmte %0, %1; isync" ::
+		    "r"(td->td_pcb->pcb_cpu.aim.usr_vsid), "r"(USER_SLB_SLBE));
 #endif
 
 	error = syscallenter(td);
@@ -690,6 +691,9 @@ handle_user_slb_spill(pmap_t pm, vm_offset_t addr)
 	struct slb *user_entry;
 	uint64_t esid;
 	int i;
+
+	if (pm->pm_slb == NULL)
+		return (-1);
 
 	esid = (uintptr_t)addr >> ADDR_SR_SHFT;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801251810.w0PIAYSj093298>