public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
To: vgoyal@redhat.com
Cc: ebiederm@xmission.com, mahesh@linux.vnet.ibm.com,
	hbabu@us.ibm.com, oomichi@mxs.nes.nec.co.jp, horms@verge.net.au,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: [patch 3/3] kexec-tools: Emit program check on s390 for checksum failure
Date: Fri, 29 Jul 2011 14:39:47 +0200	[thread overview]
Message-ID: <20110729124000.809651778@linux.vnet.ibm.com> (raw)
In-Reply-To: 20110729123944.562622201@linux.vnet.ibm.com

[-- Attachment #1: kexec-tools-s390-kdump-entry.patch --]
[-- Type: text/plain, Size: 3750 bytes --]

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

With this patch on s390 a program check interrupt is emitted if purgatory
checksums are not valid. This establishes a error handling mechanism where
the caller of crash_kexec/purgatory can catch the error by installing a
program check handler function. On s390 this will be used by our stand-alone
dump tools. The tools first get control and install a program check handler.
Then if kdump is pre-loaded, the dump tools jump into the old kernel where
crash_kexec->purgatory is executed. If kdump fails on this code path, a
program check is emitted and then control is passed back to the stand-alone
dump tools that will then create a full-blown dump as backup mechanism.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
 purgatory/arch/i386/purgatory-x86.c      |    7 +++++++
 purgatory/arch/ia64/purgatory-ia64.c     |    7 +++++++
 purgatory/arch/ppc/purgatory-ppc.c       |    7 +++++++
 purgatory/arch/ppc64/purgatory-ppc64.c   |    7 +++++++
 purgatory/arch/s390/purgatory-s390.c     |   11 +++++++++++
 purgatory/arch/x86_64/purgatory-x86_64.c |    7 +++++++
 purgatory/include/purgatory.h            |    1 +
 purgatory/purgatory.c                    |    4 +---
 8 files changed, 48 insertions(+), 3 deletions(-)

--- a/purgatory/arch/i386/purgatory-x86.c
+++ b/purgatory/arch/i386/purgatory-x86.c
@@ -55,3 +55,10 @@ void post_verification_setup_arch(void)
 	if (panic_kernel)    crashdump_backup_memory();
 	if (jump_back_entry) x86_setup_jump_back_entry();
 }
+
+void sha256_digest_failed(void)
+{
+	for(;;) {
+		/* loop forever */
+	}
+}
--- a/purgatory/arch/ia64/purgatory-ia64.c
+++ b/purgatory/arch/ia64/purgatory-ia64.c
@@ -305,3 +305,10 @@ void post_verification_setup_arch(void)
 {
 	/* Nothing for now */
 }
+
+void sha256_digest_failed(void)
+{
+	for(;;) {
+		/* loop forever */
+	}
+}
--- a/purgatory/arch/ppc/purgatory-ppc.c
+++ b/purgatory/arch/ppc/purgatory-ppc.c
@@ -44,3 +44,10 @@ void crashdump_backup_memory(void)
 {
 	return;
 }
+
+void sha256_digest_failed(void)
+{
+	for(;;) {
+		/* loop forever */
+	}
+}
--- a/purgatory/arch/ppc64/purgatory-ppc64.c
+++ b/purgatory/arch/ppc64/purgatory-ppc64.c
@@ -40,3 +40,10 @@ void post_verification_setup_arch(void)
 	if (panic_kernel)
 		crashdump_backup_memory();
 }
+
+void sha256_digest_failed(void)
+{
+	for(;;) {
+		/* loop forever */
+	}
+}
--- a/purgatory/arch/s390/purgatory-s390.c
+++ b/purgatory/arch/s390/purgatory-s390.c
@@ -6,6 +6,12 @@
  * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
  */
 
+#define EMIT_PGM_CHECK() do {			\
+	asm volatile(			\
+		"0:     j       0b+2\n"	\
+	: :);				\
+} while (0)
+
 unsigned long kdump_psw_addr = 0;
 
 void setup_arch(void)
@@ -15,3 +21,8 @@ void setup_arch(void)
 void post_verification_setup_arch(void)
 {
 }
+
+void sha256_digest_failed(void)
+{
+	EMIT_PGM_CHECK();
+}
--- a/purgatory/arch/x86_64/purgatory-x86_64.c
+++ b/purgatory/arch/x86_64/purgatory-x86_64.c
@@ -28,3 +28,10 @@ void post_verification_setup_arch(void)
 	if (panic_kernel)    crashdump_backup_memory();
 	if (jump_back_entry) x86_setup_jump_back_entry();
 }
+
+void sha256_digest_failed(void)
+{
+	for(;;) {
+		/* loop forever */
+	}
+}
--- a/purgatory/include/purgatory.h
+++ b/purgatory/include/purgatory.h
@@ -6,5 +6,6 @@ void sprintf(char *buffer, const char *f
 void printf(const char *fmt, ...);
 void setup_arch(void);
 void post_verification_setup_arch(void);
+void sha256_digest_failed(void);
 
 #endif /* PURGATORY_H */
--- a/purgatory/purgatory.c
+++ b/purgatory/purgatory.c
@@ -34,9 +34,7 @@ void verify_sha256_digest(void)
 			printf("%hhx ", sha256_digest[i]);
 		}
 		printf("\n");
-		for(;;) {
-			/* loop forever */
-		}
+		sha256_digest_failed();
 	}
 }
 


  parent reply	other threads:[~2011-07-29 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 12:39 [patch 0/3] kdump: Add external kdump entry point for s390 stand-alone dump tools Michael Holzheu
2011-07-29 12:39 ` [patch 1/3] kdump: Add new machine_kexec_finish() architecture callback Michael Holzheu
2011-07-29 12:39 ` [patch 2/3] s390: Add external kdump entry point for s390 stand-alone dump tools Michael Holzheu
2011-07-29 12:39 ` Michael Holzheu [this message]
2011-08-19  1:14 ` [patch 0/3] kdump: " Simon Horman
2011-08-19 12:53   ` Michael Holzheu
2011-08-19 13:20     ` Vivek Goyal
2011-08-19 13:36       ` Michael Holzheu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110729124000.809651778@linux.vnet.ibm.com \
    --to=holzheu@linux.vnet.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=hbabu@us.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=oomichi@mxs.nes.nec.co.jp \
    --cc=schwidefsky@de.ibm.com \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox