From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>, Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] [Xenomai-git] Philippe Gerum : cobalt/x86: exclude %rsp from mayday fixup
Date: Fri, 13 Feb 2015 12:46:33 +0100 [thread overview]
Message-ID: <54DDE419.5030502@siemens.com> (raw)
In-Reply-To: <54DDD826.7020509@siemens.com>
On 2015-02-13 11:55, Jan Kiszka wrote:
> On 2015-02-12 18:45, xenomai-git-request@xenomai.org wrote:
>> Module: xenomai-3
>> Branch: next
>> Commit: 667a361408e34b69ea761dcaf0ec8d8081d18cb3
>> URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=667a361408e34b69ea761dcaf0ec8d8081d18cb3
>>
>> Author: Philippe Gerum <rpm@xenomai.org>
>> Date: Thu Feb 12 18:39:02 2015 +0100
>>
>> cobalt/x86: exclude %rsp from mayday fixup
>>
>> ---
>>
>> kernel/cobalt/arch/x86/mayday.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/cobalt/arch/x86/mayday.c b/kernel/cobalt/arch/x86/mayday.c
>> index 62c5eea..22a9196 100644
>> --- a/kernel/cobalt/arch/x86/mayday.c
>> +++ b/kernel/cobalt/arch/x86/mayday.c
>> @@ -204,11 +204,12 @@ void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs)
>> test_thread_flag(TIF_IA32)) {
>> regs->ip = tcb->mayday.ip;
>> regs->ax = tcb->mayday.ax;
>> + regs->sp = tcb->mayday.sp;
>> } else
>> regs->ax = tcb->mayday.ip;
>> #else
>> regs->ip = tcb->mayday.ip;
>> regs->ax = tcb->mayday.ax;
>> -#endif
>> regs->sp = tcb->mayday.sp;
>> +#endif
>> }
>
> That makes me wonder why we have to save/restore at all? In the end, the
> syscall triggered by the ia32 trampoline code doesn't push anything to
> the user's stack, does it?
>
> But I'm also confused that my tests without this patch were still
> successful...
...because it makes no difference in practice. It seems that the
kernel's signal path saves and restores userspace sp, overwriting the
fixup so far (at least on x86-64).
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2015-02-13 11:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.178.1423763115.27969.xenomai-git@xenomai.org>
2015-02-13 10:55 ` [Xenomai] [Xenomai-git] Philippe Gerum : cobalt/x86: exclude %rsp from mayday fixup Jan Kiszka
2015-02-13 11:46 ` Jan Kiszka [this message]
2015-02-13 11:49 ` Philippe Gerum
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=54DDE419.5030502@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=rpm@xenomai.org \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.