Re: [PATCH v3 07/21] x86/fpu/xstate: Introduce helpers to manage dynamic xstate buffers

From: Bae, Chang Seok
Date: Tue Feb 02 2021 - 23:11:15 EST


On Jan 26, 2021, at 12:17, Borislav Petkov <bp@xxxxxxx> wrote:
> On Wed, Dec 23, 2020 at 07:57:03AM -0800, Chang S. Bae wrote:
>>
>> +int alloc_xstate_buffer(struct fpu *fpu, u64 mask)

<snip>

>> + if (newsz > fpu_kernel_xstate_max_size) {
>> + pr_warn_once("x86/fpu: xstate buffer too large (%u > %u bytes)\n",
>> + newsz, fpu_kernel_xstate_max_size);
>> + XSTATE_WARN_ON(1);
>> + return 0;
>
> return 0?!? On an error?!?

With more discussions, I now think it is too much to check like this. This
function (merely) allocates the requested size. So, going to remove it.

Thanks,
Chang