- 11 Jan, 2021 3 commits
-
-
François LEGAL authored
The RTNET sendmsg/recvmsg protocol handlers used to call copy_to/from_user on the struct user_msghdr argument. The syscall entry code already does this copy, so calling again the copy_to/from_user in handlers triggers SPECTRE mitigation protection on ARM. This patch removes the calls in the handlers. This patch has not been tested Signed-off-by:
François LEGAL <devel@thom.fr.eu.org> [Jan: massage commit log] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
François LEGAL authored
The RTNET sendmsg/recvmsg protocol handlers used to call copy_to/from_user on the struct user_msghdr argument. The syscall entry code already does this copy, so calling again the copy_to/from_user in handlers triggers SPECTRE mitigation protection on ARM. This patch removes the calls in the handlers. This patch has not been tested Signed-off-by:
François LEGAL <devel@thom.fr.eu.org> [Jan: massage commit log] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
François LEGAL authored
The RTNET sendmsg/recvmsg protocol handlers used to call copy_to/from_user on the struct user_msghdr argument. The syscall entry code already does this copy, so calling again the copy_to/from_user in handlers triggers SPECTRE mitigation protection on ARM. This patch removes the calls in the handlers. This patch has been tested with 4.4.x kernel Signed-off-by:
François LEGAL <devel@thom.fr.eu.org> [Jan: massage commit log] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 11 Dec, 2020 7 commits
-
-
Philippe Gerum authored
Concurrent timer start vs start, or start vs stop operations may end up confusing the logic, like: - a periodic timer being reinserted into the dispatch queue while disabled. - dirty reads of inconsistent ( date, interval, handler ) triplets by the dispatch loop, as the timer properties are being updated concurrently. Fix this by moving all updates to the timer properties under the protection of the dispatch lock (svlock), likewise for loads. Issue reported by Ronny Meeus, with a preliminary fix: https://xenomai.org/pipermail/xenomai/2020-December/043907.htmlSigned-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Philippe Gerum authored
Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Philippe Gerum authored
We have no more in-tree users of these. Besides, let's assume that the CPU's branch predictor always has better clues than we might have when assessing the likeliness of a condition. Bonus: this clears a recurring source of namespace clashes with C++ frameworks like Boost. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Philippe Gerum authored
In user-space at least, we'd be better off trusting the CPU's branch predictor, instead of relying on our limited perception when it comes to determining the likeliness of a condition, or every compiler to do the right thing with respect to efficient branching. We only have a few unlikely predictions in-tree on straightforward conditions, which we can remove safely: - POSIX condvars wait/signal loops on x86, arm and arm64 showed no observable performance penalty. - other callers from the thread cancellation path, or debug instrumentation are slow paths in essence anyway. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Philippe Gerum authored
We want to wait for ^C or any hangup condition received from the root stage, make sure to annotate as __STD(sigwait()) to bypass symbol wrapping. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Philippe Gerum authored
Uninstall udev rules. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
We migrated to gitlab-ci now, and the travis script will only bitrot over the time. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 17 Nov, 2020 2 commits
-
-
Florian Bezdeka authored
The feature initialization was arch specific up to now and the available features (= features offered by the currently running kernel) were no longer accessible once the bind syscall finished. This patch introduces a simple API for fetching the offered features during runtime. Signed-off-by:
Florian Bezdeka <florian.bezdeka@siemens.com> [Jan: simplify cobalt_features_available] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Florian Bezdeka authored
cobalt_check_features is implemented for each architecture. As further feature initialization will arrive the name of the function should clarify that. Signed-off-by:
Florian Bezdeka <florian.bezdeka@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 12 Nov, 2020 1 commit
-
-
Florian Bezdeka authored
Updating to upstream revision f858275f7f307eecba84c2f5429483f9f28007f8. Upstream repository is located at [1]. The reason for updating was the following compiler error when trying to compile with GCC 10.2 10.2.1 20201016. As it turned out the problem was already addressed upstream: iniparser/iniparser.c: In function ‘iniparser_load’: iniparser/iniparser.c:616:13: error: ‘sprintf’ arguments 3, 4 may overlap destination object ‘buf’ [-Werror=restrict] 616 | sprintf(tmp, "%s:%s", section, key); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I reviewed especially the API changes. Most of them are cleanups only but two things should be pointed out: - The type of the size field of struct _dictionary_ changed from int to ssize_t. The only user of this struct is lib/analogy/calibration.c which uses this structure for internal things only. It is never exposed to any public API so updating is OK and fully backward compatible. - dictionary_new changed its signature from dictionary_new(int size) to dictionary_new(size_t size). This function is not part of any public API. So updating does not break backward compatibility. [1] https://github.com/ndevilla/iniparserSigned-off-by:
Florian Bezdeka <florian.bezdeka@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 26 Oct, 2020 12 commits
-
-
Jan Kiszka authored
Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
As the Xenomai libs hook into the option parser and hijack --help, we need to provide application_usage() in order to get the full help printed. Needs eventually a better fix, i.e. the removal of the implicit parser hook. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
A compatible keyword is "fallthrough", use that and add it one missing spot in cobalt_sched_policy_param. Doesn't make all gcc versions happy yet, but that's a compiler issue. At least gcc-9 is fine. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Not desired here according ancient git logs. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Apparently not desired but likely harmless. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
This was folded into spin_unlock, thus obsoleted. Keep it for older kernels. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
linux/pci-aspm.h has been folded into linux/pci.h in that version. Account for that in drivers that actually need it. Furthermore, our implementation of SO_SNDTIMEO is now SO_SNDTIMEO_OLD until 2038 has been addressed. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Use the *_OLD defines for the 2038-wise unconverted socket options. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Since that version, the FPU is only updated when returning to userspace. This breaks the thread switching expectations of Xenomai because there is no update happening when returning to a thread in primary mode or when switching in a primary-mode kernel thread. Account for that by - saving the context when switching out an in-kernel Xenomai thread - restoring the context after switching in a Xenomai thread - invalidate the FPU state variables after returning to a preempted Linux kernel thread that uses the FPU Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Fino Meng authored
Signed-off-by:
Fino Meng <fino.meng@linux.intel.com> Signed-off-by:
Mingliang Hu <mingliang.hu@intel.com> [Jan: reformat] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Fino Meng authored
compat_timex related definitions moved from compat code into normal timekeeping code. see 4d5f007e in upstream Linux kernel. Signed-off-by:
Fino Meng <fino.meng@linux.intel.com> Signed-off-by:
Mingliang Hu <mingliang.hu@intel.com> [Jan: account for older kernel versions] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Quirin Gylstorff authored
Add the variable CCACHE_DIR to the build to move the ccache from ~/.ccache to the current directory and upload the cache from each build. Each job uses a separate cache. Signed-off-by:
Quirin Gylstorff <quirin.gylstorff@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 13 Oct, 2020 2 commits
-
-
Philippe Gerum authored
vfile_snapshot_open() may re-run the data collection loop in case we detected a race by checking the revision tag of the data set. Unfortunately, the seq_file is already open at this point, causing a leakage as seq_open() will be called again. The bug triggers after a while running the following commands concurrently: $ while : ; do cat /proc/xenomai/sched/stat > /dev/null; done & $ while : ; do switchtest -T 5; done As the private_data field of the backing file is not NULL once seq_open() has run, this bug triggers the following warning splat when calling it anew for the same file: [ 32.660548] WARNING: CPU: 0 PID: 446 at fs/seq_file.c:55 seq_open.cold+0xc/0x1a [ 32.670934] CPU: 0 PID: 446 Comm: cat Not tainted 4.19.89+ #16 [ 32.686078] I-pipe domain: Linux [ 32.689312] RIP: 0010:seq_open.cold+0xc/0x1a [ 32.693592] Code: 48 8b 74 24 08 e8 1e 5e f9 ff 48 8b 5d 18 48 8b 55 08 4c 01 f3 48 89 5d 18 e9 25 fe ff ff 48 c7 c7 00 99 2b 82 e8 32 71 de ff <0f> 0b e9 d3 db ff ff 90 90 90 90 90 90 90 41 57 41 56 41 55 41 54 [ 32.712354] RSP: 0018:ffff88815476f9b0 EFLAGS: 00010246 [ 32.717588] RAX: 0000000000000024 RBX: ffff888153ec7400 RCX: 0000000000000000 [ 32.724728] RDX: 1ffff1102b944a01 RSI: 0000000000000008 RDI: ffffed102a8edf2d [ 32.731873] RBP: ffffffff828c5560 R08: 0000000000000024 R09: ffffffff815d0644 [ 32.739016] R10: ffffed102b946f1c R11: ffff88815ca378e7 R12: ffff888153ec74c8 [ 32.746156] R13: ffffffff828c75a0 R14: ffff8881544ebb80 R15: ffff888155a2d9c8 [ 32.753299] FS: 00007ff225dc3740(0000) GS:ffff88815ca00000(0000) knlGS:0000000000000000 [ 32.761395] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 32.767152] CR2: 00007ff225eb8120 CR3: 0000000153d8c000 CR4: 00000000003406f0 [ 32.774289] Call Trace: [ 32.776746] vfile_snapshot_open+0x2a8/0x560 [ 32.781022] proc_reg_open+0x124/0x270 [ 32.784782] ? proc_i_callback+0x20/0x20 [ 32.788713] do_dentry_open+0x2ac/0x750 [ 32.792558] ? proc_i_callback+0x20/0x20 [ 32.796492] ? __x64_sys_fchmod+0x70/0x70 [ 32.800507] ? inode_permission.part.0+0x4f/0x180 [ 32.805219] ? security_inode_permission+0x13/0x60 [ 32.810015] path_openat+0x456/0x1b80 [ 32.813681] ? kmem_cache_alloc+0xd2/0x1c0 [ 32.817783] ? getname_flags+0x35/0x240 [ 32.821624] ? do_syscall_64+0x8a/0x240 [ 32.825466] ? __rcu_read_unlock+0x66/0x80 [ 32.829572] ? path_lookupat+0x430/0x430 [ 32.833497] ? find_get_pages_range_tag+0x3a0/0x3a0 [ 32.838381] ? finish_mkwrite_fault+0x1f0/0x1f0 [ 32.842916] do_filp_open+0x103/0x210 [ 32.846586] ? may_open_dev+0x50/0x50 [ 32.850253] ? __fdget+0xe0/0xe0 [ 32.853491] ? __virt_addr_valid+0xa6/0x100 [ 32.857677] ? check_stack_object+0x1f/0x60 [ 32.861864] ? __check_object_size+0x10c/0x1ce [ 32.866316] ? _raw_spin_unlock+0x9/0x30 [ 32.870245] ? __alloc_fd+0x115/0x220 [ 32.873910] do_sys_open+0x1c3/0x290 [ 32.877489] ? __do_page_fault+0x494/0x7b0 [ 32.881588] ? file_open_name+0x180/0x180 [ 32.885604] do_syscall_64+0x8a/0x240 [ 32.889270] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fix this by deferring the call to seq_open() until after the data is fully collected without race, which prevents any seq_file leakage on race by design. Signed-off-by:
Philippe Gerum <rpm@xenomai.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Vitaly Chikunov authored
Enable soname suffix with --enable-so-suffix configure option (Mercury core only). This will allow (for users) installing both versions of libs into the same system and (for distributions) having them without conflicts in the same repository. Such script is used to change Makefile.am-s: for lib in copperplate alchemy psos smokey trank vxworks do find -name Makefile.am \ | xargs -r \ sed -i -e "s/lib${lib}\.la/lib${lib}@CORE@\.la/g" \ -e "s/lib${lib}\_la/lib${lib}@CORE@\_la/g" done Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 28 Sep, 2020 3 commits
-
-
Vitaly Chikunov authored
When building Cobalt core ALT rpmbuild QA script detects that libmodechk is linked improperly: verify-elf: ERROR: ./usr/lib64/libmodechk.so.0.0.0: undefined symbol: cobalt_assert_nrt Signed-off-by:
Vitaly Chikunov <vt@altlinux.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
They only break building outside of the tree. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Jan Kiszka authored
Makes the demo more portable. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 21 Sep, 2020 1 commit
-
-
Fino Meng authored
Out of tree build will fail after porting xenomai to Linux kernel 5.4.y, update Makefiles and scripts to fix it. Signed-off-by:
Fino Meng <fino.meng@linux.intel.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 17 Sep, 2020 1 commit
-
-
Jan Kiszka authored
This not just traces garbage, it usually crashes the system one the tracepoint is enabled. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 15 Sep, 2020 1 commit
-
-
Vitaly Chikunov authored
ALT rpmbuild QA script detects that libsmokey and libcopperplate is improperly linked (when built for Mercury core). Excerpt from the error message: verify-elf: ERROR: ./usr/lib64/libsmokey.so.0.0.0: undefined symbol: get_mem_size verify-elf: ERROR: ./usr/lib64/libcopperplate.so.0.0.0: undefined symbol: get_mem_size Signed-off-by:
Vitaly Chikunov <vt@altlinux.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 11 Sep, 2020 1 commit
-
-
Jan Leupold authored
__open_2() and __open64_2() from glibc add runtime precondition tests for the 'oflag' parameter to the functionality of open()/open64(). They may be used when the macro _FORTIFY_SOURCE is defined when compiling the application code. Added these wrappers to cover those cases. If Xenomai itself is not compiled with FORTIFY_SOURCE then the function declarations for __open_2() and __open64_2() are not available. __STD(__open_2(...)) will not link in this case (would be a very special use case anyway?). Signed-off-by:
Jan Leupold <leupold@rsi-elektrotechnik.de> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 04 Sep, 2020 1 commit
-
-
Quirin Gylstorff authored
Create a gitlab-ci.yml from .travis.yml. Changes are debian instead of ubuntu as base image. Signed-off-by:
Quirin Gylstorff <quirin.gylstorff@siemens.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 19 Aug, 2020 1 commit
-
-
Pintu Kumar authored
With CONFIG_XENO_OPT_PRIVATE_HEAPSZ, user can request any heap size based on their needs. For some application needs, this can grow as large as 4MB that is, 2^10 order pages, which is unlikely to succeed with kzalloc. Even the default (256KB) may fail on highly fragmented system. Moreover, for this heap allocation, we don't need physical contiguous memory. Thus vmalloc/vzalloc may be sufficient here. Note, we may also use kvzalloc/kvmalloc, but unfortunately these are not available in all kernel versions. Thus for backward compatibility we stick to vmalloc at least till we support 4.x kernel. Signed-off-by:
Pintu Kumar <pintu@codeaurora.org> Signed-off-by:
sunshilong <sunshilong369@gmail.com> Tested-by:
sunshilong <sunshilong369@gmail.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 12 Aug, 2020 1 commit
-
-
chensong authored
This a tool to benchmark the latency of GPIO driver, it's able to run 2 kinds of benchmark test: 1, loopback mode 1) apply 2 gpio pins by calling service in gpio RTDM driver like gpio-bcm2835 and gpio-core.c, one is as output, the other is as interrupt 2) call write_rt to send a pulse from output 3) call read_rt to get timestamps recorded in driver (inner loop) 4) also record timespace in user space(outer_loop) outer_loop is inner_loop plus overhead of event wakeup 5) ftrace enable/disable 2, react mode 1) apply 2 gpio pins by calling service in gpio RTDM driver like gpio-bcm2835 and gpio-core.c, one is as ourput, the other is as interrupt 2) call read_rt to wait for a pulse from latency box 3) call write_rt to send a signal back to latency box as a reaction 4) latency box calculates the diff and makes the histogram e.g.: 1) react mode: gpiobench -o 20 -i 21 -c pinctrl-bcm2835 -m 1 -l 1000 2) loopback mode: gpiobench -o 20 -i 21 -c pinctrl-bcm2835 -m 0 -l 1000 -h 100 -b 50 CC: Jan Kiszka <jan.kiszka@siemens.com> CC: Greg Gallagher <greg@embeddedgreg.com> Signed-off-by:
chensong <chensong@tj.kylinos.cn> [Jan: fixed time delta calculation and output for 32-bit targets] Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 02 Jun, 2020 1 commit
-
-
Joshua Karch authored
Signed-off-by:
Joshua Karch <jkarch48@hotmail.com> Signed-off-by:
Greg Gallagher <greg@embeddedgreg.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
- 24 Apr, 2020 2 commits
-
-
Laurentiu-Cristian Duca authored
In order to avoid a possible too early interrupt from the omap mcSPI controller, disable interrupts before writing the number of bytes from the SPI message that fill up the omap mcSPI controller queue, and enable interrupts after that. Signed-off-by:
Laurentiu-Cristian Duca <laurentiu.duca@gmail.com> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-
Vitaly Chikunov authored
Avoid possible prompt being redefined in `.gdbinit' which could break gdb test. Signed-off-by:
Vitaly Chikunov <vt@altlinux.org> Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com>
-