I'm trying to make HVC instruction trap to EL2 but for some reason, it doesn't work. IIUC rpi3 CPUs start at EL2 (at least that is what I see in CurrentEL), so basically the only thing I need to do is to set vbar_el2 to point into proper exception vector table and that's it - not much space to make a mistake.
Unfortunately, when my EL1 code executes hvc #0 it doesn't trap into my EL2 handler. Interesting thing is that RPI3 doesn't crash, hangs or breaks in any other visible way and just returns execution to the caller, which makes me think that hvc traps somewhere (maybe in EL3?) just not to my EL2 handler.
I also should mention that the same code works in QEMU without any visible problems.
Any thoughts on how to approach this problem and make hvc work on RPI3?