Module Name:    src
Committed By:   rmind
Date:           Mon Apr 26 17:06:21 UTC 2010

Modified Files:
        src/sys/arch/amd64/amd64 [rmind-uvmplock]: vector.S
        src/sys/arch/i386/i386 [rmind-uvmplock]: vector.S

Log Message:
Slight simplification to TLB shootdown handler on i386 and amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.53.2.1 -r1.53.2.2 src/sys/arch/i386/i386/vector.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.33.2.1 src/sys/arch/amd64/amd64/vector.S:1.33.2.2
--- src/sys/arch/amd64/amd64/vector.S:1.33.2.1	Mon Apr 26 04:48:49 2010
+++ src/sys/arch/amd64/amd64/vector.S	Mon Apr 26 17:06:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.33.2.1 2010/04/26 04:48:49 rmind Exp $	*/
+/*	$NetBSD: vector.S,v 1.33.2.2 2010/04/26 17:06:21 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -546,38 +546,32 @@
 4:
 	iretq
 5:
-	/* Invalidate whole address space: */
-	testw	$PG_G, TP_PTE(%rbx)
-	jnz	6f
 	/*
-	 * a) Invalidating user TLB entries only.
-	 *
-	 * - Get the emap generation number.
-	 * - Invalidate TLB entries.
-	 * - Perform emap update, pass the generation number.
-	 *
 	 * Note that caller-save registers might be modified (all saved in the
-	 * beginning).  Only %rbx value must be preserved for the 2b context.
+	 * beginning).  Only %rbx value must be preserved for the 2f context.
 	 */
+
+	/* Get the emap generation number. */
 	callq	_C_LABEL(uvm_emap_gen_return)
 	movq	%rax, %rdi
+
+	/* Which entries we are invalidating? */
+	testw	$PG_G, TP_PTE(%rbx)
+	jnz	6f
+
+	/* a) Invalidating user TLB entries only. */
 	movq	%cr3, %rax
 	movq	%rax, %cr3
-	callq	_C_LABEL(uvm_emap_update)
-	jmp	2b
+	jmp	7f
 6:
-	/*
-	 * b) Invalidating user and kernel TLB entries.
-	 *
-	 * See notes above.
-	 */
-	callq	_C_LABEL(uvm_emap_gen_return)
-	movq	%rax, %rdi
+	/* b) Invalidating user and kernel TLB entries. */
 	movq	%cr4, %rax
 	movq	%rax, %rdx
 	andq	$~CR4_PGE, %rdx
 	movq	%rdx, %cr4
 	movq	%rax, %cr4
+7:
+	/* Perform emap update, pass the generation number. */
 	callq	_C_LABEL(uvm_emap_update)
 	jmp	2b
 

Index: src/sys/arch/i386/i386/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.53.2.1 src/sys/arch/i386/i386/vector.S:1.53.2.2
--- src/sys/arch/i386/i386/vector.S:1.53.2.1	Mon Apr 26 02:43:34 2010
+++ src/sys/arch/i386/i386/vector.S	Mon Apr 26 17:06:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.53.2.1 2010/04/26 02:43:34 rmind Exp $	*/
+/*	$NetBSD: vector.S,v 1.53.2.2 2010/04/26 17:06:21 rmind Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.53.2.1 2010/04/26 02:43:34 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.53.2.2 2010/04/26 17:06:21 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -244,40 +244,32 @@
 	popl	%eax
 	iret
 4:
-	/* Invalidate whole address space: */
-	testw	$PG_G, TP_PTE(%ebx)
-	jnz	5f
 	/*
-	 * a) Invalidating user TLB entries only.
-	 *
-	 * - Get the emap generation number.
-	 * - Invalidate TLB entries.
-	 * - Perform emap update, pass the generation number.
-	 *
 	 * Note that caller-save registers might be modified (all saved in the
 	 * beginning).  Only %ebx value must be preserved for the 2b context.
 	 */
+
+	/* Get the emap generation number. */
 	call	_C_LABEL(uvm_emap_gen_return)
-	movl	%eax, %edx
+	movl	%eax, %ecx
+
+	/* Which entries we are invalidating? */
+	testw	$PG_G, TP_PTE(%ebx)
+	jnz	5f
+
+	/* a) Invalidating user TLB entries only. */
 	movl	%cr3, %eax
 	movl	%eax, %cr3
-	pushl	%edx
-	call	_C_LABEL(uvm_emap_update)
-	addl	$4, %esp
-	jmp	2b
+	jmp	6f
 5:
-	/*
-	 * b) Invalidating user and kernel TLB entries.
-	 *
-	 * See notes above.
-	 */
-	call	_C_LABEL(uvm_emap_gen_return)
-	movl	%eax, %ecx
+	/* b) Invalidating user and kernel TLB entries. */
 	movl	%cr4, %eax
 	movl	%eax, %edx
 	andl	$~CR4_PGE, %edx
 	movl	%edx, %cr4
 	movl	%eax, %cr4
+6:
+	/* Perform emap update, pass the generation number. */
 	pushl	%ecx
 	call	_C_LABEL(uvm_emap_update)
 	addl	$4, %esp

Reply via email to