I read the source code of linux aarch64: https://elixir.bootlin.com/linux/latest/source/arch/arm64/kernel/fpsimd.c#L311
It says that TIF_SVE can control the SVE register state save/restore machanism.
My userspace program is using SVE instructions and runs in an environment where the SVE Vector Length is 256bits. Therefore, the default machanism of SVE state save/restore during interrupts is not enough, as it only saves 128bits of each register. Then my program will fail when an interrupt happens. Thus, I need to set the TIF_SVE flag in my userspace program.
By the way, my userspace program uses OpenMP library.
How can I set the TIF_SVE flag in my userspace program?
I have seen the pthread_attr_t structs in pthread_create() interface.
But I'm not sure there is any relationships between pthread_attr_t
and TIF_SVE
.
And, I searched OpenMP library manual, I've not seen where to set the TIF_SVE
flag.
Now, I know that the TIF_SVE
flag is set by the linux kernel, other than by a system call interface.
After I add some trace_printk()
in fpsimd.c . I find that the do_sve_acc()
is not called. The SVE load/restore using fpsimd_load_state()
and fpsimd_save_state()
functions, other than sve_load_state()
and sve_save_state()
functions. This finding can explain why after interrupts, the z0
register only remains the low 128bits data.
But, why do_sve_acc()
is not called ?