From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Major KVM issues with kernel 4.5 on the host Date: Wed, 13 Apr 2016 22:36:34 +0200 Message-ID: <570EADD2.8030300@redhat.com> References: <20160317165435.GB3022@torres.zugschlus.de> <20160317181128.GA30324@pd.tnic> <56EBD20A.1020608@redhat.com> <20160413183701.GC7600@torres.zugschlus.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Borislav Petkov , linux-kernel@vger.kernel.org, kvm ML To: Marc Haber Return-path: In-Reply-To: <20160413183701.GC7600@torres.zugschlus.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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