[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d517a7598f7833196ec0c8258816aba@kernel.org>
Date: Thu, 19 May 2022 16:27:26 +0100
From: Marc Zyngier <maz@...nel.org>
To: Vivek Kumar <quic_vivekuma@...cinc.com>
Cc: corbet@....net, catalin.marinas@....com, will@...nel.org,
tglx@...utronix.de, 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, 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,
Prasanna Kumar <quic_kprasan@...cinc.com>
Subject: Re: [RFC 1/6] arm64: hibernate: Introduce new entry point to kernel
On 2022-05-18 08:48, Vivek Kumar wrote:
> 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())
So here, you are creating a new ABI with the bootloader, based on
a data structure that isn't mean't to be ABI. It means that we
wouldn't be allowed to ever change this data structure, as this
would mean having to update the bootloader in sync.
Clearly, this isn't acceptable.
M.
--
Jazz is not dead. It just smells funny...
Powered by blists - more mailing lists