Could anyone give me the code to get the current secure state?
That's correct. EL2 is only supported in Non-secure state, therefore when in EL2 the core must be in Non-secure state.