Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp988093rwd; Thu, 25 May 2023 06:47:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7m0TtaujNwVZLTzuijYgyAff9Zp5PVW/7+B1snF7B/L3GfVis4Az4Qzrkx/TSsbYkBui/n X-Received: by 2002:a05:6a20:a5a8:b0:10c:8f0c:f81c with SMTP id bc40-20020a056a20a5a800b0010c8f0cf81cmr9416011pzb.53.1685022436112; Thu, 25 May 2023 06:47:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685022436; cv=none; d=google.com; s=arc-20160816; b=ZE90u0g1aH9r2/P2ji8fVmkCLRVdQHkdrnBuHCbqox0pA3AmMmSGvw8bMwyqhPPq5q tYniaTN+O7+Dbf8zztfDMDblhIet4z/ucZjaMUjeP0tTwMz9uUfwWLn4jlWG1GmyYfY3 4LRbkxO7TA4iimx2aFI1+164tIPgjFWkEfbI5JPtNw5FIU+g6qmQCC8nmUxHHUmb54/l MFjGp9v7+07VyT4ZbqeU+WGH0JOJnJS4M7AFG+TwVtbYL/7BONUgfHXWucWbOf30HijQ 88xUC1Z7iIweCD0sU06LjX7bz8UeHaRY2JXUuPftXZj0YXW9HK53gEJXNcZDBNuhxtuS hY2Q== 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=bOccQXmo2035CwTFujmC8mOqSuEwBb9LtX0oVjEbuJY=; b=npt2VQDCNkN978dky2daiU2HpG+ZKDNmm5YHnV01RafR1cTDGpiZq748eIWIKVG6g+ r/I12vZrO7JCRe8isKqJ88kvAxi+Dy8os07tqqkIutaCFIymLAbO7s7dWwQjx1PxbNu6 DtQuwq9PYer3ZGm+YsoA6D/RUpHDeV1bUzCb2sX26BhCHeBZBz2XLT1+QO7rG91kC8w2 RR5ZLiMyk0MlAfPEJUgAR3OJ03vHacUGNSpV/tFsCaW21nEBtnZSFZUSK3UtC7CVrs/X xvz7xsKZARVeURT9xW9V2tsGBEVWUDNbCggp2f6d+xEMG6Csul3MSLE5get2LG0BmXBp DVaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20221208.gappssmtp.com header.s=20221208 header.b=OkMUYmyd; 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 r11-20020aa7988b000000b0064cf289a327si1547210pfl.129.2023.05.25.06.47.00; Thu, 25 May 2023 06:47:16 -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=OkMUYmyd; 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 S241064AbjEYNn2 (ORCPT + 99 others); Thu, 25 May 2023 09:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233263AbjEYNn0 (ORCPT ); Thu, 25 May 2023 09:43:26 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0EC8183 for ; Thu, 25 May 2023 06:43:25 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-96fb1642b09so96721166b.0 for ; Thu, 25 May 2023 06:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20221208.gappssmtp.com; s=20221208; t=1685022204; x=1687614204; 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=bOccQXmo2035CwTFujmC8mOqSuEwBb9LtX0oVjEbuJY=; b=OkMUYmydKGw5MAtGrmnKLknwVM75BiYt9vXJFl4d/v5aKqnpw6s3mNfu7ess3qJSGC c2bKWnfDgNr5FMrKg+vu0jVS+n7L3NjEfUx0ue8njRxP8alsciAXDQAkG/exd7FF1518 bK+KgQs8QtbQ6mmdp2t6r1rE+FWMtj1uYIDnScU2XgNFW43moZ70VxdX+SCD3PE7nnVm J2F/9VRwXstHKK2rstRz+rr5DIdQ3A8OW7Uiy0DJftQhaluXAO6zOxWH11RoedQYGBgS FXatctF8adb7RyiB7Vu+EvIE+lpMZmZnbdRwtvvkohUsq7dYnciWCwyT9XbzWWAQwbRE BggA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685022204; x=1687614204; 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=bOccQXmo2035CwTFujmC8mOqSuEwBb9LtX0oVjEbuJY=; b=LDQwIfM8VecH1V2UDxMnF8mAa/kynp9H03v5fE/qriYLsj4KaZqt8tLBgeni8cmuDF ajpdbJvwPyPP0Vh1lLr/M8BHJecijz18ZHK0Qv/pM5T0zqYUMqqSzuhat8/XO3ghs2bD FMFtvzvRWOJTkXZaVD1UN3XgPOsI4klcHk2WbxqdmbA0ypu/Whz0kr1pKuA6EB327fvu SEiikQYCg3xPSf6CRRWOL0QvOaiZgjHhRDhR42bIpoDTmGtUhf59HDCuqU7ud7qWrWeg OBSWUmC3KeaqqjkWwZh2fNb7dyh5VAwyh1nAOEIhgnDJ5co2jC4RztYQXm8AUFpOyp5t 48dg== X-Gm-Message-State: AC+VfDxGHNWfcYE4/aTLRt2dwzGh9mhl1gokIzQKjc5r3tQgrFf8OPRw 1jZSe8o7pDzYD7SS4qYn6JmoxBWqNipkXee0POmRFA== X-Received: by 2002:a17:907:944e:b0:973:92d4:9f4e with SMTP id dl14-20020a170907944e00b0097392d49f4emr1353242ejc.53.1685022204015; Thu, 25 May 2023 06:43:24 -0700 (PDT) MIME-Version: 1.0 References: <20230517-preacher-primer-f41020b3376a@wendy> <20230525-guacamole-swimmer-68048a73baac@wendy> <20230525-postnasal-monopoly-98adb96ffaa1@wendy> In-Reply-To: <20230525-postnasal-monopoly-98adb96ffaa1@wendy> From: Anup Patel Date: Thu, 25 May 2023 19:13:11 +0530 Message-ID: Subject: Re: Bug report: kernel paniced when system hibernates To: Conor Dooley Cc: Anup Patel , Atish Patra , Alexandre Ghiti , robh@kernel.org, Alexandre Ghiti , 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 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 Thu, May 25, 2023 at 7:08=E2=80=AFPM Conor Dooley wrote: > > On Thu, May 25, 2023 at 06:51:28PM +0530, Anup Patel wrote: > > > > We should only rely on this node name for known bad versions of opens= bi > > > IMO. Going forward, if something needs to be reserved for firmware, t= he > > > firmware should make sure that it is reserved by using the property f= or > > > that purpose :) > > > There is no issue with OpenSBI since it does the right thing by marking > > memory as reserved in the DT. This real issue is with the kernel handli= ng > > of reserved memory for hibernate. > > I don't think we are talking about the same thing here. I meant the > no-map property which OpenSBI does not set. Yes, we are talking about the same thing. It's not just OpenSBI not setting no-map property in reserved memory node because other SBI implementations would be doing the same thing (i.e. not setting no-map property) Regards, Anup > > > Like Atish mentioned, not just OpenSBI, there will be other entities > > (like TSM) or some other M-mode firmware which will also reserve > > memory in DT/ACPI so clearly kernel needs a SBI implementation > > independent way of handling reserved memory for hibernate. > > > > > Another option is to use compatible string or label property to ind= icate > > > > that this memory region is not to be saved/restored during hibernat= ion. > > > > This can be documented in RISC-V DT bindings as well as the booting= guide > > > > doc that alex was talking about. > > > > > > Sure, a dt-binding for sbi reserved regions doesn't immediately sound > > > like an awful idea... But we still have to work around the borked > > > firmware - be that disabling hibernation or using the mmode_resv node > > > when we know that the version of OpenSBI is one of those with the > > > problem. > > Did you skip over this? I was agreeing that defining a common binding for > sbi reserved regions was a good idea.