From: Avi Kivity <avi@redhat.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: KVM General <kvm@vger.kernel.org>
Subject: Re: Problem with KVM guest switching to x86 long mode
Date: Sun, 11 Apr 2010 12:16:31 +0300 [thread overview]
Message-ID: <4BC1936F.5060009@redhat.com> (raw)
In-Reply-To: <4BC16CA3.8060804@cs.helsinki.fi>
On 04/11/2010 09:30 AM, Pekka Enberg wrote:
> Avi Kivity wrote:
>> The instruction at 0x28 is enabling paging, next insn fetch faults,
>> so the paging structures must be incorrect.
>>
>> Questions:
>> - what is the u64 at cr3? (call it pte4)
>> - what is the u64 at (pte4 & ~0xfff)? (call it pte3)
>> - what is the u64 at (pte3 & ~0xfff)? ("pte2")
>> - what is the u64 at ((pte2 & ~0xfff) + 2048)? ("pte1")
>>
>> Note if bit 7 of pte2 is set, then pte1 is unneeded.
>
> Sorry for the delay. Here you go:
>
> Page Tables:
> pte4: 0000000002403007 pte3: 0000000002404007 pte2: 0000000000000183
These are all correct.
The only thing I can think of, is that MAXPHYADDR is small value. And
indeed, if I run it on an ept capable machine (which does the check in
hardware, not software), I get
IO error: OUT port=cf8, size=4, count=1
KVM exit reason: 2 ("KVM_EXIT_IO")
Registers:
rip: ffffffff813a0d8f rsp: ffffffff8167bdf8 flags: 0000000000000086
rax: 000000008000c300 rbx: 000000000000c000 rcx: 0000000000000000
rdx: 0000000000000cf8 rsi: 0000000000000018 rdi: 0000000000000000
rbp: ffffffff8167be08 r8: 0000000000000000 r9: 0000000000000000
r10: 0000000000000006 r11: 00000000bbceeb20 r12: 0000000000000000
r13: 0000000000000000 r14: 0000000000000000 r15: 0000000000000000
cr0: 0000000080050033 cr2: 0000000000000000 cr3: 0000000001001000
cr4: 00000000000000a0 cr8: 0000000000000000
So the guest is in long mode, happily trying to access pci config space.
MAXPHYADDR comes from cpuid 80000008.eax[0:7]. Typical values are 36-40
(number of physical address bits supported by the processor). What
value does your guest see?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-04-11 9:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 18:26 Problem with KVM guest switching to x86 long mode Pekka Enberg
2010-04-08 18:36 ` Avi Kivity
2010-04-08 18:59 ` Pekka Enberg
2010-04-08 19:30 ` Avi Kivity
2010-04-11 6:30 ` Pekka Enberg
2010-04-11 9:16 ` Avi Kivity [this message]
2010-04-11 9:48 ` Pekka Enberg
2010-04-11 9:59 ` Avi Kivity
2010-04-11 10:02 ` Pekka Enberg
2010-04-11 11:48 ` Avi Kivity
2010-04-11 11:52 ` Pekka Enberg
2010-04-11 12:02 ` Avi Kivity
2010-04-11 12:04 ` 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=4BC1936F.5060009@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
/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