blob: eeb90780f19f82e0d006fb3c9ff287b6ffbce896 [file] [log] [blame]
Julian Halle76ade82020-11-25 03:07:21 +01001Deploying Programs on FVP
2=========================
3This page explains how to load and run user space programs on a Linux image running in FVP simulation.
4The loaded programs may use any trusted services that are available as part of the image firmware.
5
6To prepare and run an image that includes trusted services running in S-EL0 secure partitions under
7OP-TEE. see:
8:ref:`Deploying trusted services in S-EL0 Secure Partitions under OP-TEE`
9
10Shared directory
11----------------
12The OP-TEE image built for the FVP virtual platform supports directory sharing between the running
13OS and the host computer. This provides a convenient way to transfer files between the host and
14the device simulation. When the FVP is run using the *run-only* target in *fvp.mk*, the shared
15directory is set-up automatically.
16
17On the host, the shared directory is located here::
18
19 optee/shared
20
21On the simulated device, running under FVP, a mount is created here::
22
23 /mnt
24
25Deploying service level tests
26-----------------------------
27As an example of how to load and run programs, the *ts-service-test* binary executable is used.
28The build file for the *arm-linux* deployment of *ts-service-test* lives under::
29
30 trusted-services/deployments/ts-service-test/arm-linux
31
32The executable includes service level test cases that exercise trusted services via their
33standard interfaces. Test cases use *libts* for locating services and establishing RPC
34sessions. *ts-service-test* provides a useful reference for understanding how *libts* may
35be used for accessing trusted services.
36
37The build file for the *arm-linux* deployment of *libts* lives under::
38
39 trusted-services/deployments/libts/arm-linux
40
41Trusted service build instructions are here:
42:ref:`Build Instructions`
43
44Having built *ts-service-test* and *libts* for the *arm-linux* environment, the steps
45are required.
46
47Copy files to share directory
48'''''''''''''''''''''''''''''
49Assuming that the *OP-TEE* and *trusted-services* projects are located under a common
50parent 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
55Installing libts.so
56'''''''''''''''''''
57Having copied *libts.so* to the shared directory, it needs to be copied to one of the standard
58lib directories so that it is located when a dependent program is started. From the terminal
59command prompt for the booted FVP, use::
60
61 cd /mnt
62 cp libts.so /usr/lib/.
63
64Running the program executable
65''''''''''''''''''''''''''''''
66The *ts-service-test* program may be run directly from the */mnt* directory using::
67
68 ./ts-service-test -v
69
70If 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
86SPDX-License-Identifier: BSD-3-Clause