Re: P2P problem on QEMU

2021-05-27 Thread James Harvey
On Wed, May 26, 2021 at 1:44 PM Gabriele Borello
 wrote:
> The following kernel version was used: Linux 5.9.0-rc8 x86_64,
> ...
>  The kernel was compiled by configuring peer-to-peer as described in the 
> p2pmem-test guide. Trying to run the command suggested in the p2pmem-test 
> guide ( ./p2pmem-test /dev/nvme0n1 /dev/nvme1n1 /dev/p2pmem0 -c 1 -s 4k),  we 
> get a kernel panic.

I've never looked at PCI Peer-to-Peer DMA.  Briefly, I see the
p2pmem-test developer sbates130272 has github repos for linux-p2pmen
which has been maintained through 5.13-rc1.  It could be worth trying
the more recent kernel.

> We don't know where we went wrong. If you could give us feedback we would be 
> very grateful.

The stacktrace from the panic would be needed for others to give much
feedback.  If I'm understanding correctly that you aren't trying to
really do P2P between the host and guest OS's, but between a virtual
NVMe in the guest to a p2pmem device in the guest, my next step would
be to get an NVMe and install exactly what you installed in QEMU to it
(identical versions and configuration) and see if you could replicate
the stacktrace on bare metal.  If so, it would be a kernel issue
rather than QEMU.  If you couldn't, that could suggest the QEMU NVMe
device support may be incomplete or bugged in a way preventing this.
If you're running an older version of QEMU, it would also be worth
trying 6.0.0 to see if the issue has been resolved.



P2P problem on QEMU

2021-05-26 Thread Gabriele Borello
Dear Sir/Madame,
I am Gabriele Borello, an engineering student at the Polytechnic of Turin.
I am preparing my master's thesis at the Reds laboratories of HEIG-VD in
Yverdon-les-bains, Switzerland.
It is based on the creation of a simple computational storage that exploits
the advantages deriving from the NVMe protocol.

 The QEMU environment has been widely used for the validation phase and I
am writing to you about a problem encountered for the implementation of a
peer-to-peer transfer using p2pmem-test (
https://github.com/sbates130272/p2pmem-test ).

The following kernel version was used: Linux 5.9.0-rc8 x86_64,
with the following QEMU settings:
sudo ./experimental_qemu/build/qemu-system-x86_64 -M pc -nographic
-no-reboot -object
memory-backend-file,id=pc.ram,size=3G,mem-path=/dev/shm/qemu-mem,share=on
-machine memory-backend=pc.ram -cpu host -m 3G -smp cpus=2 --enable-kvm
-kernel ./bzImage -drive file=./rootfs-target.img,if=ide,format=raw -drive
file=nvme.img,if=none,id=nvme0 -device
nvme,drive=nvme0,serial=d00d,num_queues=8,cmb_size_mb=128 -drive
file=nvme1.img,if=none,id=nvme1 -device
nvme,drive=nvme1,serial=e00e,num_queues=8,cmb_size_mb=128 -append
"console=ttyS0 root=/dev/sda rw panic=1 earlyprintk=serial,ttyS0,115200"
-trace events="${QEMU_TMP_DIR}"/events.

 The kernel was compiled by configuring peer-to-peer as described in the
p2pmem-test guide. Trying to run the command suggested in the p2pmem-test
guide ( ./p2pmem-test /dev/nvme0n1 /dev/nvme1n1 /dev/p2pmem0 -c 1 -s 4k),
we get a kernel panic.

We don't know where we went wrong. If you could give us feedback we would
be very grateful.

Thank you,
Best regards.

Gabriele