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] [day] [month] [year] [list]
Date:	Sat, 26 May 2012 11:46:53 -0700 (PDT)
From:	Hugh Dickins <hughd@...gle.com>
To:	Alex Shi <alex.shi@...el.com>
cc:	Andi Kleen <ak@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>,
	cl@...ux-foundation.org, Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	mgorman@...e.de, Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-mm@...r.kernel.org
Subject: Re: unnecessary tlb flush in mprotect

On Wed, 23 May 2012, Alex Shi wrote:
> On 05/23/2012 12:37 AM, Andi Kleen wrote:
> > On Tue, May 22, 2012 at 09:08:47AM +0800, Alex Shi wrote:
> >> On 05/21/2012 04:30 PM, Alex Shi wrote:
> >>
> >>> when mprotect just change prots of non-present pages, current mprotect
> >>> still do the tlb flush in check_protection().
> >>> but according to 4.10.2.3 Intel SDM V3A (
> >>> www.intel.com/Assets/ja_JP/PDF/manual/253668.pdf ) at that time, TLB has
> >>> no this lines for this page. So, tlb flush is just waste time. (for cr3
> >>> rewrite, flush all tlb, or invlpg, like a 'nop' in intel cpu)

Yes.

> >>>
> >>> Do we need to add the pte_present similar check here to prevent the
> >>> unnecessary tlb flushing? I mean, are there real case in word, User like
> >>> to change page prots before assign a physical page to it?

We have always simply assumed that mprotecting an entirely empty range
is too uncommon to bother with the slight complication of optimizing it.
Our assumption might be very wrong.

Hugh

> >>>
> >>
> >>
> >> Any comments from linux-mm emailing list?
> > 
> > I would be careful with TLB optimizations if it's not a clear performance
> > wins. A lot of these interactions are tricky and it's very easy to break
> > things in subtle and hard to debug ways.
> > 
> > -Andi
> 
> 
> Sure, functionality is fundamental.
--
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