[PATCH v2 00/13] More robust idle thread creation and TLS handling

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 14 09:54:56 UTC 2022


On 10.10.22 10:17, Sebastian Huber wrote:
> On 06/10/2022 10:23, Sebastian Huber wrote:
>> This patch set started with an 8 byte overwrite of the interrupt stack 
>> while
>> porting an application from RTEMS 5 to 6.
>>
>> The overwrite was due to a mismatch of the size returned by
>> _TLS_Get_allocation_size() and the actual usage of the area.  To fix 
>> this issue
>> it was necessary to add a new CPU port option:
>> CPU_THREAD_LOCAL_STORAGE_VARIANT.  I checked also the glibc 
>> implementations.
>> It seems that on some architectures (for example powerpc) the TCB is 
>> used for a
>> couple of more things.  For RTEMS, we don't really need the DTV and 
>> TCB.  It
>> could be useful for debuggers, however, then we probably need also 
>> some glibc
>> compatibility.
>>
>> Add a new fatal error to catch a failing idle thread initialization:
>> INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED.  This can only happen if a 
>> thread
>> create extension fails for an idle thread.
>>
>> By default, allocate the IDLE task storage areas from the RTEMS 
>> Workspace.
>> This avoids having to estimate the thread-local storage size in the 
>> default
>> configuration.
>> Add the application configuration option 
>> CONFIGURE_IDLE_TASK_STORAGE_SIZE to
>> request a static allocation of the task storage area for IDLE tasks.
>>
>> v2:
>>
>> * Add CONFIGURE_IDLE_TASK_STORAGE_SIZE instead of 
>> CONFIGURE_IDLE_TASK_MINIMUM_STACK_SIZE.
> 
> Any objections to commit this version?

I checked in the patch set. All BSPs did build except:

microblaze/kcu105
microblaze/kcu105_qemu

They failed due to:

./librtemscpu.a(threadqops.c.52.o): in function 
`_Thread_queue_Queue_enqueue':
/home/EB/sebastian_h/src/rtems/cpukit/score/src/threadqops.c:102:(.text._Thread_queue_Queue_enqueue+0xb4): 
relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol 
`__assert_func' defined in .text.__assert_func section in 
./librtemscpu.a(__assert.c.52.o)

This seems to be unrelated to the patch set.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list