aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei/erst.c
diff options
context:
space:
mode:
authorAruna Balakrishnaiah <aruna@linux.vnet.ibm.com>2013-08-16 16:57:26 -0400
committerTony Luck <tony.luck@intel.com>2013-08-19 14:53:40 -0400
commit901037ba31c09132b820f2a21b66444fca735749 (patch)
treec877eee9042216f3fcd9c79c37710d8aca9aaf82 /drivers/acpi/apei/erst.c
parent40594264bd622e0865a981f14b98d9e09bc50b14 (diff)
erst: Read and write to the 'compressed' flag of pstore
In pstore write, set the section type to CPER_SECTION_TYPE_DMESG_COMPR if the data is compressed. In pstore read, read the section type and update the 'compressed' flag accordingly. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/acpi/apei/erst.c')
-rw-r--r--drivers/acpi/apei/erst.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index b412e9137e36..822b1ed3b00f 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -958,6 +958,9 @@ static struct pstore_info erst_info = {
958#define CPER_SECTION_TYPE_DMESG \ 958#define CPER_SECTION_TYPE_DMESG \
959 UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \ 959 UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \
960 0x94, 0x19, 0xeb, 0x12) 960 0x94, 0x19, 0xeb, 0x12)
961#define CPER_SECTION_TYPE_DMESG_Z \
962 UUID_LE(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \
963 0x34, 0xdd, 0xfa, 0xc6)
961#define CPER_SECTION_TYPE_MCE \ 964#define CPER_SECTION_TYPE_MCE \
962 UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ 965 UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \
963 0x04, 0x4a, 0x38, 0xfc) 966 0x04, 0x4a, 0x38, 0xfc)
@@ -1036,7 +1039,12 @@ skip:
1036 } 1039 }
1037 memcpy(*buf, rcd->data, len - sizeof(*rcd)); 1040 memcpy(*buf, rcd->data, len - sizeof(*rcd));
1038 *id = record_id; 1041 *id = record_id;
1042 *compressed = false;
1039 if (uuid_le_cmp(rcd->sec_hdr.section_type, 1043 if (uuid_le_cmp(rcd->sec_hdr.section_type,
1044 CPER_SECTION_TYPE_DMESG_Z) == 0) {
1045 *type = PSTORE_TYPE_DMESG;
1046 *compressed = true;
1047 } else if (uuid_le_cmp(rcd->sec_hdr.section_type,
1040 CPER_SECTION_TYPE_DMESG) == 0) 1048 CPER_SECTION_TYPE_DMESG) == 0)
1041 *type = PSTORE_TYPE_DMESG; 1049 *type = PSTORE_TYPE_DMESG;
1042 else if (uuid_le_cmp(rcd->sec_hdr.section_type, 1050 else if (uuid_le_cmp(rcd->sec_hdr.section_type,
@@ -1087,7 +1095,10 @@ static int erst_writer(enum pstore_type_id type, enum kmsg_dump_reason reason,
1087 rcd->sec_hdr.flags = CPER_SEC_PRIMARY; 1095 rcd->sec_hdr.flags = CPER_SEC_PRIMARY;
1088 switch (type) { 1096 switch (type) {
1089 case PSTORE_TYPE_DMESG: 1097 case PSTORE_TYPE_DMESG:
1090 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG; 1098 if (compressed)
1099 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG_Z;
1100 else
1101 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_DMESG;
1091 break; 1102 break;
1092 case PSTORE_TYPE_MCE: 1103 case PSTORE_TYPE_MCE:
1093 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE; 1104 rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE;