Re: Re: Possible tls bug on arm / microblaze

2022-10-19 Thread Sam Price
Sebastian,
I think you fixed this for me in this commit.
Do you know if this got run / tested on a qemu emulator?

commit 4c89fbcd316ca99fa16a0acc31f88fb80cb3060f
Author: Sebastian Huber 
Date:   Tue Sep 27 07:43:37 2022 +0200

score: Add CPU_THREAD_LOCAL_STORAGE_VARIANT

Update #3835.

On Wed, Aug 24, 2022 at 11:17 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> I am on holidays until 2022-08-28. For RTEMS related topics please contact
> Christian Mauderer  if it is
> urgent.
>


-- 
Sincerely,

Sam Price
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Possible tls bug on arm / microblaze

2022-08-24 Thread Sam Price
I modified cpukit/score/cpu/microblaze/__tls_get_addr.c
and added a printf
  printf("TLS OFFSET %x %p %p %d",(uintptr_t) _TLS_Alignment,
tls_block,executing->Start.tls_area, ti->offset);
and then ran the splts* tests on my hardware.
The __tls_get_addr in the splts* tests.

*** BEGIN OF TEST SPTLS 1 ***
*** TEST VERSION: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
TLS item = 123
TLS item = 123
TLS item = 5

*** END OF TEST SPTLS 1 ***


[ RTEMS shutdown ]
RTEMS version: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
RTEMS tools: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
executing thread ID: 0x08a010001
executing thread name: UI1


*** BEGIN OF TEST SPTLS 2 ***
*** TEST VERSION: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
A::globalCounter() = 0
../../../testsuites/sptests/sptls02/init.cc: 168 extern_int == 7

[ RTEMS shutdown ]
RTEMS version: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
RTEMS tools: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
executing thread ID: 0x08a010001
executing thread name: UI1

RTEMS version: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
RTEMS tools: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
executing thread ID: 0x08a010001
executing thread name: UI1


*** BEGIN OF TEST SPTLS 3 ***
*** TEST VERSION: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)

*** END OF TEST SPTLS 3 ***


[ RTEMS shutdown ]
RTEMS version: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
RTEMS tools: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
executing thread ID: 0x08a010001
executing thread name: UI1

*** BEGIN OF TEST SPTLS 4 ***
*** TEST VERSION: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)

*** END OF TEST SPTLS 4 ***


[ RTEMS shutdown ]
RTEMS version: 6.0.0.0cb37ce45e81a2b030cbd99678a42884bc864f84
RTEMS tools: 10.3.1 20220622 (RTEMS 6, RSB
5a19dda19ffaaa43305af1f34597fd4d8165029b, Newlib 27fd806)
executing thread ID: 0x08a010001
executing thread name: UI1

On Tue, Jul 19, 2022 at 2:25 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 19/07/2022 20:10, Sam Price wrote:
> >
> > Where would the ti->offset member be updated / initialized at?
>
> The caller of __tls_get_addr() has to do this. On ARM, this is function
> is normally not used.
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@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/
>


-- 
Sincerely,

Sam Price
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Possible tls bug on arm / microblaze

2022-07-19 Thread Sebastian Huber

On 19/07/2022 20:10, Sam Price wrote:


Where would the ti->offset member be updated / initialized at?


The caller of __tls_get_addr() has to do this. On ARM, this is function 
is normally not used.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@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/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Possible tls bug on arm / microblaze

2022-07-19 Thread Sam Price
At one point I believe a company tested the sptls tests, unsure if they did
this on qemu or hardware.

I'll try running those tests on a recent hash, and back when the company
ran those tests.

Where would the ti->offset member be updated / initialized at?
Only the arm, and microblaze bsps have this in them.

Thanks,
Sam
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Possible tls bug on arm / microblaze

2022-07-19 Thread Sebastian Huber



On 19/07/2022 14:51, Sam Price wrote:

On microblaze i was getting a

ESR: Unaligned data access exception

I narrowed this down to this "ti->offset;" being uninitialized in the 
following two bsps


https://git.rtems.org/rtems/tree/cpukit/score/cpu/microblaze/__tls_get_addr.c 


Also this file
cpukit/score/cpu/arm/__tls_get_addr.c

I tried recompiling with this on the microblaze build with offset being 
renamed to offseta.

This only caused a compilation error in the __tls_get_addr function.
So I think this variable is being used without being initialized or ever 
changed.

Is it safe to just remove the offset variable?


No, it is not safe to remove the offset member. The offset member value 
is provided by the caller of __tls_get_addr(). You have to check that 
TLS_Index definition matches the GCC ABI. Do the sptls* tests run on 
your system?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@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/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Possible tls bug on arm / microblaze

2022-07-19 Thread Sam Price
On microblaze i was getting a

ESR: Unaligned data access exception

I narrowed this down to this "ti->offset;" being uninitialized in the
following two bsps

https://git.rtems.org/rtems/tree/cpukit/score/cpu/microblaze/__tls_get_addr.c
Also this file
cpukit/score/cpu/arm/__tls_get_addr.c

I tried recompiling with this on the microblaze build with offset being
renamed to offseta.
This only caused a compilation error in the __tls_get_addr function.
So I think this variable is being used without being initialized or ever
changed.
Is it safe to just remove the offset variable?

-- 
Thank you,

Sam Price
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel