diff options
| -rw-r--r-- | arch/powerpc/Kconfig | 58 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/highmem.h | 19 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/mmu-44x.h | 17 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/page.h | 13 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/page_32.h | 7 | ||||
| -rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/kernel/head_44x.S | 23 | ||||
| -rw-r--r-- | arch/powerpc/kernel/misc_32.S | 12 | ||||
| -rw-r--r-- | arch/powerpc/mm/pgtable_32.c | 23 | ||||
| -rw-r--r-- | arch/powerpc/platforms/Kconfig.cputype | 2 |
10 files changed, 130 insertions, 48 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f7f5448f863..1af22579e3d 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -405,23 +405,53 @@ config PPC_HAS_HASH_64K | |||
| 405 | depends on PPC64 | 405 | depends on PPC64 |
| 406 | default n | 406 | default n |
| 407 | 407 | ||
| 408 | config PPC_64K_PAGES | 408 | choice |
| 409 | bool "64k page size" | 409 | prompt "Page size" |
| 410 | depends on PPC64 | 410 | default PPC_4K_PAGES |
| 411 | select PPC_HAS_HASH_64K | ||
| 412 | help | 411 | help |
| 413 | This option changes the kernel logical page size to 64k. On machines | 412 | Select the kernel logical page size. Increasing the page size |
| 414 | without processor support for 64k pages, the kernel will simulate | 413 | will reduce software overhead at each page boundary, allow |
| 415 | them by loading each individual 4k page on demand transparently, | 414 | hardware prefetch mechanisms to be more effective, and allow |
| 416 | while on hardware with such support, it will be used to map | 415 | larger dma transfers increasing IO efficiency and reducing |
| 417 | normal application pages. | 416 | overhead. However the utilization of memory will increase. |
| 417 | For example, each cached file will using a multiple of the | ||
| 418 | page size to hold its contents and the difference between the | ||
| 419 | end of file and the end of page is wasted. | ||
| 420 | |||
| 421 | Some dedicated systems, such as software raid serving with | ||
| 422 | accelerated calculations, have shown significant increases. | ||
| 423 | |||
| 424 | If you configure a 64 bit kernel for 64k pages but the | ||
| 425 | processor does not support them, then the kernel will simulate | ||
| 426 | them with 4k pages, loading them on demand, but with the | ||
| 427 | reduced software overhead and larger internal fragmentation. | ||
| 428 | For the 32 bit kernel, a large page option will not be offered | ||
| 429 | unless it is supported by the configured processor. | ||
| 430 | |||
| 431 | If unsure, choose 4K_PAGES. | ||
| 432 | |||
| 433 | config PPC_4K_PAGES | ||
| 434 | bool "4k page size" | ||
| 435 | |||
| 436 | config PPC_16K_PAGES | ||
| 437 | bool "16k page size" if 44x | ||
| 438 | |||
| 439 | config PPC_64K_PAGES | ||
| 440 | bool "64k page size" if 44x || PPC_STD_MMU_64 | ||
| 441 | select PPC_HAS_HASH_64K if PPC_STD_MMU_64 | ||
| 442 | |||
| 443 | endchoice | ||
| 418 | 444 | ||
| 419 | config FORCE_MAX_ZONEORDER | 445 | config FORCE_MAX_ZONEORDER |
| 420 | int "Maximum zone order" | 446 | int "Maximum zone order" |
| 421 | range 9 64 if PPC_64K_PAGES | 447 | range 9 64 if PPC_STD_MMU_64 && PPC_64K_PAGES |
| 422 | default "9" if PPC_64K_PAGES | 448 | default "9" if PPC_STD_MMU_64 && PPC_64K_PAGES |
| 423 | range 13 64 if PPC64 && !PPC_64K_PAGES | 449 | range 13 64 if PPC_STD_MMU_64 && !PPC_64K_PAGES |
| 424 | default "13" if PPC64 && !PPC_64K_PAGES | 450 | default "13" if PPC_STD_MMU_64 && !PPC_64K_PAGES |
| 451 | range 9 64 if PPC_STD_MMU_32 && PPC_16K_PAGES | ||
| 452 | default "9" if PPC_STD_MMU_32 && PPC_16K_PAGES | ||
| 453 | range 7 64 if PPC_STD_MMU_32 && PPC_64K_PAGES | ||
| 454 | default "7" if PPC_STD_MMU_32 && PPC_64K_PAGES | ||
| 425 | range 11 64 | 455 | range 11 64 |
| 426 | default "11" | 456 | default "11" |
| 427 | help | 457 | help |
| @@ -441,7 +471,7 @@ config FORCE_MAX_ZONEORDER | |||
| 441 | 471 | ||
| 442 | config PPC_SUBPAGE_PROT | 472 | config PPC_SUBPAGE_PROT |
| 443 | bool "Support setting protections for 4k subpages" | 473 | bool "Support setting protections for 4k subpages" |
| 444 | depends on PPC_64K_PAGES | 474 | depends on PPC_STD_MMU_64 && PPC_64K_PAGES |
| 445 | help | 475 | help |
| 446 | This option adds support for a system call to allow user programs | 476 | This option adds support for a system call to allow user programs |
| 447 | to set access permissions (read/write, readonly, or no access) | 477 | to set access permissions (read/write, readonly, or no access) |
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h index fd97e501aa6..04e4a620952 100644 --- a/arch/powerpc/include/asm/highmem.h +++ b/arch/powerpc/include/asm/highmem.h | |||
| @@ -38,9 +38,24 @@ extern pte_t *pkmap_page_table; | |||
| 38 | * easily, subsequent pte tables have to be allocated in one physical | 38 | * easily, subsequent pte tables have to be allocated in one physical |
| 39 | * chunk of RAM. | 39 | * chunk of RAM. |
| 40 | */ | 40 | */ |
| 41 | #define LAST_PKMAP (1 << PTE_SHIFT) | 41 | /* |
| 42 | #define LAST_PKMAP_MASK (LAST_PKMAP-1) | 42 | * We use one full pte table with 4K pages. And with 16K/64K pages pte |
| 43 | * table covers enough memory (32MB and 512MB resp.) that both FIXMAP | ||
| 44 | * and PKMAP can be placed in single pte table. We use 1024 pages for | ||
| 45 | * PKMAP in case of 16K/64K pages. | ||
| 46 | */ | ||
| 47 | #ifdef CONFIG_PPC_4K_PAGES | ||
| 48 | #define PKMAP_ORDER PTE_SHIFT | ||
| 49 | #else | ||
| 50 | #define PKMAP_ORDER 10 | ||
| 51 | #endif | ||
| 52 | #define LAST_PKMAP (1 << PKMAP_ORDER) | ||
| 53 | #ifndef CONFIG_PPC_4K_PAGES | ||
| 54 | #define PKMAP_BASE (FIXADDR_START - PAGE_SIZE*(LAST_PKMAP + 1)) | ||
| 55 | #else | ||
| 43 | #define PKMAP_BASE ((FIXADDR_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK) | 56 | #define PKMAP_BASE ((FIXADDR_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK) |
| 57 | #endif | ||
| 58 | #define LAST_PKMAP_MASK (LAST_PKMAP-1) | ||
| 44 | #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) | 59 | #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) |
| 45 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) | 60 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) |
| 46 | 61 | ||
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h index b21af32ac6d..8a97cfb08b7 100644 --- a/arch/powerpc/include/asm/mmu-44x.h +++ b/arch/powerpc/include/asm/mmu-44x.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | * PPC440 support | 4 | * PPC440 support |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <asm/page.h> | ||
| 8 | |||
| 7 | #define PPC44x_MMUCR_TID 0x000000ff | 9 | #define PPC44x_MMUCR_TID 0x000000ff |
| 8 | #define PPC44x_MMUCR_STS 0x00010000 | 10 | #define PPC44x_MMUCR_STS 0x00010000 |
| 9 | 11 | ||
| @@ -74,4 +76,19 @@ typedef struct { | |||
| 74 | /* Size of the TLBs used for pinning in lowmem */ | 76 | /* Size of the TLBs used for pinning in lowmem */ |
| 75 | #define PPC_PIN_SIZE (1 << 28) /* 256M */ | 77 | #define PPC_PIN_SIZE (1 << 28) /* 256M */ |
| 76 | 78 | ||
| 79 | #if (PAGE_SHIFT == 12) | ||
| 80 | #define PPC44x_TLBE_SIZE PPC44x_TLB_4K | ||
| 81 | #elif (PAGE_SHIFT == 14) | ||
| 82 | #define PPC44x_TLBE_SIZE PPC44x_TLB_16K | ||
| 83 | #elif (PAGE_SHIFT == 16) | ||
| 84 | #define PPC44x_TLBE_SIZE PPC44x_TLB_64K | ||
| 85 | #else | ||
| 86 | #error "Unsupported PAGE_SIZE" | ||
| 87 | #endif | ||
| 88 | |||
| 89 | #define PPC44x_PGD_OFF_SHIFT (32 - PGDIR_SHIFT + PGD_T_LOG2) | ||
| 90 | #define PPC44x_PGD_OFF_MASK_BIT (PGDIR_SHIFT - PGD_T_LOG2) | ||
| 91 | #define PPC44x_PTE_ADD_SHIFT (32 - PGDIR_SHIFT + PTE_SHIFT + PTE_T_LOG2) | ||
| 92 | #define PPC44x_PTE_ADD_MASK_BIT (32 - PTE_T_LOG2 - PTE_SHIFT) | ||
| 93 | |||
| 77 | #endif /* _ASM_POWERPC_MMU_44X_H_ */ | 94 | #endif /* _ASM_POWERPC_MMU_44X_H_ */ |
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index c0b8d4a29a9..197d569f5bd 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h | |||
| @@ -19,12 +19,15 @@ | |||
| 19 | #include <asm/kdump.h> | 19 | #include <asm/kdump.h> |
| 20 | 20 | ||
| 21 | /* | 21 | /* |
| 22 | * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software | 22 | * On regular PPC32 page size is 4K (but we support 4K/16K/64K pages |
| 23 | * on PPC44x). For PPC64 we support either 4K or 64K software | ||
| 23 | * page size. When using 64K pages however, whether we are really supporting | 24 | * page size. When using 64K pages however, whether we are really supporting |
| 24 | * 64K pages in HW or not is irrelevant to those definitions. | 25 | * 64K pages in HW or not is irrelevant to those definitions. |
| 25 | */ | 26 | */ |
| 26 | #ifdef CONFIG_PPC_64K_PAGES | 27 | #if defined(CONFIG_PPC_64K_PAGES) |
| 27 | #define PAGE_SHIFT 16 | 28 | #define PAGE_SHIFT 16 |
| 29 | #elif defined(CONFIG_PPC_16K_PAGES) | ||
| 30 | #define PAGE_SHIFT 14 | ||
| 28 | #else | 31 | #else |
| 29 | #define PAGE_SHIFT 12 | 32 | #define PAGE_SHIFT 12 |
| 30 | #endif | 33 | #endif |
| @@ -151,7 +154,7 @@ typedef struct { pte_basic_t pte; } pte_t; | |||
| 151 | /* 64k pages additionally define a bigger "real PTE" type that gathers | 154 | /* 64k pages additionally define a bigger "real PTE" type that gathers |
| 152 | * the "second half" part of the PTE for pseudo 64k pages | 155 | * the "second half" part of the PTE for pseudo 64k pages |
| 153 | */ | 156 | */ |
| 154 | #ifdef CONFIG_PPC_64K_PAGES | 157 | #if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_STD_MMU_64) |
| 155 | typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; | 158 | typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; |
| 156 | #else | 159 | #else |
| 157 | typedef struct { pte_t pte; } real_pte_t; | 160 | typedef struct { pte_t pte; } real_pte_t; |
| @@ -191,10 +194,10 @@ typedef pte_basic_t pte_t; | |||
| 191 | #define pte_val(x) (x) | 194 | #define pte_val(x) (x) |
| 192 | #define __pte(x) (x) | 195 | #define __pte(x) (x) |
| 193 | 196 | ||
| 194 | #ifdef CONFIG_PPC_64K_PAGES | 197 | #if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_STD_MMU_64) |
| 195 | typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; | 198 | typedef struct { pte_t pte; unsigned long hidx; } real_pte_t; |
| 196 | #else | 199 | #else |
| 197 | typedef unsigned long real_pte_t; | 200 | typedef pte_t real_pte_t; |
| 198 | #endif | ||
