If you are running at EL1, one thing to watch out for is the interrupt priority view of a non-secure group 1 interrupt. The following is from the GIC doc:
For Non-secure writes to a priority field of a Non-secure Group 1 interrupt, before storing the value:
• The value is right-shifted by one bit.
• Bit [7] of the value is set to 1.
This translation means the priority value for the Non-secure Group 1 interrupt is in the bottom half of the priority range.
If your hardware implements 5 priority bits (32 unique priorities) and you want to set a non-secure group 1 interrupt’s priority to 18 (it can be greater than 16 only to ensure that it is in the bottom half range), you should use the following value:
( 18 << 4 ) & 0xFF
instead of
( 18 << 3 ) & 0xFF
Thanks.