[LITMUS^RT] New release: 2012.3
Andrea Bastoni
bastoni at sprg.uniroma2.it
Wed Jan 16 17:20:41 CET 2013
On Wed, Jan 16, 2013 at 5:04 PM, Felipe Cerqueira
<felipeqcerqueira at gmail.com> wrote:
>
>
> 2013/1/16 Björn Brandenburg <bbb at mpi-sws.org>
>>
>>
>> On Jan 16, 2013, at 2:55 PM, Felipe Cerqueira <felipeqcerqueira at gmail.com>
>> wrote:
>> > I was checking the dev boards with Manohar and we got some kernel
>> > compilation errors in the iMx6 SABRELITE.
>> > Could anyone try to reproduce this cross-compiling 2012.3 for ARM?
>> >
>> > 1) In sys_release_ts() sync.c,
>> > when litmus_clock() is divided by ONE_MS, it causes undefined reference
>> > to `__aeabi_uldivmod'.
>> > It seems this function is called by the compiler to optimize a division
>> > followed by a modulo.
>> > I had a look at litmus_clock() but I didn't find the modulo operation.
>> > Anyway, I had to change it to this to make it work:
>> >
>> > /* round up to next larger integral millisecond */
>> > //start_time = ((litmus_clock() / ONE_MS) + 1) * ONE_MS;
>> > start_time = litmus_clock();
>> > do_div(start_time,ONE_MS);
>> > start_time = (start_time + 1) * ONE_MS;
>>
>> Yes, that code needs a do_div().
>>
>> > 2) The use of cmpxchg in request_exit_np_atomic() makes a __bad_cmpxchg
>> > show up.
>> > __bad_cmpxchg is raised when you try to use cmpxchg with variables of
>> > certain size.
>> > Since it's not implemented in the kernel, we also get a undefined
>> > reference error.
>>
>> 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.
>>
>
> Hmm it seems it is possible, at least for the arm boards with Cortex A11 and
> A15.
> They correspond to instruction set ARMv7AR. Linux considered ARMv7-M, which
> apparently didn't have them.
> Linux support complete 64-bit operations only in arch/arm64 (armv8) in the
> newer kernels, which will be supported in the future processors.
>
> The instructions we can use are LDREXD and STREXD.
Hi,
By reading the ARM v7AR reference manual (A3.5.3 Atomicity in the ARM
architecture), it does not seems straightforward to me to support
atomic 64-bit ops on ARMv7, and usually, dealing with this kind of
stuff is quite time consuming.
IMHO, if it's not an issue to have 32 bit only atomic in the current
litmus (for ARM), I think it's easier/faster to wait for the kernel
people to add appropriate support for atomic 64 on ARM, and go back to
32-only for the moment on ARM.
Just my 2 cents,
Best,
- Andrea
>> (These bugs show that we need to improve our test coverage on
>> ARM—apparently nobody tried building the kernel on ARM before the release.)
>>
>> - Björn
More information about the litmus-dev
mailing list