From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: vmx: restore MSR_IA32_DEBUGCTLMSR after VMEXIT Date: Sun, 12 Aug 2012 16:22:59 +0300 Message-ID: <5027AE33.1040408@redhat.com> References: <20120812131228.GL3341@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56385 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755Ab2HLNXE (ORCPT ); Sun, 12 Aug 2012 09:23:04 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7CDN1K5031556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 12 Aug 2012 09:23:01 -0400 In-Reply-To: <20120812131228.GL3341@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/12/2012 04:12 PM, Gleb Natapov wrote: > MSR_IA32_DEBUGCTLMSR is zeroed on VMEXIT. Restore it to the correct > value. > > @@ -6222,6 +6222,7 @@ static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx) > static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) > { > struct vcpu_vmx *vmx = to_vmx(vcpu); > + unsigned long debugctlmsr; > > if (is_guest_mode(vcpu) && !vmx->nested.nested_run_pending) { > struct vmcs12 *vmcs12 = get_vmcs12(vcpu); > @@ -6261,6 +6262,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) > vmx_set_interrupt_shadow(vcpu, 0); > > atomic_switch_perf_msrs(vmx); > + debugctlmsr = get_debugctlmsr(); How expensive is this? We may want a follow-on patch to cache it in a per-cpu variable. -- error compiling committee.c: too many arguments to function