All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Stas Sergeev <stsp@list.ru>,
	x86@kernel.org, Pavel Emelyanov <xemul@parallels.com>,
	kvm list <kvm@vger.kernel.org>
Subject: Re: [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling
Date: Fri, 14 Aug 2015 23:55:18 +0300	[thread overview]
Message-ID: <20150814205518.GD2129@uranus> (raw)
In-Reply-To: <ea81981de89c22262e7b9324144f0055cff8b955.1439496828.git.luto@kernel.org>

On Thu, Aug 13, 2015 at 01:18:50PM -0700, Andy Lutomirski wrote:
> This adds two new uc_flags flags.  UC_SAVED_SS will be set for all
> 64-bit signals (including x32).  It indicates that the saved SS field
> is valid and that the kernel understands UC_RESTORE_SS.
> 
> The kernel will *not* set UC_RESTORE_SS.  User signal handlers can
> set UC_RESTORE_SS themselves to indicate that sigreturn should
> restore SS from the sigcontext.
> 
> 64-bit programs that use segmentation are encouraged to check
> UC_SAVED_SS and set UC_RESTORE_SS in their signal handlers.  This is
> the only straightforward way to cause sigreturn to restore SS.  (The
> only non-test program that I know of that uses segmentation in a
> 64-bit binary is DOSEMU, and DOSEMU currently uses a nasty
> trampoline to work around the lack of this mechanism in old kernels.
> It could detect UC_RESTORE_SS and use it to avoid needing a
> trampoline.
> 
> Cc: Stas Sergeev <stsp@list.ru>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Cyrill Gorcunov <gorcunov@gmail.com>
> Cc: Pavel Emelyanov <xemul@parallels.com>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>

Looks reasonable to me. Andy, Linus, what the final conclusion --
are we about to introduce this flag or simply continue with
revert? Should I test this one? (from the code I don't excpect it
break criu anyhow but still).

  reply	other threads:[~2015-08-14 20:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 20:18 [RFC/PATCH 0/3] x86/signal/64: A better attempt at SS cleanup Andy Lutomirski
2015-08-13 20:18 ` [RFC/PATCH 1/3] x86/kvm: Rename VMX's segment access rights defines Andy Lutomirski
2015-08-14 22:47   ` Paolo Bonzini
2015-08-13 20:18 ` [RFC/PATCH 2/3] x86/signal/64: Try to preserve hardware SS across 64-bit signal delivery Andy Lutomirski
2015-08-13 20:25   ` Andy Lutomirski
2015-08-13 21:26     ` Andy Lutomirski
2015-08-13 21:41       ` Linus Torvalds
2015-08-13 21:49         ` Andy Lutomirski
2015-08-13 22:03           ` Andy Lutomirski
2015-08-13 20:18 ` [RFC/PATCH 3/3] x86/signal/64: Add explicit controls for sigcontext SS handling Andy Lutomirski
2015-08-14 20:55   ` Cyrill Gorcunov [this message]
2015-08-14 20:57     ` Andy Lutomirski
2015-08-14 21:05       ` Cyrill Gorcunov

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=20150814205518.GD2129@uranus \
    --to=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=stsp@list.ru \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=xemul@parallels.com \
    /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.