Skip to the content.

记录下 x86.c 的内容

x86.c overview

  1. debugfs
    static struct kmem_cache *x86_fpu_cache;
    static struct kmem_cache *x86_emulator_cache;
    
  2. kvm_on_user_return :
    1. user return ?
    2. share msr
  3. exception_type

  4. payload

提供了很多函数访问设置 vcpu,比如 kvm_get_msr 之类的

  1. 谁调用 <- vmx.c 吧 !
  2. 实现的方法 : 将其放在 vmcs 中, 从 vmcs 中间读取 : 当想要访问的时候,

kvm_steal_time_set_preempted

details

vmx_vcpu_run

vmx_exit_handlers_fastpath : 通过 omit what 来 fast

kvm_read_guest_virt_helper

内核读取 guest 的内存,因为 guest 的使用地址空间是 用户态的,所以

  1. gva_to_gpa 的地址切换 gpa_t gpa = vcpu->arch.walk_mmu->gva_to_gpa(vcpu, addr, access,
  2. kvm_vcpu_read_guest_page : copy_to_user 而已

event injection

在 ./nested.md 中的同名 section 中间

kvm_vcpu_flush_tlb_all

static void kvm_vcpu_flush_tlb_all(struct kvm_vcpu *vcpu)
{
    ++vcpu->stat.tlb_flush;
    kvm_x86_ops.tlb_flush_all(vcpu);
}

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。