[dovetail][PATCH v3 0/3] Fix state corruption on fault migration, cleanups

2021-06-06 Thread Jan Kiszka via Xenomai
Changes in v3: - do not track oob stalling on iryentry - add check that oob is unstalled on irqentry Jan Jan Kiszka (3): irq_pipeline: Clean up stage_info field and users irq_pipeline: Account for stage migration across faults irq_pipeline: Warn when calling irqentry_enter with oob stalle

[dovetail][PATCH v3 3/3] irq_pipeline: Warn when calling irqentry_enter with oob stalled

2021-06-06 Thread Jan Kiszka via Xenomai
From: Jan Kiszka Something must have went wrong if entering for an IRQ or an exception over oob and with this stage stalled. Warn when debugging Suggest-by: Philippe Gerum Signed-off-by: Jan Kiszka --- kernel/entry/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/entry/comm

[dovetail][PATCH v3 1/3] irq_pipeline: Clean up stage_info field and users

2021-06-06 Thread Jan Kiszka via Xenomai
From: Jan Kiszka This field represents mutually exclusive states, namely - IRQENTRY_INBAND_UNSTALLED - IRQENTRY_INBAND_STALLED - IRQENTRY_OOB Encodes them as enum and test against them, rather than against state bits that suggest they could be combined. Also flip the inverted naming of INBAND_

[dovetail][PATCH v3 2/3] irq_pipeline: Account for stage migration across faults

2021-06-06 Thread Jan Kiszka via Xenomai
From: Jan Kiszka We need to unstall the inband stage when we entered for a fault over OOB and then migrated to inband. So far we kept the inband stage stalled, causing a state corruption this way. Signed-off-by: Jan Kiszka --- kernel/entry/common.c | 6 -- 1 file changed, 4 insertions(+),

Re: [PATCH] irq_pipeline: Prevent returning to user space with pending inband IRQs

2021-06-06 Thread Jan Kiszka via Xenomai
On 06.06.21 16:43, Philippe Gerum via Xenomai wrote: > > Jan Kiszka writes: > >> From: Jan Kiszka >> >> The correct order is hard IRQs off first, then stalling inband, see also >> I-pipe. Otherwise, we risk to take an interrupt for the inband stage but >> do not inject it before returning to us

Re: On update to 3.1, select() starts returning errno == EADV

2021-06-06 Thread Jan Kiszka via Xenomai
On 06.06.21 21:24, steve freyder via Xenomai wrote: > Hello Xenomai group, > > We're in the process of moving from Xenomai 3.0.7/4.1.18 to > 3.1/4.14.85.  Testing one of our apps we found that select() was > returning -1 with errno == EADV.  This app was written before we knew > about the recommen

On update to 3.1, select() starts returning errno == EADV

2021-06-06 Thread steve freyder via Xenomai
Hello Xenomai group, We're in the process of moving from Xenomai 3.0.7/4.1.18 to 3.1/4.14.85.  Testing one of our apps we found that select() was returning -1 with errno == EADV.  This app was written before we knew about the recommendation from Philippe contained in this message: https://x

Re: [PATCH] irq_pipeline: Prevent returning to user space with pending inband IRQs

2021-06-06 Thread Philippe Gerum via Xenomai
Jan Kiszka writes: > From: Jan Kiszka > > The correct order is hard IRQs off first, then stalling inband, see also > I-pipe. Otherwise, we risk to take an interrupt for the inband stage but > do not inject it before returning to user space. > > Signed-off-by: Jan Kiszka > --- > > Fixes the RC

Re: [v5.13.y-dovetail][PATCH 2/2] irq_pipeline: Account for stage migration across faults

2021-06-06 Thread Philippe Gerum via Xenomai
Jan Kiszka writes: > On 05.06.21 09:54, Philippe Gerum via Xenomai wrote: >> >> Jan Kiszka writes: >> >>> From: Jan Kiszka >>> >>> We need to unstall the inband stage when we entered for a fault over OOB >>> and unstalled and then migrated to inband. So far we kept the inband >>> stage stalle

[v5.13.y-dovetail][PATCH v2 2/2] irq_pipeline: Account for stage migration across faults

2021-06-06 Thread Jan Kiszka via Xenomai
From: Jan Kiszka We need to unstall the inband stage when we entered for a fault over OOB and then migrated to inband. So far we kept the inband stage stalled, causing a state corruption this way. Introduce an additional state to irqentry_info, tracking the stalling state on OOB entry. It should

Re: [v5.13.y-dovetail][PATCH 2/2] irq_pipeline: Account for stage migration across faults

2021-06-06 Thread Jan Kiszka via Xenomai
On 05.06.21 09:54, Philippe Gerum via Xenomai wrote: > > Jan Kiszka writes: > >> From: Jan Kiszka >> >> We need to unstall the inband stage when we entered for a fault over OOB >> and unstalled and then migrated to inband. So far we kept the inband >> stage stalled, causing a state corruption thi

[PATCH] irq_pipeline: Prevent returning to user space with pending inband IRQs

2021-06-06 Thread Jan Kiszka via Xenomai
From: Jan Kiszka The correct order is hard IRQs off first, then stalling inband, see also I-pipe. Otherwise, we risk to take an interrupt for the inband stage but do not inject it before returning to user space. Signed-off-by: Jan Kiszka --- Fixes the RCU stalls Florian reported, at least for