Add affinity3 field to json output

Affinity3 in arm processor errors is used to determine the
socket number generating the error. This is critical
information that needs to be presented to the end-user

Change-Id: I66c7d29407bb610625087b0f46e18ff868f7da64
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/include/libcper/sections/cper-section-arm.h b/include/libcper/sections/cper-section-arm.h
index be65731..173d0bc 100644
--- a/include/libcper/sections/cper-section-arm.h
+++ b/include/libcper/sections/cper-section-arm.h
@@ -8,6 +8,8 @@
 #include <json.h>
 #include <libcper/Cper.h>
 
+#define ARM_SOCK_MASK 0xFF00000000
+
 #define ARM_ERROR_VALID_BITFIELD_NAMES                                         \
 	(const char *[])                                                       \
 	{                                                                      \
diff --git a/sections/cper-section-arm.c b/sections/cper-section-arm.c
index 119b30a..b07c829 100644
--- a/sections/cper-section-arm.c
+++ b/sections/cper-section-arm.c
@@ -73,8 +73,15 @@
 	json_object_object_add(section_ir, "errorAffinity", error_affinity);
 
 	//Processor ID (MPIDR_EL1) and chip ID (MIDR_EL1).
+	uint64_t sock;
+	uint64_t mpidr_eli1 = record->MPIDR_EL1;
 	json_object_object_add(section_ir, "mpidrEl1",
-			       json_object_new_uint64(record->MPIDR_EL1));
+			       json_object_new_uint64(mpidr_eli1));
+	//Arm Processor socket info
+	sock = (mpidr_eli1 & ARM_SOCK_MASK) >> 32;
+	json_object_object_add(section_ir, "affinity3",
+			       json_object_new_uint64(sock));
+
 	json_object_object_add(section_ir, "midrEl1",
 			       json_object_new_uint64(record->MIDR_EL1));
 
diff --git a/specification/json/sections/cper-arm-processor.json b/specification/json/sections/cper-arm-processor.json
index 6efb2ae..ec70748 100644
--- a/specification/json/sections/cper-arm-processor.json
+++ b/specification/json/sections/cper-arm-processor.json
@@ -8,6 +8,7 @@
         "sectionLength",
         "errorAffinity",
         "mpidrEl1",
+        "affinity3",
         "midrEl1",
         "running",
         "errorInfo",
@@ -62,6 +63,9 @@
         "mpidrEl1": {
             "type": "integer"
         },
+        "affinity3": {
+            "type": "integer"
+        },
         "midrEl1": {
             "type": "integer"
         },