diff options
-rw-r--r-- | arch/sparc64/kernel/entry.S | 12 | ||||
-rw-r--r-- | arch/sparc64/mm/init.c | 29 | ||||
-rw-r--r-- | include/asm-sparc64/hypervisor.h | 4 |
3 files changed, 36 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index c9b0d7af64ae..ea257e828364 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
@@ -2593,3 +2593,15 @@ sun4v_mmustat_info: | |||
2593 | retl | 2593 | retl |
2594 | nop | 2594 | nop |
2595 | .size sun4v_mmustat_info, .-sun4v_mmustat_info | 2595 | .size sun4v_mmustat_info, .-sun4v_mmustat_info |
2596 | |||
2597 | .globl sun4v_mmu_demap_all | ||
2598 | .type sun4v_mmu_demap_all,#function | ||
2599 | sun4v_mmu_demap_all: | ||
2600 | clr %o0 | ||
2601 | clr %o1 | ||
2602 | mov HV_MMU_ALL, %o2 | ||
2603 | mov HV_FAST_MMU_DEMAP_ALL, %o5 | ||
2604 | ta HV_FAST_TRAP | ||
2605 | retl | ||
2606 | nop | ||
2607 | .size sun4v_mmu_demap_all, .-sun4v_mmu_demap_all | ||
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index e18ccf85224f..fbeb55d71e76 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1133,14 +1133,9 @@ static void __init mark_kpte_bitmap(unsigned long start, unsigned long end) | |||
1133 | } | 1133 | } |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static void __init kernel_physical_mapping_init(void) | 1136 | static void __init init_kpte_bitmap(void) |
1137 | { | 1137 | { |
1138 | unsigned long i; | 1138 | unsigned long i; |
1139 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1140 | unsigned long mem_alloced = 0UL; | ||
1141 | #endif | ||
1142 | |||
1143 | read_obp_memory("reg", &pall[0], &pall_ents); | ||
1144 | 1139 | ||
1145 | for (i = 0; i < pall_ents; i++) { | 1140 | for (i = 0; i < pall_ents; i++) { |
1146 | unsigned long phys_start, phys_end; | 1141 | unsigned long phys_start, phys_end; |
@@ -1149,14 +1144,24 @@ static void __init kernel_physical_mapping_init(void) | |||
1149 | phys_end = phys_start + pall[i].reg_size; | 1144 | phys_end = phys_start + pall[i].reg_size; |
1150 | 1145 | ||
1151 | mark_kpte_bitmap(phys_start, phys_end); | 1146 | mark_kpte_bitmap(phys_start, phys_end); |
1147 | } | ||
1148 | } | ||
1152 | 1149 | ||
1150 | static void __init kernel_physical_mapping_init(void) | ||
1151 | { | ||
1153 | #ifdef CONFIG_DEBUG_PAGEALLOC | 1152 | #ifdef CONFIG_DEBUG_PAGEALLOC |
1153 | unsigned long i, mem_alloced = 0UL; | ||
1154 | |||
1155 | for (i = 0; i < pall_ents; i++) { | ||
1156 | unsigned long phys_start, phys_end; | ||
1157 | |||
1158 | phys_start = pall[i].phys_addr; | ||
1159 | phys_end = phys_start + pall[i].reg_size; | ||
1160 | |||
1154 | mem_alloced += kernel_map_range(phys_start, phys_end, | 1161 | mem_alloced += kernel_map_range(phys_start, phys_end, |
1155 | PAGE_KERNEL); | 1162 | PAGE_KERNEL); |
1156 | #endif | ||
1157 | } | 1163 | } |
1158 | 1164 | ||
1159 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1160 | printk("Allocated %ld bytes for kernel page tables.\n", | 1165 | printk("Allocated %ld bytes for kernel page tables.\n", |
1161 | mem_alloced); | 1166 | mem_alloced); |
1162 | 1167 | ||
@@ -1398,6 +1403,10 @@ void __init paging_init(void) | |||
1398 | 1403 | ||
1399 | inherit_prom_mappings(); | 1404 | inherit_prom_mappings(); |
1400 | 1405 | ||
1406 | read_obp_memory("reg", &pall[0], &pall_ents); | ||
1407 | |||
1408 | init_kpte_bitmap(); | ||
1409 | |||
1401 | /* Ok, we can use our TLB miss and window trap handlers safely. */ | 1410 | /* Ok, we can use our TLB miss and window trap handlers safely. */ |
1402 | setup_tba(); | 1411 | setup_tba(); |
1403 | 1412 | ||
@@ -1904,7 +1913,9 @@ void __flush_tlb_all(void) | |||
1904 | "wrpr %0, %1, %%pstate" | 1913 | "wrpr %0, %1, %%pstate" |
1905 | : "=r" (pstate) | 1914 | : "=r" (pstate) |
1906 | : "i" (PSTATE_IE)); | 1915 | : "i" (PSTATE_IE)); |
1907 | if (tlb_type == spitfire) { | 1916 | if (tlb_type == hypervisor) { |
1917 | sun4v_mmu_demap_all(); | ||
1918 | } else if (tlb_type == spitfire) { | ||
1908 | for (i = 0; i < 64; i++) { | 1919 | for (i = 0; i < 64; i++) { |
1909 | /* Spitfire Errata #32 workaround */ | 1920 | /* Spitfire Errata #32 workaround */ |
1910 | /* NOTE: Always runs on spitfire, so no | 1921 | /* NOTE: Always runs on spitfire, so no |
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h index 524d49835dfd..3ad45dff52f8 100644 --- a/include/asm-sparc64/hypervisor.h +++ b/include/asm-sparc64/hypervisor.h | |||
@@ -709,6 +709,10 @@ extern unsigned long sun4v_mmu_tsb_ctx0(unsigned long num_descriptions, | |||
709 | */ | 709 | */ |
710 | #define HV_FAST_MMU_DEMAP_ALL 0x24 | 710 | #define HV_FAST_MMU_DEMAP_ALL 0x24 |
711 | 711 | ||
712 | #ifndef __ASSEMBLY__ | ||
713 | extern void sun4v_mmu_demap_all(void); | ||
714 | #endif | ||
715 | |||
712 | /* mmu_map_perm_addr() | 716 | /* mmu_map_perm_addr() |
713 | * TRAP: HV_FAST_TRAP | 717 | * TRAP: HV_FAST_TRAP |
714 | * FUNCTION: HV_FAST_MMU_MAP_PERM_ADDR | 718 | * FUNCTION: HV_FAST_MMU_MAP_PERM_ADDR |