Skip to content

[PW_SID:968391] [RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#469

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

[PW_SID:968391] [RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts#469
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw968391

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 968391 applied to workflow__riscv__fixes

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

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.

This is highly unusual and 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 maintain walk_page_range_novma() for this single usage, and
document the function as such.

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_page_range_kernel() in this case.

We introduce walk_page_range_kernel() for the far more common case of
kernel page table traversal.

While it would result in less churn to keep the function signature the same
for the kernel version, it doesn't make sense to pass an mm_struct in the
kernel case (it's always &init_mm), so we must modify the signature
accordingly.

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: "[RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 106.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RESEND] 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: "[RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.76 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#82: FILE: arch/openrisc/kernel/dma.c:76:
+	error = walk_page_range_kernel(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_page_range_kernel(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_page_range_kernel(lm_start, lm_end,
 						    &pageattr_ops, NULL, &masks);

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

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

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

CHECK: Alignment should match open parenthesis
#141: FILE: include/linux/pagewalk.h:133:
+int walk_page_range_kernel(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_page_range_kernel(start, end, &vmemmap_remap_ops,
 				    NULL, walk);

CHECK: Alignment should match open parenthesis
#168: 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
#207: FILE: mm/pagewalk.c:626:
+int walk_page_range_kernel(unsigned long start, unsigned long end,
+		const struct mm_walk_ops *ops, pgd_t *pgd, void *private)

total: 0 errors, 0 warnings, 10 checks, 201 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 edd6eff8a259 ("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, 201 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[RESEND] 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: "[RESEND] mm/pagewalk: split walk_page_range_novma() into kernel/user parts"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot
Copy link
Copy Markdown
Author

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

@linux-riscv-bot linux-riscv-bot deleted the pw968391 branch June 4, 2025 15:14
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