'Virtualization'에 해당되는 글 23건

  1. 2014.05.23 IDE initializing Process by MeatNBrew
  2. 2014.05.23 Process of Device Init by MeatNBrew
  3. 2014.05.23 The way to communicate between QEMU and KVM Modules by MeatNBrew
  4. 2014.05.23 Inside of operations for x86 in KVM by MeatNBrew
  5. 2014.05.23 The way to run vcpus between Qemu and KVM by MeatNBrew
  6. 2014.05.23 Inside of iotcl of VM files("/dev/kvm" , "kvm-vm" , "kvm-vpu") by MeatNBrew
  7. 2014.05.23 KVM Device File Types by MeatNBrew
  8. 2014.05.23 KVM IO handle sequence by MeatNBrew
  9. 2014.05.23 Visualiztion where to start analyzing KVM kernel & QEMU by MeatNBrew
  10. 2014.05.23 KVM Kernel - things kvm_init does by MeatNBrew

IDE initializing Process

2014. 5. 23. 22:28 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Process of Device Init

2014. 5. 23. 22:27 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

The way to communicate between QEMU and KVM Modules

2014. 5. 23. 22:27 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Inside of operations for x86 in KVM

2014. 5. 23. 22:26 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

First, in Qemu, QEMU Process order "kvm-vcpu" to run like this

first,  x86_cpu_realizefn calls qemu_init_vcpu , in qemu/target-i386/cpu.c

2) qemu_init_vcpu calls qemu_kvm_start_vcpu , in cpus.c

3) qemu_kvm_start_vpuc calls qemu_kvm_cpu_thread_fn through creating thread, in cpus.c

4) qemu_kvm_cpu_thread_fn calls kvm_init_vcpu to initialize kvm_vcpu and then calls kvm_cpu_exec, in cpus.c

5) kvm_cpu_exec calls kvm_vpuc_ioctl for running vcpu stored in kvm-vcpu file.

 

then, in linux kernel, KVM modules get an order to run "vcpu" through "kvm-vcpu" anonymous file. so, called

1) kvm_vcpu_ioctl through ioctl function for kvm-vcpu is file operation "kvm_vcpu_fops" , in /virt/kvm/kvm_main.c

2) kvm_vcpu_ioctl calls kvm_arch_vcpu_ioctl_run , in /virt/kvm/kvm_main.c

3) kvm_arch_vcpc_ioctl_run calls __vcpu_run , in /arch/x86/kvm/x86.c

4) __vcpu_run calls vcpu_enter_guest , in /arch/x86/kvm/x86.c ( and while loop calls vcpu_enter_guest until return value is equal or more than zero)

5) vcpu_enter_guest calls x86 operations for VM already initialized when launching kvm modules, and also calls kvm_guest_enter and  kvm_x86_ops->run , in /arch/x86/kvm/x86.c

Posted by MeatNBrew
l

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

KVM Device File Types

2014. 5. 23. 22:25 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

KVM IO handle sequence

2014. 5. 23. 22:24 by MeatNBrew

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

at the last post of this section, i posted kvm has  two parts. i.e) kvm kernel and QEMU for guest, and also where to start analyzing kvm kernel as a kernel modules.

in this post, i'm just about to analyze kvm_init.

kvm_init is doing as following functions.

1. kvm_arch_init: initialize architecture oriented operation

2. kvm_irqfd_init: initialize interrupt, but but nothing to do with this. i have no idea why doing nothing.

3. zalloc_cpumask_var: cpu mask variable initialization.

4. kvm_arch_hardware_setup: architecture oriented hardware setup. in case of x86, it will call "kvm_x86_ops->hardware_setup()" function in x86.c,  already initialized in kvm_init, kvm_arch_init(opaque), hardware_setup was set up in svm.c or vmx.c

5. kmem_cache_create: creating kernel cache for kvm vcpu

you can see hole init_kvm functions on mygithub

Posted by MeatNBrew
l