Some questions from a freshman to this community

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux