From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AB58C7115E for ; Thu, 19 Jun 2025 07:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Etc8A2lAiWE8nlTulcLevnLIGkcA51P3UnDL4nPPPPY=; b=dS0cbxh0llgY8p JjvYEAy5zhplZqDgyw2U43+8Py0NuhNhCzXOlNWklbKBJWAXJtwXmx2CZbar0B+5CMZCWSjtrIMCg cPmTjJxC7Kmn9e7NDuc1SsDRSbSUxVbYhBI6uaF/6L0mtjl8WrVtGMEmdfVMxvhjfsYxL/4VEriJo XzTg2mI8ckAvomrXqEp2a1mqtlzh7Npm7jF3r47RzuHja/Wky7QZY5agJwn75PLhdDca2zsRX2P1P uhgTi5EBf71tq3bZE0hM94YXindLcdeS8q0SYhSJfuzsrfBG8CtEA91GtaLeTvHsEGFRpROq13Gvt ZYUfWW/WNjNT4ztbxz2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uSAAZ-0000000CMzZ-2WvE; Thu, 19 Jun 2025 07:58:47 +0000 Received: from smtp21.cstnet.cn ([159.226.251.21] helo=cstnet.cn) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uS9gc-0000000CIAX-0Drt for linux-riscv@lists.infradead.org; Thu, 19 Jun 2025 07:27:52 +0000 Received: from ubt.. (unknown [210.73.43.2]) by APP-01 (Coremail) with SMTP id qwCowACHNdTuu1NoWfSNBw--.21068S2; Thu, 19 Jun 2025 15:27:42 +0800 (CST) From: Chunyan Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Andrew Morton Cc: linux-riscv@lists.infradead.org, Deepak Gupta , Ved Shanbhogue , linux-kernel@vger.kernel.org, Chunyan Zhang Subject: [PATCH V8 0/3] riscv: mm: Add soft-dirty and uffd-wp support Date: Thu, 19 Jun 2025 14:52:29 +0800 Message-Id: <20250619065232.1786470-1-zhangchunyan@iscas.ac.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: qwCowACHNdTuu1NoWfSNBw--.21068S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Ar17tFy7GrW5tw1fWF4fAFb_yoW8ZFW8pF sagw13KFW5Jr1ftrZ3G348CF1rXan5A34fGay3J34kJw43WFWjvr1kC3W8Gr1rJF4F9rWF 93W5ury5u3yqyaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9mb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwV C2z280aVCY1x0267AKxVWxJr0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xv F2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4A2jsIE14v26r4j6F 4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kI c2xKxwCY1x0262kKe7AKxVWUtVW8ZwCY02Avz4vE14v_GF4l42xK82IYc2Ij64vIr41l4I 8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AK xVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcV AFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8I cIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r 1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07boqXLUUUUU= X-Originating-IP: [210.73.43.2] X-CM-SenderInfo: x2kd0wxfkx051dq6x2xfdvhtffof0/1tbiBgwSB2hTjTWyEwAAs9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250619_002750_465742_3C85BDA6 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patchset adds Svrsw60t59b [1] extension support, also soft dirty and userfaultfd write protect tracking for RISC-V. This patchset has been tested with kselftest mm suite in which soft-dirty, madv_populate, test_unmerge_uffd_wp, and uffd-unit-tests run and pass, and no regressions are observed in any of the other tests. This patchset applies on top of v6.16-rc1. V8: - Rebase on v6.16-rc1; - Add dependencies to MMU && 64BIT for RISCV_ISA_SVRSW60T59B; - Use 'Svrsw60t59b' instead of 'SVRSW60T59B' in Kconfig help paragraph; - Add Alex's Reviewed-by tag in patch 1. V7: (https://lore.kernel.org/all/20250409095320.224100-1-zhangchunyan@iscas.ac.cn/) - Add Svrsw60t59b [1] extension support; - Have soft-dirty and uffd-wp depending on the Svrsw60t59b extension to avoid crashes for the hardware which don't have this extension. V6: - Changes to use bits 59-60 which are supported by extension Svrsw60t59b for soft dirty and userfaultfd write protect tracking. V5: - Fixed typos and corrected some words in Kconfig and commit message; - Removed pte_wrprotect() from pte_swp_mkuffd_wp(), this is a copy-paste error; - Added Alex's Reviewed-by tag in patch 2. V4: - Added bit(4) descriptions into "Format of swap PTE". V3: - Fixed the issue reported by kernel test irobot . V1 -> V2: - Add uffd-wp supported; - Make soft-dirty uffd-wp and devmap mutually exclusive which all use the same PTE bit; - Add test results of CRIU in the cover-letter. [1] https://github.com/riscv/Svrsw60t59b.git Chunyan Zhang (3): riscv: Add RISC-V Svrsw60t59b extension support riscv: mm: Add soft-dirty page tracking support riscv: mm: Add uffd write-protect support arch/riscv/Kconfig | 16 +++ arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/include/asm/pgtable-bits.h | 37 +++++++ arch/riscv/include/asm/pgtable.h | 136 +++++++++++++++++++++++++- arch/riscv/kernel/cpufeature.c | 1 + 5 files changed, 189 insertions(+), 2 deletions(-) -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv