Repository navigation
Conversation
In _tx_initialize_kernel_enter (common_smp/src/tx_initialize_kernel_enter.c),
the kernel waits for secondary cores to become ready with a loop:
do { ... } while (other_core_status != ((ULONG) 0));
On the SMP Linux port, virtual cores are simulated rather than backed by hardware
secondary cores. TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION (tx_port.h:427)
zeroes _tx_thread_system_state[1 .. TX_THREAD_SMP_MAX_CORES-1] on core 0 before
the loop begins, causing the loop condition to evaluate to false on the first
pass.
To force both outcomes of the loop-back branch in coverage reports, the port's
TX_REGRESSION_TEST block defined TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATION to fold
core 0's own _tx_thread_system_state[0] into other_core_status and clear it. This
artificially forced a second loop pass, misrepresenting the loop-back branch as
covered when the port cannot exercise it.
Dropped the TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATION macro from the
TX_REGRESSION_TEST block in ports_smp/linux/gnu/inc/tx_port.h, falling back to
its default empty definition in common_smp/inc/tx_api.h. Line 167 remains 100%
line-covered while the coverage report accurately reflects that the loop-back
edge is unreached on this simulated port.
Verified with the full SMP regression suite: all 118 ctest cases pass cleanly.
Fixes: eclipse-threadx#768
Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
_tx_initialize_kernel_enter, the kernel waits for secondary cores to complete initialization by checking_tx_thread_system_state[1 .. TX_THREAD_SMP_MAX_CORES-1]. On the Linux SMP simulator port, these slots are cleared on core 0 byTX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATIONjust before the loop starts. Because there are no secondary hardware boot cores in this simulator, the loop condition evaluates to false on the first pass and the loop-back branch is never taken.To show both outcomes of the loop branch in test coverage reports,
ports_smp/linux/gnu/inc/tx_port.hdefinedTX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATIONunderTX_REGRESSION_TESTto fold core 0's own system state into the accumulator and reset it. This artificially forced a second pass through the loop, masking the fact that the port does not actually exercise that wait path.This change removes the
TX_PORT_SPECIFIC_MEMORY_SYNCHRONIZATIONmacro from the regression test block inports_smp/linux/gnu/inc/tx_port.h. The macro now falls back to its default empty definition incommon_smp/inc/tx_api.h. Full line coverage is maintained acrosstx_initialize_kernel_enter.c, the coverage report truthfully reflects that the loop-back branch is not taken on this simulated port, and all 118 SMP regression tests pass cleanly.Fixes #768