lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Dec 2018 08:34:42 +0800
From:   "Li, Aubrey" <aubrey.li@...ux.intel.com>
To:     Dave Hansen <dave.hansen@...el.com>,
        Aubrey Li <aubrey.li@...el.com>, tglx@...utronix.de,
        mingo@...hat.com, peterz@...radead.org, hpa@...or.com
Cc:     ak@...ux.intel.com, tim.c.chen@...ux.intel.com,
        arjan@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks

On 2018/12/12 1:20, Dave Hansen wrote:
>  to update AVX512 state
>> + */
>> +static inline void update_avx512_state(struct fpu *fpu)
>> +{
>> +	/*
>> +	 * AVX512 state is tracked here because its use is known to slow
>> +	 * the max clock speed of the core.
>> +	 *
>> +	 * However, AVX512-using tasks are expected to clear this state when
>> +	 * not actively using these registers. Thus, this tracking mechanism
>> +	 * can miss. To ensure that false-negatives do not immediately show
>> +	 * up, decay the usage count over time.
>> +	 */
>> +	if (fpu->state.xsave.header.xfeatures & XFEATURE_MASK_AVX512)
>> +		fpu->avx512_usage = AVX512_STATE_DECAY_COUNT;
>> +	else if (fpu->avx512_usage)
>> +		fpu->avx512_usage--;
>> +}
>> +
>>  /*
>>   * This function is called only during boot time when x86 caps are not set
>>   * up and alternative can not be used yet.
>> @@ -411,6 +432,7 @@ static inline int copy_fpregs_to_fpstate(struct fpu *fpu)
>>  {
>>  	if (likely(use_xsave())) {
>>  		copy_xregs_to_kernel(&fpu->state.xsave);
>> +		update_avx512_state(fpu);
>>  		return 1;
>>  	}
> 
> 
> Is there a reason we shouldn't do:
> 
> 	if (!cpu_feature_enabled(X86_FEATURE_AVX512F))
> 		update_avx512_state(fpu);
> 
> ?
> 

Why _!_ ?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ