25
25
#include <asm/setup.h>
26
26
#include <asm/cpcmd.h>
27
27
#include <asm/ebcdic.h>
28
- #include <asm/reset.h>
29
28
#include <asm/sclp.h>
30
29
#include <asm/checksum.h>
31
30
#include <asm/debug.h>
@@ -119,29 +118,20 @@ static char *dump_type_str(enum dump_type type)
119
118
}
120
119
121
120
enum ipl_method {
122
- REIPL_METHOD_CCW_CIO ,
123
121
REIPL_METHOD_CCW_DIAG ,
124
- REIPL_METHOD_CCW_VM ,
125
- REIPL_METHOD_FCP_RO_DIAG ,
126
- REIPL_METHOD_FCP_RW_DIAG ,
127
- REIPL_METHOD_FCP_RO_VM ,
122
+ REIPL_METHOD_FCP_DIAG ,
128
123
REIPL_METHOD_FCP_DUMP ,
129
- REIPL_METHOD_NSS ,
130
124
REIPL_METHOD_NSS_DIAG ,
131
125
REIPL_METHOD_DEFAULT ,
132
126
};
133
127
134
128
enum dump_method {
135
129
DUMP_METHOD_NONE ,
136
- DUMP_METHOD_CCW_CIO ,
137
130
DUMP_METHOD_CCW_DIAG ,
138
- DUMP_METHOD_CCW_VM ,
139
131
DUMP_METHOD_FCP_DIAG ,
140
132
};
141
133
142
134
static int ipl_block_valid ;
143
- static int diag308_set_works ;
144
-
145
135
static struct ipl_parameter_block ipl_block ;
146
136
147
137
static int reipl_capabilities = IPL_TYPE_UNKNOWN ;
@@ -256,14 +246,6 @@ static struct kobj_attribute sys_##_prefix##_##_name##_attr = \
256
246
sys_##_prefix##_##_name##_show, \
257
247
sys_##_prefix##_##_name##_store)
258
248
259
- static void make_attrs_ro (struct attribute * * attrs )
260
- {
261
- while (* attrs ) {
262
- (* attrs )-> mode = S_IRUGO ;
263
- attrs ++ ;
264
- }
265
- }
266
-
267
249
/*
268
250
* ipl section
269
251
*/
@@ -541,10 +523,6 @@ static void __ipl_run(void *unused)
541
523
{
542
524
__bpon ();
543
525
diag308 (DIAG308_LOAD_CLEAR , NULL );
544
- if (MACHINE_IS_VM )
545
- __cpcmd ("IPL" , NULL , 0 , NULL );
546
- else if (ipl_info .type == IPL_TYPE_CCW )
547
- reipl_ccw_dev (& ipl_info .data .ccw .dev_id );
548
526
}
549
527
550
528
static void ipl_run (struct shutdown_trigger * trigger )
@@ -951,31 +929,18 @@ static int reipl_set_type(enum ipl_type type)
951
929
952
930
switch (type ) {
953
931
case IPL_TYPE_CCW :
954
- if (diag308_set_works )
955
- reipl_method = REIPL_METHOD_CCW_DIAG ;
956
- else if (MACHINE_IS_VM )
957
- reipl_method = REIPL_METHOD_CCW_VM ;
958
- else
959
- reipl_method = REIPL_METHOD_CCW_CIO ;
932
+ reipl_method = REIPL_METHOD_CCW_DIAG ;
960
933
set_reipl_block_actual (reipl_block_ccw );
961
934
break ;
962
935
case IPL_TYPE_FCP :
963
- if (diag308_set_works )
964
- reipl_method = REIPL_METHOD_FCP_RW_DIAG ;
965
- else if (MACHINE_IS_VM )
966
- reipl_method = REIPL_METHOD_FCP_RO_VM ;
967
- else
968
- reipl_method = REIPL_METHOD_FCP_RO_DIAG ;
936
+ reipl_method = REIPL_METHOD_FCP_DIAG ;
969
937
set_reipl_block_actual (reipl_block_fcp );
970
938
break ;
971
939
case IPL_TYPE_FCP_DUMP :
972
940
reipl_method = REIPL_METHOD_FCP_DUMP ;
973
941
break ;
974
942
case IPL_TYPE_NSS :
975
- if (diag308_set_works )
976
- reipl_method = REIPL_METHOD_NSS_DIAG ;
977
- else
978
- reipl_method = REIPL_METHOD_NSS ;
943
+ reipl_method = REIPL_METHOD_NSS_DIAG ;
979
944
set_reipl_block_actual (reipl_block_nss );
980
945
break ;
981
946
case IPL_TYPE_UNKNOWN :
@@ -1015,74 +980,22 @@ static struct kobj_attribute reipl_type_attr =
1015
980
static struct kset * reipl_kset ;
1016
981
static struct kset * reipl_fcp_kset ;
1017
982
1018
- static void get_ipl_string (char * dst , struct ipl_parameter_block * ipb ,
1019
- const enum ipl_method m )
1020
- {
1021
- char loadparm [LOADPARM_LEN + 1 ] = {};
1022
- char vmparm [DIAG308_VMPARM_SIZE + 1 ] = {};
1023
- char nss_name [NSS_NAME_SIZE + 1 ] = {};
1024
- size_t pos = 0 ;
1025
-
1026
- reipl_get_ascii_loadparm (loadparm , ipb );
1027
- reipl_get_ascii_nss_name (nss_name , ipb );
1028
- reipl_get_ascii_vmparm (vmparm , sizeof (vmparm ), ipb );
1029
-
1030
- switch (m ) {
1031
- case REIPL_METHOD_CCW_VM :
1032
- pos = sprintf (dst , "IPL %X CLEAR" , ipb -> ipl_info .ccw .devno );
1033
- break ;
1034
- case REIPL_METHOD_NSS :
1035
- pos = sprintf (dst , "IPL %s" , nss_name );
1036
- break ;
1037
- default :
1038
- break ;
1039
- }
1040
- if (strlen (loadparm ) > 0 )
1041
- pos += sprintf (dst + pos , " LOADPARM '%s'" , loadparm );
1042
- if (strlen (vmparm ) > 0 )
1043
- sprintf (dst + pos , " PARM %s" , vmparm );
1044
- }
1045
-
1046
983
static void __reipl_run (void * unused )
1047
984
{
1048
- struct ccw_dev_id devid ;
1049
- static char buf [128 ];
1050
-
1051
985
switch (reipl_method ) {
1052
- case REIPL_METHOD_CCW_CIO :
1053
- devid .ssid = reipl_block_ccw -> ipl_info .ccw .ssid ;
1054
- devid .devno = reipl_block_ccw -> ipl_info .ccw .devno ;
1055
- reipl_ccw_dev (& devid );
1056
- break ;
1057
- case REIPL_METHOD_CCW_VM :
1058
- get_ipl_string (buf , reipl_block_ccw , REIPL_METHOD_CCW_VM );
1059
- __cpcmd (buf , NULL , 0 , NULL );
1060
- break ;
1061
986
case REIPL_METHOD_CCW_DIAG :
1062
987
diag308 (DIAG308_SET , reipl_block_ccw );
1063
988
diag308 (DIAG308_LOAD_CLEAR , NULL );
1064
989
break ;
1065
- case REIPL_METHOD_FCP_RW_DIAG :
990
+ case REIPL_METHOD_FCP_DIAG :
1066
991
diag308 (DIAG308_SET , reipl_block_fcp );
1067
992
diag308 (DIAG308_LOAD_CLEAR , NULL );
1068
993
break ;
1069
- case REIPL_METHOD_FCP_RO_DIAG :
1070
- diag308 (DIAG308_LOAD_CLEAR , NULL );
1071
- break ;
1072
- case REIPL_METHOD_FCP_RO_VM :
1073
- __cpcmd ("IPL" , NULL , 0 , NULL );
1074
- break ;
1075
994
case REIPL_METHOD_NSS_DIAG :
1076
995
diag308 (DIAG308_SET , reipl_block_nss );
1077
996
diag308 (DIAG308_LOAD_CLEAR , NULL );
1078
997
break ;
1079
- case REIPL_METHOD_NSS :
1080
- get_ipl_string (buf , reipl_block_nss , REIPL_METHOD_NSS );
1081
- __cpcmd (buf , NULL , 0 , NULL );
1082
- break ;
1083
998
case REIPL_METHOD_DEFAULT :
1084
- if (MACHINE_IS_VM )
1085
- __cpcmd ("IPL" , NULL , 0 , NULL );
1086
999
diag308 (DIAG308_LOAD_CLEAR , NULL );
1087
1000
break ;
1088
1001
case REIPL_METHOD_FCP_DUMP :
@@ -1138,9 +1051,6 @@ static int __init reipl_nss_init(void)
1138
1051
if (!reipl_block_nss )
1139
1052
return - ENOMEM ;
1140
1053
1141
- if (!diag308_set_works )
1142
- sys_reipl_nss_vmparm_attr .attr .mode = S_IRUGO ;
1143
-
1144
1054
rc = sysfs_create_group (& reipl_kset -> kobj , & reipl_nss_attr_group );
1145
1055
if (rc )
1146
1056
return rc ;
@@ -1158,17 +1068,9 @@ static int __init reipl_ccw_init(void)
1158
1068
if (!reipl_block_ccw )
1159
1069
return - ENOMEM ;
1160
1070
1161
- if (MACHINE_IS_VM ) {
1162
- if (!diag308_set_works )
1163
- sys_reipl_ccw_vmparm_attr .attr .mode = S_IRUGO ;
1164
- rc = sysfs_create_group (& reipl_kset -> kobj ,
1165
- & reipl_ccw_attr_group_vm );
1166
- } else {
1167
- if (!diag308_set_works )
1168
- sys_reipl_ccw_loadparm_attr .attr .mode = S_IRUGO ;
1169
- rc = sysfs_create_group (& reipl_kset -> kobj ,
1170
- & reipl_ccw_attr_group_lpar );
1171
- }
1071
+ rc = sysfs_create_group (& reipl_kset -> kobj ,
1072
+ MACHINE_IS_VM ? & reipl_ccw_attr_group_vm
1073
+ : & reipl_ccw_attr_group_lpar );
1172
1074
if (rc )
1173
1075
return rc ;
1174
1076
@@ -1187,14 +1089,6 @@ static int __init reipl_fcp_init(void)
1187
1089
{
1188
1090
int rc ;
1189
1091
1190
- if (!diag308_set_works ) {
1191
- if (ipl_info .type == IPL_TYPE_FCP ) {
1192
- make_attrs_ro (reipl_fcp_attrs );
1193
- sys_reipl_fcp_scp_data_attr .attr .mode = S_IRUGO ;
1194
- } else
1195
- return 0 ;
1196
- }
1197
-
1198
1092
reipl_block_fcp = (void * ) get_zeroed_page (GFP_KERNEL );
1199
1093
if (!reipl_block_fcp )
1200
1094
return - ENOMEM ;
@@ -1339,12 +1233,7 @@ static int dump_set_type(enum dump_type type)
1339
1233
return - EINVAL ;
1340
1234
switch (type ) {
1341
1235
case DUMP_TYPE_CCW :
1342
- if (diag308_set_works )
1343
- dump_method = DUMP_METHOD_CCW_DIAG ;
1344
- else if (MACHINE_IS_VM )
1345
- dump_method = DUMP_METHOD_CCW_VM ;
1346
- else
1347
- dump_method = DUMP_METHOD_CCW_CIO ;
1236
+ dump_method = DUMP_METHOD_CCW_DIAG ;
1348
1237
break ;
1349
1238
case DUMP_TYPE_FCP :
1350
1239
dump_method = DUMP_METHOD_FCP_DIAG ;
@@ -1394,21 +1283,7 @@ static void diag308_dump(void *dump_block)
1394
1283
1395
1284
static void __dump_run (void * unused )
1396
1285
{
1397
- struct ccw_dev_id devid ;
1398
- static char buf [100 ];
1399
-
1400
1286
switch (dump_method ) {
1401
- case DUMP_METHOD_CCW_CIO :
1402
- devid .ssid = dump_block_ccw -> ipl_info .ccw .ssid ;
1403
- devid .devno = dump_block_ccw -> ipl_info .ccw .devno ;
1404
- reipl_ccw_dev (& devid );
1405
- break ;
1406
- case DUMP_METHOD_CCW_VM :
1407
- sprintf (buf , "STORE STATUS" );
1408
- __cpcmd (buf , NULL , 0 , NULL );
1409
- sprintf (buf , "IPL %X" , dump_block_ccw -> ipl_info .ccw .devno );
1410
- __cpcmd (buf , NULL , 0 , NULL );
1411
- break ;
1412
1287
case DUMP_METHOD_CCW_DIAG :
1413
1288
diag308_dump (dump_block_ccw );
1414
1289
break ;
@@ -1454,8 +1329,6 @@ static int __init dump_fcp_init(void)
1454
1329
1455
1330
if (!sclp_ipl_info .has_dump )
1456
1331
return 0 ; /* LDIPL DUMP is not installed */
1457
- if (!diag308_set_works )
1458
- return 0 ;
1459
1332
dump_block_fcp = (void * ) get_zeroed_page (GFP_KERNEL );
1460
1333
if (!dump_block_fcp )
1461
1334
return - ENOMEM ;
@@ -1513,18 +1386,9 @@ static void dump_reipl_run(struct shutdown_trigger *trigger)
1513
1386
dump_run (trigger );
1514
1387
}
1515
1388
1516
- static int __init dump_reipl_init (void )
1517
- {
1518
- if (!diag308_set_works )
1519
- return - EOPNOTSUPP ;
1520
- else
1521
- return 0 ;
1522
- }
1523
-
1524
1389
static struct shutdown_action __refdata dump_reipl_action = {
1525
1390
.name = SHUTDOWN_ACTION_DUMP_REIPL_STR ,
1526
1391
.fn = dump_reipl_run ,
1527
- .init = dump_reipl_init ,
1528
1392
};
1529
1393
1530
1394
/*
@@ -1944,67 +1808,16 @@ void __init ipl_store_parameters(void)
1944
1808
int rc ;
1945
1809
1946
1810
rc = diag308 (DIAG308_STORE , & ipl_block );
1947
- if ((rc == DIAG308_RC_OK ) || (rc == DIAG308_RC_NOCONFIG ))
1948
- diag308_set_works = 1 ;
1949
1811
if (rc == DIAG308_RC_OK && ipl_block .hdr .version <= IPL_MAX_SUPPORTED_VERSION )
1950
1812
ipl_block_valid = 1 ;
1951
1813
}
1952
1814
1953
- static LIST_HEAD (rcall );
1954
- static DEFINE_MUTEX (rcall_mutex );
1955
-
1956
- void register_reset_call (struct reset_call * reset )
1957
- {
1958
- mutex_lock (& rcall_mutex );
1959
- list_add (& reset -> list , & rcall );
1960
- mutex_unlock (& rcall_mutex );
1961
- }
1962
- EXPORT_SYMBOL_GPL (register_reset_call );
1963
-
1964
- void unregister_reset_call (struct reset_call * reset )
1965
- {
1966
- mutex_lock (& rcall_mutex );
1967
- list_del (& reset -> list );
1968
- mutex_unlock (& rcall_mutex );
1969
- }
1970
- EXPORT_SYMBOL_GPL (unregister_reset_call );
1971
-
1972
- static void do_reset_calls (void )
1973
- {
1974
- struct reset_call * reset ;
1975
-
1976
- if (diag308_set_works ) {
1977
- diag308_reset ();
1978
- return ;
1979
- }
1980
- list_for_each_entry (reset , & rcall , list )
1981
- reset -> fn ();
1982
- }
1983
-
1984
1815
void s390_reset_system (void )
1985
1816
{
1986
- struct lowcore * lc ;
1987
-
1988
- lc = (struct lowcore * )(unsigned long ) store_prefix ();
1989
-
1990
- /* Stack for interrupt/machine check handler */
1991
- lc -> panic_stack = S390_lowcore .panic_stack ;
1992
-
1993
1817
/* Disable prefixing */
1994
1818
set_prefix (0 );
1995
1819
1996
1820
/* Disable lowcore protection */
1997
- __ctl_clear_bit (0 ,28 );
1998
-
1999
- /* Set new machine check handler */
2000
- S390_lowcore .mcck_new_psw .mask = PSW_KERNEL_BITS | PSW_MASK_DAT ;
2001
- S390_lowcore .mcck_new_psw .addr =
2002
- (unsigned long ) s390_base_mcck_handler ;
2003
-
2004
- /* Set new program check handler */
2005
- S390_lowcore .program_new_psw .mask = PSW_KERNEL_BITS | PSW_MASK_DAT ;
2006
- S390_lowcore .program_new_psw .addr =
2007
- (unsigned long ) s390_base_pgm_handler ;
2008
-
2009
- do_reset_calls ();
1821
+ __ctl_clear_bit (0 , 28 );
1822
+ diag308_reset ();
2010
1823
}
0 commit comments