11-22-2019 10:57 AM
We've found an unexpected behaviour when installing a kernel module in a Zynq UltraScale+ device and we'd like to know whether there is something wrong in our procedure. In any case, we've found a workaround thanks to this post:
Here's the problem:
We have a kernel module installed and tested on a ZedBoard. The kernel module is compiled with xlnx_rebase_v4.14_2018.3 and the OS in the ZedBoard is created with PetaLinux 2018.3.
Now, we are porting this module to a ZCU102 board by using the same xlnx_rebase_v4.14_2018.3 but compiled for a ZynqMP (aarch64). However, when we try installing the module with insmod the following error appears:
kernel_module_drv: version magic '4.14.0 SMP mod_unload aarch64' should be '4.14.0-xilinx-v2018.3 SMP mod_unload aarch64'
insmod: can't insert 'kernel_module_drv.ko': invalid module format
We have tried to modify the kernel 'Local Version' tag with PetaLinux and remove the '-xilinx-v2018.3' extension but it doesn't work, the error still appears.
The PetaLinux project for the ZCU102 uses xilinx-zcu102-zu9-es2-rev1.0-v2018.3-final.bsp
Our current workaround for now is:
Would you have any recommendation to avoid this workaround?
Space Science & Engineering Lab, ssel.upct.es
11-22-2019 11:44 AM
You have a kernel named version mismatch.
The kernel module's version must match its kernel's version, the architecture as well (Zynq 7000 is different from Zynq Ultrascale+ MP).
The kernel localversion is configured via General Setup menu of the kernel configuration menuconfig:
11-23-2019 03:12 AM
Thanks for your answer. Unfortunately, we had already tried that and it didn't work.
As the nomenclature can be a little bit tricky I'm going to define the keynames I'll use in the message, just to be sure we're on the same page:
We had already tried to change the kernel OS's localversion via the General Setup menu of the kernel configuration menuconfig and remove the '-xilinx-v2018.3' tag. It didn't work, the mismatch still exists.
For now, we can only modify the kernel OS's localversion by modifying the linux-xlnx_%.bbappend file when creating the Linux for the Zynq MP.
However, when we build a kernel module and kernel OS for a Zynq 7000 we don't have to do any modification on this matter. The kernel OS's localversion has the '-xilinx-v2018.3' by default (checked in the kernel configuration menuconfig).
Our hypothesis is that the kernel module's version doesn't include the '-xilinx-v2018.3' tag when it's compiled for a Zynq MP but it does when it's compiled for a Zynq 7000.
It isn't very important as we have a workaround but we were wondering whether this is an expected behaviour when compiling for a Zynq MP or maybe there was something we weren't aware of.
11-27-2019 12:42 PM
I had this issue when I used a pre-built 102 kernel, while my coworker set that same kernel as an ext-local-src. Make sure you either both use the one that's built in to petalinux, or you both use an externel one (even if you use the same kernel, it matters whether you specify it as ext-local-src or linux-xlnx in the config menu.)