From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: VMX: Fix clts Date: Mon, 25 Jan 2010 11:25:38 -0200 Message-ID: <20100125132538.GA3640@amt.cnet> References: <1264328243-21604-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753700Ab0AYNmP (ORCPT ); Mon, 25 Jan 2010 08:42:15 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0PDgFmS006250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Jan 2010 08:42:15 -0500 Content-Disposition: inline In-Reply-To: <1264328243-21604-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Jan 24, 2010 at 12:17:23PM +0200, Avi Kivity wrote: > The simplistic clts implementation has a couple of flaws: > - kvm_read_cr0_bits() is temporarily unsynchronized when vcpu->arch.cr0 changes > - if the fpu is active, we need to clear GUEST_CR0.TS, not just > CR_READ_SHADOW.TS, so that we don't send the guest an unexpected #NM. > > Fix by replacing custom logic with a call to vmx_set_cr0(), which does the > right thing, albeit less efficiently. > > Signed-off-by: Avi Kivity Applied, thanks.