<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 4, 2019 at 5:07 PM Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/2/19 6:53 am, Joel Sherrill wrote:<br>
> Then we should ensure proper alignment since we NEVER want an unaligned<br>
> exception on any architecture if it is avoidable. No point in taking the likely<br>
> performance hit or exception. <br>
<br>
Is this documented anywhere?<br></blockquote><div><br></div><div>Unless it is in the porting guide, I doubt it. Alignment issues for critical structures</div><div>and the stack is a porting issue.</div><div><br></div><div>I was just thinking of the m68k where it allowed unaligned accesses but there</div><div>was often a hidden performance penalty. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
It is an important issue because a performance hit such as unaligned accesses<br>
silently happening is difficult to see and it tends to be accounted for as RTEMS<br>
not performing or hardware not performing. Is this something we could test for<br>
and check?<br></blockquote><div><br></div><div>I don't know if it could be a static assertion but it could be a debug check.</div><div>It could certainly be checked with a normal test which peeked under the hood.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I personally have never stopped and checked a BSP for correct alignment in all<br>
cases or the critical cases before using and when something exposes it I have<br>
been surprised.<br></blockquote><div><br></div><div>Me too. We all assume that alignment was thought through by the person who </div><div>did the port. Similar to finding caching disabled on a BSP.</div><div><br></div><div>I suppose if we identify the critical structures that a test could check them all.</div><div>But we should be careful about this. What is minimum needed and what is</div><div>for performance? 4 or 8 byte alignments would avoid faults/unaligned accesses.</div><div>16 or 32 byte would be performance helps on many architectures for larger</div><div>structures.</div><div><br></div><div>--joel</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Chris<br>
</blockquote></div></div>