Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with sgx_build_modules.sh #45

Open
YuryAlkevich opened this issue Jun 12, 2017 · 3 comments
Open

Problem with sgx_build_modules.sh #45

YuryAlkevich opened this issue Jun 12, 2017 · 3 comments

Comments

@YuryAlkevich
Copy link

YuryAlkevich commented Jun 12, 2017

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
Copy link
Owner

This is fixed in the am33x-v4.11 branch

Regards,

@YuryAlkevich
Copy link
Author

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:NTCti,sgx
depends:
vermagic: 4.11.4-bone2 mod_unload modversions ARMv7 thumb2 p2v8

@YuryAlkevich
Copy link
Author

YuryAlkevich commented Jun 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants