Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2599994rwd; Fri, 26 May 2023 08:36:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kXkBCuZikfSXw6jtkHomhycuhDdRXdU7JGQdVBTD7rghpwjwZ0xpr+Z2+uSd7utj/5XE/ X-Received: by 2002:a17:902:d2cb:b0:1aa:ff24:f8f0 with SMTP id n11-20020a170902d2cb00b001aaff24f8f0mr3169131plc.4.1685115382871; Fri, 26 May 2023 08:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685115382; cv=none; d=google.com; s=arc-20160816; b=JzHtWGmKtvnF+cMQ+NYYU+aYeAx/bVu1Saz4VR76vMRIMUliDQksBm6aJFXwVx9DGc aHk/i8IixbDEKrLKEqz9xYR3JxInYTbhD6J2OKsPAbL9U2fmEF6i1DM0Ccc85FMPno7P gA6UEDnxWzPmWHQ5DQ4qR43tSyaJ+n0rOlfBxUFhzhT+munduxHsTqhipGMdmDoNsuuR GQ0bqwOnvWfuuRRtv5FgnU17wBBRY8nOGN47i+as1VPsAsDVW72QqcXMRGl1SlQ21Sxu gNu1O4mB482/wcBZF/tY95OXn1J7BOUPyPrMv6Ov+2OIOmiwR8EYXdlqmsdyL9hbTv+e 4+Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=+y0M9KxFm9SSaGID44mBrAZ+4wAEa8CdwEmGmHNHG78=; b=YPJ8YwCk7PStOd11Y4u2S4UTVfEX3lBtSCbefODLQT6bLoOIejxg1HbOot99+YHHVA wAJOsNJKivsTQFz095pV/cn8JmVfQYF0BwSpUIX4T8qs0+D+ezD2ySn3Ttwyerr1uYQK za5y2QEAG4Bg0KER2vqSiLyj1nR2Ql0J7of5eRAwPeqzlt3wktBv8laCzAZT6cmMI9VZ cje5Oy2hi42WB21J5A+40AWG2fGAyFAQKhW9e1lQ12N7IKTFuCWNEIE19stWszIXhYRD aQ9bU5eB/oX6ScADTnoXgjxpYCy1wqjj26SxPt4REj/68MnvOSsdgXMFdw/6jnkkLzS2 xZ8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170902e5cb00b001ae0691dff4si4488154plf.630.2023.05.26.08.36.08; Fri, 26 May 2023 08:36:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237375AbjEZPM6 (ORCPT + 99 others); Fri, 26 May 2023 11:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbjEZPM5 (ORCPT ); Fri, 26 May 2023 11:12:57 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76077F7 for ; Fri, 26 May 2023 08:12:54 -0700 (PDT) X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id 0217DC0007; Fri, 26 May 2023 15:12:46 +0000 (UTC) Message-ID: Date: Fri, 26 May 2023 17:12:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Bug report: kernel paniced when system hibernates Content-Language: en-US To: Conor Dooley , Alexandre Ghiti Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Conor Dooley , Anup Patel , Anup Patel , robh@kernel.org, jeeheng.sia@starfivetech.com, linux-kernel@vger.kernel.org, palmer@rivosinc.com, leyfoon.tan@starfivetech.com, mason.huo@starfivetech.com, Guo Ren , Paul Walmsley , Song Shuai , linux-riscv@lists.infradead.org, Andrew Jones References: <20230525-shrapnel-precut-26500fca4a48@wendy> <20230525-citric-waged-a2f78d27eb0c@wendy> <20230525-flaring-trading-f2bf0713ae26@spud> <20230525-desecrate-imposing-d97ab34e06ad@spud> <20230525-batting-botch-7e03393a2d97@spud> <20230526-steep-omen-a5a46a1086bf@spud> From: Alexandre Ghiti In-Reply-To: <20230526-steep-omen-a5a46a1086bf@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On 26/05/2023 16:59, Conor Dooley wrote: > On Fri, May 26, 2023 at 03:14:33PM +0200, Alexandre Ghiti wrote: >> Hi everyone, >> >> On Thu, May 25, 2023 at 11:24 PM Conor Dooley wrote: >>> On Thu, May 25, 2023 at 01:06:04PM -0700, Atish Patra wrote: >>>> On Thu, May 25, 2023 at 11:39 AM Conor Dooley wrote: >>>>> On Thu, May 25, 2023 at 11:37:40AM -0700, Atish Patra wrote: >>>>> >>>>>> Any testing of hibernation still needs to revert the patch until we >>>>>> have the proper fix. >>>>> "the patch" is what exactly? I assume you don't mean depending on >>>>> NONPORTABLE, since that is a Kconfig option. >>>> Nope. Sorry I meant the commit >>>> >>>> 3335068 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") >>> Ah, if your SBI implementation is one of the affected ones, yeah. >>> If not, you can just set NONPORTABLE :) >> @Björn Töpel emitted the idea of excluding from the hibernation all >> the memory nodes in the "/reserved-memory" node >> (https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml): >> I have to admit that I don't see why it is not done by default by the >> kernel. > My understanding was that it was perfectly fine to use reserved memory > nodes to fence off some memory to use in device drivers etc, which then > may need to be saved/restored. Agreed, but I would say that it's up to the driver then to take care of that, see https://docs.kernel.org/driver-api/pm/notifiers.html >> Unless there is stuff in this node that needs to be "hibernated", I >> think that would be a very good solution since we would not rely on >> the name of the "internal" nodes of "/reserved-memory" (i.e. >> "mmode_resv"). >> >> I'm digging into why it is not done by default, just wanted to have >> your feedback before the week-end :)