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 56C8DC636D4 for ; Wed, 15 Feb 2023 08:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233793AbjBOICk (ORCPT ); Wed, 15 Feb 2023 03:02:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbjBOICh (ORCPT ); Wed, 15 Feb 2023 03:02:37 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487623668F for ; Wed, 15 Feb 2023 00:02:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8515F61A7B for ; Wed, 15 Feb 2023 08:02:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFF55C433EF; Wed, 15 Feb 2023 08:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676448147; bh=QDjPmZcGUSDtJoHRAZL8Zkp030l2cNP4ARA092+yGBA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qLtB8z4l/Av6UjfwI/XorTC/GS94J/S/RA+feMxvs3nli/F65LWibGxMDRZxmolkm 0q4E0UpkJuTLGc0NiaCedGVDJZ/PqyAl8AoA9cblsPzAhUrrrY4GNeosg3sIhH7tQ3 7u6bQaZj+smSuyPE3uwo3rXSmVZtsvLZg1vN9TJcsRBBzcK/0wKBaM6M35BHFBlXri zecbrQpsn3Je51InFHWPeDf9PubTClJvAf1f+55YoF42Emp1gaXhWODxkhYNg3251H mFr+IWYKcgx94BrX08JnkBEDO3BB5UsUFJWaSlnMLbwYnf+FTYh39YqjXbujvW+e9u eWz4XsHlCR6ng== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pSCkC-00AX1J-M7; Wed, 15 Feb 2023 08:02:25 +0000 Date: Wed, 15 Feb 2023 08:02:20 +0000 Message-ID: <87o7pvz78z.wl-maz@kernel.org> From: Marc Zyngier To: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Oliver Upton , linux-kernel@vger.kernel.org (open list:IRQCHIP DRIVERS), Sudeep Holla , Broadcom internal kernel review list Subject: Re: [PATCH 3/3] irqchip/gic-v3: Save and restore distributor and re-distributor In-Reply-To: <20230214233426.2994501-4-f.fainelli@gmail.com> References: <20230214233426.2994501-1-f.fainelli@gmail.com> <20230214233426.2994501-4-f.fainelli@gmail.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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: f.fainelli@gmail.com, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, oliver.upton@linux.dev, linux-kernel@vger.kernel.org, sudeep.holla@arm.com, bcm-kernel-feedback-list@broadcom.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Feb 2023 23:34:26 +0000, Florian Fainelli wrote: > > On platforms implementing Suspend to RAM where the GIC loses power, we > are not properly saving and restoring the GIC distributor and > re-distributor registers thus leading to the system resuming without any > functional interrupts. The real question is *why* we need any of this. On any decent system, this is the firmware's job. It was *never* the OS GIC driver's job the first place. Importantly, the OS cannot save the full state: a large part of it is only accessible via secure, and Linux doesn't run in secure mode. How do you restore the group configuration, for example? Oh wait, you don't even save it. So unless you have a single security state system, this cannot work. And apart from VMs (which by the way do not need any of this), there is no GICv3-based system without EL3. If you know of one, please let me know. And if it existed, then all the save/restore should happen only when GICD_CTLR.DS==1. To conclude, this patch doesn't do what it advertises, because it *cannot* do it, by definition. The secure firmware is the only place where this can be done. M. -- Without deviation from the norm, progress is not possible.