Lines Matching +full:boot +full:- +full:page +full:- +full:step

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Ubuntu project, hibernation support for mach-dove
50 /* hyp-stub vectors, used to restore el2 during resume from hibernate. */
54 * The logical cpu number we should resume on, initialised to a non-cpu
57 static int sleep_cpu = -EINVAL;
78 * re-configure el2.
88 memcpy(i->uts_version, init_utsname()->version, sizeof(i->uts_version)); in arch_hdr_invariants()
94 unsigned long nosave_end_pfn = sym_to_pfn(&__nosave_end - 1); in pfn_is_nosave()
113 return -EOVERFLOW; in arch_hibernation_header_save()
115 arch_hdr_invariants(&hdr->invariants); in arch_hibernation_header_save()
116 hdr->ttbr1_el1 = __pa_symbol(swapper_pg_dir); in arch_hibernation_header_save()
117 hdr->reenter_kernel = _cpu_resume; in arch_hibernation_header_save()
121 hdr->__hyp_stub_vectors = __pa_symbol(__hyp_stub_vectors); in arch_hibernation_header_save()
123 hdr->__hyp_stub_vectors = 0; in arch_hibernation_header_save()
128 return -ENODEV; in arch_hibernation_header_save()
130 hdr->sleep_cpu_mpidr = cpu_logical_map(sleep_cpu); in arch_hibernation_header_save()
132 hdr->sleep_cpu_mpidr); in arch_hibernation_header_save()
145 if (memcmp(&hdr->invariants, &invariants, sizeof(invariants))) { in arch_hibernation_header_restore()
147 return -EINVAL; in arch_hibernation_header_restore()
150 sleep_cpu = get_logical_index(hdr->sleep_cpu_mpidr); in arch_hibernation_header_restore()
152 hdr->sleep_cpu_mpidr); in arch_hibernation_header_restore()
155 sleep_cpu = -EINVAL; in arch_hibernation_header_restore()
156 return -EINVAL; in arch_hibernation_header_restore()
161 sleep_cpu = -EINVAL; in arch_hibernation_header_restore()
177 * Copies length bytes, starting at src_start into an new page,
182 * overwriting the kernel text. This function generates a new set of page
186 * page system.
196 void *page = (void *)get_safe_page(GFP_ATOMIC); in create_safe_exec_page() local
201 if (!page) in create_safe_exec_page()
202 return -ENOMEM; in create_safe_exec_page()
204 memcpy(page, src_start, length); in create_safe_exec_page()
205 caches_clean_inval_pou((unsigned long)page, (unsigned long)page + length); in create_safe_exec_page()
206 rc = trans_pgd_idmap_page(&trans_info, &trans_ttbr0, &t0sz, page); in create_safe_exec_page()
211 *phys_dst_addr = virt_to_phys(page); in create_safe_exec_page()
220 static int save_tags(struct page *page, unsigned long pfn) in save_tags() argument
226 return -ENOMEM; in save_tags()
228 mte_save_page_tags(page_address(page), tag_storage); in save_tags()
267 for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) { in swsusp_mte_save_tags()
268 struct page *page = pfn_to_online_page(pfn); in swsusp_mte_save_tags() local
270 if (!page) in swsusp_mte_save_tags()
273 if (!page_mte_tagged(page)) in swsusp_mte_save_tags()
276 ret = save_tags(page, pfn); in swsusp_mte_save_tags()
300 struct page *page = pfn_to_online_page(pfn); in swsusp_mte_restore_tags() local
302 mte_restore_page_tags(page_address(page), tags); in swsusp_mte_restore_tags()
335 return -EBUSY; in swsusp_arch_suspend()
377 sleep_cpu = -EINVAL; in swsusp_arch_suspend()
381 * Just in case the boot kernel did turn the SSBD in swsusp_arch_suspend()
414 * Restoring the memory image will overwrite the ttbr1 page tables. in swsusp_arch_resume()
424 * We need a zero page that is zero before & after resume in order in swsusp_arch_resume()
425 * to break before make on the ttbr1 page tables. in swsusp_arch_resume()
429 pr_err("Failed to allocate zero page.\n"); in swsusp_arch_resume()
430 return -ENOMEM; in swsusp_arch_resume()
441 exit_size = __hibernate_exit_text_end - __hibernate_exit_text_start; in swsusp_arch_resume()
443 * Copy swsusp_arch_suspend_exit() to a safe page. This will generate in swsusp_arch_resume()
444 * a new set of ttbr0 page tables and load them. in swsusp_arch_resume()
449 pr_err("Failed to create safe executable page for hibernate_exit code.\n"); in swsusp_arch_resume()
457 * We can skip this step if we booted at EL1, or are running with VHE. in swsusp_arch_resume()
473 return -ENODEV; in hibernate_resume_nonboot_cpu_disable()