KVM下vcpu描述

linux 内核 kvm中的vcpu描述

此结构也是KVM架构层抽象出的虚拟CPU描述,这里跟前面的KVM结构一样,是内核对虚拟机一系列资源抽象后得到的数据描述。

include/linux/kvm_host.h struct kvm_vcpu {  struct kvm *kvm;所关联的虚拟机描述 #ifdef CONFIG_PREEMPT_NOTIFIERS  struct preempt_notifier preempt_notifier; #endif  int cpu;  int vcpu_id;虚拟CPU的id  int srcu_idx;  int mode;  unsigned long requests;  unsigned long guest_debug;

 int pre_pcpu;  struct list_head blocked_vcpu_list;

 struct mutex mutex;  struct kvm_run *run;

 int fpu_active;  int guest_fpu_loaded, guest_xcr0_loaded;  unsigned char fpu_counter;  struct swait_queue_head wq;  struct pid *pid;  int sigset_active;  sigset_t sigset;  struct kvm_vcpu_stat stat;  unsigned int halt_poll_ns;  bool valid_wakeup;

#ifdef CONFIG_HAS_IOMEM  int mmio_needed;  int mmio_read_completed;  int mmio_is_write;  int mmio_cur_fragment;  int mmio_nr_fragments;  struct kvm_mmio_fragment mmio_fragments[KVM_MAX_MMIO_FRAGMENTS]; #endif

#ifdef CONFIG_KVM_ASYNC_PF  struct {   u32 queued;   struct list_head queue;   struct list_head done;   spinlock_t lock;  } async_pf; #endif

#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT  struct {   bool in_spin_loop;   bool dy_eligible;  } spin_loop; #endif  bool preempted;  struct kvm_vcpu_arch arch;  struct dentry *debugfs_dentry; }; 这里需要关注kvm_run结构,其跟具体支持虚拟化的host cpu密切相关。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值