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:   Mon, 30 Aug 2021 23:39:58 +0000
From:   "Bae, Chang Seok" <chang.seok.bae@...el.com>
To:     Borislav Petkov <bp@...en8.de>
CC:     "Lutomirski, Andy" <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>,
        "Macieira, Thiago" <thiago.macieira@...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 v9 08/26] x86/fpu/xstate: Introduce helpers to manage the
 XSTATE buffer dynamically

On Aug 30, 2021, at 10:07, Borislav Petkov <bp@...en8.de> wrote:
> On Wed, Aug 18, 2021 at 07:46:55PM +0000, Bae, Chang Seok wrote:
>> No, this non-compacted thing is not for optimization. SDM is not quite clear
>> about the logic behind the non-compacted format -- some state’s offset does
>> not always match with the 'size + offset' of the previous one, even without
>> 64B-alignment. So, the loop is only for the compacted format, not the
>> non-compacted one. 
>> 
>> It was refactored to use in the new helper to find feature_nr’s start point.
>> If the size is added up here, it is not ‘i’'s start point anymore.
> 
> Let's see, we're still talking about this thing, right:
> 
>        nr = fls64(mask) - 1;
> 
>        if (!boot_cpu_has(X86_FEATURE_XSAVES))
>                return xstate_offsets[nr] + xstate_sizes[nr];
> 
> ?
> 
> That @mask is "which components reserved in the buffer."
> 
> Which buffer? The mask being passed is independent from whatever buffer.
> 
> So you need to do a lot more explaining here before this goes anywhere.

Yes, this function that you suggested to rename like 
calculate_xstate_buf_size_from_mask() has no input to do with any buffer.

Perhaps, as Dave suggested [1],
    "@mask		The set of components for which the space is needed."

Along with these,
    "calculate_xstate_buf_size_from_mask -- Calculate the amount of space
     needed to store an xstate buffer with the given features.”

    s/nr/last_feature_nr/

[1]: https://lore.kernel.org/lkml/bb49fdc9-2228-8bd1-bcc5-7c498daf0887@intel.com/

Thanks,
Chang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ