[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a98b9bf-8004-47e0-82e6-77da49419e0b@intel.com>
Date: Wed, 13 Nov 2024 11:10:01 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Aruna Ramakrishna <aruna.ramakrishna@...cle.com>,
linux-kernel@...r.kernel.org
Cc: x86@...nel.org, dave.hansen@...ux.intel.com, tglx@...utronix.de,
mingo@...nel.org, rudi.horn@...cle.com, joe.jin@...cle.com
Subject: Re: [PATCH 2/2] x86/pkeys: Set XINUSE[PKRU] to 1 so that PKRU is
XRSTOR'd correctly
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.
Powered by blists - more mailing lists