Skip to content

[PW_SID:968942] [v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#476

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw968942
Closed

[PW_SID:968942] [v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#476
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw968942

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 968942 applied to workflow__riscv__fixes

Name: [v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=968942
Version: 3

Linux RISC-V bot and others added 2 commits May 14, 2025 13:11
The walk_page_range_novma() function is rather confusing - it supports two
modes, one used often, the other used only for debugging.

The first mode is the common case of traversal of kernel page tables, which
is what nearly all callers use this for.

Secondly it provides an unusual debugging interface that allows for the
traversal of page tables in a userland range of memory even for that memory
which is not described by a VMA.

It is far from certain that such page tables should even exist, but perhaps
this is precisely why it is useful as a debugging mechanism.

As a result, this is utilised by ptdump only. Historically, things were
reversed - ptdump was the only user, and other parts of the kernel evolved
to use the kernel page table walking here.

Since we have some complicated and confusing locking rules for the novma
case, it makes sense to separate the two usages into their own functions.

Doing this also provide self-documentation as to the intent of the caller -
are they doing something rather unusual or are they simply doing a standard
kernel page table walk?

We therefore establish two separate functions - walk_page_range_debug() for
this single usage, and walk_kernel_page_table_range() for general kernel
page table walking.

The walk_page_range_debug() function is currently used to traverse both
userland and kernel mappings, so we maintain this and in the case of kernel
mappings being traversed, we have walk_page_range_debug() invoke
walk_kernel_page_table_range() internally.

We additionally make walk_page_range_debug() internal to mm.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 109.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1045.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1368.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.92 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#82: FILE: arch/openrisc/kernel/dma.c:76:
+	error = walk_kernel_page_table_range(va, va + size,
 			&set_nocache_walk_ops, NULL, NULL);

CHECK: Alignment should match open parenthesis
#91: FILE: arch/openrisc/kernel/dma.c:91:
+	WARN_ON(walk_kernel_page_table_range(va, va + size,
 			&clear_nocache_walk_ops, NULL, NULL));

CHECK: Alignment should match open parenthesis
#104: FILE: arch/riscv/mm/pageattr.c:303:
+			ret = walk_kernel_page_table_range(lm_start, lm_end,
 						    &pageattr_ops, NULL, &masks);

CHECK: Alignment should match open parenthesis
#113: FILE: arch/riscv/mm/pageattr.c:321:
+		ret = walk_kernel_page_table_range(lm_start, lm_end,
 					    &pageattr_ops, NULL, &masks);

CHECK: Alignment should match open parenthesis
#120: FILE: arch/riscv/mm/pageattr.c:327:
+	ret =  walk_kernel_page_table_range(start, end, &pageattr_ops, NULL,
 				     &masks);

CHECK: Alignment should match open parenthesis
#129: FILE: arch/riscv/mm/pageattr.c:339:
+	ret =  walk_kernel_page_table_range(start, end, &pageattr_ops, NULL,
 				     &masks);

CHECK: Alignment should match open parenthesis
#145: FILE: include/linux/pagewalk.h:133:
+int walk_kernel_page_table_range(unsigned long start,
+		unsigned long end, const struct mm_walk_ops *ops,

CHECK: Alignment should match open parenthesis
#160: FILE: mm/hugetlb_vmemmap.c:170:
+	ret = walk_kernel_page_table_range(start, end, &vmemmap_remap_ops,
 				    NULL, walk);

CHECK: Alignment should match open parenthesis
#205: FILE: mm/pagewalk.c:606:
+int walk_kernel_page_table_range(unsigned long start, unsigned long end,
+		const struct mm_walk_ops *ops, pgd_t *pgd, void *private)

total: 0 errors, 0 warnings, 9 checks, 214 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 399892b92e2e ("mm/pagewalk: split walk_page_range_novma() into kernel/user parts") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 9 checks, 214 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 68.10 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch 3 times, most recently from 7d18b70 to 0b44c19 Compare June 11, 2025 02:52
@linux-riscv-bot linux-riscv-bot deleted the pw968942 branch June 11, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants