sancus-tee / sancus-core

Minimal OpenMSP430 hardware extensions for isolation and attestation
BSD 3-Clause "New" or "Revised" License
20 stars 14 forks source link

Add CPUID-like instruction #3

Open jovanbulck opened 7 years ago

jovanbulck commented 7 years ago

To facilitate portable Sancus application code, we should add a CPUID-like instruction that returns at least:

jovanbulck commented 6 years ago

We can use the Special Function Registers (SFRs) located in the lower 16 bytes of the address space. Specifically, the openMSP430 core features a 32-bit read-only CPUID register from address 0x0004. Including a 5-bit USER_VERSION that we could use to encode the Sancus security level.

jovanbulck commented 6 years ago

And there's 3 more bits in the CPU_VERSION field. The current sancus-core is based on openMSP430 v2, and upstream openMSP430 is currently at version 3. We could thus encode the "Sancus version number" from 0x7 downwards to try and avoid clashes with openMSP430 version numbers.

jovanbulck commented 6 years ago

For future reference: core configuration details can also be recognized/printed in openmsp430-loader by editing omsp_alias.xml.