Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check vector number and pointer to ISR in "_isr_wrapper" routine for aarch64 #29776

Closed
vladimir-podbrezsky opened this issue Nov 4, 2020 · 1 comment
Assignees
Labels
area: ARM ARM (32-bit) Architecture area: Interrupt Controller Enhancement Changes/Updates/Additions to existing features

Comments

@vladimir-podbrezsky
Copy link

Problem description:
In file “Kconfig.defconfig.viper_bcm58402_a72” defined NUM_IRQS as 240. It the same time GIC may rise some special purpose interrupts in range 1020 up to 1023. These vectors are out of _sw_isr_table and it case to invoking of wrong function.
I propose to check

  1. GIC rises interrupt that is less than CONFIG_NUM_IRQS
  2. Pointer to ISR is not NULL.

For example, I added some lines to isr_wrapper.S as following

stp x0, x1, [sp, #-16]!
cmp x0, #CONFIG_NUM_IRQS				// new line 
b.hi spr						// new line 
lsl x0, x0, #4 /* table is 16-byte wide */

/* Retrieve the interrupt service routine */
ldr	x1, =_sw_isr_table
add	x1, x1, x0
ldp	x0, x3, [x1] /* arg in x0, ISR in x3 */
cmp	x3, #0x0					// new line 
b.eq spr						// new line 
/*
 * Call the ISR. Unmask and mask again the IRQs to support nested
 * exception handlers
 */
msr	daifclr, #(DAIFSET_IRQ)
blr	x3
msr	daifset, #(DAIFSET_IRQ)

spr: // new line

/* Signal end-of-interrupt */
ldp x0, x1, [sp], #16
@vladimir-podbrezsky vladimir-podbrezsky added the Enhancement Changes/Updates/Additions to existing features label Nov 4, 2020
@carlocaione
Copy link
Collaborator

Hi @vladimir-podbrezsky, can you open a proper PR with your changes so we can discuss there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture area: Interrupt Controller Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

3 participants