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  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]
Date:	Mon, 10 Nov 2014 17:03:16 +0800
From:	Daniel J Blueman <daniel@...ascale.com>
To:	Borislav Petkov <bp@...en8.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>
CC:	Yinghai Lu <yinghai@...nel.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	Steffen Persvold <sp@...ascale.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH] x86: Drop redundant memory-block sizing code

On 11/06/2014 07:56 PM, Borislav Petkov wrote:
> On Thu, Nov 06, 2014 at 07:10:45PM +0800, Daniel J Blueman wrote:
>> "As the first check for 64GB or larger memory returns a 2GB memory
>> block size in that case, the following check for less than 64GB will
>> always
>
> Right, but why isn't there a simple else? Instead, the >64GB case is
> looking at totalram_pages but the so-called else case is looking at
> max_pfn. Why, what's the difference?
>
> My purely hypothetical suspicion is this thing used to handle some
> special case with memory holes where totalram_pages was still < 64GB but
> max_pfn was above. I'm looking at this memory block size approximation
> downwards which supposedly used to do something at some point, right?
>
> Now, when you remove this, it doesn't do so anymore, potentially
> breaking some machines.
>
> Or is this simply unfortunate coding and totalram_pages and max_pfn are
> equivalent?
>
> Questions over questions... Maybe it is time for some git log
> archeology...

Yes, totalram_pages doesn't count the MMIO hole, whereas max_pfn does.

I've made NumaConnect firmware changes that will guarantee max_pfn is 
always aligned to at least 2GB, so 
bdee237c0343a5d1a6cf72c7ea68e88338b26e08 "x86: mm: Use 2GB memory block 
size on large-memory x86-64 systems" can be dropped and Yinghai's 
approach will give 2GB memory blocks on our systems.

Thanks,
   Daniel
-- 
Daniel J Blueman
Principal Software Engineer, Numascale
--
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