Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1171046

[PATCH v3 11/15] x86/asm/entry/64: Simplify irq stack pt_regs handling

Path csiph.com!aioe.org!news.e-liance.net!news.e-liance.net!feeds.phibee-telecom.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v3 11/15] x86/asm/entry/64: Simplify irq stack pt_regs handling
Date Wed, 24 Jun 2015 04:50:02 +0200
Message-ID <pEIVc-554-41@gated-at.bofh.it> (permalink)
References <pEIVb-554-3@gated-at.bofh.it>
X-Original-To x86@kernel.org, linux-kernel@vger.kernel.org
X-Mailer git-send-email 2.4.3
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 46
Organization linux.* mail to news gateway
X-Original-Cc Frédéric Weisbecker <fweisbec@gmail.com>, Rik van Riel <riel@redhat.com>, Oleg Nesterov <oleg@redhat.com>, Denys Vlasenko <vda.linux@googlemail.com>, Borislav Petkov <bp@alien8.de>, Kees Cook <keescook@chromium.org>, Brian Gerst <brgerst@gmail.com>, paulmck@linux.vnet.ibm.com, Andy Lutomirski <luto@kernel.org>
X-Original-Date Tue, 23 Jun 2015 19:46:14 -0700
X-Original-Message-ID <79b6a6554e6befe737089f1a3ea6a99bda949516.1435113808.git.luto@kernel.org>
X-Original-References <cover.1435113808.git.luto@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1171046

Show key headers only | View raw


There's no need for both rsi and rdi to point to the original stack.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/entry/entry_64.S | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 3fdfd3e27918..ce2d10933c11 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -505,8 +505,6 @@ END(irq_entries_start)
 	SAVE_C_REGS
 	SAVE_EXTRA_REGS
 
-	movq	%rsp,%rdi	/* arg1 for \func (pointer to pt_regs) */
-
 	testb	$3, CS(%rsp)
 	jz	1f
 	SWAPGS
@@ -518,14 +516,14 @@ END(irq_entries_start)
 	 * a little cheaper to use a separate counter in the PDA (short of
 	 * moving irq_enter into assembly, which would be too much work)
 	 */
-	movq	%rsp, %rsi
+	movq	%rsp, %rdi
 	incl	PER_CPU_VAR(irq_count)
 	cmovzq	PER_CPU_VAR(irq_stack_ptr), %rsp
-	pushq	%rsi
+	pushq	%rdi
 	/* We entered an interrupt context - irqs are off: */
 	TRACE_IRQS_OFF
 
-	call	\func
+	call	\func	/* rdi points to pt_regs */
 	.endm
 
 	/*
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v3 11/15] x86/asm/entry/64: Simplify irq stack pt_regs handling Andy Lutomirski <luto@kernel.org> - 2015-06-24 04:50 +0200

csiph-web