diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-08 00:51:08 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-20 04:11:55 -0500 |
commit | 481295f982b21b1dbe71cbf41d3a93028fee30d1 (patch) | |
tree | 5b1af84a7f83021698bcf138c8875d7290e65282 /arch/sparc64/mm/init.c | |
parent | 89a5264f065672a882f555228000614a6b2182b7 (diff) |
[SPARC64]: Register per-cpu fault status area with sun4v hypervisor.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 29 |
1 files changed, 25 insertions, 4 deletions
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 | ||
44 | extern void device_scan(void); | 45 | extern 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. */ | ||
1088 | void __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 | ||
1088 | extern void cheetah_ecache_flush_init(void); | 1107 | extern 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); |