diff options
author | Dmitry Safonov <dsafonov@virtuozzo.com> | 2016-04-18 21:02:00 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@virtuozzo.com> | 2017-03-14 21:03:21 +0300 |
commit | 6068d10cee4a7976876d7a8a9d24fd40ffdbb1b9 (patch) | |
tree | dbeae70b16280bc0e025b970fc2896f29dad8015 /images/core-x86.proto | |
parent | d94b9f3065057b8e3eb49a519499764dcacd3409 (diff) |
core/x86: add compatible 32 register set
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@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'images/core-x86.proto')
-rw-r--r-- | images/core-x86.proto | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/images/core-x86.proto b/images/core-x86.proto index a3fa1759e..6c084e5ca 100644 --- a/images/core-x86.proto +++ b/images/core-x86.proto @@ -2,6 +2,12 @@ syntax = "proto2"; import "opts.proto"; +enum user_x86_regs_case_t { + NATIVE = 1; + COMPAT = 2; +} + +/* Reusing entry for both 64 and 32 bits register sets */ message user_x86_regs_entry { required uint64 r15 = 1; required uint64 r14 = 2; @@ -30,6 +36,7 @@ message user_x86_regs_entry { required uint64 es = 25; required uint64 fs = 26; required uint64 gs = 27; + optional user_x86_regs_case_t gpregs_case = 28 [default = NATIVE]; } message user_x86_xsave_entry { |