Index: kernel/arch/sparc64/src/cpu/cpu.c
===================================================================
--- kernel/arch/sparc64/src/cpu/cpu.c	(revision 730376d1b21f93d17f9ba190a599809dcb0a13a7)
+++ kernel/arch/sparc64/src/cpu/cpu.c	(revision 0af7a09df0167c47f195b0970ba63783ab374f4c)
@@ -41,7 +41,4 @@
 #include <arch/types.h>
 #include <arch/drivers/tick.h>
-#include <arch/mm/page.h>
-#include <arch/mm/tlb.h>
-#include <macros.h>
 
 /** Perform sparc64 specific initialization of the processor structure for the
@@ -81,22 +78,4 @@
 	CPU->arch.clock_frequency = clock_frequency;
 	tick_init();
-	
-	/*
-	 * Lock CPU stack in DTLB.
-	 */
-	uintptr_t base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
-		 
-	if (!overlaps((uintptr_t) CPU->stack, PAGE_SIZE, base, (1 <<
-		KERNEL_PAGE_WIDTH))) {
-		/*
-		 * Kernel stack of this processor is not locked in DTLB.
-		 * First, demap any already existing mappings.
-		 * Second, create a locked mapping for it.
-		 */
-		dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t)
-			CPU->stack);
-		dtlb_insert_mapping((uintptr_t) CPU->stack, KA2PA(CPU->stack),
-			PAGESIZE_8K, true, true);
-	}
 }
 
Index: kernel/arch/sparc64/src/proc/scheduler.c
===================================================================
--- kernel/arch/sparc64/src/proc/scheduler.c	(revision 730376d1b21f93d17f9ba190a599809dcb0a13a7)
+++ kernel/arch/sparc64/src/proc/scheduler.c	(revision 0af7a09df0167c47f195b0970ba63783ab374f4c)
@@ -37,11 +37,5 @@
 #include <arch.h>
 #include <arch/asm.h>
-#include <arch/regdef.h>
 #include <arch/stack.h>
-#include <arch/mm/tlb.h>
-#include <arch/mm/page.h>
-#include <config.h>
-#include <align.h>
-#include <macros.h>
 
 /** Perform sparc64 specific tasks needed before the new task is run. */
@@ -52,46 +46,10 @@
 /** Perform sparc64 specific steps before scheduling a thread.
  *
- * Ensure that thread's kernel stack, as well as userspace window buffer for
- * userspace threads, are locked in DTLB. For userspace threads, initialize
- * reserved global registers in the alternate and interrupt sets.
+ * For userspace threads, initialize reserved global registers in the alternate
+ * and interrupt sets.
  */
 void before_thread_runs_arch(void)
 {
-	uintptr_t base;
-	
-	base = ALIGN_DOWN(config.base, 1<<KERNEL_PAGE_WIDTH);
-
-	if (!overlaps((uintptr_t) THREAD->kstack, PAGE_SIZE, base, (1 <<
-		KERNEL_PAGE_WIDTH))) {
-		/*
-		 * Kernel stack of this thread is not locked in DTLB.
-		 * First, make sure it is not mapped already.
-		 * If not, create a locked mapping for it.
-		 */
-		dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t)
-			THREAD->kstack);
-		dtlb_insert_mapping((uintptr_t) THREAD->kstack,
-			KA2PA(THREAD->kstack), PAGESIZE_8K, true, true);
-	}
-	
 	if ((THREAD->flags & THREAD_FLAG_USPACE)) {
-		/*
-		 * If this thread executes also in userspace, we have to lock
-		 * its userspace window buffer into DTLB.
-		 */
-		ASSERT(THREAD->arch.uspace_window_buffer);
-		uintptr_t uw_buf = ALIGN_DOWN((uintptr_t)
-			THREAD->arch.uspace_window_buffer, PAGE_SIZE);
-		if (!overlaps(uw_buf, PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH))
-			{
-			/*
-			 * The buffer is not covered by the 4M locked kernel
-			 * DTLB entry.
-			 */
-			dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, uw_buf);
-			dtlb_insert_mapping(uw_buf, KA2PA(uw_buf), PAGESIZE_8K,
-				true, true);
-		}
-		
 		/*
 		 * Write kernel stack address to %g6 of the alternate and
@@ -114,43 +72,8 @@
 }
 
-/** Perform sparc64 specific steps before a thread stops running.
- *
- * Demap any locked DTLB entries installed by the thread (i.e. kernel stack
- * and userspace window buffer).
- */
+/** Perform sparc64 specific steps before a thread stops running. */
 void after_thread_ran_arch(void)
 {
-	uintptr_t base;
-
-	base = ALIGN_DOWN(config.base, 1 << KERNEL_PAGE_WIDTH);
-
-	if (!overlaps((uintptr_t) THREAD->kstack, PAGE_SIZE, base, (1 <<
-		KERNEL_PAGE_WIDTH))) {
-		/*
-		 * Kernel stack of this thread is locked in DTLB.
-		 * Destroy the mapping.
-		 */
-		dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t)
-			THREAD->kstack);
-	}
-	
 	if ((THREAD->flags & THREAD_FLAG_USPACE)) {
-		/*
-		 * If this thread executes also in userspace, we have to
-		 * demap the userspace window buffer from DTLB.
-		 */
-		ASSERT(THREAD->arch.uspace_window_buffer);
-		
-		uintptr_t uw_buf = ALIGN_DOWN((uintptr_t)
-			THREAD->arch.uspace_window_buffer, PAGE_SIZE);
-		if (!overlaps(uw_buf, PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {
-			/*
-			 * The buffer is not covered by the 4M locked kernel DTLB entry
-			 * and therefore it was given a dedicated locked DTLB entry.
-			 * Demap it.
-			 */
-			dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, uw_buf);
-		}
-	
 		/* sample the state of the userspace window buffer */	
 		THREAD->arch.uspace_window_buffer = (uint8_t *) read_from_ag_g7();
Index: kernel/arch/sparc64/src/trap/trap_table.S
===================================================================
--- kernel/arch/sparc64/src/trap/trap_table.S	(revision 730376d1b21f93d17f9ba190a599809dcb0a13a7)
+++ kernel/arch/sparc64/src/trap/trap_table.S	(revision 0af7a09df0167c47f195b0970ba63783ab374f4c)
@@ -743,9 +743,4 @@
 	rd %y, %g4
 
-	/*
-	 * The following memory accesses will not fault
-	 * because special provisions are made to have
-	 * the kernel stack of THREAD locked in DTLB.
-	 */
 	stx %g1, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TSTATE]
 	stx %g2, [%sp + PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TPC]
