Pcie — Device Remapping [top]

The Linux host sees the NVMe drive at BDF 0000:01:00.0 . The device’s BARs are mapped to Host Physical Addresses (e.g., 0xFE000000 ).

The hypervisor (QEMU) tells VFIO: "My guest thinks the device BAR is at GPA 0xC0000000 ." The VFIO driver programs the IOMMU: "When the device at BDF 01:00.0 tries to DMA to GPA 0xC0000000 , translate it to HPA 0xFE000000 ." The device’s internal DMA engine writes to 0xC0000000 (guest logic). The IOMMU remaps it in flight to 0xFE000000 (actual RAM). pcie device remapping

SR-IOV allows a single physical PCIe device (e.g., a high-end 100Gbps NIC) to appear as multiple lightweight virtual devices. The Linux host sees the NVMe drive at BDF 0000:01:00

modprobe vfio-pci vendor_device_id=$(lspci -n -s 02:00.0 | awk 'print $3') echo "vfio-pci" > /sys/bus/pci/devices/0000:02:00.0/driver_override echo 0000:02:00.0 > /sys/bus/pci/devices/0000:02:00.0/driver/unbind echo 0000:02:00.0 > /sys/bus/pci/drivers_probe The IOMMU remaps it in flight to 0xFE000000 (actual RAM)