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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF0B6C433E0 for ; Tue, 23 Feb 2021 14:20:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BF5A64DE9 for ; Tue, 23 Feb 2021 14:20:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BF5A64DE9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject: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=yPK0jv2GH24Lh09HaAyovmLMqh+OMm0WWXxjbz9cc1A=; b=TU5UKYTgWtKQAEBaNfAA/5ozh uzMP1+AiIgKBkPk9LOVwY4wft7odirmTzsDp9rmhGSXD8P10gfLqv5l727gKw2tgfTPCl+MT7cmcu agBRaI4vANbyVVHnl6asqibn33AXgiCs32bSFGfv7N4WBtci9Iz13X3QbvfgXC0tI/f4WSgem7ODr EnON9j9o33cNr609GiJp9+dS5Hg83hErmeY1wRHk2XT+WwEn0j+pmcra0oc34sHJO4bb9kVQe4plj Uk1ywpCIzs3g4maxmUuKbIW7yjoPRC9aP79qy1iFdn/XKoos241lu1LWpyAlg+7bkhsk7PB0IK+sY 3Fc4P9BRw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEYWn-0002io-Uc; Tue, 23 Feb 2021 14:19:05 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEYWk-0002hP-RO for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 14:19:04 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1E2564DE9; Tue, 23 Feb 2021 14:19:00 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lEYWg-00FVc1-Iy; Tue, 23 Feb 2021 14:18:58 +0000 Date: Tue, 23 Feb 2021 14:18:57 +0000 Message-ID: <87blca27fy.wl-maz@kernel.org> From: Marc Zyngier To: Guillaume Tucker Subject: Re: mainline/master bisection: baseline.login on meson-sm1-khadas-vim3l In-Reply-To: <00e098ec-671b-1117-c9c6-7f8fa96519f7@collabora.com> References: <6033a5da.1c69fb81.9be93.66e6@mx.google.com> <00e098ec-671b-1117-c9c6-7f8fa96519f7@collabora.com> 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: 62.31.163.78 X-SA-Exim-Rcpt-To: guillaume.tucker@collabora.com, will@kernel.org, catalin.marinas@arm.com, dbrazdil@google.com, ardb@kernel.org, amit.kachhap@arm.com, vincenzo.frascino@arm.com, linux-arm-kernel@lists.infradead.org, broonie@kernel.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, andreyknvl@google.com, remi.denis.courmont@huawei.com, kernelci-results@groups.io 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-20210223_091903_112617_00035EC4 X-CRM114-Status: GOOD ( 24.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , David Brazdil , "kernelci-results@groups.io" , Catalin Marinas , Remi Denis-Courmont , linux-kernel@vger.kernel.org, Mark Brown , Andrey Konovalov , Amit Daniel Kachhap , Vincenzo Frascino , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org 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 Hi Guillaume, On Tue, 23 Feb 2021 09:46:30 +0000, Guillaume Tucker wrote: > > Hello Marc, > > Please see the bisection report below about a boot failure on > meson-sm1-khadas-vim3l on mainline. It seems to only be > affecting kernels built with CONFIG_ARM64_64K_PAGES=y. > > Reports aren't automatically sent to the public while we're > trialing new bisection features on kernelci.org but this one > looks valid. > > There's no output in the log, so the kernel is most likely > crashing early. Some more details can be found here: > > https://kernelci.org/test/case/id/6034bed3b344e2860daddcc8/ > > Please let us know if you need any help to debug the issue or try > a fix on this platform. Thanks for the heads up. There is actually a fundamental problem with the patch you bisected to: it provides no guarantee that the point where we enable the EL2 MMU is in the idmap and, as it turns out, the code we're running from disappears from under our feet, leading to a translation fault we're not prepared to handle. How does it work with 4kB pages? Luck. Do you mind giving the patch below a go? It does work on my vim3l and on a FVP, so odds are that it will solve it for you too. Thanks, M. diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index 678cd2c618ee..fbd2543b8f7d 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -96,8 +96,10 @@ SYM_CODE_START_LOCAL(mutate_to_vhe) cmp x1, xzr and x2, x2, x1 csinv x2, x2, xzr, ne - cbz x2, 1f + cbnz x2, 2f +1: eret +2: // Engage the VHE magic! mov_q x0, HCR_HOST_VHE_FLAGS msr hcr_el2, x0 @@ -131,11 +133,29 @@ SYM_CODE_START_LOCAL(mutate_to_vhe) msr mair_el1, x0 isb + // Hack the exception return to stay at EL2 + mrs x0, spsr_el1 + and x0, x0, #~PSR_MODE_MASK + mov x1, #PSR_MODE_EL2h + orr x0, x0, x1 + msr spsr_el1, x0 + + b enter_vhe +SYM_CODE_END(mutate_to_vhe) + + // At the point where we reach enter_vhe(), we run with + // the MMU off (which is enforced by mutate_to_vhe()). + // We thus need to be in the idmap, or everything will + // explode when enabling the MMU. + + .pushsection .idmap.text, "ax" + +SYM_CODE_START_LOCAL(enter_vhe) + // Enable the EL2 S1 MMU, as set up from EL1 // Invalidate TLBs before enabling the MMU tlbi vmalle1 dsb nsh - // Enable the EL2 S1 MMU, as set up from EL1 mrs_s x0, SYS_SCTLR_EL12 set_sctlr_el1 x0 @@ -143,17 +163,12 @@ SYM_CODE_START_LOCAL(mutate_to_vhe) mov_q x0, INIT_SCTLR_EL1_MMU_OFF msr_s SYS_SCTLR_EL12, x0 - // Hack the exception return to stay at EL2 - mrs x0, spsr_el1 - and x0, x0, #~PSR_MODE_MASK - mov x1, #PSR_MODE_EL2h - orr x0, x0, x1 - msr spsr_el1, x0 - mov x0, xzr -1: eret -SYM_CODE_END(mutate_to_vhe) + eret +SYM_CODE_END(enter_vhe) + + .popsection .macro invalid_vector label SYM_CODE_START_LOCAL(\label) -- 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