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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5965E92705 for ; Thu, 5 Oct 2023 14:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239111AbjJEOlr (ORCPT ); Thu, 5 Oct 2023 10:41:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236897AbjJEOhj (ORCPT ); Thu, 5 Oct 2023 10:37:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F1B597AA0 for ; Thu, 5 Oct 2023 07:03:17 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0F1F153B; Thu, 5 Oct 2023 03:28:10 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.94.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 676E23F5A1; Thu, 5 Oct 2023 03:27:29 -0700 (PDT) Date: Thu, 5 Oct 2023 11:27:26 +0100 From: Mark Rutland To: Doug Anderson Cc: Marc Zyngier , Catalin Marinas , Will Deacon , Stephen Boyd , Valentin Schneider , Chen-Yu Tsai , AngeloGioacchino Del Regno , D Scott Phillips , Josh Poimboeuf , Matthias Brugger , Misono Tomohiro , Peter Zijlstra , Sumit Garg , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/2] arm64: smp: Fix pseudo NMI issues w/ broken Mediatek FW Message-ID: References: <20231002094526.1.Ie8f760213053e3d11592f892b30912dbac6b8b48@changeid> <86jzs2ofqs.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 04, 2023 at 07:04:12AM -0700, Doug Anderson wrote: > On Wed, Oct 4, 2023 at 3:15 AM Marc Zyngier wrote: > > > > On Wed, 04 Oct 2023 10:59:50 +0100, > > Mark Rutland wrote: > > > > > > Given you haven't seen any issues, I suspect those are getting reset to fixed > > > values that happens to work out for us, but it is a bit worrisome more > > > generally (e.g. the LPI case above). > > > > It is likely that these SoCs don't even have an ITS. > > Right. That was what we decided [1] when Marc pointed this out earlier. > > Overall: we know that this firmware behavior is not good but we're > stuck with it. :( At the very least, any new devices coming out will > have this fixed. Presumably if old devices are working OK enough today > (as long as you don't enable pseudo-NMI) then they can be made to keep > working? > > So circling back: what patch should we actually land? For now I'd prefer we took the patch I sent in: https://lore.kernel.org/linux-arm-kernel/ZRr8r7XMoyDKaitd@FVFF77S0Q05N.cambridge.arm.com/ ... as that leaves us no worse than before this series, and it's pretty simple. > As of right now only pseudo-NMI is broken, but it would be good to make sure > that if the kernel later adds other features that would be broken on this > hardware that it gets handled properly... Going further than the above, I think there are three options here: 1) Complete fix: depend on a working firmware, and throw this workaround away. IIUC from the above, that's not something you can commit to. 2) Partial fix: have the kernel save/restore everything. IIUC this is unpalatable. 3) Partial fix: make the ARM64_HAS_GIC_PRIO_MASKING cpucap depend on the absence of a "mediatek,broken-save-restore-fw" property in the DT. I believe we can check that in early_enable_pseudo_nmi() or can_use_gic_priorities(). That'll avoid potential issues if/when we change the priorities used for pNMI (which is something I've been looking at). I'm happy with (3) if Marc is. Mark.