Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/rmind-uvmplock]: src/sys/arch Slight simplification to TLB shootdown han...



details:   https://anonhg.NetBSD.org/src/rev/be9a0e9a8fb6
branches:  rmind-uvmplock
changeset: 753058:be9a0e9a8fb6
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon Apr 26 17:06:21 2010 +0000

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

diffstat:

 sys/arch/amd64/amd64/vector.S |  40 +++++++++++++++++-----------------------
 sys/arch/i386/i386/vector.S   |  38 +++++++++++++++-----------------------
 2 files changed, 32 insertions(+), 46 deletions(-)

diffs (136 lines):

diff -r d14c96527287 -r be9a0e9a8fb6 sys/arch/amd64/amd64/vector.S
--- a/sys/arch/amd64/amd64/vector.S     Mon Apr 26 04:48:49 2010 +0000
+++ b/sys/arch/amd64/amd64/vector.S     Mon Apr 26 17:06:21 2010 +0000
@@ -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: */
+       /*
+        * Note that caller-save registers might be modified (all saved in the
+        * 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.
-        *
-        * - 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.
-        */
-       callq   _C_LABEL(uvm_emap_gen_return)
-       movq    %rax, %rdi
+
+       /* 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
 
diff -r d14c96527287 -r be9a0e9a8fb6 sys/arch/i386/i386/vector.S
--- a/sys/arch/i386/i386/vector.S       Mon Apr 26 04:48:49 2010 +0000
+++ b/sys/arch/i386/i386/vector.S       Mon Apr 26 17:06:21 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index