lkml.org 
[lkml]   [2019]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 05/16] KVM: VMX: Drop initialization of IA32_FEATURE_CONTROL MSR
On Mon, Oct 21, 2019 at 05:08:20PM -0700, Sean Christopherson wrote:
> + if (WARN_ON_ONCE(!(msr & FEATURE_CONTROL_LOCKED)))
> + return 1;
> +
> + /* launched w/ TXT and VMX disabled */
> + if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX) &&
> + tboot_enabled())
> + return 1;
> + /* launched w/o TXT and VMX only enabled w/ TXT */
> + if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX) &&
> + (msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX) &&
> + !tboot_enabled()) {
> + pr_warn("kvm: disable TXT in the BIOS or "
> + "activate TXT before enabling KVM\n");
> + return 1;

Might as well fix that with a cleanup patch ontop:

WARNING: quoted string split across lines
#69: FILE: arch/x86/kvm/vmx/vmx.c:2208:
+ pr_warn("kvm: disable TXT in the BIOS or "
+ "activate TXT before enabling KVM\n");


Also in that same cleanup patch, if the order of those tests doesn't
matter, you can simplify them a bit:

if (tboot_enabled()) {
/* msr flag test here */

/* tboot disabled */
} else {
/* other two tests here */
}

Should make it a bit easier to parse.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2019-10-25 18:27    [W:0.305 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site