Could anyone give me the code to get the current secure state?
There isn't really a simple way to do this. You could infer it by accessing one of the Secure only System registers. If the access succeeds you are in Secure state, if it Undefs then you aren't(*).
One explanation for which there isn't an easy way to do this is that software generally already knows. This is Hypervisor code, therefore currently in Non-secure state at EL2. This is Secure Firmware code, therefore currently in EL3.
(* It's actually a little more tricky than that, as the access could also fail due to insufficient privilege).
I could not access Secure monitor code. But, exception level of my machine is EL2 on bootloader.
According to ARM Cortex -A53 MPCore Processor TRM, 3.2.6 ARMv8 security model, "EL2 exists only in Non-secure state."
And then, is it Non-secure state certainly?
That's correct. EL2 is only supported in Non-secure state, therefore when in EL2 the core must be in Non-secure state.