Skip to main content

Posts

Showing posts with the label optee_os

ARM Trustzone - An overview on how SMC calls are handled by the EL3 Monitor

In this write up, we will focus mainly on the ARMv8-A exceptions, the role of ARM Trusted Firmware (that provides Secure Monitor functionality) and how the World Switch happens between Secure and Normal. If we look on the the architectural diagram of ARM Trustzone w.r.t ARMv8-A, the Execution Level is divided into four levels namely: EL0 (Secure & Non-Secure) - User Application EL1 (Secure & Non-Secure) - Kernel EL2 - Hypervisor for running different OS's simuntaneously EL3 - Security Monitor Now, whenever a normal world User Application calls for some Secure Operation, the calls goes via IOCTL call to the Linux Driver, which ultimately calls the smc instruction. To understand what the smc instruction, we have to look on the Exceptions in ARMv8 ARMv8 Exceptions In ARMv8 the exceptions are divided into two categories: Synchronous & Asynchronous.  An exception is described as synchronous if it is generated as a result of execution or attempted executi...

Raspberry Pi 3 secure image building process

Here we will experiment with Raspberry Pi  3 Model B+ board. I have built some image for it using OPTEE manifest. I am currently using Ubuntu 16.04 OS. I have faced some dependency issue while building the complete set of images. Hardware required: 1. Raspberry Pi 3 Model B+ 2. USB to serial cable (BaudRate = 115200) 3. Power Cable or MicroUSB cable (I have drawn power from my PC) 4. Micro SD card formatted in FAT32 format. Serial Cable Connection with PI Refer to this diagram. PIN 6, 8 & 9 shall be used. In my case I have drawn power from my PC, hence I didn't required any GND connection. How to Build images: Prerequisite: Following dependencies need to be installed.: $ sudo apt-get install android-tools-fastboot autoconf bison cscope curl  flex gdisk libc6:i386 libfdt-dev libglib2.0-dev  libpixman-1-dev libstdc++6:i386 libz1:i386 netcat  python-crypto python-serial uuid-dev xz-utils zlib1g-dev libssl-dev curl repo vim $ sudo apt install py...