[RFC 1/6] arm64: hibernate: Introduce new entry point to kernel
Vivek Kumar
quic_vivekuma at quicinc.com
Wed May 18 00:48:36 PDT 2022
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.
Signed-off-by: Vivek Kumar <quic_vivekuma at quicinc.com>
Signed-off-by: Prasanna Kumar <quic_kprasan at quicinc.com>
---
arch/arm64/kernel/hibernate.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c
index 6328308..4e294b3 100644
--- a/arch/arm64/kernel/hibernate.c
+++ b/arch/arm64/kernel/hibernate.c
@@ -74,6 +74,14 @@ static struct arch_hibernate_hdr {
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.
*/
@@ -116,6 +124,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())
--
2.7.4
More information about the linux-arm-kernel
mailing list