From: Andi Kleen <andi@firstfloor.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>, Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH] x86_64,entry: Fix RCX for traced syscalls
Date: Thu, 26 Jun 2014 21:56:29 +0200 [thread overview]
Message-ID: <20140626195629.GC5714@two.firstfloor.org> (raw)
In-Reply-To: <55466fbd36df1d011876135cf7ca5d40c05029c7.1403809591.git.luto@amacapital.net>
> show RCX == RIP even under strace.
If you think it's really worth the extra instruction?
It's not wrong, but it's not clear if it's useful.
-Andi
>
> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> ---
> arch/x86/kernel/entry_64.S | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index b25ca96..6624e18 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -143,7 +143,8 @@ ENDPROC(native_usergs_sysret64)
> movq \tmp,RSP+\offset(%rsp)
> movq $__USER_DS,SS+\offset(%rsp)
> movq $__USER_CS,CS+\offset(%rsp)
> - movq $-1,RCX+\offset(%rsp)
> + movq RIP+\offset(%rsp),\tmp /* get rip */
> + movq \tmp,RCX+\offset(%rsp) /* copy it to rcx as sysret would do */
> movq R11+\offset(%rsp),\tmp /* get eflags */
> movq \tmp,EFLAGS+\offset(%rsp)
> .endm
> --
> 1.9.3
>
--
ak@linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2014-06-26 19:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 19:08 Andy Lutomirski
2014-06-26 19:56 ` Andi Kleen [this message]
2014-06-26 19:59 ` Andy Lutomirski
2014-06-26 20:00 ` Andy Lutomirski
2014-06-26 20:12 ` H. Peter Anvin
2014-06-26 20:47 ` Andy Lutomirski
2014-06-28 17:07 ` Pavel Machek
2014-06-30 15:12 ` Andy Lutomirski
2014-11-04 23:43 ` Andy Lutomirski
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=20140626195629.GC5714@two.firstfloor.org \
--to=andi@firstfloor.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=x86@kernel.org \
/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®