mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Rudi Horn <rudi.horn@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Joe Jin <joe.jin@oracle.com>, Jeff Xu <jeffxu@chromium.org>
Subject: Re: [RFC] Restore PKRU to user-defined value after signal handling
Date: Thu, 7 Nov 2024 23:56:08 +0000	[thread overview]
Message-ID: <4111AC83-7A7C-4268-B294-3AB75C0EC451@oracle.com> (raw)
In-Reply-To: <7819c425-5792-4cc5-96aa-9c8b012f1a06@intel.com>


> On Nov 7, 2024, at 7:56 AM, Dave Hansen <dave.hansen@intel.com> wrote:
> 
> The question still stands as to whether the new XSTATE_BV value should
> be calculated by the kernel or read directly from the userspace buffer.

If it is calcuated by the kernel, is there a chance that we could inadvertently
set XINUSE[i] to 1 for more components other than just PKRU? Since it is 
possible that some other component was set to its init state by XSAVE, but
we’d be overwriting it with:

       xstate_bv = mask | XFEATURE_MASK_PKRU;

It seems safer to read userspace buffer and write it back, so that we do not
modify any other XSTATE_BV bits.

Apologies if I’m wildly off base.

Thanks,
Aruna

  parent reply	other threads:[~2024-11-07 23:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 18:33 Aruna Ramakrishna
2024-11-06 19:27 ` Dave Hansen
2024-11-06 19:40   ` Aruna Ramakrishna
2024-11-06 19:47     ` Dave Hansen
2024-11-07 11:41   ` Rudi Horn
2024-11-07 15:56     ` Dave Hansen
2024-11-07 16:03       ` Dave Hansen
2024-11-07 23:56       ` Aruna Ramakrishna [this message]
2024-11-08  0:26         ` Dave Hansen
2024-11-08  9:58           ` Rudi Horn

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=4111AC83-7A7C-4268-B294-3AB75C0EC451@oracle.com \
    --to=aruna.ramakrishna@oracle.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jeffxu@chromium.org \
    --cc=joe.jin@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rudi.horn@oracle.com \
    --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®