Skip to contentSkip to conversation

Unchecked ipipe_test_pipeline_from

Adeos-main Jan Kiszka 3 participants 8 messages Nov 9, 2009 – Nov 10, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Introduce a debug-free ipipe_check_pipeline_from for rthal_local_irq_disabled?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu. So, it looks like rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Signature · 1 line
                                          Gilles
author
#2 lore raw
Quoted 10 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Quoted 3 lines

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 18 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Quoted 3 lines

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

Quoted 5 lines
Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

If it is debug stuff, does the heavy-weight matter that much?

Signature · 1 line
                                          Gilles
author
#4 lore raw
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Quoted 3 lines

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

If it is debug stuff, does the heavy-weight matter that much?

Actually, I'm no longer sure that a preemption check for ipipe_stall_pipeline_from makes sense at all. Am I missing some case?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#5 lore raw
Quoted 12 lines · Jan Kiszka
Quoted 11 lines · Gilles Chanteperdrix
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

A plain task over the root domain which is subject to a migration may end up testing the stall bit on the wrong (dest) CPU, which may execute a different domain than the one running on the source CPU. As soon as the domain is not a context invariant, you do have a serious issue coming up. So this does matter a lot, as the bug fixed some time ago in ipipe_check_context() showed.

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

If it is debug stuff, does the heavy-weight matter that much?

Actually, I'm no longer sure that a preemption check for ipipe_stall_pipeline_from makes sense at all. Am I missing some case?

Same as above. Albeit there may not be forced CPU migration over the Xenomai domain, this is perfectly possible on the root one.

Quoted 2 lines

Jan

Signature · 1 line
Philippe.
author
#6 lore raw
Quoted 16 lines · Philippe Gerum
Quoted 15 lines · Jan Kiszka
Quoted 14 lines · Gilles Chanteperdrix
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

A plain task over the root domain which is subject to a migration may end up testing the stall bit on the wrong (dest) CPU, which may execute a different domain than the one running on the source CPU. As soon as

Yeah, makes sense now (with source and dest swapped, though).

Quoted 8 lines

the domain is not a context invariant, you do have a serious issue coming up. So this does matter a lot, as the bug fixed some time ago in ipipe_check_context() showed.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If it is debug stuff, does the heavy-weight matter that much?

Actually, I'm no longer sure that a preemption check for ipipe_stall_pipeline_from makes sense at all. Am I missing some case?

Same as above. Albeit there may not be forced CPU migration over the Xenomai domain, this is perfectly possible on the root one.

OK, will fix the checks in RTDM then.

Jan

#7 lore raw
Quoted 22 lines · Jan Kiszka
Quoted 21 lines · Philippe Gerum
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

Hi Philippe,

just noticed: The __ipipe_check_percpu_access of __ipipe_get_cpu_var, added in 2.6.29, makes ipipe_test_pipeline_from unusable for debugging purposes. It now triggers a false positive warning if the caller did not disabled interrupts or stalled its pipeline. One such user under Xenomai is rthal_local_irq_disabled, and that is used to check RTDM driver handlers /wrt leaking IRQ masks.

Quoted 3 lines

It does not look like a false positive. If the task issuing the call to rthal_local_irq_disabled function was migrated at the wrong time, it could check the stall flag on the wrong cpu.

Unless you want to test the migration logic itself, a plain task in whatever domain should never see a CPU-depend rthal_local_irq_disabled - migration should never alter the context in this respect.

Quoted 5 lines
Quoted 3 lines

A plain task over the root domain which is subject to a migration may end up testing the stall bit on the wrong (dest) CPU, which may execute a different domain than the one running on the source CPU. As soon as

Yeah, makes sense now (with source and dest swapped, though).

Yes, I got it backward for the src/dst mention. The issue is indeed that the address of the status word on src gets computed before a migration is triggered to dst, so the action ends up being wrongly applied to src.

Quoted 26 lines
Quoted 9 lines

the domain is not a context invariant, you do have a serious issue coming up. So this does matter a lot, as the bug fixed some time ago in ipipe_check_context() showed.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

So, it looks like
rthal_local_irq_disabled should be fixed to turn off irqs during the check.

Would work, but would also be more heavy-weighted then needed.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

If it is debug stuff, does the heavy-weight matter that much?

Actually, I'm no longer sure that a preemption check for ipipe_stall_pipeline_from makes sense at all. Am I missing some case?

Same as above. Albeit there may not be forced CPU migration over the Xenomai domain, this is perfectly possible on the root one.

OK, will fix the checks in RTDM then.

Jan

_______________________________________________
Adeos-main mailing list
[email protected]
https://mail.gna.org/listinfo/adeos-main

Signature · 1 line
Philippe.