public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: x86@kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jan Beulich <jbeulich@novell.com>,
	Stable Kernel <stable@kernel.org>
Subject: [PATCH] x86: set PAE PHYSICAL_MASK_SHIFT to match 64-bit
Date: Thu, 05 Jun 2008 16:21:14 +0100	[thread overview]
Message-ID: <4848046A.5060006@goop.org> (raw)

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 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.

The 46-bit mask used in 64-bit seems pretty arbitrary.  The physical
size could be between 40 and 52 bits.  Setting the mask to 40 bits
would restrict the physical size to 1TB, which is definitely too
small.  Setting it to 52 would be ridiculously large, and runs the
risk that one of the vendors may decide to put flags rather than
physical address in one of the upper reserved bits.

Doing it "properly" would require testing cpuid leaf 0x80000008, but
it would mean that we would lose the ability to make all these
compile-time constants.

So, stick with 46 bits.  It's enough for now.

[ Ingo: This needs a test, but I think it should be fairly low-risk.
   If it checks out OK, it should be slipped to Linus fairly soon,
   since it is a bugfix.  It's probably worth putting into stable
   too. ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Stable Kernel <stable@kernel.org>

diff -r 0eebd30011dc include/asm-x86/page_32.h
--- a/include/asm-x86/page_32.h	Wed Jun 04 10:32:01 2008 +0100
+++ b/include/asm-x86/page_32.h	Thu Jun 05 16:09:53 2008 +0100
@@ -22,7 +22,7 @@
 
 
 #ifdef CONFIG_X86_PAE
-#define __PHYSICAL_MASK_SHIFT	36
+#define __PHYSICAL_MASK_SHIFT	46
 #define __VIRTUAL_MASK_SHIFT	32
 #define PAGETABLE_LEVELS	3
 



             reply	other threads:[~2008-06-05 15:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 15:21 Jeremy Fitzhardinge [this message]
2008-06-05 15:34 ` [PATCH] x86: set PAE PHYSICAL_MASK_SHIFT to match 64-bit Jan Beulich
2008-06-05 15:42   ` Jeremy Fitzhardinge
2008-06-05 16:45     ` H. Peter Anvin
2008-06-05 21:14       ` Jeremy Fitzhardinge
2008-06-07 18:35         ` H. Peter Anvin
2008-06-06  9:21   ` [PATCH UPDATED] x86: set PAE PHYSICAL_MASK_SHIFT to 44 bits Jeremy Fitzhardinge
2008-06-06  9:58     ` Jan Beulich
2008-06-06 13:15     ` Andi Kleen
2008-06-06 13:50       ` Jeremy Fitzhardinge
2008-06-10 10:31     ` Ingo Molnar
2008-06-10 13:06       ` Jeremy Fitzhardinge
2008-06-13  7:24         ` Ingo Molnar
2008-06-06  1:40 ` [PATCH] x86: set PAE PHYSICAL_MASK_SHIFT to match 64-bit Andi Kleen
2008-06-06  7:14   ` Jan Beulich
2008-06-06  7:59   ` Jeremy Fitzhardinge
2008-06-06  8:14     ` Jan Beulich
2008-06-06  8:15       ` Jeremy Fitzhardinge
2008-06-07 18:39         ` H. Peter Anvin
2008-06-06  4:45 ` Arjan van de Ven
2008-06-06  8:08   ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4848046A.5060006@goop.org \
    --to=jeremy@goop.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox