[CRIU] [PATCH 14/15] core/x86: add compatible 32 register set

Cyrill Gorcunov gorcunov at gmail.com
Mon Apr 11 13:06:02 PDT 2016


On Mon, Apr 11, 2016 at 03:19:28PM +0300, Dmitry Safonov wrote:
> Introduced user_regs_struct32.
> Other changes mainly are reforming existing code to use the new
> register sets union.
> 
> For protobuf images - reuse user_x86_regs_entry for both compatible
> and native tasks with enum in the beggining that describes register
> set type. That's better and simpler, than introducing a new 32-bit
> register set for compatible tasks. I tried to do this firstly with
> oneof keyword:
> https://github.com/0x7f454c46/criu/commit/499c93ae0e2b8ffb8c562f309bb046d77d6b07c0
> But protobuf supports oneof keyword only from recent version 2.6.0,
> so I tried to rework it into enum + 2 register sets:
> https://github.com/0x7f454c46/criu/commit/aab4489bd4e0b1360b6e05614c2fce3ff2a52eb7
> 
> But that did not work either because restorer pie takes gpregs as
> thread_restore_args parameter and UserRegsEntry shouldn't contain
> pointers, but structure objects. This may be fixed by redefining
> UserRegsEntry not as typedef for UserX86RegsEntry, but containing
> needed objects, than treat it right for restorer - but that's
> more complicated that reusing user_x86_regs_entry.
> 
> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov at openvz.org>


More information about the CRIU mailing list