From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: BUG: sleeping function called from invalid context at mm/slub.c:793 Date: Thu, 13 Jan 2011 15:06:36 +0200 Message-ID: <4D2EF8DC.9040301@redhat.com> References: <20110110105433.GA17881@shutemov.name> <20110110193117.GA20027@shutemov.name> <4D2C279D.5050309@redhat.com> <4D2C3115.9030301@redhat.com> <4D2EF717.8080604@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Kirill A. Shutemov" , Christoph Lameter , Marcelo Tosatti , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Pekka Enberg To: Jan Kiszka Return-path: In-Reply-To: <4D2EF717.8080604@siemens.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 01/13/2011 02:59 PM, Jan Kiszka wrote: > > @@ -5351,6 +5351,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > > int r; > > sigset_t sigsaved; > > > > + if (!tsk_used_math(current)&& init_fpu(current)) > > + return -ENOMEM; > > + > > Could become a rainy day for the kvm-kmod maintainer: > > For compat support on kernels without init_fpu exported yet, can I > trigger the same result by simply issuing an FPU instruction here so > that do_device_not_available will perform the allocation? Not really > nice, but it doesn't appear to me like there is any code path that would > complain about in-kernel FPU usage (provided we don't need math > emulation - which is quite likely). That's a pessimization, since it forces the fpu to be switched. If both qemu and the guest don't use the fpu, we can run a guest with some other task's fpu loaded. Oh, but if it's after the check for !tsk_used_math(), it only triggers once, so that's okay. I guess something like mov %%xmm0, %%xmm0 should do nicely. -- error compiling committee.c: too many arguments to function