Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1294387

Rethinking sigcontext's xfeatures slightly for PKRU's benefit?

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject Rethinking sigcontext's xfeatures slightly for PKRU's benefit?
Date 2015-12-18 02:50 +0100
Message-ID <qGSlc-7uA-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi all-

I think that, for PKRU in particular, we want the default signal
handling behavior to be a bit unusual.

When a signal is delivered, I think we should save the entire xstate
including PKRU.  I see no reason to do anything other than that.

When a signal returns (sigreturn is called), though, I think we should
*not* restore PKRU.  To me, PKRU seems like a global per-thread state,
not something that signal handlers are likely to clobber and should
therefore have restored.  It's also unusual in that it doesn't fit
into the usual xstate feature model of being a bunch of registers that
are mostly caller-saved.

Does this make sense?  Should we do this?

We have _fpx_sw_bytes.xfeatures and _xstate._header.xfeatures.  They
appear to do more or less the same thing.  Could we say that, for
certain new features (e.g. PKRU), if they're not in
_fpx_sw_bytes.xfeatures, then sigreturn will preserve the old content
rather than copying it?  User code that wants to change it on
sigreturn would manually or the feature in to xfeatures, which would
cause the feature to go to its init state if it's not in
_header.xfeatures or to go into the saved state if it is in
_header.xfeatures?

Other means of signaling this could work, too.

It's not all that much code, I think.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@kernel.org> - 2015-12-18 02:50 +0100
  Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 03:20 +0100
    Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 03:40 +0100
      Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 04:00 +0100
        Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 06:30 +0100
          Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? "H. Peter Anvin" <hpa@zytor.com> - 2015-12-18 07:50 +0100
            Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 17:10 +0100
              Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 18:00 +0100
              Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 19:50 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 20:30 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 21:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 21:30 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-18 21:40 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 21:50 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? "H. Peter Anvin" <hpa@zytor.com> - 2015-12-18 22:00 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 22:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 22:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-18 22:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-18 22:20 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-18 22:50 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-18 23:30 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-19 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-19 00:20 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-19 00:30 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-21 18:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-22 00:00 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-22 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-22 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-22 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-22 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Andy Lutomirski <luto@amacapital.net> - 2015-12-22 00:10 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Dave Hansen <dave.hansen@linux.intel.com> - 2015-12-30 00:50 +0100
                Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-18 22:20 +0100
          Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Ingo Molnar <mingo@kernel.org> - 2015-12-18 09:40 +0100
  Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Christoph Hellwig <hch@infradead.org> - 2015-12-18 10:00 +0100
    Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? Borislav Petkov <bp@alien8.de> - 2015-12-18 14:00 +0100

csiph-web