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 8B180C43217 for ; Thu, 13 Oct 2022 13:51:52 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kBBzEiM+CvNH2Spfq5Ou/oahReZQBBDECmNuW42Nx7k=; b=T0boQIkgndWyAr 7Pp5DeQFw8HRomhkEZE7WITNnle5ElcrD3Ye7m4+3hnBWL6kksMVweHAnm+PDawfFZXHALp7Eh6q/ +0essWdF1IDawp3I9YkgZb5k8+DyNRLma6znG3ko0EEx8m+d09SDfj1zfqlgj1nW6vVrivIdfDNdQ eM/lVZx40sRGwUJIzJ7clELNqgqOjmvSaD9iyzNNCCXSVujm5ZiKj9qYjIUadVJD/2QEngXigO9fl TIS7n3lNWlKViYEUQFIIB1YEm8MM3Dc4+9yoDGN8Sj0emj6yeKxlmQXabrTD1cNM9BcG8V8+2CtfX /2JGZFdrsUoK/BNhcq2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiybQ-00C0Df-Ko; Thu, 13 Oct 2022 13:50:25 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiyLM-00Btt3-C1 for linux-arm-kernel@lists.infradead.org; Thu, 13 Oct 2022 13:33:49 +0000 Received: by mail-wm1-x333.google.com with SMTP id r3-20020a05600c35c300b003b4b5f6c6bdso1451681wmq.2 for ; Thu, 13 Oct 2022 06:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wtCloI9hskeDNVZ254m/WnfVkbDM6sWRXNrTkKvw5FY=; b=YW8z6aczP59ni0skunR8oi0MaOYp45DzXHwhcdK7CWpUnP5B39YJhV5ewCDGDKUgfb XODKvI1+dXZXPs/gz2ycYE0tw/6n+1eOUS4Vz1+uKTt87A312Z3T0sxaIQCm6Dc5+GVx 3DpQL6CfPKCU/LA0HFGxJ2Se2t33vLI8UrQNVl5MrDvlvSe3UYx4CRMrDgZ2I2/NjkoS 82b54oP5rxZdq+DNZWVJ/iH3KL9O9sEqFbtskumqU4lFdhmPqp9WdIPau4TvKcT2jL1A ZGFNJdKvht+9AQVirDse/nkU60mohW71olHTsNkVHZFgUUITm2dtLCwJLVQN6jN6Hv6l 10RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wtCloI9hskeDNVZ254m/WnfVkbDM6sWRXNrTkKvw5FY=; b=EoZoxsIf0but5kxQoVoK6JntLTCgz3tM7NaRhyyuk/1CE3pKPMpZQPwfaUSi7X1NJQ fqmeRBxxewkPWSSZjQw3Awaqt+1JbQi9SBEqff4UkXH/FNH6blauvJdouDYnilr4D9LB JS1K3gqRjtTFcxW8HY/VIARB4x3viGOaQIYBubQDxSUeKvMadB5enUd9CDcQUJlCCyNf nXcrQJEOEJHC2ZNcynn2tR0fnGpadTYri4lgNCiGdnk1GaYyBSP2dd54/JPyaKdJGtJ3 Aw2sB9zmhY+gdyuG5tO9glrK8aKKk9vj00cTtCIfgLVKe0k0E11RWzwLMBjSkaLYTxDQ G2nA== X-Gm-Message-State: ACrzQf3VO5ggx5njxyQQSgOuzz921FLafuvTAe6b0KKgBcqEQX5Httbi 0bTBzC1aZ0F34Csq8Tb5ZOs5nA== X-Google-Smtp-Source: AMsMyM5Xvso38gZmW1inlKkLOIsDEX7FDM5OiRgLE55NcJDVGJPiW+JGoOffZ4yRYyETMAV8Z8Ms2g== X-Received: by 2002:a7b:c341:0:b0:3c4:552d:2ea7 with SMTP id l1-20020a7bc341000000b003c4552d2ea7mr6699736wmj.82.1665668023180; Thu, 13 Oct 2022 06:33:43 -0700 (PDT) Received: from google.com (65.0.187.35.bc.googleusercontent.com. [35.187.0.65]) by smtp.gmail.com with ESMTPSA id r205-20020a1c44d6000000b003c3a1d8c8e6sm4582858wma.19.2022.10.13.06.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 06:33:42 -0700 (PDT) Date: Thu, 13 Oct 2022 14:33:38 +0100 From: Vincent Donnefort To: Marc Zyngier Cc: Oliver Upton , 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 Subject: Re: [PATCH] KVM: arm64: pkvm: Fixup boot mode to reflect that the kernel resumes from EL1 Message-ID: References: <20221011165400.1241729-1-maz@kernel.org> <87pmeygjrl.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87pmeygjrl.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221013_063348_469347_18B7D5E8 X-CRM114-Status: GOOD ( 25.09 ) 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, Oct 11, 2022 at 09:58:22PM +0100, Marc Zyngier wrote: > 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. On a 5.10 though, the suprious HVCs are gone and I have not observed any regression. Thanks! For a stable fix: Tested-by: Vincent Donnefort > > 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