Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp347449rdb; Thu, 5 Oct 2023 07:42:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDHq1x6nW1vopJ3P2A0jRX+TRrv5lqJvKCvPGQ9T38fu7sMNKFIruhns6MkGJpicT6uIxY X-Received: by 2002:a05:6a21:6da9:b0:15c:cde5:fb02 with SMTP id wl41-20020a056a216da900b0015ccde5fb02mr6326287pzb.52.1696516936556; Thu, 05 Oct 2023 07:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696516936; cv=none; d=google.com; s=arc-20160816; b=Wf0WNp2IVcfTZdM5j/sX9ZBcXLCjxZB+X6f6CnUMneMS8AW7gQKN4l5zxgM6vkmiFG gHqZP/5K0RwTccrwUJTcnIJoMLaYDYnBsVerZCXd3Sg/DJnMQ5FvJcZbAZR3cNnafdAd spmPktU8laMgXmYqQvaT4QHhWU4gjJro+VN6B1aNe4ZRmW9wURr2XKP7qYDv6/e9hX3I ehAEed2tajrMpvyuaimRJscpNJ8Tgo0rSn8ZLxvRK6xxiyB2EQ1a4+bIm8VK1HT48riZ gAWHB6iXB/YDrm+6Kk3aDyi+fBYBMS8Lc1UcTsmKaqupVheq3Ho6aSMuVVEFGq3/IX2w CXyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/jAIT8711ULGb6f+FX7b7dt1N2Jmj997+xycepBbzyo=; fh=v7PcEeLN0OAHyLA4mHepezXEGASCJPhdVTqW4gAbAkg=; b=HSA1jomyf/WNMEHQ/VMHPDNWVZUtB0IayXFrXxhEP/si3W/rj3ejpUxht1KFjb7DZO VOixscIMdRwC/SX7T6omkLvJBnSEF0gwi5gyuVrI0WA33wNnFkuvbFZx6giAQsrZkLor 6yE1Wi4iqE16ocJIzKOORWREq4gmspgmnff5Npl0+Sj834Jjn5WITPU0yu7z5kJVeBNB Jsd3jnzQKkMrOeU1v9g1mItLwjxDK7v3dexCp+N9lVtObqwyFNlYAzan7difFUX6fXQ1 htlpFkyinst0Wmu00dXIzX8TidV3Wh223cVijS3EcTryw6j2JTLamlSpcdv+GBMTam7b Cwmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 12-20020a63164c000000b0058933a7437fsi1542356pgw.507.2023.10.05.07.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:42:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 79AEA82ECB31; Thu, 5 Oct 2023 07:42:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238904AbjJEOln (ORCPT + 99 others); Thu, 5 Oct 2023 10:41:43 -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: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:42:15 -0700 (PDT) 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.