aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/include/asm/system.h16
-rw-r--r--arch/s390/kernel/ipl.c4
-rw-r--r--drivers/s390/char/zcore.c4
3 files changed, 6 insertions, 18 deletions
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
index 3f2ccb82b863..3a8b26eb1f2e 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
@@ -458,22 +458,6 @@ static inline unsigned short stap(void)
458 return cpu_address; 458 return cpu_address;
459} 459}
460 460
461static inline u32 cksm(void *addr, unsigned long len)
462{
463 register unsigned long _addr asm("0") = (unsigned long) addr;
464 register unsigned long _len asm("1") = len;
465 unsigned long accu = 0;
466
467 asm volatile(
468 "0:\n"
469 " cksm %0,%1\n"
470 " jnz 0b\n"
471 : "+d" (accu), "+d" (_addr), "+d" (_len)
472 :
473 : "cc", "memory");
474 return accu;
475}
476
477extern void (*_machine_restart)(char *command); 461extern void (*_machine_restart)(char *command);
478extern void (*_machine_halt)(void); 462extern void (*_machine_halt)(void);
479extern void (*_machine_power_off)(void); 463extern void (*_machine_power_off)(void);
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 5663c1f8e46a..505fec06e634 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -24,6 +24,7 @@
24#include <asm/reset.h> 24#include <asm/reset.h>
25#include <asm/sclp.h> 25#include <asm/sclp.h>
26#include <asm/setup.h> 26#include <asm/setup.h>
27#include <asm/checksum.h>
27 28
28#define IPL_PARM_BLOCK_VERSION 0 29#define IPL_PARM_BLOCK_VERSION 0
29 30
@@ -1359,7 +1360,8 @@ static void dump_reipl_run(struct shutdown_trigger *trigger)
1359 "a" (&lowcore_ptr[smp_processor_id()]->ipib)); 1360 "a" (&lowcore_ptr[smp_processor_id()]->ipib));
1360#endif 1361#endif
1361 asm volatile("stura %0,%1" 1362 asm volatile("stura %0,%1"
1362 :: "a" (cksm(reipl_block_actual, reipl_block_actual->hdr.len)), 1363 :: "a" (csum_partial(reipl_block_actual,
1364 reipl_block_actual->hdr.len, 0)),
1363 "a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum)); 1365 "a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum));
1364 preempt_enable(); 1366 preempt_enable();
1365 dump_run(trigger); 1367 dump_run(trigger);
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index cfe782ee6473..1bbae433fbd8 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -24,6 +24,7 @@
24#include <asm/debug.h> 24#include <asm/debug.h>
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/irqflags.h> 26#include <asm/irqflags.h>
27#include <asm/checksum.h>
27#include "sclp.h" 28#include "sclp.h"
28 29
29#define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x) 30#define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x)
@@ -704,7 +705,8 @@ static int __init zcore_reipl_init(void)
704 free_page((unsigned long) ipl_block); 705 free_page((unsigned long) ipl_block);
705 return rc; 706 return rc;
706 } 707 }
707 if (cksm(ipl_block, ipl_block->hdr.len) != ipib_info.checksum) { 708 if (csum_partial(ipl_block, ipl_block->hdr.len, 0) !=
709 ipib_info.checksum) {
708 TRACE("Checksum does not match\n"); 710 TRACE("Checksum does not match\n");
709 free_page((unsigned long) ipl_block); 711 free_page((unsigned long) ipl_block);
710 ipl_block = NULL; 712 ipl_block = NULL;