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, 29 Nov 2023 22:16:32 +0800
From:   "Yang, Weijiang" <weijiang.yang@...el.com>
To:     "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
CC:     "Hansen, Dave" <dave.hansen@...el.com>,
        "seanjc@...gle.com" <seanjc@...gle.com>,
        "john.allen@....com" <john.allen@....com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "Gao, Chao" <chao.gao@...el.com>,
        "mlevitsk@...hat.com" <mlevitsk@...hat.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 06/26] x86/fpu/xstate: Create guest fpstate with guest
 specific config

On 11/28/2023 11:19 PM, Edgecombe, Rick P wrote:
> On Fri, 2023-11-24 at 00:53 -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_features includes 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.
>> +        */
>> +       gfpstate_size =
>> xstate_calculate_size(fpu_guest_cfg.default_features,
>> +                                             compacted);
> Why not fpu_guest_cfg.default_size here?

Nice catch!
I should use fpu_guest_cfg.default_size directly instead of re-calculating it with the same manner. Thanks!
>
>> +
>> +       size = gfpstate_size + ALIGN(offsetof(struct fpstate, regs),
>> 64);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ