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]
Message-ID: <e32f16a0-f963-be9e-906a-e8995ea60ca2@gmail.com>
Date:   Thu, 14 Apr 2022 16:15:55 +0100
From:   "Colin King (gmail)" <colin.i.king@...il.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H . Peter Anvin" <hpa@...or.com>, kvm@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: VMX: make read-only const array vmx_uret_msrs_list
 static

On 14/04/2022 15:39, Sean Christopherson wrote:
> On Thu, Apr 14, 2022, Colin Ian King wrote:
>> Don't populate the read-only array vmx_uret_msrs_list on the stack
>> but instead make it static. Also makes the object code a little smaller.
> 
> Why not put it on the stack?  It's an __init function, i.e. called once in the
> lifetime of kvm-intel.ko, isn't all that big, and is certainly not performance
> critical.  And making it static begs the question of whether or not the data gets
> thrown away after init, i.e. this might consume _more_ memory once KVM has reached
> steady state.

Doh, my bad, I forgot to check that it was an __init function. Please 
discard this patch.

Colin

> 
>> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
>> ---
>>   arch/x86/kvm/vmx/vmx.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>> index c654c9d76e09..36429e2bb918 100644
>> --- a/arch/x86/kvm/vmx/vmx.c
>> +++ b/arch/x86/kvm/vmx/vmx.c
>> @@ -7871,7 +7871,7 @@ static __init void vmx_setup_user_return_msrs(void)
>>   	 * but is never loaded into hardware.  MSR_CSTAR is also never loaded
>>   	 * into hardware and is here purely for emulation purposes.
>>   	 */
>> -	const u32 vmx_uret_msrs_list[] = {
>> +	static const u32 vmx_uret_msrs_list[] = {
>>   	#ifdef CONFIG_X86_64
>>   		MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR,
>>   	#endif
>> -- 
>> 2.35.1
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ