Re: [PATCH v4 5/8] arch: introduce set_direct_map_valid_noflush()

Mike Rapoport <[email protected]>
Newsgroups gmane.linux.ports.ppc64.devel,gmane.linux.kernel.bpf,gmane.linux.ports.alpha,gmane.linux.kernel.cross-arch,gmane.linux.ports.arm.kernel,gmane.linux.ports.hexagon,gmane.linux.kernel,gmane.linux.ports.mips,gmane.linux.kernel.mm,gmane.linux.kernel.modules,gmane.linux.ports.parisc,gmane.linux.ports.riscv,gmane.linux.ports.sh.devel,gmane.linux.kernel.arc,gmane.linux.uml.devel,gmane.linux.ports.sparc
Message-ID <[email protected]>
Hi Huacai,

On Tue, Oct 08, 2024 at 10:11:25AM +0800, Huacai Chen wrote:
> Hi, Mike,
> 
> On Mon, Oct 7, 2024 at 2:30 PM Mike Rapoport <[email protected]> wrote:
> >
> > From: "Mike Rapoport (Microsoft)" <[email protected]>
> >
> > Add an API that will allow updates of the direct/linear map for a set of
> > physically contiguous pages.
> >
> > It will be used in the following patches.
> >
> > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]>
> > ---
> >  arch/arm64/include/asm/set_memory.h     |  1 +
> >  arch/arm64/mm/pageattr.c                | 10 ++++++++++
> >  arch/loongarch/include/asm/set_memory.h |  1 +
> >  arch/loongarch/mm/pageattr.c            | 21 +++++++++++++++++++++
> >  arch/riscv/include/asm/set_memory.h     |  1 +
> >  arch/riscv/mm/pageattr.c                | 15 +++++++++++++++
> >  arch/s390/include/asm/set_memory.h      |  1 +
> >  arch/s390/mm/pageattr.c                 | 11 +++++++++++
> >  arch/x86/include/asm/set_memory.h       |  1 +
> >  arch/x86/mm/pat/set_memory.c            |  8 ++++++++
> >  include/linux/set_memory.h              |  6 ++++++
> >  11 files changed, 76 insertions(+)
> >
> > diff --git a/arch/loongarch/include/asm/set_memory.h b/arch/loongarch/include/asm/set_memory.h
> > index d70505b6676c..55dfaefd02c8 100644
> > --- a/arch/loongarch/include/asm/set_memory.h
> > +++ b/arch/loongarch/include/asm/set_memory.h
> > @@ -17,5 +17,6 @@ int set_memory_rw(unsigned long addr, int numpages);
> >  bool kernel_page_present(struct page *page);
> >  int set_direct_map_default_noflush(struct page *page);
> >  int set_direct_map_invalid_noflush(struct page *page);
> > +int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid);
> >
> >  #endif /* _ASM_LOONGARCH_SET_MEMORY_H */
> > diff --git a/arch/loongarch/mm/pageattr.c b/arch/loongarch/mm/pageattr.c
> > index ffd8d76021d4..f14b40c968b4 100644
> > --- a/arch/loongarch/mm/pageattr.c
> > +++ b/arch/loongarch/mm/pageattr.c
> > @@ -216,3 +216,24 @@ int set_direct_map_invalid_noflush(struct page *page)
> >
> >         return __set_memory(addr, 1, __pgprot(0), __pgprot(_PAGE_PRESENT | _PAGE_VALID));
> >  }
> > +
> > +int set_direct_map_valid_noflush(struct page *page, unsigned nr, bool valid)
> > +{
> > +       unsigned long addr = (unsigned long)page_address(page);
> > +       pgprot_t set, clear;
> > +
> > +       return __set_memory((unsigned long)page_address(page), nr, set, clear);
> This line should be removed.

Argh, copy/paste is so hard...

Thanks, will do.
 
> Huacai

-- 
Sincerely yours,
Mike.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.