mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>,
	linux-kernel@vger.kernel.org
Cc: x86@kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de,
	mingo@kernel.org, rudi.horn@oracle.com, joe.jin@oracle.com
Subject: Re: [PATCH 2/2] x86/pkeys: Set XINUSE[PKRU] to 1 so that PKRU is XRSTOR'd correctly
Date: Wed, 13 Nov 2024 11:10:01 -0800	[thread overview]
Message-ID: <5a98b9bf-8004-47e0-82e6-77da49419e0b@intel.com> (raw)
In-Reply-To: <20241113181436.3518359-2-aruna.ramakrishna@oracle.com>

On 11/13/24 10:14, Aruna Ramakrishna wrote:
> PKRU value is not XRSTOR'd from the XSAVE area if the corresponding
> XINUSE[i] bit is 0. When PKRU value is set to 0, it sets XINUSE[PKRU]
> to 0 on AMD systems, which means the value updated on the sigframe
> later (after a wrpkru(0)) is ignored.

I think this is confusing XINUSE and XSTATE_BV.

XINUSE is really internal to the CPU and is partially exposed in
xgetbv(1).  But XINUSE is monolithic; it includes user and supervisor state.

XSTATE_BV is the actual memory location in the XSAVE buffer.

So I think it's incorrect to say that XRSTOR behavior depends on XINUSE.
 XRSTOR behavior depends on XSTATE_BV.

  reply	other threads:[~2024-11-13 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 18:14 [PATCH 1/2] x86/pkeys: Change caller of update_pkru_in_sigframe() Aruna Ramakrishna
2024-11-13 18:14 ` [PATCH 2/2] x86/pkeys: Set XINUSE[PKRU] to 1 so that PKRU is XRSTOR'd correctly Aruna Ramakrishna
2024-11-13 19:10   ` Dave Hansen [this message]
2024-11-13 20:04     ` Aruna Ramakrishna

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=5a98b9bf-8004-47e0-82e6-77da49419e0b@intel.com \
    --to=dave.hansen@intel.com \
    --cc=aruna.ramakrishna@oracle.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=joe.jin@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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®