Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amd64 Declare and use INTR_RECURSE_ENTRY, an optimi...



details:   https://anonhg.NetBSD.org/src/rev/e9721f0084d7
branches:  trunk
changeset: 359066:e9721f0084d7
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Jan 27 18:17:57 2018 +0000

description:
Declare and use INTR_RECURSE_ENTRY, an optimized version of INTRENTRY.
When processing deferred interrupts, we are always entering the new
handler in kernel mode, so there is no point performing the userland
checks.

Saves several instructions.

diffstat:

 sys/arch/amd64/amd64/vector.S     |  10 +++++-----
 sys/arch/amd64/include/frameasm.h |   7 ++++++-
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 34ff8c5ed719 -r e9721f0084d7 sys/arch/amd64/amd64/vector.S
--- a/sys/arch/amd64/amd64/vector.S     Sat Jan 27 17:54:13 2018 +0000
+++ b/sys/arch/amd64/amd64/vector.S     Sat Jan 27 18:17:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vector.S,v 1.56 2018/01/21 11:21:40 maxv Exp $ */
+/*     $NetBSD: vector.S,v 1.57 2018/01/27 18:17:57 maxv Exp $ */
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -113,7 +113,7 @@
        INTR_RECURSE_HWFRAME
        pushq   $0
        pushq   $T_ASTFLT
-       INTRENTRY
+       INTR_RECURSE_ENTRY
        jmp     1f
 IDTVEC_END(recurse_lapic_ipi)
 NENTRY(handle_x2apic_ipi)
@@ -213,7 +213,7 @@
        INTR_RECURSE_HWFRAME
        pushq   $0
        pushq   $T_ASTFLT
-       INTRENTRY
+       INTR_RECURSE_ENTRY
        jmp     1f
 IDTVEC_END(recurse_lapic_ltimer)
 NENTRY(handle_x2apic_ltimer)
@@ -316,7 +316,7 @@
        INTR_RECURSE_HWFRAME                                            ;\
        subq    $8,%rsp                                                 ;\
        pushq   $T_ASTFLT               /* trap # for doing ASTs */     ;\
-       INTRENTRY                                                       ;\
+       INTR_RECURSE_ENTRY                                              ;\
        jmp     1f                                                      ;\
 IDTVEC_END(recurse_ ## name ## num)                                    ;\
 IDTVEC(resume_ ## name ## num)                                         \
@@ -881,7 +881,7 @@
        INTR_RECURSE_HWFRAME                                            ;\
        subq    $8,%rsp                                                 ;\
        pushq   $T_ASTFLT               /* trap # for doing ASTs */     ;\
-       INTRENTRY                                                       ;\
+       INTR_RECURSE_ENTRY                                              ;\
 IDTVEC(resume_ ## name ## num)                                         \
        movq    $IREENT_MAGIC,TF_ERR(%rsp)                              ;\
        movl    %ebx,%r13d                                              ;\
diff -r 34ff8c5ed719 -r e9721f0084d7 sys/arch/amd64/include/frameasm.h
--- a/sys/arch/amd64/include/frameasm.h Sat Jan 27 17:54:13 2018 +0000
+++ b/sys/arch/amd64/include/frameasm.h Sat Jan 27 18:17:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frameasm.h,v 1.32 2018/01/27 08:12:27 maxv Exp $       */
+/*     $NetBSD: frameasm.h,v 1.33 2018/01/27 18:17:57 maxv Exp $       */
 
 #ifndef _AMD64_MACHINE_FRAMEASM_H
 #define _AMD64_MACHINE_FRAMEASM_H
@@ -174,6 +174,11 @@
        XEN_ONLY2(andb  $0xfc,(%rsp);)    \
        pushq   %r13                    ;
 
+#define INTR_RECURSE_ENTRY \
+       subq    $TF_REGSIZE,%rsp        ; \
+       INTR_SAVE_GPRS                  ; \
+       cld
+
 #define        CHECK_DEFERRED_SWITCH \
        cmpl    $0, CPUVAR(WANT_PMAPLOAD)
 



Home | Main Index | Thread Index | Old Index