Home
last modified time | relevance | path

Searched hist:b166fabf3e8c35de38ccc77a870b58941f73cb83 (Results 1 – 4 of 4) sorted by relevance

/optee_os/core/arch/arm/kernel/
H A Dentry_a32.Sb166fabf3e8c35de38ccc77a870b58941f73cb83 Fri Jun 05 15:01:28 UTC 2020 Jerome Forissier <jerome@forissier.org> core: initialize thread_core_local::curr_thread to -1

The struct thread_core_local for each CPU is global, hence initialized
to zero when .bss is cleared. So before threads are initialized we have
a seemingly valid curr_thread value (0) when we should really have -1.
thread_get_id_may_fail() can return 0 although there is no current
thread.

Fix this by setting curr_thread to -1 earlier in the boot.

Note: this moves code out of thread_init_threads(), which is called by
virt_guest_created() when virtualization is enabled. I think it is the
right thing to do because I see no reason why the thread_core_local
structures should be cleared when a guest is added (the data belong to
.nex_bss).

Signed-off-by: Jerome Forissier <jerome@forissier.org>
CC: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
H A Dentry_a64.Sb166fabf3e8c35de38ccc77a870b58941f73cb83 Fri Jun 05 15:01:28 UTC 2020 Jerome Forissier <jerome@forissier.org> core: initialize thread_core_local::curr_thread to -1

The struct thread_core_local for each CPU is global, hence initialized
to zero when .bss is cleared. So before threads are initialized we have
a seemingly valid curr_thread value (0) when we should really have -1.
thread_get_id_may_fail() can return 0 although there is no current
thread.

Fix this by setting curr_thread to -1 earlier in the boot.

Note: this moves code out of thread_init_threads(), which is called by
virt_guest_created() when virtualization is enabled. I think it is the
right thing to do because I see no reason why the thread_core_local
structures should be cleared when a guest is added (the data belong to
.nex_bss).

Signed-off-by: Jerome Forissier <jerome@forissier.org>
CC: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
H A Dboot.cb166fabf3e8c35de38ccc77a870b58941f73cb83 Fri Jun 05 15:01:28 UTC 2020 Jerome Forissier <jerome@forissier.org> core: initialize thread_core_local::curr_thread to -1

The struct thread_core_local for each CPU is global, hence initialized
to zero when .bss is cleared. So before threads are initialized we have
a seemingly valid curr_thread value (0) when we should really have -1.
thread_get_id_may_fail() can return 0 although there is no current
thread.

Fix this by setting curr_thread to -1 earlier in the boot.

Note: this moves code out of thread_init_threads(), which is called by
virt_guest_created() when virtualization is enabled. I think it is the
right thing to do because I see no reason why the thread_core_local
structures should be cleared when a guest is added (the data belong to
.nex_bss).

Signed-off-by: Jerome Forissier <jerome@forissier.org>
CC: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
H A Dthread.cb166fabf3e8c35de38ccc77a870b58941f73cb83 Fri Jun 05 15:01:28 UTC 2020 Jerome Forissier <jerome@forissier.org> core: initialize thread_core_local::curr_thread to -1

The struct thread_core_local for each CPU is global, hence initialized
to zero when .bss is cleared. So before threads are initialized we have
a seemingly valid curr_thread value (0) when we should really have -1.
thread_get_id_may_fail() can return 0 although there is no current
thread.

Fix this by setting curr_thread to -1 earlier in the boot.

Note: this moves code out of thread_init_threads(), which is called by
virt_guest_created() when virtualization is enabled. I think it is the
right thing to do because I see no reason why the thread_core_local
structures should be cleared when a guest is added (the data belong to
.nex_bss).

Signed-off-by: Jerome Forissier <jerome@forissier.org>
CC: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>