Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14995213rwd; Sun, 25 Jun 2023 08:09:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58gN+DebSJJHx/341vZdhHfGIzBzSmPO+OvZEwKW77S7Ks5fmY1tDK5k74Gxcr8V/7s8sx X-Received: by 2002:a17:907:6d82:b0:991:b834:af83 with SMTP id sb2-20020a1709076d8200b00991b834af83mr392686ejc.59.1687705754597; Sun, 25 Jun 2023 08:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687705754; cv=none; d=google.com; s=arc-20160816; b=v1Ds9zIL5gtk90DQzyKj2+sW6vBn5B1eQFWYQXkxsswiiDDKMvEKD7nRc6tJc1MF20 EhEdJ7fMIsIrkYvLV/Fe64xobEU0L/72e/bCbC0PLvWzaAv89K0N/a22vqrR6cSv6qcu RnLV3bfCO8kMQG4NH/OMeOg5q/OwOS5oVOfD15Ub7sZdZ8q909JP03tJVk6lU6WGxZlh 48pen7RecQjXsUNvlK6yEIn2CKmoy1VEKsq/dAt6OBgC3hbudORb7jzkdZjgtO9BrTrh ttFroDXhljBW6pqUZ0M5Cdkzm8PVXXFAaLfvG1qoXFJtPGLl11+X5gqmZ6+wVwW+qh9Y dejw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=aO4bL7wh8dIgxc1UXdk85xO6Ne+sPAuUMDbTWR3f9NQ=; fh=2/EbjHRE7EKafzAkxWdKfWLNh6seQ7/0UQ7OzUYTgxI=; b=iqEOOLlFyrPRVMM/LrYwcvH2ff1xiS6KhevgZ1ir8WJDwAKwv5sNMHOV4BXuMLXpc1 oplddCTWJqu+PADbT/78Av3bQucjiPsto2axDp0TR4Fct+pdsMGHf6VtgwxRDaiCKnYb uLkxg3X8kK6Uz3dYv7UFCPpdGNjk3uT6xdnfB2FoXLCib598+o9G5Wb/ez5zCx8ji9wQ ThiEEfoCNkzj8yeU5GsreWX50wAfOaskf40hhetg5OESr74tukZgKAKLHTVm6q39Z5S1 LsGYoQ65dVIwWc72u3YIo0jeNWAE+ji0TJrfVR04z/MF/uh4HpE39WlfePtBzhkLvCrc bYkQ== 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 rk27-20020a170907215b00b0098700f22ba7si1731301ejb.447.2023.06.25.08.08.44; Sun, 25 Jun 2023 08:09:14 -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 S230021AbjFYOLA (ORCPT + 99 others); Sun, 25 Jun 2023 10:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbjFYOKz (ORCPT ); Sun, 25 Jun 2023 10:10:55 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB7B1B1 for ; Sun, 25 Jun 2023 07:10:53 -0700 (PDT) X-QQ-mid: bizesmtp73t1687702208t869bq9s Received: from localhost.localdomain ( [112.2.230.41]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 25 Jun 2023 22:10:04 +0800 (CST) X-QQ-SSF: 01200000000000B0B000000A0000000 X-QQ-FEAT: TVZM0Uoyj00c0bZeOtQsMG0DaWKF8k5IP29sSaNKu2IqHl0SZUO1pXN9aQB5m So+nB8VGz5FuKu2vXt+QJgjvfdapKB5QFP/nycPWDjuq5n+govmjlnnfC3eg5zAOuPs3RLJ tidw5jfJcMk/f3odNds/Y35dsaNOgrDwb/1JqzDV+lozOChS18Qcsa48sKJp4BW5GTiQIy+ uENrBlNboO9pUCSceB6gdweAS2JHCzmhrhNjhlZNzbmvK9cEFaJe9JopuWLI/HG/hHN1hbp YC5V/dL5eDx0XIYB3rpFxJsYuPt+2YzAPJHuZUvik2ApM8SgDnrqQS532EawfgLqH9EsUe7 JIjbNrfBR84Y/3K7AbHzIySaufKumCejpKOrEBPytWTAKTadhs= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11597191393074232432 From: Song Shuai To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, ajones@ventanamicro.com, alexghiti@rivosinc.com, mpe@ellerman.id.au, arnd@arndb.de, songshuaishuai@tinylab.org, rppt@kernel.org, samuel@sholland.org, panqinglin2020@iscas.ac.cn, conor.dooley@microchip.com, anup@brainfault.org, xianting.tian@linux.alibaba.com, anshuman.khandual@arm.com, heiko@sntech.de Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH V1 1/3] Revert "RISC-V: mark hibernation as nonportable" Date: Sun, 25 Jun 2023 22:09:29 +0800 Message-Id: <20230625140931.1266216-2-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230625140931.1266216-1-songshuaishuai@tinylab.org> References: <20230625140931.1266216-1-songshuaishuai@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 This reverts commit ed309ce522185583b163bd0c74f0d9f299fe1826. With the commit 3335068f8721 ("riscv: Use PUD/P4D/PGD pages for the linear mapping") reverted, the MIN_MEMBLOCK_ADDR points the kernel load address which was placed at a PMD boundary. And firmware always correctly mark resident memory, or memory protected with PMP as per the devicetree specification and/or the UEFI specification. So those regions will not be mapped in the linear mapping and they can be safely saved/restored by hibernation. Signed-off-by: Song Shuai --- arch/riscv/Kconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 5966ad97c30c..17b5fc7f54d4 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -800,11 +800,8 @@ menu "Power management options" source "kernel/power/Kconfig" -# Hibernation is only possible on systems where the SBI implementation has -# marked its reserved memory as not accessible from, or does not run -# from the same memory as, Linux config ARCH_HIBERNATION_POSSIBLE - def_bool NONPORTABLE + def_bool y config ARCH_HIBERNATION_HEADER def_bool HIBERNATION -- 2.20.1