public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	kvm@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: VMX: make read-only const array vmx_uret_msrs_list static
Date: Thu, 14 Apr 2022 14:39:32 +0000	[thread overview]
Message-ID: <YlgyJPRVNCe4w8q3@google.com> (raw)
In-Reply-To: <20220414100720.295502-1-colin.i.king@gmail.com>

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.

> Signed-off-by: Colin Ian King <colin.i.king@gmail.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
> 

  reply	other threads:[~2022-04-14 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 10:07 [PATCH] KVM: VMX: make read-only const array vmx_uret_msrs_list static Colin Ian King
2022-04-14 14:39 ` Sean Christopherson [this message]
2022-04-14 15:15   ` Colin King (gmail)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YlgyJPRVNCe4w8q3@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=colin.i.king@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox