- 22 Jul, 2021 4 commits
-
-
Jan Kiszka authored
When running in QEMU, the 5 ms holding time of mutex_timed_locker may be too short when the host is busy. This occasionally leads to failing tests in our CI: posix-mutex.c:510, FAILED: get_effective_prio() == prio (=false) Expand to 50 ms in such setups. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
RTTST_RTIOC_RTDM_DEFER_CLOSE causes a 300 ms delay by the driver. We only added 1 ms plus the open/close of the second device, and that was sometimes too short when running in QEMU: 2021-06-18T18:58:41 FAILED run_rtdm:186: open returned -16 instead of 12 - Device or resource busy Make it 100 ms in that case, to be safe. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
At least on ARM, an illegal instruction event that could also mean "breakpoint" can become an FPU event after analyzing it in xnarch_handle_fpu_fault. Avoid registering the process as being stopped for debugging first - this would be false alarm, and it would not be unregistered any time soon. This was exposed by the ptrace helper addition. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 07 Jul, 2021 1 commit
-
-
The space allocated for irq stats in xnintr_init() will not be freed by rtdm_irq_free(), because it just calls xnintr_detach(). Replacing it with xnintr_destroy() fixes the issue. Signed-off-by:
Wolfgang Grandegger <wg@grandegger.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 05 Jul, 2021 14 commits
-
-
Jan Kiszka authored
The core assumes in some places that CPU 0 is available for real-time. Therefore fail if the mask is excluding it. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Scheduling a thread on a CPU that is not supported by Xenomai will only fail and flood the screen with error messages. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
The I-pipe implementation was lucky in its approach to not wake up the RT thread in case the non-RT part migrated to an unsupported CPU. For unclear reasons, the scheduled cancellation made it to the thread and avoided any lockup. On dovetail, this fails. So switch both implemenations to the safer pattern of actually completing the migration, using the previous affinity of the thread. It will still be canceled right after that, now also over dovetail. As cobalt_affinity_ok's return value becomes irrelevant, refactor this function to cobalt_adjust_affinity without and return code. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
__this_cpu_read will generate a warning when called by print_core_clock_status because the context is detected as preemptible. Avoid this by picking up the name from CPU 0, just like ipipe_timer_name did. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Rather than duplicating lots of code for the sake of compat userspace accesses, provide a common version that is given a flag to decide whether to take the compat or regular code paths. This also brings restart support to the compat selection version which was forgotten by 36132cdb . Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
There is no use for this outside of the core that implements select. So stop exporting these helpers. As there are no users outside, simplify their return value on success to 0 because their callers do not care about more. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Commit 36132cdb forgot to align this with the native syscall. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Since rtdm_fd_select started to return EADV for unknown fds (2db562ad ), we were returning that code to applications in case a selector had been allocated for the caller already. That was because libcobalt lacked handling of this error. This fixes it and also establish proper signaling of EBADF in case the is a real error related to an RTDM fd. For that purpose, detect if __cobalt_select_bind_all got EADV for the first fd or for a succeeding one, i.e. on an unsupported mixed fd set. Also return EADV if the early __cobalt_first_fd_valid_p test fails. That ensures that we only retry with the regular Linux call when it makes sense. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
2db562ad had a point in avoiding EBADF for file descriptors that are not under RTDM management. But it unfortunately got a lot of other cases wrong along this. This one is about returning the right error code if an RTDM driver does not implement a particular handler. That must never be EADV because that error would signal "not an RTDM fd, retry with Linux" which is obviously wrong. Even worse, mmap clearly defines the right error to return in case it is not implemented, and that is ENODEV as was returned before. So this restores ENODEV as invalid default for mmap, uses ENOTTY for unimplemented IOCTL and switches all others to EBADF which is a match for select and a reasonable choice for read/write/recvmsg/sendmsg. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
It also returns -EADV since 2db562ad - causing troubles in select. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
It worked, but it is not nice to read. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Already at the time of introduction (8ac3db81 ), -ENOENT was not returned by any sane function behind rtdm_fd_select(). Today rtdm_fd_select() officially only returns -EBADF or -EINVAL. By now it also returns -EADV, via rtdm_fd_get() or a default select handler. The only remaining possibility for -ENOENT is a select handler. In-tree, a4l_rt_select actually has such a case, but for no sane reason this or any out-of-tree driver case should receive special handling here. Remove this case, these is also no need for the select_bind_one wrapper anymore. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This caused random values in those vars, and that led to premature leaving of __bufp_readbuf and __bufp_writebuf with waiter states not properly updated, e.g. Fixes: 0a67a85b ("drivers/ipc: bufp: fix rd/rd and wr/wr races") Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 02 Jul, 2021 4 commits
-
-
Jan Kiszka authored
Add rtdm_irq_request_affine and rtdm_irq_set_affinity to start IRQs or specific CPUs or move them around. So far, this was unsupported and made users bypass layer to configure the desired affinity. Starting with the right affinity also avoids hitting the wrong CPU at least once before the IRQ can be live-migrated. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This allows to start up interrupts with a specific affinity already set. Will be used by a new RTDM service. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This function should respect the supported cpu set and report an error if the specified set has no intersection with it. It should also return potential errors for the underlying pipeline code. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Passing a potentially large mask by value was a bad idea of I-pipe. Dovetail uses the kernel API, and that does it right. So adjust our internal abstraction - which is unused so far anyway. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 18 Jun, 2021 1 commit
-
-
Jan Kiszka authored
This is needed when there is not userspace-readable clocksource available. This can happen under Dovetail where Linux selects the suitable clocksource and may see problems with, e.g., the TSC under x86. When it then switches to a clocksource that require a syscall, we so far migrate to Linux on every access. This handler resolves that problem. It's not needed under I-pipe where clock_gettime is not routed through the vDSO and the clocksource is separate. Therefore, we simply never match on the related syscall numbers under I-pipe. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 16 Jun, 2021 1 commit
-
-
Add missing sigarray initialization to avoid missing signal in __xnthread_signal. Signed-off-by:
Hongzhan Chen <hongzhan.chen@intel.com> [Jan: simplify size calculation] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 15 Jun, 2021 3 commits
-
-
Jan Kiszka authored
Same pattern as for previous changes: All that code it common, no need to duplicate it. The only difference was that I-pipe needs to call ipipe_disable_user_intret_notifier first while dovetail does this disabling automatically. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Same pattern as for previous changes: All that code it common, no need to duplicate it. The only difference between the two versions of handle_cleanup_event was what is now encapsulated in pipeline_cleanup_process. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Same pattern as for previous changes: All that code it common, no need to duplicate it. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 14 Jun, 2021 2 commits
-
-
Jan Kiszka authored
Those functions are identical now, with the variations due to some older I-pipe releases removed. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
All those events have been added long ago to I-pipe versions we want to support with the next release. Time to drop the tests which will also allow sharing some code with dovetail. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 11 Jun, 2021 10 commits
-
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
I-pipe makes sure that arguments of compat calls are ordered just like native calls. Dovetail does not. But it is better to use the kernel's syscall_get_arguments for retrieving the arguments anyway. Introduce pipeline_get_syscall_args to abstract that difference. Xenomai/ARM syscalls have an unconventional argument marshalling, with ARM_ORIG_r0 containing the Xenomai syscall number (ORed with __COBALT_SYSCALL_BIT), followed by the first actual argument to the syscall in ARM_r1. For this reason, using syscall_get_arguments() to collect the syscall parameters won't yield the expected result, with regs[0] matching __xn_reg_sys(regs) instead of __xn_reg_arg1(regs). Allow Dovetail-enabled architectures to override the generic implementation of pipeline_get_syscall_args(), provide a working one for ARM. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> [Philippe: add special handling of ARM] Signed-off-by:
Philippe Gerum <rpm@xenomai.org>
-
At this chance, fix stale and missing copyright notices. Specifically, Dmitriy Cherkasov <dmitriy@mperpetuo.com> is the original author of the Xenomai/arm64 port, based on the ARM implementation; add credit where it is due. In the same move, introduce SPDX tags as replacement for GPL boilerplate for the altered files. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Unlike the I-pipe, Dovetail does not need to expose the underlying timestamp counter to applications. The best equivalent to this counter would be the common monotonic clock, expressing time as a count of nanoseconds. Fork the implementation accordingly between Dovetail and I-pipe configurations, depending on which pipeline flavour was detected at init. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Expiration dates of in-band timers are based on the monotonic time base read by ktime_get(), which is ok for us to use from non-NMI context. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
When Dovetail is enabled in the kernel, we get timestamps for common clocks (CLOCK_REALTIME, CLOCK_MONOTONIC) from the vDSO-based gettime() routine as usual. Do not expect KUSER_TSC support to be there in such a case, it is not. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
When Dovetail is enabled in the kernel, we get timestamps for common clocks (CLOCK_REALTIME, CLOCK_MONOTONIC) from the vDSO-based gettime() routine as usual. Do not expect KUSER_TSC support to be there in such a case, it is not. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This is needed as cobalt_arch_check_features() will make use of __cobalt_tsc_clockfreq via cobalt_use_legacy_tsc(). Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
The license notice for arch/arm/dovetail/machine.c is fixed in order to match the remaining code, which is [1] for the prefaulting handler, and myself for the rest. [1] from Xenomai v2.5-rc1: commit 8421cc62 Author: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> Date: Sat Nov 15 23:45:24 2008 +0000 Fault heaps memory on ARM Signed-off-by:
Philippe Gerum <rpm@xenomai.org> [Jan: style fix] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-