-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core: arm: enable native interrupts before init calls #7262
Conversation
core/arch/arm/kernel/boot.c
Outdated
@@ -1069,8 +1069,15 @@ void __weak boot_init_primary_late(unsigned long fdt __unused, | |||
|
|||
boot_primary_init_intc(); | |||
init_vfp_nsec(); | |||
if (!IS_ENABLED(CFG_NS_VIRTUALIZATION)) | |||
if (!IS_ENABLED(CFG_NS_VIRTUALIZATION)) { | |||
if (IS_ENABLED(CFG_UNMASK_NATIVE_INTR_AT_BOOT)) { |
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.
Why not always enable this?
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.
Fair.
init_tee_runtime(); | ||
} |
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 should probably disable the interrupts again since entry_a64.S
doesn't expect interrupts to be enabled when boot_init_primary_late()
returns.
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.
Right. Then i'll unmask them back in boot_init_primary_final()
for call_driver_initcalls()
and call_finalcalls()
execution.
call_driver_initcalls(); | ||
} | ||
|
||
call_finalcalls(); |
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.
CFG_NS_VIRTUALIZATION
may also benefit from unmasked native interrupts during finalcalls.
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.
Right, I missed that. Thanks, i'll update.
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.
Reviewed-by: Jens Wiklander <[email protected]>
Enable native interrupts on Arm architectures when executing initcalls (early,service,driver,final). This change allows drivers to leverage interrupts during OP-TEE core initialization, as for example detecting a firewall access violation when it occurs. Before this change, OP-TEE needed to complete its initialization and return the secure monitor for secure interrupts to be handled. Note that when CFG_NS_VIRTUALIZATION is enabled, initcalls called from virt_on_stdcall() is not changed here since they are executing from a standard call entry hence with native and foreign interrupts already default unmasked. Signed-off-by: Etienne Carriere <[email protected]> Reviewed-by: Jens Wiklander <[email protected]>
1dcae02
to
af7060f
Compare
Fixup commits squashed and review tag applied. |
I forgot to say that I've changed the commit message body. Please cross-check that it still matches change description expectations. |
Looks good. :-) |
Enable native interrupts on Arm architecture before initcalls handlers are called. This change allows drivers to leverage interrupts during OP-TEE core initialization, as for example detecting a firewall access violation when it happens. Before this change, OP-TEE needed to complete its initialization and return the secure monitor for secure interrupts to be handled.
The feature is embedded upon config switch CFG_UNMASK_NATIVE_INTR_AT_BOOT and applies only when CFG_NS_VIRTUALIZATION is disabled. When CFG_NS_VIRTUALIZATION is enabled, early/service/driver initcalls already execute with native interrupts unmasked, from a standard call entry when the non-secure guest is registered.