From patchwork Sun Jun 25 14:09:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 112597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6939516vqr; Sun, 25 Jun 2023 07:18:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ691i5qAWb1wh/5fOfDWQKIyPeKaDoF/B6wDmQkOB5e1zhtHISRQoSniPWKebST96l5dFAH X-Received: by 2002:a05:6a00:17a6:b0:676:ad06:29d7 with SMTP id s38-20020a056a0017a600b00676ad0629d7mr1272909pfg.15.1687702698330; Sun, 25 Jun 2023 07:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687702698; cv=none; d=google.com; s=arc-20160816; b=onhrr8nidMg6AWv0LUt62lurA8X2glFJlPtBDXtRE/3okZeQA6Y1E23Ch9KLQhZpJH DGcQSU4W6vZBDAOmUWhiOOC8kuFeZ8S7JWczS/Qoi5J3uvyxpRWTseyBbMw/M3mByxTq /wxdD90H6npvd7Lb0UArWa7iMqpf9chpcxGZudK4/C1tdmASqbg59ZhErbEbA6hgBILR HWOBA0DWfdv/ZMx5UEj/B40X3cCbW9xLTAUDo5JDjWUxGIdjdXB80Lz5qJs+DScA9mn7 I7amhB4SH/xe5zbMnqm3oSjuIALG3Gc+0mqPKNiYd/KAkGurwzRDCjIzrTOrEMvdmcyN /4sQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br6-20020a056a00440600b006686ec2f62esi3151241pfb.187.2023.06.25.07.18.05; Sun, 25 Jun 2023 07:18:18 -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 S230026AbjFYOLA (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769684544467580743?= X-GMAIL-MSGID: =?utf-8?q?1769684544467580743?= 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