[patch 5/5] x86: set PAE PHYSICAL_MASK_SHIFT to 44 bits.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, Willy Tarreau <w@...>, Rodrigo Rubira Branco <rbranco@...>, <torvalds@...>, <akpm@...>, <alan@...>, Jeremy Fitzhardinge <jeremy.fitzhardinge@...>, Jan Beulich <jbeulich@...>, Ingo Molnar <mingo@...>
Date: Sunday, June 22, 2008 - 3:01 pm

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Jeremy Fitzhardinge <jeremy@goop.org>

commit ad524d46f36bbc32033bb72ba42958f12bf49b06 upstream

When a 64-bit x86 processor runs in 32-bit PAE mode, a pte can
potentially have the same number of physical address bits as the
64-bit host ("Enhanced Legacy PAE Paging").  This means, in theory,
we could have up to 52 bits of physical address in a pte.

The 32-bit kernel uses a 32-bit unsigned long to represent a pfn.
This means that it can only represent physical addresses up to 32+12=44
bits wide.  Rather than widening pfns everywhere, just set 2^44 as the
Linux x86_32-PAE architectural limit for physical address size.

This is a bugfix for two cases:
1. running a 32-bit PAE kernel on a machine with
  more than 64GB RAM.
2. running a 32-bit PAE Xen guest on a host machine with
  more than 64GB RAM

In both cases, a pte could need to have more than 36 bits of physical,
and masking it to 36-bits will cause fairly severe havoc.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/asm-x86/page_32.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/include/asm-x86/page_32.h
+++ b/include/asm-x86/page_32.h
@@ -14,7 +14,8 @@
 #define __PAGE_OFFSET		_AC(CONFIG_PAGE_OFFSET, UL)
 
 #ifdef CONFIG_X86_PAE
-#define __PHYSICAL_MASK_SHIFT	36
+/* 44=32+12, the limit we can fit into an unsigned long pfn */
+#define __PHYSICAL_MASK_SHIFT	44
 #define __VIRTUAL_MASK_SHIFT	32
 #define PAGETABLE_LEVELS	3
 

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 0/5] 2.6.25-stable review, Greg KH, (Sun Jun 22, 3:01 pm)
Re: [patch 0/5] 2.6.25-stable review, S.Çağlar, (Mon Jun 23, 7:19 am)
Re: [stable] [patch 0/5] 2.6.25-stable review, Greg KH, (Mon Jun 23, 3:30 pm)
[patch 5/5] x86: set PAE PHYSICAL_MASK_SHIFT to 44 bits., , (Sun Jun 22, 3:01 pm)
[patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Greg KH, (Sun Jun 22, 3:01 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Johannes Weiner, (Sun Jun 22, 4:22 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Linus Torvalds, (Sun Jun 22, 4:36 pm)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Ingo Molnar, (Mon Jun 23, 4:09 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Bernhard Walle, (Mon Jun 23, 6:33 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Ingo Molnar, (Mon Jun 23, 6:53 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Bernhard Walle, (Mon Jun 23, 9:21 am)
Re: [patch 4/5] x86: use BOOTMEM_EXCLUSIVE on 32-bit, Adrian Bunk, (Sun Jun 22, 4:36 pm)