/* * paging_init() sets up the page tables */ void __init paging_init(void) { unsigned long max_zone_pfns[MAX_NR_ZONES]; unsigned long pgd_type, asce_bits; init_mm.pgd = swapper_pg_dir; if (VMALLOC_END > (1UL << 42)) { asce_bits = _ASCE_TYPE_REGION2 | _ASCE_TABLE_LENGTH; pgd_type = _REGION2_ENTRY_EMPTY; } else { asce_bits = _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; pgd_type = _REGION3_ENTRY_EMPTY; } S390_lowcore.kernel_asce = (__pa(init_mm.pgd) & PAGE_MASK) | asce_bits; clear_table((unsigned long *) init_mm.pgd, pgd_type, sizeof(unsigned long)*2048); vmem_map_init(); /* enable virtual mapping in kernel mode */ __ctl_load(S390_lowcore.kernel_asce, 1, 1); __ctl_load(S390_lowcore.kernel_asce, 7, 7); __ctl_load(S390_lowcore.kernel_asce, 13, 13); __arch_local_irq_stosm(0x04); sparse_memory_present_with_active_regions(MAX_NUMNODES); sparse_init(); memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); max_zone_pfns[ZONE_DMA] = PFN_DOWN(MAX_DMA_ADDRESS); max_zone_pfns[ZONE_NORMAL] = max_low_pfn; free_area_init_nodes(max_zone_pfns); }
/* * Reset system and call either kdump or normal kexec */ static void __machine_kexec(void *data) { __arch_local_irq_stosm(0x04); /* enable DAT */ pfault_fini(); tracing_off(); debug_locks_off(); #ifdef CONFIG_CRASH_DUMP if (((struct kimage *) data)->type == KEXEC_TYPE_CRASH) __machine_kdump(data); #endif __do_machine_kexec(data); }
/* * Check if kdump checksums are valid: We call purgatory with parameter "0" */ static int kdump_csum_valid(struct kimage *image) { #ifdef CONFIG_CRASH_DUMP int (*start_kdump)(int) = (void *)image->start; int rc; __arch_local_irq_stnsm(0xfb); /* disable DAT */ rc = start_kdump(0); __arch_local_irq_stosm(0x04); /* enable DAT */ return rc ? 0 : -EINVAL; #else return -EINVAL; #endif }
/* * Reset system and call either kdump or normal kexec */ static void __machine_kexec(void *data) { struct kimage *image = data; __arch_local_irq_stosm(0x04); /* enable DAT */ pfault_fini(); tracing_off(); debug_locks_off(); if (image->type == KEXEC_TYPE_CRASH) { lgr_info_log(); s390_reset_system(__do_machine_kdump, data); } else { s390_reset_system(__do_machine_kexec, data); } disabled_wait((unsigned long) __builtin_return_address(0)); }
/* * Reset system and call either kdump or normal kexec */ static void __machine_kexec(void *data) { __arch_local_irq_stosm(0x04); /* enable DAT */ pfault_fini(); tracing_off(); debug_locks_off(); #ifdef CONFIG_CRASH_DUMP if (((struct kimage *) data)->type == KEXEC_TYPE_CRASH) { lgr_info_log(); s390_reset_system(setup_regs, __do_machine_kdump, data); } else #endif s390_reset_system(NULL, __do_machine_kexec, data); disabled_wait((unsigned long) __builtin_return_address(0)); }