From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: [PATCH] fx_init() needs preemption disabled while it plays with the FPU state Date: Mon, 30 Jul 2007 16:29:56 +1000 Message-ID: <1185776996.12151.145.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org fx_init() needs preemption disabled while it plays with the FPU state Signed-off-by: Rusty Russell diff -r 66566cf6b576 drivers/kvm/kvm_main.c --- a/drivers/kvm/kvm_main.c Fri Jul 27 16:27:11 2007 +1000 +++ b/drivers/kvm/kvm_main.c Mon Jul 30 11:22:44 2007 +1000 @@ -651,10 +651,13 @@ void fx_init(struct kvm_vcpu *vcpu) } *fx_image; + /* Initialize guest FPU by resetting ours and saving into guest's */ + preempt_disable(); fx_save(vcpu->host_fx_image); fpu_init(); fx_save(vcpu->guest_fx_image); fx_restore(vcpu->host_fx_image); + preempt_enable(); fx_image = (struct fx_image_s *)vcpu->guest_fx_image; fx_image->mxcsr = 0x1f80; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/