mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <hpa@zytor.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86-64/asm: use negative immediates for stack adjustments
Date: Mon, 01 Jun 2015 13:02:55 +0100	[thread overview]
Message-ID: <556C660F020000780007FB60@mail.emea.novell.com> (raw)

Doing so allows adjustments by 128 bytes (occurring for
REMOVE_PT_GPREGS_FROM_STACK 8 uses) to be expressed with a single byte
immediate.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 arch/x86/include/asm/calling.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 4.1-rc6/arch/x86/include/asm/calling.h
+++ 4.1-rc6-x86_64-invert-stack-adjust/arch/x86/include/asm/calling.h
@@ -91,7 +91,7 @@ For 32-bit we have the following convent
 #define SIZEOF_PTREGS	21*8
 
 	.macro ALLOC_PT_GPREGS_ON_STACK addskip=0
-	subq	$15*8+\addskip, %rsp
+	addq	$-(15*8+\addskip), %rsp
 	CFI_ADJUST_CFA_OFFSET 15*8+\addskip
 	.endm
 
@@ -204,7 +204,7 @@ For 32-bit we have the following convent
 	.endm
 
 	.macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
-	addq $15*8+\addskip, %rsp
+	subq $-(15*8+\addskip), %rsp
 	CFI_ADJUST_CFA_OFFSET -(15*8+\addskip)
 	.endm
 




             reply	other threads:[~2015-06-01 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:02 Jan Beulich [this message]
2015-06-02  8:24 ` [tip:x86/asm] x86/asm/entry/64: Use " tip-bot for Jan Beulich

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=556C660F020000780007FB60@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®