linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: Always use set_pXX() helpers to write page tables
@ 2025-12-11  8:11 Samuel Holland
  2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
  2025-12-11  8:11 ` [PATCH 2/2] mm/madvise: Use set_pte() " Samuel Holland
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel Holland @ 2025-12-11  8:11 UTC (permalink / raw)
  To: Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: linux-kernel, linux-mm, Ryan Roberts, Anshuman Khandual,
	Gavin Shan, Zi Yan, Samuel Holland

As Ryan Roberts points out[1], when writing page tables, generic mm code
should already be using the architecture-provided helper functions.
This series includes fixes for the few instances where we didn't do
that, as found by my coccinelle script[2].

[1]: https://lore.kernel.org/linux-mm/02e3b3bd-ae6a-4db4-b4a1-8cbc1bc0a1c8@arm.com/
[2]: https://lore.kernel.org/linux-mm/20251113014656.2605447-7-samuel.holland@sifive.com/


Samuel Holland (2):
  mm/debug_vm_pgtable: Use set_pXd() to write page tables
  mm/madvise: Use set_pte() to write page tables

 mm/debug_vm_pgtable.c | 4 ++--
 mm/madvise.c          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.47.2

base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
branch: up/fix-pte-madvise


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
  2025-12-11  8:11 [PATCH 0/2] mm: Always use set_pXX() helpers to write page tables Samuel Holland
@ 2025-12-11  8:11 ` Samuel Holland
  2025-12-11  9:36   ` Ryan Roberts
                     ` (2 more replies)
  2025-12-11  8:11 ` [PATCH 2/2] mm/madvise: Use set_pte() " Samuel Holland
  1 sibling, 3 replies; 8+ messages in thread
From: Samuel Holland @ 2025-12-11  8:11 UTC (permalink / raw)
  To: Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: linux-kernel, linux-mm, Ryan Roberts, Anshuman Khandual,
	Gavin Shan, Zi Yan, Samuel Holland

Generic code must always use the architecture-provided helper function
to write page tables.

Fixes: a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers")
Fixes: c0fe07b0aa72 ("mm/debug_vm_pgtable: use struct pgtable_debug_args in PMD modifying tests")
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

 mm/debug_vm_pgtable.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
index ae9b9310d96fd..8c7996d6c1f2a 100644
--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -445,7 +445,7 @@ static void __init pmd_huge_tests(struct pgtable_debug_args *args)
 	 * X86 defined pmd_set_huge() verifies that the given
 	 * PMD is not a populated non-leaf entry.
 	 */
-	WRITE_ONCE(*args->pmdp, __pmd(0));
+	set_pmd(args->pmdp, __pmd(0));
 	WARN_ON(!pmd_set_huge(args->pmdp, __pfn_to_phys(args->fixed_pmd_pfn), args->page_prot));
 	WARN_ON(!pmd_clear_huge(args->pmdp));
 	pmd = pmdp_get(args->pmdp);
@@ -465,7 +465,7 @@ static void __init pud_huge_tests(struct pgtable_debug_args *args)
 	 * X86 defined pud_set_huge() verifies that the given
 	 * PUD is not a populated non-leaf entry.
 	 */
-	WRITE_ONCE(*args->pudp, __pud(0));
+	set_pud(args->pudp, __pud(0));
 	WARN_ON(!pud_set_huge(args->pudp, __pfn_to_phys(args->fixed_pud_pfn), args->page_prot));
 	WARN_ON(!pud_clear_huge(args->pudp));
 	pud = pudp_get(args->pudp);
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] mm/madvise: Use set_pte() to write page tables
  2025-12-11  8:11 [PATCH 0/2] mm: Always use set_pXX() helpers to write page tables Samuel Holland
  2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
@ 2025-12-11  8:11 ` Samuel Holland
  2025-12-11  9:43   ` Ryan Roberts
  2025-12-11 23:40   ` kernel test robot
  1 sibling, 2 replies; 8+ messages in thread
From: Samuel Holland @ 2025-12-11  8:11 UTC (permalink / raw)
  To: Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: linux-kernel, linux-mm, Ryan Roberts, Anshuman Khandual,
	Gavin Shan, Zi Yan, Samuel Holland

Generic code must always use the architecture-provided helper function
to write page tables.

Fixes: 662df3e5c376 ("mm: madvise: implement lightweight guard page mechanism")
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

 mm/madvise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index b617b1be0f535..4da9c32f8738a 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1114,7 +1114,7 @@ static int guard_install_set_pte(unsigned long addr, unsigned long next,
 	unsigned long *nr_pages = (unsigned long *)walk->private;
 
 	/* Simply install a PTE marker, this causes segfault on access. */
-	*ptep = make_pte_marker(PTE_MARKER_GUARD);
+	set_pte(ptep, make_pte_marker(PTE_MARKER_GUARD));
 	(*nr_pages)++;
 
 	return 0;
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
  2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
@ 2025-12-11  9:36   ` Ryan Roberts
  2025-12-12  0:48   ` kernel test robot
  2025-12-12 12:11   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: Ryan Roberts @ 2025-12-11  9:36 UTC (permalink / raw)
  To: Samuel Holland, Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: linux-kernel, linux-mm, Anshuman Khandual, Gavin Shan, Zi Yan

On 11/12/2025 08:11, Samuel Holland wrote:
> Generic code must always use the architecture-provided helper function
> to write page tables.
> 
> Fixes: a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers")
> Fixes: c0fe07b0aa72 ("mm/debug_vm_pgtable: use struct pgtable_debug_args in PMD modifying tests")
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
> ---
> 
>  mm/debug_vm_pgtable.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index ae9b9310d96fd..8c7996d6c1f2a 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -445,7 +445,7 @@ static void __init pmd_huge_tests(struct pgtable_debug_args *args)
>  	 * X86 defined pmd_set_huge() verifies that the given
>  	 * PMD is not a populated non-leaf entry.
>  	 */
> -	WRITE_ONCE(*args->pmdp, __pmd(0));
> +	set_pmd(args->pmdp, __pmd(0));

My guess is that this should actually be:

	pmd_clear(args->pmdp);

As the "clear" value may not be zero on some arches (see um) or there may be
more to do on other arches (see arm32's 2 level pgtable).

>  	WARN_ON(!pmd_set_huge(args->pmdp, __pfn_to_phys(args->fixed_pmd_pfn), args->page_prot));
>  	WARN_ON(!pmd_clear_huge(args->pmdp));
>  	pmd = pmdp_get(args->pmdp);
> @@ -465,7 +465,7 @@ static void __init pud_huge_tests(struct pgtable_debug_args *args)
>  	 * X86 defined pud_set_huge() verifies that the given
>  	 * PUD is not a populated non-leaf entry.
>  	 */
> -	WRITE_ONCE(*args->pudp, __pud(0));
> +	set_pud(args->pudp, __pud(0));

Likewise, I think this should be:

	pud_clear(args->pudp);

Thanks,
Ryan

>  	WARN_ON(!pud_set_huge(args->pudp, __pfn_to_phys(args->fixed_pud_pfn), args->page_prot));
>  	WARN_ON(!pud_clear_huge(args->pudp));
>  	pud = pudp_get(args->pudp);



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mm/madvise: Use set_pte() to write page tables
  2025-12-11  8:11 ` [PATCH 2/2] mm/madvise: Use set_pte() " Samuel Holland
@ 2025-12-11  9:43   ` Ryan Roberts
  2025-12-11 23:40   ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: Ryan Roberts @ 2025-12-11  9:43 UTC (permalink / raw)
  To: Samuel Holland, Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: linux-kernel, linux-mm, Anshuman Khandual, Gavin Shan, Zi Yan

On 11/12/2025 08:11, Samuel Holland wrote:
> Generic code must always use the architecture-provided helper function
> to write page tables.
> 
> Fixes: 662df3e5c376 ("mm: madvise: implement lightweight guard page mechanism")
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
> ---
> 
>  mm/madvise.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index b617b1be0f535..4da9c32f8738a 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -1114,7 +1114,7 @@ static int guard_install_set_pte(unsigned long addr, unsigned long next,
>  	unsigned long *nr_pages = (unsigned long *)walk->private;
>  
>  	/* Simply install a PTE marker, this causes segfault on access. */
> -	*ptep = make_pte_marker(PTE_MARKER_GUARD);
> +	set_pte(ptep, make_pte_marker(PTE_MARKER_GUARD));

No! As I explained in my response on the other thread (which you linked in the
cover letter), it is correct as is and should not be changed to set_pte().

Copy/pasting my explanation:

| I tried "fixing" this before. But it's correct as is. ptep is pointing to a
| value on the stack. See [2].
|
| https://lore.kernel.org/linux-mm/2308a4d0-273e-4cf8-9c9f-3008c42b6d18@arm.com/

If you go look at where this function is called from, you'll see that it's a
pointer to a stack variable:


---8<---
static int walk_pte_range_inner(pte_t *pte, unsigned long addr,
				unsigned long end, struct mm_walk *walk)
{
	const struct mm_walk_ops *ops = walk->ops;
	int err = 0;

	for (;;) {
		if (ops->install_pte && pte_none(ptep_get(pte))) {
			pte_t new_pte;

			err = ops->install_pte(addr, addr + PAGE_SIZE, &new_pte,
					       walk);
---8<---

I agree that it's extremely confusing. Perhaps, at a minimum, we should come up
with some kind of naming convention for this and update this and the other
couple of places that pass pointers to stack-based pXX_t around?

e.g. instead of calling it "ptep", call it "ptevalp" or something like that?

Thanks,
Ryan


>  	(*nr_pages)++;
>  
>  	return 0;



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mm/madvise: Use set_pte() to write page tables
  2025-12-11  8:11 ` [PATCH 2/2] mm/madvise: Use set_pte() " Samuel Holland
  2025-12-11  9:43   ` Ryan Roberts
@ 2025-12-11 23:40   ` kernel test robot
  1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-12-11 23:40 UTC (permalink / raw)
  To: Samuel Holland, Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, linux-kernel,
	Ryan Roberts, Anshuman Khandual, Gavin Shan, Zi Yan,
	Samuel Holland

Hi Samuel,

kernel test robot noticed the following build errors:

[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]

url:    https://github.com/intel-lab-lkp/linux/commits/Samuel-Holland/mm-debug_vm_pgtable-Use-set_pXd-to-write-page-tables/20251211-161254
base:   d358e5254674b70f34c847715ca509e46eb81e6f
patch link:    https://lore.kernel.org/r/20251211081117.1126521-3-samuel.holland%40sifive.com
patch subject: [PATCH 2/2] mm/madvise: Use set_pte() to write page tables
config: arm-footbridge_defconfig (https://download.01.org/0day-ci/archive/20251212/202512120735.ge1E0s5N-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251212/202512120735.ge1E0s5N-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512120735.ge1E0s5N-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/madvise.c:1117:2: error: call to undeclared function 'set_pte'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1117 |         set_pte(ptep, make_pte_marker(PTE_MARKER_GUARD));
         |         ^
   mm/madvise.c:1117:2: note: did you mean 'set_ptes'?
   arch/arm/include/asm/pgtable.h:212:6: note: 'set_ptes' declared here
     212 | void set_ptes(struct mm_struct *mm, unsigned long addr,
         |      ^
   1 error generated.


vim +/set_pte +1117 mm/madvise.c

  1110	
  1111	static int guard_install_set_pte(unsigned long addr, unsigned long next,
  1112					 pte_t *ptep, struct mm_walk *walk)
  1113	{
  1114		unsigned long *nr_pages = (unsigned long *)walk->private;
  1115	
  1116		/* Simply install a PTE marker, this causes segfault on access. */
> 1117		set_pte(ptep, make_pte_marker(PTE_MARKER_GUARD));
  1118		(*nr_pages)++;
  1119	
  1120		return 0;
  1121	}
  1122	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
  2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
  2025-12-11  9:36   ` Ryan Roberts
@ 2025-12-12  0:48   ` kernel test robot
  2025-12-12 12:11   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-12-12  0:48 UTC (permalink / raw)
  To: Samuel Holland, Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: oe-kbuild-all, Linux Memory Management List, linux-kernel,
	Ryan Roberts, Anshuman Khandual, Gavin Shan, Zi Yan,
	Samuel Holland

Hi Samuel,

kernel test robot noticed the following build errors:

[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]

url:    https://github.com/intel-lab-lkp/linux/commits/Samuel-Holland/mm-debug_vm_pgtable-Use-set_pXd-to-write-page-tables/20251211-161254
base:   d358e5254674b70f34c847715ca509e46eb81e6f
patch link:    https://lore.kernel.org/r/20251211081117.1126521-2-samuel.holland%40sifive.com
patch subject: [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
config: powerpc64-randconfig-r054-20251212 (https://download.01.org/0day-ci/archive/20251212/202512120808.akRJJMa7-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251212/202512120808.akRJJMa7-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512120808.akRJJMa7-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/debug_vm_pgtable.c: In function 'pmd_huge_tests':
>> mm/debug_vm_pgtable.c:448:2: error: implicit declaration of function 'set_pmd'; did you mean 'set_pgd'? [-Werror=implicit-function-declaration]
     448 |  set_pmd(args->pmdp, __pmd(0));
         |  ^~~~~~~
         |  set_pgd
   mm/debug_vm_pgtable.c: In function 'pud_huge_tests':
>> mm/debug_vm_pgtable.c:468:2: error: implicit declaration of function 'set_pud'; did you mean 'set_pgd'? [-Werror=implicit-function-declaration]
     468 |  set_pud(args->pudp, __pud(0));
         |  ^~~~~~~
         |  set_pgd
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for CAN_DEV
   Depends on [n]: NETDEVICES [=n] && CAN [=y]
   Selected by [y]:
   - CAN [=y] && NET [=y]


vim +448 mm/debug_vm_pgtable.c

   433	
   434	#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
   435	static void __init pmd_huge_tests(struct pgtable_debug_args *args)
   436	{
   437		pmd_t pmd;
   438	
   439		if (!arch_vmap_pmd_supported(args->page_prot) ||
   440		    args->fixed_alignment < PMD_SIZE)
   441			return;
   442	
   443		pr_debug("Validating PMD huge\n");
   444		/*
   445		 * X86 defined pmd_set_huge() verifies that the given
   446		 * PMD is not a populated non-leaf entry.
   447		 */
 > 448		set_pmd(args->pmdp, __pmd(0));
   449		WARN_ON(!pmd_set_huge(args->pmdp, __pfn_to_phys(args->fixed_pmd_pfn), args->page_prot));
   450		WARN_ON(!pmd_clear_huge(args->pmdp));
   451		pmd = pmdp_get(args->pmdp);
   452		WARN_ON(!pmd_none(pmd));
   453	}
   454	
   455	static void __init pud_huge_tests(struct pgtable_debug_args *args)
   456	{
   457		pud_t pud;
   458	
   459		if (!arch_vmap_pud_supported(args->page_prot) ||
   460		    args->fixed_alignment < PUD_SIZE)
   461			return;
   462	
   463		pr_debug("Validating PUD huge\n");
   464		/*
   465		 * X86 defined pud_set_huge() verifies that the given
   466		 * PUD is not a populated non-leaf entry.
   467		 */
 > 468		set_pud(args->pudp, __pud(0));
   469		WARN_ON(!pud_set_huge(args->pudp, __pfn_to_phys(args->fixed_pud_pfn), args->page_prot));
   470		WARN_ON(!pud_clear_huge(args->pudp));
   471		pud = pudp_get(args->pudp);
   472		WARN_ON(!pud_none(pud));
   473	}
   474	#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */
   475	static void __init pmd_huge_tests(struct pgtable_debug_args *args) { }
   476	static void __init pud_huge_tests(struct pgtable_debug_args *args) { }
   477	#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */
   478	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
  2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
  2025-12-11  9:36   ` Ryan Roberts
  2025-12-12  0:48   ` kernel test robot
@ 2025-12-12 12:11   ` kernel test robot
  2 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-12-12 12:11 UTC (permalink / raw)
  To: Samuel Holland, Andrew Morton, Liam R . Howlett, Lorenzo Stoakes,
	David Hildenbrand, Vlastimil Babka, Jann Horn
  Cc: oe-kbuild-all, Linux Memory Management List, linux-kernel,
	Ryan Roberts, Anshuman Khandual, Gavin Shan, Zi Yan,
	Samuel Holland

Hi Samuel,

kernel test robot noticed the following build errors:

[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]

url:    https://github.com/intel-lab-lkp/linux/commits/Samuel-Holland/mm-debug_vm_pgtable-Use-set_pXd-to-write-page-tables/20251211-161254
base:   d358e5254674b70f34c847715ca509e46eb81e6f
patch link:    https://lore.kernel.org/r/20251211081117.1126521-2-samuel.holland%40sifive.com
patch subject: [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() to write page tables
config: powerpc64-randconfig-r064-20251212 (https://download.01.org/0day-ci/archive/20251212/202512121948.74kTIiJi-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251212/202512121948.74kTIiJi-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512121948.74kTIiJi-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/debug_vm_pgtable.c:448:2: error: call to undeclared function 'set_pmd'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     448 |         set_pmd(args->pmdp, __pmd(0));
         |         ^
>> mm/debug_vm_pgtable.c:468:2: error: call to undeclared function 'set_pud'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     468 |         set_pud(args->pudp, __pud(0));
         |         ^
   2 errors generated.


vim +/set_pmd +448 mm/debug_vm_pgtable.c

   433	
   434	#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
   435	static void __init pmd_huge_tests(struct pgtable_debug_args *args)
   436	{
   437		pmd_t pmd;
   438	
   439		if (!arch_vmap_pmd_supported(args->page_prot) ||
   440		    args->fixed_alignment < PMD_SIZE)
   441			return;
   442	
   443		pr_debug("Validating PMD huge\n");
   444		/*
   445		 * X86 defined pmd_set_huge() verifies that the given
   446		 * PMD is not a populated non-leaf entry.
   447		 */
 > 448		set_pmd(args->pmdp, __pmd(0));
   449		WARN_ON(!pmd_set_huge(args->pmdp, __pfn_to_phys(args->fixed_pmd_pfn), args->page_prot));
   450		WARN_ON(!pmd_clear_huge(args->pmdp));
   451		pmd = pmdp_get(args->pmdp);
   452		WARN_ON(!pmd_none(pmd));
   453	}
   454	
   455	static void __init pud_huge_tests(struct pgtable_debug_args *args)
   456	{
   457		pud_t pud;
   458	
   459		if (!arch_vmap_pud_supported(args->page_prot) ||
   460		    args->fixed_alignment < PUD_SIZE)
   461			return;
   462	
   463		pr_debug("Validating PUD huge\n");
   464		/*
   465		 * X86 defined pud_set_huge() verifies that the given
   466		 * PUD is not a populated non-leaf entry.
   467		 */
 > 468		set_pud(args->pudp, __pud(0));
   469		WARN_ON(!pud_set_huge(args->pudp, __pfn_to_phys(args->fixed_pud_pfn), args->page_prot));
   470		WARN_ON(!pud_clear_huge(args->pudp));
   471		pud = pudp_get(args->pudp);
   472		WARN_ON(!pud_none(pud));
   473	}
   474	#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */
   475	static void __init pmd_huge_tests(struct pgtable_debug_args *args) { }
   476	static void __init pud_huge_tests(struct pgtable_debug_args *args) { }
   477	#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */
   478	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-12 12:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11  8:11 [PATCH 0/2] mm: Always use set_pXX() helpers to write page tables Samuel Holland
2025-12-11  8:11 ` [PATCH 1/2] mm/debug_vm_pgtable: Use set_pXd() " Samuel Holland
2025-12-11  9:36   ` Ryan Roberts
2025-12-12  0:48   ` kernel test robot
2025-12-12 12:11   ` kernel test robot
2025-12-11  8:11 ` [PATCH 2/2] mm/madvise: Use set_pte() " Samuel Holland
2025-12-11  9:43   ` Ryan Roberts
2025-12-11 23:40   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).