![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux KVM
星空探索
linux
展开
-
linux kernel KVM
kvm 的linux内核描述: struct kvm { spinlock_t mmu_lock; struct mutex slots_lock; struct mm_struct *mm; /* userspace tied to this vm */ struct kvm_memslots *memslots[KVM_ADDRESS_SPACE_NUM]; struct sr原创 2017-02-25 21:46:53 · 751 阅读 · 0 评论 -
X86架构对KVM支持
linux kernel000000000000原创 2017-02-28 14:29:40 · 607 阅读 · 0 评论 -
x86架构对KVM支持的内核实现
x86与KVM原创 2017-02-25 21:51:10 · 1181 阅读 · 0 评论 -
基于x86的KVM实现之vcpu建立过程
在用户态通过ioctl设置KVM_CREATE_VCPU时,内核会创建一个虚拟CPU环境: kvm_vm_ioctl_create_vcpu() --> kvm_arch_vcpu_create() --> vmx_create_vcpu --> kvm_arch_vcpu_setup(vcpu); 函数首先通过kvm_arch_vcpu_create()创建基本信息,之后调用kvm_原创 2017-03-08 08:07:03 · 808 阅读 · 0 评论 -
kvm设备节点操作
KVM设备节点文件操作: static struct file_operations kvm_chardev_ops = { .unlocked_ioctl = kvm_dev_ioctl, .compat_ioctl = kvm_dev_ioctl, .llseek = noop_llseek, }; static struct miscdevice kvm_dev原创 2017-02-25 21:57:49 · 742 阅读 · 0 评论 -
kvm VM ioctl操作
VM虚拟机提供的文件操作,主要以ioctl方式提供: static struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, #ifdef CONFIG_KVM_COMPAT .compat_ioctl = kvm_vm_compat原创 2017-02-25 22:06:19 · 1054 阅读 · 0 评论 -
kvm vm运行
用户空间发送KVM_RUN指令,通过vm的fd描述符进行。 static long kvm_vcpu_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm_vcpu *vcpu = filp->private_data; void __user *argp = (void __user原创 2017-02-25 22:22:12 · 914 阅读 · 0 评论 -
kvm debugfs 接口
static int kvm_init_debug(void) { int r = -EEXIST; struct kvm_stats_debugfs_item *p;kvm_debugfs_dir = debugfs_create_dir("kvm", NULL); if (kvm_debugfs_dir == NULL) goto out;kvm_debugfs_n原创 2017-02-25 22:28:28 · 563 阅读 · 0 评论 -
KVM 设备虚拟文件接口
static long kvm_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm *kvm = filp->private_data; void __user *argp = (void __user *)arg; int r; if (kvm->mm != curr原创 2017-02-25 22:54:23 · 549 阅读 · 0 评论 -
KVM下vcpu描述
linux 内核 kvm中的vcpu描述原创 2017-02-25 21:48:58 · 870 阅读 · 0 评论 -
kvm vm操作
static struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, #ifdef CONFIG_KVM_COMPAT .compat_ioctl = kvm_vm_compat_ioctl, #endif .llseek =原创 2017-02-25 22:01:54 · 472 阅读 · 0 评论 -
kvm-vcpu 文件接口
kvm_vm_ioctl_create_vcpu vcpu = kvm_arch_vcpu_create(kvm, id); r = kvm_arch_vcpu_setup(vcpu); r = kvm_create_vcpu_debugfs(vcpu); r = create_vcpu_fd(vcpu); kvm->vcpus[atomic_read(&kvm->onlin原创 2017-02-25 22:48:49 · 498 阅读 · 0 评论