From: Avi Kivity <avi@qumranet.com>
To: Chris Lalancette <clalance@redhat.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>
Subject: Re: [PATCH]: Fix MSR_K7_EVNTSEL{0,3} for SVM
Date: Fri, 25 Apr 2008 10:30:06 +0300 [thread overview]
Message-ID: <4811887E.6040202@qumranet.com> (raw)
In-Reply-To: <481105FB.1080705@redhat.com>
Chris Lalancette wrote:
> Avi Kivity wrote:
>
>> Now it uses %rsi instead of %esi, and any junk in the upper bits will
>> cause the ja to be taken.
>>
>> We need to get a reduced testcase to the gcc folks, this is a serious
>> bug. Any changes in the code to work around this would be fragile.
>>
>>
>
> Avi,
> I've now filed a bug in the upstream gcc database:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36040
>
> And I came up with a reduced test case, available here:
>
> http://people.redhat.com/clalance/rsi-test-case.tar.bz2
>
> If I compile the code in the above and look at the disassembly, it shows the
> problem; however, I can't reproduce the bug by actually running the code. I
> suspect the %rsi register is always 0 when we start in this userland code, so I
> never run into the bogus ja, but I just thought I'd mention it.
>
>
Hmm, looking back at the dump:
> 1811: 8d 86 00 00 ff 3f lea 0x3fff0000(%rsi),%eax
> 1817: 83 f8 03 cmp $0x3,%eax
> 181a: 0f 87 e2 01 00 00 ja 1a02 <svm_set_msr+0x27f>
So while gcc is using %rsi, it loads the result back into %eax, which
has the effect of dropping back into 32-bits. So looks like gcc was
right here. Sorry for spreading confusion and apologies to gcc.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-25 7:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-23 18:23 [PATCH]: Fix MSR_K7_EVNTSEL{0,3} for SVM Chris Lalancette
2008-04-24 7:35 ` Avi Kivity
[not found] ` <4810926E.3070900@redhat.com>
2008-04-24 15:20 ` Avi Kivity
2008-04-24 15:44 ` Chris Lalancette
2008-04-24 22:13 ` Chris Lalancette
2008-04-25 7:30 ` Avi Kivity [this message]
2008-04-25 13:06 ` Chris Lalancette
2008-04-25 18:43 ` Chris Lalancette
2008-04-28 12:46 ` Joerg Roedel
2008-04-28 14:17 ` Chris Lalancette
2008-04-28 15:57 ` Joerg Roedel
2008-04-28 16:38 ` Chris Lalancette
2008-04-28 16:41 ` Andi Kleen
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=4811887E.6040202@qumranet.com \
--to=avi@qumranet.com \
--cc=clalance@redhat.com \
--cc=kvm-devel@lists.sourceforge.net \
/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