1. 07 Sep, 2021 2 commits
    • Philippe Gerum's avatar
      lib/init: do not look for vDSO support on Valgrind · 3cdad2b0
      Philippe Gerum authored
      
      
      There is no vDSO support with Valgrind. Detect when running on top of
      such virtual machine using the Valgrind API, picking the fallback
      clock_gettime() implementation if so.
      
      This is not a problem since the EVL core does intercept and honor this
      syscall directly from the out-of-band stage as needed. The incurred
      overhead is negligible compared to what Valgrind already adds anyway.
      
      Also, provide a placeholder for valgrind/valgrind.h which should be
      picked when Valgrind is not installed on the build system.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      3cdad2b0
    • Philippe Gerum's avatar
      lib/syscall: convert to prctl-based syscall form · 2dcda22d
      Philippe Gerum authored
      
      
      The syscall form used for issuing requests to the companion core is
      based on ORing __OOB_SYSCALL_BIT to the syscall register for tagging
      an out-of-band syscall, which is outside of the valid in-band range
      for syscall numbers.
      
      Unfortunately, this method has a major drawback: tools like Valgrind
      which track system calls issued by applications may choke on
      out-of-band system calls since these do not belong to the common set
      it recognizes. Although adding syscall wrappers to Valgrind might be a
      solution, this would not be the most practical one for dual kernel
      syscall interfaces. The most practical approach would be to piggyback
      on an existing system call which Valgrind (and others) already
      recognizes. For this reason, Dovetail introduced a new syscall form
      based on the regular prctl(2) syscall.
      
      In order to benefit from this feature, EVL syscalls are now folded
      into a prctl() request, which the core receives.
      
      This change introduces ABI #27. Recent revisions of the EVL core
      support both the former ABI and the new (prctl-based) one
      indifferently.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      2dcda22d
  2. 21 Aug, 2021 1 commit
  3. 01 Mar, 2021 1 commit
    • Philippe Gerum's avatar
      include/tube: fix queue remove/add race · edb5af7f
      Philippe Gerum authored
      
      
      A receiver could get a spurious empty tube status, due to
      receive_tube() racing with send_tube(). See the added comments into
      the code for details about the resolution.
      
      At this chance, guard against load/store tearing on shared pointers.
      
      Pending issue: we still have a potential connectivity issue between
      the prep and finish ops when pushing to a tube.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      edb5af7f
  4. 13 Dec, 2020 4 commits
  5. 12 Dec, 2020 2 commits
    • Philippe Gerum's avatar
      include/compiler: drop likely/unlikely annotations · 455b4f17
      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's avatarPhilippe Gerum <rpm@xenomai.org>
      455b4f17
    • Philippe Gerum's avatar
      include/tube: remove likely branch annotations · 4be045bb
      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 couple of likely predictions in-tree on straightforward
      conditions from the tube implementation code, which we can remove
      safely.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      4be045bb
  6. 01 Jun, 2020 1 commit
    • Philippe Gerum's avatar
      benchmarks/latmus: add sirq latency measurement · acf10e3a
      Philippe Gerum authored
      
      
      This mode measures the delay between the moment a synthetic interrupt
      is posted from the oob stage and when it is eventually received by its
      in-band handler. When measured under significant pressure, this gives
      the typical interrupt latency experienced by the in-band kernel due to
      local interrupt disabling.
      
      Therefore, this is an in-band only test which measures IRQ latency
      experienced by the common kernel infrastructure, _NOT_ by EVL.
      
      Measurement is requested with '-s' option.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      acf10e3a
  7. 04 May, 2020 1 commit
  8. 30 Apr, 2020 2 commits
    • Philippe Gerum's avatar
      lib: convert to HM diagnostic messages · 3fef97c6
      Philippe Gerum authored
      
      
      Since ABI 23, the core is able to channel T_WOSS, T_WOLI and T_WOSX
      error notifications through the offender's observable component if
      present.
      
      Convert all SIGDEBUG_xxx cause codes to the new EVL_HMDIAG_xxx naming,
      so that we have a single nomenclature for these errors regardless of
      whether threads are notified via SIGDEBUG or their observable
      component.
      
      The API rev. is bumped to #17 as a result of these changes.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      3fef97c6
    • Philippe Gerum's avatar
      lib: introduce the interface to observables · f27fc993
      Philippe Gerum authored
      
      
      Since ABI 23, the core provides the new observable element, which
      enables the observer design pattern. Any EVL thread is in and of
      itself an observable which can be monitored for events too.
      
      As a by-product, the poll interface can now be given a user-defined
      opaque data when subscribing file descriptors to poll elements, which
      the core passes back on return to evl_poll().
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      f27fc993
  9. 23 Apr, 2020 3 commits
  10. 21 Apr, 2020 1 commit
  11. 18 Apr, 2020 1 commit
    • Philippe Gerum's avatar
      lib: introduce element visibility attribute · 9b42b85e
      Philippe Gerum authored
      
      
      Since core ABI 21, users can decide whether a new element should be
      made public or private depending on the value of clone flags added to
      the new long form of all element creation calls, i.e. evl_create_*().
      All evl_new_*() calls become a shorthand for their respective long
      form with reasonable default arguments, including private visibility.
      
      As a shorthand, libevl also interprets a slash character leading the
      name argument passed to these services as an implicit request for
      creating a public element. In other words, this is the same as passing
      EVL_CLONE_PUBLIC in the clone flags.
      
      A public element appears as a cdev in the /dev/evl hierarchy, which
      means that it is visible to other processes, which may share it. On
      the contrary, a private element is only known from the process
      creating it, although it does appear in the /sysfs hierarchy
      regardless.
      
      e.g.:
      
      efd = evl_attach_self("/visible-thread");
      
      total 0
      crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone
      crw-rw----    1 root     root      246,   0 Apr 17 11:59 visible-thread
      
      or,
      
      efd = evl_attach_self("private-thread");
      
      total 0
      crw-rw----    1 root     root      248,   1 Apr 17 11:59 clone
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      9b42b85e
  12. 17 Apr, 2020 2 commits
  13. 28 Mar, 2020 1 commit
  14. 26 Mar, 2020 8 commits
  15. 19 Mar, 2020 5 commits
    • Philippe Gerum's avatar
      lib: fix unfortunate misnomer · a9f1e2f6
      Philippe Gerum authored
      a9f1e2f6
    • Philippe Gerum's avatar
      build: catch obviously wrong UAPI setting · 865d8f62
      Philippe Gerum authored
      865d8f62
    • Philippe Gerum's avatar
      include: do not export uapi/linux · a9653c72
      Philippe Gerum authored
      
      
      uapi/evl should not directly depend on uapi/linux from the same kernel
      release. The kernel definitions we need in uapi/evl should be limited
      to linux/types.h, as available from a current toolchain. Revert the
      uapi/linux export introduced by commit #5f68658b8.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      a9653c72
    • Philippe Gerum's avatar
      lib: y2038: convert to timespec64 kernel interface · 4204f25b
      Philippe Gerum authored
      
      
      This set of changes makes libevl y2038-safe by switching to the ABI
      revision 19 of the EVL core, which generalizes the use of a 64bit
      timespec type. These changes also go a long way preparing for the
      upcoming mixed 32/64 ABI support (aka compat mode).
      
      The changes only affect the internal interface between libevl and the
      kernel, not the API.  Nevertheless, the API was bumped to revision 10
      with the removal of the evl_adjust_clock() service, which neither had
      proper specification nor defined use case currently, but would stand
      in the way of the sanitization work for y2038. At any rate, any future
      service implementing some sort of EVL clock adjustment should
      definitely not depend on the legacy struct timex which is
      y2038-unsafe.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      4204f25b
    • Philippe Gerum's avatar
      lib/init: state ABI requirement explicitly · 1565744d
      Philippe Gerum authored
      
      
      Instead of matching whatever ABI we might be compiled against like
      previously, define the kernel ABI we need as a prerequisite
      (EVL_KABI_PREREQ), checking for sanity at build time and runtime.
      
      This prerequisite is matched against the range of ABI revisions the
      kernel supports (from EVL_ABI_BASE to EVL_ABI_CURRENT). In the
      simplest case, the kernel implements a single ABI with no backward
      compatibility mechanism (EVL_ABI_BASE == EVL_ABI_CURRENT).
      
      This addresses two issues:
      
      - the fact that libevl might build against a given set of uapi/ files
        does not actually mean that the corresponding kernel ABI found there
        is fully compatible with what libevl expects. Specifying a
        compatible ABI prereq explicitly addresses this problem.
      
      - we can obtain services from EVL cores supporting multiple ABI
        revisions (i.e. providing backward compat feat).
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      1565744d
  16. 26 Feb, 2020 1 commit
  17. 14 Feb, 2020 1 commit
  18. 22 Jan, 2020 1 commit
  19. 21 Jan, 2020 1 commit
    • Philippe Gerum's avatar
      lib: rename evl_udelay() to evl_usleep() · db712cc1
      Philippe Gerum authored
      evl_udelay() was an annoying misnomer for people with kernel
      development background, as this relates to a busy wait loop, not to a
      sleeping call, which evl_udelay() actually was.
      
      Rename this call to evl_usleep(), converging to the glibc signature
      for usleep(3) in the same move.
      db712cc1
  20. 03 Dec, 2019 1 commit