ufrisk / MemProcFS

MemProcFS
GNU Affero General Public License v3.0
3.14k stars 382 forks source link

Ubuntu/aarch64 - Java API: vmm.VmmException: Native call to vmm failed! #260

Open EmhyrVarEmreis opened 10 months ago

EmhyrVarEmreis commented 10 months ago

MemProcFS v5.8.20 Defice: fpga Target system: Windows 11 Reading from rpi5

First I am getting:

[+] using FTDI device: 0403:601f (bus 2, device 2)
[+] FTDIFTDI SuperSpeed-FIFO Bridge000000000001

But when I call vmm.processGet it fails with vmm.VmmException: Native call to vmm failed! How to debug? What should I check?

ufrisk commented 10 months ago

Apologies for the slow answer.

First you'd have to check out if you have DMA access working at all.

I'd recommend using PCILeech for this. pcileech -device fpga -v display -min 0x1000 is it successful? If not try to shut down the target computer and start it again. Read again after that.

For additional info you may use: pcileech -device fpga -v display -min 0x1000 -vvv

If DMA is working you might require a memory map of the target system, especially if the target system is AMD-based. https://github.com/ufrisk/LeechCore/wiki/Device_FPGA_AMD_Thunderbolt

Let me know if this helps.

ufrisk commented 9 months ago

Did you resolve this issue or is it still not working?

EmhyrVarEmreis commented 9 months ago

Sorry, but I have not had time recently to come back to this problem but I still intend to investigate it

EmhyrVarEmreis commented 9 months ago

Issue still exists

On fresh start I got correct results with no errors reading memory with display pcileech -device fpga -v display -min 0x1000 -vvv

But when tried with Python API I got an error (same as in Java):

[+] using FTDI device: 0403:601f (bus 2, device 3)
[+] FTDIFTDI SuperSpeed-FIFO Bridge000000000001
[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output ErrorTraceback (most recent call last):
  File "/home/emhyr/hacking/test.py", line 4, in <module>
    vmm = memprocfs.Vmm(['-device', 'fpga'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Vmm.init(): Initialization of vmm failed.

Then pcileech -device fpga -v display -min 0x1000 -vvv gives:

[+] using FTDI device: 0403:601f (bus 2, device 3)
[+] FTDIFTDI SuperSpeed-FIFO Bridge000000000001
[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output Error[-] bulk transfer error: Input/Output ErrorDEVICE: FPGA: ERROR: Unable to connect to FPGA device [0,v0.0,0000]
PCILEECH: Failed to connect to the device.

until I restart target computer or wait some time (several minutes).

RPi5 is on Ubuntu 22.04.3 LTS, freeshly updated

ufrisk commented 9 months ago

hm, I'd have to check this out on my RPi5 to see if I can replicate the issue. Hopefully in the weekend.

It very much looks like some libusb error though. If there is an issue with libusb or the underlying hardware / drivers there isn't really anything this project can do about unfortunately.

But I'll take a look at least :)