Error "qemu: vfio-fsl-mc is not a valid device model name"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error "qemu: vfio-fsl-mc is not a valid device model name"

Jump to solution
1,891 Views
sevseev
Contributor I

Hello,

we're trying to use direct DPAA2 networking assignment on LX2160ARDB rev.2 board. We are using 21.08 LSDK. Currently we are down to _literally_ following the procedure described in LSDK User Guide, section 10.1.3.7, with the exception of course the numbers assigned to DPAA2 objects by the restool and locations of the kernel and the root file system images. Yet the error message in the subject field shows up when we run QEMU. QEMU came with the LSDK.

Any ideas and/or hints will be appreciated greatly.

Thanks,

Serguei Evseev

embedded software engineer

Thales, Canada

 

 

 

Labels (1)
0 Kudos
1 Solution
1,860 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to "9.2.6.1 Launch Virtual Machine" in LSDK 21.08 user manual, the default QEMU present in filesystem may not support the direct assignment feature, please refer section "10.1.2.10 Building QEMU" to compile and install the proper QEMU version on the target.

Execute the following commands to build the QEMU 4.2 with VFIO passthrough support locally:
git clone https://source.codeaurora.org/external/qoriq/qoriq-components/qemu
cd qemu
git checkout qemu-4.2
git submodule update --init dtc
Make sure your machine has the required packages to build QEMU. Refer the example below:
#update your ubuntu m/c with required packages.

apt-get install pkg-config

apt-get install libglib2.0-dev

apt-get install libpixman-1-dev

apt-get install libaio-dev

apt-get install libusb-1.0-0-dev
Now, build the QEMU
./configure --prefix=/root/qemu-4.2 --target-list=aarch64-softmmu --enable-fdt --enable-kvm
make
make install
The new QEMU will be installed in /root/qemu-4.2 folder.

View solution in original post

0 Kudos
5 Replies
1,880 Views
yipingwang
NXP TechSupport
NXP TechSupport

I didn't reproduce your problem with LSDK 21.08 images. 

Please refer to my following console log.

root@localhost:~# restool dprc create dprc.1
dprc.2 is created under dprc.1
root@localhost:~# echo vfio-fsl-mc > /sys/bus/fsl-mc/devices/dprc.2/driver_override
root@localhost:~#
root@localhost:~# echo dprc.2 > /sys/bus/fsl-mc/drivers/vfio-fsl-mc/bind
root@localhost:~# qemu-system-aarch64 -smp 1 -m 1024 -cpu host -machine type=virt,gic-version=3 -kernel /boot/Image -enable-kvm -display none -serial tcp::4446,server,telnet -drive if=none,file=rootfs_lsdk2108_ubuntu_lite_arm64.ext4,id=foo,format=raw -device virtio-blk-device,drive=foo -append 'root=/dev/vda rw console=ttyAMA0 rootwait earlyprintk' -monitor stdio -device vfio-fsl-mc,host=dprc.2 -S
QEMU 4.2.1 monitor - type 'help' for more information
(qemu) qemu-system-aarch64: -serial tcp::4446,server,telnet: info: QEMU waiting for connection on: disconnected:telnet:0.0.0.0:4446,server

0 Kudos
1,870 Views
sevseev
Contributor I

Hello,

Thank you.

Below is my log where I follow exactly the steps described in LSDK 21.08 User Guide, section 10.1.3.7. Of course, I use the numbers assigned to DPAA2 objects on my NXP board rather than the ones in the User Guide. The same is true for files locations.

restool dprc create dprc.1
dprc.2 is created under dprc.1

restool dpio create --container=dprc.2
dpio.16 is created under dprc.2

restool dpcon create --num-priorities=2 --container=dprc.2
dpcon.48 is created under dprc.2

restool dpmcp create --container=dprc.2
dpmcp.38 is created under dprc.2

restool dpmcp create --container=dprc.2
dpmcp.39 is created under dprc.2

restool dpbp create --container=dprc.2
dpbp.3 is created under dprc.2

restool dpni create --container=dprc.2
dpni.2 is created under dprc.2


restool dprc assign dprc.2 --object=dpio.16 --plugged=1
restool dprc assign dprc.2 --object=dpcon.48 --plugged=1
restool dprc assign dprc.2 --object=dpmcp.38 --plugged=1
restool dprc assign dprc.2 --object=dpmcp.39 --plugged=1
restool dprc assign dprc.2 --object=dpbp.3 --plugged=1
restool dprc assign dprc.2 --object=dpni.2 --plugged=1

restool dprc show dprc.2
dprc.2 contains 6 objects:
object label plugged-state
dpni.2 plugged
dpbp.3 plugged
dpmcp.39 plugged
dpmcp.38 plugged
dpio.16 plugged
dpcon.48 plugged

restool dprc connect dprc.1 --endpoint1=dpni.2 --endpoint2=dpmac.4

echo vfio-fsl-mc > /sys/bus/fsl-mc/devices/dprc.2/driver_override
echo dprc.2 > /sys/bus/fsl-mc/drivers/vfio-fsl-mc/bind

qemu-system-aarch64 -smp 1 -m 512 -cpu host -machine type=virt,gic-version=3 -kernel /home/user/Image -enable-kvm -display none -serial tcp::4446,server,telnet -drive if=none,file=/home/user/rootfs_lsdk2108_ubuntu_main_arm64.ext4,id=foo,format=raw -device virtio-blk-device,drive=foo -append 'root=/dev/vda rw console=ttyAMA0 rootwait earlyprintk' -monitor stdio -device vfio-fsl-mc,host=dprc.2 -S

QEMU 4.2.1 monitor - type 'help' for more information
(qemu) qemu-system-aarch64: -serial tcp::4446,server,telnet: info: QEMU waiting for connection on: disconnected:telnet:0.0.0.0:4446,server

// At this point qemu waits for connection. Once I telnet to it I get the error message:

qemu-system-aarch64: -device vfio-fsl-mc,host=dprc.2: 'vfio-fsl-mc' is not a valid device model name

Your log shows creation of dprc.2 under dprc.1 and then misses all other steps that exist in my log up to the binding of dprc.2 resource container (echo commands above). Can it be a reason somehow that my sequence does not work?

My understanding, perhaps wrong, was that dpni, dpio etc. objects must be provided to VM's so that in the end to present to VM OS's networking stack an ethernet driver. Figure 134 in the LSDK 21.08 User Guide shows the things that way. Without being able to export all of these pieces to VM it won't be able to do networking. Am I right?

Serguei

 

0 Kudos
1,861 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to "9.2.6.1 Launch Virtual Machine" in LSDK 21.08 user manual, the default QEMU present in filesystem may not support the direct assignment feature, please refer section "10.1.2.10 Building QEMU" to compile and install the proper QEMU version on the target.

Execute the following commands to build the QEMU 4.2 with VFIO passthrough support locally:
git clone https://source.codeaurora.org/external/qoriq/qoriq-components/qemu
cd qemu
git checkout qemu-4.2
git submodule update --init dtc
Make sure your machine has the required packages to build QEMU. Refer the example below:
#update your ubuntu m/c with required packages.

apt-get install pkg-config

apt-get install libglib2.0-dev

apt-get install libpixman-1-dev

apt-get install libaio-dev

apt-get install libusb-1.0-0-dev
Now, build the QEMU
./configure --prefix=/root/qemu-4.2 --target-list=aarch64-softmmu --enable-fdt --enable-kvm
make
make install
The new QEMU will be installed in /root/qemu-4.2 folder.

0 Kudos
1,854 Views
sevseev
Contributor I

Hi yipingwang,

I'll try that. Thanks!

 

0 Kudos
1,842 Views
sevseev
Contributor I

Hi yipingwang,

It worked! Thanks!

sevseev

 

0 Kudos