From: tip-bot for Borislav Petkov <bp@alien8.de>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
tglx@linutronix.de, hpa@linux.intel.com, bp@alien8.de
Subject: [tip:x86/asm] x86, asm: Flip SAVE_ARGS arguments logic
Date: Fri, 3 Jun 2011 23:28:42 GMT [thread overview]
Message-ID: <tip-cac0e0a78f722abd85b7f8d614ee0820f7672f58@git.kernel.org> (raw)
In-Reply-To: <1306873314-32523-3-git-send-email-bp@alien8.de>
Commit-ID: cac0e0a78f722abd85b7f8d614ee0820f7672f58
Gitweb: http://git.kernel.org/tip/cac0e0a78f722abd85b7f8d614ee0820f7672f58
Author: Borislav Petkov <bp@alien8.de>
AuthorDate: Tue, 31 May 2011 22:21:52 +0200
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 3 Jun 2011 14:38:51 -0700
x86, asm: Flip SAVE_ARGS arguments logic
This saves us the else part of the conditional statement in the macro.
No functionality change.
Signed-off-by: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/1306873314-32523-3-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/ia32/ia32entry.S | 6 +++---
arch/x86/include/asm/calling.h | 8 +++-----
arch/x86/kernel/entry_64.S | 2 +-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index c1870dd..c5435dc 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -143,7 +143,7 @@ ENTRY(ia32_sysenter_target)
CFI_REL_OFFSET rip,0
pushq_cfi %rax
cld
- SAVE_ARGS 0,0,1
+ SAVE_ARGS 0,1,0
/* no need to do an access_ok check here because rbp has been
32bit zero extended */
1: movl (%rbp),%ebp
@@ -289,7 +289,7 @@ ENTRY(ia32_cstar_target)
* disabled irqs and here we enable it straight after entry:
*/
ENABLE_INTERRUPTS(CLBR_NONE)
- SAVE_ARGS 8,1,1
+ SAVE_ARGS 8,0,0
movl %eax,%eax /* zero extension */
movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
movq %rcx,RIP-ARGOFFSET(%rsp)
@@ -419,7 +419,7 @@ ENTRY(ia32_syscall)
cld
/* note the registers are not zero extended to the sf.
this could be a problem. */
- SAVE_ARGS 0,0,1
+ SAVE_ARGS 0,1,0
GET_THREAD_INFO(%r10)
orl $TS_COMPAT,TI_status(%r10)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h
index b67e06c..b0b7d90 100644
--- a/arch/x86/include/asm/calling.h
+++ b/arch/x86/include/asm/calling.h
@@ -85,22 +85,20 @@ For 32-bit we have the following conventions - kernel is built with
#define ARGOFFSET R11
#define SWFRAME ORIG_RAX
- .macro SAVE_ARGS addskip=0, norcx=0, nor891011=0
+ .macro SAVE_ARGS addskip=0, save_rcx=1, save_r891011=1
subq $9*8+\addskip, %rsp
CFI_ADJUST_CFA_OFFSET 9*8+\addskip
movq_cfi rdi, 8*8
movq_cfi rsi, 7*8
movq_cfi rdx, 6*8
- .if \norcx
- .else
+ .if \save_rcx
movq_cfi rcx, 5*8
.endif
movq_cfi rax, 4*8
- .if \nor891011
- .else
+ .if \save_r891011
movq_cfi r8, 3*8
movq_cfi r9, 2*8
movq_cfi r10, 1*8
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 8a445a0..e5ece6b 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -473,7 +473,7 @@ ENTRY(system_call_after_swapgs)
* and short:
*/
ENABLE_INTERRUPTS(CLBR_NONE)
- SAVE_ARGS 8,1
+ SAVE_ARGS 8,0
movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
movq %rcx,RIP-ARGOFFSET(%rsp)
CFI_REL_OFFSET rip,RIP-ARGOFFSET
next prev parent reply other threads:[~2011-06-03 23:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 20:21 [PATCH 0/4] Some x86, asm cleanups Borislav Petkov
2011-05-31 20:21 ` [PATCH 1/4] x86, asm: Thin down SAVE/RESTORE_* asm macros Borislav Petkov
2011-06-03 23:28 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2011-05-31 20:21 ` [PATCH 2/4] x86, asm: Flip SAVE_ARGS arguments logic Borislav Petkov
2011-06-03 23:28 ` tip-bot for Borislav Petkov [this message]
2011-05-31 20:21 ` [PATCH 3/4] x86, asm: Flip RESTORE_ARGS " Borislav Petkov
2011-06-03 23:29 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2011-05-31 20:21 ` [PATCH 4/4] x86, asm: Cleanup thunk_64.S Borislav Petkov
2011-06-03 23:29 ` [tip:x86/asm] " tip-bot for Borislav Petkov
2011-06-01 2:06 ` [PATCH 0/4] Some x86, asm cleanups H. Peter Anvin
2011-06-01 6:48 ` Borislav Petkov
2011-06-01 18:14 ` Borislav Petkov
2011-06-01 18:19 ` H. Peter Anvin
2011-06-01 20:40 ` Borislav Petkov
2011-06-03 20:07 ` [PATCH 5/4] x86, asm: Fix another binutils 2.16 issue Borislav Petkov
2011-06-03 23:30 ` [tip:x86/asm] x86, asm: Fix binutils 2.16 issue with __USER32_CS tip-bot for Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-cac0e0a78f722abd85b7f8d614ee0820f7672f58@git.kernel.org \
--to=bp@alien8.de \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome