ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.
BSD 2-Clause "Simplified" License
560 stars 168 forks source link

Get a "cannot execute on arm64 due to bus error" error when running the test exemple #31

Closed babouFomb closed 4 years ago

babouFomb commented 4 years ago

Hi, I try to use your module on a Nvidia Xavier AGX board. The compilation and module loadging go without any error. But when I tried to run the example, I got the "cannot execute on arm64 due to bus error" message. Here is the complete output:

machine = aarch64 phys_addr=0xe6900000 size=1048576 check_buf() sync_mode=0, O_SYNC=0, sync_mode=0, O_SYNC=1, sync_mode=1, O_SYNC=0, sync_mode=1, O_SYNC=1, sync_mode=2, O_SYNC=0, sync_mode=2, O_SYNC=1, sync_mode=3, O_SYNC=0, sync_mode=3, O_SYNC=1, sync_mode=4, O_SYNC=0, sync_mode=4, O_SYNC=1, sync_mode=5, O_SYNC=0, sync_mode=5, O_SYNC=1, sync_mode=6, O_SYNC=0, sync_mode=6, O_SYNC=1, sync_mode=7, O_SYNC=0, sync_mode=7, O_SYNC=1, clear_buf() sync_mode=0, O_SYNC=0, sync_mode=0, O_SYNC=1, sync_mode=1, O_SYNC=0, sync_mode=1, O_SYNC=1, cannot execute on arm64 due to bus error. sync_mode=2, O_SYNC=0, sync_mode=2, O_SYNC=1, sync_mode=3, O_SYNC=0, sync_mode=3, O_SYNC=1, sync_mode=4, O_SYNC=0, sync_mode=4, O_SYNC=1, sync_mode=5, O_SYNC=0, cannot execute on arm64 due to bus error. sync_mode=5, O_SYNC=1, cannot execute on arm64 due to bus error. sync_mode=6, O_SYNC=0, sync_mode=6, O_SYNC=1, sync_mode=7, O_SYNC=0, sync_mode=7, O_SYNC=1,

How can I fix this problem. My goal is to use udmabuf with uio in order to perform DMA transfers between the Xavier system memory and a NVMe SSD drive (connected through a M.2 Key M)

Thanks

ikwzm commented 4 years ago

Thank you for the issue.

On ARM64, executing memset() on a non-cached area causes a bus error. Therefore, udmabuf_test.c skips the clear test when udmabuf is specified as a non-cache area. This message indicates that the clear test was skipped "intentionally".

If you access udmabuf as a cache area, ignore this test result. If you access udmabuf as a non-cache area, do not use memset().

For details on bus error when executing memset() on non-cache area on ARM64, refer to the following URL (Japanese)

https://qiita.com/ikwzm/items/3216f907ff8fc41866c4