1. 03 Feb, 2021 6 commits
    • Philippe Gerum's avatar
      cobalt/clock: drop timer calibration · 9466bfd1
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      The calibrated timer setup time is currently accounted for in the
      timer gravity triplet (.user, also used as default .irq latency),
      exclusively. This forces in a dynamically calculated parameter with no
      way to override it. Meanwhile, this value would be already included in
      every gravity value which autotune may determine, so this setting is
      pretty much redundant.
      
      Drop nktimerlat and the requirement for the machine section to provide
      a timer calibration handler, we don't need these.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      9466bfd1
    • Philippe Gerum's avatar
      cobalt/clock: pipeline: move TSC-related code to the I-pipe section · d9499c1e
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      Cobalt over Dovetail represents time values as counts of nanoseconds,
      dismissing the legacy (hardware) TSC representation entirely. For this
      reason, we can move any code which implements TSC/nanosecs conversion
      to the I-pipe specific section.
      
      This includes the handler applying CPU frequency updates
      (xnclock_update_freq()) which has no purpose over Dovetail, since
      these events are transparently dealt with for the proxy device by the
      generic clockevent framework.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      d9499c1e
    • Philippe Gerum's avatar
      cobalt/arch: pipeline: move architecture code to pipeline-specific section · b10574bc
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      The Cobalt architecture code is overwhelmingly specific to a pipeline
      flavour, most of it for interfacing with the I-pipe. We may still need
      very little arch-specific code in the Dovetail set up though,
      specifically for implementing Cobalt's built-in FPU tests.
      
      Let's move the existing architecture code under the ipipe/ hierarchy,
      fixing up the kernel prep script accordingly.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      [Jan: fix pipeline type probing, resolve two whitespace warnings]
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      b10574bc
    • Philippe Gerum's avatar
      cobalt/clock: pipeline: abstract access to host (real)time · d3d5592b
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      Dovetail enables applications to get timestamps from the
      CLOCK_MONOTONIC and CLOCK_REALTIME clocks via the regular vDSO by
      calling clock_gettime(), including from the out-of-band stage
      (i.e. primary mode).
      
      Legacy support involving IPIPE_HOSTRT can move to the I-pipe specific
      section.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      d3d5592b
    • Philippe Gerum's avatar
      cobalt/thread: pipeline: abstract synchronous single-stepping code · d0f63400
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      Although the synchronous single-stepping code has moved to the I-pipe
      section, we should be able to reuse the current logic nearly as is on
      top of Dovetail, with only minor adjustments.
      
      However, compared to the previous implementation, the single-stepping
      status (XNCONTHI) and the user return notifier are armed _after_ the
      personality handlers have run, in the relaxing path for the current
      thread (see xnthread_relax()). This change should not affect the
      overall logic, assuming no custom relax handler was depending on the
      original sequence of actions (which they should definitely not
      anyway).
      
      We keep this commit which does introduce a small functional change
      separated from the other scheduler-related modifications, as a
      convenience for chasing regressions if need be.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      d0f63400
    • Philippe Gerum's avatar
      cobalt/kernel: pipeline: abstract context switching support · b506a5e2
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      Implement an abstract API for the low-level context switching code,
      moving the legacy open coded support to the I-pipe specific section
      (e.g. fpu management, register file switching, root context tracking).
      Dovetail provides built-in support for all these nitty-gritty details,
      which we may tap into for the same purpose instead.
      
      The changes have been introduced in a way which properly maps to the
      Dovetail interface, while remaining compatible with the interface to
      the legacy code.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      [Jan: make giveup_fpu static]
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      b506a5e2
  2. 25 Jan, 2021 1 commit
    • Ronny Meeus's avatar
      copperplate/timerobj: fix corrupted timer list. · b89eacfe
      Ronny Meeus authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      We observe an issue that the timer-list gets corrupted resulting in an
      endless loop executed by the timer-server thread.
      
      During the processing of the timeout list, a pointer to the next timer
      to be handled is kept in the tmp stack variable.
      Just before calling the timer handler of the current timer the lock on
      the timer list is released giving other threads to change the list.
      If the timer currently referenced by tmp is deleted, we end up with an
      invalid node (next pointer pointing to itself) and this will result in
      an endless loop of the timer server.
      
      Test code is not available but I have seen this issue in our real
      production code and after applying this path, the issue is solved.
      
      The patch basically changes the timer server logic to always start
      from the beginning of the list since when a timer is processed, it is
      either removed (one-shot) or reinserted in a different location in the
      list.
      The processing of the list will stop anyhow if all timers that need
      to expire up to "now" are handled.
      
      Signed-off-by: default avatarRonny Meeus <ronny.meeus@gmail.com>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      b89eacfe
  3. 19 Jan, 2021 13 commits
  4. 11 Jan, 2021 8 commits
  5. 08 Jan, 2021 7 commits
  6. 17 Dec, 2020 3 commits
    • Philippe Gerum's avatar
      cobalt/intr: pipeline: IRQ management code is pipeline-specific · 38baf072
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      The way we request and manage interrupts depends on the underlying
      pipeline interface.
      
      As a matter of fact, Dovetail already deals with most of the logic
      implemented by the xnintr layer, such as edge/level shared IRQs, fully
      reusing the regular genirq interface for management. IRQ handlers with
      Dovetail have regular signatures as well.
      
      For the time being, let's move the entire xnintr layer to the I-pipe
      specific section created earlier. We should be able to design the
      abstract interface to IRQ management after this layer for the most
      part, which we would connect to Dovetail eventually.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      38baf072
    • Philippe Gerum's avatar
      cobalt/init: pipeline: abstract pipeline-specific inits · 6d2989b6
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      This is the initial step to enabling Dovetail for the Cobalt core,
      which requires to introduce an abstraction layer between such core and
      the interrupt pipeline interface, either Dovetail or the legacy
      I-pipe.
      
      Eventually, the Cobalt implementation which has to interface to the
      underlying pipeline should branch off at the following points:
      
      - kernel/cobalt/{ipipe, dovetail}/arch, the arch-specific
        implementation which overwhelmingly depends on the pipeline flavour.
      
      - kernel/cobalt/{ipipe, dovetail}, the generic Cobalt code calling
        pipeline services.
      
      - kernel/cobalt/include/{ipipe, dovetail}, the client glue types and
        definitions pulled into some basic kernel types by the pipeline
        implementation (e.g. the thread_info extension structure).
      
      - include/cobalt/kernel/{ipipe, dovetail}, the generic Cobalt headers
        depending on services and definitions the pipeline provides for.
      
      We start the process by abstracting the machine-level init code which
      depends on the pipeline flavour.
      
      No functional change is introduced.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      6d2989b6
    • Philippe Gerum's avatar
      cobalt/kernel: substitute ipipe_processor_id() with raw_smp_processor_id() · 18c7ed6a
      Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
      
      
      raw_smp_processor_id() has been callable from any pipeline domain for
      many moons now, there is no point in using the legacy
      ipipe_processor_id() call anymore.
      
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
      Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
      18c7ed6a
  7. 16 Dec, 2020 2 commits