From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 3/8] KVM: Activate fpu on clts Date: Wed, 3 Feb 2010 12:23:54 +0200 Message-ID: <20100203102354.GL739@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17824 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932276Ab0BCKX5 (ORCPT ); Wed, 3 Feb 2010 05:23:57 -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 o13ANuvo004869 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Feb 2010 05:23:57 -0500 Content-Disposition: inline In-Reply-To: <4B67DF6C.3000507@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Feb 02, 2010 at 09:16:44AM +0100, 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. > We should assume that any part of emulator can be reached from a guest and do check accordingly. -- Gleb.