Skip to content

core: kernel: allow not masking interrupts on output traces#7705

Open
etienne-lms wants to merge 1 commit intoOP-TEE:masterfrom
etienne-lms:console-lock2
Open

core: kernel: allow not masking interrupts on output traces#7705
etienne-lms wants to merge 1 commit intoOP-TEE:masterfrom
etienne-lms:console-lock2

Conversation

@etienne-lms
Copy link
Contributor

Add configuration switch CFG_TEE_CONSOLE_UNLOCKED to evacuate trace messages without masking interrupts. This configuration can be handy to still benefit from OP-TEE threads output console trace support without affecting native and foreign interrupts handling latency.

Enabling the configuration does not fully prevent collision of trace messages: a trace message from an non-thread context can still be interrupted by a message from a interrupt context.

By the way, add an initial value to local variable p in trace_ext_puts().

@etienne-lms
Copy link
Contributor Author

Follow up of #6727.

@jforissier
Copy link
Contributor

Sorry I did not look at the code just the description -- can the description be clearer about which message can possibly get mixed up when the new config is enabled? If I'm not mistaken, we have: thread context, non-thread non-interrupt context, and interrupt context, right?

@etienne-lms
Copy link
Contributor Author

etienne-lms commented Feb 12, 2026

I assume a non-thread context cannot be interrupted. These comprise async interrupts as well as fastcall SMCs. Did I miss something?

@etienne-lms
Copy link
Contributor Author

Updated.

Copy link
Contributor

@jenswi-linaro jenswi-linaro left a 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 <jens.wiklander@linaro.org>

@etienne-lms etienne-lms force-pushed the console-lock2 branch 3 times, most recently from 085d70c to 40e6a92 Compare February 16, 2026 14:26
@jforissier
Copy link
Contributor

Thanks for updating the description and the comment in config.mk. Now it's clear 😉

Acked-by: Jerome Forissier <jerome.forissier@arm.com>

Add configuration switch CFG_CONSOLE_MASK_INTERRUPTS define whether
or not interrupts are masked when console trace messages are
emitted. The config switch is default enabled to reflect core legacy
behavior.

Disabling this configuration switch can be handy to still benefit from
OP-TEE threads output console trace support without adding extra
latency to native and foreign interrupts handling when trace messages
from interruptible thread context are emitted.

Enabling the configuration does not fully prevent collisions
of trace messages as described in mk/config.mk.

By the way, add an initial value to local variable p in trace_ext_puts().

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@arm.com>

static bool wait_if_trace_contended(uint32_t *itr_status)
{
bool was_contended = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is wrong with "contended" instead of "was_contended"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants