0

Can I open OP-TEE using QEMU-KVM without trustzone CPU emulation instead of TCG?

I add enable-kvm option and turn off trustzone CPU emulation in QEMU command (Since KVM doesn't support trustzone) As expected, it can't boot. But it seems the BL1 (assigned as BIOS in QEMU option) isn't be executed. I'm curious about whether there is some check to ensure that BL1 is executed in EL3 before bl1_entrypoint.S being executed?

  • With KVM you can't emulate EL2 or EL3. So any guest code that expects to execute at those exception levels will likely crash pretty early if you try to run it at EL1. I don't imagine it's checking explicitly, it will just be trying to access a system register that is EL3-only. – Peter Maydell Aug 09 '23 at 17:38
  • @PeterMaydell Thanks a lot for your response. Maybe I should try to emulate system register of EL3 in QEMU. But it seems like the bootloader binary I provide for QEMU through `--bios` wasn't even be executed, is KVM with QEMU won't execute BIOS even I provide one? – lastages Aug 10 '23 at 05:09
  • If you want to execute guest code at EL3, just use TCG -- it already supports emulation of EL3. There is no support for EL3 with KVM. I'm pretty sure there are tutorials out there on how to run OP-TEE under QEMU, so find and follow one of those. – Peter Maydell Aug 10 '23 at 09:19

0 Answers0