<br><br><div class="gmail_quote">2013/1/16 Björn Brandenburg <span dir="ltr"><<a href="mailto:bbb@mpi-sws.org" target="_blank">bbb@mpi-sws.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
On Jan 16, 2013, at 2:55 PM, Felipe Cerqueira <<a href="mailto:felipeqcerqueira@gmail.com">felipeqcerqueira@gmail.com</a>> wrote:<br>
> I was checking the dev boards with Manohar and we got some kernel compilation errors in the iMx6 SABRELITE.<br>
> Could anyone try to reproduce this cross-compiling 2012.3 for ARM?<br>
><br>
> 1) In sys_release_ts() sync.c,<br>
> when litmus_clock() is divided by ONE_MS, it causes undefined reference to `__aeabi_uldivmod'.<br>
> It seems this function is called by the compiler to optimize a division followed by a modulo.<br>
> I had a look at litmus_clock() but I didn't find the modulo operation.<br>
> Anyway, I had to change it to this to make it work:<br>
><br>
>         /* round up to next larger integral millisecond */<br>
>         //start_time = ((litmus_clock() / ONE_MS) + 1) * ONE_MS;<br>
>         start_time = litmus_clock();<br>
>         do_div(start_time,ONE_MS);<br>
>         start_time = (start_time + 1) * ONE_MS;<br>
<br>
</div>Yes, that code needs a do_div().<br>
<div class="im"><br>
> 2) The use of cmpxchg in request_exit_np_atomic() makes a __bad_cmpxchg show up.<br>
> __bad_cmpxchg is raised when you try to use cmpxchg with variables of certain size.<br>
> Since it's not implemented in the kernel, we also get a undefined reference error.<br>
<br>
</div>Patch 173e46b1ea0305ab74ab8e6a4b4461e296b83922 changed the NP flag to use 64 bits. Apparently ARM can't do a 64bit cmpxchg. Fixing this will require changing the size of the NP flag back to 31 bits and adjusting the padding accordingly.<br>


<br></blockquote><div><br>Hmm it seems it is possible, at least for the arm boards with Cortex A11 and A15.<br>They correspond to instruction set ARMv7AR. Linux considered ARMv7-M, which apparently didn't have them.<br>

Linux support complete 64-bit operations only in arch/arm64 (armv8) in the newer kernels, which will be supported in the future processors.<br><br>The instructions we can use are LDREXD and STREXD.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


(These bugs show that we need to improve our test coverage on ARM—apparently nobody tried building the kernel on ARM before the release.)<br>
<span class="HOEnZb"><font color="#888888"><br>
- Björn<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
litmus-dev mailing list<br>
<a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br>
<a href="https://lists.litmus-rt.org/listinfo/litmus-dev" target="_blank">https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
</div></div></blockquote></div><br>