This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARMV8 arch64 how to handle bus error and interrupt occur together

Hi expert,

After enabling TZC, both bus error and interrupt occur if the transaction is illegal. The software only processes the bus error by Synchronous(vector table), not entering the interrupt handle. And the system will get stuck

From TZC:

DDI0504C_tzc400_r0p1_trm.pdf

Set If an ACE-Lite transaction has insufficient security privileges, then for: decode error and raise an interrupt

This enables the issuing master to behave as though the memory location is absent. The TZC-400 presents a DECERR response and generates an interrupt

sync handler:

	.section DefaultHandleEL3, "ax"
	.balign 4
	.type default_handle_el3, "function"
default_handle_el3:
	msr spsel, #0
	STP x29, x30, [sp, #-16]!
	STP x18, x19, [sp, #-16]!
	STP x16, x17, [sp, #-16]!
	STP x14, x15, [sp, #-16]!
	STP x12, x13, [sp, #-16]!
	STP x10, x11, [sp, #-16]!
	STP x8, x9, [sp, #-16]!
	STP x6, x7, [sp, #-16]!
	STP x4, x5, [sp, #-16]!
	STP x2, x3, [sp, #-16]!
	STP x0, x1, [sp, #-16]!

	mrs x0, elr_el3
	add x0, x0, #4
	msr elr_el3, x0

	BL synchandler

	LDP x0, x1, [sp], #16
	LDP x2, x3, [sp], #16
	LDP x4, x5, [sp], #16
	LDP x6, x7, [sp], #16
	LDP x8, x9, [sp], #16
	LDP x10, x11, [sp], #16
	LDP x12, x13, [sp], #16
	LDP x14, x15, [sp], #16
	LDP x16, x17, [sp], #16
	LDP x18, x19, [sp], #16
	LDP x29, x30, [sp], #16
	ERET

IRQ handler:

	.section InterruptHandlers, "ax"
	.balign 4
	.type irq_handle_el3, "function"
irq_handle_el3:
	msr spsel, #0
	STP x29, x30, [sp, #-16]!
	STP x18, x19, [sp, #-16]!
	STP x16, x17, [sp, #-16]!
	STP x14, x15, [sp, #-16]!
	STP x12, x13, [sp, #-16]!
	STP x10, x11, [sp, #-16]!
	STP x8, x9, [sp, #-16]!
	STP x6, x7, [sp, #-16]!
	STP x4, x5, [sp, #-16]!
	STP x2, x3, [sp, #-16]!
	STP x0, x1, [sp, #-16]!

	BL sys_irq

	LDP x0, x1, [sp], #16
	LDP x2, x3, [sp], #16
	LDP x4, x5, [sp], #16
	LDP x6, x7, [sp], #16
	LDP x8, x9, [sp], #16
	LDP x10, x11, [sp], #16
	LDP x12, x13, [sp], #16
	LDP x14, x15, [sp], #16
	LDP x16, x17, [sp], #16
	LDP x18, x19, [sp], #16
	LDP x29, x30, [sp], #16
	ERET

Thanks.

Parents
  • I'm not sure what you mean by getting stuck. What does the sync handler to do?

    In terms of the interrupt, there are a couple of reasons you might not be seeing it:

    • When the PE takes the sync exception it will set PSTATE.I/F, masking interrupts if they're taken to the same EL as the sync exception
    • If an interrupt is routed to lower ELs (controlled by SCR_EL3 and HCR_EL2) then it is implicitly masked
    • Is the GIC set up to deliver the interrupt?  Have you checked whether the GIC is reporting the interrupt as the HPPI?
Reply
  • I'm not sure what you mean by getting stuck. What does the sync handler to do?

    In terms of the interrupt, there are a couple of reasons you might not be seeing it:

    • When the PE takes the sync exception it will set PSTATE.I/F, masking interrupts if they're taken to the same EL as the sync exception
    • If an interrupt is routed to lower ELs (controlled by SCR_EL3 and HCR_EL2) then it is implicitly masked
    • Is the GIC set up to deliver the interrupt?  Have you checked whether the GIC is reporting the interrupt as the HPPI?
Children