VFIO-MDEV driver access virtual machine‘s memory

本文介绍了一个自定义VFIO-MDEV驱动如何使虚拟机通过该驱动访问硬件寄存器,以及驱动如何访问虚拟机的缓冲区/内存。内容包括虚拟机访问硬件寄存器的步骤、VFIO-MDEV驱动读写虚拟机内存的方法,以及在实现过程中遇到的PCI IO映射问题和outl()函数输出4字节的问题。
摘要由CSDN通过智能技术生成

As I created myself VFIO-MDEV driver/virtual device, the next steps I can think are:

1) make virtual machine can access real hardware through this VFIO-MDEV driver.

2) hardware/VFIO-MDEV driver can access the buffer in virtual machine. Because many HW will write/read data from buffer/memory. If we vituralize a HW and provide its virtual device to the virtual machine, we will need this feature.

So this blog will introduce:

1) How does virtual machine access HW(VFIO-MDEV virtual device's) registers.

2) How does VFIO-MDEV driver access virtual machine's buffer/memory.

1. How does virtual machine access HW registers.

On host VFIO-MDEV driver:

Firstly I fixed a bug on virtual device's PCI configure space. That is the PCI device class. Last time I set it to 0x0. This will cause pci_enable_device() error. So I modified it to 0xFF(misc device).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值