/* * In order to soft-boot, we need to insert a 1:1 mapping in place of * the user-mode pages. This will then ensure that we have predictable * results when turning the mmu off */ void setup_mm_for_reboot(char mode) { /* * We need to access to user-mode page tables here. For kernel threads * we don't have any user-mode mappings so we use the context that we * "borrowed". */ identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE); local_flush_tlb_all(); }
static int __init init_static_idmap_hyp(void) { hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); if (!hyp_pgd) return -ENOMEM; pr_info("Setting up static HYP identity map for 0x%p - 0x%p\n", __hyp_idmap_text_start, __hyp_idmap_text_end); identity_mapping_add(hyp_pgd, __hyp_idmap_text_start, __hyp_idmap_text_end, PMD_SECT_AP1); return 0; }
static int __init init_static_idmap(void) { idmap_pgd = pgd_alloc(&init_mm); if (!idmap_pgd) return -ENOMEM; identity_mapping_add(idmap_pgd, __idmap_text_start, __idmap_text_end, 0); /* Flush L1 for the hardware to see this page table content */ flush_cache_louis(); return 0; }
static int __init init_static_idmap(void) { phys_addr_t idmap_start, idmap_end; idmap_pgd = pgd_alloc(&init_mm); if (!idmap_pgd) return -ENOMEM; /* Add an identity mapping for the physical address of the section. */ idmap_start = virt_to_phys((void *)__idmap_text_start); idmap_end = virt_to_phys((void *)__idmap_text_end); pr_info("Setting up static identity map for 0x%llx - 0x%llx\n", (long long)idmap_start, (long long)idmap_end); identity_mapping_add(idmap_pgd, idmap_start, idmap_end); return 0; }
static int __init init_static_idmap(void) { int ret; idmap_pgd = pgd_alloc(&init_mm); if (!idmap_pgd) return -ENOMEM; pr_info("Setting up static identity map for 0x%p - 0x%p\n", __idmap_text_start, __idmap_text_end); identity_mapping_add(idmap_pgd, __idmap_text_start, __idmap_text_end, 0); ret = init_static_idmap_hyp(); /* Flush L1 for the hardware to see this page table content */ flush_cache_louis(); return ret; }
static int __init init_static_idmap(void) { phys_addr_t idmap_start, idmap_end; idmap_pgd = pgd_alloc(&init_mm); if (!idmap_pgd) return -ENOMEM; /* Add an identity mapping for the physical address of the section. */ idmap_start = virt_to_phys((void *)__idmap_text_start); idmap_end = virt_to_phys((void *)__idmap_text_end); pr_info("Setting up static identity map for 0x%llx - 0x%llx\n", (long long)idmap_start, (long long)idmap_end); identity_mapping_add(idmap_pgd, idmap_start, idmap_end); /* Flush L1 for the hardware to see this page table content */ flush_cache_louis(); return 0; }