[CRIU] [PATCH 3/5] [RFC] protobuf: added description of messages to store the AArch64 CPU state

Alexander Kartashov alekskartashov at parallels.com
Tue Feb 4 22:14:38 PST 2014


These messages are constructed in the same spirit as ARM and x86 ones
except for two major points:

* general-purpose registers are stored in a variable-length array
  of uint64's: the architecture provides 32 general-purpose registers
  that makes it unfeasible to create a separate protobuf field
  for each of them since it requires a lot of "copy-paste" to convert
  between the struct pt_regs and protobuf message; the length of
  the array storing registers is to be checked by the architecture-
  dependent CRIU code;

* AArch64 FP/SIMD registers are 128 bit long while protobuf lacks
  the support for integers of this size; the FP/SIMD registers
  are stored in an array of uint64, two consecutive elements
  of the array represent a single FP/SIMD register.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 protobuf/Makefile           |    1 +
 protobuf/core-aarch64.proto |   18 ++++++++++++++++++
 protobuf/core.proto         |    3 +++
 3 files changed, 22 insertions(+)
 create mode 100644 protobuf/core-aarch64.proto

diff --git a/protobuf/Makefile b/protobuf/Makefile
index 2bfd696..7df74ac 100644
--- a/protobuf/Makefile
+++ b/protobuf/Makefile
@@ -13,6 +13,7 @@ proto-obj-y	+= stats.o
 proto-obj-y	+= core.o
 proto-obj-y	+= core-x86.o
 proto-obj-y	+= core-arm.o
+proto-obj-y	+= core-aarch64.o
 proto-obj-y	+= inventory.o
 proto-obj-y	+= fdinfo.o
 proto-obj-y	+= fown.o
diff --git a/protobuf/core-aarch64.proto b/protobuf/core-aarch64.proto
new file mode 100644
index 0000000..b29425e
--- /dev/null
+++ b/protobuf/core-aarch64.proto
@@ -0,0 +1,18 @@
+message user_aarch64_regs_entry {
+	repeated uint64 regs	= 1;
+	required uint64 sp	= 2;
+	required uint64 pc	= 3;
+	required uint64 pstate	= 4;
+}
+
+message user_aarch64_fpsimd_context_entry {
+	repeated uint64 vregs	= 1;
+	required uint32 fpsr	= 2;
+	required uint32 fpcr	= 3;
+}
+
+message thread_info_aarch64 {
+	required uint64			 		clear_tid_addr	= 1;
+	required user_aarch64_regs_entry		gpregs		= 2;
+	required user_aarch64_fpsimd_context_entry	fpsimd		= 3;
+}
diff --git a/protobuf/core.proto b/protobuf/core.proto
index f358930..8cb2a79 100644
--- a/protobuf/core.proto
+++ b/protobuf/core.proto
@@ -1,5 +1,6 @@
 import "core-x86.proto";
 import "core-arm.proto";
+import "core-aarch64.proto";
 
 message task_core_entry {
 	required uint32			task_state	= 1;
@@ -46,11 +47,13 @@ message core_entry {
 		UNKNOWN		= 0;
 		X86_64		= 1;
 		ARM             = 2;
+		AARCH64		= 3;
 	}
 
 	required march			mtype		= 1;
 	optional thread_info_x86	thread_info	= 2;
 	optional thread_info_arm	ti_arm		= 6;
+	optional thread_info_aarch64	ti_aarch64	= 7;
 
 	optional task_core_entry	tc		= 3;
 	optional task_kobj_ids_entry	ids		= 4;
-- 
1.7.9.5



More information about the CRIU mailing list