From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: pkeys: Support setting access rights for signal handlers Date: Wed, 13 Dec 2017 07:22:01 -0800 Message-ID: References: <5fee976a-42d4-d469-7058-b78ad8897219@redhat.com> <5965d682-61b2-d7da-c4d7-c223aa396fab@redhat.com> <20171212231324.GE5460@ram.oc3035372033.ibm.com> <9dc13a32-b1a6-8462-7e19-cfcf9e2c151e@redhat.com> <20171213113544.GG5460@ram.oc3035372033.ibm.com> <9f86d79e-165a-1b8e-32dd-7e4e8579da59@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mga07.intel.com ([134.134.136.100]:36868 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbdLMPWD (ORCPT ); Wed, 13 Dec 2017 10:22:03 -0500 In-Reply-To: <9f86d79e-165a-1b8e-32dd-7e4e8579da59@redhat.com> Content-Language: en-US Sender: linux-arch-owner@vger.kernel.org List-ID: To: Florian Weimer , Ram Pai Cc: linux-mm , x86@kernel.org, linux-arch , linux-x86_64@vger.kernel.org, Linux API On 12/13/2017 07:08 AM, Florian Weimer wrote: > Okay, this model is really quite different from x86. Is there a > good reason for the difference? Yes, both implementations are simple and take the "natural" behavior. x86 changes XSAVE-controlled register values on entering a signal, so we let them be changed (including PKRU). POWER hardware does not do this to its PKRU-equivalent, so we do not force it to. x86 didn't have to do this for *signals*. But, we kinda went on this trajectory when we decided to clear/restore FPU state on entering/exiting signals before XSAVE even existed. FWIW, I do *not* think we have to do this for future XSAVE states. But, if we do that, we probably need an interface for apps to tell us which states to save/restore and which state to set upon entering a signal handler. That's what I was trying to get you to consider instead of just a one-off hack to fix this for pkeys.