RobertCNelson / bb-kernel

MIT License
130 stars 102 forks source link

Problem with sgx_build_modules.sh #45

Open YuryAlkevich opened 7 years ago

YuryAlkevich commented 7 years ago

Hello, I'm using am33x-v4.9 branch of the repo and trying to build sgx modules. But the script sgx_build_modules.sh ends up with the following errors:

CC [M] /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.o /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c: In function ‘OSAcquirePhysPageAddr’: /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c:3613:31: error: too many arguments to function ‘get_user_pages_remote’ psInfo->iNumPagesMapped = get_user_pages_remote(current, current->mm, uStartAddr, psInfo->iNumPages, FOLL_WRITE, psInfo->ppsPages, NULL, NULL); ^~~~~ In file included from ./arch/arm/include/asm/cacheflush.h:13:0, from /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c:55: ./include/linux/mm.h:1298:6: note: declared here long get_user_pages_remote(struct task_struct tsk, struct mm_struct mm, ^~~~~ /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c: In function ‘pvr_dmac_inv_range’: /home/sergey/bbb/rcn/bb-kernel-am33x-v4.9/ignore/ti-sdk-pvr/Graphics_SDK/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c:4339:2: error: implicit declaration of function ‘dmac_map_area’ [-Werror=implicit-function-declaration] dmac_map_area(pvStart, pvr_dmac_range_len(pvStart, pvEnd), DMA_FROM_DEVICE); ^~~~~ cc1: some warnings being treated as err

A script for building a kernel works fine. First error I've resolved with the following line of code psInfo->iNumPagesMapped = get_user_pages_remote(current, current->mm, uStartAddr, psInfo->iNumPages, FOLL_WRITE, psInfo->ppsPages, NULL); But I don't know what to do with the rest. Could someone help with that problem?

RobertCNelson commented 7 years ago

This is fixed in the am33x-v4.11 branch

Regards,

YuryAlkevich commented 7 years ago

Thank you for the response. The script sgx_build_modules.sh works fine on the am33x-v4.11 branch, but I've encountered a new problem now. I can't insmod the module:

insmod pvrsrvkm.ko [ 100.552555] pvrsrvkm: loading out-of-tree module taints kernel. [ 100.560392] pvrsrvkm: section 3 reloc 482 sym 'mutex_unlock': relocation 10 out of range (0xbf80294a -> 0xc084c009) insmod: can't insert 'pvrsrvkm.ko': invalid module format

modinfo pvrsrvkm.ko filename: pvrsrvkm.ko author: Imagination Technologies Ltd. gpl-support@imgtec.com license: Dual MIT/GPL alias: of:NTCti,sgxC alias: of:NT*Cti,sgx depends:
vermagic: 4.11.4-bone2 mod_unload modversions ARMv7 thumb2 p2v8

YuryAlkevich commented 7 years ago

The problem doesn't relate to sgx. So the issue may be actually closed. But GFX_5.01.01.02_es8.x.tar.gz archive contains wrong *.ko's. So I had to copy them from "ignore/ti-sdk-pvr/Graphics_SDK/gfx_rel_es8.x". Also the error mentioned above doesn't happen when I load module again right after the first try. But I still don't know why.