[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210205134927.GL4718@ziepe.ca>
Date: Fri, 5 Feb 2021 09:49:27 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
dan.j.williams@...el.com
Subject: Re: [PATCH 1/2] mm: provide a sane PTE walking API for modules
On Fri, Feb 05, 2021 at 05:32:58AM -0500, Paolo Bonzini wrote:
> Currently, the follow_pfn function is exported for modules but
> follow_pte is not. However, follow_pfn is very easy to misuse,
> because it does not provide protections (so most of its callers
> assume the page is writable!) and because it returns after having
> already unlocked the page table lock.
>
> Provide instead a simplified version of follow_pte that does
> not have the pmdpp and range arguments. The older version
> survives as follow_invalidate_pte() for use by fs/dax.c.
>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> ---
> arch/s390/pci/pci_mmio.c | 2 +-
> fs/dax.c | 5 +++--
> include/linux/mm.h | 6 ++++--
> mm/memory.c | 35 ++++++++++++++++++++++++++++++-----
> 4 files changed, 38 insertions(+), 10 deletions(-)
Looks good to me, thanks
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists