> Factor out the code to change index from x86_fsbase_write_cpu() and > x86_gsbase_write_cpu_inactive(). Now the code is located in > do_arch_prctl_64(). > > The helper functions that purport to write the base register should just > write the > base register only. It shouldn't have magic optimizations to change the index. > > putreg() in ptrace does not write the current task, but a stopped task. >
Wm, I just realized that the changelog should also clearly include this: "While at here, subsequently factor out the read for the current task's base from x86_fsbase_read_task() and x86_gsbase_read_task() to do_arch_prctl_64()." Sorry for this. Let me know if you feel it should go as a separate patch. Chang