-
Notifications
You must be signed in to change notification settings - Fork 639
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
gicv3: Use split EOI mode #1183
base: master
Are you sure you want to change the base?
Conversation
a300a1e
to
4ec0ba0
Compare
I don't plan to add this support to the other GIC versions in this PR as there would be more substantial changes involved:
None of these are show-stoppers, but it'd be a fair amount of code changes and I don't think it's justified at this stage unless there was a cortex-a15 platform that really wanted the change. |
4ec0ba0
to
b1bc53a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the doRemoteDeactivatePrivateInterrupt
typo and the ifdef maze, it looks good.
Would be good to test this cross-core too though, either manually or with sel4test. But sel4test doesn't have the infrastructure to trigger IRQs on demand yet.
Agreed with not supporting GICv2. As for cross-core IRQ handling, if we add a way to change the affinity of an existing IRQ handler, I'm fine with disallowing cross-core interrupt acks. That way users will notice if they accidentally configured a system horribly wrong. |
I'm not convinced that RISC-V's |
One potential issue is with what happens if user-level keeps calling seL4_IRQHandler_Ack for the same interrupt.
Edit: I think that "writes to ICC_DIR_EL1 must be ignored" means that the hardware has to ignore writes to ICC_DIR_EL1 without an active corresponding interrupt in the distributor. So it's just a question of whether our platforms have implementations that generate system errors in this case.
|
767a00a
to
b3cc3f7
Compare
Separate priority drop from deactivation so that when the kernel delegates interrupts to userlevel, they can be left in the active state until user level performs the ack invocation which deactivates them. This is more efficient than doing a disable and enable operation for each handled interrupt as it is core local and doesn't require sending operations to the GIC distributor.. Signed-off-by: Kent McLeod <kent@kry10.com>
This is added for completeness, but it's not efficient for userlevel to deactivate PPI IRQs on different cores than they were received on. Signed-off-by: Kent McLeod <kent@kry10.com>
b3cc3f7
to
ff06645
Compare
The same document also says:
So perhaps |
maskInterrupt(false, irq); | ||
#endif | ||
#endif /* CONFIG_ARM_GIC_V3_SUPPORT */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the endif
is this close to the if
I would drop the comment as it only makes things messy and it's clear enough without it.
#ifdef CONFIG_ARM_GIC_V3_SUPPORT | ||
doRemoteDeactivatePrivateInterrupt(IRQT_TO_CORE(irq), IRQT_TO_IDX(irq)); | ||
#else /* CONFIG_ARM_GIC_V3_SUPPORT */ | ||
doRemoteMaskPrivateInterrupt(IRQT_TO_CORE(irq), false, IRQT_TO_IDX(irq)); | ||
#endif /* CONFIG_ARM_GIC_V3_SUPPORT */ | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of pattern in generic code will make it impossible for us to switch between GICv2 and GICv3 in verification without making it an entire new architecture. Can this be put behind a generic interface that both GIC versions implement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem is that the current IRQ model doesn't match reality enough and we need to extend maskInterrupt()
with something like kernelAckInterrupt()
and userAckInterrupt()
, with remote equivalent functions.
Then all the ifdeffery is moved to arch code instead of generic code.
#ifdef CONFIG_ARM_GIC_V3_SUPPORT | ||
deactivateInterrupt(irq); | ||
#else /* CONFIG_ARM_GIC_V3_SUPPORT */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, having ARM config dependent ifdefs in generic code will make generic proofs impossible -- it's fine for those that we're not planning to ever verify, but GICv3 does sound like something we'd want pretty soon.
#if !defined(CONFIG_ARCH_RISCV) && !defined(CONFIG_ARM_GIC_V3_SUPPORT) | ||
maskInterrupt(true, irq); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do this much in the kernel usually, but would it work to use an actual if
instead of conditional compilation/preprocessor here? Then we can follow both paths in the verification and it'll work either way. IIRC, the compiler should optimise out any if (0)
cases.
Separate priority drop from deactivation so that when the kernel
delegates interrupts to userlevel, they can be left in the active state
until user level performs the ack invocation which deactivates them.
This is more efficient than doing a disable and enable operation
for each handled interrupt as it is core local and doesn't require
sending operations to the GIC distributor.