Commit 1e941d39 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky

s390: move ipl block to .boot.preserved.data section

.boot.preserved.data is a better fit for ipl block than .boot.data
which is discarded after init. Reusing .boot.preserved.data allows to
simplify code a little bit and avoid copying data from .boot.data to
persistent variables.
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent bf9921a9
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include "boot.h" #include "boot.h"
char __bootdata(early_command_line)[COMMAND_LINE_SIZE]; char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
struct ipl_parameter_block __bootdata(early_ipl_block); struct ipl_parameter_block __bootdata_preserved(ipl_block);
int __bootdata(early_ipl_block_valid); int __bootdata_preserved(ipl_block_valid);
unsigned long __bootdata(memory_end); unsigned long __bootdata(memory_end);
int __bootdata(memory_end_set); int __bootdata(memory_end_set);
...@@ -45,10 +45,10 @@ void store_ipl_parmblock(void) ...@@ -45,10 +45,10 @@ void store_ipl_parmblock(void)
{ {
int rc; int rc;
rc = __diag308(DIAG308_STORE, &early_ipl_block); rc = __diag308(DIAG308_STORE, &ipl_block);
if (rc == DIAG308_RC_OK && if (rc == DIAG308_RC_OK &&
early_ipl_block.hdr.version <= IPL_MAX_SUPPORTED_VERSION) ipl_block.hdr.version <= IPL_MAX_SUPPORTED_VERSION)
early_ipl_block_valid = 1; ipl_block_valid = 1;
} }
static size_t scpdata_length(const char *buf, size_t count) static size_t scpdata_length(const char *buf, size_t count)
...@@ -103,14 +103,14 @@ static void append_ipl_block_parm(void) ...@@ -103,14 +103,14 @@ static void append_ipl_block_parm(void)
delim = early_command_line + len; /* '\0' character position */ delim = early_command_line + len; /* '\0' character position */
parm = early_command_line + len + 1; /* append right after '\0' */ parm = early_command_line + len + 1; /* append right after '\0' */
switch (early_ipl_block.hdr.pbt) { switch (ipl_block.hdr.pbt) {
case DIAG308_IPL_TYPE_CCW: case DIAG308_IPL_TYPE_CCW:
rc = ipl_block_get_ascii_vmparm( rc = ipl_block_get_ascii_vmparm(
parm, COMMAND_LINE_SIZE - len - 1, &early_ipl_block); parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
break; break;
case DIAG308_IPL_TYPE_FCP: case DIAG308_IPL_TYPE_FCP:
rc = ipl_block_get_ascii_scpdata( rc = ipl_block_get_ascii_scpdata(
parm, COMMAND_LINE_SIZE - len - 1, &early_ipl_block); parm, COMMAND_LINE_SIZE - len - 1, &ipl_block);
break; break;
} }
if (rc) { if (rc) {
...@@ -141,7 +141,7 @@ void setup_boot_command_line(void) ...@@ -141,7 +141,7 @@ void setup_boot_command_line(void)
strcpy(early_command_line, strim(COMMAND_LINE)); strcpy(early_command_line, strim(COMMAND_LINE));
/* append IPL PARM data to the boot command line */ /* append IPL PARM data to the boot command line */
if (early_ipl_block_valid) if (ipl_block_valid)
append_ipl_block_parm(); append_ipl_block_parm();
} }
...@@ -234,9 +234,9 @@ void parse_boot_command_line(void) ...@@ -234,9 +234,9 @@ void parse_boot_command_line(void)
void setup_memory_end(void) void setup_memory_end(void)
{ {
#ifdef CONFIG_CRASH_DUMP #ifdef CONFIG_CRASH_DUMP
if (!OLDMEM_BASE && early_ipl_block_valid && if (!OLDMEM_BASE && ipl_block_valid &&
early_ipl_block.hdr.pbt == DIAG308_IPL_TYPE_FCP && ipl_block.hdr.pbt == DIAG308_IPL_TYPE_FCP &&
early_ipl_block.ipl_info.fcp.opt == DIAG308_IPL_OPT_DUMP) { ipl_block.ipl_info.fcp.opt == DIAG308_IPL_OPT_DUMP) {
if (!sclp_early_get_hsa_size(&memory_end) && memory_end) if (!sclp_early_get_hsa_size(&memory_end) && memory_end)
memory_end_set = 1; memory_end_set = 1;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <asm/ipl.h> #include <asm/ipl.h>
extern char early_command_line[COMMAND_LINE_SIZE]; extern char early_command_line[COMMAND_LINE_SIZE];
extern struct ipl_parameter_block early_ipl_block; extern struct ipl_parameter_block ipl_block;
extern int early_ipl_block_valid; extern int ipl_block_valid;
#endif /* _ASM_S390_BOOT_DATA_H */ #endif /* _ASM_S390_BOOT_DATA_H */
...@@ -88,7 +88,6 @@ void __init save_area_add_regs(struct save_area *, void *regs); ...@@ -88,7 +88,6 @@ void __init save_area_add_regs(struct save_area *, void *regs);
void __init save_area_add_vxrs(struct save_area *, __vector128 *vxrs); void __init save_area_add_vxrs(struct save_area *, __vector128 *vxrs);
extern void s390_reset_system(void); extern void s390_reset_system(void);
extern void ipl_store_parameters(void);
extern size_t ipl_block_get_ascii_vmparm(char *dest, size_t size, extern size_t ipl_block_get_ascii_vmparm(char *dest, size_t size,
const struct ipl_parameter_block *ipb); const struct ipl_parameter_block *ipb);
......
...@@ -309,7 +309,6 @@ void __init startup_init(void) ...@@ -309,7 +309,6 @@ void __init startup_init(void)
setup_facility_list(); setup_facility_list();
detect_machine_type(); detect_machine_type();
setup_arch_string(); setup_arch_string();
ipl_store_parameters();
setup_boot_command_line(); setup_boot_command_line();
detect_diag9c(); detect_diag9c();
detect_diag44(); detect_diag44();
......
...@@ -119,11 +119,8 @@ static char *dump_type_str(enum dump_type type) ...@@ -119,11 +119,8 @@ static char *dump_type_str(enum dump_type type)
} }
} }
struct ipl_parameter_block __bootdata(early_ipl_block); int __bootdata_preserved(ipl_block_valid);
int __bootdata(early_ipl_block_valid); struct ipl_parameter_block __bootdata_preserved(ipl_block);
static int ipl_block_valid;
static struct ipl_parameter_block ipl_block;
static int reipl_capabilities = IPL_TYPE_UNKNOWN; static int reipl_capabilities = IPL_TYPE_UNKNOWN;
...@@ -1675,14 +1672,6 @@ void __init setup_ipl(void) ...@@ -1675,14 +1672,6 @@ void __init setup_ipl(void)
atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb); atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
} }
void __init ipl_store_parameters(void)
{
if (early_ipl_block_valid) {
memcpy(&ipl_block, &early_ipl_block, sizeof(ipl_block));
ipl_block_valid = 1;
}
}
void s390_reset_system(void) void s390_reset_system(void)
{ {
/* Disable prefixing */ /* Disable prefixing */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment