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] [day] [month] [year] [list]
Date:   Fri, 19 Feb 2021 19:19:15 +0000
From:   "Bae, Chang Seok" <chang.seok.bae@...el.com>
To:     Borislav Petkov <bp@...e.de>
CC:     Andy Lutomirski <luto@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...nel.org" <mingo@...nel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "Brown, Len" <len.brown@...el.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        "Liu, Jing2" <jing2.liu@...el.com>,
        "Shankar, Ravi V" <ravi.v.shankar@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 11/21] x86/fpu/xstate: Update xstate buffer address
 finder to support dynamic xstate

On Feb 19, 2021, at 07:00, Borislav Petkov <bp@...e.de> wrote:
> On Wed, Dec 23, 2020 at 07:57:07AM -0800, Chang S. Bae wrote:
>> 
>> 
>> +/*
>> + * Available once those arrays for the offset, size, and alignment info are set up,
>> + * by setup_xstate_features().
>> + */
> 
> That's kinda clear, right? Apparently, we do cache FPU attributes in
> xstate.c so what is that comment actually trying to tell us? Or do you
> want to add some sort of an assertion to this function in case it gets
> called before setup_xstate_features()?

Yes, it looks apparent without saying that. I don’t think assertion needed.

> I think you should simply add kernel-doc style comment explaining what
> the inputs are and what the function gives, which would be a lot more
> useful.

Maybe something like this:

/**
 * get_xstate_comp_offset() - Find the feature's offset in the compacted format
 * @mask:		This bitmap tells which components reserved in the format.
 * @feature_nr:	Feature number
 *
 * Returns:		The offset value
 */

>> +static unsigned int get_xstate_comp_offset(struct fpu *fpu, int feature_nr)
>> +{
>> +	return __get_xstate_comp_offset(fpu->state_mask, feature_nr);
>> +}
> 
> Just get rid of the __ variant and have a single function with the
> following signature:
> 
> 	static unsigned int get_xstate_comp_offset(u64 mask, int feature_nr)

Yeah, I should have done like this.

Thanks,
Chang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ