aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorSteven J. Magnani <steve@digidescorp.com>2010-05-13 11:48:27 -0400
committerMichal Simek <monstr@monstr.eu>2010-08-04 04:22:34 -0400
commitba9c4f88d747836bf35c3eee36aa18d2e164f493 (patch)
treed244c9946b40af1ea21a1b71d3e49efa513bb4b7 /arch/microblaze
parent0d9ec762af297f1ef38114f9498322d994063802 (diff)
microblaze: Allow PAGE_SIZE configuration
Allow developer to configure memory page size at compile time. Larger pages can improve performance on some workloads. Based on PowerPC code. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/Kconfig30
-rw-r--r--arch/microblaze/include/asm/elf.h2
-rw-r--r--arch/microblaze/include/asm/page.h12
-rw-r--r--arch/microblaze/kernel/cpu/mb.c1
-rw-r--r--arch/microblaze/kernel/head.S4
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S12
6 files changed, 50 insertions, 11 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 505a08592423..a51742190c12 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -223,6 +223,36 @@ config TASK_SIZE
223 hex "Size of user task space" if TASK_SIZE_BOOL 223 hex "Size of user task space" if TASK_SIZE_BOOL
224 default "0x80000000" 224 default "0x80000000"
225 225
226choice
227 prompt "Page size"
228 default MICROBLAZE_4K_PAGES
229 depends on ADVANCED_OPTIONS && !MMU
230 help
231 Select the kernel logical page size. Increasing the page size
232 will reduce software overhead at each page boundary, allow
233 hardware prefetch mechanisms to be more effective, and allow
234 larger dma transfers increasing IO efficiency and reducing
235 overhead. However the utilization of memory will increase.
236 For example, each cached file will using a multiple of the
237 page size to hold its contents and the difference between the
238 end of file and the end of page is wasted.
239
240 If unsure, choose 4K_PAGES.
241
242config MICROBLAZE_4K_PAGES
243 bool "4k page size"
244
245config MICROBLAZE_8K_PAGES
246 bool "8k page size"
247
248config MICROBLAZE_16K_PAGES
249 bool "16k page size"
250
251config MICROBLAZE_32K_PAGES
252 bool "32k page size"
253
254endchoice
255
226endmenu 256endmenu
227 257
228source "mm/Kconfig" 258source "mm/Kconfig"
diff --git a/arch/microblaze/include/asm/elf.h b/arch/microblaze/include/asm/elf.h
index 7d4acf2b278e..732caf1be741 100644
--- a/arch/microblaze/include/asm/elf.h
+++ b/arch/microblaze/include/asm/elf.h
@@ -77,7 +77,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
77#define ELF_DATA ELFDATA2MSB 77#define ELF_DATA ELFDATA2MSB
78#endif 78#endif
79 79
80#define ELF_EXEC_PAGESIZE 4096 80#define ELF_EXEC_PAGESIZE PAGE_SIZE
81 81
82 82
83#define ELF_CORE_COPY_REGS(_dest, _regs) \ 83#define ELF_CORE_COPY_REGS(_dest, _regs) \
diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
index 464ff32bee3d..c12c6dfafd9f 100644
--- a/arch/microblaze/include/asm/page.h
+++ b/arch/microblaze/include/asm/page.h
@@ -23,8 +23,16 @@
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25/* PAGE_SHIFT determines the page size */ 25/* PAGE_SHIFT determines the page size */
26#define PAGE_SHIFT (12) 26#if defined(CONFIG_MICROBLAZE_32K_PAGES)
27#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) 27#define PAGE_SHIFT 15
28#elif defined(CONFIG_MICROBLAZE_16K_PAGES)
29#define PAGE_SHIFT 14
30#elif defined(CONFIG_MICROBLAZE_8K_PAGES)
31#define PAGE_SHIFT 13
32#else
33#define PAGE_SHIFT 12
34#endif
35#define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
28#define PAGE_MASK (~(PAGE_SIZE-1)) 36#define PAGE_MASK (~(PAGE_SIZE-1))
29 37
30#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR)) 38#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR))
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
index 4216eb1eaa32..7086e3564281 100644
--- a/arch/microblaze/kernel/cpu/mb.c
+++ b/arch/microblaze/kernel/cpu/mb.c
@@ -126,6 +126,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
126 cpuinfo.pvr_user1, 126 cpuinfo.pvr_user1,
127 cpuinfo.pvr_user2); 127 cpuinfo.pvr_user2);
128 128
129 count += seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE);
129 return 0; 130 return 0;
130} 131}
131 132
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
index 1bf739888260..42434008209e 100644
--- a/arch/microblaze/kernel/head.S
+++ b/arch/microblaze/kernel/head.S
@@ -43,10 +43,10 @@
43.global empty_zero_page 43.global empty_zero_page
44.align 12 44.align 12
45empty_zero_page: 45empty_zero_page:
46 .space 4096 46 .space PAGE_SIZE
47.global swapper_pg_dir 47.global swapper_pg_dir
48swapper_pg_dir: 48swapper_pg_dir:
49 .space 4096 49 .space PAGE_SIZE
50 50
51#endif /* CONFIG_MMU */ 51#endif /* CONFIG_MMU */
52 52
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index db72d7124602..b0de1a6b5513 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -55,7 +55,7 @@ SECTIONS {
55 */ 55 */
56 .sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) { 56 .sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
57 _ssrw = .; 57 _ssrw = .;
58 . = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */ 58 . = ALIGN(PAGE_SIZE); /* page aligned when MMU used */
59 *(.sdata2) 59 *(.sdata2)
60 . = ALIGN(8); 60 . = ALIGN(8);
61 _essrw = .; 61 _essrw = .;
@@ -70,7 +70,7 @@ SECTIONS {
70 /* Reserve some low RAM for r0 based memory references */ 70 /* Reserve some low RAM for r0 based memory references */
71 . = ALIGN(0x4) ; 71 . = ALIGN(0x4) ;
72 r0_ram = . ; 72 r0_ram = . ;
73 . = . + 4096; /* a page should be enough */ 73 . = . + PAGE_SIZE; /* a page should be enough */
74 74
75 /* Under the microblaze ABI, .sdata and .sbss must be contiguous */ 75 /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
76 . = ALIGN(8); 76 . = ALIGN(8);
@@ -120,7 +120,7 @@ SECTIONS {
120 120
121 __init_end_before_initramfs = .; 121 __init_end_before_initramfs = .;
122 122
123 .init.ramfs ALIGN(4096) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { 123 .init.ramfs ALIGN(PAGE_SIZE) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
124 __initramfs_start = .; 124 __initramfs_start = .;
125 *(.init.ramfs) 125 *(.init.ramfs)
126 __initramfs_end = .; 126 __initramfs_end = .;
@@ -132,11 +132,11 @@ SECTIONS {
132 * so that __init_end == __bss_start. This will make image.elf 132 * so that __init_end == __bss_start. This will make image.elf
133 * consistent with the image.bin 133 * consistent with the image.bin
134 */ 134 */
135 /* . = ALIGN(4096); */ 135 /* . = ALIGN(PAGE_SIZE); */
136 } 136 }
137 __init_end = .; 137 __init_end = .;
138 138
139 .bss ALIGN (4096) : AT(ADDR(.bss) - LOAD_OFFSET) { 139 .bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) {
140 /* page aligned when MMU used */ 140 /* page aligned when MMU used */
141 __bss_start = . ; 141 __bss_start = . ;
142 *(.bss*) 142 *(.bss*)
@@ -145,7 +145,7 @@ SECTIONS {
145 __bss_stop = . ; 145 __bss_stop = . ;
146 _ebss = . ; 146 _ebss = . ;
147 } 147 }
148 . = ALIGN(4096); 148 . = ALIGN(PAGE_SIZE);
149 _end = .; 149 _end = .;
150 150
151 DISCARDS 151 DISCARDS