linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>, Tomas Racek <tracek@redhat.com>
Cc: qemu-devel@nongnu.org, "H. Peter Anvin" <hpa@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	linux-kernel@vger.kernel.org, Alan Cox <alan@linux.intel.com>,
	kvm-devel <kvm@vger.kernel.org>, Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [Qemu-devel] x86, nops settings result in kernel crash
Date: Thu, 16 Aug 2012 16:51:46 -0500	[thread overview]
Message-ID: <87393msdxp.fsf@codemonkey.ws> (raw)
In-Reply-To: <20120816195324.5356cba0@pyramind.ukuu.org.uk>

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> On Thu, 16 Aug 2012 14:45:15 -0400 (EDT)
> Tomas Racek <tracek@redhat.com> wrote:
>
>> ----- Original Message -----
>> > On Thu, Aug 16, 2012 at 09:35:12AM -0400, Tomas Racek wrote:
>> > > Hi,
>> > > 
>> > > I am writing a file system test which I execute in qemu with kernel
>> > > compiled from latest git sources and running it causes this error:
>> > > 
>> > > https://bugzilla.kernel.org/show_bug.cgi?id=45971
>> > > 
>> > > It works with v3.5, so I ran git bisect which pointed me to:
>> > > 
>> > > d6250a3f12edb3a86db9598ffeca3de8b4a219e9 x86, nops: Missing break
>> > > resulting in incorrect selection on Intel
>> > > 
>> > > To be quite honest, I don't understand this stuff much but I tried
>> > > to do some debugging and I figured out (I hope) that the crash is
>> > > caused by setting ideal_nops to p6_nops (k8_nops was used before
>> > > the break statement was added).
>> > 
>> > Maybe I overlooked it or maybe it was implied but did you try
>> > reverting
>> > the patch and rerunning your test? Does it work ok then?
>> > 
>> 
>> Yes, if I remove the break statement (introduced by this commit), it works fine.
>
> What version of qemu is this - do we have qemu bug here I wonder.

>From the cpuinfo, it's 0.15.1.  That's old but not ancient.

I took a brief look at the kernel code here.  The default invocation of
qemu presents an idealistic CPU with a very minimum feature bit set
exposed.  No processor has ever existed with this feature set.

We do this in order to maintain compatibility when migration from Intel
to AMD but also for legacy reasons.

>From the report, using '-cpu host' solves the problem.  '-cpu host'
exposes most of the host CPUID to the guest.

That said, QEMU really doesn't do anything differently depending on what
feature bits are exposed to the guest.  So my guess is that the odd
combination of CPUID bits that are exposed to the guest is confusing the
kernel.

Can you post dmesg from the host kernel?  Perhaps there's instruction
emulation failing in the host KVM?  That would manifest in strange
behavior in the guest.

Regards,

Anthony Liguori

>
> Alan

  parent reply	other threads:[~2012-08-16 21:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1104118228.1760802.1345121009530.JavaMail.root@redhat.com>
2012-08-16 13:35 ` x86, nops settings result in kernel crash Tomas Racek
2012-08-16 13:48   ` Borislav Petkov
2012-08-16 18:45     ` Tomas Racek
2012-08-16 18:53       ` Alan Cox
2012-08-16 21:30         ` H. Peter Anvin
2012-08-17  7:42           ` Tomas Racek
2012-08-16 21:51         ` Anthony Liguori [this message]
2012-08-17  7:43           ` [Qemu-devel] " Tomas Racek
2012-08-17  8:09             ` Borislav Petkov
2012-08-20 17:13               ` Tomas Racek
2012-08-21  7:22                 ` Michael Tokarev
2012-08-21  9:28                   ` Tomas Racek
2012-08-22  9:54                     ` Avi Kivity
2012-08-22 10:03                       ` [PATCH] x86, alternative: fix p6 nops on non-modular kernels Avi Kivity
2012-08-22 10:21                         ` [tip:x86/urgent] x86/alternatives: Fix " tip-bot for Avi Kivity
2012-08-22 10:33                         ` [PATCH] x86, alternative: fix " Tomas Racek

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=87393msdxp.fsf@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=alan@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=avi@redhat.com \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tracek@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).