aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc64/kernel/smp.c3
-rw-r--r--arch/sparc64/mm/init.c29
-rw-r--r--include/asm-sparc64/pgtable.h1
3 files changed, 29 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index aba0f886b05b..223cc6bd369a 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -122,6 +122,9 @@ void __init smp_callin(void)
122 122
123 __local_per_cpu_offset = __per_cpu_offset(cpuid); 123 __local_per_cpu_offset = __per_cpu_offset(cpuid);
124 124
125 if (tlb_type == hypervisor)
126 sun4v_register_fault_status();
127
125 __flush_tlb_all(); 128 __flush_tlb_all();
126 129
127 smp_setup_percpu_timer(); 130 smp_setup_percpu_timer();
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index e9aac424877f..4c95cf34075b 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -40,6 +40,7 @@
40#include <asm/spitfire.h> 40#include <asm/spitfire.h>
41#include <asm/sections.h> 41#include <asm/sections.h>
42#include <asm/tsb.h> 42#include <asm/tsb.h>
43#include <asm/hypervisor.h>
43 44
44extern void device_scan(void); 45extern void device_scan(void);
45 46
@@ -1083,6 +1084,24 @@ static void __init tsb_phys_patch(void)
1083 } 1084 }
1084} 1085}
1085 1086
1087/* Register this cpu's fault status area with the hypervisor. */
1088void __cpuinit sun4v_register_fault_status(void)
1089{
1090 register unsigned long arg0 asm("%o0");
1091 register unsigned long arg1 asm("%o1");
1092 int cpu = hard_smp_processor_id();
1093 struct trap_per_cpu *tb = &trap_block[cpu];
1094 unsigned long pa;
1095
1096 pa = kern_base + ((unsigned long) tb - KERNBASE);
1097 arg0 = HV_FAST_MMU_FAULT_AREA_CONF;
1098 arg1 = pa;
1099 __asm__ __volatile__("ta %4"
1100 : "=&r" (arg0), "=&r" (arg1)
1101 : "0" (arg0), "1" (arg1),
1102 "i" (HV_FAST_TRAP));
1103}
1104
1086/* paging_init() sets up the page tables */ 1105/* paging_init() sets up the page tables */
1087 1106
1088extern void cheetah_ecache_flush_init(void); 1107extern void cheetah_ecache_flush_init(void);
@@ -1096,12 +1115,17 @@ void __init paging_init(void)
1096 unsigned long end_pfn, pages_avail, shift; 1115 unsigned long end_pfn, pages_avail, shift;
1097 unsigned long real_end, i; 1116 unsigned long real_end, i;
1098 1117
1118 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
1119 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
1120
1099 if (tlb_type == cheetah_plus || 1121 if (tlb_type == cheetah_plus ||
1100 tlb_type == hypervisor) 1122 tlb_type == hypervisor)
1101 tsb_phys_patch(); 1123 tsb_phys_patch();
1102 1124
1103 if (tlb_type == hypervisor) 1125 if (tlb_type == hypervisor) {
1104 sun4v_patch_tlb_handlers(); 1126 sun4v_patch_tlb_handlers();
1127 sun4v_register_fault_status();
1128 }
1105 1129
1106 /* Find available physical memory... */ 1130 /* Find available physical memory... */
1107 read_obp_memory("available", &pavail[0], &pavail_ents); 1131 read_obp_memory("available", &pavail[0], &pavail_ents);
@@ -1112,9 +1136,6 @@ void __init paging_init(void)
1112 1136
1113 pfn_base = phys_base >> PAGE_SHIFT; 1137 pfn_base = phys_base >> PAGE_SHIFT;
1114 1138
1115 kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
1116 kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;
1117
1118 set_bit(0, mmu_context_bmap); 1139 set_bit(0, mmu_context_bmap);
1119 1140
1120 shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE); 1141 shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE);
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 2b2ecd6104d2..c42c06a37d18 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -437,6 +437,7 @@ extern unsigned long get_fb_unmapped_area(struct file *filp, unsigned long,
437#define HAVE_ARCH_FB_UNMAPPED_AREA 437#define HAVE_ARCH_FB_UNMAPPED_AREA
438 438
439extern void pgtable_cache_init(void); 439extern void pgtable_cache_init(void);
440extern void sun4v_register_fault_status(void);
440 441
441#endif /* !(__ASSEMBLY__) */ 442#endif /* !(__ASSEMBLY__) */
442 443