[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82a9f0c4-7e6d-477a-bc6e-6dcb046b25fd@intel.com>
Date: Fri, 5 Jan 2024 16:16:53 +0800
From: "Yang, Weijiang" <weijiang.yang@...el.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
CC: "Hansen, Dave" <dave.hansen@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "seanjc@...gle.com" <seanjc@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, "kvm@...r.kernel.org"
<kvm@...r.kernel.org>, "john.allen@....com" <john.allen@....com>,
"peterz@...radead.org" <peterz@...radead.org>, "Gao, Chao"
<chao.gao@...el.com>, "mlevitsk@...hat.com" <mlevitsk@...hat.com>
Subject: Re: [PATCH v8 06/26] x86/fpu/xstate: Create guest fpstate with guest
specific config
On 1/5/2024 6:47 AM, Edgecombe, Rick P wrote:
> On Thu, 2023-12-21 at 09:02 -0500, Yang Weijiang wrote:
>> +static struct fpstate *__fpu_alloc_init_guest_fpstate(struct
>> fpu_guest *gfpu)
>> {
>> + bool compacted = cpu_feature_enabled(X86_FEATURE_XCOMPACTED);
>> + unsigned int gfpstate_size, size;
>> struct fpstate *fpstate;
>> - unsigned int size;
>>
>> - size = fpu_user_cfg.default_size + ALIGN(offsetof(struct
>> fpstate, regs), 64);
>> + /*
>> + * fpu_guest_cfg.default_size is initialized to hold all
>> enabled
>> + * xfeatures except the user dynamic xfeatures. If the user
>> dynamic
>> + * xfeatures are enabled, the guest fpstate will be re-
>> allocated to
>> + * hold all guest enabled xfeatures, so omit user dynamic
>> xfeatures
>> + * here.
>> + */
>> + size = fpu_guest_cfg.default_size +
>> + ALIGN(offsetof(struct fpstate, regs), 64);
>> +
>> fpstate = vzalloc(size);
>> if (!fpstate)
>> - return false;
>> + return NULL;
>> + /*
>> + * Initialize sizes and feature masks, use fpu_user_cfg.*
>> + * for user_* settings for compatibility of exiting uAPIs.
>> + */
>> + fpstate->size = gfpstate_size;
> gfpstate_size is used uninitialized.
Ah, this is another unused variable after introduce fpu_guest_cfg.*, should be replaced by
fpu_guest_cfg.default_size. Thanks for caching it!
Powered by blists - more mailing lists