Julian Hall | e76ade8 | 2020-11-25 03:07:21 +0100 | [diff] [blame] | 1 | Deploying Programs on FVP |
| 2 | ========================= |
| 3 | This page explains how to load and run user space programs on a Linux image running in FVP simulation. |
| 4 | The loaded programs may use any trusted services that are available as part of the image firmware. |
| 5 | |
| 6 | To prepare and run an image that includes trusted services running in S-EL0 secure partitions under |
| 7 | OP-TEE. see: |
| 8 | :ref:`Deploying trusted services in S-EL0 Secure Partitions under OP-TEE` |
| 9 | |
| 10 | Shared directory |
| 11 | ---------------- |
| 12 | The OP-TEE image built for the FVP virtual platform supports directory sharing between the running |
| 13 | OS and the host computer. This provides a convenient way to transfer files between the host and |
| 14 | the device simulation. When the FVP is run using the *run-only* target in *fvp.mk*, the shared |
| 15 | directory is set-up automatically. |
| 16 | |
| 17 | On the host, the shared directory is located here:: |
| 18 | |
| 19 | optee/shared |
| 20 | |
| 21 | On the simulated device, running under FVP, a mount is created here:: |
| 22 | |
| 23 | /mnt |
| 24 | |
| 25 | Deploying service level tests |
| 26 | ----------------------------- |
| 27 | As an example of how to load and run programs, the *ts-service-test* binary executable is used. |
| 28 | The build file for the *arm-linux* deployment of *ts-service-test* lives under:: |
| 29 | |
| 30 | trusted-services/deployments/ts-service-test/arm-linux |
| 31 | |
| 32 | The executable includes service level test cases that exercise trusted services via their |
| 33 | standard interfaces. Test cases use *libts* for locating services and establishing RPC |
| 34 | sessions. *ts-service-test* provides a useful reference for understanding how *libts* may |
| 35 | be used for accessing trusted services. |
| 36 | |
| 37 | The build file for the *arm-linux* deployment of *libts* lives under:: |
| 38 | |
| 39 | trusted-services/deployments/libts/arm-linux |
| 40 | |
| 41 | Trusted service build instructions are here: |
| 42 | :ref:`Build Instructions` |
| 43 | |
| 44 | Having built *ts-service-test* and *libts* for the *arm-linux* environment, the steps |
| 45 | are required. |
| 46 | |
| 47 | Copy files to share directory |
| 48 | ''''''''''''''''''''''''''''' |
| 49 | Assuming that the *OP-TEE* and *trusted-services* projects are located under a common |
| 50 | parent directory, the following files need to be copied from the host using:: |
| 51 | |
| 52 | cp trusted-services/deployments/libts/arm-linux/build/install/lib/libts.so optee/shared/. |
| 53 | cp trusted-services/deployments/ts-service-test/arm-linux/build/install/bin/ts-service-test optee/shared/. |
| 54 | |
| 55 | Installing libts.so |
| 56 | ''''''''''''''''''' |
| 57 | Having copied *libts.so* to the shared directory, it needs to be copied to one of the standard |
| 58 | lib directories so that it is located when a dependent program is started. From the terminal |
| 59 | command prompt for the booted FVP, use:: |
| 60 | |
| 61 | cd /mnt |
| 62 | cp libts.so /usr/lib/. |
| 63 | |
| 64 | Running the program executable |
| 65 | '''''''''''''''''''''''''''''' |
| 66 | The *ts-service-test* program may be run directly from the */mnt* directory using:: |
| 67 | |
| 68 | ./ts-service-test -v |
| 69 | |
| 70 | If all is well, you should see something like:: |
| 71 | |
| 72 | TEST(E2EcryptoOpTests, generateRandomNumbers) - 3 ms |
| 73 | TEST(E2EcryptoOpTests, asymEncryptDecrypt) - 8 ms |
| 74 | TEST(E2EcryptoOpTests, signAndVerifyHash) - 29 ms |
| 75 | TEST(E2EcryptoOpTests, exportAndImportKeyPair) - 17 ms |
| 76 | TEST(E2EcryptoOpTests, exportPublicKey) - 10 ms |
| 77 | TEST(E2EcryptoOpTests, generatePersistentKeys) - 34 ms |
| 78 | TEST(E2EcryptoOpTests, generateVolatileKeys) - 16 ms |
| 79 | |
| 80 | OK (7 tests, 7 ran, 56 checks, 0 ignored, 0 filtered out, 117 ms) |
| 81 | |
| 82 | -------------- |
| 83 | |
| 84 | *Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.* |
| 85 | |
| 86 | SPDX-License-Identifier: BSD-3-Clause |