diff options
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/Kconfig | 42 | ||||
-rw-r--r-- | arch/arm64/include/asm/page.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/sysreg.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/thread_info.h | 2 | ||||
-rw-r--r-- | arch/arm64/kvm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm64/mm/proc.S | 4 |
6 files changed, 51 insertions, 6 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 13b51a0c4e7f..854166422c42 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -173,7 +173,8 @@ config PGTABLE_LEVELS | |||
173 | default 2 if ARM64_64K_PAGES && ARM64_VA_BITS_42 | 173 | default 2 if ARM64_64K_PAGES && ARM64_VA_BITS_42 |
174 | default 3 if ARM64_64K_PAGES && ARM64_VA_BITS_48 | 174 | default 3 if ARM64_64K_PAGES && ARM64_VA_BITS_48 |
175 | default 3 if ARM64_4K_PAGES && ARM64_VA_BITS_39 | 175 | default 3 if ARM64_4K_PAGES && ARM64_VA_BITS_39 |
176 | default 4 if ARM64_4K_PAGES && ARM64_VA_BITS_48 | 176 | default 3 if ARM64_16K_PAGES && ARM64_VA_BITS_47 |
177 | default 4 if !ARM64_64K_PAGES && ARM64_VA_BITS_48 | ||
177 | 178 | ||
178 | source "init/Kconfig" | 179 | source "init/Kconfig" |
179 | 180 | ||
@@ -363,6 +364,13 @@ config ARM64_4K_PAGES | |||
363 | help | 364 | help |
364 | This feature enables 4KB pages support. | 365 | This feature enables 4KB pages support. |
365 | 366 | ||
367 | config ARM64_16K_PAGES | ||
368 | bool "16KB" | ||
369 | help | ||
370 | The system will use 16KB pages support. AArch32 emulation | ||
371 | requires applications compiled with 16K (or a multiple of 16K) | ||
372 | aligned segments. | ||
373 | |||
366 | config ARM64_64K_PAGES | 374 | config ARM64_64K_PAGES |
367 | bool "64KB" | 375 | bool "64KB" |
368 | help | 376 | help |
@@ -376,6 +384,7 @@ endchoice | |||
376 | choice | 384 | choice |
377 | prompt "Virtual address space size" | 385 | prompt "Virtual address space size" |
378 | default ARM64_VA_BITS_39 if ARM64_4K_PAGES | 386 | default ARM64_VA_BITS_39 if ARM64_4K_PAGES |
387 | default ARM64_VA_BITS_47 if ARM64_16K_PAGES | ||
379 | default ARM64_VA_BITS_42 if ARM64_64K_PAGES | 388 | default ARM64_VA_BITS_42 if ARM64_64K_PAGES |
380 | help | 389 | help |
381 | Allows choosing one of multiple possible virtual address | 390 | Allows choosing one of multiple possible virtual address |
@@ -390,6 +399,10 @@ config ARM64_VA_BITS_42 | |||
390 | bool "42-bit" | 399 | bool "42-bit" |
391 | depends on ARM64_64K_PAGES | 400 | depends on ARM64_64K_PAGES |
392 | 401 | ||
402 | config ARM64_VA_BITS_47 | ||
403 | bool "47-bit" | ||
404 | depends on ARM64_16K_PAGES | ||
405 | |||
393 | config ARM64_VA_BITS_48 | 406 | config ARM64_VA_BITS_48 |
394 | bool "48-bit" | 407 | bool "48-bit" |
395 | 408 | ||
@@ -399,6 +412,7 @@ config ARM64_VA_BITS | |||
399 | int | 412 | int |
400 | default 39 if ARM64_VA_BITS_39 | 413 | default 39 if ARM64_VA_BITS_39 |
401 | default 42 if ARM64_VA_BITS_42 | 414 | default 42 if ARM64_VA_BITS_42 |
415 | default 47 if ARM64_VA_BITS_47 | ||
402 | default 48 if ARM64_VA_BITS_48 | 416 | default 48 if ARM64_VA_BITS_48 |
403 | 417 | ||
404 | config CPU_BIG_ENDIAN | 418 | config CPU_BIG_ENDIAN |
@@ -466,7 +480,7 @@ config ARCH_WANT_GENERAL_HUGETLB | |||
466 | def_bool y | 480 | def_bool y |
467 | 481 | ||
468 | config ARCH_WANT_HUGE_PMD_SHARE | 482 | config ARCH_WANT_HUGE_PMD_SHARE |
469 | def_bool y if ARM64_4K_PAGES | 483 | def_bool y if ARM64_4K_PAGES || ARM64_16K_PAGES |
470 | 484 | ||
471 | config HAVE_ARCH_TRANSPARENT_HUGEPAGE | 485 | config HAVE_ARCH_TRANSPARENT_HUGEPAGE |
472 | def_bool y | 486 | def_bool y |
@@ -503,7 +517,25 @@ config XEN | |||
503 | config FORCE_MAX_ZONEORDER | 517 | config FORCE_MAX_ZONEORDER |
504 | int | 518 | int |
505 | default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) | 519 | default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) |
520 | default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE) | ||
506 | default "11" | 521 | default "11" |
522 | help | ||
523 | The kernel memory allocator divides physically contiguous memory | ||
524 | blocks into "zones", where each zone is a power of two number of | ||
525 | pages. This option selects the largest power of two that the kernel | ||
526 | keeps in the memory allocator. If you need to allocate very large | ||
527 | blocks of physically contiguous memory, then you may need to | ||
528 | increase this value. | ||
529 | |||
530 | This config option is actually maximum order plus one. For example, | ||
531 | a value of 11 means that the largest free memory block is 2^10 pages. | ||
532 | |||
533 | We make sure that we can allocate upto a HugePage size for each configuration. | ||
534 | Hence we have : | ||
535 | MAX_ORDER = (PMD_SHIFT - PAGE_SHIFT) + 1 => PAGE_SHIFT - 2 | ||
536 | |||
537 | However for 4K, we choose a higher default value, 11 as opposed to 10, giving us | ||
538 | 4M allocations matching the default size used by generic code. | ||
507 | 539 | ||
508 | menuconfig ARMV8_DEPRECATED | 540 | menuconfig ARMV8_DEPRECATED |
509 | bool "Emulate deprecated/obsolete ARMv8 instructions" | 541 | bool "Emulate deprecated/obsolete ARMv8 instructions" |
@@ -689,9 +721,9 @@ config COMPAT | |||
689 | the user helper functions, VFP support and the ptrace interface are | 721 | the user helper functions, VFP support and the ptrace interface are |
690 | handled appropriately by the kernel. | 722 | handled appropriately by the kernel. |
691 | 723 | ||
692 | If you also enabled CONFIG_ARM64_64K_PAGES, please be aware that you | 724 | If you use a page size other than 4KB (i.e, 16KB or 64KB), please be aware |
693 | will only be able to execute AArch32 binaries that were compiled with | 725 | that you will only be able to execute AArch32 binaries that were compiled |
694 | 64k aligned segments. | 726 | with page size aligned segments. |
695 | 727 | ||
696 | If you want to execute 32-bit userspace applications, say Y. | 728 | If you want to execute 32-bit userspace applications, say Y. |
697 | 729 | ||
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h index da3235494ffd..9b2f5a9d019d 100644 --- a/arch/arm64/include/asm/page.h +++ b/arch/arm64/include/asm/page.h | |||
@@ -24,6 +24,9 @@ | |||
24 | #ifdef CONFIG_ARM64_64K_PAGES | 24 | #ifdef CONFIG_ARM64_64K_PAGES |
25 | #define PAGE_SHIFT 16 | 25 | #define PAGE_SHIFT 16 |
26 | #define CONT_SHIFT 5 | 26 | #define CONT_SHIFT 5 |
27 | #elif defined(CONFIG_ARM64_16K_PAGES) | ||
28 | #define PAGE_SHIFT 14 | ||
29 | #define CONT_SHIFT 7 | ||
27 | #else | 30 | #else |
28 | #define PAGE_SHIFT 12 | 31 | #define PAGE_SHIFT 12 |
29 | #define CONT_SHIFT 4 | 32 | #define CONT_SHIFT 4 |
diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index d59cb231a673..4b57e1080538 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h | |||
@@ -59,6 +59,9 @@ | |||
59 | #if defined(CONFIG_ARM64_4K_PAGES) | 59 | #if defined(CONFIG_ARM64_4K_PAGES) |
60 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT | 60 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT |
61 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN4_SUPPORTED | 61 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN4_SUPPORTED |
62 | #elif defined(CONFIG_ARM64_16K_PAGES) | ||
63 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT | ||
64 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN16_SUPPORTED | ||
62 | #elif defined(CONFIG_ARM64_64K_PAGES) | 65 | #elif defined(CONFIG_ARM64_64K_PAGES) |
63 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT | 66 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT |
64 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN64_SUPPORTED | 67 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN64_SUPPORTED |
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 5eac6a2300af..90c7ff233735 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h | |||
@@ -25,6 +25,8 @@ | |||
25 | 25 | ||
26 | #ifdef CONFIG_ARM64_4K_PAGES | 26 | #ifdef CONFIG_ARM64_4K_PAGES |
27 | #define THREAD_SIZE_ORDER 2 | 27 | #define THREAD_SIZE_ORDER 2 |
28 | #elif defined(CONFIG_ARM64_16K_PAGES) | ||
29 | #define THREAD_SIZE_ORDER 0 | ||
28 | #endif | 30 | #endif |
29 | 31 | ||
30 | #define THREAD_SIZE 16384 | 32 | #define THREAD_SIZE 16384 |
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 5c7e920e4861..6a7d5cd772e6 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig | |||
@@ -19,6 +19,7 @@ if VIRTUALIZATION | |||
19 | config KVM | 19 | config KVM |
20 | bool "Kernel-based Virtual Machine (KVM) support" | 20 | bool "Kernel-based Virtual Machine (KVM) support" |
21 | depends on OF | 21 | depends on OF |
22 | depends on !ARM64_16K_PAGES | ||
22 | select MMU_NOTIFIER | 23 | select MMU_NOTIFIER |
23 | select PREEMPT_NOTIFIERS | 24 | select PREEMPT_NOTIFIERS |
24 | select ANON_INODES | 25 | select ANON_INODES |
@@ -33,6 +34,8 @@ config KVM | |||
33 | select HAVE_KVM_IRQFD | 34 | select HAVE_KVM_IRQFD |
34 | ---help--- | 35 | ---help--- |
35 | Support hosting virtualized guest machines. | 36 | Support hosting virtualized guest machines. |
37 | We don't support KVM with 16K page tables yet, due to the multiple | ||
38 | levels of fake page tables. | ||
36 | 39 | ||
37 | If unsure, say N. | 40 | If unsure, say N. |
38 | 41 | ||
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 91cb2eaac256..3a4b8b19978b 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S | |||
@@ -30,7 +30,9 @@ | |||
30 | 30 | ||
31 | #ifdef CONFIG_ARM64_64K_PAGES | 31 | #ifdef CONFIG_ARM64_64K_PAGES |
32 | #define TCR_TG_FLAGS TCR_TG0_64K | TCR_TG1_64K | 32 | #define TCR_TG_FLAGS TCR_TG0_64K | TCR_TG1_64K |
33 | #else | 33 | #elif defined(CONFIG_ARM64_16K_PAGES) |
34 | #define TCR_TG_FLAGS TCR_TG0_16K | TCR_TG1_16K | ||
35 | #else /* CONFIG_ARM64_4K_PAGES */ | ||
34 | #define TCR_TG_FLAGS TCR_TG0_4K | TCR_TG1_4K | 36 | #define TCR_TG_FLAGS TCR_TG0_4K | TCR_TG1_4K |
35 | #endif | 37 | #endif |
36 | 38 | ||