Module Name: src Committed By: maxv Date: Sat Jan 27 18:17:57 UTC 2018
Modified Files: src/sys/arch/amd64/amd64: vector.S src/sys/arch/amd64/include: frameasm.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amd64/amd64/vector.S cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amd64/include/frameasm.h 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.56 src/sys/arch/amd64/amd64/vector.S:1.57 --- src/sys/arch/amd64/amd64/vector.S:1.56 Sun Jan 21 11:21:40 2018 +++ src/sys/arch/amd64/amd64/vector.S Sat Jan 27 18:17:57 2018 @@ -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 @@ IDTVEC(recurse_lapic_ipi) 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 @@ IDTVEC(recurse_lapic_ltimer) 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 @@ IDTVEC(recurse_ ## name ## num) ;\ 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 @@ IDTVEC(recurse_ ## name ## num) ;\ 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 ;\ Index: src/sys/arch/amd64/include/frameasm.h diff -u src/sys/arch/amd64/include/frameasm.h:1.32 src/sys/arch/amd64/include/frameasm.h:1.33 --- src/sys/arch/amd64/include/frameasm.h:1.32 Sat Jan 27 08:12:27 2018 +++ src/sys/arch/amd64/include/frameasm.h Sat Jan 27 18:17:57 2018 @@ -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 @@ usertrap ; \ 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)