1. A method of executing instructions to simulate an input/output device in a computer system having a hardware processor that is operable in both a secure mode and a non-secure mode, comprising: while the hardware processor operates in the non-secure mode: executing, by the hardware processor, a first instruction accessing a first memory address, the execution of the first instruction causing a transition of the hardware processor from operating in non-secure mode to operating in secure mode; while the hardware processor operates in the secure mode: analyzing, by hardware processor, the accessed memory address to determine whether or not the accessed memory address corresponds to an input/output device not backed by hardware; if the accessed memory address corresponds to the input/output device not backed by hardware, then: interpreting, by the hardware processor, the first instruction; executing, by the hardware processor, one or more instructions to simulate behavior of the input/output device based on the interpreted instruction; and returning to operating in non-secure mode with access to a result of executing the one or more instructions.