1. 11 Aug, 2014 2 commits
    • Philippe Gerum's avatar
      cobalt/intr: introduce IRQ disabled state · aefaab5d
      Philippe Gerum authored
      With the IRQ line enable/disable operations restricted to the root
      domain, interrupt handlers may not invoke xnintr_disable() directly to
      shut down the interrupt line.
      
      To support this requirement, we add an explicit disabled state to the
      interrupt descriptor, which the handler may turn on by returning the
      new XN_IRQ_DISABLE operation status. In response, the core disables
      the descriptor, shutting down the interrupt line in the same move
      instead of unmasking it on return from the interrupt context.
      
      XN_IRQ_DISABLE is exposed by RTDM as RTDM_IRQ_DISABLE.
      
      As a consequence of this change, XN_ISR_NOENABLE was dropped as we
      have no in-tree client which need such semantics anymore.
      
      At this chance, various naming and documentation fixes have been
      applied.
      aefaab5d
    • Philippe Gerum's avatar
      utils/autotune: fix error output · ea7147d0
      Philippe Gerum authored
      ea7147d0
  2. 10 Aug, 2014 1 commit
  3. 09 Aug, 2014 1 commit
  4. 08 Aug, 2014 14 commits
  5. 07 Aug, 2014 10 commits
  6. 06 Aug, 2014 1 commit
  7. 05 Aug, 2014 4 commits
    • Philippe Gerum's avatar
      alchemy: do not publish objects to clusters until they are fully built · 1f146d90
      Philippe Gerum authored
      We must NOT push Alchemy objects to clusters before they have been
      fully built, including the registration phase.
      
      Otherwise, a high priority task waiting on the binding service for the
      object to appear in a cluster might preempt the creation call
      immediately when the latter is updated, then destroy the half-baked
      resource being pushed, leading to invalid memory references and all
      sorts of unpleasant outcomes.
      1f146d90
    • Philippe Gerum's avatar
      491864a0
    • Philippe Gerum's avatar
      copperplate/init: introduce switches to control sanity checks · b075e5b7
      Philippe Gerum authored
      Copperplate performs sanity checks at application startup
      (e.g. detection of single-processor code over SMP kernel).
      
      --[no-]sanity can be used to control their execution at runtime.
      
      Passing the --enable/disable-sanity switch when building can be used
      to set the default mode when unspecified on the command line.
      b075e5b7
    • Philippe Gerum's avatar
      copperplate: work-around glibc race in cancel state handling · 75cc5dac
      Philippe Gerum authored
      This is a SMP race which seems to affect NPTL-based glibc releases
      (2.9 and 2.18 checked, other releases are likely concerned as
      well). The issue requires SMP setups to pop up, when
      --enable-async-cancel is mentioned on the Xenomai build configuration
      line. It was detected over the Mercury core, not checked on the Cobalt
      core. The work-around will fit both.
      
      The bug creates a situation where
      pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, ...) does not actually
      prevent subsequent asynchronous cancellation of the caller, in the
      following scenario:
      
      threadB has its cancellability set to PTHREAD_CANCEL_ENABLE,
      PTHREAD_CANCEL_ASYNCHRONOUS on entry:
      
      threadA[CPU0]: pthread_cancel(threadB)
      		(SIGCANCEL queued to threadB[CPU1])
      threadB[CPU1]: pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL)
      		(SIGCANCEL delivered to threadB[CPU1])
      		<sigcancel_handler>
      			if (cancel_type(threadB) == PTHREAD_CANCEL_ASYNCHRONOUS)
      				__do_cancel();
      			...
      
      As illustrated, the source of this issue is in glibc's SIGCANCEL
      handler, which only (re-)checks the cancellability TYPE prior to
      entering the thread deletion process on the target CPU, omitting the
      cancellability STATE from this check. High concurrency may therefore
      cause the target CPU to receive an asynchronous cancellation signal
      out of sync, which contradicts the current cancellability state of the
      recipient thread, due to the delayed signal propagation induced by SMP
      activities.
      
      Considering this, the cancellability state seems only safe for
      disabling the internal cancellation points, but can't be relied on for
      blocking asynchronous requests in SMP configurations.
      
      The work-around is to make sure to turn the cancellability type to
      PTHREAD_CANCEL_DEFERRED in addition to disabling cancellation with
      PTHREAD_CANCEL_DISABLE.
      
      Copperplate, and all Copperplate-based APIs are affected by the
      change.
      75cc5dac
  8. 04 Aug, 2014 4 commits
  9. 03 Aug, 2014 3 commits