From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov 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 Message-ID: <20150814205518.GD2129@uranus> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Stas Sergeev , x86@kernel.org, Pavel Emelyanov , kvm list To: Andy Lutomirski Return-path: Received: from mail-lb0-f178.google.com ([209.85.217.178]:35768 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbbHNUzW (ORCPT ); Fri, 14 Aug 2015 16:55:22 -0400 Received: by lbcbn3 with SMTP id bn3so51926409lbc.2 for ; Fri, 14 Aug 2015 13:55:20 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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 > Cc: Linus Torvalds > Cc: Cyrill Gorcunov > Cc: Pavel Emelyanov > Signed-off-by: Andy Lutomirski 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).