Skip to content

Commit

Permalink
KVM: x86: VMX: redo fix for link error without CONFIG_HYPERV
Browse files Browse the repository at this point in the history
Arnd had sent this patch to the KVM mailing list, but it slipped through
the cracks of maintainers hand-off, and therefore wasn't included in
the pull request.

The same issue had been fixed by Linus in commit dbee3d0 ("KVM: x86:
VMX: fix build without hyper-v", 2018-06-12) as a self-described
"quick-and-hacky build fix".  However, checking the compile-time
configuration symbol with IS_ENABLED is cleaner and it is enough to
avoid the link error, so switch to Arnd's solution.

Signed-off-by: Arnd Bergmann <[email protected]>
[Rewritten commit message. - Paolo]
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
arndb authored and bonzini committed Jun 14, 2018
1 parent 09027ab commit 1f008e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4429,16 +4429,14 @@ static int alloc_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
goto out_vmcs;
memset(loaded_vmcs->msr_bitmap, 0xff, PAGE_SIZE);

#if IS_ENABLED(CONFIG_HYPERV)
if (static_branch_unlikely(&enable_evmcs) &&
if (IS_ENABLED(CONFIG_HYPERV) &&
static_branch_unlikely(&enable_evmcs) &&
(ms_hyperv.nested_features & HV_X64_NESTED_MSR_BITMAP)) {
struct hv_enlightened_vmcs *evmcs =
(struct hv_enlightened_vmcs *)loaded_vmcs->vmcs;

evmcs->hv_enlightenments_control.msr_bitmap = 1;
}
#endif

}
return 0;

Expand Down

0 comments on commit 1f008e1

Please sign in to comment.