linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp-cmBhpYW9OiY@public.gmane.org>
To: Szabolcs Nagy <nsz-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>,
	Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
Subject: Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext()
Date: Sun, 6 Mar 2016 23:27:26 +0300	[thread overview]
Message-ID: <56DC92AE.3070707@list.ru> (raw)
In-Reply-To: <20160306200207.GT29662-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>

06.03.2016 23:02, Szabolcs Nagy пишет:
> * Stas Sergeev <stsp-cmBhpYW9OiY@public.gmane.org> [2016-03-01 00:29:03 +0300]:
>> The following patches make it possible to use swapcontext()
>> in a sighandler that works on sigaltstack.
> i don't think that's possible, the (obsolete) userspace
> *context functions cannot operate on kernel provided
> ucontext_t structs,
It doesn't have to.
It does the normal getcontext()/swapcontext() sequences,
as if it would be switching from any casual code place.
Kernel-provided context structs are completely irrelevant.
For more details please see the test-case I posted in that patch series.
It shows what can be done and how.

>   so they are not usable in signal
> handlers.
Please note the fact that swapcontext() also replaces the
signal mask as part of the context switching. This is a very
strong hint that it was intended to work with signal handlers.
And in fact it perfectly does.
What I want is only to make it friendly to sigaltstack.
I am not making it friendly to signal handlers in general,
because it already is.

> at least not on most target archs.
>
> so i don't understand how the tests can work portably.
If you apply my patch series, you can immediately test
it on any arch you want, thanks to the test-case my patch
adds to the kernel. Please let me know on what arch it fails.

  parent reply	other threads:[~2016-03-06 20:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 21:29 [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-02-29 21:29 ` [PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag Stas Sergeev
     [not found]   ` <1456781345-8243-2-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
2016-03-04 22:22     ` Andy Lutomirski
     [not found]       ` <CALCETrWMJ-2xovNnPgsKZtmBWZpqBERCTzne2L81x0tcm0BhbQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-05  7:39         ` Stas Sergeev
     [not found]           ` <56DA8D25.20600-cmBhpYW9OiY@public.gmane.org>
2016-03-05  7:40             ` Stas Sergeev
2016-03-06 20:07     ` Andy Lutomirski
     [not found]       ` <CALCETrVhtHdiS_W3WuCi1bTH78uoTSCHW2MN9hA36=h56-A3oA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-06 20:10         ` Andy Lutomirski
     [not found]           ` <CALCETrW=M1=n6R6dwOj-ks_=+14vf4rz0S3SFty-_GuwFFZU5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-06 20:17             ` Stas Sergeev
     [not found]               ` <56DC904C.2060708-cmBhpYW9OiY@public.gmane.org>
2016-03-06 20:55                 ` Andy Lutomirski
2016-02-29 21:29 ` [PATCH 2/2] selftests: Add test for sigaltstack(SS_AUTODISARM) Stas Sergeev
     [not found] ` <1456781345-8243-1-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
2016-03-06 20:02   ` [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Szabolcs Nagy
     [not found]     ` <20160306200207.GT29662-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>
2016-03-06 20:27       ` Stas Sergeev [this message]
2016-03-06 20:27       ` Szabolcs Nagy

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=56DC92AE.3070707@list.ru \
    --to=stsp-cmbhpyw9oiy@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
    --cc=nsz-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org \
    --cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.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;
as well as URLs for NNTP newsgroup(s).