Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99d87c60 authored by Vivek Kumar's avatar Vivek Kumar Committed by Gerrit - the friendly Code Review server
Browse files

arm64: hibernate: Introduce new entry point to kernel



Introduce a new entry point to hibernated kernel image.
This is generally needed when bootloader restores the
hibernated image from disc to ddr and passes control
to it by turning off the mmu, also initialize this new
entry point with cpu_resume which turns on the mmu and
then proceeds with restore routines.

Change-Id: I854880e244910614153996a1f9ea923124369ae2
Signed-off-by: default avatarVivek Kumar <vivekuma@codeaurora.org>
parent ef618860
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -83,6 +83,14 @@ static struct arch_hibernate_hdr {
	phys_addr_t	ttbr1_el1;
	void		(*reenter_kernel)(void);

	/*
	 * Another entry point if jump to kernel happens with mmu disabled,
	 * generally done when restoring hibernation image from bootloader
	 * context
	 */

	phys_addr_t	phys_reenter_kernel;

	/*
	 * We need to know where the __hyp_stub_vectors are after restore to
	 * re-configure el2.
@@ -126,6 +134,7 @@ int arch_hibernation_header_save(void *addr, unsigned int max_size)
	arch_hdr_invariants(&hdr->invariants);
	hdr->ttbr1_el1		= __pa_symbol(swapper_pg_dir);
	hdr->reenter_kernel	= _cpu_resume;
	hdr->phys_reenter_kernel  = __pa(cpu_resume);

	/* We can't use __hyp_get_vectors() because kvm may still be loaded */
	if (el2_reset_needed())