[CRIU] [PATCH 1/2] protobuf: added description of messages to store the AArch64 CPU state

Alexander Kartashov alekskartashov at parallels.com
Mon Mar 10 02:41:12 PDT 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>
Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
 protobuf/Makefile           |    1 +
 protobuf/core-aarch64.proto |   19 +++++++++++++++++++
 protobuf/core.proto         |    3 +++
 3 files changed, 23 insertions(+)
 create mode 100644 protobuf/core-aarch64.proto

diff --git a/protobuf/Makefile b/protobuf/Makefile
index 317b341..2e40ade 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..dfcead9
--- /dev/null
+++ b/protobuf/core-aarch64.proto
@@ -0,0 +1,19 @@
+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 uint64					tls		= 2;
+	required user_aarch64_regs_entry		gpregs		= 3;
+	required user_aarch64_fpsimd_context_entry	fpsimd		= 4;
+}
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