Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbcDMUgq (ORCPT ); Wed, 13 Apr 2016 16:36:46 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35481 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421AbcDMUgo (ORCPT ); Wed, 13 Apr 2016 16:36:44 -0400 Subject: Re: Major KVM issues with kernel 4.5 on the host To: Marc Haber References: <20160317165435.GB3022@torres.zugschlus.de> <20160317181128.GA30324@pd.tnic> <56EBD20A.1020608@redhat.com> <20160413183701.GC7600@torres.zugschlus.de> Cc: Borislav Petkov , linux-kernel@vger.kernel.org, kvm ML From: Paolo Bonzini Message-ID: <570EADD2.8030300@redhat.com> Date: Wed, 13 Apr 2016 22:36:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160413183701.GC7600@torres.zugschlus.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1858 Lines: 65 On 13/04/2016 20:37, Marc Haber wrote: > On Fri, Mar 18, 2016 at 11:01:46AM +0100, Paolo Bonzini wrote: >> On 17/03/2016 19:11, Borislav Petkov wrote: >>> I'm going to try reproducing the issue on a less "important" machine >>> so that bisecting is less painful, but maybe you guys have an idea >>> what's going wrong here. >> >> No idea, sorry. :( Bisecting would be great. > > Working on that now. > >> I'll also try reproducing and bisecting next week, in the meanwhile >> just having the host dmesg would help a lot. > > Attached. I hope the message will get through to the list. Didn't help, but a fresh look at the list of 4.5 patches helped. What the hell was I thinking, I missed write_rdtscp_aux who obviously uses MSR_TSC_AUX. diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 31346a3f20a5..1481dea15844 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -39,6 +39,7 @@ #include #include +#include #include "trace.h" #define __ex(x) __kvm_handle_fault_on_reboot(x) @@ -1240,9 +1241,6 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu) wrmsrl(MSR_AMD64_TSC_RATIO, tsc_ratio); } } - /* This assumes that the kernel never uses MSR_TSC_AUX */ - if (static_cpu_has(X86_FEATURE_RDTSCP)) - wrmsrl(MSR_TSC_AUX, svm->tsc_aux); } static void svm_vcpu_put(struct kvm_vcpu *vcpu) @@ -3847,6 +3845,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) svm->vmcb->save.cr2 = vcpu->arch.cr2; clgi(); + if (static_cpu_has(X86_FEATURE_RDTSCP)) + wrmsrl(MSR_TSC_AUX, svm->tsc_aux); local_irq_enable(); @@ -3923,6 +3923,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) #endif ); + if (static_cpu_has(X86_FEATURE_RDTSCP)) + wrmsrl(MSR_TSC_AUX, __getcpu()); #ifdef CONFIG_X86_64 wrmsrl(MSR_GS_BASE, svm->host.gs_base); #else Paolo