From: Borislav Petkov <bp@alien8.de>
To: "Chang S. Bae" <chang.seok.bae@intel.com>
Cc: luto@kernel.org, tglx@linutronix.de, mingo@kernel.org,
x86@kernel.org, len.brown@intel.com, dave.hansen@intel.com,
thiago.macieira@intel.com, jing2.liu@intel.com,
ravi.v.shankar@intel.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH v9 07/26] x86/fpu/xstate: Convert the struct fpu 'state' field to a pointer
Date: Thu, 12 Aug 2021 19:09:28 +0200 [thread overview]
Message-ID: <YRVVyI2RDVzFplnn@zn.tnic> (raw)
In-Reply-To: <20210730145957.7927-8-chang.seok.bae@intel.com>
On Fri, Jul 30, 2021 at 07:59:38AM -0700, Chang S. Bae wrote:
> diff --git a/arch/x86/include/asm/fpu/types.h b/arch/x86/include/asm/fpu/types.h
> index f5a38a5f3ae1..c7826708f27f 100644
> --- a/arch/x86/include/asm/fpu/types.h
> +++ b/arch/x86/include/asm/fpu/types.h
> @@ -339,13 +339,30 @@ struct fpu {
> /*
> * @state:
> *
> - * In-memory copy of all FPU registers that we save/restore
> - * over context switches. If the task is using the FPU then
> - * the registers in the FPU are more recent than this state
> - * copy. If the task context-switches away then they get
> - * saved here and represent the FPU state.
> + * A pointer to indicate the in-memory copy of all FPU registers
> + * that are saved/restored over context switches.
> + *
> + * Initially @state points to @__default_state. When dynamic states
> + * get used, a memory is allocated for the larger state copy and
> + * @state is updated to point to it. Then, the state in ->state
> + * supersedes and invalidates the state in @__default_state.
> + *
> + * In general, if the task is using the FPU then the registers in
> + * the FPU are more recent than the state copy. If the task
> + * context-switches away then they get saved in ->state and
> + * represent the FPU state.
> + */
> + union fpregs_state *state;
> +
> + /*
> + * @__default_state:
> + *
> + * Initial in-memory copy of all FPU registers that saved/restored
> + * over context switches. When the task is switched to dynamic
> + * states, this copy is replaced with the new in-memory copy in
> + * ->state.
> */
> - union fpregs_state state;
> + union fpregs_state __default_state;
> /*
> * WARNING: 'state' is dynamically-sized. Do not put
^^^^^^
that needs to be __default_state as it is which is dynamically-sized.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2021-08-12 17:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210730145957.7927-1-chang.seok.bae@intel.com>
2021-07-30 14:59 ` [PATCH v9 01/26] x86/fpu/xstate: Modify the initialization helper to handle both static and dynamic buffers Chang S. Bae
2021-07-30 14:59 ` [PATCH v9 03/26] x86/fpu/xstate: Modify address finders " Chang S. Bae
2021-07-30 14:59 ` [PATCH v9 05/26] x86/fpu/xstate: Add new variables to indicate dynamic XSTATE buffer size Chang S. Bae
2021-08-12 15:03 ` Borislav Petkov
2021-07-30 14:59 ` [PATCH v9 07/26] x86/fpu/xstate: Convert the struct fpu 'state' field to a pointer Chang S. Bae
2021-08-12 17:09 ` Borislav Petkov [this message]
2021-07-30 14:59 ` [PATCH v9 09/26] x86/fpu/xstate: Update the XSTATE save function to support dynamic states Chang S. Bae
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=YRVVyI2RDVzFplnn@zn.tnic \
--to=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@intel.com \
--cc=jing2.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=tglx@linutronix.de \
--cc=thiago.macieira@intel.com \
--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