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: <200910142114.12433.thomas.schlichter@web.de>
Date:	Wed, 14 Oct 2009 21:14:12 +0200
From:	Thomas Schlichter <thomas.schlichter@....de>
To:	"Jan Beulich" <JBeulich@...ell.com>
Cc:	"Jeremy Fitzhardinge" <jeremy.fitzhardinge@...rix.com>,
	"Robert Hancock" <hancockrwd@...il.com>,
	"Henrique de Moraes Holschuh" <hmh@....eng.br>,
	"Suresh Siddha" <suresh.b.siddha@...el.com>,
	"Venkatesh Pallipadi" <venkatesh.pallipadi@...el.com>,
	"Tejun Heo" <tj@...nel.org>, x86@...nel.org,
	"Yinghai Lu" <yinghai@...nel.org>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"Arjan van de Ven" <arjan@...ux.intel.com>,
	dri-devel@...ts.sourceforge.net, "Ingo Molnar" <mingo@...hat.com>,
	linux-kernel@...r.kernel.org, jbarnes@...tuousgeek.org,
	"Thomas Hellstrom" <thellstrom@...are.com>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available

Jan Beulich wrote:
> >>> Thomas Schlichter <thomas.schlichter@....de> 13.10.09 23:29 >>>
> >No, at least the comments in mtrr_add and mtrr_check state that it is just
> >required that phys_addr and size are multiple of PAGE_SIZE. And I'm not
> > sure if it is always safe to round these up/down to the next PAGE
> > boundary. If it is not, maybe it is better to fail...
> 
> That function isn't the limiting factor, generic_validate_add_page() is
> what you need to look at (plus the spec on how the MTRR ranges are
> calculated by the CPU from the base/mask register pairs).

Yes, you are right. Sorry for not looking into generic_validate_add_page() 
before. Thank you for showing!

I added a function mtrr_add_unaligned() that tries to create as many MTRR 
entries as necessary, beginning with the biggest regions. It does not check 
the return values of each mtrr_add(), nor does it return the indexes of the 
created MTRR entries. So it seems to be only useful with increment=false. Or 
do you have a better idea?

Kind regards,
  Thomas

View attachment "0001-Add-new-mtrr_add_unaligned-function.patch" of type "text/x-patch" (2619 bytes)

View attachment "0002-Use-MTRR-for-write-combining-mmap-ioremap-if-PAT-is-.patch" of type "text/x-patch" (3276 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ