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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Oct 2007 16:20:24 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Dave Hansen <haveblue@...ibm.com>
CC:	Matt Mackall <mpm@...enic.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>,
	David Rientjes <rientjes@...gle.com>,
	Fengguang Wu <wfg@...l.ustc.edu.cn>,
	"ADAM G. LITKE [imap]" <agl@...ibm.com>
Subject: Re: [PATCH 4/11] maps3: introduce a generic page walker

Dave Hansen wrote:
> For now, we should probably document that these functions assume that
> the appropriate locks are held, and that there are no changes being made
> to the pagetables as we walk.
>
> However, I can see that people might want to use these in the future for
> establishing ptes.  Perhaps a special code coming back from the
> ->pte_hole() function could indicate changes were made to the
> pagetables.  I guess we could at least retry part of the loop where the
> hole call was made, like:
>   

Yes.  We already have apply_to_page_range(), which has the side effect
of creating the page range in order to apply a function to it.  It would
be nice to be able to replicate its functionality with this page waker
so we can have just one.

> +int walk_page_range(struct mm_struct *mm,...
> +{
> ...
> +       pgd = pgd_offset(mm, addr);
> +       do {
> +               next = pgd_addr_end(addr, end);
> +               if (pgd_none_or_clear_bad(pgd)) {
> +                       if (walk->pte_hole)
> +                               err = walk->pte_hole(addr, next, private);
> 			if (err == -EAGAIN) { // or whatever we want
> 				pgd--;
> 				err = 0;
> 			}
> +                       if (err)
> +                               break;
> +                       continue;
> +               }
>
> That wouldn't allow changes behind the walker, but it should allow them
> in the range that was walked by the ->pte_hole() function.
>   

Yep.

    J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ