public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jidong Xiao <jidong.xiao@gmail.com>, KVM <kvm@vger.kernel.org>
Subject: Re: Question about the kvm emulator
Date: Thu, 22 May 2014 13:42:06 +0200	[thread overview]
Message-ID: <537DE28E.7040900@redhat.com> (raw)
In-Reply-To: <CAG4AFWanoyXTt82yNvJQyNRExc2qX9vxgO6M-2dhkEyZMKWi7Q@mail.gmail.com>

Il 22/05/2014 05:55, Jidong Xiao ha scritto:
> Hi,
>
> I noticed that there is a file call emulate.c, under the directory of
> arch/x86/kvm/, in its header part, it says:
>
> "Generic x86 (32-bit and 64-bit) instruction decoder and emulator."
>
> I am confused about this, since qemu will be the emulator, why does
> kvm itself also includes such an emulator? In particular, I added some
> printk debug statement in x86_emulate_insn() and
> emulate_instruction(), but I never see them being invoked. Can someone
> kindly explain this, thank you!

QEMU is providing the device model and interfaces with KVM.  QEMU's CPU 
emulation functionality is not used when running with KVM.

The KVM emulator is used: 1) to execute instructions that read or write 
to device memory; 2) to run "big real mode" programs on microprocessors 
that do not support it natively, for example Intel processors older than 
Westmere.

Paolo


  reply	other threads:[~2014-05-22 11:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  3:55 Question about the kvm emulator Jidong Xiao
2014-05-22 11:42 ` Paolo Bonzini [this message]
2014-05-23  2:24   ` Jidong Xiao

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=537DE28E.7040900@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jidong.xiao@gmail.com \
    --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