From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: Problem with KVM guest switching to x86 long mode Date: Sun, 11 Apr 2010 12:48:38 +0300 Message-ID: <4BC19AF6.6030407@cs.helsinki.fi> References: <4BBE2213.6020802@redhat.com> <4BBE277B.1090908@cs.helsinki.fi> <4BBE2EF3.6010304@redhat.com> <4BC16CA3.8060804@cs.helsinki.fi> <4BC1936F.5060009@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: KVM General To: Avi Kivity Return-path: Received: from courier.cs.helsinki.fi ([128.214.9.1]:57922 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655Ab0DKJso (ORCPT ); Sun, 11 Apr 2010 05:48:44 -0400 In-Reply-To: <4BC1936F.5060009@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: >> 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? Ah, nice catch! The host cpuid doesn't seem to support 80000008 at so I didn't set it up in the guest either. I now added dummy emulation for it and the triple fault is fixed. Thanks Avi! Pekka