mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Matthias Neugschwandtner <matthias.neugschwandtner@oracle.com>,
	Andrew Brownsword <andrew.brownsword@oracle.com>
Subject: Re: [RFC PATCH v2 1/1] x86/pkeys: update PKRU to enable pkey 0 before XSAVE
Date: Fri, 22 Mar 2024 18:30:53 +0000	[thread overview]
Message-ID: <34F412AB-F301-40A9-9252-BDB4BA7CC4DE@oracle.com> (raw)
In-Reply-To: <Zf1TX3QXjWQsVp2R@gmail.com>



> On Mar 22, 2024, at 2:46 AM, Ingo Molnar <mingo@kernel.org> wrote:
> 
> Ok, this looks a lot saner than the first patch.
> 
> A couple of requests:
> 
> 1)
> 
> Please split out all the PKRU parameter passing interface changes into a 
> separate patch. Ie. split out patches that don't change any behavior, and 
> try to make the final feature-enabling (bug-fixing) patch as small and easy 
> to read as possible. Maybe even have 3 patches:
> 
>  - function interface changes
>  - helper function additions
>  - behavioral changes to signal handler pkru context
> 
> 2)
> 
> I do agree that isolation of sandboxed execution into a non-zero pkey might 
> make sense. But this really needs an actual testcase.
> 
> 3)
> 
> The semantics you've implemented for sigaltstacks are not the only possible 
> ones. In principle, a signal handler with its own stack might want to have 
> its own key(s) enabled. In a way a Linux signal handler is a mini-thread 
> created on the fly, with its own stack and its own attributes. Some thought 
> & analysis should go into which way to go here, and the best path should be 
> chosen. Fixing the SIGSEGV you observed should be a happy side effect of 
> other worthwile improvements.
> 
> Thanks,
> 
> Ingo

Thank you, Ingo!

I will split this patch into multiple patches when I send it out as a patch review
request next. And add a testcase.

I agree that this patch covers a very specific use case, and it probably raises
more questions than it answers. That’s why I sent it out as an RFC - because
I wasn’t sure if this was the best way to add this functionality, and I wanted the
experts to weigh in.

As Dave suggested, I can instead do wrpkru(0) to enable all pkeys before
XSAVE.

Thanks,
Aruna

  reply	other threads:[~2024-03-22 18:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 21:56 [RFC PATCH v2 0/1] x86/pkeys: update PKRU to enable pkey 0 Aruna Ramakrishna
2024-03-21 21:56 ` [RFC PATCH v2 1/1] x86/pkeys: update PKRU to enable pkey 0 before XSAVE Aruna Ramakrishna
2024-03-22  9:46   ` Ingo Molnar
2024-03-22 18:30     ` Aruna Ramakrishna [this message]
2024-04-25 22:03     ` jeffxu
2024-03-22 15:40   ` Dave Hansen
2024-03-22 18:28     ` Aruna Ramakrishna
2024-04-25 21:05   ` jeffxu
2024-04-25 22:49     ` Aruna Ramakrishna
2024-04-26  0:12       ` Jeff Xu
2024-04-26 16:13         ` Jeff Xu
2024-04-26 16:33           ` Edgecombe, Rick P
2024-04-26 17:13             ` Jeff Xu
2024-04-25 21:58   ` jeffxu

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=34F412AB-F301-40A9-9252-BDB4BA7CC4DE@oracle.com \
    --to=aruna.ramakrishna@oracle.com \
    --cc=andrew.brownsword@oracle.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.neugschwandtner@oracle.com \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®