public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Christoph Lameter <cl@linux.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: BUG: sleeping function called from invalid context at mm/slub.c:793
Date: Thu, 13 Jan 2011 15:06:36 +0200	[thread overview]
Message-ID: <4D2EF8DC.9040301@redhat.com> (raw)
In-Reply-To: <4D2EF717.8080604@siemens.com>

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

      reply	other threads:[~2011-01-13 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 10:54 BUG: sleeping function called from invalid context at mm/slub.c:793 Kirill A. Shutemov
2011-01-10 16:52 ` Christoph Lameter
2011-01-10 19:31   ` Kirill A. Shutemov
2011-01-11  9:49     ` Avi Kivity
2011-01-11 10:29       ` Avi Kivity
2011-01-11 11:13         ` Kirill A. Shutemov
2011-01-11 11:20           ` Pekka Enberg
2011-01-11 14:43             ` Christoph Lameter
2011-01-13 12:59         ` Jan Kiszka
2011-01-13 13:06           ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2EF8DC.9040301@redhat.com \
    --to=avi@redhat.com \
    --cc=cl@linux.com \
    --cc=hpa@zytor.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kirill@shutemov.name \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox