From: Avi Kivity <avi@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: kvm@vger.kernel.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: Current KVM head crashes on startup
Date: Wed, 18 Feb 2009 08:49:33 +0000 [thread overview]
Message-ID: <499BCB9D.6070005@redhat.com> (raw)
In-Reply-To: <20090218081602.GC12284@amit-x200.pnq.redhat.com>
Amit Shah wrote:
> On (Wed) Feb 18 2009 [13:21:26], Amit Shah wrote:
>
>> On (Tue) Feb 17 2009 [12:47:10], Brian Kress wrote:
>>
>>> When I try to run KVM built off the current head, it crashes with a
>>> Segmentation fault. KVM-84 does
>>> not. Seems to be dealing with the CPUID changes:
>>>
>>>
>>> 0x081a5c70 in host_cpuid ()
>>> at /home/kressb/kvm/src/qemu/target-i386/helper.c:1426
>>> 1426 asm volatile("pusha \n\t"
>>>
>> This looks like some kind of stack corruption on 32-bit:
>>
>> 1472 if (kvm_enabled())
>> (gdb)
>> 1473 host_cpuid(0, 0, NULL, ebx, ecx, edx);
>> (gdb)
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x081a2d60 in host_cpuid (function=10, count=1231384169, eax=0x0, ebx=0xadfc1914,
>> ecx=0xadfc1910, edx=0xadfc190c)
>> at /home/amit/src/kvm-userspace/qemu/target-i386/helper.c:1426
>> 1426 asm volatile("pusha \n\t"
>>
>> I don't see this on 64-bit. Investigating.
>>
>
> Avi, what's the reason for doing this in the host_cpuid code? As I see
> it, the first version should work for both 64-bit and 32-bit code.
>
> #ifdef __x86_64__
> asm volatile("cpuid"
> : "=a"(vec[0]), "=b"(vec[1]),
> "=c"(vec[2]), "=d"(vec[3])
> : "0"(function), "c"(count) : "cc");
> #else
> asm volatile("pusha \n\t"
> "cpuid \n\t"
> "mov %%eax, 0(%1) \n\t"
> "mov %%ebx, 4(%1) \n\t"
> "mov %%ecx, 8(%1) \n\t"
> "mov %%edx, 12(%1) \n\t"
> "popa"
> : : "a"(function), "c"(count), "S"(vec)
> : "memory", "cc");
> #endif
>
The first version generates too much register pressure for some
compilers on i386, leading to compilation failures. The second version
is surely wrong, though? Counting from zero, the "vec" parameter would
be %2, not %1.
(copied Anthony)
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2009-02-18 8:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 17:47 Current KVM head crashes on startup Brian Kress
2009-02-18 7:51 ` Amit Shah
2009-02-18 8:16 ` Amit Shah
2009-02-18 8:49 ` Avi Kivity [this message]
2009-02-18 9:05 ` Amit Shah
2009-02-18 10:19 ` Avi Kivity
2009-02-18 11:21 ` Amit Shah
2009-02-18 11:26 ` Avi Kivity
2009-02-18 12:20 ` Amit Shah
2009-02-18 12:29 ` Avi Kivity
2009-02-18 17:03 ` Avi Kivity
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=499BCB9D.6070005@redhat.com \
--to=avi@redhat.com \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=kvm@vger.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