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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180321150819.GC3214@redhat.com>
Date:   Wed, 21 Mar 2018 11:08:19 -0400
From:   Jerome Glisse <jglisse@...hat.com>
To:     John Hubbard <jhubbard@...dia.com>
Cc:     linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org,
        Evgeny Baskakov <ebaskakov@...dia.com>,
        Ralph Campbell <rcampbell@...dia.com>,
        Mark Hairgrove <mhairgrove@...dia.com>
Subject: Re: [PATCH 13/15] mm/hmm: factor out pte and pmd handling to
 simplify hmm_vma_walk_pmd()

On Tue, Mar 20, 2018 at 10:07:29PM -0700, John Hubbard wrote:
> On 03/19/2018 07:00 PM, jglisse@...hat.com wrote:
> > From: Jérôme Glisse <jglisse@...hat.com>
> > 
> > No functional change, just create one function to handle pmd and one
> > to handle pte (hmm_vma_handle_pmd() and hmm_vma_handle_pte()).
> > 
> > Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
> > Cc: Evgeny Baskakov <ebaskakov@...dia.com>
> > Cc: Ralph Campbell <rcampbell@...dia.com>
> > Cc: Mark Hairgrove <mhairgrove@...dia.com>
> > Cc: John Hubbard <jhubbard@...dia.com>
> > ---
> >  mm/hmm.c | 174 +++++++++++++++++++++++++++++++++++++--------------------------
> >  1 file changed, 102 insertions(+), 72 deletions(-)
> > 
> > diff --git a/mm/hmm.c b/mm/hmm.c
> > index 52cdceb35733..dc703e9c3a95 100644
> > --- a/mm/hmm.c
> > +++ b/mm/hmm.c
> > @@ -351,6 +351,99 @@ static int hmm_vma_walk_hole(unsigned long addr,
> >  	return hmm_vma_walk->fault ? -EAGAIN : 0;
> >  }
> >  
> > +static int hmm_vma_handle_pmd(struct mm_walk *walk,
> > +			      unsigned long addr,
> > +			      unsigned long end,
> > +			      uint64_t *pfns,
> 
> Hi Jerome,
> 
> Nice cleanup, it makes it much easier to follow the code now.
> 
> Let's please rename the pfns argument above to "pfn", because in this
> helper (and the _pte helper too), there is only one pfn involved, rather
> than an array of them.

This is only true to handle_pte, for handle_pmd it will go over several
pfn entries. But they will all get fill with same value modulo pfn which
will increase monotically (ie same flag as pmd permissions apply to all
entries).

Note sure s/pfns/pfn for hmm_vma_handle_pte() warrant a respin.

Cheers,
Jérôme

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ