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

How to build sdp environment base on linux 6.6 #6777

Closed
wayne110 opened this issue Apr 2, 2024 · 5 comments
Closed

How to build sdp environment base on linux 6.6 #6777

wayne110 opened this issue Apr 2, 2024 · 5 comments
Labels

Comments

@wayne110
Copy link

wayne110 commented Apr 2, 2024

I have a question about optee driver on linux 6.6.

I want to use dma-buf to register sharememory to optee,

But I have not found the tee_shm_register_fd in linux 6.6.
853 static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
854 {
855 >...struct tee_context *ctx = filp->private_data;
856 >...void __user *uarg = (void __user *)arg;
857
858 >...switch (cmd) {
859 >...case TEE_IOC_VERSION:
860 >...>...return tee_ioctl_version(ctx, uarg);
861 >...case TEE_IOC_SHM_ALLOC:
862 >...>...return tee_ioctl_shm_alloc(ctx, uarg);
863 >...case TEE_IOC_SHM_REGISTER:
864 >...>...return tee_ioctl_shm_register(ctx, uarg);
865 >...case TEE_IOC_SHM_REGISTER_FD:
866 >...>...return tee_ioctl_shm_register_fd(ctx, uarg);
867 >...case TEE_IOC_OPEN_SESSION:
868 >...>...return tee_ioctl_open_session(ctx, uarg);
869 >...case TEE_IOC_INVOKE:
870 >...>...return tee_ioctl_invoke(ctx, uarg);
871 >...case TEE_IOC_CANCEL:
872 >...>...return tee_ioctl_cancel(ctx, uarg);
873 >...case TEE_IOC_CLOSE_SESSION:
874 >...>...return tee_ioctl_close_session(ctx, uarg);
875 >...case TEE_IOC_SUPPL_RECV:
876 >...>...return tee_ioctl_supp_recv(ctx, uarg);
877 >...case TEE_IOC_SUPPL_SEND:
878 >...>...return tee_ioctl_supp_send(ctx, uarg);
879 >...default:
880 >...>...return -EINVAL;
881 >...}
882 }

Did linaro use another way to support Secure media path between REE and TEE on the newest linux?

Or whether linaro maintain the shm APIs to use dma-buf in other branches?

@jenswi-linaro
Copy link
Contributor

SDP is not supported (yet?). I ran across this OP-TEE/optee_test#716 though.

@jenswi-linaro
Copy link
Contributor

I guess linaro-swg/linux#118 is the same question.

@jbech-linaro
Copy link
Contributor

Hi, like Jens said, since ION was removed from the Linux kernel, we haven't been able to re-enable SDP. Work has been done (and is ongoing) trying to get that up and running again with dma-buf. You'll find patches on the kernel mailinglist for this. In addition to that we've been a couple of people from Linaro, Google, Arm, Qualcomm etc who have met a couple of times to discuss this. You can find more about that here:

If you just want to play around with SDP on a somewhat recent OP-TEE setup, then you can try a setup I did a couple of months ago, however, this is based on older patches from NXP, so likely if we ever end up with a getting this supported in kernel, it will likely look a lot different to this setup. But with this, I've re-enabled SDP and SDP test etc in OP-TEE.

mkdir optee-sdp && cd optee-sdp
repo init -u https://github.com/jbech-linaro/manifest.git -m qemu_v8.xml -b nxp-sdp
repo sync -j12
cd build
make toolchains
make -j24 CFG_SECURE_DATA_PATH=y CFG_CORE_ASLR=n CFG_TA_ASLR=n run
When reaching the shell, type: xtest --sdp-basic

@wayne110
Copy link
Author

wayne110 commented Apr 3, 2024

@jenswi-linaro @jbech-linaro Many thanks.
I will get the code and verify it.

Copy link

github-actions bot commented May 4, 2024

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label May 4, 2024
@github-actions github-actions bot closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants