mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Harald Arnesen <harald@skogtun.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [BISECTED] KVM error with 5.0-rc
Date: Mon, 14 Jan 2019 10:33:19 -0800	[thread overview]
Message-ID: <20190114183319.GB5141@linux.intel.com> (raw)
In-Reply-To: <c8d44a6a-bdb6-6b8c-4a50-1d152a3964f8@skogtun.org>

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

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 <sean.j.christopherson@intel.com>
> 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 <sean.j.christopherson@intel.com>
>     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

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.

[-- Attachment #2: 0001-KVM-VMX-Use-the-correct-var-field-when-clearing-VM_E.patch --]
[-- Type: text/x-diff, Size: 1331 bytes --]

From 6dde876a992ca2e3627b1fe7aca3975487bc1da6 Mon Sep 17 00:00:00 2001
From: Sean Christopherson <sean.j.christopherson@intel.com>
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 <harald@skogtun.org>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 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


  reply	other threads:[~2019-01-14 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 17:04 Harald Arnesen
2019-01-14 18:33 ` Sean Christopherson [this message]
2019-01-14 19:17   ` Harald Arnesen
2019-01-14 20:07     ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114183319.GB5141@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=harald@skogtun.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome