[CRIU] [PATCHv3 26/26] x86: restore TLS

Dmitry Safonov dsafonov at virtuozzo.com
Mon Jun 20 07:36:15 PDT 2016


On 06/20/2016 05:13 PM, Cyrill Gorcunov wrote:
> On Mon, Jun 20, 2016 at 04:42:57PM +0300, Dmitry Safonov wrote:
>> +
>> +extern unsigned long call32_from_64(void *stack, void *func);
>> +
>> +asm (	"	.pushsection .text				\n"
>> +	"	.global restore_set_thread_area			\n"
>> +	"	.code32						\n"
>> +	"restore_set_thread_area:				\n"
>> +	"	mov %edx, %ebx					\n"
>> +	"	movl $"__stringify(__NR32_set_thread_area)",%eax\n"
>> +	"	int $0x80					\n"
>> +	"	ret						\n"
>> +	"	.code64");
>> +extern char restore_set_thread_area;
>
> Don't you rather have to popsection instead of .code64?
> The rest looks good for me.

Well, yeah, I'll add .popsection -- copy-paste unattention:
the same missing at sysret_ss_attrs.c selftest, where from
I got call32_from_64 helper. For the selftest it's ok:
sections stack is empty, but for criu may be some problems
with such missings.

But .code64 should stay, otherwise with .popsection added:
/tmp/ccNBlOW4.s:212: Error: `movslq' is only supported in 64-bit mode
/tmp/ccNBlOW4.s:214: Error: bad register name `%rax'
/tmp/ccNBlOW4.s:216: Error: bad register name `%rbx'
/tmp/ccNBlOW4.s:223: Error: bad register name `%r12'


>
> Reviewed-by: Cyrill Gorcunov <gorcunov at openvz.org>

Thanks!

I think, I'm gonna resend the set today, as I got patch for zdtm
and ptrace-signals patch is comming (I hope it'll be done today).
So, if you got some time -- could you glance for at least trivial
things, which I may forget like builtin_memcpy? So I'll resend
the set corrected & tested.
It's fine if you don't have time now -- I'll resend it as-is with
new patches/fixes.


More information about the CRIU mailing list