From 69020eea973d95766e905ee0ce7773e0027377a3 Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Thu, 6 Jun 2013 00:21:44 +0530 Subject: powerpc/pseries: Read rtas partition via pstore This patch set exploits the pstore subsystem to read details of rtas partition in NVRAM to a separate file in /dev/pstore. For instance, rtas details will be stored in a file named [rtas-nvram-4]. Signed-off-by: Aruna Balakrishnaiah Reviewed-by: Jim Keniston Signed-off-by: Benjamin Herrenschmidt --- fs/pstore/inode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/pstore') diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index e4bcb2cf055a..ec24f9ceb5ed 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -324,6 +324,9 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, case PSTORE_TYPE_MCE: sprintf(name, "mce-%s-%lld", psname, id); break; + case PSTORE_TYPE_PPC_RTAS: + sprintf(name, "rtas-%s-%lld", psname, id); + break; case PSTORE_TYPE_UNKNOWN: sprintf(name, "unknown-%s-%lld", psname, id); break; -- cgit v1.2.3 From f33f748c964f6a6ee272b1c794b52f54f4da1d04 Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Thu, 6 Jun 2013 00:22:10 +0530 Subject: powerpc/pseries: Read of-config partition via pstore This patch set exploits the pstore subsystem to read details of of-config partition in NVRAM to a separate file in /dev/pstore. For instance, of-config partition details will be stored in a file named [of-nvram-5]. Signed-off-by: Aruna Balakrishnaiah Reviewed-by: Jim Keniston Signed-off-by: Benjamin Herrenschmidt --- fs/pstore/inode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/pstore') diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index ec24f9ceb5ed..73148aef9e31 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -327,6 +327,9 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, case PSTORE_TYPE_PPC_RTAS: sprintf(name, "rtas-%s-%lld", psname, id); break; + case PSTORE_TYPE_PPC_OF: + sprintf(name, "powerpc-ofw-%s-%lld", psname, id); + break; case PSTORE_TYPE_UNKNOWN: sprintf(name, "unknown-%s-%lld", psname, id); break; -- cgit v1.2.3 From a5e4797b0f46819a74a7233825137ed5d2f51b51 Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Thu, 6 Jun 2013 00:22:20 +0530 Subject: powerpc/pseries: Read common partition via pstore This patch exploits pstore subsystem to read details of common partition in NVRAM to a separate file in /dev/pstore. For instance, common partition details will be stored in a file named [common-nvram-6]. Signed-off-by: Aruna Balakrishnaiah Reviewed-by: Jim Keniston Signed-off-by: Benjamin Herrenschmidt --- fs/pstore/inode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/pstore') diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 73148aef9e31..08c3d76b24ca 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -330,6 +330,9 @@ int pstore_mkfile(enum pstore_type_id type, char *psname, u64 id, int count, case PSTORE_TYPE_PPC_OF: sprintf(name, "powerpc-ofw-%s-%lld", psname, id); break; + case PSTORE_TYPE_PPC_COMMON: + sprintf(name, "powerpc-common-%s-%lld", psname, id); + break; case PSTORE_TYPE_UNKNOWN: sprintf(name, "unknown-%s-%lld", psname, id); break; -- cgit v1.2.3 From 6bbbca735936e15b9431882eceddcf6dff76e03c Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Thu, 27 Jun 2013 14:02:56 +0530 Subject: pstore: Pass header size in the pstore write callback Header size is needed to distinguish between header and the dump data. Incorporate the addition of new argument (hsize) in the pstore write callback. Signed-off-by: Aruna Balakrishnaiah Acked-by: Kees Cook Signed-off-by: Benjamin Herrenschmidt --- fs/pstore/platform.c | 10 ++++++---- fs/pstore/ram.c | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'fs/pstore') diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 86d1038b5a12..4637ec4169cd 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -159,7 +159,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, break; ret = psinfo->write(PSTORE_TYPE_DMESG, reason, &id, part, - oopscount, hsize + len, psinfo); + oopscount, hsize, hsize + len, psinfo); if (ret == 0 && reason == KMSG_DUMP_OOPS && pstore_is_mounted()) pstore_new_entry = 1; @@ -196,7 +196,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) spin_lock_irqsave(&psinfo->buf_lock, flags); } memcpy(psinfo->buf, s, c); - psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, 0, c, psinfo); + psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, 0, 0, c, psinfo); spin_unlock_irqrestore(&psinfo->buf_lock, flags); s += c; c = e - s; @@ -221,9 +221,11 @@ static void pstore_register_console(void) {} static int pstore_write_compat(enum pstore_type_id type, enum kmsg_dump_reason reason, u64 *id, unsigned int part, int count, - size_t size, struct pstore_info *psi) + size_t hsize, size_t size, + struct pstore_info *psi) { - return psi->write_buf(type, reason, id, part, psinfo->buf, size, psi); + return psi->write_buf(type, reason, id, part, psinfo->buf, hsize, + size, psi); } /* diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 1376e5a8f0d6..c6bb77ca35b5 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -195,7 +195,8 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz) static int notrace ramoops_pstore_write_buf(enum pstore_type_id type, enum kmsg_dump_reason reason, u64 *id, unsigned int part, - const char *buf, size_t size, + const char *buf, + size_t hsize, size_t size, struct pstore_info *psi) { struct ramoops_context *cxt = psi->data; -- cgit v1.2.3 From 1d8b368ab4aacfc3f864655baad4d31a3028ec1a Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Tue, 2 Jul 2013 11:06:54 +0530 Subject: pstore: Add hsize argument in write_buf call of pstore_ftrace_call Incorporate the addition of hsize argument in write_buf callback of pstore. This was forgotten in 6bbbca735936e15b9431882eceddcf6dff76e03c pstore: Pass header size in the pstore write callback Causing a build failure when ftrace and pstore are enabled. Signed-off-by: Aruna Balakrishnaiah Signed-off-by: Benjamin Herrenschmidt --- fs/pstore/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/pstore') diff --git a/fs/pstore/ftrace.c b/fs/pstore/ftrace.c index 43b12807a51d..76a4eeb92982 100644 --- a/fs/pstore/ftrace.c +++ b/fs/pstore/ftrace.c @@ -44,7 +44,7 @@ static void notrace pstore_ftrace_call(unsigned long ip, rec.parent_ip = parent_ip; pstore_ftrace_encode_cpu(&rec, raw_smp_processor_id()); psinfo->write_buf(PSTORE_TYPE_FTRACE, 0, NULL, 0, (void *)&rec, - sizeof(rec), psinfo); + 0, sizeof(rec), psinfo); local_irq_restore(flags); } -- cgit v1.2.3