From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2449FC43217 for ; Thu, 19 May 2022 15:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:Cc:To:From :Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AHwMIV8N4wyb7uqEBfKsiZqVk6QWyfIUYvRcLTsFFS0=; b=l9bhn7kARjUqRX1LPkVG/B5y+6 dXxrk75vjFEKQC4rdNijoGuS+bkj2Wco0zD5C8jERtn0nqr0r2vdD9aqb1PU46dTVmPHif8py/fsh v9+SevX6l/+LGuERSkOTTzJJgoPt+dfY17SugZUPVxFGwaHdgOGDLQHYRctXu0eqs3BNY4km9nto+ NG+B2nxYbChqI76Dsp0/eWZIM8JFOXQ+3NKjAE1WdW1ZzhRyoBlfn/s0L99IjK5gNfZXLJm9nUj82 uzp+/qR6uqRKDuTHVsQEwAKc8ETkMSdBw7Dm2FQEc5qkicaik1Roinabta8TfmIrPbOgswTYQxXRa 2MaHGh2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nri7k-007yHl-Ae; Thu, 19 May 2022 15:31:36 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nri3o-007vwL-IC for linux-arm-kernel@lists.infradead.org; Thu, 19 May 2022 15:27:34 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 8D52ECE2516; Thu, 19 May 2022 15:27:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5DC7C385AA; Thu, 19 May 2022 15:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652974048; bh=fWzT1RDzL+g/G2pbgJJD/u9obC3MZhKB4yK9conyL8g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KhPlyqr5DQ+2cxzW0xu4vYkoXbmxOHVwbib+1FOdSi4DyM1fdNRJKpkCXmhKC8/sw jNg5Ewr2ACxNFq6z9vUY4tGKAxaJ6wujFNx5o7sLHygM2LxCMvsb+AXZ+kJbtwHbrm TcVxENBVaAuttLzbvtbAahxCC7LXKKuezdvoJFBMa9CL6AZPR13x9yJAJs3w9JdE2M gILeHgLB+1/mYxOpjc9gAt4SIVhmBzql+/b7dKEEToGvpMwDfrRpEtcjpy6FnzQ5iP 1yGgwc3aZNTv1BV6VUHo14UYj1DGJ41lfxRRnI3gGhcTloxiboRbNY0M0VvQwEOy+f tiNlDxh+Nzn/g== Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nri3i-00CSzu-B2; Thu, 19 May 2022 16:27:26 +0100 MIME-Version: 1.0 Date: Thu, 19 May 2022 16:27:26 +0100 From: Marc Zyngier To: Vivek Kumar Cc: corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, axboe@kernel.dk, rafael@kernel.org, akpm@linux-foundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-block@vger.kernel.org, linux-pm@vger.kernel.org, linux-mm@kvack.org, len.brown@intel.com, pavel@ucw.cz, paulmck@kernel.org, bp@suse.de, keescook@chromium.org, songmuchun@bytedance.com, rdunlap@infradead.org, damien.lemoal@opensource.wdc.com, pasha.tatashin@soleen.com, tabba@google.com, ardb@kernel.org, tsoni@quicinc.com, quic_psodagud@quicinc.com, quic_svaddagi@quicinc.com, Prasanna Kumar Subject: Re: [RFC 1/6] arm64: hibernate: Introduce new entry point to kernel In-Reply-To: <1652860121-24092-2-git-send-email-quic_vivekuma@quicinc.com> References: <1652860121-24092-1-git-send-email-quic_vivekuma@quicinc.com> <1652860121-24092-2-git-send-email-quic_vivekuma@quicinc.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <1d517a7598f7833196ec0c8258816aba@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: quic_vivekuma@quicinc.com, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, axboe@kernel.dk, rafael@kernel.org, akpm@linux-foundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-block@vger.kernel.org, linux-pm@vger.kernel.org, linux-mm@kvack.org, len.brown@intel.com, pavel@ucw.cz, paulmck@kernel.org, bp@suse.de, keescook@chromium.org, songmuchun@bytedance.com, rdunlap@infradead.org, damien.lemoal@opensource.wdc.com, pasha.tatashin@soleen.com, tabba@google.com, ardb@kernel.org, tsoni@quicinc.com, quic_psodagud@quicinc.com, quic_svaddagi@quicinc.com, quic_kprasan@quicinc.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_082733_037277_8509392C X-CRM114-Status: GOOD ( 23.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Prasanna Kumar > --- > 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... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel