public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: kvm@vger.kernel.org
Subject: Re: pekka-vm and kvm documentation
Date: Thu, 25 Mar 2010 22:57:31 +0200	[thread overview]
Message-ID: <4BABCE3B.5080605@redhat.com> (raw)
In-Reply-To: <4BABC636.5010905@cs.helsinki.fi>

On 03/25/2010 10:23 PM, Pekka Enberg wrote:
> Hi Avi,
>
> Avi Kivity wrote:
>> When you come up against something that is undocumented or badly 
>> described, please complain on kvm@.  We will then update the 
>> documentation.
>
> So one thing I'm wondering is in what mode do we enter the guest? Is 
> that entirely specified with KVM_SET_REGS and KVM_SET_SREGS?

Yes.  cr0.pe = real/protected, eflags.vm = vm86 mode, cs.d = 
prot16/prot32, efer.lme/efer.lma/cs.l = longmode.

>
> I assume we're entering real mode as per how I set up "rflags" but for 
> some reason I'm seeing "cs" base being zeroed out before first 
> instruction is executed with my simple kvm program which could mean 
> that it's trying to use GDT (which is not set up at that point).

I see you set up the cpu as if after reset (cs:ip = f000:fff0) but just 
dumped a kernel there.  That won't work, you need real code.

Try poking 'e9 fd ff' at your entry point (ffff0) and see the cpu pegged 
at 100% (1: jmp 1b) (this is probably the largest possible kernel that 
is bug-free).

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


      reply	other threads:[~2010-03-25 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4BAB1CCB.3070800@redhat.com>
2010-03-25 20:23 ` pekka-vm and kvm documentation Pekka Enberg
2010-03-25 20:57   ` Avi Kivity [this message]

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=4BABCE3B.5080605@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