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 3F0BDC433FE for ; Tue, 11 Oct 2022 21:00:50 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=avyiihN00DhwsWFKpdp3yRmUKFb760AnqjrzxqOdJ3Q=; b=hxpAMlBGn35itZ 1JnW0qlAIdqbemCCXgR7kYlF2xWaxKbLqV80Lg57FK+0TVr5dOW+Z7SRZcpw3/F2aoxmx641jG7GI /mB8Y7praJLAQpxRBGzU6+lp9DgJ11wRICNqfCrU7LrIj7Ovfds/D5OnzAKm63ydvM/WO4KrziK5X 1KxqsGLZoEAaVhJxWNaz+nBb4Lu/TIKh/J5gqs34wWJBCOSu9hwjs4d7+gTsNdwWKeVEsLwZph8I3 cEwBXPL76CKOKuB9fF5GgRZ3lcqN/7Dxi5tBza+upzTdcIehhXywxoK3GtuYKSiHTOa4OW5ksQsQV xQYIezUGxrwnLc0tivfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiMLT-005rD7-De; Tue, 11 Oct 2022 20:59:23 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiMLP-005rCP-QO for linux-arm-kernel@lists.infradead.org; Tue, 11 Oct 2022 20:59:21 +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 ams.source.kernel.org (Postfix) with ESMTPS id 033AEB8168D; Tue, 11 Oct 2022 20:59:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA530C433C1; Tue, 11 Oct 2022 20:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665521955; bh=WDo7TGKL3wdUVXktG1Ud6ocgH2ZnNiVxM3UyUdlDECc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ke+sNRqK7PE3/xFvxADXu/qe+KbCTRkR0BxLz1btUnknJZgyM4ekS9tob+pkCvhs2 Icg12WveyWOwGN6iuyt/biq+f6iXDYHU3QwLNFGXx5ImYf6JoUvs1OsFNZPd/rGthL PJDvQiyIKwPRUuuiD8IEFi5V9oSncigd5LLu709bJD63+oIYT4EbwALvsb/tHfLzFI 0zuVX09Ss7iN7GkS86KOZv/52ANIBsjqfeArwhB3tGd1cQwY1QU8i5Kv8/lhb+nSMc OPQDzn72FDLOqeTpMYdZFoQkldEK9ihPTGEJ3+CLaxDRVrFrbp18sJw3ci8VMftclB IygljItW34ovA== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oiMLJ-00FuhW-Bb; Tue, 11 Oct 2022 21:59:13 +0100 Date: Tue, 11 Oct 2022 21:58:22 +0100 Message-ID: <87pmeygjrl.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.cs.columbia.edu, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Suzuki K Poulose , Alexandru Elisei , Quentin Perret , Will Deacon , Vincent Donnefort Subject: Re: [PATCH] KVM: arm64: pkvm: Fixup boot mode to reflect that the kernel resumes from EL1 In-Reply-To: References: <20221011165400.1241729-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.cs.columbia.edu, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, qperret@google.com, will@kernel.org, vdonnefort@google.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-20221011_135920_190227_816AF847 X-CRM114-Status: GOOD ( 24.36 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 11 Oct 2022 19:48:39 +0100, Oliver Upton wrote: > > On Tue, Oct 11, 2022 at 05:54:00PM +0100, Marc Zyngier wrote: > > The kernel has an awfully complicated boot sequence in order to cope > > with the various EL2 configurations, including those that "enhanced" > > the architecture. We go from EL2 to EL1, then back to EL2, staying > > at EL2 if VHE capable and otherwise go back to EL1. > > > > Here's a paracetamol tablet for you. > > Heh, still have a bit of a headache from this :) > > I'm having a hard time following where we skip the EL2 promotion based > on __boot_cpu_mode. > > On the cpu_resume() path it looks like we take the return of > init_kernel_el() and pass that along to finalise_el2(). As we are in EL1 > at this point, it seems like we'd go init_kernel_el() -> init_el1(). > > What am I missing? That I'm an idiot. This is only necessary on pre-6.0, before 005e12676af0 ("arm64: head: record CPU boot mode after enabling the MMU"), as this code-path *used* to reload the boot mode from memory. Now, this is directly passed as a parameter, making this patch useless. The joys of looking at too many code bases at the same time... I'll see how we can add it to 5.19. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel