kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhengwang Ruan <ruan.zhengwang@gmail.com>
To: kvm@vger.kernel.org
Subject: Some questions from a freshman to this community
Date: Mon, 25 Jun 2012 19:18:53 +0800	[thread overview]
Message-ID: <4FE8491D.2080309@gmail.com> (raw)

Hi all,

I am freshman to this community, I have some questions roughly about how 
does KVM work, please help me answer these questions, thank you!

1, What is the relation between kvm-mod and kvm-qemu?

Is kvm-qemu mainly used to emulate the first initial 16-bit code of a 
guest, then this qemu context will be replaced by the real guest, such 
as linux, windows? But I also see some emulation code in kvm-mod, what 
are these code used for?

2, How to handle irqs in kvm-mod?

I found vmx_inject_irq is used to inject an interrupt to a guest by 
writing vmcs for a guest, initialized by this call trace: vmx_init -> 
kvm_init -> kvm_arch_init (kvm_x86_ops is assigned in this call), then 
kvm_x86_ops will be used everywhere to set_irq for guests. Am I right?

But I seems to me that vmx_inject_irq is only called by .unlocked_ioctl 
in kvm_vcpu_fops file_operation struct, where could we use this file 
operation? If a device wants to issue an interrupt to a guest, how does 
this happen in device driver?

3, APIC.

I see that each vcpu has a local apic (vcpu.arch->apic), and some 
functions use this area ranged by this apic pointer to do setting and 
reading. Is this used to emulate apic for each vcpu? If so, when and 
where this will be used by guests?

4, The relation between kvm_vcpu_arch and vmcs.

There are some regular registers in kvm_vcpu_arch, and the values for 
these registers also be used to read and write. I am confused about 
this, if we want to read/write a register for a guest, we don't directly 
use those values in vmcs??


Regards,

Zhengwang


             reply	other threads:[~2012-06-25 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 11:18 Zhengwang Ruan [this message]
2012-06-26  2:20 ` Some questions from a freshman to this community Zhengwang Ruan

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=4FE8491D.2080309@gmail.com \
    --to=ruan.zhengwang@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;
as well as URLs for NNTP newsgroup(s).