From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mtagate7.uk.ibm.com ([194.196.100.167]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QmmMM-0001tE-AQ for kexec@lists.infradead.org; Fri, 29 Jul 2011 12:40:12 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p6TCe2Z4006770 for ; Fri, 29 Jul 2011 12:40:02 GMT Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6TCe1te2412582 for ; Fri, 29 Jul 2011 13:40:02 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p6TCe1Vi006341 for ; Fri, 29 Jul 2011 06:40:01 -0600 Message-Id: <20110729124000.809651778@linux.vnet.ibm.com> Date: Fri, 29 Jul 2011 14:39:47 +0200 From: Michael Holzheu Subject: [patch 3/3] kexec-tools: Emit program check on s390 for checksum failure References: <20110729123944.562622201@linux.vnet.ibm.com> Content-Disposition: inline; filename=kexec-tools-s390-kdump-entry.patch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=twosheds.infradead.org@lists.infradead.org To: vgoyal@redhat.com Cc: oomichi@mxs.nes.nec.co.jp, linux-s390@vger.kernel.org, mahesh@linux.vnet.ibm.com, heiko.carstens@de.ibm.com, linux-kernel@vger.kernel.org, hbabu@us.ibm.com, horms@verge.net.au, ebiederm@xmission.com, schwidefsky@de.ibm.com, kexec@lists.infradead.org From: Michael Holzheu 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 --- 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 */ +#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(); } } _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec