Skip to content

[PW_SID:968648] [v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#471

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw968648
Closed

[PW_SID:968648] [v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#471
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw968648

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 968648 applied to workflow__riscv__fixes

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

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.

We additionally make walk_page_range_debug() internal to mm.

Note that ptdump uses the precise same function for kernel walking as a
convenience, so we permit this but make it very explicit by having
walk_page_range_novma() invoke walk_kernel_page_table_range() in this case.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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: 983.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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: 1271.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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: 20.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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: 21.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

CHECK: Alignment should match open parenthesis
#78: 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
#87: 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
#100: 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
#109: 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
#116: 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
#125: 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
#141: 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
#156: 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
#183: FILE: mm/pagewalk.c:588:
+static int __walk_page_range_novma(struct mm_struct *mm, unsigned long start,
+		unsigned long end, const struct mm_walk_ops *ops,

CHECK: Alignment should match open parenthesis
#223: FILE: mm/pagewalk.c:626:
+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, 10 checks, 231 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 bc4385e6b4e5 ("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, 10 checks, 231 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v2] 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: "[v2] 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: "[v2] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw968648 branch June 5, 2025 15:20
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