index.html 48.7 KB
Newer Older
Philippe Gerum's avatar
Philippe Gerum committed
1 2 3 4 5 6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.8" />
Philippe Gerum's avatar
Philippe Gerum committed
7
<title>Troubleshooting a dual kernel configuration</title>
Philippe Gerum's avatar
Philippe Gerum committed
8 9
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
Philippe Gerum's avatar
Philippe Gerum committed
10

Philippe Gerum's avatar
Philippe Gerum committed
11 12 13 14
/* Default font. */
body {
  font-family: Georgia,serif;
}
Philippe Gerum's avatar
Philippe Gerum committed
15

Philippe Gerum's avatar
Philippe Gerum committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
  font-family: Arial,Helvetica,sans-serif;
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}
h5 {
  font-size: 1.0em;
}

div.sectionbody {
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}


#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}

#footer {
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid #dddddd;
  border-left: 4px solid #f0f0f0;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid #dddddd;
  border-left: 5px solid #f0f0f0;
  background: #f8f8f8;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #f0f0f0;
  color: #888;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > pre.content {
  font-family: inherit;
  font-size: inherit;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}

div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}

div.colist td {
  padding-right: 0.5em;
  padding-bottom: 0.3em;
  vertical-align: top;
}
div.colist td img {
  margin-top: 0.3em;
}

@media print {
  #footer-badges { display: none; }
}

#toc {
  margin-bottom: 2.5em;
}

#toctitle {
  color: #527bbd;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}

span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }

span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }

span.big { font-size: 2em; }
span.small { font-size: 0.6em; }

span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }

div.unbreakable { page-break-inside: avoid; }


/*
 * xhtml11 specific
 *
 * */

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-weight: bold;
  color: #527bbd;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


/*
 * html5 specific
 *
 * */

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
}
p.tableblock {
  margin-top: 0;
}
table.tableblock {
  border-width: 3px;
  border-spacing: 0px;
  border-style: solid;
  border-color: #527bbd;
  border-collapse: collapse;
}
th.tableblock, td.tableblock {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #527bbd;
}

table.tableblock.frame-topbot {
  border-left-style: hidden;
  border-right-style: hidden;
}
table.tableblock.frame-sides {
  border-top-style: hidden;
  border-bottom-style: hidden;
}
table.tableblock.frame-none {
  border-style: hidden;
}

th.tableblock.halign-left, td.tableblock.halign-left {
  text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
  text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
  text-align: right;
}

th.tableblock.valign-top, td.tableblock.valign-top {
  vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
  vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  vertical-align: bottom;
}


/*
 * manpage specific
 *
 * */

body.manpage h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
body.manpage h2 {
  border-style: none;
}
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


</style>
Philippe Gerum's avatar
Philippe Gerum committed
537 538
<script type="text/javascript">
/*<![CDATA[*/
Philippe Gerum's avatar
Philippe Gerum committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  if (!toc) {
    return;
  }

  // Delete existing TOC entries in case we're reloading the TOC.
  var tocEntriesToRemove = [];
  var i;
  for (i = 0; i < toc.childNodes.length; i++) {
    var entry = toc.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div'
     && entry.getAttribute("class")
     && entry.getAttribute("class").match(/^toclevel/))
      tocEntriesToRemove.push(entry);
  }
  for (i = 0; i < tocEntriesToRemove.length; i++) {
    toc.removeChild(tocEntriesToRemove[i]);
  }

  // Rebuild TOC entries.
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  // Delete existing footnote entries in case we're reloading the footnodes.
  var i;
  var noteholder = document.getElementById("footnotes");
  if (!noteholder) {
    return;
  }
  var entriesToRemove = [];
  for (i = 0; i < noteholder.childNodes.length; i++) {
    var entry = noteholder.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
      entriesToRemove.push(entry);
  }
  for (i = 0; i < entriesToRemove.length; i++) {
    noteholder.removeChild(entriesToRemove[i]);
  }

  // Rebuild footnote entries.
  var cont = document.getElementById("content");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      var note = spans[i].getAttribute("data-note");
      if (!note) {
        // Use [\s\S] in place of . so multi-line matches work.
        // Because JavaScript has no s (dotall) regex flag.
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
        spans[i].innerHTML =
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
        spans[i].setAttribute("data-note", note);
      }
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
},

install: function(toclevels) {
  var timerId;

  function reinstall() {
    asciidoc.footnotes();
    if (toclevels) {
      asciidoc.toc(toclevels);
    }
  }

  function reinstallAndRemoveTimer() {
    clearInterval(timerId);
    reinstall();
  }

  timerId = setInterval(reinstall, 500);
  if (document.addEventListener)
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  else
    window.onload = reinstallAndRemoveTimer;
}

}
Philippe Gerum's avatar
Philippe Gerum committed
728 729 730 731 732 733
asciidoc.install(3);
/*]]>*/
</script>
</head>
<body class="article" style="max-width:55em">
<div id="header">
Philippe Gerum's avatar
Philippe Gerum committed
734
<h1>Troubleshooting a dual kernel configuration</h1>
Philippe Gerum's avatar
Philippe Gerum committed
735 736 737 738 739 740 741 742
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
Philippe Gerum's avatar
Philippe Gerum committed
743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
<div class="paragraph"><p>This page is a troubleshooting guide enumerating known issues
with dual kernel Xenomai configurations.</p></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/tip.png" alt="Tip" />
</td>
<td class="content">If running any release from the Xenomai 2 series, or a Xenomai 3
release using the <strong>Cobalt</strong> real-time core, then you are using a dual
kernel configuration, and this document was meant for you.  Xenomai 3
over the <strong>Mercury</strong> core stands for a single kernel configuration
instead, for which you can find specific
<a href="troubleshooting-a-single-kernel-configuration/">troubleshooting
information here</a>.</td>
</tr></table>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
759 760 761
</div>
</div>
<div class="sect1">
Philippe Gerum's avatar
Philippe Gerum committed
762
<h2 id="_kernel_related_issues">1. Kernel-related issues</h2>
Philippe Gerum's avatar
Philippe Gerum committed
763
<div class="sectionbody">
Philippe Gerum's avatar
Philippe Gerum committed
764 765
<div class="sect2">
<h3 id="kconf">1.1. Common kernel configuration issues</h3>
Philippe Gerum's avatar
Philippe Gerum committed
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
<div class="paragraph"><p>When configuring the Linux kernel, some options should be avoided.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
CONFIG_CPU_FREQ
</dt>
<dd>
<p>
This allows the CPU frequency to be modulated with
workload, but many CPUs change the TSC counting frequency also, which
makes it useless for accurate timing when the CPU clock can
change. Also some CPUs can take several milliseconds to ramp up to
full speed.
</p>
</dd>
<dt class="hdlist1">
CONFIG_CPU_IDLE
</dt>
<dd>
<p>
Allows the CPU to enter deep sleep states,
increasing the time it takes to get out of these sleep states, hence
the latency of an idle system. Also, on some CPU, entering these deep
sleep states causes the timers used by Xenomai to stop functioning.
</p>
</dd>
<dt class="hdlist1">
CONFIG_KGDB
</dt>
<dd>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
796
This option should not be enabled, except with x86.
Philippe Gerum's avatar
Philippe Gerum committed
797 798
</p>
</dd>
Philippe Gerum's avatar
Philippe Gerum committed
799 800 801 802 803 804 805 806 807 808 809 810 811 812
<dt class="hdlist1">
CONFIG_CONTEXT_TRACKING_FORCE
</dt>
<dd>
<p>
This option which appeared in kernel
3.8 is forced off by I-pipe patches since 3.14 onward, as it is
incompatible with interrupt pipelining, and has no upside for regular
users. However, you have to manually disable it for older kernels when
present. Common effects observed with this feature enabled include
RCU-related kernel warnings during real-time activities, and
pathologically high latencies.
</p>
</dd>
Philippe Gerum's avatar
Philippe Gerum committed
813 814 815
</dl></div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
816
<h3 id="_kernel_hangs_after_uncompressing_linux_8230_done_booting_the_kernel">1.2. Kernel hangs after "Uncompressing Linux&#8230; done, booting the kernel."</h3>
Philippe Gerum's avatar
Philippe Gerum committed
817 818 819 820 821 822 823 824 825
<div class="paragraph"><p>This means that the kernel crashes before the console is enabled. You
should enable the <code>CONFIG_EARLY_PRINTK</code> option. For some architectures
(blackfin, x86, arm), enabling this option also requires passing the
<code>earlyprintk</code> parameter on the kernel command line. See
<em>Documentation/kernel-parameters.txt</em> for possible values.</p></div>
<div class="paragraph"><p>For the ARM architecture, you have to enable <code>CONFIG_DEBUG_KERNEL</code> and
<code>CONFIG_DEBUG_LL</code> in order to be able to enable <code>CONFIG_EARLY_PRINTK</code>.</p></div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
826 827 828 829 830 831 832
<h3 id="_kernel_oopses">1.3. Kernel OOPSes</h3>
<div class="paragraph"><p>Please make sure to check the <a href="#kconf">"Kernel configuration"</a> section
first.</p></div>
<div class="paragraph"><p>If nothing seems wrong there, try capturing the OOPS information using
a <em>serial console</em> or <em>netconsole</em>, then post it to the
<a href="mailto:xenomai@xenomai.org">xenomai mailing list</a>, along with the
kernel configuration file (aka <code>.config</code>) matching the kernel build.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
833 834
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
835
<h3 id="_kernel_boots_but_does_not_print_any_message">1.4. Kernel boots but does not print any message</h3>
Philippe Gerum's avatar
Philippe Gerum committed
836 837 838 839 840 841
<div class="paragraph"><p>Your distribution may be configured to pass the <code>quiet</code> option on the
kernel command line. In this case, the kernel does not print all the
log messages, however, they are still available using the <code>dmesg</code>
command.</p></div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
842 843 844 845 846 847
<h3 id="kerror">1.5. Kernel log displays Xenomai or I-pipe error messages</h3>
<div class="sect3">
<h4 id="no-timer">1.5.1. I-pipe: could not find timer for cpu #N</h4>
<div class="paragraph"><p>The most probable reason is that no hardware timer chip is available
for Xenomai timing operations.</p></div>
<div class="paragraph"><p>Check that you did not enable some of the conflicting options listed
Philippe Gerum's avatar
Philippe Gerum committed
848
in the <a href="#kconf">"Kernel configuration"</a> section.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868
<div class="dlist"><dl>
<dt class="hdlist1">
With AMD x86_64 CPUs
</dt>
<dd>
<p>
You will most likely also see the following
message:
</p>
</dd>
</dl></div>
<div class="listingblock">
<div class="content">
<pre><code>I-pipe: cannot use LAPIC as a tick device
I-pipe: disable C1E power state in your BIOS</code></pre>
</div></div>
<div class="paragraph"><p>The interrupt pipeline outputs this message if C1E option is enabled
in the BIOS. To fix this issue, disable C1E support in the BIOS. In
some Award BIOS this option is located in the <code>Advanced BIOS
Features&#8594;</code> menu (<code>AMD C1E Support</code>).</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
869 870 871
<div class="admonitionblock">
<table><tr>
<td class="icon">
Philippe Gerum's avatar
Philippe Gerum committed
872
<img src="../asciidoc-icons/warning.png" alt="Warning" />
Philippe Gerum's avatar
Philippe Gerum committed
873
</td>
Philippe Gerum's avatar
Philippe Gerum committed
874 875
<td class="content">Disabling the <code>AMD K8 Cool&amp;Quiet</code> feature in the BIOS will <strong>NOT</strong> solve
this problem.</td>
Philippe Gerum's avatar
Philippe Gerum committed
876 877
</tr></table>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
<div class="dlist"><dl>
<dt class="hdlist1">
With other CPU architectures
</dt>
<dd>
<p>
The interrupt pipeline implementation
may lack a registration for a hardware timer available to Xenomai
timing operations (e.g. a call to <code>ipipe_timer_register()</code>).
</p>
</dd>
</dl></div>
<div class="paragraph"><p>If you are working on porting the interrupt pipeline to some ARM SoC,
you may want to have a look at this
<a href="porting-xenomai-to-a-new-arm-soc/#The_general_case">detailed
information</a>.</p></div>
</div>
<div class="sect3">
<h4 id="SMI">1.5.2. SMI-enabled chipset found, but SMI workaround disabled</h4>
<div class="paragraph"><p>You may have an issue with System Management Interrupts on your x86
platform. You may want to look at
<a href="dealing-with-x86-smi-troubles/">this document</a>.</p></div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
901 902
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
903 904 905 906 907 908 909 910
<h3 id="_xenomai_and_linux_devices_share_the_same_irq_vector">1.6. Xenomai and Linux devices share the same IRQ vector</h3>
<div class="paragraph"><p>This x86-specific issue might still happen on legacy hardware with no
MSI support. See
<a href="what-if-xenomai-and-linux-devices-share-the-same-IRQ">this
article</a> from the Knowledge Base.</p></div>
</div>
<div class="sect2">
<h3 id="_kernel_issues_specific_to_the_xenomai_2_x_series">1.7. Kernel issues specific to the Xenomai 2.x series</h3>
Philippe Gerum's avatar
Philippe Gerum committed
911
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928
<h4 id="_system_init_failed_code_19">1.7.1. system init failed, code -19</h4>
<div class="paragraph"><p>See <a href="#no-timer">this entry</a>.</p></div>
</div>
<div class="sect3">
<h4 id="_system_init_failed_code_22">1.7.2. system init failed, code -22</h4>
<div class="paragraph"><p>On the ppc64 platform, check whether <code>CONFIG_PPC_64K_PAGES</code> is defined
in your kernel configuration. If so, then you likely need to raise all
Xenomai parameters defining the size of internal heaps, such as
<code>CONFIG_XENO_OPT_SYS_HEAPSZ</code>, <code>CONFIG_XENO_OPT_GLOBAL_SEM_HEAPSZ</code> and
<code>CONFIG_XENO_OPT_SEM_HEAPSZ</code>, so that (size / 64k) &gt; 2. The default
values for these parameters are currently based on the assumption that
PAGE_SIZE = 4k.</p></div>
</div>
<div class="sect3">
<h4 id="_local_apic_absent_or_disabled">1.7.3. Local APIC absent or disabled!</h4>
<div class="paragraph"><p>The Xenomai 2.x <em>nucleus</em> issues this warning if the kernel
configuration enables the local APIC support
Philippe Gerum's avatar
Philippe Gerum committed
929 930 931 932 933 934
(<code>CONFIG_X86_LOCAL_APIC</code>), but the processor status gathered at boot
time by the kernel says that no local APIC support is available.
There are two options for fixing this issue:</p></div>
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
935 936
either your CPU really has <em>no</em> local APIC hardware, in which case
you need to rebuild a kernel with LAPIC support disabled.
Philippe Gerum's avatar
Philippe Gerum committed
937 938 939 940 941
</p>
</li>
<li>
<p>
or it does have a local APIC but the kernel boot parameters did not
Philippe Gerum's avatar
Philippe Gerum committed
942 943
specify to activate it using the <em>lapic</em> option. The latter is
required since 2.6.9-rc4 for boxes which APIC hardware is disabled by
Philippe Gerum's avatar
Philippe Gerum committed
944 945 946 947 948 949 950 951 952 953 954
default by the BIOS. You may want to look at the file
<em>Documentation/kernel-parameters.txt</em> from the Linux source tree, for
more information about this parameter.
</p>
</li>
</ul></div>
</div>
</div>
</div>
</div>
<div class="sect1">
Philippe Gerum's avatar
Philippe Gerum committed
955
<h2 id="_application_level_issues">2. Application-level issues</h2>
Philippe Gerum's avatar
Philippe Gerum committed
956 957
<div class="sectionbody">
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
958
<h3 id="vsyscall">2.1. --enable-x86-sep needs NPTL and Linux 2.6.x or higher</h3>
Philippe Gerum's avatar
Philippe Gerum committed
959 960 961 962
<div class="paragraph"><p>or,</p></div>
</div>
<div class="sect2">
<h3 id="_enable_x86_vsyscall_requires_nptl_8230">2.2. --enable-x86-vsyscall requires NPTL &#8230;</h3>
Philippe Gerum's avatar
Philippe Gerum committed
963 964 965 966 967 968 969
<div class="paragraph"><p>This message may happen when starting a Xenomai 2.x or 3.x application
respectively. On the x86 architecture, the configure script option
mentioned allows Xenomai to use the <em>vsyscall</em> mechanism for issuing
system calls, based on the most efficient method determined by the
kernel for the current system. This mechanism is only available from
NPTL-enabled glibc releases.</p></div>
<div class="paragraph"><p>Turn off this feature for other libc flavours.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
970 971
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
972 973 974 975 976 977 978 979 980 981 982 983 984
<h3 id="_cobalt_core_not_enabled_in_kernel">2.3. Cobalt core not enabled in kernel</h3>
<div class="paragraph"><p>As mentioned in the message, the target kernel is lacking Cobalt
support.  See
<a href="installing-xenomai-3-x/#Installing_the_Cobalt_core">this document</a>
for detailed information about installing Cobalt.</p></div>
</div>
<div class="sect2">
<h3 id="_binding_failed_function_not_implemented">2.4. binding failed: Function not implemented</h3>
<div class="paragraph"><p>Another symptom of the previous issue, i.e. the Cobalt core is not
enabled in the target kernel.</p></div>
</div>
<div class="sect2">
<h3 id="_binding_failed_operation_not_permitted">2.5. binding failed: Operation not permitted</h3>
Philippe Gerum's avatar
Philippe Gerum committed
985 986 987 988 989
<div class="paragraph"><p>This is the result of an attempt to run a Xenomai application as an
unprivileged user, which fails because invoking Xenomai services
requires <code>CAP_SYS_NICE</code>. However, you may allow a specific group of
users to access Xenomai services, by following the instructions on
<a href="running-a-Xenomai-application-as-a-regular-user">this page</a>.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
990 991
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
992
<h3 id="_incompatible_abi_revision_level">2.6. incompatible ABI revision level</h3>
Philippe Gerum's avatar
Philippe Gerum committed
993 994 995
<div class="paragraph"><p>Same as below:</p></div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
996
<h3 id="_abi_mismatch">2.7. ABI mismatch</h3>
Philippe Gerum's avatar
Philippe Gerum committed
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
<div class="paragraph"><p>The ABI concerned by this message is the system call binary interface
between the Xenomai libraries and the real-time kernel services it
invokes (e.g. <code>libcobalt</code> and the Cobalt kernel with Xenomai
3.x). This ABI may evolve over time, only between major Xenomai
releases or testing candidate releases (i.e. -rc series) though. When
this happens, the ABI level required by the application linked against
Xenomai libraries may not match the ABI exposed by the Xenomai
co-kernel implementation on the target machine, which is the situation
this message reports.</p></div>
<div class="paragraph"><p>To fix this issue, just make sure to rebuild both the Xenomai kernel
support and the user-space binaries for your target system. If however
you did install the appropriate Xenomai binaries on your target
system, chances are that stale files from a previous Xenomai
installation still exist on your system, causing the mismatch.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1011
<div class="paragraph"><p>Each major Xenomai release (e.g. 2.1.x, 2.2.x &#8230; 2.6.x, 3.0.x &#8230;)
Philippe Gerum's avatar
Philippe Gerum committed
1012 1013 1014 1015 1016
defines such kernel/user ABI, which remains stable across minor update
releases (e.g. 2.6.0 &#8594; 2.6.4). This guarantee makes partial updates
possible with production systems (i.e. kernel and/or user support).
For instance, any application built over the Xenomai 2.6.0 binaries
can run over a Xenomai 2.6.4 kernel support, and conversely.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1017 1018 1019 1020 1021
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/tip.png" alt="Tip" />
</td>
Philippe Gerum's avatar
Philippe Gerum committed
1022 1023 1024 1025
<td class="content">Debian-based distributions (notably Ubuntu) may ship with
pre-installed Xenomai libraries. Make sure that these files don&#8217;t get
in the way if you plan to install a more recent Xenomai kernel
support.</td>
Philippe Gerum's avatar
Philippe Gerum committed
1026
</tr></table>
Philippe Gerum's avatar
Philippe Gerum committed
1027 1028 1029
</div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
1030
<h3 id="_lt_program_gt_not_found">2.8. &lt;program&gt;: not found</h3>
Philippe Gerum's avatar
Philippe Gerum committed
1031 1032 1033 1034 1035 1036 1037 1038
<div class="paragraph"><p>Although the program in question may be present, this message may
happen on ARM platforms when a mismatch exists between the kernel and
user library configurations with respect to EABI support. Typically,
if user libraries are compiled with a toolchain generating OABI code,
the result won&#8217;t run over a kernel not enabling the
<code>CONFIG_OABI_COMPAT</code> option. Conversely, the product of a compilation
with an EABI toolchain won&#8217;t run on a kernel not enabling the
<code>CONFIG_AEABI</code> option.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1039
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1040
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
1041
<h3 id="_incompatible_feature_set">2.9. incompatible feature set</h3>
Philippe Gerum's avatar
Philippe Gerum committed
1042 1043 1044 1045 1046 1047
<div class="paragraph"><p>When a Xenomai application starts, the set of core features it
requires is compared to the feature set the kernel provides. This
message denotes a mismatch between both sets, which can be solved by
fixing the kernel and/or user build configuration.  Further details
are available from <a href="installing-xenomai-3-x">this page</a> for Xenomai
3, and <a href="installing-xenomai-2-x">this page</a> for Xenomai 2.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1048
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1049
<h4 id="_feature_mismatch_missing_smp_nosmp">2.9.1. feature mismatch: missing="smp/nosmp"</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066
<div class="paragraph"><p>On SMP-capable architectures, both kernel and user-space components
(i.e. Xenomai libraries) must be compiled with the same setting with
respect to SMP support.</p></div>
<div class="paragraph"><p>SMP support in the kernel is controlled via the <code>CONFIG_SMP</code> option.
The <code>--enable-smp</code> configuration switch enables this feature for the
Xenomai libraries (conversely, <code>--disable-smp</code> disables it).</p></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/caution.png" alt="Caution" />
</td>
<td class="content">Using Xenomai libraries built for a single-processor configuration
(i.e. <code>--disable-smp</code>) over a SMP kernel (i.e. <code>CONFIG_SMP=y</code>) is
<strong>NOT</strong> valid. On the other hand, using Xenomai libraries built with SMP
support enabled over a single-processor kernel is fine.</td>
</tr></table>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1067 1068 1069
</div>
</div>
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
1070
<h3 id="_application_level_issues_specific_to_the_xenomai_2_x_series">2.10. Application-level issues specific to the Xenomai 2.x series</h3>
Philippe Gerum's avatar
Philippe Gerum committed
1071 1072
<div class="paragraph"><p>The following feature mismatches can be detected with the 2.x series:</p></div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1073
<h4 id="_feature_mismatch_missing_kuser_tsc">2.10.1. feature mismatch: missing="kuser_tsc"</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1074
<div class="paragraph"><p>See the <a href="#arm-tsc">"ARM tsc emulation issues"</a> section.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1075 1076 1077 1078 1079 1080 1081 1082 1083
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
<td class="content">This issue does not affect Xenomai 3.x as the latter requires modern
I-pipe series which must provide <em>KUSER_TSC</em> support on the ARM
architecture.</td>
</tr></table>
Philippe Gerum's avatar
Philippe Gerum committed
1084 1085
</div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1086
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1087
<h4 id="_feature_mismatch_missing_sep">2.10.2. feature mismatch: missing="sep"</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1088 1089
<div class="paragraph"><p>This error is specific to the x86 architecture on Xenomai 2.x, for
pre-Pentium CPUs which do not provide the <em>sysenter/sysexit</em>
Philippe Gerum's avatar
Philippe Gerum committed
1090
instruction pair. See <a href="#vsyscall">this section</a>.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1091 1092 1093 1094 1095 1096 1097 1098
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
<td class="content">This issue does not affect Xenomai 3.x as the latter does not
support pre-Pentium systems in the first place.</td>
</tr></table>
Philippe Gerum's avatar
Philippe Gerum committed
1099 1100
</div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1101
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1102
<h4 id="_feature_mismatch_missing_tsc">2.10.3. feature mismatch: missing="tsc"</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
<div class="paragraph"><p>This error is specific to the x86 architecture on Xenomai 2.x, for
pre-Pentium CPUs which do not provide the <em>rdtsc</em> instruction. In this
particular case, <code>--enable-x86-tsc</code> cannot be mentioned in the
configuration options for building the user libraries, since the
processor does not support this feature.</p></div>
<div class="paragraph"><p>The rule of thumb is to pick the <strong>exact</strong> processor for your x86
platform when configuring the kernel, at the very least the most
specific model which is close to the target CPU, not a generic
placeholder such as <em>i586</em>, for which <em>rdtsc</em> is not available.</p></div>
<div class="paragraph"><p>If your processor does not provide the <em>rdtsc</em> instruction, you have
to pass <code>--disable-x86-tsc</code> option to the configure script for
building the user librairies. In this case, Xenomai will provide a
(much slower) emulation of the hardware TSC.</p></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<img src="../asciidoc-icons/note.png" alt="Note" />
</td>
<td class="content">This issue does not affect Xenomai 3.x as the latter does not
support pre-Pentium systems in the first place.</td>
</tr></table>
Philippe Gerum's avatar
Philippe Gerum committed
1124 1125
</div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1126
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1127
<h4 id="arm-tsc">2.10.4. ARM tsc emulation issues</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1128 1129 1130
<div class="paragraph"><p>In order to allow applications to measure short durations with as
little overhead as possible, Xenomai uses a 64 bits high resolution
counter. On x86, the counter used for this purpose is the time-stamp
Philippe Gerum's avatar
Philippe Gerum committed
1131
counter readable by the dedicated <em>rdtsc</em> instruction.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
<div class="paragraph"><p>ARM processors generally do not have a 64 bits high resolution counter
available in user-space, so this counter is emulated by reading
whatever high resolution counter is available on the processor, and
used as clock source in kernel-space, and extend it to 64 bits by
using data shared with the kernel. If Xenomai libraries are compiled
without emulated tsc support, system calls are used, which have a much
higher overhead than the emulated tsc code.</p></div>
<div class="paragraph"><p>In recent versions of the I-pipe patch, SOCs generally select the
<code>CONFIG_IPIPE_ARM_KUSER_TSC</code> option, which means that the code for
reading this counter is provided by the kernel at a predetermined
address (in the vector page, a page which is mapped at the same
address in every process) and is the code used if you do not pass the
<code>--enable-arm-tsc</code> or <code>--disable-arm-tsc</code> option to configure, or pass
<code>--enable-arm-tsc=kuser</code>.</p></div>
<div class="paragraph"><p>This default should be fine with recent patches and most ARM
SOCs.</p></div>
<div class="paragraph"><p>However, if you see the following message:</p></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1151
<pre><code>incompatible feature set
Philippe Gerum's avatar
Philippe Gerum committed
1152 1153 1154
(userland requires "kuser_tsc...", kernel provides..., missing="kuser_tsc")</code></pre>
</div></div>
<div class="paragraph"><p>It means that you are either using an old patch, or that the SOC you
Philippe Gerum's avatar
Philippe Gerum committed
1155
are using does not select the <code>CONFIG_IPIPE_ARM_KUSER_TSC</code> option.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169
<div class="paragraph"><p>So you should resort to what Xenomai did before branch 2.6: select the
tsc emulation code when compiling Xenomai user-space support by using
the <code>--enable-arm-tsc</code> option. The parameter passed to this option is
the name of the SOC or SOC family for which you are compiling Xenomai.
Typing:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>/patch/to/xenomai/configure --help</code></pre>
</div></div>
<div class="paragraph"><p>will return the list of valid values for this option.</p></div>
<div class="paragraph"><p>If after having enabled this option and recompiled, you see the
following message when starting the latency test:</p></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1170
<pre><code>kernel/user tsc emulation mismatch</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182
</div></div>
<div class="paragraph"><p>or</p></div>
<div class="listingblock">
<div class="content">
<pre><code>Hardware tsc is not a fast wrapping one</code></pre>
</div></div>
<div class="paragraph"><p>It means that you selected the wrong SOC or SOC family, reconfigure
Xenomai user-space support by passing the right parameter to
<code>--enable-arm-tsc</code> and recompile.</p></div>
<div class="paragraph"><p>The following message:</p></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1183
<pre><code>Your board/configuration does not allow tsc emulation</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
1184 1185 1186 1187 1188 1189
</div></div>
<div class="paragraph"><p>means that the kernel-space support for the SOC you are using does not
provide support for tsc emulation in user-space. In that case, you
should recompile Xenomai user-space support passing the
<code>--disable-arm-tsc</code> option.</p></div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1190
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1191
<h4 id="_hardware_tsc_is_not_a_fast_wrapping_one">2.10.5. hardware tsc is not a fast wrapping one</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1192 1193 1194
<div class="paragraph"><p>or,</p></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1195
<h4 id="_kernel_user_tsc_emulation_mismatch">2.10.6. kernel/user tsc emulation mismatch</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1196 1197 1198
<div class="paragraph"><p>or,</p></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1199
<h4 id="_board_configuration_does_not_allow_tsc_emulation">2.10.7. board/configuration does not allow tsc emulation</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1200
<div class="paragraph"><p>See the <a href="#arm-tsc">"ARM tsc emulation issues"</a> section.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1201
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1202
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1203
<h4 id="_native_skin_or_config_xeno_opt_pervasive_disabled">2.10.8. native skin or CONFIG_XENO_OPT_PERVASIVE disabled</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
<div class="paragraph"><p>Possible reasons for this error are:</p></div>
<div class="ulist"><ul>
<li>
<p>
you booted a kernel without Xenomai or I-pipe support, a kernel with
I-pipe and Xenomai support should have a <em>/proc/ipipe/version</em> and
<em>/proc/xenomai/version</em> files;
</p>
</li>
<li>
<p>
the kernel you booted does not have the <code>CONFIG_XENO_SKIN_NATIVE</code> and
<code>CONFIG_XENO_OPT_PERVASIVE</code> options enabled;
</p>
</li>
<li>
<p>
Xenomai failed to start, check the <a href="#kerror">"Xenomai or I-pipe error in the kernel log"</a> section;
</p>
</li>
<li>
<p>
you are trying to run Xenomai user-space support compiled for x86_32
on an x86_64 kernel.
</p>
</li>
</ul></div>
Philippe Gerum's avatar
Philippe Gerum committed
1231
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1232
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1233
<h4 id="_warning_lt_service_gt_is_deprecated_while_compiling_kernel_code">2.10.9. "warning: &lt;service&gt; is deprecated" while compiling kernel code</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
<div class="paragraph"><p>Where &lt;service&gt; is a thread creation service, one of:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>cre_tsk</code>
</p>
</li>
<li>
<p>
<code>pthread_create</code>
</p>
</li>
<li>
<p>
<code>rt_task_create</code>
</p>
</li>
<li>
<p>
<code>sc_tecreate</code> or <code>sc_tcreate</code>
</p>
</li>
<li>
<p>
<code>taskSpawn</code> or <code>taskInit</code>
</p>
</li>
<li>
<p>
<code>t_create</code>
</p>
</li>
</ul></div>
Philippe Gerum's avatar
Philippe Gerum committed
1267 1268 1269 1270 1271 1272
<div class="paragraph"><p>Starting with Xenomai 3, APIs are not usable from kernel modules
anymore, at the notable exception of the RTDM device driver API, which
by essence must be used from kernel space for writing real-time device
drivers. Those warnings are there to remind you that application code
should run in user-space context instead, so that it can be ported to
Xenomai 3.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1273
<div class="paragraph"><p>You may switch those warnings off by enabling the
Philippe Gerum's avatar
Philippe Gerum committed
1274 1275
<code>CONFIG_XENO_OPT_NOWARN_DEPRECATED</code> option in your kernel
configuration, but nevertheless, you have been <strong>WARNED</strong>.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1276
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1277
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1278
<h4 id="_a_xenomai_system_call_fails_with_code_38_enosys">2.10.10. a Xenomai system call fails with code -38 (ENOSYS)</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1279
<div class="paragraph"><p>Possible reasons for this error are:</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1280 1281 1282
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308
you booted a kernel without Xenomai or I-pipe support, a kernel with
I-pipe and Xenomai support should have a <em>/proc/ipipe/version</em> and
<em>/proc/xenomai/version</em> files;
</p>
</li>
<li>
<p>
the kernel you booted does not have the <code>CONFIG_XENO_SKIN_*</code> option
enabled for the skin you use, or <code>CONFIG_XENO_OPT_PERVASIVE</code> is
disabled;
</p>
</li>
<li>
<p>
Xenomai failed to start, check the <a href="#kerror">"Xenomai or I-pipe error in the kernel log"</a> section;
</p>
</li>
<li>
<p>
you are trying to run Xenomai user-space support compiled for x86_32
on an x86_64 kernel.
</p>
</li>
</ul></div>
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1309
<h4 id="_the_application_overconsumes_system_memory">2.10.11. the application overconsumes system memory</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
<div class="paragraph"><p>Your user-space application unexpectedly commits a lot of virtual
memory, as reported by "<code>top</code>" or <em>/proc/&lt;pid&gt;/maps</em>. Sometimes OOM
situations may even appear during runtime on systems with limited
memory.</p></div>
<div class="paragraph"><p>The reason is that Xenomai threads are underlaid by regular POSIX
threads, for which a large default amount of stack space memory is
commonly reserved by the POSIX threading library (8MiB per thread by
the <em>glibc</em>). Therefore, the kernel will commit as much as
<em>8MiB&#160;*&#160;nr_threads</em> bytes to RAM space for the application,
as a side-effect of calling the <code>mlockall()</code> service to lock the
process memory, as Xenomai requires.</p></div>
<div class="paragraph"><p>This behaviour can be controlled in two ways:</p></div>
<div class="ulist"><ul>
<li>
<p>
via the <em>stacksize</em> parameter passed to the various thread creation
routines, or <code>pthread_attr_setstacksize()</code> directly when using the
POSIX API.
</p>
</li>
<li>
<p>
by setting a lower user-limit for the initial stack allocation from
the application&#8217;s parent shell which all threads from the child
process inherit, as illustrated below:
Philippe Gerum's avatar
Philippe Gerum committed
1335 1336 1337 1338 1339
</p>
</li>
</ul></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1340
<pre><code>ulimit -s &lt;initial-size-in-kbytes&gt;</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
1341
</div></div>
Philippe Gerum's avatar
Philippe Gerum committed
1342 1343
</div>
<div class="sect3">
Philippe Gerum's avatar
Philippe Gerum committed
1344
<h4 id="_freeze_or_machine_lockup">2.10.12. freeze or machine lockup</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1345
<div class="paragraph"><p>Possible reasons may be:</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1346 1347 1348
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361
Stack space overflow issue now biting some real-time kernel thread?
</p>
</li>
<li>
<p>
Spurious delay/timeout values computed by the application
(specifically: too short).
</p>
</li>
<li>
<p>
A case of freeze is a system call called in a loop which fails
without its return value being properly checked.
Philippe Gerum's avatar
Philippe Gerum committed
1362 1363 1364
</p>
</li>
</ul></div>
Philippe Gerum's avatar
Philippe Gerum committed
1365 1366 1367 1368 1369 1370
<div class="paragraph"><p>On x86, whenever the nucleus watchdog does not trigger, you may want to
try disabling CONFIG_X86_UP_IOAPIC while keeping CONFIG_X86_UP_APIC, and
arm the kernel NMI watchdog on the LAPIC (nmi_watchdog=2). You may be
lucky and have a backtrace after the freeze. Maybe enabling all the
nucleus debug options would catch something too.</p></div>
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1371
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1372 1373 1374 1375 1376
</div>
</div>
<div class="sect1">
<h2 id="_issues_when_running_xenomai_test_programs">3. Issues when running Xenomai test programs</h2>
<div class="sectionbody">
Philippe Gerum's avatar
Philippe Gerum committed
1377
<div class="sect2">
Philippe Gerum's avatar
Philippe Gerum committed
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
<h3 id="latency">3.1. Issues when running the <em>latency</em> test</h3>
<div class="paragraph"><p>The first test to run to see if Xenomai is running correctly on your
platform is the latency test. The following sections describe the
usual reasons for this test not to run correctly.</p></div>
<div class="sect3">
<h4 id="_failed_to_open_benchmark_device">3.1.1. failed to open benchmark device</h4>
<div class="paragraph"><p>You have launched <code>latency -t 1</code> or <code>latency -t 2</code> which both require
the kernel to have been configured with the
<code>CONFIG_XENO_DRIVERS_TIMERBENCH</code> option.</p></div>
</div>
<div class="sect3">
<h4 id="_the_em_latency_em_test_hangs">3.1.2. the <em>latency</em> test hangs</h4>
<div class="paragraph"><p>The most common reason for this issues is a too short period passed
with the <code>-p</code> option, try increasing the period. If you enable the
watchdog (option <code>CONFIG_XENO_OPT_WATCHDOG</code>, in your kernel
configuration), you should see the <a href="#short-period">"watchdog triggered (period too short?)"</a> message.</p></div>
</div>
<div class="sect3">
<h4 id="short-period">3.1.3. watchdog triggered (period too short?)</h4>
<div class="paragraph"><p>The built-in Xenomai watchdog has stopped the <em>latency</em> test because
it was using all the CPU in pure real-time mode (aka <em>primary
mode</em>). This is likely due to a too short period.  Run the <em>latency</em>
test again, passing a longer period using the <code>-p</code> option this time.</p></div>
</div>
<div class="sect3">
<h4 id="_the_em_latency_em_test_shows_high_latencies">3.1.4. the <em>latency</em> test shows high latencies</h4>
<div class="paragraph"><p>The <em>latency</em> test runs, but you are seeing high latencies.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1405 1406 1407
<div class="ulist"><ul>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1408
make sure that you carefully followed the <a href="#kconf">"Kernel configuration" section</a>.
Philippe Gerum's avatar
Philippe Gerum committed
1409 1410 1411 1412
</p>
</li>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1413 1414
if running on a Raspberry Pi SBC, make sure you don&#8217;t hit a firmware
issue, see <a href="https://github.com/raspberrypi/firmware/issues/497">https://github.com/raspberrypi/firmware/issues/497</a>.
Philippe Gerum's avatar
Philippe Gerum committed
1415 1416 1417 1418
</p>
</li>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1419 1420 1421 1422 1423 1424 1425 1426
if running on a x86 platform, make sure that you do not have an
issue with SMIs, see the <a href="#SMI">section about SMIs</a>.
</p>
</li>
<li>
<p>
if running on a x86 platform with a <em>legacy USB</em> switch available
from the BIOS configuration, try disabling it.
Philippe Gerum's avatar
Philippe Gerum committed
1427 1428 1429 1430
</p>
</li>
<li>
<p>
Philippe Gerum's avatar
Philippe Gerum committed
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450
if you do not have this option at BIOS configuration level, it does
not necessarily mean that there is no support for it, thus no
potential for high latencies; this support might just be forcibly
enabled at boot time. To solve this, in case your machine has some USB
controller hardware, make sure to enable the corresponding host
controller driver support in your kernel configuration. For instance,
UHCI-compliant hardware needs <code>CONFIG_USB_UHCI_HCD</code>. As part of its
init chores, the driver should reset the host controller properly,
kicking out the BIOS off the concerned hardware, and deactivate the
USB legacy mode if set in the same move.
</p>
</li>
<li>
<p>
if you observe high latencies while running X-window, try disabling
hardware acceleration in the X-window server file. With recent
versions of X-window, try using the <em>fbdev</em> driver. Install it
(Debian package named <em>xserver-xorg-video-fbdev</em> for instance), then
modifiy the <code>Device</code> section to use this driver in
<em>/etc/X11/xorg.conf</em>, as in:
Philippe Gerum's avatar
Philippe Gerum committed
1451 1452 1453 1454 1455
</p>
</li>
</ul></div>
<div class="listingblock">
<div class="content">
Philippe Gerum's avatar
Philippe Gerum committed
1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
<pre><code>Section "Device"
        Identifier  "Card0"
        Driver      "fbdev"
EndSection</code></pre>
</div></div>
<div class="paragraph"><p>With olders versions of X-window, keep the existing driver, but
add the following line to the <code>Device</code> section:</p></div>
<div class="listingblock">
<div class="content">
<pre><code>        Option "NoAccel"</code></pre>
Philippe Gerum's avatar
Philippe Gerum committed
1466
</div></div>
Philippe Gerum's avatar
Philippe Gerum committed
1467 1468 1469 1470 1471 1472
</div>
</div>
<div class="sect2">
<h3 id="_issues_when_running_the_em_switchtest_em_program">3.2. Issues when running the <em>switchtest</em> program</h3>
<div class="sect3">
<h4 id="_pthread_create_resource_temporarily_unavailable">3.2.1. pthread_create: Resource temporarily unavailable</h4>
Philippe Gerum's avatar
Philippe Gerum committed
1473 1474 1475 1476 1477 1478 1479 1480
<div class="paragraph"><p>The switchtest test creates many kernel threads, an operation which
consumes memory taken from internal pools managed by the Xenomai
real-time core.</p></div>
<div class="paragraph"><p>Xenomai 2.x and 3.x series require <code>CONFIG_XENO_OPT_SYS_HEAPSZ</code> to be
large enough in the kernel configuration settings, to cope with the
allocation requests.</p></div>
<div class="paragraph"><p>Xenomai 2.x may also require to increase the
<code>CONFIG_XENO_OPT_SYS_STACKPOOLSZ</code> setting.</p></div>
Philippe Gerum's avatar
Philippe Gerum committed
1481
</div>
Philippe Gerum's avatar
Philippe Gerum committed
1482 1483 1484 1485 1486 1487 1488
</div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Philippe Gerum's avatar
Philippe Gerum committed
1489
Last updated 2017-04-02 16:42:05 CEST
Philippe Gerum's avatar
Philippe Gerum committed
1490 1491 1492 1493
</div>
</div>
</body>
</html>