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=-4.4 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 1BF6FC4338F for ; Sun, 15 Aug 2021 07:31:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DA6A660EE2 for ; Sun, 15 Aug 2021 07:31:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DA6A660EE2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fCPGQHu4adPMHMOv8PXfnvUtCSHxhpPjQjMW38hjzR0=; b=SvwgZrzXrBE1p9qEXwGIbWB2pt sRIOiDe4Zf0uZOFW6Y4pGjaAvNlJ38IpBVlPJVf0m/y0asa3bGh0k/ZygzFSyByJFUtketPQYK/OD sDl8THbg54nZa752DUWAQR1d5DsdRNxJJvZG0zpdpbbnHk5goLaTVQB0wCtWj5la7I9NG9WGEpqfd dsTKz+XSesxnz1Z0IM9wwl9ED/iQR4DCMNGQoiDA4CAiHzwsxLJqki/k4pZ72pxJSD9+hj2Sauovt MDE3E6F4+mmf61+XfDKCTjgSGxJdRlc9s9A+vTjeDvC/cvVohjeHrm2fh8ntZdZYdxFnO3VHE3sW1 LNbYAD1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFAZm-00Ezg9-IF; Sun, 15 Aug 2021 07:28:58 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mFAZi-00Ezfg-4R for linux-arm-kernel@lists.infradead.org; Sun, 15 Aug 2021 07:28:55 +0000 Received: by mail-pj1-x102d.google.com with SMTP id w14so21729519pjh.5 for ; Sun, 15 Aug 2021 00:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cn/+Frc54mS+Ha2Lobee22sCIkMscZ5re9djGEP3QzE=; b=HdF3gao57FQhc4op+Z08XKW7iXonIW2f6C3zevEzMN2PvVcasXubg4GMGjhXCJpQMB omJGL2L6u+Zt3mySJUtN+bP79cYystJ/tRH6r7xfuPVduVkdUUO0/2EupWHZrUg2tqBv s8pVdNsqqzzi2Dokaxn/3/k9fqNBU7zo0hElBpOHGQsO7h2bOwTFDJKdpz2/NUe+N6Eu nb1Gt6hMcWW7iM94QlnNYV95IdoSepr7T11KXJB3uGlLUyVbY2jelQtl/bjtpKUyymYS whxEHhv6+OTsPwilpIV+jLDK7hj6aq+4DoSEzRuQhdnbIUlHjdI2gyH1Dh5SDgQ/Cd4h FXDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cn/+Frc54mS+Ha2Lobee22sCIkMscZ5re9djGEP3QzE=; b=qjEay69I2Jprgv9vITBGEd8EYvBUmrSPhCkr+KQ94o+xPR5SawYkel2dA9yJSRPE6Q TfR3JsCckr4E66u1mZu6DUvjiVo4ccaPJ+U2zjo/99ao4zfmgY2Jx1oz0iVIWxAlg4qJ RTDOynDdTxb1hKLPSQach6JV+rGy0AmeCr4DzARSgLCzDGxmkYe0lJLC9pq+T9h/5iYB hLQ3fGX29FFhtIPxxkq0Jndfg5EGGmAYg7go4SKJDzcjXERozztacQuL5tosyadOG5JC WbTfU3N67/ecmUy+mvVgB5f57wAJmau6F2wgSpvRiBu0y0X5Tv+oaJ7EFiuOBa4dTkFW c6Iw== X-Gm-Message-State: AOAM532RWvISuUz1Rvp1iZzvaNn+wNp+uYZRqyqwyOAE+wiK5lgwaLUi 1PbGv6dg5B7kushTa2KT9yU= X-Google-Smtp-Source: ABdhPJwrWmWWu+2lk+8Z95VUhJyjjEWzMM/tLQbMaiOwf/18RoS/YvsL7l9/7O3QkubasGwB6fM+kg== X-Received: by 2002:a65:62d1:: with SMTP id m17mr10192429pgv.370.1629012533446; Sun, 15 Aug 2021 00:28:53 -0700 (PDT) Received: from [10.230.32.65] ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id b17sm8375667pgl.61.2021.08.15.00.28.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Aug 2021 00:28:52 -0700 (PDT) Subject: Re: [PATCH 0/5] arm64: Survival kit for SCR_EL3.HCE==0 conditions To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, kernel-team@android.com References: <20210812190213.2601506-1-maz@kernel.org> From: Florian Fainelli Message-ID: <7ffa35bb-1f2c-19ff-fe4b-33267fba80e8@gmail.com> Date: Sun, 15 Aug 2021 09:28:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210812190213.2601506-1-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210815_002854_745215_1F522B08 X-CRM114-Status: GOOD ( 24.34 ) 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 8/12/2021 9:02 PM, Marc Zyngier wrote: > Anyone vaguely familiar with the ARMv8 architecture would quickly > understand that entering the kernel at EL2 without enabling the HVC > instruction is... living dangerously. But as it turns out [0], there > is a whole range of (*cough*) "high quality" (*cough*) Broadcom > systems out there configured exactly like that. Some Broadcom systems, namely the 4908 and all of those using CFE, they later switched to u-boot and ATF and got it right. > > If you are speechless, I'm right with you. > > These machines have stopped being able to boot an upstream kernel > since 5.12, where we changed the way we switch from nVHE to VHE, as > this relies on the HVC instruction being usable... It is also worth > noting that these systems have never been able to use KVM. Or kexec. > > This small series addresses the issue by detecting an UNDEFing HVC in > a fairly controlled environment, and in this case pretend that we have > booted at EL1. It also documents the requirement for SCR_EL3.HCE to be > set to *1* if the kernel is entered at EL2. Turns out that we really > have to state the obvious. > > This has been tested on a FVP model with a hacked-up boot-wrapper. > > Note that I really don't think any of this is -stable material, except > maybe for the documentation. It isn't 5.14 material either. Best case, > this is 5.15, or maybe even later. If ever. While I am very appreciative of the work you have done here to try to get the dysfunctional systems to warn and continue to boot, I would rather we try to load a minimal shim at EL3 capable of fixing up any incorrect EL3 register setting ahead of loading the kernel provided this is possible at all on a commercially available system. Rafal, is this something that CFE allows you to do (as I could not get a straight answer from that team), if so have you tried it? -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel