Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3876868imu; Mon, 14 Jan 2019 10:35:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN61CweCrmFxjzlg3CjVnA7GciNg4g67WdtEFnN+FuoZ3tB+UomzcCkzFbZjQCI3ACoVp5Ci X-Received: by 2002:a63:d846:: with SMTP id k6mr24541946pgj.251.1547490906034; Mon, 14 Jan 2019 10:35:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547490906; cv=none; d=google.com; s=arc-20160816; b=V49DGADeEyhu50mlG4YsB2o+709ggtWNoD/nwy1tLSqrnXCDLUIo1du62H6XCx9q2y RgTAnO8WPf05mSyftXqovxEfHjwyYMAX4VD3RcUF+ll7GmgSyq7KAlS4UNjFix/jV0z6 yIvg7FMhGngIJXasx7IjlFONk5qE+KBAsMKhBIvUkrza2l43pA1Xky1FUGK32ffrWs/e MqaIS/N3HlTDxY6h2egPashCzxuXzNApTsCgO0TZiQKrSR3BRj0jphJ7KK0slgDqAdp4 Wsarv080trvyIPTVr0gI3hUHt8VtlJQo7xmcJlvxQ/vRtbMrcV1H+//ExP55UHkO1lAI 5x4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NFk4DTouHJmGStp6mobWjwPB1ZeICgQ4H+081HD0EuI=; b=vGaXu0l4ge0AxF0vtG+MRZrO21IycSRxayW0hF2QxK7pW15qsrTXwfwQHVjF5aJpji 5XA5w2DTSaowNJODsK3xxATTGOINIPpLpcOi0A2xvAivZ1mYNdDS1uppOuKsYJlpmW6u 2GxzG6kZmO0W6oelyyNzxKJ1jMdTvJVafudBGIuikCAsWR8DPVmH2mOlL2zqtyxWDf9q AdTPzpQS5IFz8iJ2dyh3/H5IWPsFwG9H3NG4YzsEoSgpxEdY+TOrRcSuO5DgYkuADmrQ 5GDc/d8uCt4KTcfQb9+kaNF/8+sTjYx0YwWTG0RdrFHkJeye0lmWdeV8qK08PAlariY8 062w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si900745pga.219.2019.01.14.10.34.50; Mon, 14 Jan 2019 10:35:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbfANSdX (ORCPT + 99 others); Mon, 14 Jan 2019 13:33:23 -0500 Received: from mga09.intel.com ([134.134.136.24]:15619 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfANSdV (ORCPT ); Mon, 14 Jan 2019 13:33:21 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 10:33:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,478,1539673200"; d="scan'208,223";a="116686451" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by fmsmga008.fm.intel.com with ESMTP; 14 Jan 2019 10:33:19 -0800 Date: Mon, 14 Jan 2019 10:33:19 -0800 From: Sean Christopherson To: Harald Arnesen Cc: Linux Kernel Mailing List , Paolo Bonzini Subject: Re: [BISECTED] KVM error with 5.0-rc Message-ID: <20190114183319.GB5141@linux.intel.com> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 14, 2019 at 06:04:27PM +0100, Harald Arnesen wrote: > Qemu with KVM acceleration fails with kernel 5.0-rc1 and 5.0-rc2. > It works fine with 4.20. ... > Bisecting gives: > > c73da3fcab43357feb68cac227194b13e998a8db is the first bad commit > commit c73da3fcab43357feb68cac227194b13e998a8db > Author: Sean Christopherson > Date: Mon Dec 3 13:53:00 2018 -0800 > > KVM: VMX: Properly handle dynamic VM Entry/Exit controls > > EFER and PERF_GLOBAL_CTRL MSRs have dedicated VM Entry/Exit controls > that KVM dynamically toggles based on whether or not the guest's value > for each MSRs differs from the host. Handle the dynamic behavior by > adding a helper that clears the dynamic bits so the bits aren't set > when initializing the VMCS field outside of the dynamic toggling flow. > This makes the handling consistent with similar behavior for other > controls, e.g. pin, exec and sec_exec. More importantly, it eliminates > two global bools that are stealthily modified by setup_vmcs_config. > > Opportunistically clean up a comment and print related to errata for > IA32_PERF_GLOBAL_CTRL. > > Signed-off-by: Sean Christopherson > Signed-off-by: Paolo Bonzini Can you test the attached patch? Found a bug when re-inspecting the guilty commit, the wrong VMCS field is being modifying when applying an errata to disable VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL. Your CPU is listed as one of the models affected by the errata. Compile tested only. --3MwIy2ne0vdjdPXF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-KVM-VMX-Use-the-correct-var-field-when-clearing-VM_E.patch" From 6dde876a992ca2e3627b1fe7aca3975487bc1da6 Mon Sep 17 00:00:00 2001 From: Sean Christopherson Date: Mon, 14 Jan 2019 10:23:46 -0800 Subject: [PATCH] KVM: VMX: Use the correct var field when clearing VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL Fix a recently introduced bug that results in the wrong VMCS control field being updated when applying a IA32_PERF_GLOBAL_CTRL errata. Fixes: c73da3fcab43 ("KVM: VMX: Properly handle dynamic VM Entry/Exit controls") Reported-by: Harald Arnesen Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index f6915f10e584..0762fcab8fc9 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -2344,7 +2344,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, case 37: /* AAT100 */ case 44: /* BC86,AAY89,BD102 */ case 46: /* BA97 */ - _vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL; + _vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL; _vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL; pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL " "does not work properly. Using workaround\n"); -- 2.19.2 --3MwIy2ne0vdjdPXF--