Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-02-09 Thread Bae, Chang Seok
On Feb 8, 2021, at 04:33, Borislav Petkov wrote: > On Wed, Dec 23, 2020 at 07:57:06AM -0800, Chang S. Bae wrote: >> copy_xregs_to_kernel() used to save all user states in a kernel buffer. >> When the dynamic user state is enabled, it becomes conditional which state >> to be saved. >> >>

Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-02-08 Thread Borislav Petkov
On Wed, Dec 23, 2020 at 07:57:06AM -0800, Chang S. Bae wrote: > copy_xregs_to_kernel() used to save all user states in a kernel buffer. > When the dynamic user state is enabled, it becomes conditional which state > to be saved. > > fpu->state_mask can indicate which state components are reserved

Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-01-14 Thread Liu, Jing2
On 1/15/2021 12:59 PM, Bae, Chang Seok wrote: On Jan 11, 2021, at 18:52, Liu, Jing2 wrote: On 1/8/2021 2:40 AM, Bae, Chang Seok wrote: On Jan 7, 2021, at 17:41, Liu, Jing2 wrote: static void kvm_save_current_fpu(struct fpu *fpu) { + struct fpu *src_fpu = >thread.fpu; + /*

Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-01-14 Thread Bae, Chang Seok
> On Jan 11, 2021, at 18:52, Liu, Jing2 wrote: > > On 1/8/2021 2:40 AM, Bae, Chang Seok wrote: >>> On Jan 7, 2021, at 17:41, Liu, Jing2 wrote: >>> >>> static void kvm_save_current_fpu(struct fpu *fpu) { >>> + struct fpu *src_fpu = >thread.fpu; >>> + >>> /* >>> * If the target FPU

Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-01-11 Thread Liu, Jing2
On 1/8/2021 2:40 AM, Bae, Chang Seok wrote: On Jan 7, 2021, at 17:41, Liu, Jing2 wrote: static void kvm_save_current_fpu(struct fpu *fpu) { + struct fpu *src_fpu = >thread.fpu; + /* * If the target FPU state is not resident in the CPU registers, just *

Re: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-01-07 Thread Bae, Chang Seok
> On Jan 7, 2021, at 17:41, Liu, Jing2 wrote: > > static void kvm_save_current_fpu(struct fpu *fpu) { > + struct fpu *src_fpu = >thread.fpu; > + > /* >* If the target FPU state is not resident in the CPU registers, just >* memcpy() from current, else save CPU state

RE: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2021-01-07 Thread Liu, Jing2
; k...@vger.kernel.org Subject: [PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate copy_xregs_to_kernel() used to save all user states in a kernel buffer. When the dynamic user state is enabled, it becomes conditional which state to be saved. fpu->state_m

[PATCH v3 10/21] x86/fpu/xstate: Update xstate save function to support dynamic xstate

2020-12-23 Thread Chang S. Bae
copy_xregs_to_kernel() used to save all user states in a kernel buffer. When the dynamic user state is enabled, it becomes conditional which state to be saved. fpu->state_mask can indicate which state components are reserved to be saved in XSAVE buffer. Use it as XSAVE's instruction mask to