[1/1] x86/entry: remove unused argument %rsi passed to exc_nmi()

Message ID 20230926061319.1929127-1-xin@zytor.com
State New
Headers
Series [1/1] x86/entry: remove unused argument %rsi passed to exc_nmi() |

Commit Message

Xin Li (Intel) Sept. 26, 2023, 6:13 a.m. UTC
  From: "Xin Li (Intel)" <xin@zytor.com>

exc_nmi() only takes one argument of type struct pt_regs *, but
asm_exc_nmi() calls it with 2 arguments. The second one passed
in %rsi seems a leftover, so simply remove it.

BTW, fix 2 slips in the comments.

Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
---
 arch/x86/entry/entry_64.S | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
  

Comments

Ingo Molnar Sept. 27, 2023, 8:06 a.m. UTC | #1
* xin@zytor.com <xin@zytor.com> wrote:

> From: "Xin Li (Intel)" <xin@zytor.com>
> 
> exc_nmi() only takes one argument of type struct pt_regs *, but
> asm_exc_nmi() calls it with 2 arguments. The second one passed
> in %rsi seems a leftover, so simply remove it.
> 
> BTW, fix 2 slips in the comments.
> 
> Signed-off-by: Xin Li (Intel) <xin@zytor.com>
> Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
> ---
>  arch/x86/entry/entry_64.S | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

I've split this into two patches, because the comment fixes
are entirely unrelated to this patch.

[ I've propagated the SOBs and Acked-by's to the two patches,
  as I presume is fine by everyone involved? ]

Thanks,

	Ingo
  
Xin Li (Intel) Sept. 27, 2023, 8:12 a.m. UTC | #2
On 9/27/2023 1:06 AM, Ingo Molnar wrote:
> 
> * xin@zytor.com <xin@zytor.com> wrote:
> 
>> From: "Xin Li (Intel)" <xin@zytor.com>
>>
>> exc_nmi() only takes one argument of type struct pt_regs *, but
>> asm_exc_nmi() calls it with 2 arguments. The second one passed
>> in %rsi seems a leftover, so simply remove it.
>>
>> BTW, fix 2 slips in the comments.
>>
>> Signed-off-by: Xin Li (Intel) <xin@zytor.com>
>> Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
>> ---
>>   arch/x86/entry/entry_64.S | 10 ++++------
>>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> I've split this into two patches, because the comment fixes
> are entirely unrelated to this patch.
> 
> [ I've propagated the SOBs and Acked-by's to the two patches,
>    as I presume is fine by everyone involved? ]

surely no problem at all!
  
H. Peter Anvin Sept. 27, 2023, 7:15 p.m. UTC | #3
On September 27, 2023 1:06:23 AM PDT, Ingo Molnar <mingo@kernel.org> wrote:
>
>* xin@zytor.com <xin@zytor.com> wrote:
>
>> From: "Xin Li (Intel)" <xin@zytor.com>
>> 
>> exc_nmi() only takes one argument of type struct pt_regs *, but
>> asm_exc_nmi() calls it with 2 arguments. The second one passed
>> in %rsi seems a leftover, so simply remove it.
>> 
>> BTW, fix 2 slips in the comments.
>> 
>> Signed-off-by: Xin Li (Intel) <xin@zytor.com>
>> Acked-by: H. Peter Anvin (Intel) <hpa@zytor.com>
>> ---
>>  arch/x86/entry/entry_64.S | 10 ++++------
>>  1 file changed, 4 insertions(+), 6 deletions(-)
>
>I've split this into two patches, because the comment fixes
>are entirely unrelated to this patch.
>
>[ I've propagated the SOBs and Acked-by's to the two patches,
>  as I presume is fine by everyone involved? ]
>
>Thanks,
>
>	Ingo

Perfect, thanks!
  

Patch

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index f71664dea1a3..9b4b512f2a75 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -1163,8 +1163,8 @@  SYM_CODE_START(asm_exc_nmi)
 	 * anyway.
 	 *
 	 * To handle this case we do the following:
-	 *  Check the a special location on the stack that contains
-	 *  a variable that is set when NMIs are executing.
+	 *  Check a special location on the stack that contains a
+	 *  variable that is set when NMIs are executing.
 	 *  The interrupted task's stack is also checked to see if it
 	 *  is an NMI stack.
 	 *  If the variable is not set and the stack is not the NMI
@@ -1237,7 +1237,6 @@  SYM_CODE_START(asm_exc_nmi)
 	 */
 
 	movq	%rsp, %rdi
-	movq	$-1, %rsi
 	call	exc_nmi
 
 	/*
@@ -1295,8 +1294,8 @@  SYM_CODE_START(asm_exc_nmi)
 	 * end_repeat_nmi, then we are a nested NMI.  We must not
 	 * modify the "iret" frame because it's being written by
 	 * the outer NMI.  That's okay; the outer NMI handler is
-	 * about to about to call exc_nmi() anyway, so we can just
-	 * resume the outer NMI.
+	 * about to call exc_nmi() anyway, so we can just resume
+	 * the outer NMI.
 	 */
 
 	movq	$repeat_nmi, %rdx
@@ -1451,7 +1450,6 @@  end_repeat_nmi:
 	UNWIND_HINT_REGS
 
 	movq	%rsp, %rdi
-	movq	$-1, %rsi
 	call	exc_nmi
 
 	/* Always restore stashed SPEC_CTRL value (see paranoid_entry) */