logoalt Hacker News

cakehonoluluyesterday at 12:19 PM7 repliesview on HN

Hi! Author here! You can technically offload the transactions the real driver on your host does to wherever you want really. PCI is very delay-tolerant and it usually negotiates with the device so I see not much of an issue doing that proven that you can efficiently and performantly manage the throughput throughout the architecture. The thing that kinda makes PCIem special is that you are pretty much free to do whatever you want with the accesses the driver does, you have total freedom. I have made a simple NVME controller (With a 1GB drive I basically malloc'd) which pops up on the local PCI bus (And the regular Linux's nvme block driver attaches to it just fine). You can format it, mount it, create files, folders... it's kinda neat. I also have a simple dumb rasteriser that I made inside QEMU that I wanted to write a driver for, but since it doesn't exist, I used PCIem to help me redirect the driver writes to the QEMU instance hosting the card (Thus was able to run software-rendered DOOM, OpenGL 1.X-based Quake and Half-Life ports).


Replies

yndoendoyesterday at 2:20 PM

Just to hijack this thread on how resilient PCIe is. PS4 Linux hackers ran PCIe over UART serial connection to reverse engineer the GPU. [0] [1]

[0] https://www.psdevwiki.com/ps4/PCIe

[1] https://fail0verflow.com/blog/2016/console-hacking-2016-post...

topspinyesterday at 4:31 PM

> PCI is very delay-tolerant

That fascinates me. Intel deserves a lot of credit for PCI. They built in future proofing for use cases that wouldn't emerge for years, when their primary market was desktop PCs, and they could have done far less. The open-ness and platform independence are also notable for something that came from 1990 Intel.

tonypleeyesterday at 3:59 PM

Can one make a PCIe analyzer out of your code base by proxy all transactions thru a virtual PCIem driver to a real driver?

show 1 reply
baruchyesterday at 8:09 PM

Is it possible to put such a driver for nvme under igb_uio or another uio interface? I have an app that uses raw nvme devices and being able to tests strange edge cases would be a real boon!

s4mbh4yesterday at 7:24 PM

I wonder if it's possible to create a wire shark plugin for analyzing PCIE?

show 1 reply
jacquesmyesterday at 12:41 PM

Fantastic tool, thank you for making this it is one of those things that you never knew you needed until someone took the time to put it together.

gigatexalyesterday at 12:52 PM

This is really interesting. Could it be used to carve up a host GPU for use in a guest VM?

show 2 replies