From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/8] KVM: Activate fpu on clts Date: Thu, 04 Feb 2010 19:56:29 +0200 Message-ID: <4B6B0A4D.9070005@redhat.com> References: <1264080712-3981-1-git-send-email-avi@redhat.com> <1264080712-3981-4-git-send-email-avi@redhat.com> <4B67DF6C.3000507@redhat.com> <4B6AC60D.5030905@redhat.com> <20100204131125.GF2471@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , Marcelo Tosatti , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9724 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751890Ab0BDR4j (ORCPT ); Thu, 4 Feb 2010 12:56:39 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14HucBn031948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 12:56:38 -0500 In-Reply-To: <20100204131125.GF2471@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/04/2010 03:11 PM, Gleb Natapov wrote: > On Thu, Feb 04, 2010 at 03:05:17PM +0200, Avi Kivity wrote: > >> On 02/02/2010 10:16 AM, Paolo Bonzini wrote: >> >>> On 01/21/2010 02:31 PM, Avi Kivity wrote: >>> >>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >>>> index feca59f..09207ba 100644 >>>> --- a/arch/x86/kvm/x86.c >>>> +++ b/arch/x86/kvm/x86.c >>>> @@ -3266,6 +3266,7 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, >>>> gva_t address) >>>> int emulate_clts(struct kvm_vcpu *vcpu) >>>> { >>>> kvm_x86_ops->set_cr0(vcpu, kvm_read_cr0_bits(vcpu, ~X86_CR0_TS)); >>>> + kvm_x86_ops->fpu_activate(vcpu); >>>> return X86EMUL_CONTINUE; >>>> } >>>> >>> Can this code be reached if CLTS is executed in real mode? That >>> would cause a NULL-pointer access on VMX. >>> >> How would this cause a null pointer access? >> >> > vmx.c doesn't initialize kvm_x86_ops->fpu_activate as far as I see. > Gaak. Well, that's obviously unintended. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.