Re: add helper to get value of Thread Local Storage base register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2023 at 8:25 PM <chen.yunxing@xxxxxxxxxx> wrote:
>
> Hi,
>
> I want to discuss the requirement of add bpf helper:
>
> for the purpose of accessing user space variable of TLS(Thread Local Storage),we need get the TLS register of current Thread/Task.
>
> then the TLS variable can be accessed via add offset to this register (as the base)
>
> for example at arm:
>
> mrs x0, tpidr_el0

thread-local storage is only meaningful for user-space, so you don't
need to access actual register state, you can get it from struct
task_struct:

- for x86-64: task->thread.fsbase
- for aarm64: task->thread.uw.tp_value

Each architecture should have a similar field storing thread-local
storage base pointer.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux