From patchwork Tue Jul 23 09:41:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 2831891 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 52800C0319 for ; Tue, 23 Jul 2013 09:52:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34B3F201DD for ; Tue, 23 Jul 2013 09:52:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D373201D6 for ; Tue, 23 Jul 2013 09:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932138Ab3GWJwg (ORCPT ); Tue, 23 Jul 2013 05:52:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756358Ab3GWJw3 (ORCPT ); Tue, 23 Jul 2013 05:52:29 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6N9qKdx016951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 23 Jul 2013 05:52:20 -0400 Received: from amd-6168-8-1.englab.nay.redhat.com (amd-6168-8-1.englab.nay.redhat.com [10.66.104.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6N9q1km032533; Tue, 23 Jul 2013 05:52:16 -0400 From: Jason Wang To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, gleb@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jason Wang , "K. Y. Srinivasan" Subject: [PATCH 4/4] x86: properly handle kvm emulation of hyperv Date: Tue, 23 Jul 2013 17:41:05 +0800 Message-Id: <1374572465-15278-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1374572465-15278-1-git-send-email-jasowang@redhat.com> References: <1374572465-15278-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 Recent kvm has some basic support of hyperv, this will cause the guest to identify itself as running on top of hyperv instead of kvm which will disable kvm pv functionality. This is because we try to detect hyperv before kvm. Solve this by simply checking kvm in detect_hypervisor() first. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Gleb Natapov Cc: Paolo Bonzini Cc: K. Y. Srinivasan Signed-off-by: Jason Wang Acked-by: Paolo Bonzini --- arch/x86/kernel/cpu/hypervisor.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 8727921..3e149b6 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -36,10 +36,10 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] = &x86_hyper_xen_hvm, #endif &x86_hyper_vmware, - &x86_hyper_ms_hyperv, #ifdef CONFIG_KVM_GUEST &x86_hyper_kvm, #endif + &x86_hyper_ms_hyperv, }; const struct hypervisor_x86 *x86_hyper;