lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 27 Feb 2024 16:15:01 -0800
From: SeongJae Park <sj@...nel.org>
To: Barry Song <21cnbao@...il.com>
Cc: SeongJae Park <sj@...nel.org>,
	akpm@...ux-foundation.org,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Barry Song <v-songbaohua@...o.com>,
	David Hildenbrand <david@...hat.com>,
	Lance Yang <ioworker0@...il.com>,
	Ryan Roberts <ryan.roberts@....com>,
	Yin Fengwei <fengwei.yin@...el.com>
Subject: Re: [PATCH v2] mm: make folio_pte_batch available outside of mm/memory.c

On Wed, 28 Feb 2024 13:10:06 +1300 Barry Song <21cnbao@...il.com> wrote:

> On Wed, Feb 28, 2024 at 10:54 AM SeongJae Park <sj@...nel.org> wrote:
> >
> > On Tue, 27 Feb 2024 23:42:01 +1300 Barry Song <21cnbao@...il.com> wrote:
> >
> > > From: Barry Song <v-songbaohua@...o.com>
> > >
> > > madvise, mprotect and some others might need folio_pte_batch to check if
> > > a range of PTEs are completely mapped to a large folio with contiguous
> > > physical addresses. Let's make it available in mm/internal.h.
> >
> > Hi Barry,
> >
> >
> > I found this patch makes some of my build test that not setting CONFIG_MMU
> > fails with multiple errors including below:
> >
> >     In file included from .../mm/nommu.c:43:
> >     .../mm/internal.h: In function '__pte_batch_clear_ignored':
> >     .../mm/internal.h:98:23: error: implicit declaration of function 'pte_mkclean'; did you mean 'page_mkclean'? [-Werror=implicit-function-declaration]
> >        98 |                 pte = pte_mkclean(pte);
> >           |                       ^~~~~~~~~~~
> >           |                       page_mkclean
> >
> > Enabling CONFIG_MMU made the build success.  I haven't had a time to look into
> > the code yet.  May I ask your opinion?
> 
> i guess it is because we have moved some func from memory.c to
> headfile. and this headfile is included by lots of
> files in mm.  memory.c, for itself, will only be compiled with enabled
> CONFIG_MMU:
> mmu-$(CONFIG_MMU)       := highmem.o memory.o mincore.o \
>                            mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \
>                            msync.o page_vma_mapped.o pagewalk.o \
>                            pgtable-generic.o rmap.o vmalloc.o
> 
> Does the below fix your build?
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index fa9e2f7db506..4e57680b74e1 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -83,6 +83,8 @@ static inline void *folio_raw_mapping(struct folio *folio)
>         return (void *)(mapping & ~PAGE_MAPPING_FLAGS);
>  }
> 
> +#ifdef CONFIG_MMU
> +
>  /* Flags for folio_pte_batch(). */
>  typedef int __bitwise fpb_t;
> 
> @@ -172,6 +174,7 @@ static inline int folio_pte_batch(struct folio
> *folio, unsigned long addr,
> 
>         return min(ptep - start_ptep, max_nr);
>  }
> +#endif /* CONFIG_MMU */
> 
>  void __acct_reclaim_writeback(pg_data_t *pgdat, struct folio *folio,
>                                                 int nr_throttled);

Yes, applying the above diff fixed mine :)


Thanks,
SJ

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ