public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* divorce CONFIG_X86_PAE from CONFIG_HIGHMEM64G
@ 2007-06-08  2:35 William Lee Irwin III
  2007-06-08  2:41 ` Andrew Morton
  2007-06-11 23:52 ` Adrian Bunk
  0 siblings, 2 replies; 14+ messages in thread
From: William Lee Irwin III @ 2007-06-08  2:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Lord, Andi Kleen, Andrew Morton

PAE is useful for more than supporting more than 4GB RAM. It supports
expanded swapspace and NX executable protections. Some users may want
NX or expanded swapspace support without the overhead or instability
of highmem. For these reasons, the following patch divorces
CONFIG_X86_PAE from CONFIG_HIGHMEM64G.

vs. 2.6.22-rc4-mm2

Cc: Mark Lord <lkml@rtr.ca>
Cc: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: William Irwin <wli@holomorphy.com>


Index: mm-2.6.22-rc4-2/arch/i386/Kconfig
===================================================================
--- mm-2.6.22-rc4-2.orig/arch/i386/Kconfig	2007-06-07 00:05:53.609599701 -0700
+++ mm-2.6.22-rc4-2/arch/i386/Kconfig	2007-06-07 17:02:24.333262965 -0700
@@ -544,6 +544,7 @@
 config HIGHMEM64G
 	bool "64GB"
 	depends on X86_CMPXCHG64
+	select X86_PAE
 	help
 	  Select this if you have a 32-bit processor and more than 4
 	  gigabytes of physical RAM.
@@ -573,12 +574,12 @@
 	config VMSPLIT_3G
 		bool "3G/1G user/kernel split"
 	config VMSPLIT_3G_OPT
-		depends on !HIGHMEM
+		depends on !X86_PAE
 		bool "3G/1G user/kernel split (for full 1G low memory)"
 	config VMSPLIT_2G
 		bool "2G/2G user/kernel split"
 	config VMSPLIT_2G_OPT
-		depends on !HIGHMEM
+		depends on !X86_PAE
 		bool "2G/2G user/kernel split (for full 2G low memory)"
 	config VMSPLIT_1G
 		bool "1G/3G user/kernel split"
@@ -598,10 +599,15 @@
 	default y
 
 config X86_PAE
-	bool
-	depends on HIGHMEM64G
-	default y
+	bool "PAE (Physical Address Extension) Support"
+	default n
+	depends on !HIGHMEM4G
 	select RESOURCES_64BIT
+	help
+	  PAE is required for NX support, and furthermore enables
+	  larger swapspace support for non-overcommit purposes. It
+	  has the cost of more pagetable lookup overhead, and also
+	  consumes more pagetable space per process.
 
 # Common NUMA Features
 config NUMA
Index: mm-2.6.22-rc4-2/arch/i386/kernel/setup.c
===================================================================
--- mm-2.6.22-rc4-2.orig/arch/i386/kernel/setup.c	2007-06-06 23:52:18.839168580 -0700
+++ mm-2.6.22-rc4-2/arch/i386/kernel/setup.c	2007-06-07 17:02:24.349263876 -0700
@@ -273,18 +273,18 @@
 		printk(KERN_WARNING "Warning only %ldMB will be used.\n",
 					MAXMEM>>20);
 		if (max_pfn > MAX_NONPAE_PFN)
-			printk(KERN_WARNING "Use a PAE enabled kernel.\n");
+			printk(KERN_WARNING "Use a HIGHMEM64G enabled kernel.\n");
 		else
 			printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
 		max_pfn = MAXMEM_PFN;
 #else /* !CONFIG_HIGHMEM */
-#ifndef CONFIG_X86_PAE
+#ifndef CONFIG_HIGHMEM64G
 		if (max_pfn > MAX_NONPAE_PFN) {
 			max_pfn = MAX_NONPAE_PFN;
 			printk(KERN_WARNING "Warning only 4GB will be used.\n");
-			printk(KERN_WARNING "Use a PAE enabled kernel.\n");
+			printk(KERN_WARNING "Use a HIGHMEM64G enabled kernel.\n");
 		}
-#endif /* !CONFIG_X86_PAE */
+#endif /* !CONFIG_HIGHMEM64G */
 #endif /* !CONFIG_HIGHMEM */
 	} else {
 		if (highmem_pages == -1)

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: divorce CONFIG_X86_PAE from CONFIG_HIGHMEM64G
@ 2007-06-08  8:07 Mikael Pettersson
  2007-06-08 14:47 ` William Lee Irwin III
  0 siblings, 1 reply; 14+ messages in thread
From: Mikael Pettersson @ 2007-06-08  8:07 UTC (permalink / raw)
  To: linux-kernel, wli; +Cc: ak, akpm, lkml

On Thu, 7 Jun 2007 19:35:51 -0700, William Lee Irwin III wrote:
> @@ -573,12 +574,12 @@
>  	config VMSPLIT_3G
>  		bool "3G/1G user/kernel split"
>  	config VMSPLIT_3G_OPT
> -		depends on !HIGHMEM
> +		depends on !X86_PAE
>  		bool "3G/1G user/kernel split (for full 1G low memory)"
>  	config VMSPLIT_2G
>  		bool "2G/2G user/kernel split"
>  	config VMSPLIT_2G_OPT
> -		depends on !HIGHMEM
> +		depends on !X86_PAE
>  		bool "2G/2G user/kernel split (for full 2G low memory)"
>  	config VMSPLIT_1G
>  		bool "1G/3G user/kernel split"

Is this really needed? I can see why VMSPLIT_{2,3}G_OPT would
depend on !HIGHMEM, but why would they depend on !X86_PAE?

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: divorce CONFIG_X86_PAE from CONFIG_HIGHMEM64G
@ 2007-06-12  8:37 linux
  0 siblings, 0 replies; 14+ messages in thread
From: linux @ 2007-06-12  8:37 UTC (permalink / raw)
  To: linux-kernel, wli; +Cc: linux

Given that incomprehensible help texts are a bit of a pet peeve of mine
(I just last weekend figured out that you don't need to select an I2C
algorithm driver to have working I2c - I had thought it was a "one from
column A, one from column B" thing), let me take a crack...

	PAE doubles the size of each page table entry, increasing
	kernel memory consumption and slowing page table access.
	However, it enables:
	- Addressing more than 4G of physical RAM (CONFIG_HIGHMEM is
	  also required)
	- Marking pages as readable but not executable using the NX
	  (no-execute) bit, which protects applications from stack
	  overflow attacks.
	- Swap files or partitions larger than 64G each.
	  (Only needed with >4G RAM or very heavy tmpfs use.)

	A kernel compiled with this option cannot boot on a processor
	without PAE support.  Enabling this also disables the
	(expert use only) CONFIG_VMSPLIT_[23]G_OPT options.

Does that seem reasonably user-oriented?

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: divorce CONFIG_X86_PAE from CONFIG_HIGHMEM64G
@ 2007-06-13  7:26 Bodo Eggert
  0 siblings, 0 replies; 14+ messages in thread
From: Bodo Eggert @ 2007-06-13  7:26 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: linux-kernel, Adrian Bunk

Since your (William) patch will change the kconfig files my proposed patch
would change, could you please add those changes? 

I hand-updated the patch below as recommended by the original discussion 
on LKML. It won't aply as-is because of that (and because of your changes).


--- 2.6.21/arch/i386/Kconfig.ori	2007-06-06 13:41:09.000000000 +0200
+++ 2.6.21/arch/i386/Kconfig	2007-06-06 14:07:40.000000000 +0200
@@ -495,8 +495,8 @@ config NOHIGHMEM
 	bool "off"
 	depends on !X86_NUMAQ
 	---help---
-	  Linux can use up to 64 Gigabytes of physical memory on x86 systems.
-	  However, the address space of 32-bit x86 processors is only 4
+	  Linux can use up to 64 Gigabytes of physical address space on x86
+	  systems. However, the address space of 32-bit x86 processors is only 4
 	  Gigabytes large. That means that, if you have a large amount of
 	  physical memory, not all of it can be "permanently mapped" by the
 	  kernel. The physical memory that's not permanently mapped is called
@@ -510,8 +510,15 @@ config NOHIGHMEM
 	  by the kernel to permanently map as much physical memory as
 	  possible.
 
-	  If the machine has between 1 and 4 Gigabytes physical RAM, then
+
+	  If the machine has between 1 and about 3 Gigabytes physical RAM, 
+         then
 	  answer "4GB" here.
+	  
+	  The PCI address space will usually take 512 MB or 1 GB of address
+	  space. This address space is unavailable to RAM, but depending on the
+	  chipset (and BIOS settings), memory overlapping the PCI address space
+	  may be mapped beyond the 4 GB limit and be available using "64GB".
+
 
 	  If more than 4 Gigabytes is used then answer "64GB" here. This
 	  selection turns Intel PAE (Physical Address Extension) mode on.
@@ -520,6 +527,10 @@ config NOHIGHMEM
 	  processors (Pentium Pro and better). NOTE: If you say "64GB" here,
 	  then the kernel will not boot on CPUs that don't support PAE!
 
+	  An additional benefit of the 64GB-Mode is the availability of the
+	  no-execute-pageflag, which can be used to prevent some attacks from
+	  injecting malicious code into applications.
+
 	  The actual amount of total physical memory will either be
 	  auto detected or can be forced by using a kernel command line option
 	  such as "mem=256M". (Try "man bootparam" or see the documentation of
@@ -532,14 +543,14 @@ config HIGHMEM4G
 	bool "4GB"
 	depends on !X86_NUMAQ
 	help
-	  Select this if you have a 32-bit processor and between 1 and 4
+	  Select this if you have a 32-bit processor and between 1 and 3
 	  gigabytes of physical RAM.
 
 config HIGHMEM64G
-	bool "64GB"
+	bool "64GB (enables no-execute memory protection if available)"
 	depends on X86_CMPXCHG64
 	help
-	  Select this if you have a 32-bit processor and more than 4
+	  Select this if you have a 32-bit processor and more than 3
 	  gigabytes of physical RAM.
 
 endchoice
-- 
RAM DISK is not an installation procedure! 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-06-13  7:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-08  2:35 divorce CONFIG_X86_PAE from CONFIG_HIGHMEM64G William Lee Irwin III
2007-06-08  2:41 ` Andrew Morton
2007-06-08  3:06   ` William Lee Irwin III
2007-06-08  3:38     ` H. Peter Anvin
2007-06-08  3:41       ` William Lee Irwin III
2007-06-08  3:44         ` H. Peter Anvin
2007-06-08  3:51           ` William Lee Irwin III
2007-06-11 23:52 ` Adrian Bunk
2007-06-12  0:00   ` William Lee Irwin III
2007-06-12  1:12     ` Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2007-06-08  8:07 Mikael Pettersson
2007-06-08 14:47 ` William Lee Irwin III
2007-06-12  8:37 linux
2007-06-13  7:26 Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox