摘要 |
A data processing apparatus and method of data processing are provided which make use of a processor state check instruction to determine if the data processing apparatus is currently operating in a processor state, defined by at least one runtime processor state configuration value, which matches a processor state check value defined by the processor state check instruction. Dependent on the runtime processor state configuration value matching the processor state check value, the processor state check instruction is treated as an ineffective instruction, such as a no operation instruction (78 in Figure 5). When the runtime processor state configuration value does not match the processor state check value, an exception is generated, such as an illegal instruction exception (80 in Figure 5). This facilitates improved security of the data processing apparatus. The processor state may comprise an exception level, a debug state, and/or a privilege mode. The instruction may be implemented as a mode assert instruction (Figure 3A). |