US 12,353,538 B2
Method for executing a software program by a processing unit comprising a compilation phase
Michel Jaouen, Yvre l'Eveque (FR); Loic Pallardy, Rouillon (FR); and Ludovic Barre, Le Mans (FR)
Assigned to STMicroelectronics (Grand Ouest) SAS, Le Mans (FR)
Filed by STMicroelectronics (Grand Ouest) SAS, Le Mans (FR)
Filed on Nov. 22, 2022, as Appl. No. 18/058,130.
Claims priority of application No. 2112500 (FR), filed on Nov. 25, 2021.
Prior Publication US 2023/0161863 A1, May 25, 2023
Int. Cl. G06F 21/44 (2013.01)
CPC G06F 21/44 (2013.01) 19 Claims
OG exemplary drawing
 
1. A method comprising:
compiling, by a processor in a compiling phase, a software program intended to be executed by the processor, the processor having secure and non-secure access right level execution contexts, and privileged and non-privileged access right level execution contexts;
generating, in the compilation phase, instructions in machine language having an exclusively secure access right level when the instructions are intended to be executed in the secure access right level execution context, and instructions having a non-privileged access right level when the instructions are intended to be executed in the non-privileged access right level execution context,
wherein generating, in the compilation phase, the instructions comprises:
generating the instructions in the machine language irrespective of the execution contexts to which the instructions are intended to be executed, and
post-processing the generated instructions thereby replacing at least some generated instructions having an access right level not corresponding to an access right level of its execution context with instructions having the access right level corresponding to the access right level of its execution context,
wherein generating, in the compilation phase, the instructions comprises generating the instructions in the machine language from a source code in programming language, and
wherein post-processing is implemented on at least one group of instructions intended to be executed in the same execution context, the at least one group of instructions being selected in at least one of the following forms:
functions having a declaration communicating the selection in the source code in the programming language;
objects belonging to an intermediate object file, generated upon compilation; or
areas with contiguous memory addresses containing binary data encoding the machine language instructions, generated upon the compilation.