From patchwork Mon Oct 26 12:57:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@bugzilla.kernel.org X-Patchwork-Id: 7487961 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E1B5D9F37F for ; Mon, 26 Oct 2015 12:57:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EA2220700 for ; Mon, 26 Oct 2015 12:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12C1E20703 for ; Mon, 26 Oct 2015 12:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754033AbbJZM5H (ORCPT ); Mon, 26 Oct 2015 08:57:07 -0400 Received: from mail.kernel.org ([198.145.29.136]:46680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753958AbbJZM5F (ORCPT ); Mon, 26 Oct 2015 08:57:05 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23467207EA for ; Mon, 26 Oct 2015 12:57:04 +0000 (UTC) Received: from bugzilla1.web.kernel.org (bugzilla1.web.kernel.org [172.20.200.51]) by mail.kernel.org (Postfix) with ESMTP id 053EB20711 for ; Mon, 26 Oct 2015 12:57:03 +0000 (UTC) Received: by bugzilla1.web.kernel.org (Postfix, from userid 48) id 00CB1405DB; Mon, 26 Oct 2015 12:57:02 +0000 (UTC) From: bugzilla-daemon@bugzilla.kernel.org To: kvm@vger.kernel.org Subject: [Bug 106621] New: Failure to install Hyper-V role on nested KVM guest Date: Mon, 26 Oct 2015 12:57:02 +0000 X-Bugzilla-Reason: None X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: AssignedTo virtualization_kvm@kernel-bugs.osdl.org X-Bugzilla-Product: Virtualization X-Bugzilla-Component: kvm X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Rainmaker52@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: virtualization_kvm@kernel-bugs.osdl.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version cf_kernel_version rep_platform op_sys cf_tree bug_status bug_severity priority component assigned_to reporter cf_regression Message-ID: X-Bugzilla-URL: https://bugzilla.kernel.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP https://bugzilla.kernel.org/show_bug.cgi?id=106621 Bug ID: 106621 Summary: Failure to install Hyper-V role on nested KVM guest Product: Virtualization Version: unspecified Kernel Version: 4.3.0-rc7 Hardware: x86-64 OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: kvm Assignee: virtualization_kvm@kernel-bugs.osdl.org Reporter: Rainmaker52@gmail.com Regression: No When installing the Hyper-V role on a Windows guest (tried 2008 R2, 2012 R2 and 2016 TP3), the Windows installer refuses to install because of the error "Hyper-V cannot be installed because virtualization support is not enabled in the BIOS." This is because the MSR 0x3a is initialized to "0". When VMX is activated on the guest CPU, the 0x3a register should return "5". The following code patch (may be a bit of an overstatement) returns "5" if VMX is set on the guest CPU, thereby reporting to the guest that visualization is enabled in the BIOS. This, together with "-cpu host,-hypervisor,+vmx will allow Hyper-V to be installed. It will however not allow to start these Virtual Machines. --- a/arch/x86/kvm/vmx.c 2015-10-25 02:39:47.000000000 +0100 +++ b/arch/x86/kvm/vmx.c 2015-10-26 13:35:51.894700786 +0100 @@ -2661,7 +2661,12 @@ case MSR_IA32_FEATURE_CONTROL: if (!nested_vmx_allowed(vcpu)) return 1; - msr_info->data = to_vmx(vcpu)->nested.msr_ia32_feature_control; + if (nested_vmx_allowed(vcpu)) { + //Set all 3 bits in 0x3a + msr_info->data = 5; + } else { + msr_info->data = to_vmx(vcpu)->nested.msr_ia32_feature_control; + } break; case MSR_IA32_VMX_BASIC ... MSR_IA32_VMX_VMFUNC: if (!nested_vmx_allowed(vcpu))