Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2587110rwd; Fri, 26 May 2023 08:26:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Zh05/DskxWa+ICEN1UZusPQI8l3+PXhEzpO0uZYEt1Xf4O3rPJ0C77VP0pTZgIXLfB5sO X-Received: by 2002:a17:90a:3e41:b0:253:266a:3b00 with SMTP id t1-20020a17090a3e4100b00253266a3b00mr2630719pjm.37.1685114775392; Fri, 26 May 2023 08:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685114775; cv=none; d=google.com; s=arc-20160816; b=mb9XBU6BCrYPuEc/efiYX8vvnE9/x4ecW6Nlwh5J7mJYrSttwG9dds4MUc8cQ4Yb5L vVnNoIlqi0StIGYbFwqAc1Jr5Y174Ig+u5RovRHfbn+aQfMqdKQH0aAxWHuQRg/Kf5yd BBkxnFXZlK1jKm8Rav2oAFajrgVR0xpUU4XWkLbAIo2Nq+e51QDoxwO17i+cGZMR1sBY ZUpV51fNXr+ZT6c1VqPNKpIUcWheXtUHCJ6NGw0aDrMzWtyoX1YG+1qcIP2Vr1k3/FDf lccZUtH+H4P4s9nUsaRQFYh8oHoXZKlmqFb7a39a+txNUlTM1WTg/fXOSvDJHxvGxxD0 S07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sd+Dqbtp7qNkmD7ajxLTDaj4AydWZwx3n13Wvgc7GFs=; b=G9XA4BuaTlTq4+bkkNgBN+1f7Flz8SWxWme8ZYySGsRtMSnE+CMYylwoQ0o6S/WwoQ GiSmtEu0yEj22ytGrbxbPAO+Qtv9UmLmc9jPC28lfPTuTkdxEjhcnHHtxQd0O/i5psxX TVdYQG+0nDkPYWjubbMdHKicGPtqqjnphs6zNJl90ljOcYvnha/xkg/fW3ra5ALllwdY JsiitZ8me/QGlN6NzHPoigMIYju/IUyS0+sxcroGa98U8fZIqjoEzC5H4UE3OiOUYPNZ XHkEebv3R4rwowAR2Ors/LuKJtgXN/a0AiE/LMmyAutFoU/BSrE9hKVi8Wm1AWYWVnQ6 fg2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20221208.gappssmtp.com header.s=20221208 header.b=TRHNHAAR; 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 bk4-20020a17090b080400b002502c10bdb4si1216388pjb.91.2023.05.26.08.25.59; Fri, 26 May 2023 08:26:15 -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; dkim=pass header.i=@brainfault-org.20221208.gappssmtp.com header.s=20221208 header.b=TRHNHAAR; 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 S243945AbjEZPSD (ORCPT + 99 others); Fri, 26 May 2023 11:18:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237050AbjEZPSB (ORCPT ); Fri, 26 May 2023 11:18:01 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B021EE7 for ; Fri, 26 May 2023 08:18:00 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-96fbc74fbf1so148060966b.1 for ; Fri, 26 May 2023 08:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20221208.gappssmtp.com; s=20221208; t=1685114279; x=1687706279; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sd+Dqbtp7qNkmD7ajxLTDaj4AydWZwx3n13Wvgc7GFs=; b=TRHNHAAR6c1NlEv/sGYH1HA06wpmtw1E4UZ90c07jFTP1sVRLv1Jrof9UjKetX5ZkQ ze2mFYeXe+O+qNKCluJbQmhNyUfuW8hnf7DoNBOVME4k9tlA+MJaQC6jv5wkyWn0TREW zTPvIOm+ziJ77lNzncoyzYWHB5sIC5H1TPvavJPgDDzFyFZeMHY8mzzgWG4JoC2I8zky YCLnVsuCjdpMVgRgE8yTjN0U/lraQpoHD44hNQSp1XDVy/P+yIclNzAhhXuhzfY7sngJ riRi/IvdV/G1sX0RbULMNqAwEIJgP+os7FAWAEs6bMetrwR2UpfxmWshperLPxPM9RTs X1Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685114279; x=1687706279; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sd+Dqbtp7qNkmD7ajxLTDaj4AydWZwx3n13Wvgc7GFs=; b=K/giS7wv//W+2l7L0wiZT0ZiD5/GnuJUkgNhIAFcT6jYlqgHTYEhQMcICVOSzRwzYf ImtDZPODgpJp68uKC/zFpFGeIVUlkzEIvYRBjCoYwlF/2tvF5VR/Ny+TACXx6+dz2wwG 8Ga6KCjVtCvZ+AahHYYG5eOEaufA5OnBISoyKRjqfdPvt/+LyFViQF6nCFIn5p7LiQQ1 j5q7G/MxKfQYW5ubmr1Ytzl/zObikGRrOXw9jj9xUi8C8Sn7VGr8Hg0/AaBjSwxq1arQ R5N02kgK/4Xqq/lRQPJfgcDJIMXrld6vKA31qWcxTe6RurW3gMAaHljlJXrfA5YWLaco mTOg== X-Gm-Message-State: AC+VfDz6w7iqwAQwBxHHyh8tF0wufs2Wqhzn3HARObG4gsw1AEOevGyI VUENfSgzSUe5Wjq7o8emWk8TXQSaXIvhkHUotUFEHQ== X-Received: by 2002:a17:907:7f8e:b0:933:4d37:82b2 with SMTP id qk14-20020a1709077f8e00b009334d3782b2mr2787208ejc.57.1685114279026; Fri, 26 May 2023 08:17:59 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Anup Patel Date: Fri, 26 May 2023 20:47:46 +0530 Message-ID: Subject: Re: Bug report: kernel paniced when system hibernates To: Alexandre Ghiti Cc: Conor Dooley , Alexandre Ghiti , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Conor Dooley , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Fri, May 26, 2023 at 8:42=E2=80=AFPM Alexandre Ghiti wro= te: > > > 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=E2=80=AFPM Conor Dooley wrote: > >>> On Thu, May 25, 2023 at 01:06:04PM -0700, Atish Patra wrote: > >>>> On Thu, May 25, 2023 at 11:39=E2=80=AFAM 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 w= e > >>>>>> 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=C3=B6rn T=C3=B6pel emitted the idea of excluding from the hibernat= ion all > >> the memory nodes in the "/reserved-memory" node > >> (https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/device= tree/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 I agree, it should be drivers responsibility to save/restore the dedicated reserved memory used by itself. Although, I think we should at least save/restore reserved memory regions having "reusable" property set. Regards, Anup > > > >> 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 :)