mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: KVM <kvm@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	"Janakarajan Natarajan" <Janakarajan.Natarajan@amd.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH] KVM: SVM: Do not issue virtual VMLOAD/VMSAVE supported-message
Date: Wed, 6 Sep 2017 16:00:04 +0200	[thread overview]
Message-ID: <f6259a3d-d6e6-a37d-65ac-628b883a40b4@redhat.com> (raw)
In-Reply-To: <20170906131736.4tkvjveqjfmkdpxo@pd.tnic>

On 06.09.2017 15:17, Borislav Petkov wrote:
> On Wed, Sep 06, 2017 at 02:54:05PM +0200, David Hildenbrand wrote:
>> Maybe go one step further and incorporate everything (+vls) into a
>> single if statement?
> 
> Or maybe simplify it even more by not even looking at vls. If the user
> disables it, fine, if she enables it but the hw doesn't support it, it
> will be set to false automatically.
> 
> Or am I missing a case?
> 
> ---
> From: Borislav Petkov <bp@suse.de>
> Date: Tue, 5 Sep 2017 18:59:55 +0200
> Subject: [PATCH] KVM: SVM: Do not issue virtual VMLOAD/VMSAVE
>  supported-message
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> There's no need to issue that everytime during boot - we have the
> /proc/cpuinfo flag for people and software to query.
> 
> Also, simplify logic which verifies the vls chicken bit setting.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> ---
>  arch/x86/kvm/svm.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 8dbd8dbc83eb..d3c481778d9c 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -1098,15 +1098,10 @@ static __init int svm_hardware_setup(void)
>  		}
>  	}
>  
> -	if (vls) {
> -		if (!npt_enabled ||
> -		    !boot_cpu_has(X86_FEATURE_V_VMSAVE_VMLOAD) ||
> -		    !IS_ENABLED(CONFIG_X86_64)) {
> -			vls = false;
> -		} else {
> -			pr_info("Virtual VMLOAD VMSAVE supported\n");
> -		}
> -	}
> +	if (!npt_enabled ||
> +	    !boot_cpu_has(X86_FEATURE_V_VMSAVE_VMLOAD) ||
> +	    !IS_ENABLED(CONFIG_X86_64))
> +		vls = false;
>  
>  	return 0;
>  
> 

had the same idea but was worried about runtime. but  this is really
only executed once, so

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David

  reply	other threads:[~2017-09-06 14:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 17:06 Borislav Petkov
2017-09-06 12:54 ` David Hildenbrand
2017-09-06 13:17   ` Borislav Petkov
2017-09-06 14:00     ` David Hildenbrand [this message]
2017-09-06 15:28       ` Borislav Petkov
2017-09-13 14:06 ` Radim Krčmář
2017-09-13 21:31   ` Paolo Bonzini

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=f6259a3d-d6e6-a37d-65ac-628b883a40b4@redhat.com \
    --to=david@redhat.com \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=bp@alien8.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /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

all inboxes | Powered by JetHome®