Commit graph

4 commits

Author SHA1 Message Date
Ederson de Souza 7f0b5edd8c arch/x86: Make irq_offload SMP-safe on x86_64
The irq_offload mechanism was using the same entry of the IDT vector for
all CPUs on SMP systems. This caused race conditions when two CPUs were
doing irq_offload() calls.

This patch addresses that by adding one indirection layer: the
irq_offload() now sets a per CPU entry with the routine and parameter to
be run. Then a software interrupt is generated, and a default handler
will do the appropriate dispatching.

Finally, test "kernel/smp_abort" is enabled for x86 as it should work
now.

Fixes #72172.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-06-04 07:57:06 +02:00
Peter Mitsis 283d4133fa tests: thread abort deadlock scenario
Adds a test to verify that a series of k_thread_abort() issued from
ISRs do not cause a deadlock.

Filtered on x86 as the x86_64 irq_offload() implementation isn't
SMP-safe.  See #72172

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-05-02 13:55:03 -04:00
Alberto Escolar Piedras 17b4e6cc98 Revert "tests: thread abort deadlock scenario"
This reverts commit 9f4d9989c6.

This PR introduced 2 regressions in main CI:
71977 & 71978
Let's revert it by now to get main's CI passing again.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-26 10:10:24 +00:00
Peter Mitsis 9f4d9989c6 tests: thread abort deadlock scenario
Adds a test to verify that a series of k_thread_abort() issued from
ISRs do not cause a deadlock.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-25 15:12:02 +02:00