Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 1 | .. _faq: |
| 2 | |
| 3 | ########################## |
| 4 | Frequently Asked Questions |
| 5 | ########################## |
| 6 | |
| 7 | .. contents:: Table of Contents |
| 8 | |
| 9 | ---- |
| 10 | |
| 11 | Abbreviations |
| 12 | ************* |
| 13 | :OP-TEE: Open Portable TEE |
| 14 | :TA: Trusted Application |
| 15 | :TEE: Trusted Execution Environment |
| 16 | :TZASC: TrustZone Address Space Controller |
| 17 | :TZPC: TrustZone Protection Controller |
| 18 | |
| 19 | ---- |
| 20 | |
| 21 | Architecture |
| 22 | ************ |
| 23 | Q: Which platforms/architectures are supported? |
| 24 | =============================================== |
| 25 | - The :ref:`platforms_supported` page lists all platforms and architectures |
| 26 | currently supported in the official tree. |
| 27 | |
| 28 | Q: Are 32-bit as well as 64-bit support? |
| 29 | ======================================== |
| 30 | - Both 32- and 64-bit are fully supported for all OP-TEE components. |
| 31 | |
| 32 | Q: Does OP-TEE support mixed-mode, i.e., both AArch32 and AArch64 Trusted Applications on top of an AArch64 core? |
| 33 | ================================================================================================================= |
| 34 | - Yes! |
| 35 | |
| 36 | Q: What’s the maximum size for heap and stack? Can it be changed? |
| 37 | ================================================================= |
| 38 | - Yes, it can be changed. In the current setup (for vexpress for example), |
| 39 | there are ``32MB DDR`` dedicated for OP-TEE. ``1MB`` for ``TEE RAM`` and |
| 40 | ``1MB`` for ``PUB RAM``, this leaves ``30MB`` for Trusted Applications. In |
| 41 | the Trusted Applications, you set ``TA_STACK_SIZE`` and ``TA_DATA_SIZE``. |
| 42 | Typically, we set stack to ``2KB`` and data to ``32K``. But you are free |
| 43 | to adjust those according to the amount of memory you have available. If |
| 44 | you need them to be bigger than ``1MB`` then you also must adjust TA’s MMU |
| 45 | L1 table accordingly, since default section mapping is 1MB. |
| 46 | |
| 47 | Q: What is the size of OP-TEE itself? |
| 48 | ===================================== |
| 49 | - As of 2016.01, optee_os is about ``244KB`` (release build). It is |
| 50 | preferred to run :ref:`optee_os` entierly in SRAM, but if there is not |
| 51 | enough room, DRAM can be used and protected with TZASC. We are also |
| 52 | looking into the possibility of creating a ‘minimal’ OP-TEE, i.e. a |
| 53 | limited OP-TEE usable even in a very memory constrained environment, by |
| 54 | eliminating as many memory-hungry parts as possible. There is however no |
| 55 | ETA for this at the moment. |
| 56 | |
| 57 | - You can check the memory usage by using the ``make mem_usage`` target in |
| 58 | :ref:`optee_os`, for example: |
| 59 | |
| 60 | .. code-block:: bash |
| 61 | |
| 62 | $ make ... mem_usage |
| 63 | # Which will output a file with the figures here: |
| 64 | # out/arm/core/tee.mem_usage |
| 65 | |
| 66 | You will of course get different sizes depending on what compile time |
| 67 | flags you have enabled when running `make mem_usage`. |
| 68 | |
| 69 | Q: Can NEON optimizations be done in OP-TEE? |
| 70 | ============================================ |
| 71 | - Yes (for additional information, please also see `Issue#953`_) |
| 72 | |
| 73 | Q: Can I use C++ libraries in OP-TEE? |
| 74 | ===================================== |
| 75 | - C++ libraries are currently not supported. Technically, it is possible but |
| 76 | will require a fair amount of work to implement, especially more so if |
| 77 | exceptions are required. There are currently no plans to do this. |
| 78 | |
| 79 | - See `Issue#2628`_ for related information. |
| 80 | |
| 81 | Q: Would using `malloc()` in OP-TEE give physically contiguous memory? |
| 82 | ====================================================================== |
| 83 | - ``malloc()`` in OP-TEE currently gives physically contiguous memory. It is |
| 84 | not guaranteed as it is not mentioned anywhere in the documentation, but |
| 85 | in practice the heap only has physically contiguous memory in the pool(s). |
| 86 | The heap in OP-TEE is normally quite small, ~24KiB, and could be a bit |
| 87 | fragmented. |
| 88 | |
| 89 | Q: Can I limit what CPUs / cores OP-TEE runs on? |
| 90 | ================================================ |
| 91 | - Currently it’s up to the kernel to decide which core it runs on, i.e, it |
| 92 | will be the same core as the one initiating the SMC in Linux. Please also |
| 93 | see `Issue#1194`_. |
| 94 | |
| 95 | Q: How is OP-TEE being scheduled? |
| 96 | ================================= |
| 97 | - OP-TEE does not have its own scheduler, instead it is being scheduled by |
| 98 | Linux kernel. For more information, please see `Issue#1036` and |
| 99 | `Issue#1183`_. |
| 100 | |
| 101 | ---- |
| 102 | |
| 103 | Board support |
| 104 | ************* |
| 105 | Q: How do I port OP-TEE to another platform? |
| 106 | ============================================ |
| 107 | - Start by reading the :ref:`porting_guidelines`. |
| 108 | |
| 109 | - See the :ref:`presentations` page. There might be some interesting |
| 110 | information in the "LCU14-302 How To Port OP-TEE To Another Platform" deck |
| 111 | and video. Beware that the presentation is more than five years old, so |
| 112 | even though it is a good source, there might be parts that are not |
| 113 | relevant any longer. |
| 114 | |
| 115 | - As a good example for |
| 116 | |
| 117 | - **Armv8-A** patch enabling OP-TEE support on a new device, please see |
| 118 | the `ZynqMP port`_ that enabled support for running OP-TEE on `Xilinx |
| 119 | UltraScale+ Zynq MPSoC`. Besides that there are similar patches for |
| 120 | `Juno port`_, `Raspberry Pi3 port`_, `HiKey port`_. |
| 121 | |
| 122 | - **ARMv7-A**, please have a look at the `Freescale ls1021a port`_, |
| 123 | another example would be the `TI DRA7xx port`_. |
| 124 | |
| 125 | ---- |
| 126 | |
| 127 | Building |
| 128 | ******** |
| 129 | Q: I got build errors running latest, why? |
| 130 | ========================================== |
| 131 | - What did you try to build? Only :ref:`optee_os`? A full OP-TEE developer |
| 132 | setup using QEMU, HiKey, RPi3, Juno using repo? AOSP? OpenEmbedded? What |
| 133 | we build on daily basis are the OP-TEE developer setups (see |
| 134 | :ref:`optee_developer_setup`) , but other builds like AOSP and |
Joakim Bech | e58b15c | 2020-04-15 10:48:41 +0200 | [diff] [blame] | 135 | OpenEmbedded are builds that we try from time to time, but we have no |
| 136 | CI/regression testing configured for those builds. |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 137 | |
| 138 | - By running latest instead of stable also comes with a risk of getting |
| 139 | build errors due to version and/or interdependency skew which can result |
| 140 | in build error. Now, such issues most often affects running xtest and not |
| 141 | the building. If you however clean all gits and do a ``repo sync -d``. Then |
| 142 | we're almost 100% sure you will get back to a working state again, since |
| 143 | as mentioned in next bullet, we build (and run xtest) on all QEMU on all |
| 144 | patches sent to OP-TEE. |
| 145 | |
| 146 | - Every pull request in OP-TEE are tested on hardware (see |
| 147 | :ref:`how_are_you_testing_optee`). |
| 148 | |
| 149 | Q: I got build errors running stable tag x.y.z, why? |
| 150 | ==================================================== |
| 151 | - Stable releases are quite well tested both in terms of building for all |
| 152 | supported platforms and running xtest on all platforms, so if you cannot |
| 153 | get that to build and run, then there is a great chance you have something |
| 154 | wrong on your side. All platforms that has been tested on a stable release |
| 155 | can be found in `CHANGELOG.md`_ file. Having that said, we do make mistakes |
| 156 | on stable builds also from time to time. |
| 157 | |
| 158 | Q: I get `gcc XYZ` or `g++ XYZ` compiler error messages? |
| 159 | ======================================================== |
| 160 | - Most likely you're trying to build OP-TEE using the regular x86 compiler |
| 161 | and not the using the Arm toolchain. Please install the |
| 162 | :ref:`prerequisites` and make sure you have gotten and installed the Arm |
| 163 | toolchains as described at the :ref:`toolchains` page. (for additional |
| 164 | information, please see `Issue#846`_). |
| 165 | |
| 166 | Q: I found this build.git, what is that? |
| 167 | ======================================== |
| 168 | - :ref:`build` is a git that is used in conjunction with the |
| 169 | :ref:`manifest` to create full OP-TEE developer builds. It contains |
| 170 | helper makefiles that makes it easy to get OP-TEE up and running on the |
| 171 | setups that are using repo. |
| 172 | |
| 173 | Q: When running `make` from build.git it fails to download the toolchains? |
| 174 | ========================================================================== |
| 175 | - We try to stay somewhat up to date with running recent ``GCC`` versions. But |
| 176 | just like everywhere else on the net things moves around. In some cases like |
| 177 | `Issue#1195`_, the URL was changed without us noticing it. If you find and fix |
| 178 | such an issue, please send the fix as pull request and we will be happy to |
| 179 | merge it. |
| 180 | |
Jerome Forissier | 07e7fa0 | 2020-01-22 08:39:03 +0100 | [diff] [blame] | 181 | .. _faq_try_optee: |
| 182 | |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 183 | Q: What is the quickest and easiest way to try OP-TEE? |
| 184 | ====================================================== |
| 185 | - That would be running it on QEMU on a local PC. To do that you would need to: |
| 186 | |
| 187 | - Install the OP-TEE :ref:`prerequisites`. |
| 188 | - Build for QEMU according to the instructions at :ref:`qemu_v7`. |
| 189 | - And :ref:`optee_test_run_xtest`. |
| 190 | |
| 191 | - By summarizing the above, you would need to: |
| 192 | .. code-block:: bash |
| 193 | |
| 194 | $ sudo apt-get install [pre-reqs] |
| 195 | $ mkdir optee-qemu && cd optee-qemu |
| 196 | $ repo init -u https://github.com/OP-TEE/manifest.git |
| 197 | $ repo sync |
| 198 | $ cd build |
| 199 | $ make toolchains -j2 |
| 200 | $ make run |
| 201 | QEMU console: (qemu) c |
| 202 | Normal world shell: # xtest |
| 203 | |
| 204 | ---- |
| 205 | |
| 206 | Certification and security reviews |
| 207 | ********************************** |
Joakim Bech | e58b15c | 2020-04-15 10:48:41 +0200 | [diff] [blame] | 208 | Q: Will TrustedFirmware.org be involved in GlobalPlatform certification/qualification? |
| 209 | ====================================================================================== |
| 210 | - No, not as of now. Most often certification is performed using a certain |
| 211 | software version and on a unique device. I.e., it is the combination |
| 212 | software + hardware that gets certified. This is typically something that |
| 213 | the SoC or OEM needs to do on their own. |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 214 | |
| 215 | - But it is worth mentioning that since OP-TEE is coming from a proprietary |
| 216 | TEE solution that was GlobalPlatform certified on some products in the |
| 217 | past and we regularly have people from some member companies running the |
| 218 | extended test suite from GlobalPlatform we know that the gap to become |
| 219 | GlobalPlatform certified/qualified isn’t that big. |
| 220 | |
| 221 | .. _q_has_any_test_lab_been_testing_op-tee: |
| 222 | |
| 223 | Q: Has any test lab been testing OP-TEE? |
| 224 | ======================================== |
| 225 | - `Applus Laboratories`_ have done some side-channel attack testing and |
| 226 | fault injection testing on OP-TEE using the :ref:`hikey` device. Their |
| 227 | findings and fixes can be found at the `Security Advisories`_ page at |
| 228 | optee.org. |
| 229 | |
| 230 | - Riscure_ did a mini-audit of OP-TEE which generated a couple of patches |
| 231 | (see `PR#2745`). The `Security Advisories`_ page at optee.org will be |
| 232 | updated with more information regarding that in the future. |
| 233 | |
| 234 | |
| 235 | Q: Have there been any code audit / code review done? |
| 236 | ===================================================== |
Joakim Bech | e58b15c | 2020-04-15 10:48:41 +0200 | [diff] [blame] | 237 | - Full audit? No! But in the past Linaro have been collaborating with |
| 238 | Riscure trying to identify and fix potential security issues. There has |
| 239 | also been some companies that have done audits internally and they have |
| 240 | then shared the result with us and where relevant, we have created patches |
| 241 | resolving the issues reported to us (see |
| 242 | :ref:`q_has_any_test_lab_been_testing_op-tee`). |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 243 | |
| 244 | - Code review, yes! Every single patch going into OP-TEE has been reviewed |
| 245 | in a pull request on GitHub. We more or less have a requirement that every |
| 246 | patch going into OP-TEE shall at least have one "Reviewed-by" tag in the |
| 247 | patch. |
| 248 | |
| 249 | - Third party / test lab code review, no! Again some companies have reviewed |
| 250 | internally and shared the result with us, but other than that no (see |
| 251 | related :ref:`q_has_any_test_lab_been_testing_op-tee`) |
| 252 | |
| 253 | |
| 254 | Contribution |
| 255 | ************ |
| 256 | Q: How do I contribute? |
| 257 | ======================= |
| 258 | - Please see the :ref:`contribute` page. |
| 259 | |
| 260 | Q: Where can I get help? |
| 261 | ======================== |
| 262 | - Please see the :ref:`contact` page. |
| 263 | |
| 264 | Q: I'm new to OP-TEE but I would like to help out, what can I do? |
| 265 | ================================================================= |
| 266 | - We always need help with code reviews, feel free to review any of the open |
| 267 | `OP-TEE OS Pull Requests`_. Please also note that there could be open pull |
| 268 | request in the other :ref:`optee_gits` that needs reviews too. |
| 269 | |
| 270 | - We always need help answering all the questions asked at `OP-TEE OS |
| 271 | Issues`_. |
| 272 | |
| 273 | - If you want to try to solve a bug, please have a look at the `OP-TEE OS |
| 274 | Bugs`_ or the `OP-TEE OS Enhancements`_. |
| 275 | |
| 276 | - Documentation tends to become obsolete if not maintained on regular basis. |
| 277 | We try to do our best, but we're not perfect. Please have a look at |
| 278 | :ref:`optee_docs` and try to update where you find gaps. |
| 279 | |
| 280 | - Enable `repo` for the device in :ref:`manifest` and :ref:`build` (and also |
| 281 | :ref:`platforms_supported`) currently not using repo. |
| 282 | |
| 283 | - If you would like to implement a bigger feature, please reach out to us |
| 284 | (see :ref:`contact`) and we can discuss what is most relevant to look into |
| 285 | for the moment. If you already have an idea, feel free to send the |
| 286 | proposal to us. |
| 287 | |
| 288 | ---- |
| 289 | |
| 290 | Interfaces |
| 291 | ********** |
| 292 | Q: Which API’s have been implemented in OP-TEE? |
| 293 | =============================================== |
| 294 | - GlobalPlatform (see :ref:`globalplatform_api` for more details). |
| 295 | - GlobalPlatform's TEE Client API v1.1 specification |
| 296 | - GlobalPlatform's TEE Internal Core API v1.1 specification. |
| 297 | - GlobalPlatform's Secure Elements v1.0 (**now deprecated**, see ``git |
| 298 | log``). |
| 299 | - GlobalPlatform's Socket API v1.0 (TCP and UDP, but not TLS). |
| 300 | |
| 301 | - AOSP Keymaster_ (v3) and AOSP Gatekeeper_ (see :ref:`aosp` for more |
| 302 | details). |
| 303 | |
| 304 | - `Android Verified Boot 2.0`_ (AVB 2.0) |
| 305 | |
| 306 | ---- |
| 307 | |
| 308 | Hardware and peripherals |
| 309 | ************************ |
| 310 | Q: Can I use my own hardware IP for crypto acceleration? |
| 311 | ======================================================== |
| 312 | - Yes, OP-TEE has a Crypto Abstraction Layer (see |
| 313 | :ref:`cryptographic_implementation` that was designed mainly to make it |
| 314 | easy to add support for hardware crypto acceleration. There you will find |
| 315 | information about the abstraction layer itself and what you need to do to |
| 316 | be able to support new software/hardware “drivers” in OP-TEE. |
| 317 | |
| 318 | ---- |
| 319 | |
| 320 | License |
| 321 | ******* |
| 322 | Q: Under what license is OP-TEE released? |
| 323 | ========================================= |
| 324 | - The software is mostly provided under the `BSD 2-Clause`_ license. |
| 325 | |
| 326 | - The TEE kernel driver is released under GPLv2 for obvious reasons. |
| 327 | |
| 328 | - xtest (:ref:`optee_test`) uses BSD 2-Clause for code running in secure |
| 329 | world (Trusted Applications etc) and GPLv2 for code running in normal |
| 330 | world (client code). |
| 331 | |
| 332 | Q: GlobalPlatform click-through license |
| 333 | ======================================= |
| 334 | - Since OP-TEE is a GlobalPlatform based TEE which implements the APIs as |
| 335 | specified by GlobalPlatform one has to accept, the click-through license |
| 336 | which is presented when trying to download the :ref:`globalplatform_api` |
| 337 | specifications before start using OP-TEE. |
| 338 | |
| 339 | Q: I've modified OP-TEE by using code with non BSD 2-Clause license, will you accept it? |
| 340 | ======================================================================================== |
| 341 | - That is something we deal with case by case. But as a general answer, if |
| 342 | it does not contaminate the BSD 2-Clause license we will accept it. Reach |
| 343 | out to us (see :ref:`contact`) and we will take it from there. |
| 344 | |
| 345 | ---- |
| 346 | |
| 347 | Promotion |
| 348 | ********* |
| 349 | Q: I want to get my company logo on op-tee.org, how? |
| 350 | ==================================================== |
| 351 | - If your company has done significant contributions to OP-TEE, then please |
| 352 | :ref:`contact` us and we will do our best to include your company. Pay |
| 353 | attention to that we will review this on regular basis and inactive |
| 354 | supporting companies might be removed in the future again. |
| 355 | |
| 356 | ---- |
| 357 | |
| 358 | Security vulnerabilities |
| 359 | ************************ |
| 360 | Q: I have a found a security flaw in OP-TEE, how can I disclose it with you? |
| 361 | ============================================================================ |
Joakim Bech | 43479d4 | 2020-06-22 08:13:25 +0200 | [diff] [blame] | 362 | - Please see the :ref:`Contact` page. |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 363 | |
| 364 | ---- |
| 365 | |
| 366 | Source code |
| 367 | *********** |
| 368 | Q: Where is the source code? |
| 369 | ============================ |
| 370 | - It is located on GitHub under the project `OP-TEE`_ and `linaro-swg`_. |
| 371 | |
| 372 | Q: Where do I download the test suite called xtest? |
| 373 | =================================================== |
| 374 | - All the source code for that can be found in the git called |
| 375 | :ref:`optee_test`. |
| 376 | |
| 377 | - The :ref:`globalplatform_tests` can be purchased separately. |
| 378 | |
| 379 | Q: Where is the Linux kernel TEE driver? |
| 380 | ======================================== |
| 381 | - You can find both the generic TEE framework including the OP-TEE driver |
| 382 | included in the official Linux kernel project since v4.12. Having that |
| 383 | said, we "buffer up" pending patches on a our :ref:`linux_kernel` branch. |
| 384 | I.e., that is where we keep new features being developed for OP-TEE. In |
| 385 | the long run we aim to completely stop using our own branch and just send |
| 386 | all patches to the official Linux kernel tree directly. But as of now we |
| 387 | cannot do that. |
| 388 | |
| 389 | ---- |
| 390 | |
| 391 | Testing |
| 392 | ******* |
| 393 | |
| 394 | .. _how_are_you_testing_optee: |
| 395 | |
| 396 | Q: How are you testing OP-TEE? |
| 397 | ============================== |
| 398 | - There is a test suite called xtest that tests the complete TEE-solution to |
| 399 | ensure that the communication between all architectural layers is working |
| 400 | as it should. The test suite also tests the majority of the GlobalPlatform |
| 401 | TEE Internal Core API. It has close to 50,000 and ever increasing test |
| 402 | cases, and is also extendable to include the official GlobalPlatform test |
| 403 | suite (see :ref:`globalplatform_tests`). |
| 404 | |
| 405 | - Every pull request in OP-TEE are built for a multitude of different platforms |
| 406 | automatically using Travis_, Shippable_ and IBART_. Please have a look |
| 407 | there to see whether it failed building on the platform you're using |
| 408 | before submitting any issue about build errors. |
| 409 | |
| 410 | - For more information see :ref:`optee_test`. |
| 411 | |
| 412 | ---- |
| 413 | |
| 414 | Trusted Applications |
| 415 | ******************** |
| 416 | Q: How do I write a Trusted Application (TA)? |
| 417 | ============================================= |
| 418 | - Have a look at the :ref:`build_trusted_applications` page as well as the |
| 419 | :ref:`optee_examples` page. Those provides guidelines and examples on how |
| 420 | to implement basic Trusted Applications. |
| 421 | |
| 422 | - If you want to see more advanced uses cases of Trusted Applications, then |
| 423 | we encourage that you have a look at the Trusted Applications |
| 424 | :ref:`optee_test`. |
| 425 | |
| 426 | Q: How do I link a library into a Trusted Application? |
| 427 | ====================================================== |
| 428 | - See the example in :ref:`build_trusted_applications_submk`. |
| 429 | |
| 430 | - Also see `Issue#280`_, `Issue#601`_, `Issue#901`_, `Issue#1003`_. |
| 431 | |
| 432 | Q: Where should I put my compiled Trusted Application on the device? |
| 433 | ==================================================================== |
| 434 | - ``/lib/optee_armtz``, that is the default location where tee-supplicant |
| 435 | will look for Trusted Applications. |
| 436 | |
Jerome Forissier | dbe4813 | 2020-08-07 16:01:22 +0200 | [diff] [blame] | 437 | .. _what_is_a_pseudo_ta_and_how_do_i_write_one: |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 438 | |
Jerome Forissier | dbe4813 | 2020-08-07 16:01:22 +0200 | [diff] [blame] | 439 | Q: What is a Pseudo TA and how do I write one? |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 440 | ============================================== |
Jerome Forissier | dbe4813 | 2020-08-07 16:01:22 +0200 | [diff] [blame] | 441 | - A Pseudo TA is an OP-TEE firmware service offered through the generic API |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 442 | used to invoke Trusted Applications. Pseudo TA interface and services all |
| 443 | runs in TEE kernel / core context. I.e., it will have access to the same |
| 444 | functions, memory and hardware etc as the TEE core itself. If we're |
| 445 | talking ARMv8-A it is running in ``S-EL1``. |
| 446 | |
Jerome Forissier | dbe4813 | 2020-08-07 16:01:22 +0200 | [diff] [blame] | 447 | Q: Are Pseudo **user space** TAs supported? |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 448 | =========================================== |
| 449 | - No! |
| 450 | |
| 451 | Q: Can a static TA Open/Invoke dynamic TA? |
| 452 | ========================================== |
| 453 | - Yes, for a longer discussion see `Issue#967`_, `Issue#1085`_, |
| 454 | `Issue#1132`_. |
| 455 | |
| 456 | Q: How can I extend the GlobalPlatform Internal Core API? |
| 457 | ========================================================= |
Jerome Forissier | dbe4813 | 2020-08-07 16:01:22 +0200 | [diff] [blame] | 458 | - You may develop your own “Pseudo TA”, which is part of the core (see |
| 459 | :ref:`what_is_a_pseudo_ta_and_how_do_i_write_one` for more information |
| 460 | about the Pseudo TA). |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 461 | |
| 462 | Q: How are Trusted Applications verified? |
| 463 | ========================================= |
| 464 | - Please see the section :ref:`core_pub_priv_keypair` in the |
| 465 | :ref:`porting_guidelines`. |
| 466 | |
| 467 | - Alternatively one can also build a Trusted Application and embed its raw |
| 468 | binary content into the OP-TEE firmware binary. At runtime, if invoked, |
| 469 | the Trusted Application will be loaded from the OP-TEE firmware image |
| 470 | instead of being fetched from the normal world and authenticated in the |
| 471 | secure world (see :ref:`early_ta` for more information). |
| 472 | |
| 473 | Q: Is multi-core TA supported? |
| 474 | ============================== |
| 475 | - Yes, you can have two or more TAs running simultaneously. Please see also |
| 476 | `Issue#1194`_. |
| 477 | |
| 478 | Q: Is multi-threading supported in a TA? |
| 479 | ======================================== |
| 480 | - No, there is no such concept as ``pthreads`` or similar. I.e, you cannot |
| 481 | spawn thread from a TA. If you need to run tasks in parallel, then you |
| 482 | should probably look into running two TAs or more simultaneously and then |
| 483 | let them communicate with each other using the ``TA2TA`` interface. |
| 484 | |
| 485 | Q: How can I use or call OP-TEE from native Android (apk) applications? |
| 486 | ======================================================================= |
| 487 | - Use the `Java Native Interface`_ (JNI). |
| 488 | - First get familiar with `sample_hellojni.html`_ and make sure you can run |
| 489 | the sample. After that, replace the C-side Implementation with for example |
| 490 | :ref:`hello_world` or one of the other examples in :ref:`optee_examples`. |
| 491 | |
| 492 | .. note:: |
| 493 | |
| 494 | Note that :ref:`hello_world` and other binaries in optee_examples are built |
| 495 | as executables, and have to be modified to be built as a .so shared library |
| 496 | instead so that it can be loaded by the Java-side Implementation. |
| 497 | |
| 498 | - Note that ``*.apk`` apps by default have no access to the TEE driver. See |
| 499 | `Issue#903`_ for details. The workaround is to disable SELinux before |
| 500 | launching any ``*.apk`` app that calls into OP-TEE. The solution is to |
| 501 | create/write SELinux domains/rules to allow any required access, but since |
| 502 | this is not a TEE-related issue, it is left as an exercise for the users. |
| 503 | |
| 504 | Q: I've heard that there is a Widevine and PlayReady TA, how do I get access? |
| 505 | ============================================================================= |
Joakim Bech | e58b15c | 2020-04-15 10:48:41 +0200 | [diff] [blame] | 506 | - TrustedFirmware have no such implementation, but Linaro do have reference |
| 507 | implementations for that that they share with their members who have |
| 508 | signed the WMLA and NDA/MLA with Google and Microsoft. So the advice is to |
| 509 | reach out to Linaro if you have questions about that. |
Joakim Bech | 8e5c5b3 | 2018-10-25 08:18:32 +0200 | [diff] [blame] | 510 | |
| 511 | .. _Issue#280: https://github.com/OP-TEE/optee_os/issues/280 |
| 512 | .. _Issue#601: https://github.com/OP-TEE/optee_os/issues/601 |
| 513 | .. _Issue#846: https://github.com/OP-TEE/optee_os/issues/846 |
| 514 | .. _Issue#901: https://github.com/OP-TEE/optee_os/issues/901 |
| 515 | .. _Issue#903: https://github.com/OP-TEE/optee_os/issues/903 |
| 516 | .. _Issue#953: https://github.com/OP-TEE/optee_os/issues/953 |
| 517 | .. _Issue#967: https://github.com/OP-TEE/optee_os/issues/967 |
| 518 | .. _Issue#1003: https://github.com/OP-TEE/optee_os/issues/1003 |
| 519 | .. _Issue#1036: https://github.com/OP-TEE/optee_os/issues/1036 |
| 520 | .. _Issue#1085: https://github.com/OP-TEE/optee_os/issues/1085 |
| 521 | .. _Issue#1132: https://github.com/OP-TEE/optee_os/issues/1132 |
| 522 | .. _Issue#1183: https://github.com/OP-TEE/optee_os/issues/1183 |
| 523 | .. _Issue#1194: https://github.com/OP-TEE/optee_os/issues/1194 |
| 524 | .. _Issue#1195: https://github.com/OP-TEE/optee_os/issues/1195 |
| 525 | .. _Issue#2628: https://github.com/OP-TEE/optee_os/issues/2628 |
| 526 | |
| 527 | .. _PR#2745: https://github.com/OP-TEE/optee_os/pull/2745 |
| 528 | |
| 529 | .. _Android Verified Boot 2.0: https://android.googlesource.com/platform/external/avb/+/master/README.md |
| 530 | .. _Applus Laboratories: http://www.appluslaboratories.com/en/ |
| 531 | .. _BSD 2-Clause: http://opensource.org/licenses/BSD-2-Clause |
| 532 | .. _CHANGELOG.md: https://github.com/OP-TEE/optee_os/blob/master/CHANGELOG.md |
| 533 | .. _Freescale ls1021a port: https://github.com/OP-TEE/optee_os/commit/85278139a8f914dddb36808861c86a472ecb0271 |
| 534 | .. _Gatekeeper: https://source.android.com/security/authentication/gatekeeper |
| 535 | .. _HiKey port: https://github.com/OP-TEE/optee_os/commit/d70e78c49fc9c63b2d37c596b7ad3cbd38f8e574 |
| 536 | .. _IBART: https://optee.mooo.com:5000 |
| 537 | .. _Java Native Interface: http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html |
| 538 | .. _Juno port: https://github.com/OP-TEE/optee_os/commit/90e7497e0480892e2c262cec64e6c47242d4db7f |
| 539 | .. _Keymaster: https://source.android.com/security/keystore |
| 540 | .. _linaro-swg: https://github.com/linaro-swg |
| 541 | .. _OP-TEE: https://github.com/OP-TEE |
| 542 | .. _OP-TEE OS Bugs: https://github.com/OP-TEE/optee_os/labels/bug |
| 543 | .. _OP-TEE OS Enhancements: https://github.com/OP-TEE/optee_os/labels/enhancement |
| 544 | .. _OP-TEE OS Issues: https://github.com/OP-TEE/optee_os/issues |
| 545 | .. _OP-TEE OS Pull Requests: https://github.com/OP-TEE/optee_os/pulls |
| 546 | .. _Raspberry Pi3 port: https://github.com/OP-TEE/optee_os/commit/66d9cacf37e6bd4b0d86e7b32e4e5edefe8decfd |
| 547 | .. _Riscure: https://www.riscure.com |
| 548 | .. _sample_hellojni.html: https://developer.android.com/ndk/samples/sample_hellojni.html |
| 549 | .. _Security Advisories: https://www.op-tee.org/security-advisories/ |
| 550 | .. _Shippable: https://app.shippable.com/github/OP-TEE/optee_os/dashboard |
| 551 | .. _TI DRA7xx port: https://github.com/OP-TEE/optee_os/commit/9b5060cd92a19b4d114a1ce8a338b18424974037 |
| 552 | .. _Travis: https://travis-ci.org/OP-TEE |
| 553 | .. _ZynqMP port: https://github.com/OP-TEE/optee_os/commit/dc57f5a0e8f3b502fc958bc64a5ec0b0f46ef11a |