From: Borislav Petkov <bp@suse.de>
To: Alexander van Heukelum <heukelum@fastmail.fm>
Cc: Denys Vlasenko <vda.linux@googlemail.com>,
Andy Lutomirski <luto@amacapital.net>, X86 ML <x86@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Oleg Nesterov <oleg@redhat.com>, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCHv2 1/4] x86_64: cleanup THREAD_INFO(reg,offset) macro
Date: Wed, 21 Jan 2015 19:04:30 +0100 [thread overview]
Message-ID: <20150121180429.GB31527@pd.tnic> (raw)
In-Reply-To: <1421857209.171127.216796445.0DC88E13@webmail.messagingengine.com>
On Wed, Jan 21, 2015 at 05:20:09PM +0100, Alexander van Heukelum wrote:
> On Wed, Jan 21, 2015, at 14:40, Denys Vlasenko wrote:
> > On Sun, Jan 18, 2015 at 12:45 PM, Alexander van Heukelum
> > <heukelum@fastmail.fm> wrote:
> > > The macro THREAD_INFO(reg,offset) is used in assembly to compute the
> > > offset between the user ptregs and the thread_info struct. Change
> > > the macro and all its uses so that offset is given as the current
> > > top of stack in the pt_regs frame. The generated code is identical.
> >
> > What is the purpose of doing this?
> >
> > I don't mean to say that it's pointless, but it is also not obvious
> > why it's better than the code before patch.
>
> Just because I had a hard time understanding what the offset
> parameter means. Turns out Borislav did another variant in his
> patchset. Quoting him from the commit message which made
> that the change:
> > Semi-mysterious expressions THREAD_INFO(%rsp,RIP) - "why RIP??"
> > are now replaced by more logical THREAD_INFO(%rsp,SIZEOF_PTREGS) -
> > "rsp is SIZEOF_PTREGS bytes below the top, calculate
> > thread_info's address using that information"
>
> Borislav expresses "offset" as an offset from the stack's page
> boundary,while I chose the offset from the start of struct
> pt_regs on the stack.
I've never done any such thing :-)
s/Borislav/Denys/g.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
next prev parent reply other threads:[~2015-01-21 18:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-18 11:45 [PATCHv2 0/4] x86, entry: some cleanup and simplification Alexander van Heukelum
2015-01-18 11:45 ` [PATCHv2 1/4] x86_64: cleanup THREAD_INFO(reg,offset) macro Alexander van Heukelum
2015-01-21 13:40 ` Denys Vlasenko
2015-01-21 16:20 ` Alexander van Heukelum
2015-01-21 18:04 ` Borislav Petkov [this message]
2015-01-21 18:48 ` Alexander van Heukelum
2015-01-18 11:45 ` [PATCHv2 2/4] x86_64: embrace KERNEL_STACK_OFFSET Alexander van Heukelum
2015-01-21 13:44 ` Denys Vlasenko
2015-01-21 16:29 ` Alexander van Heukelum
2015-01-23 0:53 ` Denys Vlasenko
2015-01-18 11:45 ` [PATCHv2 3/4] i386: clean up KERNEL_STACK_OFFSET Alexander van Heukelum
2015-01-18 11:45 ` [PATCHv2 4/4] x86_64, entry: Create IRET-compatible stack frame at syscall entry Alexander van Heukelum
2015-01-18 16:38 ` Andy Lutomirski
2015-01-18 17:22 ` Alexander van Heukelum
2015-01-18 12:05 ` [PATCHv2 0/4] x86, entry: some cleanup and simplification Borislav Petkov
2015-01-18 15:47 ` Alexander van Heukelum
2015-01-21 13:26 ` Denys Vlasenko
2015-01-21 15:51 ` Alexander van Heukelum
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=20150121180429.GB31527@pd.tnic \
--to=bp@suse.de \
--cc=fweisbec@gmail.com \
--cc=heukelum@fastmail.fm \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=oleg@redhat.com \
--cc=riel@redhat.com \
--cc=vda.linux@googlemail.com \
--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®