lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1652860121-24092-2-git-send-email-quic_vivekuma@quicinc.com>
Date:   Wed, 18 May 2022 13:18:36 +0530
From:   Vivek Kumar <quic_vivekuma@...cinc.com>
To:     <corbet@....net>, <catalin.marinas@....com>, <will@...nel.org>,
        <tglx@...utronix.de>, <maz@...nel.org>, <axboe@...nel.dk>,
        <rafael@...nel.org>, <akpm@...ux-foundation.org>,
        <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-block@...r.kernel.org>, <linux-pm@...r.kernel.org>,
        <linux-mm@...ck.org>
CC:     <len.brown@...el.com>, <pavel@....cz>, <paulmck@...nel.org>,
        <bp@...e.de>, <keescook@...omium.org>, <songmuchun@...edance.com>,
        <rdunlap@...radead.org>, <damien.lemoal@...nsource.wdc.com>,
        <pasha.tatashin@...een.com>, <tabba@...gle.com>, <ardb@...nel.org>,
        <tsoni@...cinc.com>, <quic_psodagud@...cinc.com>,
        <quic_svaddagi@...cinc.com>,
        Vivek Kumar <quic_vivekuma@...cinc.com>,
        Prasanna Kumar <quic_kprasan@...cinc.com>
Subject: [RFC 1/6] 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.

Signed-off-by: Vivek Kumar <quic_vivekuma@...cinc.com>
Signed-off-by: Prasanna Kumar <quic_kprasan@...cinc.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ