[CRIU] [PATCH] Wire up AArch64 TLS dump and restore

Christopher Covington cov at codeaurora.org
Thu Feb 27 07:22:55 PST 2014


On 02/18/2014 10:07 AM, Christopher Covington wrote:
> On 02/17/2014 12:37 PM, Alexander Kartashov wrote:
>> On 02/15/2014 03:18 AM, Christopher Covington wrote:
>>> I wonder why ptrace isn't being used by existing architecture
>>> ports for TLS registers
>> That's my fault: I haven't known that it's possible to fetch
>> the value of the TLS register using ptrace(). I shall consider
>> moving the TLS fetchr and store routines to ptrace().
> 
> I've not tested it out for more than a trivial case--it may may not work
> exactly right in all cases, but I would suspect that if GDB is using it, it
> should be pretty robust.
> 
> My guess would be that x86_64 set the example of using GETREGS because at the
> time it was better documented than GETREGSET. From a brief glance through the
> kernel code, GETREGS doesn't include TLS registers, so an
> architecture-specific method was employed. I only stumbled across the TLS
> support case in the kernel code for GETREGSET because I was tracing through
> how your AArch64 patches worked, which were influenced by the fact that the
> AArch64 kernel code doesn't implement GETREGS.
> 
> It's certainly easier to add support for a new architecture when it follows
> the example of the other ports, so I wouldn't recommend gating the AArch64
> support on using ptrace for TLS, but maybe down the road if all of the
> architectures moved to GETREGSET, more of the register dumping code could
> become generic across architectures.

It looks like support for NT_ARM_TLS is missing for A32. I'll add that onto my
someday/maybe list. Also, u32 seemed to work for one test case but is
insufficient for other A64 cases. I should have a revised patch in a few days
that uses unsigned long like the kernel in C code and u64 in protobuf. Any
progress on the test suite pass rate? I've been using other programs to test
for the moment but I hope to start running the test suite in the future.

Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.


More information about the CRIU mailing list