Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 5222/1: Allow configuring user:kernel split via Kconfig

This patch adds a config option (CONFIG_VMSPLIT_*) to allow choosing
between 3:1, 2:2 and 1:3 user:kernel memory splits.

Tested-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Lennert Buytenhek and committed by
Russell King
8d5796d2 2d4b6c9a

+34 -33
+24
arch/arm/Kconfig
··· 311 311 select PLAT_IOP 312 312 select PCI 313 313 select ARCH_SUPPORTS_MSI 314 + select VMSPLIT_1G 314 315 help 315 316 Support for Intel's IOP13XX (XScale) family of processors. 316 317 ··· 739 738 <http://www.linuxdoc.org/docs.html#howto>. 740 739 741 740 If you don't know what to do here, say N. 741 + 742 + choice 743 + prompt "Memory split" 744 + default VMSPLIT_3G 745 + help 746 + Select the desired split between kernel and user memory. 747 + 748 + If you are not absolutely sure what you are doing, leave this 749 + option alone! 750 + 751 + config VMSPLIT_3G 752 + bool "3G/1G user/kernel split" 753 + config VMSPLIT_2G 754 + bool "2G/2G user/kernel split" 755 + config VMSPLIT_1G 756 + bool "1G/3G user/kernel split" 757 + endchoice 758 + 759 + config PAGE_OFFSET 760 + hex 761 + default 0x40000000 if VMSPLIT_1G 762 + default 0x80000000 if VMSPLIT_2G 763 + default 0xC0000000 742 764 743 765 config NR_CPUS 744 766 int "Maximum number of CPUs (2-32)"
+10 -20
arch/arm/include/asm/memory.h
··· 13 13 #ifndef __ASM_ARM_MEMORY_H 14 14 #define __ASM_ARM_MEMORY_H 15 15 16 + #include <linux/compiler.h> 17 + #include <linux/const.h> 18 + #include <mach/memory.h> 19 + #include <asm/sizes.h> 20 + 16 21 /* 17 22 * Allow for constants defined here to be used from assembly code 18 23 * by prepending the UL suffix only with actual C code compilation. 19 24 */ 20 - #ifndef __ASSEMBLY__ 21 - #define UL(x) (x##UL) 22 - #else 23 - #define UL(x) (x) 24 - #endif 25 - 26 - #include <linux/compiler.h> 27 - #include <mach/memory.h> 28 - #include <asm/sizes.h> 25 + #define UL(x) _AC(x, UL) 29 26 30 27 #ifdef CONFIG_MMU 31 28 32 - #ifndef TASK_SIZE 33 29 /* 30 + * PAGE_OFFSET - the virtual address of the start of the kernel image 34 31 * TASK_SIZE - the maximum size of a user space task. 35 32 * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area 36 33 */ 37 - #define TASK_SIZE UL(0xbf000000) 38 - #define TASK_UNMAPPED_BASE UL(0x40000000) 39 - #endif 34 + #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) 35 + #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) 36 + #define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) 40 37 41 38 /* 42 39 * The maximum size of a 26-bit user space task. 43 40 */ 44 41 #define TASK_SIZE_26 UL(0x04000000) 45 - 46 - /* 47 - * Page offset: 3GB 48 - */ 49 - #ifndef PAGE_OFFSET 50 - #define PAGE_OFFSET UL(0xc0000000) 51 - #endif 52 42 53 43 /* 54 44 * The module space lives between the addresses given by TASK_SIZE
-10
arch/arm/mach-footbridge/include/mach/memory.h
··· 42 42 43 43 #endif 44 44 45 - /* Task size and page offset at 3GB */ 46 - #define TASK_SIZE UL(0xbf000000) 47 - #define PAGE_OFFSET UL(0xc0000000) 48 - 49 45 /* 50 46 * Cache flushing area. 51 47 */ ··· 51 55 * Physical DRAM offset. 52 56 */ 53 57 #define PHYS_OFFSET UL(0x00000000) 54 - 55 - /* 56 - * This decides where the kernel will search for a free chunk of vm 57 - * space during mmap's. 58 - */ 59 - #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) 60 58 61 59 #define FLUSH_BASE_PHYS 0x50000000 62 60
-3
arch/arm/mach-iop13xx/include/mach/memory.h
··· 7 7 * Physical DRAM offset. 8 8 */ 9 9 #define PHYS_OFFSET UL(0x00000000) 10 - #define TASK_SIZE UL(0x3f000000) 11 - #define PAGE_OFFSET UL(0x40000000) 12 - #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) 13 10 14 11 #ifndef __ASSEMBLY__ 15 12