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=-3.2 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,URIBL_BLOCKED,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 CAA74C4338F for ; Sun, 22 Aug 2021 11:34:10 +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 83D6861267 for ; Sun, 22 Aug 2021 11:34:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 83D6861267 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=B8/gtXHPelPQOLxGcl9L0QXn1z0bMpq++yc6G5pgy5c=; b=BPuxV90wrxQD0sePGbHZQ34Hxs 025sDivC/J7RpGCk/K1jzNzT2Bu3fZucZZ/guJxfqh0bY1eL/E1vL019Rl7rAPHTu67DZJnjzqtyz lLks91pF915u4mS8k1/KPN6mwlZUirsonv6ARB6Bj4D4HyW6U051hnyz5Hbp6cxdqDdQV0+rMcdU/ urSb4hEyHfB4uECIoF5xJtPvtN5ieBbXxghkoKIn/N19upr5x+MmVYUZz6lJi/EYjrUuWbkdjUDI3 DL1HVB+jOHdKmolidpYyDbKPEc2vWyUFQVcSAxlDacyW2/2jkiCal3YWcx8kE7amTtjduoZmVQfd7 WapG89cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mHlhm-00DvFE-87; Sun, 22 Aug 2021 11:31:58 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mHlhh-00DvEt-Lh for linux-arm-kernel@lists.infradead.org; Sun, 22 Aug 2021 11:31:55 +0000 Received: by mail-pl1-x62c.google.com with SMTP id e15so8513015plh.8 for ; Sun, 22 Aug 2021 04:31:50 -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=uG8L86QsABhqIwwrydn4T4dyHIpTrRxaUr9DrrinnwM=; b=l7SzrK0oaNhCcHt3E8VCYzXFX6OdelfMnmQ4dHsFQ8jR1Gr78k59aO7yKKJRxl2Smq NnvsA0bNbiMcKTvGJ69azmWt3OA0b273iXiFG8snU2bnbJE1lAlMh0H7CDKOwrDr3v4F DTmg9B6q8D3XYY10kROF747L3MfsOySEgi8+30LnWak1TNLUHBAUm2Lvh0ELe/1REo4q +VKXo8k/QJItqI8pojbff+ebfpcFzpT99fjNvwxtdJOx5ybBqSuyafl6i8ybClNdYsEt ekXhdNS9lHS7ZtXQd3TjwGL/Oc4WUwRHItt0HlPwbbChHED6JTWmu82wZIUd1F5ICkQ8 7Gng== 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=uG8L86QsABhqIwwrydn4T4dyHIpTrRxaUr9DrrinnwM=; b=AKbfl8vfKhu41QXgl2HPFENrp/FQX2U08WqHlkX0WSqnH9HE6z4APzslVH/16JXLEq B7w/jygn1LDR8XnihB1zVbkbxRg7FA06YsqtiQ4viHewHlje/HZ4hDe3MdW3X7f+UP9/ Q45Wk1gu5nkCuvjilJ1V3wTcow9xy3bAIrYZjeqh8wp1B8W5yHA2/9t2AenhKtjESjQH jH8JCJEkEHiX72lwPZS4ppaCvUl8iJeM2LhIdRjEmMLE8CPhlQQDm37/stB12/b8c+Xu yx0Xw0ZQrDK7zU3pe7e6RcCoARLGlrWqBWXA8Cu34kyAaxhbxuVJJOwOIO/jzSpSzGEu eMCw== X-Gm-Message-State: AOAM532eCFE0yNoqHbeehhounvDmEhNwCACBUglwPHufJ2NMhkWENjF4 kFkIcQDzJ2VepG/va/tnjEI= X-Google-Smtp-Source: ABdhPJw6tKO7hQ6MCmq1ZROVlWfDeX1cTvVIteWiV9X19pBYrc5vUsBuw+myU5VcWIPvSDU/x7/IMQ== X-Received: by 2002:a17:90a:c481:: with SMTP id j1mr14469626pjt.164.1629631910175; Sun, 22 Aug 2021 04:31:50 -0700 (PDT) Received: from [10.230.31.46] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id z2sm15074459pgb.33.2021.08.22.04.31.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Aug 2021 04:31:49 -0700 (PDT) Subject: Re: [PATCH 0/5] arm64: Survival kit for SCR_EL3.HCE==0 conditions To: Marc Zyngier , Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , bcm-kernel-feedback-list@broadcom.com, kernel-team@android.com References: <20210812190213.2601506-1-maz@kernel.org> <7ffa35bb-1f2c-19ff-fe4b-33267fba80e8@gmail.com> <874kbr12in.wl-maz@kernel.org> From: Florian Fainelli Message-ID: <0d3de5dd-f85c-d6d6-2c1b-1248847c0a09@gmail.com> Date: Sun, 22 Aug 2021 13:31:38 +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: <874kbr12in.wl-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210822_043153_771700_D708A9C7 X-CRM114-Status: GOOD ( 28.84 ) 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/15/2021 11:27 AM, Marc Zyngier wrote: > On Sun, 15 Aug 2021 08:28:47 +0100, > Florian Fainelli wrote: >> >> >> >> 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. > > Do we have a list of the affected systems? That is going to be hard to come up with given that OEMs such as Asus, TP-Link, or Netgear and multiple devices are affected. I would start with this list which is far from exhaustive: Netgear R8000P, TP-Link Archer C2300, Asus GT AC5300. > >> >>> >>> 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. > > That would be the best thing to do, and would make the machine fully > usable. I still think we need to have something in the kernel to at > least let the user know that their system is misconfigured though. > > If CFE allows a payload to be loaded at EL3 and executed on all CPUs, > that would be absolutely awesome. It would even allow switching over > to ATF... Supposedly there are GPL tarballs containing an u-boot that is suitable for the 4908, however I have no idea where to find those. In premise you could chainload those to CFE and a get seemingly functional system. -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel