aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ipl.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-06-05 03:59:52 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-06-14 03:09:02 -0400
commitfbe765680d1fe9d08187ea4dad5041a7955a2c3a (patch)
treecfa5ba11106bb5535552cf6b29ff6aa81f32c606 /arch/s390/kernel/ipl.c
parent72f6e3a8bc956fddf6e004ae9b804977d1458e77 (diff)
s390/smp: make absolute lowcore / cpu restart parameter accesses more robust
Setting the cpu restart parameters is done in three different fashions: - directly setting the four parameters individually - copying the four parameters with memcpy (using 4 * sizeof(long)) - copying the four parameters using a private structure In addition code in entry*.S relies on a certain order of the restart members of struct _lowcore. Make all of this more robust to future changes by adding a mem_absolute_assign(dest, val) define, which assigns val to dest using absolute addressing mode. Also the load multiple instructions in entry*.S have been split into separate load instruction so the order of the struct _lowcore members doesn't matter anymore. In addition move the prototypes of memcpy_real/absolute from uaccess.h to processor.h. These memcpy* variants are not related to uaccess at all. string.h doesn't seem to match as well, so lets use processor.h. Also replace the eight byte array in struct _lowcore which represents a misaliged u64 with a u64. The compiler will always create code that handles the misaligned u64 correctly. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ipl.c')
-rw-r--r--arch/s390/kernel/ipl.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 2f6cfd460cb6..25241cd8ddd8 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -1528,15 +1528,12 @@ static struct shutdown_action __refdata dump_action = {
1528 1528
1529static void dump_reipl_run(struct shutdown_trigger *trigger) 1529static void dump_reipl_run(struct shutdown_trigger *trigger)
1530{ 1530{
1531 struct { 1531 unsigned long ipib = (unsigned long) &reipl_block_actual;
1532 void *addr; 1532 unsigned int csum;
1533 __u32 csum; 1533
1534 } __packed ipib; 1534 csum = csum_partial(reipl_block_actual, reipl_block_actual->hdr.len, 0);
1535 1535 mem_assign_absolute(S390_lowcore.ipib, ipib);
1536 ipib.csum = csum_partial(reipl_block_actual, 1536 mem_assign_absolute(S390_lowcore.ipib_checksum, csum);
1537 reipl_block_actual->hdr.len, 0);
1538 ipib.addr = reipl_block_actual;
1539 memcpy_absolute(&S390_lowcore.ipib, &ipib, sizeof(ipib));
1540 dump_run(trigger); 1537 dump_run(trigger);
1541} 1538}
1542 1539